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

Some resources cannot use success/failure conditions at all due to bug in UnsafeGuessKindToResource #9393

Closed
3 tasks done
wreed4 opened this issue Aug 18, 2022 · 4 comments · Fixed by #9396
Closed
3 tasks done

Comments

@wreed4
Copy link
Contributor

wreed4 commented Aug 18, 2022

Checklist

  • Double-checked my configuration.
  • Tested using the latest version.
  • Used the Emissary executor.

Summary

Due to this bug kubernetes/client-go#1082
And the usage of this function here:

pluralGVR, _ := meta.UnsafeGuessKindToResource(gvk)

certain custom resources will get the incorrect plural and fail when using a success/failure condition.

gateway is one such word.

The relevant log from the executor is here

time="2022-08-18T19:55:50.232Z" level=info msg="Resource: kaas-egress-ip/eipgateway.egressips.acquia.io/eipgateway-post-sync-wf-1660852548-7f461cfc5b5e. SelfLink: apis/egressips.acquia.io/v1alpha1/namespaces/kaas-egress-ip/eipgatewaies/eipgateway-post-sync-wf-1660852548-7f461cfc5b5e"
time="2022-08-18T19:55:50.232Z" level=info msg="Waiting for conditions: status.eipAssignments.1.state==ASSIGNED,status.eipAssignments.2.state==ASSIGNED"
time="2022-08-18T19:55:50.240Z" level=info msg="Get eipgatewaies 403"
time="2022-08-18T19:55:50.240Z" level=warning msg="Non-transient error: eipgatewaies.egressips.acquia.io \"eipgateway-post-sync-wf-1660852548-7f461cfc5b5e\" is forbidden: User \"system:serviceaccount:kaas-egress-ip:eip-post-sync-tests\" cannot get resource \"eipgatewaies\" in API group \"egressips.acquia.io\" in the namespace \"kaas-egress-ip\""

Diagnostics

You'll need a CRD to test this, but anything ending in gateway will trigger this bug.


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

@terrytangyuan
Copy link
Member

I don't think there's any better way than UnsafeGuessKindToResource to can do this. This should be a bug in client-go instead.

@wreed4
Copy link
Contributor Author

wreed4 commented Aug 19, 2022

an optional field could be provided to specify the plural explicitly on the resource template as a workaround. That seems like a simple option that would be fairly easy to ignore in future versions if/when this bug gets fixed.

Alternatively, and this might be extreme, the plural is stored on the CRD. That could be looked up and parsed. That feels pretty hacky though.

@wreed4
Copy link
Contributor Author

wreed4 commented Aug 19, 2022

This seems like another reasonable work around

kubernetes/kubernetes#110053 (comment)

@wreed4
Copy link
Contributor Author

wreed4 commented Aug 19, 2022

Threw up a test PR. Seems to work locally. #9396

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

Successfully merging a pull request may close this issue.

3 participants