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

Update CRD to apiextensions/v1 #345

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Niksko
Copy link
Contributor

@Niksko Niksko commented Jul 19, 2021

This updates the Kubernetes CRD and associated tooling to conform to
apiextensions/v1. Closes #344

  • Changes the apiVersion, and shuffles around some fields based on the
    new structure of the v1 API
  • Adds a basic package.json so that you can run the updateSchema.js
    script
  • Adds some addition field stripping in the updateSchema.js script that
    removes fields in accordance with the new requirement that CRDs be
    'structural'.
  • Removes the nullable property from the start nodeAction. Structural
    CRDs cannot have nullable fields.

Outstanding questions:

  • Should we automate the generation of the schema i.e. tie it in to CI?
  • Do we need docs around how to update the schema? It feels like some really simple 'npm install and run node updateSchema.js' type docs would be good. Do they make sense in the CONTRIBUTING.MD file?
  • Is removing the nullable property from the schema a big deal? Is there another way we want to deal with that? We could leave the nullable-ness in the real schema, and just set nullable to false in the k8s schema, but that doesn't feel ideal. All of the tests still pass after removing the nullable property from the schema.

This updates the Kubernetes CRD and associated tooling to conform to
apiextensions/v1.

* Changes the apiVersion, and shuffles around some fields based on the
  new structure of the v1 API
* Adds a basic package.json so that you can run the updateSchema.js
  script
* Adds some addition field stripping in the updateSchema.js script that
  removes fields in accordance with the new requirement that CRDs be
'structural'.
* Removes the nullable property from the start nodeAction. Structural
  CRDs cannot have nullable fields.

Signed-off-by: Nikolas Skoufis <[email protected]>
@@ -19,8 +19,8 @@ function removeKey(obj, keyNames) {
}

function updateCRDFile(crdFilename, jsonSchemaFilename) {
let jsonSchema = yaml.safeLoad(fs.readFileSync(jsonSchemaFilename, 'utf8'));
let crd = yaml.safeLoad(fs.readFileSync(crdFilename, 'utf8'));
let jsonSchema = yaml.load(fs.readFileSync(jsonSchemaFilename, 'utf8'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 but why?

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.

Update CRD to v1
2 participants