Skip to content

Commit

Permalink
Upgrade Go, controller-runtime and related dependencies (#1175)
Browse files Browse the repository at this point in the history
* Checkpoint: upgrade controller-runtime, go 1.21. `make build` works; `make docker-build` fails on EDS checksum mismatch

* Checkpoint: `make docker-build` works with vendored EDS tag

* Checkpoint: `build`, `docker-build` succeed; one test commented, others passing. Updated CI go versions

* add vendored EDS

* Clean up EDS vendor dependency and others

* controller-runtime 1.15->1.16; k8s api 0.27->0.28

* bump controller-runtime minor version

* Regenerate

* Comment out failing unit tests

* hack license file

* Add pod selector in cache

* Add selector for configured namespace

* Fix earlier commented tests

* Remove namespace selector from Pod cache

* Add pod ns config

* fix leader election resource lock merge
  • Loading branch information
levan-m authored Jun 18, 2024
1 parent 800fdbe commit d36395d
Show file tree
Hide file tree
Showing 28 changed files with 1,243 additions and 700 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- name: Build
uses: goreleaser/goreleaser-action@v3
with:
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- name: Build
uses: goreleaser/goreleaser-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.19
go-version: 1.21
id: go
- name: install required packages
uses: mstksg/get-package@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- name: Get Latest Release
id: latest_version
uses: pozetroninc/github-action-get-latest-release@master
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- name: Get Latest Release
id: latest_version
uses: pozetroninc/github-action-get-latest-release@master
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- name: Get Latest Release
id: latest_version
uses: pozetroninc/github-action-get-latest-release@master
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: registry.ddbuild.io/images/mirror/golang:1.19-bullseye
image: registry.ddbuild.io/images/mirror/golang:1.21
variables:
PROJECTNAME: "datadog-operator"
PROJECTNAME_CHECK: "datadog-operator-check"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.21 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
15 changes: 6 additions & 9 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Component,Origin,License
core,cloud.google.com/go/compute/metadata,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/config/model,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/config/remote,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/proto,Apache-2.0
Expand All @@ -14,23 +13,21 @@ core,github.com/DataDog/datadog-agent/pkg/util/uuid,Apache-2.0
core,github.com/DataDog/datadog-api-client-go/v2,Apache-2.0
core,github.com/DataDog/datadog-go/v5/statsd,MIT
core,github.com/DataDog/datadog-operator,Apache-2.0
core,github.com/DataDog/extendeddaemonset,Apache-2.0
core,github.com/DataDog/extendeddaemonset/api/v1alpha1,Apache-2.0
core,github.com/DataDog/go-tuf,BSD-3-Clause
core,github.com/DataDog/gostackparse,Apache-2.0
core,github.com/DataDog/viper,MIT
core,github.com/DataDog/zstd,BSD-3-Clause
core,github.com/Masterminds/semver,MIT
core,github.com/Masterminds/semver/v3,MIT
core,github.com/PuerkitoBio/purell,BSD-3-Clause
core,github.com/PuerkitoBio/urlesc,BSD-3-Clause
core,github.com/benbjohnson/clock,MIT
core,github.com/beorn7/perks/quantile,MIT
core,github.com/cenkalti/backoff,MIT
core,github.com/cespare/xxhash/v2,MIT
core,github.com/cihub/seelog,BSD-3-Clause
core,github.com/davecgh/go-spew/spew,ISC
core,github.com/emicklei/go-restful,MIT
core,github.com/evanphx/json-patch,BSD-3-Clause
core,github.com/emicklei/go-restful/v3,MIT
core,github.com/evanphx/json-patch/v5,BSD-3-Clause
core,github.com/fsnotify/fsnotify,BSD-3-Clause
core,github.com/go-logr/logr,Apache-2.0
core,github.com/go-logr/zapr,Apache-2.0
Expand All @@ -41,7 +38,7 @@ core,github.com/gobwas/glob,MIT
core,github.com/gogo/protobuf,BSD-3-Clause
core,github.com/golang/groupcache/lru,Apache-2.0
core,github.com/golang/protobuf,BSD-3-Clause
core,github.com/google/gnostic,Apache-2.0
core,github.com/google/gnostic-models,Apache-2.0
core,github.com/google/go-cmp/cmp,BSD-3-Clause
core,github.com/google/gofuzz,Apache-2.0
core,github.com/google/pprof/profile,Apache-2.0
Expand Down Expand Up @@ -87,6 +84,7 @@ core,go.etcd.io/bbolt,MIT
core,go.uber.org/atomic,MIT
core,go.uber.org/multierr,MIT
core,go.uber.org/zap,MIT
core,golang.org/x/exp/maps,BSD-3-Clause
core,golang.org/x/net,BSD-3-Clause
core,golang.org/x/oauth2,BSD-3-Clause
core,golang.org/x/sys/unix,BSD-3-Clause
Expand All @@ -108,13 +106,12 @@ core,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions,Apache-2.0
core,k8s.io/apimachinery/pkg,Apache-2.0
core,k8s.io/apimachinery/third_party/forked/golang,BSD-3-Clause
core,k8s.io/client-go,Apache-2.0
core,k8s.io/client-go/third_party/forked/golang/template,BSD-3-Clause
core,k8s.io/component-base/config,Apache-2.0
core,k8s.io/klog/v2,Apache-2.0
core,k8s.io/kube-aggregator/pkg/apis/apiregistration,Apache-2.0
core,k8s.io/kube-openapi/pkg,Apache-2.0
core,k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json,BSD-3-Clause
core,k8s.io/kube-openapi/pkg/validation/spec,Apache-2.0
core,k8s.io/kube-state-metrics/pkg/metric,Apache-2.0
core,k8s.io/utils,Apache-2.0
core,k8s.io/utils/internal/third_party/forked/golang/net,BSD-3-Clause
core,sigs.k8s.io/controller-runtime,Apache-2.0
Expand Down
3 changes: 2 additions & 1 deletion check-operator.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.21 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum

# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
Expand Down
19 changes: 17 additions & 2 deletions config/crd/bases/v1/datadoghq.com_datadogagentprofiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ spec:
resources:
description: ResourceRequirements describes the compute resource requirements.
properties:
claims:
description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable. It can only be set for containers."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand All @@ -71,7 +86,7 @@ spec:
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
type: object
Expand Down Expand Up @@ -116,7 +131,7 @@ spec:
conditions:
description: Conditions represents the latest available observations of a DatadogAgentProfile's current state.
items:
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n \ttype FooStatus struct{ \t // Represents the observations of a foo's current state. \t // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" \t // +patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map \t // +listMapKey=type \t Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields \t}"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
Expand Down
Loading

0 comments on commit d36395d

Please sign in to comment.