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

Runtime CRs should be validated to assure they're correct #229

Open
4 tasks
Tracked by #112
Disper opened this issue May 22, 2024 · 0 comments
Open
4 tasks
Tracked by #112

Runtime CRs should be validated to assure they're correct #229

Disper opened this issue May 22, 2024 · 0 comments

Comments

@Disper
Copy link
Member

Disper commented May 22, 2024

Description

  • Take the ADR that defines the contract

  • Have a test that will identify CRs with invalid values (e.g. shoot.kubernetes.kubeAPIServer.oidcConfig.clientID, and shoot.kubernetes.kubeAPIServer.oidcConfig.issuerURL should not be empty, there should be at least one workers pool)

  • Ensure required fields will be added with default values

    1. KIM will store the default values for some fields in our RuntimeCR (e.g. oidcConfig)
    2. We will have a few fields in the RuntimeCR , which won't be necessarily provided by KEB but have to be filled out with default values by KIM (<< having them in the RuntimeCR included is helpful for later operational actions applied by SRE - they will sometimes have to adjust these values when major cluster-upgrades are applied)
    3. It's KIMs responsibility, to check for each creation/update of a RuntimeCR instance, that missing fields will be added to this CR with their default values (could be done by an webhook executed before KIM starts processing the values etc.)

    Right now, we know two fields, which have to be filled out with default-values by KIM if KEB is not providing them:

    • oidcConfig (<< will be filled out with default Kyma-OIDC provider if nothing else is provided by KEB)
    • additionalOidcConfigs (<< if list is empty, KIM has to add one entry to the list - as soon as the list is not empty, nothing has to be checked by KIM)

AC:

  • Implement CR validation (using JSON schema validation)
  • Support setting of default values for missing fields (these fields cannot be set to be mandatory in the contract as it's allowed for KEB to leave them out, but before the Shoot-spec get created, these values have to be defined in the RuntimeCR).
    • oidcConfig has to be set if KEB is not providing it
    • oidcConfiguration list is not allowed to be empty, if empty one entry has to be added by KIM
@Disper Disper changed the title Validation webkhook should make sure that Runtime CRs are valid Runtime CRs should be validated to assure they're correct Jun 13, 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

No branches or pull requests

1 participant