Skip to content

Support apiextensions.k8s.io/v1 - #8460

Closed
jimmidyson wants to merge 1 commit into
helm:dev-v2from
jimmidyson:helm-v2-apiextensions-v1
Closed

jimmidyson wants to merge 1 commit into
helm:dev-v2from
jimmidyson:helm-v2-apiextensions-v1

Conversation

@jimmidyson

Copy link
Copy Markdown

What this PR does / why we need it:

Adds apiextensions.k8s.io/v1 support. Fixes #6783.

Special notes for your reviewer:

If applicable:

  • this PR contains documentation
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

@helm-bot helm-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 15, 2020
@jimmidyson
jimmidyson force-pushed the helm-v2-apiextensions-v1 branch from b1104e4 to 504eb40 Compare July 15, 2020 20:56
Comment thread pkg/kube/client.go Resolved
@jimmidyson
jimmidyson force-pushed the helm-v2-apiextensions-v1 branch from 504eb40 to eeaab45 Compare July 16, 2020 17:40
@jimmidyson
jimmidyson requested a review from bacongobbler July 21, 2020 09:03
Comment thread pkg/kube/client.go Outdated
return false, fmt.Errorf("unable to cast CRD to unstructured.Unstructured type: %v", err)
}

conditions, ok, err := unstructured.NestedSlice(crd.UnstructuredContent(), "status", "conditions")

@bacongobbler bacongobbler Jul 30, 2020 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are we casting to an unstructured object, then trying to determine if .status.conditions is part of the object? Why can't we do the same conversion logic as is available in Helm 3?

In other words..

switch value := AsVersioned(info.Object).(type) {
case *apiextv1beta1.CustomResourceDefinition:
    ...
case *apiextv1.CustomResourceDefinition:
    ...
}

There may be other object types that also report their status via the .status.conditions field. As I understand it, converting this object to an unstructured type without checking its means we're no longer checking the object's type, and could potentially trigger wait logic on a non-CRD type (like a Deployment). Effectively this is like a poor man's version of duck typing, but much worse as we cannot guarantee that .status.conditions actually is the correct type we expect.

@bridgetkromhout

Copy link
Copy Markdown
Member

Hi, @jimmidyson - can you take a look at the feedback and revise this PR? We are nearly at the end of the change window for v2, so we really need to get this in in the next few days if at all. Thanks.

@bridgetkromhout bridgetkromhout added the v2.x Issues and Pull Requests related to the major version v2 label Aug 6, 2020
@jimmidyson
jimmidyson force-pushed the helm-v2-apiextensions-v1 branch from eeaab45 to fc89c12 Compare August 6, 2020 17:04
@jimmidyson

Copy link
Copy Markdown
Author

@bridgetkromhout @bacongobbler I'm not going to have time in the next few days to fix this up so unless someone else picks it up, I guess it will have to miss the v2 change window. I'm moving to helm v3 ASAP - which is a good thing :)

@bacongobbler

Copy link
Copy Markdown
Member

We are no longer accepting bug fixes for Helm 2. See https://helm.sh/blog/helm-v2-deprecation-timeline/ for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files. v2.x Issues and Pull Requests related to the major version v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants