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

Unknown apiVersionKind secrets-store.csi.x-k8s.io/v1/SecretProviderClass is it registered? - K8S java client #2655

Closed
payalgodhanioracle opened this issue May 9, 2023 · 7 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@payalgodhanioracle
Copy link

Describe the bug
Unknown apiVersionKind secrets-store.csi.x-k8s.io/v1/SecretProviderClass is it registered?

Error Stack

Failed to load resources:
java.io.IOException: Unknown apiVersionKind secrets-store.csi.x-k8s.io/v1/SecretProviderClass is it registered?
at io.kubernetes.client.util.Yaml.modelMapper(Yaml.java:554)
at io.kubernetes.client.util.Yaml.loadAll(Yaml.java:179)
at io.kubernetes.client.util.Yaml.loadAll(Yaml.java:145)

Client Version
e.g. 17.0.2 and 18.0.0

Kubernetes Version
e.g. 1.23.4

Java Version
e.g. Java 8

To Reproduce
Steps to reproduce the behavior:

Expected behavior
Should be able to create the resource - secrets-store.csi.x-k8s.io
This resource can be created with kubectl and helm manually but not with Java K8S client. We see that the fix is already in the master branch. This is the pull request which was merged but there was no java client release post this.

#2620

Could we create a new release from the master branch or have an ETA for the next release ?

@brendandburns
Copy link
Contributor

I don't think that this is the issue that you referenced.

This library only has the built-in resources by default. That resource is a custom resource (CRD) that is dynamically loaded into the cluster. You need to either register your own implementation of that resource using the ModelMapper class or you need to use the generic client as shown here:

https://github.com/kubernetes-client/java/blob/master/examples/examples-release-15/src/main/java/io/kubernetes/client/examples/GenericClientExample.java

There are also instructions here:
https://github.com/kubernetes-client/java/wiki/5.-Generate-Java-CRD-Model

If you want to generate the client models from an OpenAPI specification.

@payalgodhanioracle
Copy link
Author

The SecretProviderClass is registered with the cluster, and we still see the above error and we see that it works fine with kubectl

@brendandburns
Copy link
Contributor

When kubectl talks to custom resources it doesn't use strongly-typed objects, it uses the equivalent of the GenericClient referenced above. You are getting this error because this library doesn't have a strongly-typed object representation for any custom resources whether they are registered with the cluster or not.

As I mentioned above, you need to either generate/write the strongly-typed objects yourself (and register them with the ModelMapper) or you can use the GenericClient without a strongly-typed object.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 20, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 19, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants