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

Env. variable is not updated after user sets an invalid PodTemplateSpec value #252

Open
jsenko opened this issue Jul 24, 2024 · 2 comments
Assignees

Comments

@jsenko
Copy link
Member

jsenko commented Jul 24, 2024

Field spec.deployment.podTemplateSpecPreview in the ApicurioRegistry CR provides users with a powerful way to configure the resulting Apicurio Registry Deployment resource. However, the Operator does not check whether the field is valid. If, for example, user configures a volume mount when the corresponding volume does not exist, this change is rejected when the Operator attempts to apply it to the cluster. This might result in a partial reconcilliation of the Apicurio Registry Deployment resource, or the Operator crashing. In one case, even after the invalid PodTemplateSpec value was corrected, the Operator failed to update value of an env. variable after it has been changed by an user in the spec.configuration.env field.

In case you encounter this issue, and you'll see an error in the Operator logs similar to:

msg="Could not create new resource." resource=apps.Deployment error="Deployment.apps \"example-deployment\" is invalid: [...]"

or

msg="could not submit patch" resource=apps.Deployment error="Deployment.apps \"example-deployment\" is invalid: [...]"

correct the invalid value in the spec.deployment.podTemplateSpecPreview field, and then delete the Deployment resource to allow the Operator to recreate it. This should resolve further issues.

@jsenko jsenko self-assigned this Jul 24, 2024
@pwright
Copy link

pwright commented Jul 25, 2024

@jsenko if i change spec.deployment.podTemplateSpecPreview but also some other value, eg spec.configuration.keycloak.url, is only the pod config affected, or is the whole CR rejected?

@jsenko
Copy link
Member Author

jsenko commented Jul 25, 2024

The CR is not rejected and will be updated, because it's still syntactically valid, but the Operator would not be able to act on the change and update the Deployment. So the change to the keycloak URL field will likely not have any effect (until the recovery steps are done). So in the end there might be partial reconcilliation, where only some of the configuration defined by the CR is translated to the Deployment.

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

No branches or pull requests

2 participants