Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into gianluca/ERRORT-4860-…
Browse files Browse the repository at this point in the history
…add-env-vars-to-operator
  • Loading branch information
eloytoro committed Feb 14, 2025
2 parents b220604 + 1c16822 commit 058aa97
Show file tree
Hide file tree
Showing 265 changed files with 5,424 additions and 4,198 deletions.
19 changes: 18 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,22 @@
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
},
"runArgs": ["--name", "datadog-operator-devenv", "-w", "/workspaces/datadog-operator"],
"postStartCommand": ["git", "config", "--global", "--add", "safe.directory", "/workspaces/datadog-operator"]
"postStartCommand": "git config --global --add safe.directory /workspaces/datadog-operator && make install-tools",
"customizations": {
"vscode": {
"settings": {
"go.lintTool": "golangci-lint",
"go.lintOnSave": "package",
"go.lintFlags": [
"--config=/workspaces/datadog-operator/.golangci.toml"
],
"[go]": {
"editor.formatOnSave": true
}
},
"extensions": [
"golang.Go"
]
}
},
}
9 changes: 4 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# and another the rest of the directory.

# All your base
* @DataDog/container-ecosystems
* @DataDog/container-ecosystems

# Dev Container
/.devcontainer @DataDog/container-ecosystems @DataDog/container-platform

# Documentation
README.md @DataDog/documentation @DataDog/container-ecosystems
/docs/ @DataDog/documentation @DataDog/container-ecosystems
README.md @DataDog/documentation @DataDog/container-ecosystems
/docs/ @DataDog/documentation @DataDog/container-ecosystems


# Features owners
Expand All @@ -21,5 +21,4 @@ README.md @DataDog/documentation @DataDog/container-ecosystems
/internal/controller/datadogagent/feature/helmcheck/* @DataDog/container-integrations


/api/datadoghq/v1alpha2/datadogpodautoscaler_types.go @DataDog/container-autoscaling
/api/datadoghq/v1alpha1/datadogpodautoscaler_types.go @DataDog/container-autoscaling
/api/**/datadogpodautoscaler*.go @DataDog/container-autoscaling
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: gcc install
Expand All @@ -24,11 +24,11 @@ jobs:
uses: little-core-labs/get-git-tag@2c292ff564c1a61b989e29f0410d131317f89b03 # v3.0.2
id: tag
- name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757 # v3.2.0
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
with:
version: 2.4.1
args: build --skip=validate --config .goreleaser-for-linux.yaml
Expand All @@ -38,18 +38,18 @@ jobs:
# https://github.com/marketplace/actions/goreleaser-action
contents: write
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get tag
uses: little-core-labs/get-git-tag@2c292ff564c1a61b989e29f0410d131317f89b03 # v3.0.2
id: tag
- name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757 # v3.2.0
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
with:
args: build --skip=validate --config .goreleaser-for-darwin.yaml
build-windows-binary:
Expand All @@ -58,17 +58,17 @@ jobs:
# https://github.com/marketplace/actions/goreleaser-action
contents: write
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get tag
uses: little-core-labs/get-git-tag@2c292ff564c1a61b989e29f0410d131317f89b03 # v3.0.2
id: tag
- name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757 # v3.2.0
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
with:
args: build --skip=validate --config .goreleaser-for-windows.yaml
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2.28.1
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -41,7 +41,7 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
- name: Autobuild
uses: github/codeql-action/autobuild@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2.28.1
uses: github/codeql-action/autobuild@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2.28.1
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@0caeaed6fd66a828038c2da3c0f662a42862658f # v1.1.3
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
Expand All @@ -21,7 +21,7 @@ jobs:
with:
apt-get: mercurial jq build-essential
- name: Check out code into the Go module directory
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install tools
run: |
make install-tools
Expand All @@ -31,7 +31,7 @@ jobs:
- name: run unit tests and E2E tests (fake cluster)
run: |
make test
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: cover.out,cover_integration_v1.out,cover_integration_v2.out
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
pull-requests: read
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Verify Pull Request Labels
uses: jesusvasquez333/verify-pr-label-action@657d111bbbe13e22bbd55870f1813c699bde1401 # v1.4.0
with:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
actions: write
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: gcc install
Expand All @@ -32,7 +32,7 @@ jobs:
uses: little-core-labs/get-git-tag@2c292ff564c1a61b989e29f0410d131317f89b03 # v3.0.2
id: tag
- name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Get Latest Release
Expand All @@ -44,7 +44,7 @@ jobs:
excludes: prerelease, draft
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757 # v3.2.0
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
with:
version: 2.4.1
args: release --skip=publish --config .goreleaser-for-linux.yaml
Expand All @@ -67,14 +67,14 @@ jobs:
# actions/upload-artifact
actions: write
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get tag
uses: little-core-labs/get-git-tag@2c292ff564c1a61b989e29f0410d131317f89b03 # v3.0.2
id: tag
- name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Get Latest Release
Expand All @@ -86,7 +86,7 @@ jobs:
excludes: prerelease, draft
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757 # v3.2.0
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
with:
args: release --skip=publish --config .goreleaser-for-darwin.yaml
env:
Expand All @@ -107,14 +107,14 @@ jobs:
# actions/upload-artifact
actions: write
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get tag
uses: little-core-labs/get-git-tag@2c292ff564c1a61b989e29f0410d131317f89b03 # v3.0.2
id: tag
- name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Get Latest Release
Expand All @@ -126,7 +126,7 @@ jobs:
excludes: prerelease, draft
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757 # v3.2.0
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
with:
args: release --skip=publish --config .goreleaser-for-windows.yaml
env:
Expand All @@ -152,7 +152,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Make directories
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
- name: Generate Plugin manifest
run: ./hack/release/generate-plugin-manifest.sh ${{steps.tag.outputs.tag}}
- name: Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1.0.0
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v1.0.0
with:
body_path: dist/CHANGELOG.md
prerelease: ${{ contains(github.ref, '-rc.') }}
Expand All @@ -204,7 +204,7 @@ jobs:
COMMIT_TAG: ${{steps.tag.outputs.tag}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update new plugin version in krew-index
uses: rajatjindal/krew-release-bot@92da038bbf995803124a8e50ebd438b2f37bbbb0 # v0.0.43
uses: rajatjindal/krew-release-bot@3d9faef30a82761d610544f62afddca00993eef9 # v0.0.47
continue-on-error: true
with:
krew_template_file: dist/datadog-plugin.yaml
45 changes: 41 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,25 @@ trigger_internal_operator_image:
branch: master
strategy: depend
variables:
IMAGE_VERSION: tmpl-v1
IMAGE_VERSION: tmpl-v2
IMAGE_NAME: $PROJECTNAME
TMPL_SRC_IMAGE: v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}
RELEASE_TAG: ${CI_COMMIT_REF_SLUG}
BUILD_TAG: ${CI_COMMIT_REF_SLUG}
RELEASE_STAGING: "true"
RELEASE_PROD: "true"

trigger_internal_operator_image_fips:
stage: release
rules:
- if: $CI_COMMIT_TAG
- when: never
trigger:
project: DataDog/images
branch: master
strategy: depend
variables:
IMAGE_VERSION: tmpl-v2-fips
IMAGE_NAME: $PROJECTNAME
TMPL_SRC_IMAGE: v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}
RELEASE_TAG: ${CI_COMMIT_REF_SLUG}
Expand Down Expand Up @@ -340,7 +358,7 @@ trigger_internal_operator_nightly_image:
branch: master
strategy: depend
variables:
IMAGE_VERSION: tmpl-v1
IMAGE_VERSION: tmpl-v2
IMAGE_NAME: $PROJECTNAME
TMPL_SRC_IMAGE: v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}
# Trigger a nightly images build that sets the RELEASE_TAG and BUILD_TAG
Expand Down Expand Up @@ -378,7 +396,26 @@ trigger_custom_operator_image_staging:
branch: master
strategy: depend
variables:
IMAGE_VERSION: tmpl-v1
IMAGE_VERSION: tmpl-v2
IMAGE_NAME: $PROJECTNAME
TMPL_SRC_IMAGE: v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}
RELEASE_TAG: ${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}
BUILD_TAG: ${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}
RELEASE_STAGING: "true"
RELEASE_PROD: "false"

trigger_custom_operator_image_fips_staging:
stage: release
rules:
- if: $PUSH_IMAGES_TO_STAGING == 'true'
when: manual
- when: never
trigger:
project: DataDog/images
branch: master
strategy: depend
variables:
IMAGE_VERSION: tmpl-v2-fips
IMAGE_NAME: $PROJECTNAME
TMPL_SRC_IMAGE: v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}
RELEASE_TAG: ${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}
Expand Down Expand Up @@ -547,7 +584,7 @@ publish_release_candidate_workflow:
variables:
OPERATOR_RC: "true"
SKIP_PLAN_CHECK: "true"
ENVIRONMENTS: "experimental"
ENVIRONMENTS: "experimental,alpha,staging"
CHART: "datadog-operator"
OPTION_AUTOMATIC_ROLLOUT: "true"
EXPLICIT_WORKFLOWS: "//workflows:deploy_operator_rc.operator_rc"
Expand Down
9 changes: 6 additions & 3 deletions .golangci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@

[linters-settings.gci]
sections = [
"prefix(github.com/DataDog/datadog-operator)"
"standard",
"default",
"prefix(github.com/DataDog/datadog-operator)",
"blank",
"dot",
]

[linters-settings.godot]
Expand Down Expand Up @@ -55,7 +59,6 @@
"paralleltest",
"nestif",
"exhaustive",
"gci",
"wsl",
"godox",
"godot",
Expand Down Expand Up @@ -105,4 +108,4 @@
".cache",
"go/pkg/mod",
"pkg/mod",
]
]
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ LABEL summary="The Datadog Operator aims at providing a new way to deploy the Da
LABEL description="Datadog provides a modern monitoring and analytics platform. Gather \
metrics, logs and traces for full observability of your Kubernetes cluster with \
Datadog Operator."
LABEL maintainer="Datadog Inc."

WORKDIR /
COPY --from=builder /workspace/manager .
Expand Down
Loading

0 comments on commit 058aa97

Please sign in to comment.