Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCM-5803 | feat: add vpc ids field to the cloud provider data struct #893

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

oriAdler
Copy link
Contributor

The new field enables filtering VPCs by VPC ids.

The equivalent change in the backend:

type CloudProviderInquiries struct {
	GCP               *GCP         `json:"gcp,omitempty"`
	Region            *CloudRegion `json:"region,omitempty"`
	KeyLocation       *string      `json:"key_location,omitempty"`
	KeyRingName       *string      `json:"key_ring_name,omitempty"`
	AWS               *AWS         `json:"aws,omitempty"`
	Version           *Version     `json:"version,omitempty"`
	AvailabilityZones []string     `json:"availability_zones,omitempty"`
	Subnets           []string     `json:"subnets,omitempty"`
-->	VpcIds            []string     `json:"vpc_ids,omitempty"`
}

The new field enables filtering VPCs by VPC ids.

The equivalent change in the backend:
`type CloudProviderInquiries struct {
	GCP               *GCP         `json:"gcp,omitempty"`
	Region            *CloudRegion `json:"region,omitempty"`
	KeyLocation       *string      `json:"key_location,omitempty"`
	KeyRingName       *string      `json:"key_ring_name,omitempty"`
	AWS               *AWS         `json:"aws,omitempty"`
	Version           *Version     `json:"version,omitempty"`
	AvailabilityZones []string     `json:"availability_zones,omitempty"`
	Subnets           []string     `json:"subnets,omitempty"`
-->	VpcIds            []string     `json:"vpc_ids,omitempty"`
}`
@robpblake
Copy link
Contributor

/lgtm

@gdbranco
Copy link
Collaborator

IMO, this is getting confusing. I think we should strive for a pattern. If we are going to have filters within the body of a post, can we include a filter field that maps to a specific filter for it? Like we have an AWS field which has a region ID inside it as well as we have a region outside within the overall structure

I'd like to propose to have a Filter field and we can slowly deprecate the other fields so we stop simply adding more

@robpblake
Copy link
Contributor

@gdbranco Do you have a quick example of what you have in mind?

@oriAdler
Copy link
Contributor Author

IMO, this is getting confusing. I think we should strive for a pattern. If we are going to have filters within the body of a post, can we include a filter field that maps to a specific filter for it? Like we have an AWS field which has a region ID inside it as well as we have a region outside within the overall structure

I'd like to propose to have a Filter field and we can slowly deprecate the other fields so we stop simply adding more

This is a valid proposal.
As we have already AvailabilityZones and Subnets, I rather not break the consistency and have some fields in the body and the others in the new filters field.
Maybe we can handle that as part of our tech debt, and include all the fields in the new filter struct, then we can at once communicate the changes to the clients, WDYT?

@oriAdler
Copy link
Contributor Author

@gdbranco created this ticket https://issues.redhat.com/browse/OCM-5805, please feel free to add comments and context if needed, thanks.

@gdbranco
Copy link
Collaborator

Only other comment I have is that it is missing the end dot '.' to most fields in this file

@tzvatot
Copy link
Contributor

tzvatot commented Jan 30, 2024

IMO, this is getting confusing. I think we should strive for a pattern. If we are going to have filters within the body of a post, can we include a filter field that maps to a specific filter for it? Like we have an AWS field which has a region ID inside it as well as we have a region outside within the overall structure

I'd like to propose to have a Filter field and we can slowly deprecate the other fields so we stop simply adding more

I like the generic filter option. I do agree with @oriAdler that given the current design, we can't make breaking changes, and it will be very confusing to have subnet ids filtered in the body and the vpc-ids in the filter. Probably best to follow that new ticket as enhancement to the API (probably with a new endpoint).

Copy link
Contributor

@tzvatot tzvatot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tzvatot tzvatot merged commit f5952a1 into openshift-online:main Jan 30, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants