Skip to content

Commit

Permalink
Generate v1 CustomResourceDefinition
Browse files Browse the repository at this point in the history
By generating v1 instead of v1beta1, kubectl explain now works.

preserveUnknownFields is needed for explain to work when upgrading
from CRD v1beta1 to v1 but controller-gen has a bug [1] that causes
it not be included in the generated CRD yaml. Use kustomize to add
it the CRDs.

Keep the webhooks at their prior version until we decide to or must
update them. The new controller-gen defaults to newer version.

[1] - kubernetes-sigs/controller-tools#476
  • Loading branch information
bryanv committed Jan 27, 2021
1 parent 2cb1605 commit 720ec8e
Show file tree
Hide file tree
Showing 40 changed files with 955 additions and 1,239 deletions.
73 changes: 32 additions & 41 deletions config/crd/bases/vmoperator.vmware.com_contentlibraryproviders.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,53 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: contentlibraryproviders.vmoperator.vmware.com
spec:
additionalPrinterColumns:
- JSONPath: .spec.uuid
description: UUID of the vSphere content library
name: Content Library UUID
type: string
group: vmoperator.vmware.com
names:
kind: ContentLibraryProvider
listKind: ContentLibraryProviderList
plural: contentlibraryproviders
singular: contentlibraryprovider
scope: Cluster
subresources: {}
validation:
openAPIV3Schema:
description: ContentLibraryProvider is the Schema for the contentlibraryproviders
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ContentLibraryProviderSpec defines the desired state of ContentLibraryProvider
properties:
uuid:
description: UUID describes the UUID of a vSphere content library. It
is the unique identifier for a vSphere content library.
type: string
type: object
status:
description: ContentLibraryProviderStatus defines the observed state of
ContentLibraryProvider Can include fields indicating when was the last
time VM images were updated from a library
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: UUID of the vSphere content library
jsonPath: .spec.uuid
name: Content Library UUID
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: ContentLibraryProvider is the Schema for the contentlibraryproviders API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ContentLibraryProviderSpec defines the desired state of ContentLibraryProvider
properties:
uuid:
description: UUID describes the UUID of a vSphere content library. It is the unique identifier for a vSphere content library.
type: string
type: object
status:
description: ContentLibraryProviderStatus defines the observed state of ContentLibraryProvider Can include fields indicating when was the last time VM images were updated from a library
type: object
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
Expand Down
78 changes: 36 additions & 42 deletions config/crd/bases/vmoperator.vmware.com_contentsourcebindings.yaml
Original file line number Diff line number Diff line change
@@ -1,63 +1,57 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: contentsourcebindings.vmoperator.vmware.com
spec:
additionalPrinterColumns:
- JSONPath: .contentSourceRef.name
name: ContentSource
type: string
group: vmoperator.vmware.com
names:
kind: ContentSourceBinding
listKind: ContentSourceBindingList
plural: contentsourcebindings
singular: contentsourcebinding
scope: Namespaced
subresources: {}
validation:
openAPIV3Schema:
description: ContentSourceBinding is an object that represents a ContentSource
to Namespace mapping.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
contentSourceRef:
description: ContentSourceRef is a reference to a ContentSource object.
properties:
apiVersion:
description: API version of the referent.
type: string
kind:
description: Kind is the type of resource being referenced.
type: string
name:
description: Name is the name of resource being referenced.
type: string
required:
- name
type: object
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .contentSourceRef.name
name: ContentSource
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: ContentSourceBinding is an object that represents a ContentSource to Namespace mapping.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
contentSourceRef:
description: ContentSourceRef is a reference to a ContentSource object.
properties:
apiVersion:
description: API version of the referent.
type: string
kind:
description: Kind is the type of resource being referenced.
type: string
name:
description: Name is the name of resource being referenced.
type: string
required:
- name
type: object
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
Expand Down
91 changes: 41 additions & 50 deletions config/crd/bases/vmoperator.vmware.com_contentsources.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: contentsources.vmoperator.vmware.com
spec:
Expand All @@ -15,56 +15,47 @@ spec:
plural: contentsources
singular: contentsource
scope: Cluster
validation:
openAPIV3Schema:
description: ContentSource is the Schema for the contentsources API. A ContentSource
represents the desired specification and the observed status of a ContentSource
instance.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ContentSourceSpec defines the desired state of ContentSource
properties:
providerRef:
description: ProviderRef is a reference to a content provider object
that describes a provider.
properties:
apiVersion:
description: API version of the referent.
type: string
kind:
description: Kind is the type of resource being referenced.
type: string
name:
description: Name is the name of resource being referenced.
type: string
namespace:
description: Namespace of the resource being referenced. If empty,
cluster scoped resource is assumed.
type: string
required:
- kind
- name
type: object
type: object
status:
description: ContentSourceStatus defines the observed state of ContentSource
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: ContentSource is the Schema for the contentsources API. A ContentSource represents the desired specification and the observed status of a ContentSource instance.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ContentSourceSpec defines the desired state of ContentSource
properties:
providerRef:
description: ProviderRef is a reference to a content provider object that describes a provider.
properties:
apiVersion:
description: API version of the referent.
type: string
kind:
description: Kind is the type of resource being referenced.
type: string
name:
description: Name is the name of resource being referenced.
type: string
namespace:
description: Namespace of the resource being referenced. If empty, cluster scoped resource is assumed.
type: string
required:
- kind
- name
type: object
type: object
status:
description: ContentSourceStatus defines the observed state of ContentSource
type: object
type: object
served: true
storage: true
status:
Expand Down
Loading

0 comments on commit 720ec8e

Please sign in to comment.