-
Notifications
You must be signed in to change notification settings - Fork 209
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
Bug: Misalignment between CRD spec and its status #4604
Comments
We were forced into this situation because the constraints on In Kubernetes, In Azure, the set of characters allowable for We found very early on in this project that there was a compelling case that the To change the name of the property on .spec would be a breaking change impacting all current users. |
Notwithstanding the above, importing an existing Azure resource is a scenario we've already addressed. Our command line tool, asoctl, allows you to import a resource from Azure, emitting a yaml file with the resource presented in ASO format. This functionality can be used three different ways. In order of how much control they give you over the end result, they are:
|
Another approach would be to extend the There are obvious limitations with this approach - ASO is unable to infer configuration for configmaps or secrets, for example, but this may still be useful. |
Would you have any return on experience from other users of ASO about what might be a suitable generic approach? I'd tend to say |
We exposed the import functionality from In the general case, importing a resource can't be automated because there are aspects of the process that are unknowable - such as which secrets should be published or consumed, and so on. This is why we packaged the feature as a command-line tool - For your particular context, with local knowledge you may be able automate things by consuming the We're interested to know more about your specific scenario, if you're willing to share. |
Describe the bug
PrivateDnsZonesARecord has the following definition:
.spec.AzureName
https://github.com/Azure/azure-service-operator/blob/main/v2/api/network/v1api20240601/private_dns_zones_a_record_types_gen.go#L386
but its status reports:
https://github.com/Azure/azure-service-operator/blob/main/v2/api/network/v1api20240601/private_dns_zones_a_record_types_gen.go#L1282
Expected behavior
.spec and .status should have consistent naming
To Reproduce
create a CR having:
apiVersion: network.azure.com/v1api20200601kind: PrivateDnsZonesARecord
`
Additional context
Here's a scenario why we shall take care of this:
1 - A privateDnsZonesARecord already exists in Azure
2 - We create a CR locally on the k8s cluster, with
serviceoperator.azure.com/reconcile-policy: skip
, providing only.spec.owner.armid
and.spec.azureName
3 - K8S will leave an empty
.spec
(as expected) and will reflect the current status of the resource in its.status
field.4 - We want to align content of
.spec
to.status
so that we can let ASO control the remote resource from now onwards, changing the annotation toserviceoperator.azure.com/reconcile-policy: manage
.Having a consistent naming convention between
.spec
and.status
would allow us to convert this pretty easily by reading the CR payload and ingesting this into jq/yq by removing the old.spec
key and renaming.status
into.spec
.Without parsing and post-processing is required and this could be tedious and subjected to future changes.
Do you think this might be considered a valuable use case for other scenarios?
The text was updated successfully, but these errors were encountered: