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

✨ Add identityRef and cloudName into OpenStackClusterStackReleaseSpec #21

Closed
wants to merge 1 commit into from

Conversation

michal-gubricky
Copy link
Contributor

It is a common pattern in capo

@michal-gubricky michal-gubricky self-assigned this Dec 19, 2023
@cluster-stack-bot cluster-stack-bot bot added size/M Denotes a PR that changes 50-200 lines, ignoring generated files. area/api Changes made in the api directory labels Dec 19, 2023
Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud>
CloudName string `json:"cloudName"`

// IdentityRef is a reference to a identity to be used when reconciling this cluster
IdentityRef OpenStackIdentityReference `json:"identityRef,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

In the CAPO, there is *OpenStackIdentityReference, whats the difference?

Copy link
Contributor Author

@michal-gubricky michal-gubricky Dec 19, 2023

Choose a reason for hiding this comment

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

If I am correct * in go is a pointer to the specified type. I think the primary difference is whether IdentityRef is a pointer or a direct instance of OpenStackIdentityReference. Using a pointer allows the possibility of a null value, while using an actual instance does not.

Copy link
Member

@chess-knight chess-knight Dec 19, 2023

Choose a reason for hiding this comment

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

Thank you, and why you don't use a pointer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think, it is up to us. If we want to have possibility of a null value for this field or not.

Copy link
Member

Choose a reason for hiding this comment

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

I think that it can also speed up code when we work with references so the object doesn't need to be copied


// OpenStackIdentityReference is a reference to an infrastructure
// provider identity to be used to provision cluster resources.
type OpenStackIdentityReference struct {
Copy link
Member

Choose a reason for hiding this comment

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

It is somehow possible to import this type from CAPO?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can check if it is possible

Copy link
Member

Choose a reason for hiding this comment

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

Thank you

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey, I think you can import existing types, but let's do it after kubernetes-sigs/cluster-api-provider-openstack#1797 to reduce dependencies.

Copy link
Member

Choose a reason for hiding this comment

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

The mentioned PR is merged in CAPO v1alpha8

Copy link
Member

Choose a reason for hiding this comment

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

IMO this PR could be closed on behalf of #23.

Once CAPO v1alpha8 is available https://pkg.go.dev/sigs.k8s.io/cluster-api-provider-openstack@v0.9.0/api then the renovate bot will do this job for us and reduce CAPO dependencies.

@michal-gubricky
Copy link
Contributor Author

Closed in favor of #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Changes made in the api directory size/M Denotes a PR that changes 50-200 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants