Skip to content

Commit

Permalink
Generate DDPA v2alpha1
Browse files Browse the repository at this point in the history
`operator-sdk create api --group datadoghq --kind DatadogPodAutoscaler --version v2alpha1`
  • Loading branch information
jbartosik committed Jan 13, 2025
1 parent 56ab290 commit 01bed8a
Show file tree
Hide file tree
Showing 10 changed files with 247 additions and 4 deletions.
8 changes: 8 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,12 @@ resources:
kind: DatadogDashboard
path: github.com/DataDog/datadog-operator/api/datadoghq/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: com
group: datadoghq
kind: DatadogPodAutoscaler
path: github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1
version: v2alpha1
version: "3"
53 changes: 53 additions & 0 deletions api/datadoghq/v2alpha1/datadogpodautoscaler_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package v2alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// DatadogPodAutoscalerSpec defines the desired state of DatadogPodAutoscaler
type DatadogPodAutoscalerSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of DatadogPodAutoscaler. Edit datadogpodautoscaler_types.go to remove/update
Foo string `json:"foo,omitempty"`
}

// DatadogPodAutoscalerStatus defines the observed state of DatadogPodAutoscaler
type DatadogPodAutoscalerStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

// DatadogPodAutoscaler is the Schema for the datadogpodautoscalers API
type DatadogPodAutoscaler struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec DatadogPodAutoscalerSpec `json:"spec,omitempty"`
Status DatadogPodAutoscalerStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// DatadogPodAutoscalerList contains a list of DatadogPodAutoscaler
type DatadogPodAutoscalerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []DatadogPodAutoscaler `json:"items"`
}

func init() {
SchemeBuilder.Register(&DatadogPodAutoscaler{}, &DatadogPodAutoscalerList{})
}
89 changes: 89 additions & 0 deletions api/datadoghq/v2alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogpodautoscalers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -617,3 +617,40 @@ spec:
storage: true
subresources:
status: {}
- name: v2alpha1
schema:
openAPIV3Schema:
description: DatadogPodAutoscaler is the Schema for the datadogpodautoscalers 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: DatadogPodAutoscalerSpec defines the desired state of DatadogPodAutoscaler
properties:
foo:
description: Foo is an example field of DatadogPodAutoscaler. Edit datadogpodautoscaler_types.go to remove/update
type: string
type: object
status:
description: DatadogPodAutoscalerStatus defines the observed state of DatadogPodAutoscaler
type: object
type: object
served: true
storage: false
subresources:
status: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"additionalProperties": false,
"description": "DatadogPodAutoscaler is the Schema for the datadogpodautoscalers API",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore 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.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"additionalProperties": false,
"description": "DatadogPodAutoscalerSpec defines the desired state of DatadogPodAutoscaler",
"properties": {
"foo": {
"description": "Foo is an example field of DatadogPodAutoscaler. Edit datadogpodautoscaler_types.go to remove/update",
"type": "string"
}
},
"type": "object"
},
"status": {
"description": "DatadogPodAutoscalerStatus defines the observed state of DatadogPodAutoscaler",
"type": "object"
}
},
"type": "object"
}
1 change: 1 addition & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ resources:
- bases/v1/datadoghq.com_datadogpodautoscalers.yaml
- bases/v1/datadoghq.com_datadogdashboards.yaml
- bases/v1/datadoghq.com_datadoggenericresources.yaml
- bases/datadoghq.com_datadogpodautoscalers.yaml
# +kubebuilder:scaffold:crdkustomizeresource

#patches:
Expand Down
8 changes: 7 additions & 1 deletion config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ resources:
# - metrics_auth_role_binding.yaml
# - metrics_reader_role.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
kind: Kustomization# For each CRD, "Editor" and "Viewer" roles are scaffolded by
# default, aiding admins in cluster management. Those roles are
# not used by the Project itself. You can comment the following lines
# if you do not want those helpers be installed with your Project.
- datadoghq_datadogpodautoscaler_editor_role.yaml
- datadoghq_datadogpodautoscaler_viewer_role.yaml

9 changes: 9 additions & 0 deletions config/samples/datadoghq_v2alpha1_datadogpodautoscaler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: datadoghq.com/v2alpha1
kind: DatadogPodAutoscaler
metadata:
labels:
app.kubernetes.io/name: datadog-operator
app.kubernetes.io/managed-by: kustomize
name: datadogpodautoscaler-sample
spec:
# TODO(user): Add fields here
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/DataDog/datadog-operator

go 1.22
go 1.22.0

toolchain go1.22.7
toolchain go1.23.4

require (
github.com/DataDog/datadog-api-client-go/v2 v2.27.0
Expand Down Expand Up @@ -43,6 +43,7 @@ require (
github.com/DataDog/datadog-agent/pkg/config/model v0.59.0-rc.5
github.com/DataDog/datadog-agent/pkg/config/remote v0.59.0-rc.5
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.59.0-rc.5
github.com/DataDog/datadog-operator/api v0.0.0-20250111171021-a839ab9b13fa
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/prometheus/client_golang v1.19.1
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
Expand Down Expand Up @@ -86,7 +87,6 @@ require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ebitengine/purego v0.6.0-alpha.5 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
Expand Down
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ github.com/DataDog/datadog-api-client-go/v2 v2.27.0 h1:AGZj41frjnjMufQHQbJH2fzmi
github.com/DataDog/datadog-api-client-go/v2 v2.27.0/go.mod h1:QKOu6vscsh87fMY1lHfLEmNSunyXImj8BUaUWJXOehc=
github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU=
github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw=
github.com/DataDog/datadog-operator/api v0.0.0-20250111171021-a839ab9b13fa h1:TKVjHzE/mpQQ8dwcCH06iVoBblDoTzUdNlR8I80nOTA=
github.com/DataDog/datadog-operator/api v0.0.0-20250111171021-a839ab9b13fa/go.mod h1:QG0NosKjpnGlWsa4WRHV1DXoRq8Adc39ahWaITlDfhU=
github.com/DataDog/extendeddaemonset/api v0.0.0-20250108205105-6c4d337b78a1 h1:K9SD6kTk58j3vG99mExuVIFh994JSpPALQRr2MPszXQ=
github.com/DataDog/extendeddaemonset/api v0.0.0-20250108205105-6c4d337b78a1/go.mod h1:CLkfm3awFwTY5aBDm8esFwiocXIoNxY28eK6zZ5u9t0=
github.com/DataDog/go-libddwaf/v3 v3.3.0 h1:jS72fuQpFgJZEdEJDmHJCPAgNTEMZoz1EUvimPUOiJ4=
github.com/DataDog/go-libddwaf/v3 v3.3.0/go.mod h1:Bz/0JkpGf689mzbUjKJeheJINqsyyhM8p9PDuHdK2Ec=
github.com/DataDog/go-sqllexer v0.0.15 h1:rUUu52dP8EQhJLnUw0MIAxZp0BQx2fOTuMztr3vtHUU=
Expand Down Expand Up @@ -170,10 +173,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
Expand Down Expand Up @@ -219,6 +224,7 @@ github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9
github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84=
github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg=
github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw=
github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
Expand Down Expand Up @@ -735,6 +741,7 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0 h1:8WPoOHJcMAtcxTVKM0DYnFweBjxxfNit3Sjo/rf+Hkw=
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0/go.mod h1:mkZpWVLO/ERW5NqlW+w5d8waQKNvMSTUQLJfoI0vlvw=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
Expand Down

0 comments on commit 01bed8a

Please sign in to comment.