Closed stuggi closed 5 months ago
Merge Failed.
This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. Warning: Error merging github.com/openstack-k8s-operators/openstack-operator for 838,f3931df8580a711863a7a1d56c3c90d7c26adcb6
/hold
Also run the defaulting when a service is disabled, but a template provided. e.g. in the sample where manila is disabled and a template provided. if we do not calling the defaulting for that we'll hit:
$ oc apply -f core_v1beta1_openstackcontrolplane_network_isolation.yaml
The OpenStackControlPlane "openstack-network-isolation" is invalid: spec.manila.template.dbPurge.age: Invalid value: 0: spec.manila.template.dbPurge.age in body should be greater than or equal to 1
Build failed (check pipeline). Post recheck
(without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.
https://review.rdoproject.org/zuul/buildset/78aaabf6f52a4807a5057b67b13981c0
:heavy_check_mark: openstack-k8s-operators-content-provider SUCCESS in 2h 26m 00s :heavy_check_mark: podified-multinode-edpm-deployment-crc SUCCESS in 1h 12m 22s :heavy_check_mark: cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 16m 37s :x: cifmw-data-plane-adoption-osp-17-to-extracted-crc FAILURE in 2h 11m 02s :heavy_check_mark: openstack-operator-tempest-multinode SUCCESS in 1h 35m 50s
https://github.com/openstack-k8s-operators/data-plane-adoption/pull/486 is needed for the failed adoption job
rebased
This change depends on a change that failed to merge.
Change https://github.com/openstack-k8s-operators/data-plane-adoption/pull/486 is needed.
I understand the logic better now. Thanks. I have couple of nits inline still.
Also one more question. Is it intentional that the template is only validated if the service is enabled? I mean there is a case when the user provides a template but disables the service during create. The validateCreate will not run on the template provided by the user. It is probably OK as nobody will see that template as the controller will not pass it to the service operator. And when the service is enabled later, the validateUpdate will check the template.
right, this is what we have and had for all the previews. need to check if there are issues with the current implemented validations if we change it.
I understand the logic better now. Thanks. I have couple of nits inline still. Also one more question. Is it intentional that the template is only validated if the service is enabled? I mean there is a case when the user provides a template but disables the service during create. The validateCreate will not run on the template provided by the user. It is probably OK as nobody will see that template as the controller will not pass it to the service operator. And when the service is enabled later, the validateUpdate will check the template.
right, this is what we have and had for all the previews. need to check if there are issues with the current implemented validations if we change it.
@gibizer this require changes, especially in the functional tests. I suggest that we'll do that in a follow up
rebased
I understand the logic better now. Thanks. I have couple of nits inline still. Also one more question. Is it intentional that the template is only validated if the service is enabled? I mean there is a case when the user provides a template but disables the service during create. The validateCreate will not run on the template provided by the user. It is probably OK as nobody will see that template as the controller will not pass it to the service operator. And when the service is enabled later, the validateUpdate will check the template.
right, this is what we have and had for all the previews. need to check if there are issues with the current implemented validations if we change it.
@gibizer this require changes, especially in the functional tests. I suggest that we'll do that in a follow up
follow up is OK to me.
+1 from me on this change, I understand that you're going to have a follow up patch. Thanks @gibizer for the multiple reviews on this one, I'm in favor of moving to ptr and adoption would benefit of this change!
[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
Moves template parameter in the service sections to be a ptr to have them omitted in case its not provided. Also only triggers the defaulting for the service in the webhook if the service is enabled or a template provided.
If the service was disabled and gets enabled, at least an empty
template: {}
needs to be passed for correct defaulting to happen.As background, current operator behavior
This examples only show keystone and placement
template: {}
, the section obviously stays as is, as it was already filled before:the created placementapi cr gets partially defaulted, no
passwordSelector
, nodatabaseAccount
:template: {}
the default works properlyoperator behavior with the change
When osctlplane gets created with service disabled and no
template
provided, no template is defaulted and shownwhen enable the service and provide
template: {}
, the defaulting happens properlyAlso the resulting service gets defaulted as expected resulting service:
template: {}
provided, defaults correct:Note: The only remaining scenario which does not result in proper defaulting is when enabling the service without specifying at least a
template: {}
. This will result in the known behavior where the parameters get initialized with their go vars defaultsAnd the resulting services misses details as e.g. empty strings are set:
Depends-on: https://github.com/openstack-k8s-operators/data-plane-adoption/pull/486