Skip to content

Commit

Permalink
Generate V1 CRDs for Kube >=1.16 and fix v1beta1 for Kubernetes <= 1.…
Browse files Browse the repository at this point in the history
…15 (#136)

* Generate V1 CRDs for Kube >=1.16 and fix v1beta1 for Kubernetes <= 1.15
  • Loading branch information
vboulineau committed Aug 28, 2020
1 parent 4f2d252 commit 9cded9e
Show file tree
Hide file tree
Showing 8 changed files with 15,364 additions and 85 deletions.
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,22 @@ validate: bin/golangci-lint bin/wwhrd
./bin/golangci-lint run ./...
./hack/verify-license.sh > /dev/null

generate: bin/operator-sdk bin/openapi-gen bin/client-gen bin/informer-gen bin/lister-gen
generate: generate-k8s generate-crds patch-crds

generate-k8s: bin/operator-sdk
./bin/operator-sdk generate k8s

generate-crds: bin/operator-sdk
rm -f ./deploy/crds/*.yaml
./bin/operator-sdk generate crds --crd-version=v1beta1
mv ./deploy/crds/*.yaml ./deploy/crds/v1beta1/
./bin/operator-sdk generate crds --crd-version=v1
mv ./deploy/crds/*.yaml ./deploy/crds/v1/

patch-crds: bin/yq generate-crds
./hack/patch-crds.sh

generate-openapi: bin/openapi-gen bin/client-gen bin/informer-gen bin/lister-gen
./bin/openapi-gen --logtostderr=true -o "" -i ./pkg/apis/datadoghq/v1alpha1 -O zz_generated.openapi -p ./pkg/apis/datadoghq/v1alpha1 -h ./hack/boilerplate.go.txt -r "-"
./hack/generate-groups.sh client,lister,informer \
github.com/DataDog/datadog-operator/pkg/generated github.com/DataDog/datadog-operator/pkg/apis datadoghq:v1alpha1 \
Expand Down
81 changes: 0 additions & 81 deletions deploy/crds/datadoghq.com_datadogagents_crd.yaml

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions deploy/crds/datadoghq.com_datadogmetrics_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ spec:
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
currentValue:
description: Value is the latest value of the metric
type: string
Expand Down
7,672 changes: 7,672 additions & 0 deletions deploy/crds/v1/datadoghq.com_datadogagents_crd.yaml

Large diffs are not rendered by default.

110 changes: 110 additions & 0 deletions deploy/crds/v1/datadoghq.com_datadogmetrics_crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: datadogmetrics.datadoghq.com
spec:
group: datadoghq.com
names:
kind: DatadogMetric
listKind: DatadogMetricList
plural: datadogmetrics
singular: datadogmetric
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=='Active')].status
name: active
type: string
- jsonPath: .status.conditions[?(@.type=='Valid')].status
name: valid
type: string
- jsonPath: .status.currentValue
name: value
type: string
- jsonPath: .status.autoscalerReferences
name: references
type: string
- jsonPath: .status.conditions[?(@.type=='Updated')].lastUpdateTime
name: update time
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: DatadogMetric is the Schema for the datadogmetrics 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: DatadogMetricSpec defines the desired state of DatadogMetric
properties:
externalMetricName:
description: ExternalMetricName is reversed for internal use
type: string
query:
description: Query is the raw datadog query
type: string
type: object
status:
description: DatadogMetricStatus defines the observed state of DatadogMetric
properties:
autoscalerReferences:
description: List of autoscalers currently using this DatadogMetric
type: string
conditions:
description: Conditions Represents the latest available observations
of a DatadogMetric's current state.
items:
description: DatadogMetricCondition describes the state of a DatadogMetric
at a certain point.
properties:
lastTransitionTime:
description: Last time the condition transitioned from one status
to another.
format: date-time
type: string
lastUpdateTime:
description: Last time the condition was updated.
format: date-time
type: string
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of DatadogMetric condition.
type: string
required:
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
currentValue:
description: Value is the latest value of the metric
type: string
required:
- currentValue
type: object
type: object
served: true
storage: true
subresources:
status: {}

0 comments on commit 9cded9e

Please sign in to comment.