Skip to content

Conversation

@kobzonega
Copy link
Contributor

@kobzonega kobzonega commented May 20, 2024

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

In new versions of ydb-operator, the logic of configuration generation for Storage/Database objects has changed - the hosts section is generated by mutationWebhook and then paste into ConfigMap during resource synchronization. In previous versions of the operator, the hosts section was added at the stage of creating the ConfigMap https://github.com/ydb-platform/ydb-kubernetes-operator/blob/0.4.30/internal/resources/database.go#L84.

When user updating the version of the ydb-operator, the mutating/validating webhook is not executed (because they are processed by the k8s api server), and therefore the hosts section for .spec.configuration in the Database is not registered here https://github.com/ydb-platform/ydb-kubernetes-operator/blob/0.5.2/api/v1alpha1/database_webhook.go#L131-L148. Then Database object updates the ConfigMap without generated hosts section https://github.com/ydb-platform/ydb-kubernetes-operator/blob/0.5.2/internal/resources/database.go#L75-L86

Issue Number: YDBOPS-9722

What is the new behavior?

  • add a check for the presence of the hosts section before updating ConfigMap in Database/Storage objects to avoid broken configuration when updating versions of ydb-operator

Other information

@kobzonega kobzonega self-assigned this May 20, 2024
@kobzonega kobzonega merged commit d2881bd into master Jun 14, 2024
@kobzonega kobzonega deleted the YDBOPS-9722 branch June 14, 2024 15:00
kobzonega added a commit to kobzonega/ydb-kubernetes-operator that referenced this pull request Jun 25, 2024
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

Successfully merging this pull request may close these issues.

3 participants