Compare commits
164 Commits
release/v2
...
v2.6.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bda4c8187e | ||
|
|
3f281da738 | ||
|
|
963e99188c | ||
|
|
a48f81a66c | ||
|
|
55104dc188 | ||
|
|
e771ff28ab | ||
|
|
998fe11166 | ||
|
|
a6ac4c5b60 | ||
|
|
0d397d7d1f | ||
|
|
b73c7f7191 | ||
|
|
7aff0327ad | ||
|
|
3bb3ae3617 | ||
|
|
bf1af3c120 | ||
|
|
4c66d37545 | ||
|
|
481c3c6e1e | ||
|
|
1d1d96b489 | ||
|
|
0b972771fd | ||
|
|
650732109e | ||
|
|
79fed691ca | ||
|
|
b37ba736fa | ||
|
|
65766ff4fc | ||
|
|
19d9b87c62 | ||
|
|
d82ec5a211 | ||
|
|
5e5ffdbcc3 | ||
|
|
13ec11da58 | ||
|
|
2948d5e70f | ||
|
|
bb9a119456 | ||
|
|
22ac16f3a1 | ||
|
|
79a654d605 | ||
|
|
a421ce4266 | ||
|
|
4b42c9e746 | ||
|
|
5ffca1b157 | ||
|
|
0951061b5e | ||
|
|
ad9d63ac52 | ||
|
|
dccc658273 | ||
|
|
ef5389cd56 | ||
|
|
3f63b3e864 | ||
|
|
656d9d892d | ||
|
|
e979df122a | ||
|
|
8804b856ea | ||
|
|
3ba170e4d4 | ||
|
|
6150fe9942 | ||
|
|
3e80c5809e | ||
|
|
8928ac7d39 | ||
|
|
289645f142 | ||
|
|
8d9cbe7693 | ||
|
|
392a33d425 | ||
|
|
6af448e037 | ||
|
|
ac66adc24c | ||
|
|
0a64800784 | ||
|
|
941af6a648 | ||
|
|
a6b5013649 | ||
|
|
c18ab38877 | ||
|
|
8738712cfa | ||
|
|
8816c5f7de | ||
|
|
e9e15c5f7a | ||
|
|
5b582917ec | ||
|
|
d9b66f6959 | ||
|
|
1b98e16940 | ||
|
|
0c73420ccf | ||
|
|
8cb7188919 | ||
|
|
72a2866508 | ||
|
|
912718103c | ||
|
|
a7e41df1e3 | ||
|
|
c436708a13 | ||
|
|
3f4743037b | ||
|
|
7b551b0d35 | ||
|
|
bb8a10bab8 | ||
|
|
09af0becc5 | ||
|
|
d84bff7d1b | ||
|
|
a4c513487e | ||
|
|
2046003714 | ||
|
|
f07ee355ea | ||
|
|
5e02724e49 | ||
|
|
e5926bcaad | ||
|
|
355f2bc5f3 | ||
|
|
7e8e0ab772 | ||
|
|
f0fecf7399 | ||
|
|
54db4ffc8b | ||
|
|
73fff7404f | ||
|
|
24057743bb | ||
|
|
04d87be082 | ||
|
|
e7c6ebccc3 | ||
|
|
48382f885b | ||
|
|
511d8346f2 | ||
|
|
f0e8e84ee0 | ||
|
|
c277fbf14e | ||
|
|
28570296a9 | ||
|
|
39ec0cb594 | ||
|
|
af67405ee4 | ||
|
|
6f65c92fe7 | ||
|
|
c84d312289 | ||
|
|
d37473ff44 | ||
|
|
712b03727a | ||
|
|
14da7d58be | ||
|
|
45da6a86f8 | ||
|
|
3053a0b840 | ||
|
|
96f95b6b4c | ||
|
|
cf92e02f53 | ||
|
|
ce50286a92 | ||
|
|
c15eb30b0d | ||
|
|
8bedcc46d4 | ||
|
|
5d64a9fc76 | ||
|
|
035afd9533 | ||
|
|
c859688b37 | ||
|
|
13b1d199ee | ||
|
|
5f9108c53f | ||
|
|
abf52ff866 | ||
|
|
b319ee1ddf | ||
|
|
b564d2fb3b | ||
|
|
d9e25d86aa | ||
|
|
dcc4251a2a | ||
|
|
960f72fe6a | ||
|
|
6f815a36fe | ||
|
|
1d08cace4f | ||
|
|
cfd369df47 | ||
|
|
9e6f723436 | ||
|
|
e4325961af | ||
|
|
74d748f547 | ||
|
|
6f6d3fb269 | ||
|
|
e51e5df9da | ||
|
|
f604d7f342 | ||
|
|
3346542917 | ||
|
|
f0e7f92ef1 | ||
|
|
e09ba7a8e6 | ||
|
|
f29bcfb108 | ||
|
|
2e9e8e2690 | ||
|
|
3478fe343d | ||
|
|
8b10a32088 | ||
|
|
16ae23a3a6 | ||
|
|
055958d533 | ||
|
|
0cc68e0521 | ||
|
|
fae5d62b07 | ||
|
|
16f55bbf22 | ||
|
|
83c16f9c4a | ||
|
|
b232bbe004 | ||
|
|
5208515604 | ||
|
|
928ea24bcb | ||
|
|
9b1b5e8a51 | ||
|
|
5b740c45d1 | ||
|
|
19568eb94e | ||
|
|
5cf0dcc77d | ||
|
|
b45a8b5c1f | ||
|
|
2b68c8c664 | ||
|
|
939cffa561 | ||
|
|
30ed414938 | ||
|
|
d51a2f8bce | ||
|
|
120ec049f9 | ||
|
|
aa9de2c6bc | ||
|
|
226cb462c2 | ||
|
|
b1bdab4e6a | ||
|
|
8110d2f05d | ||
|
|
13c56f3e4e | ||
|
|
1013e98c0f | ||
|
|
85405928a7 | ||
|
|
570bc81278 | ||
|
|
f42a17de54 | ||
|
|
7697699e65 | ||
|
|
9f854cb7e2 | ||
|
|
995e1dcc32 | ||
|
|
5b83111dc6 | ||
|
|
9abc802f15 | ||
|
|
2a5948fe42 | ||
|
|
af765388d2 |
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@@ -6,11 +6,9 @@ updates:
|
||||
labels: ["area/ci", "dependencies"]
|
||||
groups:
|
||||
# Group all updates together, so that they are all applied in a single PR.
|
||||
# Grouped updates are currently in beta and is subject to change.
|
||||
# xref: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups
|
||||
ci:
|
||||
patterns:
|
||||
- "*"
|
||||
schedule:
|
||||
# By default, this will be on a monday.
|
||||
interval: "weekly"
|
||||
interval: "monthly"
|
||||
|
||||
15
.github/labels.yaml
vendored
15
.github/labels.yaml
vendored
@@ -44,15 +44,12 @@
|
||||
description: Feature request proposals in the RFC format
|
||||
color: '#D621C3'
|
||||
aliases: ['area/RFC']
|
||||
- name: backport:release/v2.0.x
|
||||
description: To be backported to release/v2.0.x
|
||||
color: '#ffd700'
|
||||
- name: backport:release/v2.1.x
|
||||
description: To be backported to release/v2.1.x
|
||||
color: '#ffd700'
|
||||
- name: backport:release/v2.2.x
|
||||
description: To be backported to release/v2.2.x
|
||||
color: '#ffd700'
|
||||
- name: backport:release/v2.3.x
|
||||
description: To be backported to release/v2.3.x
|
||||
color: '#ffd700'
|
||||
- name: backport:release/v2.4.x
|
||||
description: To be backported to release/v2.4.x
|
||||
color: '#ffd700'
|
||||
- name: backport:release/v2.5.x
|
||||
description: To be backported to release/v2.5.x
|
||||
color: '#ffd700'
|
||||
|
||||
2
.github/workflows/action.yaml
vendored
2
.github/workflows/action.yaml
vendored
@@ -24,6 +24,6 @@ jobs:
|
||||
name: action on ${{ matrix.version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup flux
|
||||
uses: ./action
|
||||
|
||||
4
.github/workflows/backport.yaml
vendored
4
.github/workflows/backport.yaml
vendored
@@ -16,11 +16,11 @@ jobs:
|
||||
if: github.event.pull_request.state == 'closed' && github.event.pull_request.merged && (github.event_name != 'labeled' || startsWith('backport:', github.event.label.name))
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Create backport PRs
|
||||
uses: korthout/backport-action@be567af183754f6a5d831ae90f648954763f17f5 # v3.1.0
|
||||
uses: korthout/backport-action@436145e922f9561fc5ea157ff406f21af2d6b363 # v3.2.0
|
||||
# xref: https://github.com/korthout/backport-action#inputs
|
||||
with:
|
||||
# Use token to allow workflows to be triggered for the created PR
|
||||
|
||||
36
.github/workflows/conformance.yaml
vendored
36
.github/workflows/conformance.yaml
vendored
@@ -9,7 +9,7 @@ permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
GO_VERSION: 1.22.x
|
||||
GO_VERSION: 1.24.x
|
||||
|
||||
jobs:
|
||||
conform-kubernetes:
|
||||
@@ -19,13 +19,13 @@ jobs:
|
||||
matrix:
|
||||
# Keep this list up-to-date with https://endoflife.date/kubernetes
|
||||
# Build images with https://github.com/fluxcd/flux-benchmark/actions/workflows/build-kind.yaml
|
||||
KUBERNETES_VERSION: [1.29.7, 1.30.2, 1.31.1 ]
|
||||
KUBERNETES_VERSION: [1.31.5, 1.32.1, 1.33.0]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache-dependency-path: |
|
||||
@@ -40,9 +40,9 @@ jobs:
|
||||
run: |
|
||||
make build
|
||||
- name: Setup Kubernetes
|
||||
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
|
||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
||||
with:
|
||||
version: v0.22.0
|
||||
version: v0.27.0
|
||||
cluster_name: ${{ steps.prep.outputs.CLUSTER }}
|
||||
node_image: ghcr.io/fluxcd/kindest/node:v${{ matrix.KUBERNETES_VERSION }}-arm64
|
||||
- name: Run e2e tests
|
||||
@@ -76,13 +76,13 @@ jobs:
|
||||
matrix:
|
||||
# Keep this list up-to-date with https://endoflife.date/kubernetes
|
||||
# Available versions can be found with "replicated cluster versions"
|
||||
K3S_VERSION: [ 1.29.9, 1.30.5, 1.31.1 ]
|
||||
K3S_VERSION: [ 1.31.8, 1.32.4, 1.33.0 ]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache-dependency-path: |
|
||||
@@ -97,7 +97,7 @@ jobs:
|
||||
KUBECONFIG_PATH="$(git rev-parse --show-toplevel)/bin/kubeconfig.yaml"
|
||||
echo "kubeconfig-path=${KUBECONFIG_PATH}" >> $GITHUB_OUTPUT
|
||||
- name: Setup Kustomize
|
||||
uses: fluxcd/pkg/actions/kustomize@30c101fc7c9fac4d84937ff4890a3da46a9db2dd # main
|
||||
uses: fluxcd/pkg/actions/kustomize@7e9c75bbb6a47b08c194edefa11d1c436e5bdd9e # main
|
||||
- name: Build
|
||||
run: make build-dev
|
||||
- name: Create repository
|
||||
@@ -107,7 +107,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
|
||||
- name: Create cluster
|
||||
id: create-cluster
|
||||
uses: replicatedhq/compatibility-actions/create-cluster@77121785951d05387334b773644c356885191f14 # v1.16.2
|
||||
uses: replicatedhq/replicated-actions/create-cluster@49b440dabd7e0e868cbbabda5cfc0d8332a279fa # v1.19.0
|
||||
with:
|
||||
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
|
||||
kubernetes-distribution: "k3s"
|
||||
@@ -151,7 +151,7 @@ jobs:
|
||||
kubectl delete ns flux-system --wait
|
||||
- name: Delete cluster
|
||||
if: ${{ always() }}
|
||||
uses: replicatedhq/replicated-actions/remove-cluster@77121785951d05387334b773644c356885191f14 # v1.16.2
|
||||
uses: replicatedhq/replicated-actions/remove-cluster@49b440dabd7e0e868cbbabda5cfc0d8332a279fa # v1.19.0
|
||||
continue-on-error: true
|
||||
with:
|
||||
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
|
||||
@@ -169,13 +169,13 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
# Keep this list up-to-date with https://endoflife.date/red-hat-openshift
|
||||
OPENSHIFT_VERSION: [ 4.15.0-okd ]
|
||||
OPENSHIFT_VERSION: [ 4.18.0-okd ]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache-dependency-path: |
|
||||
@@ -190,7 +190,7 @@ jobs:
|
||||
KUBECONFIG_PATH="$(git rev-parse --show-toplevel)/bin/kubeconfig.yaml"
|
||||
echo "kubeconfig-path=${KUBECONFIG_PATH}" >> $GITHUB_OUTPUT
|
||||
- name: Setup Kustomize
|
||||
uses: fluxcd/pkg/actions/kustomize@30c101fc7c9fac4d84937ff4890a3da46a9db2dd # main
|
||||
uses: fluxcd/pkg/actions/kustomize@7e9c75bbb6a47b08c194edefa11d1c436e5bdd9e # main
|
||||
- name: Build
|
||||
run: make build-dev
|
||||
- name: Create repository
|
||||
@@ -200,7 +200,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
|
||||
- name: Create cluster
|
||||
id: create-cluster
|
||||
uses: replicatedhq/compatibility-actions/create-cluster@77121785951d05387334b773644c356885191f14 # v1.16.2
|
||||
uses: replicatedhq/replicated-actions/create-cluster@49b440dabd7e0e868cbbabda5cfc0d8332a279fa # v1.19.0
|
||||
with:
|
||||
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
|
||||
kubernetes-distribution: "openshift"
|
||||
@@ -242,7 +242,7 @@ jobs:
|
||||
kubectl delete ns flux-system --wait
|
||||
- name: Delete cluster
|
||||
if: ${{ always() }}
|
||||
uses: replicatedhq/replicated-actions/remove-cluster@77121785951d05387334b773644c356885191f14 # v1.16.2
|
||||
uses: replicatedhq/replicated-actions/remove-cluster@49b440dabd7e0e868cbbabda5cfc0d8332a279fa # v1.19.0
|
||||
continue-on-error: true
|
||||
with:
|
||||
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
|
||||
|
||||
10
.github/workflows/e2e-azure.yaml
vendored
10
.github/workflows/e2e-azure.yaml
vendored
@@ -30,12 +30,14 @@ jobs:
|
||||
if: false && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
|
||||
steps:
|
||||
- name: CheckoutD
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: 1.23.x
|
||||
go-version: 1.24.x
|
||||
cache-dependency-path: tests/integration/go.sum
|
||||
- name: Setup Terraform
|
||||
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
|
||||
- name: Setup Flux CLI
|
||||
run: make build
|
||||
working-directory: ./
|
||||
@@ -47,7 +49,7 @@ jobs:
|
||||
env:
|
||||
SOPS_VER: 3.7.1
|
||||
- name: Authenticate to Azure
|
||||
uses: Azure/login@a65d910e8af852a8061c627c456678983e180302 # v1.4.6
|
||||
uses: Azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v1.4.6
|
||||
with:
|
||||
creds: '{"clientId":"${{ secrets.AZ_ARM_CLIENT_ID }}","clientSecret":"${{ secrets.AZ_ARM_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZ_ARM_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZ_ARM_TENANT_ID }}"}'
|
||||
- name: Set dynamic variables in .env
|
||||
|
||||
18
.github/workflows/e2e-bootstrap.yaml
vendored
18
.github/workflows/e2e-bootstrap.yaml
vendored
@@ -17,27 +17,27 @@ jobs:
|
||||
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: 1.23.x
|
||||
go-version: 1.24.x
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
- name: Setup Kubernetes
|
||||
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
|
||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
||||
with:
|
||||
version: v0.24.0
|
||||
cluster_name: kind
|
||||
# The versions below should target the newest Kubernetes version
|
||||
# Keep this up-to-date with https://endoflife.date/kubernetes
|
||||
node_image: ghcr.io/fluxcd/kindest/node:v1.31.0-amd64
|
||||
kubectl_version: v1.31.0
|
||||
node_image: ghcr.io/fluxcd/kindest/node:v1.33.0-amd64
|
||||
kubectl_version: v1.32.0
|
||||
- name: Setup Kustomize
|
||||
uses: fluxcd/pkg/actions/kustomize@30c101fc7c9fac4d84937ff4890a3da46a9db2dd # main
|
||||
uses: fluxcd/pkg/actions/kustomize@7e9c75bbb6a47b08c194edefa11d1c436e5bdd9e # main
|
||||
- name: Setup yq
|
||||
uses: fluxcd/pkg/actions/yq@30c101fc7c9fac4d84937ff4890a3da46a9db2dd # main
|
||||
uses: fluxcd/pkg/actions/yq@7e9c75bbb6a47b08c194edefa11d1c436e5bdd9e # main
|
||||
- name: Build
|
||||
run: make build-dev
|
||||
- name: Set outputs
|
||||
@@ -107,6 +107,8 @@ jobs:
|
||||
./bin/flux reconcile image repository podinfo
|
||||
./bin/flux reconcile image update flux-system
|
||||
./bin/flux get images all
|
||||
./bin/flux -n flux-system events --for ImageUpdateAutomation/flux-system
|
||||
kubectl -n flux-system get -o yaml ImageUpdateAutomation flux-system
|
||||
kubectl -n flux-system get -o yaml ImageUpdateAutomation flux-system | \
|
||||
yq '.status.lastPushCommit | length > 1' | grep 'true'
|
||||
env:
|
||||
|
||||
18
.github/workflows/e2e-gcp.yaml
vendored
18
.github/workflows/e2e-gcp.yaml
vendored
@@ -29,12 +29,14 @@ jobs:
|
||||
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: 1.23.x
|
||||
go-version: 1.24.x
|
||||
cache-dependency-path: tests/integration/go.sum
|
||||
- name: Setup Terraform
|
||||
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
|
||||
- name: Setup Flux CLI
|
||||
run: make build
|
||||
working-directory: ./
|
||||
@@ -46,19 +48,19 @@ jobs:
|
||||
env:
|
||||
SOPS_VER: 3.7.1
|
||||
- name: Authenticate to Google Cloud
|
||||
uses: google-github-actions/auth@62cf5bd3e4211a0a0b51f2c6d6a37129d828611d # v2.1.5
|
||||
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
|
||||
id: 'auth'
|
||||
with:
|
||||
credentials_json: '${{ secrets.FLUX2_E2E_GOOGLE_CREDENTIALS }}'
|
||||
token_format: 'access_token'
|
||||
- name: Setup gcloud
|
||||
uses: google-github-actions/setup-gcloud@f0990588f1e5b5af6827153b93673613abdc6ec7 # v2.1.1
|
||||
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
|
||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
|
||||
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
|
||||
- name: Log into us-central1-docker.pkg.dev
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
with:
|
||||
registry: us-central1-docker.pkg.dev
|
||||
username: oauth2accesstoken
|
||||
|
||||
16
.github/workflows/e2e.yaml
vendored
16
.github/workflows/e2e.yaml
vendored
@@ -23,16 +23,16 @@ jobs:
|
||||
- 5000:5000
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: 1.23.x
|
||||
go-version: 1.24.x
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
- name: Setup Kubernetes
|
||||
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
|
||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
||||
with:
|
||||
version: v0.24.0
|
||||
cluster_name: kind
|
||||
@@ -40,13 +40,13 @@ jobs:
|
||||
config: .github/kind/config.yaml # disable KIND-net
|
||||
# The versions below should target the oldest supported Kubernetes version
|
||||
# Keep this up-to-date with https://endoflife.date/kubernetes
|
||||
node_image: ghcr.io/fluxcd/kindest/node:v1.29.7-amd64
|
||||
kubectl_version: v1.29.7
|
||||
node_image: ghcr.io/fluxcd/kindest/node:v1.31.5-amd64
|
||||
kubectl_version: v1.32.0
|
||||
- name: Setup Calico for network policy
|
||||
run: |
|
||||
kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.27.3/manifests/calico.yaml
|
||||
- name: Setup Kustomize
|
||||
uses: fluxcd/pkg/actions/kustomize@30c101fc7c9fac4d84937ff4890a3da46a9db2dd # main
|
||||
uses: fluxcd/pkg/actions/kustomize@7e9c75bbb6a47b08c194edefa11d1c436e5bdd9e # main
|
||||
- name: Run tests
|
||||
run: make test
|
||||
- name: Run e2e tests
|
||||
@@ -247,7 +247,7 @@ jobs:
|
||||
- name: Debug failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl version --client --short
|
||||
kubectl version --client
|
||||
kubectl -n flux-system get all
|
||||
kubectl -n flux-system describe pods
|
||||
kubectl -n flux-system get kustomizations -oyaml
|
||||
|
||||
8
.github/workflows/ossf.yaml
vendored
8
.github/workflows/ossf.yaml
vendored
@@ -19,21 +19,21 @@ jobs:
|
||||
actions: read
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Run analysis
|
||||
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
|
||||
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_results: true
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
- name: Upload SARIF results
|
||||
uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
|
||||
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
71
.github/workflows/release.yaml
vendored
71
.github/workflows/release.yaml
vendored
@@ -2,7 +2,7 @@ name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: [ 'v*' ]
|
||||
tags: ["v*"]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -20,33 +20,33 @@ jobs:
|
||||
packages: write # needed for ghcr access
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Unshallow
|
||||
run: git fetch --prune --unshallow
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: 1.23.x
|
||||
go-version: 1.24.x
|
||||
cache: false
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
|
||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
||||
- name: Setup Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
|
||||
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
|
||||
- name: Setup Syft
|
||||
uses: anchore/sbom-action/download-syft@61119d458adab75f756bc0b9e4bde25725f86a7a # v0.17.2
|
||||
uses: anchore/sbom-action/download-syft@9f7302141466aa6482940f15371237e9d9f4c34a # v0.19.0
|
||||
- name: Setup Cosign
|
||||
uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0
|
||||
uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
|
||||
- name: Setup Kustomize
|
||||
uses: fluxcd/pkg/actions/kustomize@30c101fc7c9fac4d84937ff4890a3da46a9db2dd # main
|
||||
uses: fluxcd/pkg/actions/kustomize@7e9c75bbb6a47b08c194edefa11d1c436e5bdd9e # main
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: fluxcdbot
|
||||
password: ${{ secrets.GHCR_TOKEN }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
with:
|
||||
username: fluxcdbot
|
||||
password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
|
||||
@@ -59,30 +59,19 @@ jobs:
|
||||
run: |
|
||||
kustomize build manifests/crds > all-crds.yaml
|
||||
- name: Generate OpenAPI JSON schemas from CRDs
|
||||
uses: fluxcd/pkg/actions/crdjsonschema@30c101fc7c9fac4d84937ff4890a3da46a9db2dd # main
|
||||
uses: fluxcd/pkg/actions/crdjsonschema@7e9c75bbb6a47b08c194edefa11d1c436e5bdd9e # main
|
||||
with:
|
||||
crd: all-crds.yaml
|
||||
output: schemas
|
||||
- name: Archive the OpenAPI JSON schemas
|
||||
run: |
|
||||
tar -czvf ./output/crd-schemas.tar.gz -C schemas .
|
||||
- name: Download release notes utility
|
||||
env:
|
||||
GH_REL_URL: https://github.com/buchanae/github-release-notes/releases/download/0.2.0/github-release-notes-linux-amd64-0.2.0.tar.gz
|
||||
run: cd /tmp && curl -sSL ${GH_REL_URL} | tar xz && sudo mv github-release-notes /usr/local/bin/
|
||||
- name: Generate release notes
|
||||
run: |
|
||||
NOTES="./output/notes.md"
|
||||
echo '## CLI Changelog' > ${NOTES}
|
||||
github-release-notes -org fluxcd -repo flux2 -since-latest-release -include-author >> ${NOTES}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Run GoReleaser
|
||||
id: run-goreleaser
|
||||
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
|
||||
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
|
||||
with:
|
||||
version: latest
|
||||
args: release --release-notes=output/notes.md --skip=validate
|
||||
args: release --skip=validate
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
@@ -93,13 +82,13 @@ jobs:
|
||||
ARTIFACTS: "${{ steps.run-goreleaser.outputs.artifacts }}"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
|
||||
hashes=$(echo -E $ARTIFACTS | jq --raw-output '.[] | {name, "digest": (.extra.Digest // .extra.Checksum)} | select(.digest) | {digest} + {name} | join(" ") | sub("^sha256:";"")' | base64 -w0)
|
||||
echo "hashes=$hashes" >> $GITHUB_OUTPUT
|
||||
|
||||
|
||||
image_url=fluxcd/flux-cli:$GITHUB_REF_NAME
|
||||
echo "image_url=$image_url" >> $GITHUB_OUTPUT
|
||||
|
||||
|
||||
image_digest=$(docker buildx imagetools inspect ${image_url} --format '{{json .}}' | jq -r .manifest.digest)
|
||||
echo "image_digest=$image_digest" >> $GITHUB_OUTPUT
|
||||
|
||||
@@ -110,9 +99,9 @@ jobs:
|
||||
id-token: write
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Kustomize
|
||||
uses: fluxcd/pkg/actions/kustomize@30c101fc7c9fac4d84937ff4890a3da46a9db2dd # main
|
||||
uses: fluxcd/pkg/actions/kustomize@7e9c75bbb6a47b08c194edefa11d1c436e5bdd9e # main
|
||||
- name: Setup Flux CLI
|
||||
uses: ./action/
|
||||
- name: Prepare
|
||||
@@ -121,13 +110,13 @@ jobs:
|
||||
VERSION=$(flux version --client | awk '{ print $NF }')
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: fluxcdbot
|
||||
password: ${{ secrets.GHCR_TOKEN }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
with:
|
||||
username: fluxcdbot
|
||||
password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
|
||||
@@ -137,7 +126,7 @@ jobs:
|
||||
flux install --registry=ghcr.io/fluxcd \
|
||||
--components-extra=image-reflector-controller,image-automation-controller \
|
||||
--export > ./ghcr.io/flux-system/gotk-components.yaml
|
||||
|
||||
|
||||
cd ./ghcr.io && flux push artifact \
|
||||
oci://ghcr.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }} \
|
||||
--path="./flux-system" \
|
||||
@@ -149,13 +138,13 @@ jobs:
|
||||
flux install --registry=docker.io/fluxcd \
|
||||
--components-extra=image-reflector-controller,image-automation-controller \
|
||||
--export > ./docker.io/flux-system/gotk-components.yaml
|
||||
|
||||
|
||||
cd ./docker.io && flux push artifact \
|
||||
oci://docker.io/fluxcd/flux-manifests:${{ steps.prep.outputs.version }} \
|
||||
--path="./flux-system" \
|
||||
--source=${{ github.repositoryUrl }} \
|
||||
--revision="${{ github.ref_name }}@sha1:${{ github.sha }}"
|
||||
- uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0
|
||||
- uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
|
||||
- name: Sign manifests
|
||||
env:
|
||||
COSIGN_EXPERIMENTAL: 1
|
||||
@@ -176,7 +165,7 @@ jobs:
|
||||
actions: read # for detecting the Github Actions environment.
|
||||
id-token: write # for creating OIDC tokens for signing.
|
||||
contents: write # for uploading attestations to GitHub releases.
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
|
||||
with:
|
||||
provenance-name: "provenance.intoto.jsonl"
|
||||
base64-subjects: "${{ needs.release-flux-cli.outputs.hashes }}"
|
||||
@@ -188,7 +177,7 @@ jobs:
|
||||
actions: read # for detecting the Github Actions environment.
|
||||
id-token: write # for creating OIDC tokens for signing.
|
||||
packages: write # for uploading attestations.
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0
|
||||
with:
|
||||
image: ${{ needs.release-flux-cli.outputs.image_url }}
|
||||
digest: ${{ needs.release-flux-cli.outputs.image_digest }}
|
||||
@@ -202,10 +191,10 @@ jobs:
|
||||
actions: read # for detecting the Github Actions environment.
|
||||
id-token: write # for creating OIDC tokens for signing.
|
||||
packages: write # for uploading attestations.
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0
|
||||
with:
|
||||
image: ghcr.io/${{ needs.release-flux-cli.outputs.image_url }}
|
||||
digest: ${{ needs.release-flux-cli.outputs.image_digest }}
|
||||
registry-username: fluxcdbot
|
||||
secrets:
|
||||
registry-password: ${{ secrets.GHCR_TOKEN }}
|
||||
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
47
.github/workflows/scan.yaml
vendored
47
.github/workflows/scan.yaml
vendored
@@ -17,47 +17,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.actor != 'dependabot[bot]'
|
||||
steps:
|
||||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Run FOSSA scan and upload build data
|
||||
uses: fossa-contrib/fossa-action@cdc5065bcdee31a32e47d4585df72d66e8e941c2 # v3.0.0
|
||||
uses: fossa-contrib/fossa-action@3d2ef181b1820d6dcd1972f86a767d18167fa19b # v3.0.1
|
||||
with:
|
||||
# FOSSA Push-Only API Token
|
||||
fossa-api-key: 5ee8bf422db1471e0bcf2bcb289185de
|
||||
github-token: ${{ github.token }}
|
||||
|
||||
scan-snyk:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
|
||||
steps:
|
||||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
- name: Setup Kustomize
|
||||
uses: fluxcd/pkg/actions/kustomize@30c101fc7c9fac4d84937ff4890a3da46a9db2dd # main
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
- name: Download modules and build manifests
|
||||
run: |
|
||||
make tidy
|
||||
make cmd/flux/.manifests.done
|
||||
- uses: snyk/actions/setup@b98d498629f1c368650224d6d212bf7dfa89e4bf
|
||||
- name: Run Snyk to check for vulnerabilities
|
||||
continue-on-error: true
|
||||
run: |
|
||||
snyk test --all-projects --sarif-file-output=snyk.sarif
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
- name: Upload result to GitHub Code Scanning
|
||||
continue-on-error: true
|
||||
uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
|
||||
with:
|
||||
sarif_file: snyk.sarif
|
||||
|
||||
scan-codeql:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
@@ -65,22 +32,22 @@ jobs:
|
||||
if: github.actor != 'dependabot[bot]'
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
|
||||
uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
|
||||
with:
|
||||
languages: go
|
||||
# xref: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# xref: https://codeql.github.com/codeql-query-help/go/
|
||||
queries: security-and-quality
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
|
||||
uses: github/codeql-action/autobuild@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
|
||||
uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
|
||||
|
||||
2
.github/workflows/sync-labels.yaml
vendored
2
.github/workflows/sync-labels.yaml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2.3.3
|
||||
with:
|
||||
# Configuration file
|
||||
|
||||
8
.github/workflows/update.yaml
vendored
8
.github/workflows/update.yaml
vendored
@@ -18,11 +18,11 @@ jobs:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: 1.23.x
|
||||
go-version: 1.24.x
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
@@ -84,7 +84,7 @@ jobs:
|
||||
|
||||
- name: Create Pull Request
|
||||
id: cpr
|
||||
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
|
||||
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
|
||||
with:
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
commit-message: |
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
project_name: flux
|
||||
changelog:
|
||||
use: github-native
|
||||
builds:
|
||||
- <<: &build_defaults
|
||||
binary: flux
|
||||
|
||||
5
.scorecard.yml
Normal file
5
.scorecard.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
annotations:
|
||||
- checks:
|
||||
- dangerous-workflow
|
||||
reasons:
|
||||
- reason: not-applicable # This workflow does not run untrusted code, the bot will only backport a code if the a PR was approved and merged into main.
|
||||
@@ -67,8 +67,8 @@ for source changes.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
* go >= 1.20
|
||||
* kubectl >= 1.24
|
||||
* go >= 1.24
|
||||
* kubectl >= 1.30
|
||||
* kustomize >= 5.0
|
||||
* coreutils (on Mac OS)
|
||||
|
||||
|
||||
13
Dockerfile
13
Dockerfile
@@ -1,15 +1,16 @@
|
||||
FROM alpine:3.20 as builder
|
||||
FROM alpine:3.21 AS builder
|
||||
|
||||
RUN apk add --no-cache ca-certificates curl
|
||||
|
||||
ARG ARCH=linux/amd64
|
||||
ARG KUBECTL_VER=1.31.0
|
||||
ARG KUBECTL_VER=1.33.0
|
||||
|
||||
RUN curl -sL https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VER}/bin/${ARCH}/kubectl \
|
||||
-o /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl && \
|
||||
kubectl version --client=true
|
||||
RUN curl -sL https://dl.k8s.io/release/v${KUBECTL_VER}/bin/${ARCH}/kubectl \
|
||||
-o /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
|
||||
|
||||
FROM alpine:3.20 as flux-cli
|
||||
RUN kubectl version --client=true
|
||||
|
||||
FROM alpine:3.21 AS flux-cli
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
|
||||
4
Makefile
4
Makefile
@@ -17,8 +17,8 @@ rwildcard=$(foreach d,$(wildcard $(addsuffix *,$(1))),$(call rwildcard,$(d)/,$(2
|
||||
all: test build
|
||||
|
||||
tidy:
|
||||
go mod tidy -compat=1.22
|
||||
cd tests/integration && go mod tidy -compat=1.22
|
||||
go mod tidy -compat=1.24
|
||||
cd tests/integration && go mod tidy -compat=1.24
|
||||
|
||||
fmt:
|
||||
go fmt ./...
|
||||
|
||||
@@ -26,15 +26,15 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
oci "github.com/fluxcd/pkg/oci/client"
|
||||
"github.com/fluxcd/pkg/oci"
|
||||
"github.com/fluxcd/pkg/sourceignore"
|
||||
)
|
||||
|
||||
var buildArtifactCmd = &cobra.Command{
|
||||
Use: "artifact",
|
||||
Short: "Build artifact",
|
||||
Long: withPreviewNote(`The build artifact command creates a tgz file with the manifests
|
||||
from the given directory or a single manifest file.`),
|
||||
Long: `The build artifact command creates a tgz file with the manifests
|
||||
from the given directory or a single manifest file.`,
|
||||
Example: ` # Build the given manifests directory into an artifact
|
||||
flux build artifact --path ./path/to/local/manifests --output ./path/to/artifact.tgz
|
||||
|
||||
|
||||
@@ -53,12 +53,12 @@ flux build kustomization my-app --path ./path/to/local/manifests \
|
||||
# Exclude files by providing a comma separated list of entries that follow the .gitignore pattern fromat.
|
||||
flux build kustomization my-app --path ./path/to/local/manifests \
|
||||
--kustomization-file ./path/to/local/my-app.yaml \
|
||||
--ignore-paths "/to_ignore/**/*.yaml,ignore.yaml
|
||||
--ignore-paths "/to_ignore/**/*.yaml,ignore.yaml"
|
||||
|
||||
# Run recursively on all encountered Kustomizations
|
||||
flux build kustomization my-app --path ./path/to/local/manifests \
|
||||
--recursive \
|
||||
--local-sources GitRepository/flux-system/my-repo=./path/to/local/git"`,
|
||||
--local-sources GitRepository/flux-system/my-repo=./path/to/local/git`,
|
||||
ValidArgsFunction: resourceNamesCompletionFunc(kustomizev1.GroupVersion.WithKind(kustomizev1.KustomizationKind)),
|
||||
RunE: buildKsCmdRun,
|
||||
}
|
||||
|
||||
@@ -169,6 +169,12 @@ spec:
|
||||
resultFile: "./testdata/build-kustomization/podinfo-with-my-app-result.yaml",
|
||||
assertFunc: "assertGoldenTemplateFile",
|
||||
},
|
||||
{
|
||||
name: "build with recursive in dry-run mode",
|
||||
args: "build kustomization podinfo --kustomization-file " + tmpFile + " --path ./testdata/build-kustomization/podinfo-with-my-app --recursive --local-sources GitRepository/default/podinfo=./testdata/build-kustomization --dry-run",
|
||||
resultFile: "./testdata/build-kustomization/podinfo-with-my-app-result.yaml",
|
||||
assertFunc: "assertGoldenTemplateFile",
|
||||
},
|
||||
}
|
||||
|
||||
tmpl := map[string]string{
|
||||
|
||||
@@ -60,7 +60,7 @@ type checkFlags struct {
|
||||
}
|
||||
|
||||
var kubernetesConstraints = []string{
|
||||
">=1.28.0-0",
|
||||
">=1.31.0-0",
|
||||
}
|
||||
|
||||
var checkArgs checkFlags
|
||||
@@ -217,7 +217,7 @@ func componentsCheck(ctx context.Context, kubeClient client.Client) bool {
|
||||
}
|
||||
}
|
||||
for _, c := range d.Spec.Template.Spec.Containers {
|
||||
logger.Actionf(c.Image)
|
||||
logger.Actionf("%s", c.Image)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -238,7 +238,7 @@ func crdsCheck(ctx context.Context, kubeClient client.Client) bool {
|
||||
for _, crd := range list.Items {
|
||||
versions := crd.Status.StoredVersions
|
||||
if len(versions) > 0 {
|
||||
logger.Successf(crd.Name + "/" + versions[len(versions)-1])
|
||||
logger.Successf("%s", crd.Name+"/"+versions[len(versions)-1])
|
||||
} else {
|
||||
ok = false
|
||||
logger.Failuref("no stored versions for %s", crd.Name)
|
||||
|
||||
@@ -125,7 +125,7 @@ func (names apiType) upsertAndWait(object upsertWaitable, mutate func() error) e
|
||||
logger.Generatef("generating %s", names.kind)
|
||||
logger.Actionf("applying %s", names.kind)
|
||||
|
||||
namespacedName, err := imageRepositoryType.upsert(ctx, kubeClient, object, mutate)
|
||||
namespacedName, err := names.upsert(ctx, kubeClient, object, mutate)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ import (
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
||||
"github.com/fluxcd/pkg/runtime/transform"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/flags"
|
||||
"github.com/fluxcd/flux2/v2/internal/utils"
|
||||
@@ -142,7 +141,7 @@ var helmReleaseArgs helmReleaseFlags
|
||||
|
||||
var supportedHelmReleaseValuesFromKinds = []string{"Secret", "ConfigMap"}
|
||||
|
||||
var supportedHelmReleaseReferenceKinds = []string{sourcev1b2.OCIRepositoryKind, sourcev1.HelmChartKind}
|
||||
var supportedHelmReleaseReferenceKinds = []string{sourcev1.OCIRepositoryKind, sourcev1.HelmChartKind}
|
||||
|
||||
func init() {
|
||||
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.name, "release-name", "", "name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'")
|
||||
@@ -222,7 +221,7 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
case helmReleaseArgs.chartRef != "":
|
||||
kind, name, ns := utils.ParseObjectKindNameNamespace(helmReleaseArgs.chartRef)
|
||||
if kind != sourcev1.HelmChartKind && kind != sourcev1b2.OCIRepositoryKind {
|
||||
if kind != sourcev1.HelmChartKind && kind != sourcev1.OCIRepositoryKind {
|
||||
return fmt.Errorf("chart reference kind '%s' is not supported, must be one of: %s",
|
||||
kind, strings.Join(supportedHelmReleaseReferenceKinds, ", "))
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"regexp/syntax"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
@@ -60,6 +61,8 @@ type imagePolicyFlags struct {
|
||||
numeric string
|
||||
filterRegex string
|
||||
filterExtract string
|
||||
reflectDigest string
|
||||
interval time.Duration
|
||||
}
|
||||
|
||||
var imagePolicyArgs = imagePolicyFlags{}
|
||||
@@ -72,6 +75,8 @@ func init() {
|
||||
flags.StringVar(&imagePolicyArgs.numeric, "select-numeric", "", "use numeric sorting to select image; either \"asc\" meaning select the last, or \"desc\" meaning select the first")
|
||||
flags.StringVar(&imagePolicyArgs.filterRegex, "filter-regex", "", "regular expression pattern used to filter the image tags")
|
||||
flags.StringVar(&imagePolicyArgs.filterExtract, "filter-extract", "", "replacement pattern (using capture groups from --filter-regex) to use for sorting")
|
||||
flags.StringVar(&imagePolicyArgs.reflectDigest, "reflect-digest", "", "the digest reflection policy to use when observing latest image tags (one of 'Never', 'IfNotPresent', 'Never')")
|
||||
flags.DurationVar(&imagePolicyArgs.interval, "interval", 0, "the interval at which to check for new image digests when the policy is set to 'Always'")
|
||||
|
||||
createImageCmd.AddCommand(createImagePolicyCmd)
|
||||
}
|
||||
@@ -153,6 +158,20 @@ func createImagePolicyRun(cmd *cobra.Command, args []string) error {
|
||||
return fmt.Errorf("cannot specify --filter-extract without specifying --filter-regex")
|
||||
}
|
||||
|
||||
if p := imagev1.ReflectionPolicy(imagePolicyArgs.reflectDigest); p != "" {
|
||||
if p != imagev1.ReflectNever && p != imagev1.ReflectIfNotPresent && p != imagev1.ReflectAlways {
|
||||
return fmt.Errorf("invalid value for --reflect-digest, must be one of 'Never', 'IfNotPresent', 'Always'")
|
||||
}
|
||||
policy.Spec.DigestReflectionPolicy = p
|
||||
}
|
||||
|
||||
if imagePolicyArgs.interval != 0 {
|
||||
if imagePolicyArgs.reflectDigest != string(imagev1.ReflectAlways) {
|
||||
return fmt.Errorf("the --interval flag can only be used with the 'Always' digest reflection policy, use --reflect-digest=Always")
|
||||
}
|
||||
policy.Spec.Interval = &metav1.Duration{Duration: imagePolicyArgs.interval}
|
||||
}
|
||||
|
||||
if createArgs.export {
|
||||
return printExport(exportImagePolicy(&policy))
|
||||
}
|
||||
|
||||
128
cmd/flux/create_secret_github_app.go
Normal file
128
cmd/flux/create_secret_github_app.go
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/utils"
|
||||
"github.com/fluxcd/flux2/v2/pkg/manifestgen/sourcesecret"
|
||||
"github.com/spf13/cobra"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
||||
var createSecretGitHubAppCmd = &cobra.Command{
|
||||
Use: "githubapp [name]",
|
||||
Short: "Create or update a github app secret",
|
||||
Long: withPreviewNote(`The create secret githubapp command generates a Kubernetes secret that can be used for GitRepository authentication with github app`),
|
||||
Example: ` # Create a githubapp authentication secret on disk and encrypt it with Mozilla SOPS
|
||||
flux create secret githubapp podinfo-auth \
|
||||
--app-id="1" \
|
||||
--app-installation-id="2" \
|
||||
--app-private-key=./private-key-file.pem \
|
||||
--export > githubapp-auth.yaml
|
||||
|
||||
sops --encrypt --encrypted-regex '^(data|stringData)$' \
|
||||
--in-place githubapp-auth.yaml
|
||||
`,
|
||||
RunE: createSecretGitHubAppCmdRun,
|
||||
}
|
||||
|
||||
type secretGitHubAppFlags struct {
|
||||
appID string
|
||||
appInstallationID string
|
||||
privateKeyFile string
|
||||
baseURL string
|
||||
}
|
||||
|
||||
var secretGitHubAppArgs = secretGitHubAppFlags{}
|
||||
|
||||
func init() {
|
||||
createSecretGitHubAppCmd.Flags().StringVar(&secretGitHubAppArgs.appID, "app-id", "", "github app ID")
|
||||
createSecretGitHubAppCmd.Flags().StringVar(&secretGitHubAppArgs.appInstallationID, "app-installation-id", "", "github app installation ID")
|
||||
createSecretGitHubAppCmd.Flags().StringVar(&secretGitHubAppArgs.privateKeyFile, "app-private-key", "", "github app private key file path")
|
||||
createSecretGitHubAppCmd.Flags().StringVar(&secretGitHubAppArgs.baseURL, "app-base-url", "", "github app base URL")
|
||||
|
||||
createSecretCmd.AddCommand(createSecretGitHubAppCmd)
|
||||
}
|
||||
|
||||
func createSecretGitHubAppCmdRun(cmd *cobra.Command, args []string) error {
|
||||
if len(args) < 1 {
|
||||
return fmt.Errorf("name is required")
|
||||
}
|
||||
|
||||
secretName := args[0]
|
||||
|
||||
if secretGitHubAppArgs.appID == "" {
|
||||
return fmt.Errorf("--app-id is required")
|
||||
}
|
||||
|
||||
if secretGitHubAppArgs.appInstallationID == "" {
|
||||
return fmt.Errorf("--app-installation-id is required")
|
||||
}
|
||||
|
||||
if secretGitHubAppArgs.privateKeyFile == "" {
|
||||
return fmt.Errorf("--app-private-key is required")
|
||||
}
|
||||
|
||||
privateKey, err := os.ReadFile(secretGitHubAppArgs.privateKeyFile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to read private key file: %w", err)
|
||||
}
|
||||
|
||||
opts := sourcesecret.Options{
|
||||
Name: secretName,
|
||||
Namespace: *kubeconfigArgs.Namespace,
|
||||
GitHubAppID: secretGitHubAppArgs.appID,
|
||||
GitHubAppInstallationID: secretGitHubAppArgs.appInstallationID,
|
||||
GitHubAppPrivateKey: string(privateKey),
|
||||
}
|
||||
|
||||
if secretGitHubAppArgs.baseURL != "" {
|
||||
opts.GitHubAppBaseURL = secretGitHubAppArgs.baseURL
|
||||
}
|
||||
|
||||
secret, err := sourcesecret.Generate(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if createArgs.export {
|
||||
rootCmd.Println(secret.Content)
|
||||
return nil
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
||||
defer cancel()
|
||||
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var s corev1.Secret
|
||||
if err := yaml.Unmarshal([]byte(secret.Content), &s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := upsertSecret(ctx, kubeClient, s); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
logger.Actionf("githubapp secret '%s' created in '%s' namespace", secretName, *kubeconfigArgs.Namespace)
|
||||
return nil
|
||||
}
|
||||
74
cmd/flux/create_secret_githubapp_test.go
Normal file
74
cmd/flux/create_secret_githubapp_test.go
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
Copyright 2022 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCreateSecretGitHubApp(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
args string
|
||||
assert assertFunc
|
||||
}{
|
||||
{
|
||||
name: "create githubapp secret with missing name",
|
||||
args: "create secret githubapp",
|
||||
assert: assertError("name is required"),
|
||||
},
|
||||
{
|
||||
name: "create githubapp secret with missing app-id",
|
||||
args: "create secret githubapp appinfo",
|
||||
assert: assertError("--app-id is required"),
|
||||
},
|
||||
{
|
||||
name: "create githubapp secret with missing appInstallationID",
|
||||
args: "create secret githubapp appinfo --app-id 1",
|
||||
assert: assertError("--app-installation-id is required"),
|
||||
},
|
||||
{
|
||||
name: "create githubapp secret with missing private key file",
|
||||
args: "create secret githubapp appinfo --app-id 1 --app-installation-id 2",
|
||||
assert: assertError("--app-private-key is required"),
|
||||
},
|
||||
{
|
||||
name: "create githubapp secret with private key file that does not exist",
|
||||
args: "create secret githubapp appinfo --app-id 1 --app-installation-id 2 --app-private-key pk.pem",
|
||||
assert: assertError("unable to read private key file: open pk.pem: no such file or directory"),
|
||||
},
|
||||
{
|
||||
name: "create githubapp secret with app info",
|
||||
args: "create secret githubapp appinfo --namespace my-namespace --app-id 1 --app-installation-id 2 --app-private-key ./testdata/create_secret/githubapp/test-private-key.pem --export",
|
||||
assert: assertGoldenFile("testdata/create_secret/githubapp/secret.yaml"),
|
||||
},
|
||||
{
|
||||
name: "create githubapp secret with appinfo and base url",
|
||||
args: "create secret githubapp appinfo --namespace my-namespace --app-id 1 --app-installation-id 2 --app-private-key ./testdata/create_secret/githubapp/test-private-key.pem --app-base-url www.example.com/api/v3 --export",
|
||||
assert: assertGoldenFile("testdata/create_secret/githubapp/secret-with-baseurl.yaml"),
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cmd := cmdTestCase{
|
||||
args: tt.args,
|
||||
assert: tt.assert,
|
||||
}
|
||||
cmd.runTestCmd(t)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -138,14 +138,14 @@ func init() {
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.branch, "branch", "", "git branch")
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.tag, "tag", "", "git tag")
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.semver, "tag-semver", "", "git tag semver range")
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.refName, "ref-name", "", " git reference name")
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.refName, "ref-name", "", "git reference name")
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.commit, "commit", "", "git commit")
|
||||
createSourceGitCmd.Flags().StringVarP(&sourceGitArgs.username, "username", "u", "", "basic authentication username")
|
||||
createSourceGitCmd.Flags().StringVarP(&sourceGitArgs.password, "password", "p", "", "basic authentication password")
|
||||
createSourceGitCmd.Flags().Var(&sourceGitArgs.keyAlgorithm, "ssh-key-algorithm", sourceGitArgs.keyAlgorithm.Description())
|
||||
createSourceGitCmd.Flags().Var(&sourceGitArgs.keyRSABits, "ssh-rsa-bits", sourceGitArgs.keyRSABits.Description())
|
||||
createSourceGitCmd.Flags().Var(&sourceGitArgs.keyECDSACurve, "ssh-ecdsa-curve", sourceGitArgs.keyECDSACurve.Description())
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.secretRef, "secret-ref", "", "the name of an existing secret containing SSH or basic credentials")
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.secretRef, "secret-ref", "", "the name of an existing secret containing SSH or basic credentials or github app authentication")
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.proxySecretRef, "proxy-secret-ref", "", "the name of an existing secret containing the proxy address and credentials")
|
||||
createSourceGitCmd.Flags().Var(&sourceGitArgs.provider, "provider", sourceGitArgs.provider.Description())
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.caFile, "ca-file", "", "path to TLS CA file used for validating self-signed certificates")
|
||||
|
||||
@@ -144,10 +144,15 @@ func TestCreateSourceGitExport(t *testing.T) {
|
||||
args: "create source git podinfo --namespace=flux-system --url=https://dev.azure.com/foo/bar/_git/podinfo --provider azure --branch=test --interval=1m0s --export",
|
||||
assert: assertGoldenFile("testdata/create_source_git/source-git-provider-azure.yaml"),
|
||||
},
|
||||
{
|
||||
name: "source with github provider",
|
||||
args: "create source git podinfo --namespace=flux-system --url=https://github.com/stefanprodan/podinfo --provider github --branch=test --interval=1m0s --secret-ref appinfo --export",
|
||||
assert: assertGoldenFile("testdata/create_source_git/source-git-provider-github.yaml"),
|
||||
},
|
||||
{
|
||||
name: "source with invalid provider",
|
||||
args: "create source git podinfo --namespace=flux-system --url=https://dev.azure.com/foo/bar/_git/podinfo --provider dummy --branch=test --interval=1m0s --export",
|
||||
assert: assertError("invalid argument \"dummy\" for \"--provider\" flag: source Git provider 'dummy' is not supported, must be one of: generic|azure"),
|
||||
assert: assertError("invalid argument \"dummy\" for \"--provider\" flag: source Git provider 'dummy' is not supported, must be one of: generic|azure|github"),
|
||||
},
|
||||
{
|
||||
name: "source with empty provider",
|
||||
|
||||
@@ -29,9 +29,7 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/flags"
|
||||
"github.com/fluxcd/flux2/v2/internal/utils"
|
||||
@@ -81,7 +79,7 @@ var sourceOCIRepositoryArgs = newSourceOCIFlags()
|
||||
|
||||
func newSourceOCIFlags() sourceOCIRepositoryFlags {
|
||||
return sourceOCIRepositoryFlags{
|
||||
provider: flags.SourceOCIProvider(sourcev1b2.GenericOCIProvider),
|
||||
provider: flags.SourceOCIProvider(sourcev1.GenericOCIProvider),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,20 +125,20 @@ func createSourceOCIRepositoryCmdRun(cmd *cobra.Command, args []string) error {
|
||||
ignorePaths = &ignorePathsStr
|
||||
}
|
||||
|
||||
repository := &sourcev1b2.OCIRepository{
|
||||
repository := &sourcev1.OCIRepository{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: *kubeconfigArgs.Namespace,
|
||||
Labels: sourceLabels,
|
||||
},
|
||||
Spec: sourcev1b2.OCIRepositorySpec{
|
||||
Spec: sourcev1.OCIRepositorySpec{
|
||||
Provider: sourceOCIRepositoryArgs.provider.String(),
|
||||
URL: sourceOCIRepositoryArgs.url,
|
||||
Insecure: sourceOCIRepositoryArgs.insecure,
|
||||
Interval: metav1.Duration{
|
||||
Duration: createArgs.interval,
|
||||
},
|
||||
Reference: &sourcev1b2.OCIRepositoryRef{},
|
||||
Reference: &sourcev1.OCIRepositoryRef{},
|
||||
Ignore: ignorePaths,
|
||||
},
|
||||
}
|
||||
@@ -237,13 +235,13 @@ func createSourceOCIRepositoryCmdRun(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
func upsertOCIRepository(ctx context.Context, kubeClient client.Client,
|
||||
ociRepository *sourcev1b2.OCIRepository) (types.NamespacedName, error) {
|
||||
ociRepository *sourcev1.OCIRepository) (types.NamespacedName, error) {
|
||||
namespacedName := types.NamespacedName{
|
||||
Namespace: ociRepository.GetNamespace(),
|
||||
Name: ociRepository.GetName(),
|
||||
}
|
||||
|
||||
var existing sourcev1b2.OCIRepository
|
||||
var existing sourcev1.OCIRepository
|
||||
err := kubeClient.Get(ctx, namespacedName, &existing)
|
||||
if err != nil {
|
||||
if errors.IsNotFound(err) {
|
||||
|
||||
31
cmd/flux/debug.go
Normal file
31
cmd/flux/debug.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var debugCmd = &cobra.Command{
|
||||
Use: "debug",
|
||||
Short: "Debug a flux resource",
|
||||
Long: `The debug command can be used to troubleshoot failing resource reconciliations.`,
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(debugCmd)
|
||||
}
|
||||
113
cmd/flux/debug_helmrelease.go
Normal file
113
cmd/flux/debug_helmrelease.go
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
helmv2 "github.com/fluxcd/helm-controller/api/v2"
|
||||
"github.com/fluxcd/pkg/chartutil"
|
||||
"github.com/go-logr/logr"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/utils"
|
||||
)
|
||||
|
||||
var debugHelmReleaseCmd = &cobra.Command{
|
||||
Use: "helmrelease [name]",
|
||||
Aliases: []string{"hr"},
|
||||
Short: "Debug a HelmRelease resource",
|
||||
Long: withPreviewNote(`The debug helmrelease command can be used to troubleshoot failing Helm release reconciliations.
|
||||
WARNING: This command will print sensitive information if Kubernetes Secrets are referenced in the HelmRelease .spec.valuesFrom field.`),
|
||||
Example: ` # Print the status of a Helm release
|
||||
flux debug hr podinfo --show-status
|
||||
|
||||
# Export the final values of a Helm release composed from referred ConfigMaps and Secrets
|
||||
flux debug hr podinfo --show-values > values.yaml`,
|
||||
RunE: debugHelmReleaseCmdRun,
|
||||
Args: cobra.ExactArgs(1),
|
||||
ValidArgsFunction: resourceNamesCompletionFunc(helmv2.GroupVersion.WithKind(helmv2.HelmReleaseKind)),
|
||||
}
|
||||
|
||||
type debugHelmReleaseFlags struct {
|
||||
showStatus bool
|
||||
showValues bool
|
||||
}
|
||||
|
||||
var debugHelmReleaseArgs debugHelmReleaseFlags
|
||||
|
||||
func init() {
|
||||
debugHelmReleaseCmd.Flags().BoolVar(&debugHelmReleaseArgs.showStatus, "show-status", false, "print the status of the Helm release")
|
||||
debugHelmReleaseCmd.Flags().BoolVar(&debugHelmReleaseArgs.showValues, "show-values", false, "print the final values of the Helm release")
|
||||
debugCmd.AddCommand(debugHelmReleaseCmd)
|
||||
}
|
||||
|
||||
func debugHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
||||
name := args[0]
|
||||
|
||||
if (!debugHelmReleaseArgs.showStatus && !debugHelmReleaseArgs.showValues) ||
|
||||
(debugHelmReleaseArgs.showStatus && debugHelmReleaseArgs.showValues) {
|
||||
return fmt.Errorf("either --show-status or --show-values must be set")
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
||||
defer cancel()
|
||||
|
||||
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hr := &helmv2.HelmRelease{}
|
||||
hrName := types.NamespacedName{Namespace: *kubeconfigArgs.Namespace, Name: name}
|
||||
if err := kubeClient.Get(ctx, hrName, hr); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if debugHelmReleaseArgs.showStatus {
|
||||
status, err := yaml.Marshal(hr.Status)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rootCmd.Println("# Status documentation: https://fluxcd.io/flux/components/helm/helmreleases/#helmrelease-status")
|
||||
rootCmd.Print(string(status))
|
||||
return nil
|
||||
}
|
||||
|
||||
if debugHelmReleaseArgs.showValues {
|
||||
finalValues, err := chartutil.ChartValuesFromReferences(ctx,
|
||||
logr.Discard(),
|
||||
kubeClient,
|
||||
hr.GetNamespace(),
|
||||
hr.GetValues(),
|
||||
hr.Spec.ValuesFrom...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
values, err := yaml.Marshal(finalValues)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rootCmd.Print(string(values))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
71
cmd/flux/debug_helmrelease_test.go
Normal file
71
cmd/flux/debug_helmrelease_test.go
Normal file
@@ -0,0 +1,71 @@
|
||||
//go:build unit
|
||||
// +build unit
|
||||
|
||||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDebugHelmRelease(t *testing.T) {
|
||||
namespace := allocateNamespace("debug")
|
||||
|
||||
objectFile := "testdata/debug_helmrelease/objects.yaml"
|
||||
tmpl := map[string]string{
|
||||
"fluxns": namespace,
|
||||
}
|
||||
testEnv.CreateObjectFile(objectFile, tmpl, t)
|
||||
|
||||
cases := []struct {
|
||||
name string
|
||||
arg string
|
||||
goldenFile string
|
||||
tmpl map[string]string
|
||||
}{
|
||||
{
|
||||
"debug status",
|
||||
"debug helmrelease test-values-inline --show-status --show-values=false",
|
||||
"testdata/debug_helmrelease/status.golden.yaml",
|
||||
tmpl,
|
||||
},
|
||||
{
|
||||
"debug values",
|
||||
"debug helmrelease test-values-inline --show-values --show-status=false",
|
||||
"testdata/debug_helmrelease/values-inline.golden.yaml",
|
||||
tmpl,
|
||||
},
|
||||
{
|
||||
"debug values from",
|
||||
"debug helmrelease test-values-from --show-values --show-status=false",
|
||||
"testdata/debug_helmrelease/values-from.golden.yaml",
|
||||
tmpl,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range cases {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cmd := cmdTestCase{
|
||||
args: tt.arg + " -n=" + namespace,
|
||||
assert: assertGoldenTemplateFile(tt.goldenFile, tmpl),
|
||||
}
|
||||
|
||||
cmd.runTestCmd(t)
|
||||
})
|
||||
}
|
||||
}
|
||||
134
cmd/flux/debug_kustomization.go
Normal file
134
cmd/flux/debug_kustomization.go
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
|
||||
"github.com/fluxcd/pkg/kustomize"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/utils"
|
||||
)
|
||||
|
||||
var debugKustomizationCmd = &cobra.Command{
|
||||
Use: "kustomization [name]",
|
||||
Aliases: []string{"ks"},
|
||||
Short: "Debug a Flux Kustomization resource",
|
||||
Long: withPreviewNote(`The debug kustomization command can be used to troubleshoot failing Flux Kustomization reconciliations.
|
||||
WARNING: This command will print sensitive information if Kubernetes Secrets are referenced in the Kustomization .spec.postBuild.substituteFrom field.`),
|
||||
Example: ` # Print the status of a Flux Kustomization
|
||||
flux debug ks podinfo --show-status
|
||||
|
||||
# Export the final variables used for post-build substitutions composed from referred ConfigMaps and Secrets
|
||||
flux debug ks podinfo --show-vars > vars.env`,
|
||||
RunE: debugKustomizationCmdRun,
|
||||
Args: cobra.ExactArgs(1),
|
||||
ValidArgsFunction: resourceNamesCompletionFunc(kustomizev1.GroupVersion.WithKind(kustomizev1.KustomizationKind)),
|
||||
}
|
||||
|
||||
type debugKustomizationFlags struct {
|
||||
showStatus bool
|
||||
showVars bool
|
||||
}
|
||||
|
||||
var debugKustomizationArgs debugKustomizationFlags
|
||||
|
||||
func init() {
|
||||
debugKustomizationCmd.Flags().BoolVar(&debugKustomizationArgs.showStatus, "show-status", false, "print the status of the Flux Kustomization")
|
||||
debugKustomizationCmd.Flags().BoolVar(&debugKustomizationArgs.showVars, "show-vars", false, "print the final vars of the Flux Kustomization in dot env format")
|
||||
debugCmd.AddCommand(debugKustomizationCmd)
|
||||
}
|
||||
|
||||
func debugKustomizationCmdRun(cmd *cobra.Command, args []string) error {
|
||||
name := args[0]
|
||||
|
||||
if (!debugKustomizationArgs.showStatus && !debugKustomizationArgs.showVars) ||
|
||||
(debugKustomizationArgs.showStatus && debugKustomizationArgs.showVars) {
|
||||
return fmt.Errorf("either --show-status or --show-vars must be set")
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
||||
defer cancel()
|
||||
|
||||
kubeClient, err := utils.KubeClient(kubeconfigArgs, kubeclientOptions)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ks := &kustomizev1.Kustomization{}
|
||||
ksName := types.NamespacedName{Namespace: *kubeconfigArgs.Namespace, Name: name}
|
||||
if err := kubeClient.Get(ctx, ksName, ks); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if debugKustomizationArgs.showStatus {
|
||||
status, err := yaml.Marshal(ks.Status)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rootCmd.Println("# Status documentation: https://fluxcd.io/flux/components/kustomize/kustomizations/#kustomization-status")
|
||||
rootCmd.Print(string(status))
|
||||
return nil
|
||||
}
|
||||
|
||||
if debugKustomizationArgs.showVars {
|
||||
if ks.Spec.PostBuild == nil {
|
||||
return errors.New("no post build substitutions found")
|
||||
}
|
||||
|
||||
ksObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(ks)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
finalVars, err := kustomize.LoadVariables(ctx, kubeClient, unstructured.Unstructured{Object: ksObj})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(ks.Spec.PostBuild.Substitute) > 0 {
|
||||
for k, v := range ks.Spec.PostBuild.Substitute {
|
||||
// Remove new lines from the values as they are not supported.
|
||||
// Replicates the controller behavior from
|
||||
// https://github.com/fluxcd/pkg/blob/main/kustomize/kustomize_varsub.go
|
||||
finalVars[k] = strings.ReplaceAll(v, "\n", "")
|
||||
}
|
||||
}
|
||||
|
||||
keys := make([]string, 0, len(finalVars))
|
||||
for k := range finalVars {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
for _, k := range keys {
|
||||
rootCmd.Println(k + "=" + finalVars[k])
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
71
cmd/flux/debug_kustomization_test.go
Normal file
71
cmd/flux/debug_kustomization_test.go
Normal file
@@ -0,0 +1,71 @@
|
||||
//go:build unit
|
||||
// +build unit
|
||||
|
||||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDebugKustomization(t *testing.T) {
|
||||
namespace := allocateNamespace("debug")
|
||||
|
||||
objectFile := "testdata/debug_kustomization/objects.yaml"
|
||||
tmpl := map[string]string{
|
||||
"fluxns": namespace,
|
||||
}
|
||||
testEnv.CreateObjectFile(objectFile, tmpl, t)
|
||||
|
||||
cases := []struct {
|
||||
name string
|
||||
arg string
|
||||
goldenFile string
|
||||
tmpl map[string]string
|
||||
}{
|
||||
{
|
||||
"debug status",
|
||||
"debug ks test --show-status --show-vars=false",
|
||||
"testdata/debug_kustomization/status.golden.yaml",
|
||||
tmpl,
|
||||
},
|
||||
{
|
||||
"debug vars",
|
||||
"debug ks test --show-vars --show-status=false",
|
||||
"testdata/debug_kustomization/vars.golden.env",
|
||||
tmpl,
|
||||
},
|
||||
{
|
||||
"debug vars from",
|
||||
"debug ks test-from --show-vars --show-status=false",
|
||||
"testdata/debug_kustomization/vars-from.golden.env",
|
||||
tmpl,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range cases {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cmd := cmdTestCase{
|
||||
args: tt.arg + " -n=" + namespace,
|
||||
assert: assertGoldenTemplateFile(tt.goldenFile, tmpl),
|
||||
}
|
||||
|
||||
cmd.runTestCmd(t)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ package main
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
)
|
||||
|
||||
var deleteSourceChartCmd = &cobra.Command{
|
||||
|
||||
@@ -19,7 +19,7 @@ package main
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
)
|
||||
|
||||
var deleteSourceOCIRepositoryCmd = &cobra.Command{
|
||||
|
||||
@@ -21,8 +21,9 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
oci "github.com/fluxcd/pkg/oci/client"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
"github.com/fluxcd/pkg/oci"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
"github.com/google/go-containerregistry/pkg/crane"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/flags"
|
||||
@@ -31,7 +32,7 @@ import (
|
||||
var diffArtifactCmd = &cobra.Command{
|
||||
Use: "artifact",
|
||||
Short: "Diff Artifact",
|
||||
Long: withPreviewNote(`The diff artifact command computes the diff between the remote OCI artifact and a local directory or file`),
|
||||
Long: `The diff artifact command computes the diff between the remote OCI artifact and a local directory or file`,
|
||||
Example: `# Check if local files differ from remote
|
||||
flux diff artifact oci://ghcr.io/stefanprodan/manifests:podinfo:6.2.0 --path=./kustomize`,
|
||||
RunE: diffArtifactCmdRun,
|
||||
@@ -42,6 +43,7 @@ type diffArtifactFlags struct {
|
||||
creds string
|
||||
provider flags.SourceOCIProvider
|
||||
ignorePaths []string
|
||||
insecure bool
|
||||
}
|
||||
|
||||
var diffArtifactArgs = newDiffArtifactArgs()
|
||||
@@ -57,6 +59,7 @@ func init() {
|
||||
diffArtifactCmd.Flags().StringVar(&diffArtifactArgs.creds, "creds", "", "credentials for OCI registry in the format <username>[:<password>] if --provider is generic")
|
||||
diffArtifactCmd.Flags().Var(&diffArtifactArgs.provider, "provider", sourceOCIRepositoryArgs.provider.Description())
|
||||
diffArtifactCmd.Flags().StringSliceVar(&diffArtifactArgs.ignorePaths, "ignore-paths", excludeOCI, "set paths to ignore in .gitignore format")
|
||||
diffArtifactCmd.Flags().BoolVar(&diffArtifactArgs.insecure, "insecure-registry", false, "allows the remote artifact to be pulled without TLS")
|
||||
diffCmd.AddCommand(diffArtifactCmd)
|
||||
}
|
||||
|
||||
@@ -82,7 +85,22 @@ func diffArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
||||
defer cancel()
|
||||
|
||||
ociClient := oci.NewClient(oci.DefaultOptions())
|
||||
opts := oci.DefaultOptions()
|
||||
|
||||
if diffArtifactArgs.insecure {
|
||||
opts = append(opts, crane.Insecure)
|
||||
}
|
||||
|
||||
if diffArtifactArgs.provider.String() != sourcev1.GenericOCIProvider {
|
||||
logger.Actionf("logging in to registry with provider credentials")
|
||||
opt, err := loginWithProvider(ctx, url, diffArtifactArgs.provider.String())
|
||||
if err != nil {
|
||||
return fmt.Errorf("error during login with provider: %w", err)
|
||||
}
|
||||
opts = append(opts, opt)
|
||||
}
|
||||
|
||||
ociClient := oci.NewClient(opts)
|
||||
|
||||
if diffArtifactArgs.provider.String() == sourcev1.GenericOCIProvider && diffArtifactArgs.creds != "" {
|
||||
logger.Actionf("logging in to registry with credentials")
|
||||
@@ -91,18 +109,6 @@ func diffArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
if diffArtifactArgs.provider.String() != sourcev1.GenericOCIProvider {
|
||||
logger.Actionf("logging in to registry with provider credentials")
|
||||
ociProvider, err := diffArtifactArgs.provider.ToOCIProvider()
|
||||
if err != nil {
|
||||
return fmt.Errorf("provider not supported: %w", err)
|
||||
}
|
||||
|
||||
if err := ociClient.LoginWithProvider(ctx, url, ociProvider); err != nil {
|
||||
return fmt.Errorf("error during login with provider: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := ociClient.Diff(ctx, url, diffArtifactArgs.path, diffArtifactArgs.ignorePaths); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func TestDiffArtifact(t *testing.T) {
|
||||
tt.url = fmt.Sprintf(tt.url, dockerReg)
|
||||
_, err := executeCommand("push artifact " + tt.url + " --path=" + tt.pushFile + " --source=test --revision=test")
|
||||
if err != nil {
|
||||
t.Fatalf(fmt.Errorf("failed to push image: %w", err).Error())
|
||||
t.Fatal(fmt.Errorf("failed to push image: %w", err).Error())
|
||||
}
|
||||
|
||||
cmd := cmdTestCase{
|
||||
|
||||
@@ -44,12 +44,12 @@ flux diff kustomization my-app --path ./path/to/local/manifests \
|
||||
# Exclude files by providing a comma separated list of entries that follow the .gitignore pattern fromat.
|
||||
flux diff kustomization my-app --path ./path/to/local/manifests \
|
||||
--kustomization-file ./path/to/local/my-app.yaml \
|
||||
--ignore-paths "/to_ignore/**/*.yaml,ignore.yaml
|
||||
--ignore-paths "/to_ignore/**/*.yaml,ignore.yaml"
|
||||
|
||||
# Run recursively on all encountered Kustomizations
|
||||
flux diff kustomization my-app --path ./path/to/local/manifests \
|
||||
--recursive \
|
||||
--local-sources GitRepository/flux-system/my-repo=./path/to/local/git"`,
|
||||
--local-sources GitRepository/flux-system/my-repo=./path/to/local/git`,
|
||||
ValidArgsFunction: resourceNamesCompletionFunc(kustomizev1.GroupVersion.WithKind(kustomizev1.KustomizationKind)),
|
||||
RunE: diffKsCmdRun,
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ import (
|
||||
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
|
||||
notificationv1b3 "github.com/fluxcd/notification-controller/api/v1beta3"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/utils"
|
||||
"github.com/fluxcd/flux2/v2/pkg/printers"
|
||||
@@ -446,7 +445,7 @@ var fluxKindMap = refMap{
|
||||
field: []string{"spec", "sourceRef"},
|
||||
},
|
||||
sourcev1.GitRepositoryKind: {gvk: sourcev1.GroupVersion.WithKind(sourcev1.GitRepositoryKind)},
|
||||
sourcev1b2.OCIRepositoryKind: {gvk: sourcev1b2.GroupVersion.WithKind(sourcev1b2.OCIRepositoryKind)},
|
||||
sourcev1.OCIRepositoryKind: {gvk: sourcev1.GroupVersion.WithKind(sourcev1.OCIRepositoryKind)},
|
||||
sourcev1.BucketKind: {gvk: sourcev1.GroupVersion.WithKind(sourcev1.BucketKind)},
|
||||
sourcev1.HelmRepositoryKind: {gvk: sourcev1.GroupVersion.WithKind(sourcev1.HelmRepositoryKind)},
|
||||
autov1.ImageUpdateAutomationKind: {gvk: autov1.GroupVersion.WithKind(autov1.ImageUpdateAutomationKind)},
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
)
|
||||
|
||||
var exportSourceOCIRepositoryCmd = &cobra.Command{
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
//go:build unit
|
||||
// +build unit
|
||||
|
||||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
@@ -184,13 +184,13 @@ func (get getCommand) run(cmd *cobra.Command, args []string) error {
|
||||
|
||||
if get.list.len() == 0 {
|
||||
if len(args) > 0 {
|
||||
logger.Failuref("%s object '%s' not found in %s namespace",
|
||||
return fmt.Errorf("%s object '%s' not found in %s namespace",
|
||||
get.kind,
|
||||
args[0],
|
||||
namespaceNameOrAny(getArgs.allNamespaces, *kubeconfigArgs.Namespace),
|
||||
)
|
||||
} else if !getAll {
|
||||
logger.Failuref("no %s objects found in %s namespace",
|
||||
return fmt.Errorf("no %s objects found in %s namespace",
|
||||
get.kind,
|
||||
namespaceNameOrAny(getArgs.allNamespaces, *kubeconfigArgs.Namespace),
|
||||
)
|
||||
|
||||
@@ -87,7 +87,7 @@ var getAllCmd = &cobra.Command{
|
||||
|
||||
func logError(err error) {
|
||||
if !apimeta.IsNoMatchError(err) {
|
||||
logger.Failuref(err.Error())
|
||||
logger.Failuref("%s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ var getImageAllCmd = &cobra.Command{
|
||||
|
||||
for _, c := range allImageCmd {
|
||||
if err := c.run(cmd, args); err != nil {
|
||||
logger.Failuref(err.Error())
|
||||
logger.Failuref("%s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import (
|
||||
apimeta "k8s.io/apimachinery/pkg/api/meta"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
)
|
||||
|
||||
var getSourceAllCmd = &cobra.Command{
|
||||
@@ -42,7 +41,7 @@ var getSourceAllCmd = &cobra.Command{
|
||||
var allSourceCmd = []getCommand{
|
||||
{
|
||||
apiType: ociRepositoryType,
|
||||
list: &ociRepositoryListAdapter{&sourcev1b2.OCIRepositoryList{}},
|
||||
list: &ociRepositoryListAdapter{&sourcev1.OCIRepositoryList{}},
|
||||
},
|
||||
{
|
||||
apiType: bucketType,
|
||||
@@ -65,7 +64,7 @@ var getSourceAllCmd = &cobra.Command{
|
||||
for _, c := range allSourceCmd {
|
||||
if err := c.run(cmd, args); err != nil {
|
||||
if !apimeta.IsNoMatchError(err) {
|
||||
logger.Failuref(err.Error())
|
||||
logger.Failuref("%s", err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import (
|
||||
"golang.org/x/text/language"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/utils"
|
||||
)
|
||||
|
||||
@@ -19,7 +19,10 @@ limitations under the License.
|
||||
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_GetCmd(t *testing.T) {
|
||||
tmpl := map[string]string{
|
||||
@@ -59,3 +62,76 @@ func Test_GetCmd(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_GetCmdErrors(t *testing.T) {
|
||||
tmpl := map[string]string{
|
||||
"fluxns": allocateNamespace("flux-system"),
|
||||
}
|
||||
testEnv.CreateObjectFile("./testdata/get/objects.yaml", tmpl, t)
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
args string
|
||||
assert assertFunc
|
||||
}{
|
||||
{
|
||||
name: "specific object not found",
|
||||
args: "get kustomization non-existent-resource -n " + tmpl["fluxns"],
|
||||
assert: assertError(fmt.Sprintf("Kustomization object 'non-existent-resource' not found in \"%s\" namespace", tmpl["fluxns"])),
|
||||
},
|
||||
{
|
||||
name: "no objects found in namespace",
|
||||
args: "get helmrelease -n " + tmpl["fluxns"],
|
||||
assert: assertError(fmt.Sprintf("no HelmRelease objects found in \"%s\" namespace", tmpl["fluxns"])),
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cmd := cmdTestCase{
|
||||
args: tt.args,
|
||||
assert: tt.assert,
|
||||
}
|
||||
cmd.runTestCmd(t)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_GetCmdSuccess(t *testing.T) {
|
||||
tmpl := map[string]string{
|
||||
"fluxns": allocateNamespace("flux-system"),
|
||||
}
|
||||
testEnv.CreateObjectFile("./testdata/get/objects.yaml", tmpl, t)
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
args string
|
||||
assert assertFunc
|
||||
}{
|
||||
{
|
||||
name: "list sources git",
|
||||
args: "get sources git -n " + tmpl["fluxns"],
|
||||
assert: assertSuccess(),
|
||||
},
|
||||
{
|
||||
name: "get help",
|
||||
args: "get --help",
|
||||
assert: assertSuccess(),
|
||||
},
|
||||
{
|
||||
name: "get with all namespaces flag",
|
||||
args: "get sources git -A",
|
||||
assert: assertSuccess(),
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
cmd := cmdTestCase{
|
||||
args: tt.args,
|
||||
assert: tt.assert,
|
||||
}
|
||||
cmd.runTestCmd(t)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ func TestImageScanning(t *testing.T) {
|
||||
"testdata/image/create_image_repository.golden",
|
||||
},
|
||||
{
|
||||
"create image policy podinfo-semver --image-ref=podinfo --interval=10m --select-semver=5.0.x",
|
||||
"create image policy podinfo-semver --image-ref=podinfo --interval=10m --reflect-digest=Always --select-semver=5.0.x",
|
||||
"testdata/image/create_image_policy.golden",
|
||||
},
|
||||
{
|
||||
@@ -46,7 +46,7 @@ func TestImageScanning(t *testing.T) {
|
||||
"testdata/image/get_image_policy_semver.golden",
|
||||
},
|
||||
{
|
||||
`create image policy podinfo-regex --image-ref=podinfo --interval=10m --select-semver=">4.0.0" --filter-regex="5\.0\.0"`,
|
||||
`create image policy podinfo-regex --image-ref=podinfo --select-semver=">4.0.0" --filter-regex="5\.0\.0"`,
|
||||
"testdata/image/create_image_policy.golden",
|
||||
},
|
||||
{
|
||||
|
||||
@@ -20,10 +20,11 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/google/go-containerregistry/pkg/crane"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
oci "github.com/fluxcd/pkg/oci/client"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
"github.com/fluxcd/pkg/oci"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/flags"
|
||||
"github.com/fluxcd/flux2/v2/pkg/printers"
|
||||
@@ -34,6 +35,7 @@ type listArtifactFlags struct {
|
||||
regexFilter string
|
||||
creds string
|
||||
provider flags.SourceOCIProvider
|
||||
insecure bool
|
||||
}
|
||||
|
||||
var listArtifactArgs = newListArtifactFlags()
|
||||
@@ -47,8 +49,8 @@ func newListArtifactFlags() listArtifactFlags {
|
||||
var listArtifactsCmd = &cobra.Command{
|
||||
Use: "artifacts",
|
||||
Short: "list artifacts",
|
||||
Long: withPreviewNote(`The list command fetches the tags and their metadata from a remote OCI repository.
|
||||
The command can read the credentials from '~/.docker/config.json' but they can also be passed with --creds. It can also login to a supported provider with the --provider flag.`),
|
||||
Long: `The list command fetches the tags and their metadata from a remote OCI repository.
|
||||
The command can read the credentials from '~/.docker/config.json' but they can also be passed with --creds. It can also login to a supported provider with the --provider flag.`,
|
||||
Example: ` # List the artifacts stored in an OCI repository
|
||||
flux list artifact oci://ghcr.io/org/config/app
|
||||
`,
|
||||
@@ -60,6 +62,7 @@ func init() {
|
||||
listArtifactsCmd.Flags().StringVar(&listArtifactArgs.regexFilter, "filter-regex", "", "filter tags returned from the oci repository using regex")
|
||||
listArtifactsCmd.Flags().StringVar(&listArtifactArgs.creds, "creds", "", "credentials for OCI registry in the format <username>[:<password>] if --provider is generic")
|
||||
listArtifactsCmd.Flags().Var(&listArtifactArgs.provider, "provider", listArtifactArgs.provider.Description())
|
||||
listArtifactsCmd.Flags().BoolVar(&listArtifactArgs.insecure, "insecure-registry", false, "allows the remote artifacts list to be fetched without TLS")
|
||||
|
||||
listCmd.AddCommand(listArtifactsCmd)
|
||||
}
|
||||
@@ -78,7 +81,22 @@ func listArtifactsCmdRun(cmd *cobra.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
ociClient := oci.NewClient(oci.DefaultOptions())
|
||||
ociOpts := oci.DefaultOptions()
|
||||
|
||||
if listArtifactArgs.provider.String() != sourcev1.GenericOCIProvider {
|
||||
logger.Actionf("logging in to registry with provider credentials")
|
||||
ociOpt, err := loginWithProvider(ctx, url, listArtifactArgs.provider.String())
|
||||
if err != nil {
|
||||
return fmt.Errorf("error during login with provider: %w", err)
|
||||
}
|
||||
ociOpts = append(ociOpts, ociOpt)
|
||||
}
|
||||
|
||||
if listArtifactArgs.insecure {
|
||||
ociOpts = append(ociOpts, crane.Insecure)
|
||||
}
|
||||
|
||||
ociClient := oci.NewClient(ociOpts)
|
||||
|
||||
if listArtifactArgs.provider.String() == sourcev1.GenericOCIProvider && listArtifactArgs.creds != "" {
|
||||
logger.Actionf("logging in to registry with credentials")
|
||||
@@ -87,18 +105,6 @@ func listArtifactsCmdRun(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
if listArtifactArgs.provider.String() != sourcev1.GenericOCIProvider {
|
||||
logger.Actionf("logging in to registry with provider credentials")
|
||||
ociProvider, err := listArtifactArgs.provider.ToOCIProvider()
|
||||
if err != nil {
|
||||
return fmt.Errorf("provider not supported: %w", err)
|
||||
}
|
||||
|
||||
if err := ociClient.LoginWithProvider(ctx, url, ociProvider); err != nil {
|
||||
return fmt.Errorf("error during login with provider: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
opts := oci.ListOptions{
|
||||
RegexFilter: listArtifactArgs.regexFilter,
|
||||
SemverFilter: listArtifactArgs.semverFilter,
|
||||
|
||||
@@ -469,6 +469,8 @@ func resetCmdArgs() {
|
||||
output: "yaml",
|
||||
}
|
||||
envsubstArgs = envsubstFlags{}
|
||||
debugHelmReleaseArgs = debugHelmReleaseFlags{}
|
||||
debugKustomizationArgs = debugKustomizationFlags{}
|
||||
}
|
||||
|
||||
func isChangeError(err error) bool {
|
||||
|
||||
45
cmd/flux/oci.go
Normal file
45
cmd/flux/oci.go
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
Copyright 2025 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/google/go-containerregistry/pkg/crane"
|
||||
|
||||
"github.com/fluxcd/pkg/auth"
|
||||
"github.com/fluxcd/pkg/auth/azure"
|
||||
authutils "github.com/fluxcd/pkg/auth/utils"
|
||||
)
|
||||
|
||||
// loginWithProvider gets a crane authentication option for the given provider and URL.
|
||||
func loginWithProvider(ctx context.Context, url, provider string) (crane.Option, error) {
|
||||
var opts []auth.Option
|
||||
if provider == azure.ProviderName {
|
||||
opts = append(opts, auth.WithAllowShellOut())
|
||||
}
|
||||
authenticator, err := authutils.GetArtifactRegistryCredentials(ctx, provider, url, opts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not login to provider %s with url %s: %w", provider, url, err)
|
||||
}
|
||||
if authenticator == nil {
|
||||
return nil, errors.New("unsupported provider")
|
||||
}
|
||||
return crane.WithAuth(authenticator), nil
|
||||
}
|
||||
@@ -21,19 +21,20 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
"github.com/google/go-containerregistry/pkg/crane"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/flags"
|
||||
"github.com/fluxcd/pkg/oci"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
|
||||
oci "github.com/fluxcd/pkg/oci/client"
|
||||
"github.com/fluxcd/flux2/v2/internal/flags"
|
||||
)
|
||||
|
||||
var pullArtifactCmd = &cobra.Command{
|
||||
Use: "artifact",
|
||||
Short: "Pull artifact",
|
||||
Long: withPreviewNote(`The pull artifact command downloads and extracts the OCI artifact content to the given path.
|
||||
The command can read the credentials from '~/.docker/config.json' but they can also be passed with --creds. It can also login to a supported provider with the --provider flag.`),
|
||||
Long: `The pull artifact command downloads and extracts the OCI artifact content to the given path.
|
||||
The command can read the credentials from '~/.docker/config.json' but they can also be passed with --creds. It can also login to a supported provider with the --provider flag.`,
|
||||
Example: ` # Pull an OCI artifact created by flux from GHCR
|
||||
flux pull artifact oci://ghcr.io/org/manifests/app:v0.0.1 --output ./path/to/local/manifests
|
||||
`,
|
||||
@@ -43,6 +44,7 @@ The command can read the credentials from '~/.docker/config.json' but they can a
|
||||
type pullArtifactFlags struct {
|
||||
output string
|
||||
creds string
|
||||
insecure bool
|
||||
provider flags.SourceOCIProvider
|
||||
}
|
||||
|
||||
@@ -58,6 +60,7 @@ func init() {
|
||||
pullArtifactCmd.Flags().StringVarP(&pullArtifactArgs.output, "output", "o", "", "path where the artifact content should be extracted.")
|
||||
pullArtifactCmd.Flags().StringVar(&pullArtifactArgs.creds, "creds", "", "credentials for OCI registry in the format <username>[:<password>] if --provider is generic")
|
||||
pullArtifactCmd.Flags().Var(&pullArtifactArgs.provider, "provider", sourceOCIRepositoryArgs.provider.Description())
|
||||
pullArtifactCmd.Flags().BoolVar(&pullArtifactArgs.insecure, "insecure-registry", false, "allows artifacts to be pulled without TLS")
|
||||
pullCmd.AddCommand(pullArtifactCmd)
|
||||
}
|
||||
|
||||
@@ -83,7 +86,22 @@ func pullArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
||||
defer cancel()
|
||||
|
||||
ociClient := oci.NewClient(oci.DefaultOptions())
|
||||
opts := oci.DefaultOptions()
|
||||
|
||||
if pullArtifactArgs.insecure {
|
||||
opts = append(opts, crane.Insecure)
|
||||
}
|
||||
|
||||
if pullArtifactArgs.provider.String() != sourcev1.GenericOCIProvider {
|
||||
logger.Actionf("logging in to registry with provider credentials")
|
||||
opt, err := loginWithProvider(ctx, url, pullArtifactArgs.provider.String())
|
||||
if err != nil {
|
||||
return fmt.Errorf("error during login with provider: %w", err)
|
||||
}
|
||||
opts = append(opts, opt)
|
||||
}
|
||||
|
||||
ociClient := oci.NewClient(opts)
|
||||
|
||||
if pullArtifactArgs.provider.String() == sourcev1.GenericOCIProvider && pullArtifactArgs.creds != "" {
|
||||
logger.Actionf("logging in to registry with credentials")
|
||||
@@ -92,18 +110,6 @@ func pullArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
if pullArtifactArgs.provider.String() != sourcev1.GenericOCIProvider {
|
||||
logger.Actionf("logging in to registry with provider credentials")
|
||||
ociProvider, err := pullArtifactArgs.provider.ToOCIProvider()
|
||||
if err != nil {
|
||||
return fmt.Errorf("provider not supported: %w", err)
|
||||
}
|
||||
|
||||
if err := ociClient.LoginWithProvider(ctx, url, ociProvider); err != nil {
|
||||
return fmt.Errorf("error during login with provider: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
logger.Actionf("pulling artifact from %s", url)
|
||||
|
||||
meta, err := ociClient.Pull(ctx, url, pullArtifactArgs.output)
|
||||
|
||||
@@ -19,6 +19,7 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
@@ -33,10 +34,11 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"github.com/fluxcd/pkg/auth"
|
||||
"github.com/fluxcd/pkg/auth/azure"
|
||||
authutils "github.com/fluxcd/pkg/auth/utils"
|
||||
"github.com/fluxcd/pkg/oci"
|
||||
"github.com/fluxcd/pkg/oci/auth/login"
|
||||
"github.com/fluxcd/pkg/oci/client"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/flags"
|
||||
)
|
||||
@@ -44,8 +46,8 @@ import (
|
||||
var pushArtifactCmd = &cobra.Command{
|
||||
Use: "artifact",
|
||||
Short: "Push artifact",
|
||||
Long: withPreviewNote(`The push artifact command creates a tarball from the given directory or the single file and uploads the artifact to an OCI repository.
|
||||
The command can read the credentials from '~/.docker/config.json' but they can also be passed with --creds. It can also login to a supported provider with the --provider flag.`),
|
||||
Long: `The push artifact command creates a tarball from the given directory or the single file and uploads the artifact to an OCI repository.
|
||||
The command can read the credentials from '~/.docker/config.json' but they can also be passed with --creds. It can also login to a supported provider with the --provider flag.`,
|
||||
Example: ` # Push manifests to GHCR using the short Git SHA as the OCI artifact tag
|
||||
echo $GITHUB_PAT | docker login ghcr.io --username flux --password-stdin
|
||||
flux push artifact oci://ghcr.io/org/config/app:$(git rev-parse --short HEAD) \
|
||||
@@ -115,6 +117,7 @@ type pushArtifactFlags struct {
|
||||
output string
|
||||
debug bool
|
||||
reproducible bool
|
||||
insecure bool
|
||||
}
|
||||
|
||||
var pushArtifactArgs = newPushArtifactFlags()
|
||||
@@ -137,6 +140,7 @@ func init() {
|
||||
"the format in which the artifact digest should be printed, can be 'json' or 'yaml'")
|
||||
pushArtifactCmd.Flags().BoolVarP(&pushArtifactArgs.debug, "debug", "", false, "display logs from underlying library")
|
||||
pushArtifactCmd.Flags().BoolVar(&pushArtifactArgs.reproducible, "reproducible", false, "ensure reproducible image digests by setting the created timestamp to '1970-01-01T00:00:00Z'")
|
||||
pushArtifactCmd.Flags().BoolVar(&pushArtifactArgs.insecure, "insecure-registry", false, "allows artifacts to be pushed without TLS")
|
||||
|
||||
pushCmd.AddCommand(pushArtifactCmd)
|
||||
}
|
||||
@@ -159,7 +163,7 @@ func pushArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||
return fmt.Errorf("invalid path %q", pushArtifactArgs.path)
|
||||
}
|
||||
|
||||
url, err := client.ParseArtifactURL(ociURL)
|
||||
url, err := oci.ParseArtifactURL(ociURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -198,7 +202,7 @@ func pushArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||
logs.Warn.SetOutput(os.Stderr)
|
||||
}
|
||||
|
||||
meta := client.Metadata{
|
||||
meta := oci.Metadata{
|
||||
Source: pushArtifactArgs.source,
|
||||
Revision: pushArtifactArgs.revision,
|
||||
Annotations: annotations,
|
||||
@@ -212,29 +216,31 @@ func pushArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
||||
defer cancel()
|
||||
|
||||
var auth authn.Authenticator
|
||||
opts := client.DefaultOptions()
|
||||
var authenticator authn.Authenticator
|
||||
opts := oci.DefaultOptions()
|
||||
if pushArtifactArgs.provider.String() == sourcev1.GenericOCIProvider && pushArtifactArgs.creds != "" {
|
||||
logger.Actionf("logging in to registry with credentials")
|
||||
auth, err = client.GetAuthFromCredentials(pushArtifactArgs.creds)
|
||||
authenticator, err = oci.GetAuthFromCredentials(pushArtifactArgs.creds)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not login with credentials: %w", err)
|
||||
}
|
||||
opts = append(opts, crane.WithAuth(auth))
|
||||
opts = append(opts, crane.WithAuth(authenticator))
|
||||
}
|
||||
|
||||
if pushArtifactArgs.provider.String() != sourcev1.GenericOCIProvider {
|
||||
if provider := pushArtifactArgs.provider.String(); provider != sourcev1.GenericOCIProvider {
|
||||
logger.Actionf("logging in to registry with provider credentials")
|
||||
ociProvider, err := pushArtifactArgs.provider.ToOCIProvider()
|
||||
if err != nil {
|
||||
return fmt.Errorf("provider not supported: %w", err)
|
||||
var authOpts []auth.Option
|
||||
if provider == azure.ProviderName {
|
||||
authOpts = append(authOpts, auth.WithAllowShellOut())
|
||||
}
|
||||
|
||||
auth, err = login.NewManager().Login(ctx, url, ref, getProviderLoginOption(ociProvider))
|
||||
authenticator, err = authutils.GetArtifactRegistryCredentials(ctx, provider, url, authOpts...)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error during login with provider: %w", err)
|
||||
}
|
||||
opts = append(opts, crane.WithAuth(auth))
|
||||
if authenticator == nil {
|
||||
return errors.New("unsupported provider")
|
||||
}
|
||||
opts = append(opts, crane.WithAuth(authenticator))
|
||||
}
|
||||
|
||||
if rootArgs.timeout != 0 {
|
||||
@@ -249,27 +255,31 @@ func pushArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||
Cap: rootArgs.timeout,
|
||||
}
|
||||
|
||||
if auth == nil {
|
||||
auth, err = authn.DefaultKeychain.Resolve(ref.Context())
|
||||
if authenticator == nil {
|
||||
authenticator, err = authn.DefaultKeychain.Resolve(ref.Context())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
transportOpts, err := client.WithRetryTransport(ctx, ref, auth, backoff, []string{ref.Context().Scope(transport.PushScope)})
|
||||
transportOpts, err := oci.WithRetryTransport(ctx, ref, authenticator, backoff, []string{ref.Context().Scope(transport.PushScope)})
|
||||
if err != nil {
|
||||
return fmt.Errorf("error setting up transport: %w", err)
|
||||
}
|
||||
opts = append(opts, transportOpts, client.WithRetryBackOff(backoff))
|
||||
opts = append(opts, transportOpts, oci.WithRetryBackOff(backoff))
|
||||
}
|
||||
|
||||
if pushArtifactArgs.output == "" {
|
||||
logger.Actionf("pushing artifact to %s", url)
|
||||
}
|
||||
|
||||
ociClient := client.NewClient(opts)
|
||||
if pushArtifactArgs.insecure {
|
||||
opts = append(opts, crane.Insecure)
|
||||
}
|
||||
|
||||
ociClient := oci.NewClient(opts)
|
||||
digestURL, err := ociClient.Push(ctx, url, path,
|
||||
client.WithPushMetadata(meta),
|
||||
client.WithPushIgnorePaths(pushArtifactArgs.ignorePaths...),
|
||||
oci.WithPushMetadata(meta),
|
||||
oci.WithPushIgnorePaths(pushArtifactArgs.ignorePaths...),
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("pushing artifact failed: %w", err)
|
||||
@@ -317,16 +327,3 @@ func pushArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func getProviderLoginOption(provider oci.Provider) login.ProviderOptions {
|
||||
var opts login.ProviderOptions
|
||||
switch provider {
|
||||
case oci.ProviderAzure:
|
||||
opts.AzureAutoLogin = true
|
||||
case oci.ProviderAWS:
|
||||
opts.AwsAutoLogin = true
|
||||
case oci.ProviderGCP:
|
||||
opts.GcpAutoLogin = true
|
||||
}
|
||||
return opts
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ func isObjectReady(obj client.Object, statusType objectStatusType) (bool, error)
|
||||
case kstatus.InProgressStatus:
|
||||
return false, nil
|
||||
default:
|
||||
return false, fmt.Errorf(result.Message)
|
||||
return false, fmt.Errorf("%s", result.Message)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ func (reconcile reconcileCommand) run(cmd *cobra.Command, args []string) error {
|
||||
if readyCond.Status != metav1.ConditionTrue {
|
||||
return fmt.Errorf("%s reconciliation failed: '%s'", reconcile.kind, readyCond.Message)
|
||||
}
|
||||
logger.Successf(reconcile.object.successMessage())
|
||||
logger.Successf("%s", reconcile.object.successMessage())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ import (
|
||||
|
||||
helmv2 "github.com/fluxcd/helm-controller/api/v2"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
)
|
||||
|
||||
var reconcileHrCmd = &cobra.Command{
|
||||
@@ -92,7 +91,7 @@ func (obj helmReleaseAdapter) getSource() (reconcileSource, types.NamespacedName
|
||||
}
|
||||
return reconcileCommand{
|
||||
apiType: ociRepositoryType,
|
||||
object: ociRepositoryAdapter{&sourcev1b2.OCIRepository{}},
|
||||
object: ociRepositoryAdapter{&sourcev1.OCIRepository{}},
|
||||
}, namespacedName
|
||||
default:
|
||||
// default case assumes the HelmRelease is using a HelmChartTemplate
|
||||
|
||||
@@ -22,7 +22,6 @@ import (
|
||||
|
||||
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
)
|
||||
|
||||
var reconcileKsCmd = &cobra.Command{
|
||||
@@ -66,10 +65,10 @@ func (obj kustomizationAdapter) reconcileSource() bool {
|
||||
func (obj kustomizationAdapter) getSource() (reconcileSource, types.NamespacedName) {
|
||||
var cmd reconcileCommand
|
||||
switch obj.Spec.SourceRef.Kind {
|
||||
case sourcev1b2.OCIRepositoryKind:
|
||||
case sourcev1.OCIRepositoryKind:
|
||||
cmd = reconcileCommand{
|
||||
apiType: ociRepositoryType,
|
||||
object: ociRepositoryAdapter{&sourcev1b2.OCIRepository{}},
|
||||
object: ociRepositoryAdapter{&sourcev1.OCIRepository{}},
|
||||
}
|
||||
case sourcev1.GitRepositoryKind:
|
||||
cmd = reconcileCommand{
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
)
|
||||
|
||||
var reconcileSourceOCIRepositoryCmd = &cobra.Command{
|
||||
|
||||
@@ -96,6 +96,6 @@ func (reconcile reconcileWithSourceCommand) run(cmd *cobra.Command, args []strin
|
||||
if readyCond.Status != metav1.ConditionTrue {
|
||||
return fmt.Errorf("%s reconciliation failed: %s", reconcile.kind, readyCond.Message)
|
||||
}
|
||||
logger.Successf(reconcile.object.successMessage())
|
||||
logger.Successf("%s", reconcile.object.successMessage())
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ func (resume resumeCommand) run(cmd *cobra.Command, args []string) error {
|
||||
// If the args slice is empty, it patches all resumable objects in the given namespace.
|
||||
func (resume *resumeCommand) getPatchedResumables(ctx context.Context, args []string) ([]resumable, error) {
|
||||
if len(args) < 1 {
|
||||
objs, err := resume.patch(ctx, []client.ListOption{
|
||||
objs, err := resume.patch(ctx, args, []client.ListOption{
|
||||
client.InNamespace(resume.namespace),
|
||||
})
|
||||
if err != nil {
|
||||
@@ -151,7 +151,7 @@ func (resume *resumeCommand) getPatchedResumables(ctx context.Context, args []st
|
||||
}
|
||||
processed[arg] = struct{}{}
|
||||
|
||||
objs, err := resume.patch(ctx, []client.ListOption{
|
||||
objs, err := resume.patch(ctx, args, []client.ListOption{
|
||||
client.InNamespace(resume.namespace),
|
||||
client.MatchingFields{
|
||||
"metadata.name": arg,
|
||||
@@ -169,13 +169,17 @@ func (resume *resumeCommand) getPatchedResumables(ctx context.Context, args []st
|
||||
|
||||
// Patches resumable objects by setting their status to unsuspended.
|
||||
// Returns a slice of resumables that have been patched and any error encountered during patching.
|
||||
func (resume resumeCommand) patch(ctx context.Context, listOpts []client.ListOption) ([]resumable, error) {
|
||||
func (resume resumeCommand) patch(ctx context.Context, args []string, listOpts []client.ListOption) ([]resumable, error) {
|
||||
if err := resume.client.List(ctx, resume.list.asClientList(), listOpts...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if resume.list.len() == 0 {
|
||||
logger.Failuref("no %s objects found in %s namespace", resume.kind, resume.namespace)
|
||||
if len(args) < 1 {
|
||||
logger.Failuref("no %s objects found in %s namespace", resume.kind, resume.namespace)
|
||||
} else {
|
||||
logger.Failuref("%s object '%s' not found in %s namespace", resume.kind, args[0], resume.namespace)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -247,9 +251,9 @@ func (resume resumeCommand) printMessage(responses []reconcileResponse) {
|
||||
continue
|
||||
}
|
||||
if r.err != nil {
|
||||
logger.Failuref(r.err.Error())
|
||||
logger.Failuref("%s", r.err.Error())
|
||||
}
|
||||
logger.Successf("%s %s reconciliation completed", resume.kind, r.asClientObject().GetName())
|
||||
logger.Successf(r.successMessage())
|
||||
logger.Successf("%s", r.successMessage())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ package main
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
)
|
||||
|
||||
var resumeSourceOCIRepositoryCmd = &cobra.Command{
|
||||
|
||||
@@ -20,7 +20,6 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
)
|
||||
|
||||
// These are general-purpose adapters for attaching methods to, for
|
||||
@@ -30,13 +29,13 @@ import (
|
||||
// sourcev1.ociRepository
|
||||
|
||||
var ociRepositoryType = apiType{
|
||||
kind: sourcev1b2.OCIRepositoryKind,
|
||||
kind: sourcev1.OCIRepositoryKind,
|
||||
humanKind: "source oci",
|
||||
groupVersion: sourcev1b2.GroupVersion,
|
||||
groupVersion: sourcev1.GroupVersion,
|
||||
}
|
||||
|
||||
type ociRepositoryAdapter struct {
|
||||
*sourcev1b2.OCIRepository
|
||||
*sourcev1.OCIRepository
|
||||
}
|
||||
|
||||
func (a ociRepositoryAdapter) asClientObject() client.Object {
|
||||
@@ -50,7 +49,7 @@ func (a ociRepositoryAdapter) deepCopyClientObject() client.Object {
|
||||
// sourcev1b2.OCIRepositoryList
|
||||
|
||||
type ociRepositoryListAdapter struct {
|
||||
*sourcev1b2.OCIRepositoryList
|
||||
*sourcev1.OCIRepositoryList
|
||||
}
|
||||
|
||||
func (a ociRepositoryListAdapter) asClientList() client.ObjectList {
|
||||
|
||||
@@ -34,7 +34,6 @@ import (
|
||||
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
|
||||
notificationv1b3 "github.com/fluxcd/notification-controller/api/v1beta3"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/utils"
|
||||
"github.com/fluxcd/flux2/v2/pkg/printers"
|
||||
@@ -82,9 +81,9 @@ func runStatsCmd(cmd *cobra.Command, args []string) error {
|
||||
Group: sourcev1.GroupVersion.Group,
|
||||
},
|
||||
{
|
||||
Kind: sourcev1b2.OCIRepositoryKind,
|
||||
Version: sourcev1b2.GroupVersion.Version,
|
||||
Group: sourcev1b2.GroupVersion.Group,
|
||||
Kind: sourcev1.OCIRepositoryKind,
|
||||
Version: sourcev1.GroupVersion.Version,
|
||||
Group: sourcev1.GroupVersion.Group,
|
||||
},
|
||||
{
|
||||
Kind: sourcev1.HelmRepositoryKind,
|
||||
|
||||
@@ -19,7 +19,7 @@ package main
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
)
|
||||
|
||||
var suspendSourceOCIRepositoryCmd = &cobra.Command{
|
||||
|
||||
@@ -22,8 +22,8 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
oci "github.com/fluxcd/pkg/oci/client"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
"github.com/fluxcd/pkg/oci"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/flags"
|
||||
)
|
||||
@@ -31,8 +31,8 @@ import (
|
||||
var tagArtifactCmd = &cobra.Command{
|
||||
Use: "artifact",
|
||||
Short: "Tag artifact",
|
||||
Long: withPreviewNote(`The tag artifact command creates tags for the given OCI artifact.
|
||||
The command can read the credentials from '~/.docker/config.json' but they can also be passed with --creds. It can also login to a supported provider with the --provider flag.`),
|
||||
Long: `The tag artifact command creates tags for the given OCI artifact.
|
||||
The command can read the credentials from '~/.docker/config.json' but they can also be passed with --creds. It can also login to a supported provider with the --provider flag.`,
|
||||
Example: ` # Tag an artifact version as latest
|
||||
flux tag artifact oci://ghcr.io/org/manifests/app:v0.0.1 --tag latest
|
||||
`,
|
||||
@@ -78,7 +78,18 @@ func tagArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
||||
defer cancel()
|
||||
|
||||
ociClient := oci.NewClient(oci.DefaultOptions())
|
||||
opts := oci.DefaultOptions()
|
||||
|
||||
if tagArtifactArgs.provider.String() != sourcev1.GenericOCIProvider {
|
||||
logger.Actionf("logging in to registry with provider credentials")
|
||||
opt, err := loginWithProvider(ctx, url, tagArtifactArgs.provider.String())
|
||||
if err != nil {
|
||||
return fmt.Errorf("error during login with provider: %w", err)
|
||||
}
|
||||
opts = append(opts, opt)
|
||||
}
|
||||
|
||||
ociClient := oci.NewClient(opts)
|
||||
|
||||
if tagArtifactArgs.provider.String() == sourcev1.GenericOCIProvider && tagArtifactArgs.creds != "" {
|
||||
logger.Actionf("logging in to registry with credentials")
|
||||
@@ -87,18 +98,6 @@ func tagArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
if tagArtifactArgs.provider.String() != sourcev1.GenericOCIProvider {
|
||||
logger.Actionf("logging in to registry with provider credentials")
|
||||
ociProvider, err := tagArtifactArgs.provider.ToOCIProvider()
|
||||
if err != nil {
|
||||
return fmt.Errorf("provider not supported: %w", err)
|
||||
}
|
||||
|
||||
if err := ociClient.LoginWithProvider(ctx, url, ociProvider); err != nil {
|
||||
return fmt.Errorf("error during login with provider: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
logger.Actionf("tagging artifact")
|
||||
|
||||
for _, tag := range tagArtifactArgs.tags {
|
||||
|
||||
2
cmd/flux/testdata/check/check_pre.golden
vendored
2
cmd/flux/testdata/check/check_pre.golden
vendored
@@ -1,3 +1,3 @@
|
||||
► checking prerequisites
|
||||
✔ Kubernetes {{ .serverVersion }} >=1.28.0-0
|
||||
✔ Kubernetes {{ .serverVersion }} >=1.31.0-0
|
||||
✔ prerequisites checks passed
|
||||
|
||||
@@ -27,7 +27,7 @@ spec:
|
||||
kind: HelmRepository
|
||||
name: podinfo
|
||||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
||||
39
cmd/flux/testdata/create_secret/githubapp/secret-with-baseurl.yaml
vendored
Normal file
39
cmd/flux/testdata/create_secret/githubapp/secret-with-baseurl.yaml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: appinfo
|
||||
namespace: my-namespace
|
||||
stringData:
|
||||
githubAppBaseURL: www.example.com/api/v3
|
||||
githubAppID: "1"
|
||||
githubAppInstallationID: "2"
|
||||
githubAppPrivateKey: |-
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
YcE2CgWILk+uiVNseHnOU2frG7k2RJZtdDo8GNI6pQWFlwU/NsQoJBrtEDyYVkap
|
||||
PLv7VoJ2pr6l5IEwH++naL2McuCcwhW/CeaVb/IuSCFFMwb40zRrlqp6IB5VkMhm
|
||||
zSde2KD/ilB1YUhaAv0qaBHLTGBvVgxut1eIyvqVC+ArWoqJ7rQTst+Arp3UAiIm
|
||||
LsXqL2iZvVvCH0FiDwBIfxAMhl6fnPzuQsZBiRLPdD67jubPseN1P5JBRw3WTton
|
||||
Fa2RLLByuyge7bWh2o1hjEx2w2ZpIhosQRyDs1sPXP5TI92RzOcx1CZaTZ6V5E+T
|
||||
MROFeZmxBHYon1Y4Rw+jCSXovNyHbMBpMI67nwIDAQABAoIBAC4UrkusU8r7ilFu
|
||||
w1LWDm09+8WSIk9KgYMoBceAqH+b9DU7hrMFrKkO/cr0Mijr1somv6B3MG83WUcB
|
||||
FkhEBrwXKnh499iiO/SUo+7kaq0WLQ7mQ2Q9wpMmkkjnr0tgydAno/uNNITSaqmk
|
||||
YcE2CgWILk+uiVNseHnOU2frG7k2RJZtdDo8GNI6pQWFlwU/NsQoJBrtEDyYVkap
|
||||
Fa2RLLByuyge7bWh2o1hjEx2w2ZpIhosQRyDs1sPXP5TI92RzOcx1CZaTZ6V5E+T
|
||||
zSde2KD/ilB1YUhaAv0qaBHLTGBvVgxut1eIyvqVC+ArWoqJ7rQTst+Arp3UAiIm
|
||||
ihlXNkECgYEA3abZJZuVarHPlAqRYkprs0O+DrP6sPlmVQp+nq8y3Qg00U+N7AuP
|
||||
Y1riLo3gWq7LajkGTygWLmru2mhWsETxt+R4BtnREUq8kDEoCfEwPlHfqfphvBZL
|
||||
j5eL60QTKAqSOVqMgIzqJyxa5FGgPGqWpLDLopyVeoyNdZwcuCQzFgkCgYEA25dm
|
||||
PLv7VoJ2pr6l5IEwH++naL2McuCcwhW/CeaVb/IuSCFFMwb40zRrlqp6IB5VkMhm
|
||||
MkvaCGIAH+lfJrtTSujFaOIGFy+0ZwP+LNqHUKih14y8Qv9dEP0kaXkAD3fO3Y97
|
||||
Nj+Q2c06JpojgBKBMwVvT7M53w9KEoNKpoKBbmcCgYBelHyiRJJsdbVKyXuiAnmU
|
||||
g/qMkZYOgE1/SjwfgEjm8kJ/cj/wEjq8PaK4FMhAScf46p5blpJoei6zucQL8U9n
|
||||
lbD102oXw9lUefVI0McyQIN9J58ewDC79AG7gU/fTSt6F75OeFLOJmoedQo33Y+s
|
||||
dNhf6gsKwQD3x4aluKSn6QKBgD8HbvBAKV6P4vIiFzS0QvWtpeKam2EDHI+h+WsP
|
||||
nD77QoG/EPvpjJS9/KWgZRPz6U+0M5V0y73MZVzkbbVT/uwfgF2G91lXAr4Kfuh5
|
||||
w1LWDm09+8WSIk9KgYMoBceAqH+b9DU7hrMFrKkO/cr0Mijr1somv6B3MG83WUcB
|
||||
qCEDAoGACl8ClvMJR2uNWdaWnCz9tyPdHYgEusJ0OIP+WUY2ToYQWSlA0zNpc21Y
|
||||
lbD102oXw9lUefVI0McyQIN9J58ewDC79AG7gU/fTSt6F75OeFLOJmoedQo33Y+s
|
||||
bUytJtOhHbLRNxwgalhjBUNWICrDktqJmumNOEOOPBqVz7RGwUg=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
|
||||
38
cmd/flux/testdata/create_secret/githubapp/secret.yaml
vendored
Normal file
38
cmd/flux/testdata/create_secret/githubapp/secret.yaml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: appinfo
|
||||
namespace: my-namespace
|
||||
stringData:
|
||||
githubAppID: "1"
|
||||
githubAppInstallationID: "2"
|
||||
githubAppPrivateKey: |-
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
YcE2CgWILk+uiVNseHnOU2frG7k2RJZtdDo8GNI6pQWFlwU/NsQoJBrtEDyYVkap
|
||||
PLv7VoJ2pr6l5IEwH++naL2McuCcwhW/CeaVb/IuSCFFMwb40zRrlqp6IB5VkMhm
|
||||
zSde2KD/ilB1YUhaAv0qaBHLTGBvVgxut1eIyvqVC+ArWoqJ7rQTst+Arp3UAiIm
|
||||
LsXqL2iZvVvCH0FiDwBIfxAMhl6fnPzuQsZBiRLPdD67jubPseN1P5JBRw3WTton
|
||||
Fa2RLLByuyge7bWh2o1hjEx2w2ZpIhosQRyDs1sPXP5TI92RzOcx1CZaTZ6V5E+T
|
||||
MROFeZmxBHYon1Y4Rw+jCSXovNyHbMBpMI67nwIDAQABAoIBAC4UrkusU8r7ilFu
|
||||
w1LWDm09+8WSIk9KgYMoBceAqH+b9DU7hrMFrKkO/cr0Mijr1somv6B3MG83WUcB
|
||||
FkhEBrwXKnh499iiO/SUo+7kaq0WLQ7mQ2Q9wpMmkkjnr0tgydAno/uNNITSaqmk
|
||||
YcE2CgWILk+uiVNseHnOU2frG7k2RJZtdDo8GNI6pQWFlwU/NsQoJBrtEDyYVkap
|
||||
Fa2RLLByuyge7bWh2o1hjEx2w2ZpIhosQRyDs1sPXP5TI92RzOcx1CZaTZ6V5E+T
|
||||
zSde2KD/ilB1YUhaAv0qaBHLTGBvVgxut1eIyvqVC+ArWoqJ7rQTst+Arp3UAiIm
|
||||
ihlXNkECgYEA3abZJZuVarHPlAqRYkprs0O+DrP6sPlmVQp+nq8y3Qg00U+N7AuP
|
||||
Y1riLo3gWq7LajkGTygWLmru2mhWsETxt+R4BtnREUq8kDEoCfEwPlHfqfphvBZL
|
||||
j5eL60QTKAqSOVqMgIzqJyxa5FGgPGqWpLDLopyVeoyNdZwcuCQzFgkCgYEA25dm
|
||||
PLv7VoJ2pr6l5IEwH++naL2McuCcwhW/CeaVb/IuSCFFMwb40zRrlqp6IB5VkMhm
|
||||
MkvaCGIAH+lfJrtTSujFaOIGFy+0ZwP+LNqHUKih14y8Qv9dEP0kaXkAD3fO3Y97
|
||||
Nj+Q2c06JpojgBKBMwVvT7M53w9KEoNKpoKBbmcCgYBelHyiRJJsdbVKyXuiAnmU
|
||||
g/qMkZYOgE1/SjwfgEjm8kJ/cj/wEjq8PaK4FMhAScf46p5blpJoei6zucQL8U9n
|
||||
lbD102oXw9lUefVI0McyQIN9J58ewDC79AG7gU/fTSt6F75OeFLOJmoedQo33Y+s
|
||||
dNhf6gsKwQD3x4aluKSn6QKBgD8HbvBAKV6P4vIiFzS0QvWtpeKam2EDHI+h+WsP
|
||||
nD77QoG/EPvpjJS9/KWgZRPz6U+0M5V0y73MZVzkbbVT/uwfgF2G91lXAr4Kfuh5
|
||||
w1LWDm09+8WSIk9KgYMoBceAqH+b9DU7hrMFrKkO/cr0Mijr1somv6B3MG83WUcB
|
||||
qCEDAoGACl8ClvMJR2uNWdaWnCz9tyPdHYgEusJ0OIP+WUY2ToYQWSlA0zNpc21Y
|
||||
lbD102oXw9lUefVI0McyQIN9J58ewDC79AG7gU/fTSt6F75OeFLOJmoedQo33Y+s
|
||||
bUytJtOhHbLRNxwgalhjBUNWICrDktqJmumNOEOOPBqVz7RGwUg=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
|
||||
27
cmd/flux/testdata/create_secret/githubapp/test-private-key.pem
vendored
Normal file
27
cmd/flux/testdata/create_secret/githubapp/test-private-key.pem
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
YcE2CgWILk+uiVNseHnOU2frG7k2RJZtdDo8GNI6pQWFlwU/NsQoJBrtEDyYVkap
|
||||
PLv7VoJ2pr6l5IEwH++naL2McuCcwhW/CeaVb/IuSCFFMwb40zRrlqp6IB5VkMhm
|
||||
zSde2KD/ilB1YUhaAv0qaBHLTGBvVgxut1eIyvqVC+ArWoqJ7rQTst+Arp3UAiIm
|
||||
LsXqL2iZvVvCH0FiDwBIfxAMhl6fnPzuQsZBiRLPdD67jubPseN1P5JBRw3WTton
|
||||
Fa2RLLByuyge7bWh2o1hjEx2w2ZpIhosQRyDs1sPXP5TI92RzOcx1CZaTZ6V5E+T
|
||||
MROFeZmxBHYon1Y4Rw+jCSXovNyHbMBpMI67nwIDAQABAoIBAC4UrkusU8r7ilFu
|
||||
w1LWDm09+8WSIk9KgYMoBceAqH+b9DU7hrMFrKkO/cr0Mijr1somv6B3MG83WUcB
|
||||
FkhEBrwXKnh499iiO/SUo+7kaq0WLQ7mQ2Q9wpMmkkjnr0tgydAno/uNNITSaqmk
|
||||
YcE2CgWILk+uiVNseHnOU2frG7k2RJZtdDo8GNI6pQWFlwU/NsQoJBrtEDyYVkap
|
||||
Fa2RLLByuyge7bWh2o1hjEx2w2ZpIhosQRyDs1sPXP5TI92RzOcx1CZaTZ6V5E+T
|
||||
zSde2KD/ilB1YUhaAv0qaBHLTGBvVgxut1eIyvqVC+ArWoqJ7rQTst+Arp3UAiIm
|
||||
ihlXNkECgYEA3abZJZuVarHPlAqRYkprs0O+DrP6sPlmVQp+nq8y3Qg00U+N7AuP
|
||||
Y1riLo3gWq7LajkGTygWLmru2mhWsETxt+R4BtnREUq8kDEoCfEwPlHfqfphvBZL
|
||||
j5eL60QTKAqSOVqMgIzqJyxa5FGgPGqWpLDLopyVeoyNdZwcuCQzFgkCgYEA25dm
|
||||
PLv7VoJ2pr6l5IEwH++naL2McuCcwhW/CeaVb/IuSCFFMwb40zRrlqp6IB5VkMhm
|
||||
MkvaCGIAH+lfJrtTSujFaOIGFy+0ZwP+LNqHUKih14y8Qv9dEP0kaXkAD3fO3Y97
|
||||
Nj+Q2c06JpojgBKBMwVvT7M53w9KEoNKpoKBbmcCgYBelHyiRJJsdbVKyXuiAnmU
|
||||
g/qMkZYOgE1/SjwfgEjm8kJ/cj/wEjq8PaK4FMhAScf46p5blpJoei6zucQL8U9n
|
||||
lbD102oXw9lUefVI0McyQIN9J58ewDC79AG7gU/fTSt6F75OeFLOJmoedQo33Y+s
|
||||
dNhf6gsKwQD3x4aluKSn6QKBgD8HbvBAKV6P4vIiFzS0QvWtpeKam2EDHI+h+WsP
|
||||
nD77QoG/EPvpjJS9/KWgZRPz6U+0M5V0y73MZVzkbbVT/uwfgF2G91lXAr4Kfuh5
|
||||
w1LWDm09+8WSIk9KgYMoBceAqH+b9DU7hrMFrKkO/cr0Mijr1somv6B3MG83WUcB
|
||||
qCEDAoGACl8ClvMJR2uNWdaWnCz9tyPdHYgEusJ0OIP+WUY2ToYQWSlA0zNpc21Y
|
||||
lbD102oXw9lUefVI0McyQIN9J58ewDC79AG7gU/fTSt6F75OeFLOJmoedQo33Y+s
|
||||
bUytJtOhHbLRNxwgalhjBUNWICrDktqJmumNOEOOPBqVz7RGwUg=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
14
cmd/flux/testdata/create_source_git/source-git-provider-github.yaml
vendored
Normal file
14
cmd/flux/testdata/create_source_git/source-git-provider-github.yaml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: GitRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 1m0s
|
||||
provider: github
|
||||
ref:
|
||||
branch: test
|
||||
secretRef:
|
||||
name: appinfo
|
||||
url: https://github.com/stefanprodan/podinfo
|
||||
68
cmd/flux/testdata/debug_helmrelease/objects.yaml
vendored
Normal file
68
cmd/flux/testdata/debug_helmrelease/objects.yaml
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: {{ .fluxns }}
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: test-values-inline
|
||||
namespace: {{ .fluxns }}
|
||||
spec:
|
||||
chartRef:
|
||||
kind: OCIRepository
|
||||
name: podinfo
|
||||
interval: 5m0s
|
||||
values:
|
||||
image:
|
||||
repository: stefanprodan/podinfo
|
||||
tag: 5.0.0
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: test-values-from
|
||||
namespace: {{ .fluxns }}
|
||||
spec:
|
||||
chartRef:
|
||||
kind: OCIRepository
|
||||
name: podinfo
|
||||
interval: 5m0s
|
||||
values:
|
||||
image:
|
||||
repository: stefanprodan/podinfo
|
||||
tag: 5.0.0
|
||||
valuesFrom:
|
||||
- kind: ConfigMap
|
||||
name: test
|
||||
- kind: Secret
|
||||
name: test
|
||||
valuesKey: secrets.yaml
|
||||
- kind: Secret
|
||||
name: test
|
||||
valuesKey: flatValue
|
||||
targetPath: aFlatValue
|
||||
- kind: ConfigMap
|
||||
name: none
|
||||
optional: true
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: test
|
||||
namespace: {{ .fluxns }}
|
||||
data:
|
||||
values.yaml: |
|
||||
cm: "test"
|
||||
override: "cm"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: test
|
||||
namespace: {{ .fluxns }}
|
||||
stringData:
|
||||
secrets.yaml: |
|
||||
secret: "test"
|
||||
override: "secret"
|
||||
flatValue: some-flat-value
|
||||
2
cmd/flux/testdata/debug_helmrelease/status.golden.yaml
vendored
Normal file
2
cmd/flux/testdata/debug_helmrelease/status.golden.yaml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Status documentation: https://fluxcd.io/flux/components/helm/helmreleases/#helmrelease-status
|
||||
observedGeneration: -1
|
||||
7
cmd/flux/testdata/debug_helmrelease/values-from.golden.yaml
vendored
Normal file
7
cmd/flux/testdata/debug_helmrelease/values-from.golden.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
aFlatValue: some-flat-value
|
||||
cm: test
|
||||
image:
|
||||
repository: stefanprodan/podinfo
|
||||
tag: 5.0.0
|
||||
override: secret
|
||||
secret: test
|
||||
3
cmd/flux/testdata/debug_helmrelease/values-inline.golden.yaml
vendored
Normal file
3
cmd/flux/testdata/debug_helmrelease/values-inline.golden.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
image:
|
||||
repository: stefanprodan/podinfo
|
||||
tag: 5.0.0
|
||||
63
cmd/flux/testdata/debug_kustomization/objects.yaml
vendored
Normal file
63
cmd/flux/testdata/debug_kustomization/objects.yaml
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: {{ .fluxns }}
|
||||
---
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: test
|
||||
namespace: {{ .fluxns }}
|
||||
spec:
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: test
|
||||
interval: 1m
|
||||
path: "./"
|
||||
prune: true
|
||||
postBuild:
|
||||
substitute:
|
||||
TEST_OVERRIDE: "in-line"
|
||||
TEST_INLINE: "in-line"
|
||||
substituteFrom:
|
||||
- kind: ConfigMap
|
||||
name: test
|
||||
- kind: Secret
|
||||
name: test
|
||||
---
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: test-from
|
||||
namespace: {{ .fluxns }}
|
||||
spec:
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: test
|
||||
interval: 1m
|
||||
path: "./"
|
||||
prune: true
|
||||
postBuild:
|
||||
substituteFrom:
|
||||
- kind: ConfigMap
|
||||
name: test
|
||||
- kind: Secret
|
||||
name: test
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: test
|
||||
namespace: {{ .fluxns }}
|
||||
data:
|
||||
TEST_OVERRIDE: "cm"
|
||||
TEST_CM: "cm"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: test
|
||||
namespace: {{ .fluxns }}
|
||||
stringData:
|
||||
TEST_OVERRIDE: "secret"
|
||||
TEST_SECRET: "secret"
|
||||
2
cmd/flux/testdata/debug_kustomization/status.golden.yaml
vendored
Normal file
2
cmd/flux/testdata/debug_kustomization/status.golden.yaml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Status documentation: https://fluxcd.io/flux/components/kustomize/kustomizations/#kustomization-status
|
||||
observedGeneration: -1
|
||||
3
cmd/flux/testdata/debug_kustomization/vars-from.golden.env
vendored
Normal file
3
cmd/flux/testdata/debug_kustomization/vars-from.golden.env
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
TEST_CM=cm
|
||||
TEST_OVERRIDE=secret
|
||||
TEST_SECRET=secret
|
||||
4
cmd/flux/testdata/debug_kustomization/vars.golden.env
vendored
Normal file
4
cmd/flux/testdata/debug_kustomization/vars.golden.env
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
TEST_CM=cm
|
||||
TEST_INLINE=in-line
|
||||
TEST_OVERRIDE=in-line
|
||||
TEST_SECRET=secret
|
||||
1
cmd/flux/testdata/export/image-policy.yaml
vendored
1
cmd/flux/testdata/export/image-policy.yaml
vendored
@@ -5,6 +5,7 @@ metadata:
|
||||
name: flux-system
|
||||
namespace: {{ .fluxns }}
|
||||
spec:
|
||||
digestReflectionPolicy: Never
|
||||
imageRepositoryRef:
|
||||
name: flux-system
|
||||
policy:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
✚ generating ImagePolicy
|
||||
► applying ImagePolicy
|
||||
✔ ImageRepository created
|
||||
✔ ImagePolicy created
|
||||
◎ waiting for ImagePolicy reconciliation
|
||||
✔ ImagePolicy reconciliation completed
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
NAME LATEST IMAGE READY MESSAGE
|
||||
podinfo-regex ghcr.io/stefanprodan/podinfo:5.0.0 True Latest image tag for 'ghcr.io/stefanprodan/podinfo' resolved to 5.0.0
|
||||
NAME LATEST IMAGE READY MESSAGE
|
||||
podinfo-regex ghcr.io/stefanprodan/podinfo:5.0.0 True Latest image tag for ghcr.io/stefanprodan/podinfo resolved to 5.0.0
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
NAME LATEST IMAGE READY MESSAGE
|
||||
podinfo-semver ghcr.io/stefanprodan/podinfo:5.0.3 True Latest image tag for 'ghcr.io/stefanprodan/podinfo' resolved to 5.0.3
|
||||
NAME LATEST IMAGE READY MESSAGE
|
||||
podinfo-semver ghcr.io/stefanprodan/podinfo:5.0.3 True Latest image tag for ghcr.io/stefanprodan/podinfo resolved to 5.0.3 with digest sha256:8704da90172710d422af855049175c1a8295731cbe2ad3b9a1c1074feecf8c10
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
► resuming kustomization tkfg in {{ .ns }} namespace
|
||||
✔ kustomization resumed
|
||||
✗ no Kustomization objects found in {{ .ns }} namespace
|
||||
✗ Kustomization object 'tkfg' not found in {{ .ns }} namespace
|
||||
◎ waiting for Kustomization reconciliation
|
||||
✔ Kustomization tkfg reconciliation completed
|
||||
✔ applied revision 6.3.5@sha1:67e2c98a60dc92283531412a9e604dd4bae005a9
|
||||
|
||||
2
cmd/flux/testdata/oci/export.golden
vendored
2
cmd/flux/testdata/oci/export.golden
vendored
@@ -1,5 +1,5 @@
|
||||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
name: podinfo
|
||||
|
||||
18
cmd/flux/testdata/trace/deployment-hr-ocirepo.golden
vendored
Normal file
18
cmd/flux/testdata/trace/deployment-hr-ocirepo.golden
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
Object: deployment/podinfo
|
||||
Namespace: {{ .ns }}
|
||||
Status: Managed by Flux
|
||||
---
|
||||
HelmRelease: podinfo
|
||||
Namespace: {{ .ns }}
|
||||
Revision: 6.3.5
|
||||
Status: Last reconciled at {{ .helmReleaseLastReconcile }}
|
||||
Message: Release reconciliation succeeded
|
||||
---
|
||||
OCIRepository: podinfo-charts
|
||||
Namespace: {{ .fluxns }}
|
||||
URL: oci://ghcr.io/stefanprodan/charts/podinfo
|
||||
Tag: 6.8.0
|
||||
Revision: sha256:dbdb109711ffb3be77504d2670dbe13c24dd63d8d7f1fb489d350e5bfe930dd3
|
||||
Status: Last reconciled at {{ .ociRepositoryLastReconcile }}
|
||||
Message: stored artifact for digest 'sha256:dbdb109711ffb3be77504d2670dbe13c24dd63d8d7f1fb489d350e5bfe930dd3'
|
||||
86
cmd/flux/testdata/trace/deployment-hr-ocirepo.yaml
vendored
Normal file
86
cmd/flux/testdata/trace/deployment-hr-ocirepo.yaml
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: {{ .fluxns }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: {{ .ns }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: podinfo
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
helm.toolkit.fluxcd.io/name: podinfo
|
||||
helm.toolkit.fluxcd.io/namespace: {{ .ns }}
|
||||
name: podinfo
|
||||
namespace: {{ .ns }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: podinfo
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: podinfo
|
||||
spec:
|
||||
containers:
|
||||
- name: hello
|
||||
command: [ "echo hello world" ]
|
||||
image: busybox
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: podinfo
|
||||
namespace: {{ .ns }}
|
||||
spec:
|
||||
chartRef:
|
||||
kind: OCIRepository
|
||||
name: podinfo-charts
|
||||
namespace: {{ .fluxns }}
|
||||
interval: 5m
|
||||
status:
|
||||
conditions:
|
||||
- lastTransitionTime: "2021-07-16T15:42:20Z"
|
||||
message: Release reconciliation succeeded
|
||||
reason: ReconciliationSucceeded
|
||||
status: "True"
|
||||
type: Ready
|
||||
lastAttemptedRevision: 6.3.5
|
||||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
labels:
|
||||
kustomize.toolkit.fluxcd.io/name: flux-system
|
||||
kustomize.toolkit.fluxcd.io/namespace: {{ .fluxns }}
|
||||
name: podinfo-charts
|
||||
namespace: {{ .fluxns }}
|
||||
spec:
|
||||
interval: 10m0s
|
||||
provider: generic
|
||||
ref:
|
||||
tag: 6.8.0
|
||||
timeout: 60s
|
||||
url: oci://ghcr.io/stefanprodan/charts/podinfo
|
||||
status:
|
||||
artifact:
|
||||
lastUpdateTime: "2022-08-10T10:07:59Z"
|
||||
metadata:
|
||||
org.opencontainers.image.revision: 6.1.6@sha1:450796ddb2ab6724ee1cc32a4be56da032d1cca0
|
||||
org.opencontainers.image.source: https://github.com/stefanprodan/podinfo.git
|
||||
path: "example"
|
||||
revision: sha256:dbdb109711ffb3be77504d2670dbe13c24dd63d8d7f1fb489d350e5bfe930dd3
|
||||
url: "example"
|
||||
conditions:
|
||||
- lastTransitionTime: "2021-07-20T00:48:16Z"
|
||||
message: "stored artifact for digest 'sha256:dbdb109711ffb3be77504d2670dbe13c24dd63d8d7f1fb489d350e5bfe930dd3'"
|
||||
reason: Succeed
|
||||
status: "True"
|
||||
type: Ready
|
||||
2
cmd/flux/testdata/trace/helmrelease-oci.yaml
vendored
2
cmd/flux/testdata/trace/helmrelease-oci.yaml
vendored
@@ -59,7 +59,7 @@ status:
|
||||
type: Ready
|
||||
lastAppliedRevision: main@sha1:696f056df216eea4f9401adbee0ff744d4df390f
|
||||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: OCIRepository
|
||||
metadata:
|
||||
labels:
|
||||
|
||||
@@ -38,7 +38,6 @@ import (
|
||||
fluxmeta "github.com/fluxcd/pkg/apis/meta"
|
||||
"github.com/fluxcd/pkg/oci"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1"
|
||||
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
|
||||
|
||||
"github.com/fluxcd/flux2/v2/internal/utils"
|
||||
)
|
||||
@@ -223,7 +222,7 @@ func traceKustomization(ctx context.Context, kubeClient client.Client, ksName ty
|
||||
ksReady := meta.FindStatusCondition(ks.Status.Conditions, fluxmeta.ReadyCondition)
|
||||
|
||||
var gitRepository *sourcev1.GitRepository
|
||||
var ociRepository *sourcev1b2.OCIRepository
|
||||
var ociRepository *sourcev1.OCIRepository
|
||||
var ksRepositoryReady *metav1.Condition
|
||||
switch ks.Spec.SourceRef.Kind {
|
||||
case sourcev1.GitRepositoryKind:
|
||||
@@ -240,8 +239,8 @@ func traceKustomization(ctx context.Context, kubeClient client.Client, ksName ty
|
||||
return "", fmt.Errorf("failed to find GitRepository: %w", err)
|
||||
}
|
||||
ksRepositoryReady = meta.FindStatusCondition(gitRepository.Status.Conditions, fluxmeta.ReadyCondition)
|
||||
case sourcev1b2.OCIRepositoryKind:
|
||||
ociRepository = &sourcev1b2.OCIRepository{}
|
||||
case sourcev1.OCIRepositoryKind:
|
||||
ociRepository = &sourcev1.OCIRepository{}
|
||||
sourceNamespace := ks.Namespace
|
||||
if ks.Spec.SourceRef.Namespace != "" {
|
||||
sourceNamespace = ks.Spec.SourceRef.Namespace
|
||||
@@ -348,7 +347,7 @@ Status: Unknown
|
||||
Kustomization *kustomizev1.Kustomization
|
||||
KustomizationReady *metav1.Condition
|
||||
GitRepository *sourcev1.GitRepository
|
||||
OCIRepository *sourcev1b2.OCIRepository
|
||||
OCIRepository *sourcev1.OCIRepository
|
||||
RepositoryReady *metav1.Condition
|
||||
Annotations map[string]string
|
||||
}{
|
||||
@@ -401,38 +400,65 @@ func traceHelm(ctx context.Context, kubeClient client.Client, hrName types.Names
|
||||
|
||||
var hrGitRepository *sourcev1.GitRepository
|
||||
var hrGitRepositoryReady *metav1.Condition
|
||||
if hr.Spec.Chart.Spec.SourceRef.Kind == sourcev1.GitRepositoryKind {
|
||||
hrGitRepository = &sourcev1.GitRepository{}
|
||||
sourceNamespace := hr.Namespace
|
||||
if hr.Spec.Chart.Spec.SourceRef.Namespace != "" {
|
||||
sourceNamespace = hr.Spec.Chart.Spec.SourceRef.Namespace
|
||||
}
|
||||
err = kubeClient.Get(ctx, types.NamespacedName{
|
||||
Namespace: sourceNamespace,
|
||||
Name: hr.Spec.Chart.Spec.SourceRef.Name,
|
||||
}, hrGitRepository)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to find GitRepository: %w", err)
|
||||
}
|
||||
hrGitRepositoryReady = meta.FindStatusCondition(hrGitRepository.Status.Conditions, fluxmeta.ReadyCondition)
|
||||
}
|
||||
|
||||
var hrHelmRepository *sourcev1.HelmRepository
|
||||
var hrHelmRepositoryReady *metav1.Condition
|
||||
if hr.Spec.Chart.Spec.SourceRef.Kind == sourcev1.HelmRepositoryKind {
|
||||
hrHelmRepository = &sourcev1.HelmRepository{}
|
||||
sourceNamespace := hr.Namespace
|
||||
if hr.Spec.Chart.Spec.SourceRef.Namespace != "" {
|
||||
sourceNamespace = hr.Spec.Chart.Spec.SourceRef.Namespace
|
||||
var hrOCIRepository *sourcev1.OCIRepository
|
||||
var hrOCIRepositoryReady *metav1.Condition
|
||||
if hr.Spec.Chart == nil {
|
||||
if hr.Spec.ChartRef != nil {
|
||||
switch hr.Spec.ChartRef.Kind {
|
||||
case sourcev1.OCIRepositoryKind:
|
||||
hrOCIRepository = &sourcev1.OCIRepository{}
|
||||
sourceNamespace := hr.Namespace
|
||||
if hr.Spec.ChartRef.Namespace != "" {
|
||||
sourceNamespace = hr.Spec.ChartRef.Namespace
|
||||
}
|
||||
err = kubeClient.Get(ctx, types.NamespacedName{
|
||||
Namespace: sourceNamespace,
|
||||
Name: hr.Spec.ChartRef.Name,
|
||||
}, hrOCIRepository)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to find OCIRepository: %w", err)
|
||||
}
|
||||
hrOCIRepositoryReady = meta.FindStatusCondition(hrOCIRepository.Status.Conditions, fluxmeta.ReadyCondition)
|
||||
}
|
||||
kubeClient.Get(ctx, types.NamespacedName{
|
||||
Namespace: hr.Spec.ChartRef.Namespace,
|
||||
Name: hr.Spec.ChartRef.Name,
|
||||
}, hrOCIRepository)
|
||||
}
|
||||
err = kubeClient.Get(ctx, types.NamespacedName{
|
||||
Namespace: sourceNamespace,
|
||||
Name: hr.Spec.Chart.Spec.SourceRef.Name,
|
||||
}, hrHelmRepository)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to find HelmRepository: %w", err)
|
||||
} else {
|
||||
if hr.Spec.Chart.Spec.SourceRef.Kind == sourcev1.GitRepositoryKind {
|
||||
hrGitRepository = &sourcev1.GitRepository{}
|
||||
sourceNamespace := hr.Namespace
|
||||
if hr.Spec.Chart.Spec.SourceRef.Namespace != "" {
|
||||
sourceNamespace = hr.Spec.Chart.Spec.SourceRef.Namespace
|
||||
}
|
||||
err = kubeClient.Get(ctx, types.NamespacedName{
|
||||
Namespace: sourceNamespace,
|
||||
Name: hr.Spec.Chart.Spec.SourceRef.Name,
|
||||
}, hrGitRepository)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to find GitRepository: %w", err)
|
||||
}
|
||||
hrGitRepositoryReady = meta.FindStatusCondition(hrGitRepository.Status.Conditions, fluxmeta.ReadyCondition)
|
||||
}
|
||||
|
||||
if hr.Spec.Chart.Spec.SourceRef.Kind == sourcev1.HelmRepositoryKind {
|
||||
hrHelmRepository = &sourcev1.HelmRepository{}
|
||||
sourceNamespace := hr.Namespace
|
||||
if hr.Spec.Chart.Spec.SourceRef.Namespace != "" {
|
||||
sourceNamespace = hr.Spec.Chart.Spec.SourceRef.Namespace
|
||||
}
|
||||
err = kubeClient.Get(ctx, types.NamespacedName{
|
||||
Namespace: sourceNamespace,
|
||||
Name: hr.Spec.Chart.Spec.SourceRef.Name,
|
||||
}, hrHelmRepository)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to find HelmRepository: %w", err)
|
||||
}
|
||||
hrHelmRepositoryReady = meta.FindStatusCondition(hrHelmRepository.Status.Conditions, fluxmeta.ReadyCondition)
|
||||
}
|
||||
hrHelmRepositoryReady = meta.FindStatusCondition(hrHelmRepository.Status.Conditions, fluxmeta.ReadyCondition)
|
||||
}
|
||||
|
||||
var traceTmpl = `
|
||||
@@ -515,6 +541,34 @@ Message: {{.GitRepositoryReady.Message}}
|
||||
Status: Unknown
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .OCIRepository }}
|
||||
---
|
||||
OCIRepository: {{.OCIRepository.Name}}
|
||||
Namespace: {{.OCIRepository.Namespace}}
|
||||
URL: {{.OCIRepository.Spec.URL}}
|
||||
{{- if .OCIRepository.Spec.Reference }}
|
||||
{{- if .OCIRepository.Spec.Reference.Tag }}
|
||||
Tag: {{.OCIRepository.Spec.Reference.Tag}}
|
||||
{{- else if .OCIRepository.Spec.Reference.SemVer }}
|
||||
Tag: {{.OCIRepository.Spec.Reference.SemVer}}
|
||||
{{- else if .OCIRepository.Spec.Reference.Digest }}
|
||||
Digest: {{.OCIRepository.Spec.Reference.Digest}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .OCIRepository.Status.Artifact }}
|
||||
Revision: {{.OCIRepository.Status.Artifact.Revision}}
|
||||
{{- end }}
|
||||
{{- if .OCIRepositoryReady }}
|
||||
{{- if eq .OCIRepositoryReady.Status "False" }}
|
||||
Status: Last reconciliation failed at {{.OCIRepositoryReady.LastTransitionTime}}
|
||||
{{- else }}
|
||||
Status: Last reconciled at {{.OCIRepositoryReady.LastTransitionTime}}
|
||||
{{- end }}
|
||||
Message: {{.OCIRepositoryReady.Message}}
|
||||
{{- else }}
|
||||
Status: Unknown
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
`
|
||||
|
||||
traceResult := struct {
|
||||
@@ -528,6 +582,9 @@ Status: Unknown
|
||||
GitRepositoryReady *metav1.Condition
|
||||
HelmRepository *sourcev1.HelmRepository
|
||||
HelmRepositoryReady *metav1.Condition
|
||||
OCIRepository *sourcev1.OCIRepository
|
||||
OCIRepositoryReady *metav1.Condition
|
||||
Annotations map[string]string
|
||||
}{
|
||||
ObjectName: obj.GetKind() + "/" + obj.GetName(),
|
||||
ObjectNamespace: obj.GetNamespace(),
|
||||
@@ -539,6 +596,8 @@ Status: Unknown
|
||||
GitRepositoryReady: hrGitRepositoryReady,
|
||||
HelmRepository: hrHelmRepository,
|
||||
HelmRepositoryReady: hrHelmRepositoryReady,
|
||||
OCIRepository: hrOCIRepository,
|
||||
OCIRepositoryReady: hrOCIRepositoryReady,
|
||||
}
|
||||
|
||||
t, err := template.New("tmpl").Parse(traceTmpl)
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
//go:build unit
|
||||
// +build unit
|
||||
|
||||
/*
|
||||
Copyright 2024 The Flux authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -69,6 +85,18 @@ func TestTrace(t *testing.T) {
|
||||
"ociRepositoryLastReconcile": toLocalTime(t, "2021-07-20T00:48:16Z"),
|
||||
},
|
||||
},
|
||||
{
|
||||
"Deployment from HelmRelease from OCI registry",
|
||||
"trace podinfo --kind deployment --api-version=apps/v1",
|
||||
"testdata/trace/deployment-hr-ocirepo.yaml",
|
||||
"testdata/trace/deployment-hr-ocirepo.golden",
|
||||
map[string]string{
|
||||
"ns": allocateNamespace("podinfo"),
|
||||
"fluxns": allocateNamespace("flux-system"),
|
||||
"helmReleaseLastReconcile": toLocalTime(t, "2021-07-16T15:42:20Z"),
|
||||
"ociRepositoryLastReconcile": toLocalTime(t, "2021-07-20T00:48:16Z"),
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
|
||||
@@ -43,6 +43,9 @@ The following template can be used for the GitHub release page:
|
||||
<!-- auto-generated list of pull requests to the CLI starts here -->
|
||||
```
|
||||
|
||||
Typically, you want to link the [Flux upgrade](https://fluxcd.io/flux/installation/upgrade/)
|
||||
guide to refer users for up to date information on upgrade options.
|
||||
|
||||
In some scenarios, you may want to include specific information about API
|
||||
changes and/or upgrade procedures. Consult [the formatting of
|
||||
`v2.0.0-rc.1`](https://github.com/fluxcd/flux2/releases/tag/v2.0.0-rc.1) for
|
||||
@@ -69,4 +72,4 @@ The following template can be used for the Slack release message:
|
||||
```
|
||||
|
||||
For more concrete examples, see the pinned messages in the [Flux Slack
|
||||
channel](https://cloud-native.slack.com/archives/CLAJ40HV3).
|
||||
channel](https://cloud-native.slack.com/archives/CLAJ40HV3).
|
||||
|
||||
311
go.mod
311
go.mod
@@ -1,258 +1,265 @@
|
||||
module github.com/fluxcd/flux2/v2
|
||||
|
||||
go 1.22.4
|
||||
go 1.24.0
|
||||
|
||||
// Fix CVE-2022-28948.
|
||||
replace gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.1
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver/v3 v3.3.0
|
||||
github.com/ProtonMail/go-crypto v1.0.0
|
||||
github.com/cyphar/filepath-securejoin v0.3.2
|
||||
github.com/distribution/distribution/v3 v3.0.0-beta.1
|
||||
github.com/fluxcd/cli-utils v0.36.0-flux.9
|
||||
github.com/fluxcd/go-git-providers v0.21.0
|
||||
github.com/fluxcd/helm-controller/api v1.1.0
|
||||
github.com/fluxcd/image-automation-controller/api v0.39.0
|
||||
github.com/fluxcd/image-reflector-controller/api v0.33.0
|
||||
github.com/fluxcd/kustomize-controller/api v1.4.0
|
||||
github.com/fluxcd/notification-controller/api v1.4.0
|
||||
github.com/fluxcd/pkg/apis/event v0.10.1
|
||||
github.com/fluxcd/pkg/apis/meta v1.6.1
|
||||
github.com/fluxcd/pkg/envsubst v1.1.0
|
||||
github.com/fluxcd/pkg/git v0.21.0
|
||||
github.com/fluxcd/pkg/git/gogit v0.21.0
|
||||
github.com/fluxcd/pkg/kustomize v1.13.0
|
||||
github.com/fluxcd/pkg/oci v0.41.1
|
||||
github.com/fluxcd/pkg/runtime v0.49.1
|
||||
github.com/fluxcd/pkg/sourceignore v0.8.1
|
||||
github.com/fluxcd/pkg/ssa v0.41.1
|
||||
github.com/fluxcd/pkg/ssh v0.14.1
|
||||
github.com/fluxcd/pkg/tar v0.8.1
|
||||
github.com/fluxcd/pkg/version v0.4.1
|
||||
github.com/fluxcd/source-controller/api v1.4.1
|
||||
github.com/go-git/go-git/v5 v5.12.0
|
||||
github.com/ProtonMail/go-crypto v1.2.0
|
||||
github.com/cyphar/filepath-securejoin v0.4.1
|
||||
github.com/distribution/distribution/v3 v3.0.0
|
||||
github.com/fluxcd/cli-utils v0.36.0-flux.13
|
||||
github.com/fluxcd/go-git-providers v0.23.0
|
||||
github.com/fluxcd/helm-controller/api v1.3.0
|
||||
github.com/fluxcd/image-automation-controller/api v0.41.2
|
||||
github.com/fluxcd/image-reflector-controller/api v0.35.2
|
||||
github.com/fluxcd/kustomize-controller/api v1.6.0
|
||||
github.com/fluxcd/notification-controller/api v1.6.0
|
||||
github.com/fluxcd/pkg/apis/event v0.17.0
|
||||
github.com/fluxcd/pkg/apis/meta v1.12.0
|
||||
github.com/fluxcd/pkg/auth v0.17.0
|
||||
github.com/fluxcd/pkg/chartutil v1.3.0
|
||||
github.com/fluxcd/pkg/envsubst v1.4.0
|
||||
github.com/fluxcd/pkg/git v0.32.0
|
||||
github.com/fluxcd/pkg/git/gogit v0.35.1
|
||||
github.com/fluxcd/pkg/kustomize v1.18.0
|
||||
github.com/fluxcd/pkg/oci v0.49.0
|
||||
github.com/fluxcd/pkg/runtime v0.60.0
|
||||
github.com/fluxcd/pkg/sourceignore v0.12.0
|
||||
github.com/fluxcd/pkg/ssa v0.48.0
|
||||
github.com/fluxcd/pkg/ssh v0.19.0
|
||||
github.com/fluxcd/pkg/tar v0.12.0
|
||||
github.com/fluxcd/pkg/version v0.7.0
|
||||
github.com/fluxcd/source-controller/api v1.6.2
|
||||
github.com/go-git/go-git/v5 v5.16.2
|
||||
github.com/go-logr/logr v1.4.2
|
||||
github.com/gonvenience/bunt v1.3.5
|
||||
github.com/gonvenience/ytbx v1.4.4
|
||||
github.com/google/go-cmp v0.6.0
|
||||
github.com/google/go-containerregistry v0.20.2
|
||||
github.com/gonvenience/bunt v1.4.0
|
||||
github.com/gonvenience/ytbx v1.4.6
|
||||
github.com/google/go-cmp v0.7.0
|
||||
github.com/google/go-containerregistry v0.20.3
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2
|
||||
github.com/homeport/dyff v1.7.1
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0
|
||||
github.com/manifoldco/promptui v0.9.0
|
||||
github.com/mattn/go-shellwords v1.0.12
|
||||
github.com/notaryproject/notation-go v1.2.1
|
||||
github.com/notaryproject/notation-go v1.3.0
|
||||
github.com/olekukonko/tablewriter v0.0.5
|
||||
github.com/onsi/gomega v1.34.2
|
||||
github.com/onsi/gomega v1.37.0
|
||||
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
|
||||
github.com/spf13/cobra v1.8.1
|
||||
github.com/spf13/cobra v1.9.1
|
||||
github.com/theckman/yacspin v0.13.12
|
||||
golang.org/x/crypto v0.27.0
|
||||
golang.org/x/term v0.24.0
|
||||
golang.org/x/text v0.18.0
|
||||
k8s.io/api v0.31.1
|
||||
k8s.io/apiextensions-apiserver v0.31.1
|
||||
k8s.io/apimachinery v0.31.1
|
||||
k8s.io/cli-runtime v0.31.1
|
||||
k8s.io/client-go v0.31.1
|
||||
k8s.io/kubectl v0.31.1
|
||||
sigs.k8s.io/controller-runtime v0.19.0
|
||||
sigs.k8s.io/kustomize/api v0.17.3
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.2
|
||||
golang.org/x/crypto v0.39.0
|
||||
golang.org/x/term v0.32.0
|
||||
golang.org/x/text v0.26.0
|
||||
k8s.io/api v0.33.0
|
||||
k8s.io/apiextensions-apiserver v0.33.0
|
||||
k8s.io/apimachinery v0.33.0
|
||||
k8s.io/cli-runtime v0.33.0
|
||||
k8s.io/client-go v0.33.0
|
||||
k8s.io/kubectl v0.33.0
|
||||
sigs.k8s.io/controller-runtime v0.21.0
|
||||
sigs.k8s.io/kustomize/api v0.19.0
|
||||
sigs.k8s.io/kustomize/kyaml v0.19.0
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
require (
|
||||
code.gitea.io/sdk/gitea v0.19.0 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.6.0 // indirect
|
||||
code.gitea.io/sdk/gitea v0.21.0 // indirect
|
||||
dario.cat/mergo v1.0.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
|
||||
github.com/42wim/httpsig v1.2.2 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.9.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
|
||||
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
|
||||
github.com/BurntSushi/toml v1.4.0 // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect
|
||||
github.com/BurntSushi/toml v1.5.0 // indirect
|
||||
github.com/MakeNowJust/heredoc v1.0.0 // indirect
|
||||
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2 v1.30.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.33 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.32 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ecr v1.33.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 // indirect
|
||||
github.com/aws/smithy-go v1.20.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2 v1.36.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/config v1.29.14 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.67 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ecr v1.43.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.33.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19 // indirect
|
||||
github.com/aws/smithy-go v1.22.3 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||
github.com/bradleyfalzon/ghinstallation/v2 v2.15.0 // indirect
|
||||
github.com/bshuster-repo/logrus-logstash-hook v1.0.0 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/chai2010/gettext-go v1.0.2 // indirect
|
||||
github.com/chzyer/readline v1.5.1 // indirect
|
||||
github.com/cloudflare/circl v1.4.0 // indirect
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
|
||||
github.com/cloudflare/circl v1.6.1 // indirect
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/davidmz/go-pageant v1.0.2 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/distribution/reference v0.6.0 // indirect
|
||||
github.com/docker/cli v27.1.2+incompatible // indirect
|
||||
github.com/docker/cli v27.5.0+incompatible // indirect
|
||||
github.com/docker/distribution v2.8.3+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.8.2 // indirect
|
||||
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
|
||||
github.com/docker/go-metrics v0.0.1 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
|
||||
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
|
||||
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
|
||||
github.com/fatih/color v1.16.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/fluxcd/pkg/apis/acl v0.3.0 // indirect
|
||||
github.com/fluxcd/pkg/apis/kustomize v1.6.1 // indirect
|
||||
github.com/fluxcd/pkg/auth v0.0.1 // indirect
|
||||
github.com/fluxcd/pkg/cache v0.0.4 // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
|
||||
github.com/fluxcd/pkg/apis/acl v0.7.0 // indirect
|
||||
github.com/fluxcd/pkg/apis/kustomize v1.10.0 // indirect
|
||||
github.com/fluxcd/pkg/cache v0.9.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.9.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.7 // indirect
|
||||
github.com/go-errors/errors v1.5.1 // indirect
|
||||
github.com/go-fed/httpsig v1.1.0 // indirect
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.5.0 // indirect
|
||||
github.com/go-ldap/ldap/v3 v3.4.8 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.6.2 // indirect
|
||||
github.com/go-ldap/ldap/v3 v3.4.10 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.1 // indirect
|
||||
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.1 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/gonvenience/neat v1.3.13 // indirect
|
||||
github.com/gonvenience/term v1.0.2 // indirect
|
||||
github.com/gonvenience/text v1.0.7 // indirect
|
||||
github.com/gonvenience/wrap v1.2.0 // indirect
|
||||
github.com/google/btree v1.1.2 // indirect
|
||||
github.com/google/gnostic-models v0.6.8 // indirect
|
||||
github.com/google/go-github/v64 v64.0.0 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
|
||||
github.com/gonvenience/neat v1.3.15 // indirect
|
||||
github.com/gonvenience/term v1.0.3 // indirect
|
||||
github.com/gonvenience/text v1.0.8 // indirect
|
||||
github.com/google/btree v1.1.3 // indirect
|
||||
github.com/google/gnostic-models v0.6.9 // indirect
|
||||
github.com/google/go-github/v71 v71.0.0 // indirect
|
||||
github.com/google/go-querystring v1.1.0 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/gorilla/handlers v1.5.2 // indirect
|
||||
github.com/gorilla/mux v1.8.1 // indirect
|
||||
github.com/gorilla/websocket v1.5.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
|
||||
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/go-version v1.7.0 // indirect
|
||||
github.com/hashicorp/golang-lru/arc/v2 v2.0.5 // indirect
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.5 // indirect
|
||||
github.com/imdario/mergo v0.3.16 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||
github.com/klauspost/compress v1.17.9 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mailru/easyjson v0.9.0 // indirect
|
||||
github.com/mattn/go-ciede2000 v0.0.0-20170301095244-782e8c62fec3 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.13 // indirect
|
||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/go-ps v1.0.0 // indirect
|
||||
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
|
||||
github.com/mitchellh/hashstructure v1.1.0 // indirect
|
||||
github.com/moby/spdystream v0.4.0 // indirect
|
||||
github.com/moby/term v0.5.0 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||
github.com/moby/spdystream v0.5.0 // indirect
|
||||
github.com/moby/term v0.5.2 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
||||
github.com/notaryproject/notation-core-go v1.1.0 // indirect
|
||||
github.com/notaryproject/tspclient-go v0.2.0 // indirect
|
||||
github.com/notaryproject/notation-core-go v1.2.0 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.1.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.1.1 // indirect
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.2 // indirect
|
||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/prometheus/client_golang v1.20.3 // indirect
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/common v0.55.0 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
github.com/prometheus/client_golang v1.22.0 // indirect
|
||||
github.com/prometheus/client_model v0.6.2 // indirect
|
||||
github.com/prometheus/common v0.63.0 // indirect
|
||||
github.com/prometheus/procfs v0.16.1 // indirect
|
||||
github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect
|
||||
github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 // indirect
|
||||
github.com/redis/go-redis/v9 v9.1.0 // indirect
|
||||
github.com/redis/go-redis/v9 v9.7.3 // indirect
|
||||
github.com/rivo/uniseg v0.2.0 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/skeema/knownhosts v1.3.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/skeema/knownhosts v1.3.1 // indirect
|
||||
github.com/spf13/pflag v1.0.6 // indirect
|
||||
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
|
||||
github.com/vbatts/tar-split v0.11.3 // indirect
|
||||
github.com/vbatts/tar-split v0.11.6 // indirect
|
||||
github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
github.com/xanzy/go-gitlab v0.107.0 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.opentelemetry.io/contrib/bridges/prometheus v0.53.0 // indirect
|
||||
go.opentelemetry.io/contrib/exporters/autoexport v0.53.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
|
||||
go.opentelemetry.io/otel v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.4.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/prometheus v0.50.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/log v0.4.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk/log v0.4.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.28.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
|
||||
go.starlark.net v0.0.0-20231121155337-90ade8b19d09 // indirect
|
||||
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
|
||||
golang.org/x/net v0.29.0 // indirect
|
||||
golang.org/x/oauth2 v0.23.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/sys v0.25.0 // indirect
|
||||
golang.org/x/time v0.6.0 // indirect
|
||||
gitlab.com/gitlab-org/api/client-go v0.128.0 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/contrib/bridges/prometheus v0.57.0 // indirect
|
||||
go.opentelemetry.io/contrib/exporters/autoexport v0.57.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
|
||||
go.opentelemetry.io/otel v1.34.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.8.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.8.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/prometheus v0.54.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.8.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/log v0.8.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.34.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk/log v0.8.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.34.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
|
||||
golang.org/x/net v0.40.0 // indirect
|
||||
golang.org/x/oauth2 v0.29.0 // indirect
|
||||
golang.org/x/sync v0.15.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/time v0.11.0 // indirect
|
||||
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
|
||||
google.golang.org/grpc v1.65.0 // indirect
|
||||
google.golang.org/protobuf v1.34.2 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
|
||||
google.golang.org/grpc v1.68.1 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/component-base v0.31.1 // indirect
|
||||
helm.sh/helm/v3 v3.17.3 // indirect
|
||||
k8s.io/component-base v0.33.0 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20240411171206-dc4e619f62f3 // indirect
|
||||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
|
||||
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e // indirect
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
|
||||
)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user