openstack-k8s-operators / openstack-operator

Meta Operator for OpenStack
https://openstack-k8s-operators.github.io/openstack-operator/
Apache License 2.0
27 stars 76 forks source link

[OSPRH-10186] Fix OpenStackVersion defaults setup #1072

Closed abays closed 1 week ago

abays commented 2 weeks ago

The OpenStackVersion defaults struct declares availableVersion as a private field. It needs to be public (capitalized) so that it can be accessed outside of the function in which the surrounding struct/object was created.

openshift-ci[bot] commented 2 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, stuggi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openstack-k8s-operators/openstack-operator/blob/main/OWNERS)~~ [abays,stuggi] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
abays commented 2 weeks ago

/cherry-pick 18.0.0-proposed

openshift-cherrypick-robot commented 2 weeks ago

@abays: once the present PR merges, I will cherry-pick it on top of 18.0.0-proposed in a new PR and assign it to you.

In response to [this](https://github.com/openstack-k8s-operators/openstack-operator/pull/1072#issuecomment-2352949342): >/cherry-pick 18.0.0-proposed Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
dprince commented 1 week ago

Going to hold this until I understand more why this is needed only recently. I don't think there is a problem with this, but I'm not sure the user should change the default as that should always get set to availableVersion via an environment variable

openshift-cherrypick-robot commented 1 week ago

@abays: new pull request created: #1077

In response to [this](https://github.com/openstack-k8s-operators/openstack-operator/pull/1072#issuecomment-2352949342): >/cherry-pick 18.0.0-proposed Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
dprince commented 1 week ago

Still not understanding, I uncommented the unit test and it breaks it with the old code

+++ b/apis/core/v1beta1/openstackversionwebhook.go @@ -70,9 +70,9 @@ var webhook.Defaulter = &OpenStackVersion{} // Default implements webhook.Defaulter so a webhook will be registered for the type func (r *OpenStackVersion) Default() { openstackversionlog.Info("default", "name", r.Name)