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

Making ObjectMeta in CloudStackMachineTemplateResource nullable #176

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

maxdrib
Copy link
Contributor

@maxdrib maxdrib commented Oct 12, 2022

Issue #, if available:

Description of changes:
We have a usecase in EKS-A where we serialize a Go object, then apply it to the cluster. When we try to do this with a CloudStackMachineTemplate, the resulting object looks like

apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: CloudStackMachineTemplate
metadata:
  creationTimestamp: null
  name: drib-upgrade-control-plane-template-1665592860423
  namespace: eksa-system
spec:
  template:
    metadata:
      creationTimestamp: null
    spec:
      diskOffering:
        customSizeInGB: 0
        device: ""
        filesystem: ""
        label: ""
        mountPath: ""
      offering:
        name: Large Instance
      sshKey: ""
      template:
        name: rhel-8-kube-v1.21.5-new

and when it gets applied, we observe a validation error from the kube-api server:

unknown object type "nil" in CloudStackMachineTemplate.spec.template.metadata.creationTimestamp; if you choose to ignore these errors, turn validation off with --validate=false

Given that this objectmeta is unused in the CAPC codebase, instead of removing it, I think we should make it nullable for backwards compatibility.

Testing performed:
Generated new CAPC infrastructure-components and created cluster with them. Applied the serialized CloudStackMachineTemplate above and it succeeded without validation errors.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 12, 2022
@netlify
Copy link

netlify bot commented Oct 12, 2022

Deploy Preview for kubernetes-sigs-cluster-api-cloudstack ready!

Name Link
🔨 Latest commit 0accdf5
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-cloudstack/deploys/6346f425843eae0008185a73
😎 Deploy Preview https://deploy-preview-176--kubernetes-sigs-cluster-api-cloudstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 12, 2022
@maxdrib maxdrib requested a review from rejoshed October 12, 2022 17:06
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 12, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maxdrib, rejoshed

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants