Skip to content

Commit

Permalink
Update to operator-sdk 0.19.0 (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
vboulineau committed Aug 4, 2020
1 parent 5473309 commit 02a5073
Show file tree
Hide file tree
Showing 593 changed files with 55,018 additions and 9,525 deletions.
49 changes: 48 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ core,"github.com/Azure/go-autorest/tracing",Apache-2.0
core,"github.com/PuerkitoBio/purell",NewBSD
core,"github.com/PuerkitoBio/urlesc",NewBSD
core,"github.com/beorn7/perks/quantile",MIT
core,"github.com/blang/semver",MIT
core,"github.com/cenkalti/backoff",MIT
core,"github.com/cespare/xxhash/v2",MIT
core,"github.com/datadog/extendeddaemonset/pkg/apis/datadoghq/v1alpha1",Apache-2.0
Expand All @@ -34,7 +35,6 @@ core,"github.com/go-openapi/jsonpointer",Apache-2.0
core,"github.com/go-openapi/jsonreference",Apache-2.0
core,"github.com/go-openapi/spec",Apache-2.0
core,"github.com/go-openapi/swag",Apache-2.0
core,"github.com/gobuffalo/envy",MIT
core,"github.com/goccy/go-yaml/ast",MIT
core,"github.com/goccy/go-yaml/lexer",MIT
core,"github.com/goccy/go-yaml/printer",MIT
Expand Down Expand Up @@ -97,11 +97,17 @@ core,"github.com/modern-go/concurrent",Apache-2.0
core,"github.com/modern-go/reflect2",Apache-2.0
core,"github.com/nwaples/rardecode",FreeBSD
core,"github.com/olekukonko/tablewriter",MIT
core,"github.com/onsi/gomega/gstruct/errors",MIT
core,"github.com/onsi/gomega/types",MIT
core,"github.com/operator-framework/operator-registry/pkg/api",Apache-2.0
core,"github.com/operator-framework/operator-registry/pkg/image",Apache-2.0
core,"github.com/operator-framework/operator-registry/pkg/registry",Apache-2.0
core,"github.com/operator-framework/operator-sdk/internal/scaffold",Apache-2.0
core,"github.com/operator-framework/operator-sdk/internal/scaffold/input",Apache-2.0
core,"github.com/operator-framework/operator-sdk/internal/scaffold/internal/deps",Apache-2.0
core,"github.com/operator-framework/operator-sdk/internal/util/fileutil",Apache-2.0
core,"github.com/operator-framework/operator-sdk/internal/util/k8sutil",Apache-2.0
core,"github.com/operator-framework/operator-sdk/internal/util/kubebuilder",Apache-2.0
core,"github.com/operator-framework/operator-sdk/internal/util/projutil",Apache-2.0
core,"github.com/operator-framework/operator-sdk/pkg/k8sutil",Apache-2.0
core,"github.com/operator-framework/operator-sdk/pkg/leader",Apache-2.0
Expand Down Expand Up @@ -159,6 +165,8 @@ core,"golang.org/x/net/http/httpguts",NewBSD
core,"golang.org/x/net/http2",NewBSD
core,"golang.org/x/net/http2/hpack",NewBSD
core,"golang.org/x/net/idna",NewBSD
core,"golang.org/x/net/internal/timeseries",NewBSD
core,"golang.org/x/net/trace",NewBSD
core,"golang.org/x/oauth2",NewBSD
core,"golang.org/x/oauth2/google",NewBSD
core,"golang.org/x/oauth2/internal",NewBSD
Expand Down Expand Up @@ -197,6 +205,43 @@ core,"google.golang.org/appengine/internal/modules",Apache-2.0
core,"google.golang.org/appengine/internal/remote_api",Apache-2.0
core,"google.golang.org/appengine/internal/urlfetch",Apache-2.0
core,"google.golang.org/appengine/urlfetch",Apache-2.0
core,"google.golang.org/genproto/googleapis/rpc/status",Apache-2.0
core,"google.golang.org/grpc",Apache-2.0
core,"google.golang.org/grpc/attributes",Apache-2.0
core,"google.golang.org/grpc/backoff",Apache-2.0
core,"google.golang.org/grpc/balancer",Apache-2.0
core,"google.golang.org/grpc/balancer/base",Apache-2.0
core,"google.golang.org/grpc/balancer/roundrobin",Apache-2.0
core,"google.golang.org/grpc/binarylog/grpc_binarylog_v1",Apache-2.0
core,"google.golang.org/grpc/codes",Apache-2.0
core,"google.golang.org/grpc/connectivity",Apache-2.0
core,"google.golang.org/grpc/credentials",Apache-2.0
core,"google.golang.org/grpc/credentials/internal",Apache-2.0
core,"google.golang.org/grpc/encoding",Apache-2.0
core,"google.golang.org/grpc/encoding/proto",Apache-2.0
core,"google.golang.org/grpc/grpclog",Apache-2.0
core,"google.golang.org/grpc/internal",Apache-2.0
core,"google.golang.org/grpc/internal/backoff",Apache-2.0
core,"google.golang.org/grpc/internal/balancerload",Apache-2.0
core,"google.golang.org/grpc/internal/binarylog",Apache-2.0
core,"google.golang.org/grpc/internal/buffer",Apache-2.0
core,"google.golang.org/grpc/internal/channelz",Apache-2.0
core,"google.golang.org/grpc/internal/envconfig",Apache-2.0
core,"google.golang.org/grpc/internal/grpcrand",Apache-2.0
core,"google.golang.org/grpc/internal/grpcsync",Apache-2.0
core,"google.golang.org/grpc/internal/resolver/dns",Apache-2.0
core,"google.golang.org/grpc/internal/resolver/passthrough",Apache-2.0
core,"google.golang.org/grpc/internal/syscall",Apache-2.0
core,"google.golang.org/grpc/internal/transport",Apache-2.0
core,"google.golang.org/grpc/keepalive",Apache-2.0
core,"google.golang.org/grpc/metadata",Apache-2.0
core,"google.golang.org/grpc/naming",Apache-2.0
core,"google.golang.org/grpc/peer",Apache-2.0
core,"google.golang.org/grpc/resolver",Apache-2.0
core,"google.golang.org/grpc/serviceconfig",Apache-2.0
core,"google.golang.org/grpc/stats",Apache-2.0
core,"google.golang.org/grpc/status",Apache-2.0
core,"google.golang.org/grpc/tap",Apache-2.0
core,"gopkg.in/fsnotify.v1",NewBSD
core,"gopkg.in/inf.v0",NewBSD
core,"gopkg.in/op/go-logging.v1",NewBSD
Expand Down Expand Up @@ -477,6 +522,7 @@ core,"sigs.k8s.io/controller-runtime/pkg/webhook",Apache-2.0
core,"sigs.k8s.io/controller-runtime/pkg/webhook/admission",Apache-2.0
core,"sigs.k8s.io/controller-runtime/pkg/webhook/internal/certwatcher",Apache-2.0
core,"sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics",Apache-2.0
core,"sigs.k8s.io/kubebuilder/pkg/model/config",Apache-2.0
core,"sigs.k8s.io/kustomize/pkg/commands/build",Apache-2.0
core,"sigs.k8s.io/kustomize/pkg/constants",Apache-2.0
core,"sigs.k8s.io/kustomize/pkg/expansion",Apache-2.0
Expand All @@ -499,4 +545,5 @@ core,"sigs.k8s.io/kustomize/pkg/transformers",Apache-2.0
core,"sigs.k8s.io/kustomize/pkg/transformers/config",Apache-2.0
core,"sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig",Apache-2.0
core,"sigs.k8s.io/kustomize/pkg/types",Apache-2.0
core,"sigs.k8s.io/structured-merge-diff/v3/value",Apache-2.0
core,"sigs.k8s.io/yaml",MIT
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ validate: bin/golangci-lint bin/wwhrd

generate: bin/operator-sdk bin/openapi-gen bin/client-gen bin/informer-gen bin/lister-gen
./bin/operator-sdk generate k8s
./bin/operator-sdk generate crds
./bin/operator-sdk generate crds --crd-version=v1beta1
./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 \
--go-header-file ./hack/boilerplate.go.txt

generate-olm: bin/operator-sdk
./bin/operator-sdk olm-catalog gen-csv --csv-version $(VERSION) --update-crds
./bin/operator-sdk generate packagemanifests --version $(VERSION) --update-crds --interactive=false

pre-release: bin/yq
./hack/pre-release.sh $(VERSION)
Expand Down
2 changes: 1 addition & 1 deletion chart/datadog-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
args:
- --zap-level={{ .Values.logLevel }}
- --zap-encoder=console
# - --zap-stacktrace-level=error // TODO: uncomment after releasing v0.3.0
# - --zap-stacktrace-level=panic // TODO: uncomment after releasing v0.3.0
- "--supportExtendedDaemonset={{ .Values.supportExtendedDaemonset}}"
- "--probesPort={{ .Values.probesPort }}"
- "--metricsPort={{ .Values.metricsPort }}"
Expand Down
5 changes: 3 additions & 2 deletions cmd/kubectl-datadog/agent/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package check

import (
"bytes"
"context"
"encoding/json"
"fmt"
"sync"
Expand Down Expand Up @@ -254,7 +255,7 @@ func (o *options) execInPod(pod *corev1.Pod, cmd []string, container string) (st

// getPodsByOptions returns a list of the pods by ListOptions
func (o *options) getPodsByOptions(opts metav1.ListOptions) ([]corev1.Pod, error) {
podList, err := o.Clientset.CoreV1().Pods(o.UserNamespace).List(opts)
podList, err := o.Clientset.CoreV1().Pods(o.UserNamespace).List(context.TODO(), opts)
if err != nil {
return []corev1.Pod{}, err
}
Expand All @@ -263,7 +264,7 @@ func (o *options) getPodsByOptions(opts metav1.ListOptions) ([]corev1.Pod, error

// getPodByName returns a pod by name
func (o *options) getPodByName(name string) (corev1.Pod, error) {
pod, err := o.Clientset.CoreV1().Pods(o.UserNamespace).Get(name, metav1.GetOptions{})
pod, err := o.Clientset.CoreV1().Pods(o.UserNamespace).Get(context.TODO(), name, metav1.GetOptions{})
if err != nil {
return corev1.Pod{}, err
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/kubectl-datadog/agent/find/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package find

import (
"context"
"errors"
"fmt"

Expand Down Expand Up @@ -87,7 +88,7 @@ func (o *options) validate() error {

// run runs the find command
func (o *options) run(cmd *cobra.Command) error {
pod, err := o.Clientset.CoreV1().Pods(o.UserNamespace).Get(o.podName, metav1.GetOptions{})
pod, err := o.Clientset.CoreV1().Pods(o.UserNamespace).Get(context.TODO(), o.podName, metav1.GetOptions{})
if err != nil {
return err
}
Expand All @@ -101,7 +102,7 @@ func (o *options) run(cmd *cobra.Command) error {

// getAgentByNode returns the pod of the datadog agent running on a given node
func (o *options) getAgentByNode(nodeName string) (string, error) {
podList, err := o.Clientset.CoreV1().Pods("").List(metav1.ListOptions{
podList, err := o.Clientset.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{
FieldSelector: fmt.Sprintf("spec.nodeName=%s", nodeName),
LabelSelector: common.AgentLabel,
})
Expand Down
12 changes: 6 additions & 6 deletions cmd/kubectl-datadog/flare/flare.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (o *options) createLogFiles(dir string, cmd *cobra.Command) error {
podOpts := metav1.ListOptions{
LabelSelector: "app.kubernetes.io/name=datadog-operator",
}
pods, err := o.Clientset.CoreV1().Pods(o.UserNamespace).List(podOpts)
pods, err := o.Clientset.CoreV1().Pods(o.UserNamespace).List(context.TODO(), podOpts)
if err != nil {
return err
}
Expand All @@ -306,7 +306,7 @@ func (o *options) createLogFiles(dir string, cmd *cobra.Command) error {
// createDeploymentTemplate gets the deployment template of the operator
func (o *options) createDeploymentTemplate(dir string, cmd *cobra.Command) error {
// Get Datadog operator deployment
deploy, err := o.Clientset.ExtensionsV1beta1().Deployments(o.UserNamespace).Get("datadog-operator", metav1.GetOptions{})
deploy, err := o.Clientset.ExtensionsV1beta1().Deployments(o.UserNamespace).Get(context.TODO(), "datadog-operator", metav1.GetOptions{})
if err != nil {
return err
}
Expand All @@ -333,7 +333,7 @@ func (o *options) createMetricsFile(pod *corev1.Pod, dir string, cmd *cobra.Comm
Name(fmt.Sprintf("%s:8383", pod.Name)).
SubResource("proxy").
Suffix("metrics").
Do()
Do(context.TODO())

metrics, err := result.Raw()
if err != nil {
Expand Down Expand Up @@ -405,7 +405,7 @@ func (o *options) getVersion(pod *corev1.Pod) (string, error) {

func (o *options) getLeader() (*corev1.Pod, error) {
// Get operator lock configmap to identify the leader
cm, err := o.Clientset.CoreV1().ConfigMaps(o.UserNamespace).Get("datadog-operator-lock", metav1.GetOptions{})
cm, err := o.Clientset.CoreV1().ConfigMaps(o.UserNamespace).Get(context.TODO(), "datadog-operator-lock", metav1.GetOptions{})
if err != nil {
return nil, err
}
Expand All @@ -422,7 +422,7 @@ func (o *options) getLeader() (*corev1.Pod, error) {
}

// Get operator leader pod
return o.Clientset.CoreV1().Pods(o.UserNamespace).Get(leaderName, metav1.GetOptions{})
return o.Clientset.CoreV1().Pods(o.UserNamespace).Get(context.TODO(), leaderName, metav1.GetOptions{})
}

// execInPod execs a given command in a given pod
Expand Down Expand Up @@ -470,7 +470,7 @@ func (o *options) execInPod(command []string, pod *corev1.Pod) ([]byte, error) {
func (o *options) savePodLogs(pod corev1.Pod, dir string, cmd *cobra.Command) error {
podLogOpts := corev1.PodLogOptions{}
req := o.Clientset.CoreV1().Pods(pod.Namespace).GetLogs(pod.Name, &podLogOpts)
podLogs, err := req.Stream()
podLogs, err := req.Stream(context.TODO())
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/kubectl-datadog/validate/ad/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package pod

import (
"context"
"errors"
"fmt"

Expand Down Expand Up @@ -86,7 +87,7 @@ func (o *options) validate() error {

// run runs the pod command
func (o *options) run(cmd *cobra.Command) error {
pod, err := o.Clientset.CoreV1().Pods(o.UserNamespace).Get(o.podName, metav1.GetOptions{})
pod, err := o.Clientset.CoreV1().Pods(o.UserNamespace).Get(context.TODO(), o.podName, metav1.GetOptions{})
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/kubectl-datadog/validate/ad/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package service

import (
"context"
"errors"
"fmt"

Expand Down Expand Up @@ -86,7 +87,7 @@ func (o *options) validate() error {

// run runs the service command
func (o *options) run(cmd *cobra.Command) error {
svc, err := o.Clientset.CoreV1().Services(o.UserNamespace).Get(o.serviceName, metav1.GetOptions{})
svc, err := o.Clientset.CoreV1().Services(o.UserNamespace).Get(context.TODO(), o.serviceName, metav1.GetOptions{})
if err != nil {
return err
}
Expand Down
24 changes: 6 additions & 18 deletions deploy/crds/datadoghq.com_datadogagents_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -560,25 +560,19 @@ spec:
description: GMSACredentialSpec is where the GMSA admission
webhook (https://github.com/kubernetes-sigs/windows-gmsa)
inlines the contents of the GMSA credential spec named
by the GMSACredentialSpecName field. This field is
alpha-level and is only honored by servers that enable
the WindowsGMSA feature flag.
by the GMSACredentialSpecName field.
type: string
gmsaCredentialSpecName:
description: GMSACredentialSpecName is the name of the
GMSA credential spec to use. This field is alpha-level
and is only honored by servers that enable the WindowsGMSA
feature flag.
GMSA credential spec to use.
type: string
runAsUserName:
description: The UserName in Windows to run the entrypoint
of the container process. Defaults to the user specified
in image metadata if unspecified. May also be set
in PodSecurityContext. If set in both SecurityContext
and PodSecurityContext, the value specified in SecurityContext
takes precedence. This field is beta-level and may
be disabled with the WindowsRunAsUserName feature
flag.
takes precedence.
type: string
type: object
type: object
Expand Down Expand Up @@ -2745,25 +2739,19 @@ spec:
description: GMSACredentialSpec is where the GMSA admission
webhook (https://github.com/kubernetes-sigs/windows-gmsa)
inlines the contents of the GMSA credential spec named
by the GMSACredentialSpecName field. This field is
alpha-level and is only honored by servers that enable
the WindowsGMSA feature flag.
by the GMSACredentialSpecName field.
type: string
gmsaCredentialSpecName:
description: GMSACredentialSpecName is the name of the
GMSA credential spec to use. This field is alpha-level
and is only honored by servers that enable the WindowsGMSA
feature flag.
GMSA credential spec to use.
type: string
runAsUserName:
description: The UserName in Windows to run the entrypoint
of the container process. Defaults to the user specified
in image metadata if unspecified. May also be set
in PodSecurityContext. If set in both SecurityContext
and PodSecurityContext, the value specified in SecurityContext
takes precedence. This field is beta-level and may
be disabled with the WindowsRunAsUserName feature
flag.
takes precedence.
type: string
type: object
type: object
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
args:
- --zap-level=info
- --zap-encoder=console
- --zap-stacktrace-level=error
- --zap-stacktrace-level=panic
env:
- name: WATCH_NAMESPACE
valueFrom:
Expand Down
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ require (
github.com/mikefarah/yq/v3 v3.0.0-20200418141808-3ccd32a47e54
github.com/nwaples/rardecode v1.0.0 // indirect
github.com/olekukonko/tablewriter v0.0.2
github.com/operator-framework/operator-sdk v0.17.0
github.com/operator-framework/operator-sdk v0.19.0
github.com/pierrec/lz4 v2.4.1+incompatible // indirect
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.4.0
github.com/stretchr/testify v1.5.1
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/zorkian/go-datadog-api v2.25.0+incompatible
gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.17.4
k8s.io/apimachinery v0.17.4
k8s.io/cli-runtime v0.17.4
k8s.io/api v0.18.2
k8s.io/apimachinery v0.18.2
k8s.io/cli-runtime v0.18.2
k8s.io/client-go v12.0.0+incompatible
k8s.io/code-generator v0.17.4
k8s.io/gengo v0.0.0-20191010091904-7fa3014cb28f
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
sigs.k8s.io/controller-runtime v0.5.2
sigs.k8s.io/yaml v1.1.0
k8s.io/code-generator v0.18.2
k8s.io/gengo v0.0.0-20200114144118-36b2048a9120
k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c
sigs.k8s.io/controller-runtime v0.6.0
sigs.k8s.io/yaml v1.2.0
)

// From operator-sdk, see https://github.com/operator-framework/operator-sdk/blob/master/website/content/en/docs/migration/version-upgrade-guide.md
// From operator-sdk, see https://github.com/operator-framework/operator-sdk/tree/master/website/content/en/docs/upgrading-sdk-version
replace (
github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.3.2+incompatible // Required by OLM
k8s.io/client-go => k8s.io/client-go v0.17.4 // Required by prometheus-operator
k8s.io/client-go => k8s.io/client-go v0.18.2 // Required by prometheus-operator
)

0 comments on commit 02a5073

Please sign in to comment.