Repository navigation
Support apiextensions.k8s.io/v1 - #8460
jimmidyson wants to merge 1 commit into
Conversation
b1104e4 to
504eb40
Compare
504eb40 to
eeaab45
Compare
| return false, fmt.Errorf("unable to cast CRD to unstructured.Unstructured type: %v", err) | ||
| } | ||
|
|
||
| conditions, ok, err := unstructured.NestedSlice(crd.UnstructuredContent(), "status", "conditions") |
There was a problem hiding this comment.
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.
|
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. |
Signed-off-by: Jimmi Dyson <[email protected]>
eeaab45 to
fc89c12
Compare
|
@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 :) |
|
We are no longer accepting bug fixes for Helm 2. See https://helm.sh/blog/helm-v2-deprecation-timeline/ for more details. |
What this PR does / why we need it:
Adds
apiextensions.k8s.io/v1support. Fixes #6783.Special notes for your reviewer:
If applicable: