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

Support for API groups in CustomResourceDefinitions #114

Open
matt-psaltis opened this issue Jan 22, 2020 · 2 comments
Open

Support for API groups in CustomResourceDefinitions #114

matt-psaltis opened this issue Jan 22, 2020 · 2 comments

Comments

@matt-psaltis
Copy link

Thanks for a great library, its been very easy to get up and going and connected to my AKS cluster.

I thought I'd drop a quick issue in to describe a problem I face with the current implementation.
Microsoft provides extensions to their Azure Kubernetes configuration such as the one below.

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: azureidentities.aadpodidentity.k8s.io
spec:
  group: aadpodidentity.k8s.io
  version: v1
  names:
    kind: AzureIdentity
    singular: azureidentity
    plural: azureidentities
  scope: Namespaced

Creating a new AzureIdentity based on the above definition:

apiVersion: "aadpodidentity.k8s.io/v1"
kind: AzureIdentity
metadata:
  name: {{identity-name}}
  namespace: {{namespace}}
spec:
  type: 0
  ResourceID: {{identity-resource-id}}
  ClientID: {{identity-client-id}}

I'm using the DynamicResourceClient and the ApplyYaml call to apply the above configuration however the ApiMetadata loaded into the DynamicResourceClient does not include the group into the apiVersion lookup, instead the version is simply 'v1'. This results in a KubeClientException: Cannot find resource API for kind 'AzureIdentity', apiVersion 'aadpodidentity.k8s.io/v1'.

Its difficult to extend the current implementation as these classes are sealed and members like ApiMetadata cannot be extended to teach it about these types of extensions. Just wanted to provide that feedback as a potential opportunity for further extension points would make this very helpful!

Thanks again.

@tintoy
Copy link
Owner

tintoy commented Jan 23, 2020

Hi! Thanks for the feedback - let me have a think about this and I’ll see what can be done :)

@tintoy
Copy link
Owner

tintoy commented Jan 23, 2020

Ok, I'll have to get an Azure K8s cluster set up to scrape the API metadata so I can see where it's going wrong with interpreting it; I'll try to have a go at doing this over the weekend but if not I should have some time next week to do it.

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

No branches or pull requests

2 participants