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

CRD: remove 'status:' key from generated configs #570

Closed
wants to merge 1 commit into from

Conversation

jeremyvisser
Copy link

The CRDs in this Helm chart all follow the form:

kind: CustomResourceDefinition
metadata:
  # ...
spec:
  # ...
status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []

The problem with the status: key is that it is usually
runtime-populated, for example by a controller.

In the case of a cluster managed by Anthos Config Management, it fails
to apply the Helm-generated Traefik configs with the error:

KNV1045: Configs with "status" specified are not allowed.
To fix, either remove the config or remove the "status" field in the config.
For more information, see https://g.co/cloud/acm-errors#knv1045

If you remove the status: key from the CRDs, this now applies cleanly to an
Anthos-managed cluster.

More

Additional Notes

This does not really affect using helm install, but it does affect a situation where you helm template into a config-managed directory which is then pushed to the cluster using a separate mechanism (e.g. Anthos).

The CRDs in this Helm chart all follow the form:

    kind: CustomResourceDefinition
    metadata:
      # ...
    spec:
      # ...
    status:
      acceptedNames:
        kind: ""
        plural: ""
      conditions: []
      storedVersions: []

The problem with the `status:` key is that it is usually
runtime-populated, for example by a controller.

In the case of a cluster managed by Anthos Config Management, it fails
to apply the Helm-generated Traefik configs with the error:

    KNV1045: Configs with "status" specified are not allowed.
    To fix, either remove the config or remove the "status" field in the config.
    For more information, see https://g.co/cloud/acm-errors#knv1045

If you remove the `status:` key from the CRDs, this now applies cleanly to an
Anthos-managed cluster.
@kevinpollet
Copy link
Member

Hello @jeremyvisser,

Thanks for your contribution,

The CRDs are generated by Traefik, which means that if something is wrong with this generation an issue should be opened in the Traefik project, to avoid diverging CRD definitions.

After digging a bit more on the subject, it seems that the issue is a bug of the controller-gen project (used to generate the CRDs), see kubernetes-sigs/controller-tools#456

According to this, we will decline this pull request.

@kevinpollet kevinpollet added the resolution/declined This doesn't seem right label Mar 11, 2022
@jeremyvisser jeremyvisser deleted the fix-crd-status branch April 8, 2022 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution/declined This doesn't seem right
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants