mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 09:38:49 +01:00
Compare commits
42 Commits
commit-ser
...
v2.6.0-rc3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e51d0b3224 | ||
|
|
0f5f41ebb0 | ||
|
|
ee4b3cacc9 | ||
|
|
62a521ccf6 | ||
|
|
eb6474c524 | ||
|
|
826507897d | ||
|
|
5fcebcc799 | ||
|
|
7f00420b3d | ||
|
|
6ebca0bd01 | ||
|
|
93fa2a46a5 | ||
|
|
72f92b6f2a | ||
|
|
7d54482d42 | ||
|
|
fe8049fc50 | ||
|
|
8065748cca | ||
|
|
57560b32f6 | ||
|
|
d5eb10c24d | ||
|
|
cab9b5769f | ||
|
|
bb8ef6dfa3 | ||
|
|
6a9f37ca7d | ||
|
|
b357fd61c0 | ||
|
|
f8d275c50d | ||
|
|
053cfaf378 | ||
|
|
f869cc4feb | ||
|
|
fab4a3cb92 | ||
|
|
7dab9b23bf | ||
|
|
c8d010ceb0 | ||
|
|
3fa9a9197b | ||
|
|
af00900049 | ||
|
|
e67f4b151e | ||
|
|
3a8802f083 | ||
|
|
cdaf2b2c73 | ||
|
|
222cdf4711 | ||
|
|
c58d3843d5 | ||
|
|
383a65fe71 | ||
|
|
acfdc3d3be | ||
|
|
80f4ab9d7b | ||
|
|
44d13a73c9 | ||
|
|
a6469140b9 | ||
|
|
9a4179b1b6 | ||
|
|
0cd4854ffa | ||
|
|
81e40d53fe | ||
|
|
8532cfec4a |
68
.github/workflows/ci-build.yaml
vendored
68
.github/workflows/ci-build.yaml
vendored
@@ -27,9 +27,9 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Setup Golang
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ env.GOLANG_VERSION }}
|
||||
- name: Download all Go modules
|
||||
@@ -45,13 +45,13 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Setup Golang
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ env.GOLANG_VERSION }}
|
||||
- name: Restore go build cache
|
||||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
|
||||
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
|
||||
@@ -69,9 +69,9 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Setup Golang
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ env.GOLANG_VERSION }}
|
||||
- name: Run golangci-lint
|
||||
@@ -92,11 +92,11 @@ jobs:
|
||||
- name: Create checkout directory
|
||||
run: mkdir -p ~/go/src/github.com/argoproj
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Create symlink in GOPATH
|
||||
run: ln -s $(pwd) ~/go/src/github.com/argoproj/argo-cd
|
||||
- name: Setup Golang
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ env.GOLANG_VERSION }}
|
||||
- name: Install required packages
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
run: |
|
||||
echo "/usr/local/bin" >> $GITHUB_PATH
|
||||
- name: Restore go build cache
|
||||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
|
||||
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
|
||||
@@ -133,12 +133,12 @@ jobs:
|
||||
- name: Run all unit tests
|
||||
run: make test-local
|
||||
- name: Generate code coverage artifacts
|
||||
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: code-coverage
|
||||
path: coverage.out
|
||||
- name: Generate test results artifacts
|
||||
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: test-results
|
||||
path: test-results/
|
||||
@@ -155,11 +155,11 @@ jobs:
|
||||
- name: Create checkout directory
|
||||
run: mkdir -p ~/go/src/github.com/argoproj
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Create symlink in GOPATH
|
||||
run: ln -s $(pwd) ~/go/src/github.com/argoproj/argo-cd
|
||||
- name: Setup Golang
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ env.GOLANG_VERSION }}
|
||||
- name: Install required packages
|
||||
@@ -179,7 +179,7 @@ jobs:
|
||||
run: |
|
||||
echo "/usr/local/bin" >> $GITHUB_PATH
|
||||
- name: Restore go build cache
|
||||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
|
||||
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
|
||||
@@ -196,7 +196,7 @@ jobs:
|
||||
- name: Run all unit tests
|
||||
run: make test-race-local
|
||||
- name: Generate test results artifacts
|
||||
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: race-results
|
||||
path: test-results/
|
||||
@@ -206,9 +206,9 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Setup Golang
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ env.GOLANG_VERSION }}
|
||||
- name: Create symlink in GOPATH
|
||||
@@ -250,14 +250,14 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Setup NodeJS
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version: '12.18.4'
|
||||
- name: Restore node dependency cache
|
||||
id: cache-dependencies
|
||||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
|
||||
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
|
||||
with:
|
||||
path: ui/node_modules
|
||||
key: ${{ runner.os }}-node-dep-v2-${{ hashFiles('**/yarn.lock') }}
|
||||
@@ -287,12 +287,12 @@ jobs:
|
||||
sonar_secret: ${{ secrets.SONAR_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Restore node dependency cache
|
||||
id: cache-dependencies
|
||||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
|
||||
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
|
||||
with:
|
||||
path: ui/node_modules
|
||||
key: ${{ runner.os }}-node-dep-v2-${{ hashFiles('**/yarn.lock') }}
|
||||
@@ -303,11 +303,11 @@ jobs:
|
||||
run: |
|
||||
mkdir -p test-results
|
||||
- name: Get code coverage artifiact
|
||||
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3.0.1
|
||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||
with:
|
||||
name: code-coverage
|
||||
- name: Get test result artifact
|
||||
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3.0.1
|
||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||
with:
|
||||
name: test-results
|
||||
path: test-results
|
||||
@@ -366,22 +366,14 @@ jobs:
|
||||
GITLAB_TOKEN: ${{ secrets.E2E_TEST_GITLAB_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Setup Golang
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ env.GOLANG_VERSION }}
|
||||
- name: GH actions workaround - Kill XSP4 process
|
||||
run: |
|
||||
sudo pkill mono || true
|
||||
# ubuntu-22.04 comes with kubectl, but the version is not pinned. The version as of 2022-12-05 is 1.26.0 which
|
||||
# breaks the `TestNamespacedResourceDiffing` e2e test. So we'll pin to 1.25 and then fix the underlying issue.
|
||||
- name: Install kubectl
|
||||
run: |
|
||||
rm /usr/local/bin/kubectl
|
||||
curl -LO https://dl.k8s.io/release/v1.25.4/bin/linux/amd64/kubectl
|
||||
mv kubectl /usr/local/bin/kubectl
|
||||
chmod +x /usr/local/bin/kubectl
|
||||
- name: Install K3S
|
||||
env:
|
||||
INSTALL_K3S_VERSION: ${{ matrix.k3s-version }}+k3s1
|
||||
@@ -394,7 +386,7 @@ jobs:
|
||||
sudo chown runner $HOME/.kube/config
|
||||
kubectl version
|
||||
- name: Restore go build cache
|
||||
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
|
||||
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
|
||||
with:
|
||||
path: ~/.cache/go-build
|
||||
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
|
||||
@@ -422,7 +414,7 @@ jobs:
|
||||
run: |
|
||||
docker pull ghcr.io/dexidp/dex:v2.35.3
|
||||
docker pull argoproj/argo-cd-ci-builder:v1.0.0
|
||||
docker pull redis:7.0.5-alpine
|
||||
docker pull redis:7.0.7-alpine
|
||||
- name: Create target directory for binaries in the build-process
|
||||
run: |
|
||||
mkdir -p dist
|
||||
@@ -450,7 +442,7 @@ jobs:
|
||||
set -x
|
||||
make test-e2e-local
|
||||
- name: Upload e2e-server logs
|
||||
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: e2e-server-k8s${{ matrix.k3s-version }}.log
|
||||
path: /tmp/e2e-server.log
|
||||
|
||||
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
||||
15
.github/workflows/image.yaml
vendored
15
.github/workflows/image.yaml
vendored
@@ -29,10 +29,10 @@ jobs:
|
||||
env:
|
||||
GOPATH: /home/runner/work/argo-cd/argo-cd
|
||||
steps:
|
||||
- uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ env.GOLANG_VERSION }}
|
||||
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
with:
|
||||
path: src/github.com/argoproj/argo-cd
|
||||
|
||||
@@ -71,11 +71,18 @@ jobs:
|
||||
- name: Install cosign
|
||||
uses: sigstore/cosign-installer@9becc617647dfa20ae7b1151972e9b3a2c338a2b # v2.8.1
|
||||
with:
|
||||
cosign-release: 'v1.13.0'
|
||||
cosign-release: 'v1.13.1'
|
||||
|
||||
- name: Install crane to get digest of image
|
||||
uses: imjasonh/setup-crane@e82f1b9a8007d399333baba4d75915558e9fb6a4
|
||||
|
||||
- name: Get digest of image
|
||||
run: |
|
||||
echo "IMAGE_DIGEST=$(crane digest quay.io/argoproj/argocd:latest)" >> $GITHUB_ENV
|
||||
|
||||
- name: Sign Argo CD latest image
|
||||
run: |
|
||||
cosign sign --key env://COSIGN_PRIVATE_KEY quay.io/argoproj/argocd:latest
|
||||
cosign sign --key env://COSIGN_PRIVATE_KEY quay.io/argoproj/argocd@${{ env.IMAGE_DIGEST }}
|
||||
# Displays the public key to share.
|
||||
cosign public-key --key env://COSIGN_PRIVATE_KEY
|
||||
env:
|
||||
|
||||
19
.github/workflows/release.yaml
vendored
19
.github/workflows/release.yaml
vendored
@@ -12,7 +12,7 @@ on:
|
||||
- "!release-v0*"
|
||||
|
||||
env:
|
||||
GOLANG_VERSION: '1.18'
|
||||
GOLANG_VERSION: '1.18'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
GIT_EMAIL: argoproj@gmail.com
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -147,7 +147,7 @@ jobs:
|
||||
echo "RELEASE_NOTES=${RELEASE_NOTES}" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup Golang
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ env.GOLANG_VERSION }}
|
||||
|
||||
@@ -217,11 +217,18 @@ jobs:
|
||||
- name: Install cosign
|
||||
uses: sigstore/cosign-installer@9becc617647dfa20ae7b1151972e9b3a2c338a2b # v2.8.1
|
||||
with:
|
||||
cosign-release: 'v1.13.0'
|
||||
cosign-release: 'v1.13.1'
|
||||
|
||||
- name: Install crane to get digest of image
|
||||
uses: imjasonh/setup-crane@e82f1b9a8007d399333baba4d75915558e9fb6a4
|
||||
|
||||
- name: Get digest of image
|
||||
run: |
|
||||
echo "IMAGE_DIGEST=$(crane digest quay.io/argoproj/argocd:v${TARGET_VERSION})" >> $GITHUB_ENV
|
||||
|
||||
- name: Sign Argo CD container images and assets
|
||||
run: |
|
||||
cosign sign --key env://COSIGN_PRIVATE_KEY ${IMAGE_NAMESPACE}/argocd:v${TARGET_VERSION}
|
||||
cosign sign --key env://COSIGN_PRIVATE_KEY ${IMAGE_NAMESPACE}/argocd@${{ env.IMAGE_DIGEST }}
|
||||
cosign sign-blob --key env://COSIGN_PRIVATE_KEY ./dist/argocd-${TARGET_VERSION}-checksums.txt > ./dist/argocd-${TARGET_VERSION}-checksums.sig
|
||||
# Retrieves the public key to release as an asset
|
||||
cosign public-key --key env://COSIGN_PRIVATE_KEY > ./dist/argocd-cosign.pub
|
||||
@@ -264,7 +271,7 @@ jobs:
|
||||
SIGS_BOM_VERSION: v0.2.1
|
||||
# comma delimited list of project relative folders to inspect for package
|
||||
# managers (gomod, yarn, npm).
|
||||
PROJECT_FOLDERS: ".,./ui"
|
||||
PROJECT_FOLDERS: ".,./ui"
|
||||
# full qualified name of the docker image to be inspected
|
||||
DOCKER_IMAGE: ${{env.IMAGE_NAMESPACE}}/argocd:v${{env.TARGET_VERSION}}
|
||||
run: |
|
||||
|
||||
2
.github/workflows/update-snyk.yaml
vendored
2
.github/workflows/update-snyk.yaml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build reports
|
||||
|
||||
@@ -207,7 +207,7 @@ func NewCommand() *cobra.Command {
|
||||
command.Flags().StringVar(&cmdutil.LogFormat, "logformat", env.StringFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_LOGFORMAT", "text"), "Set the logging format. One of: text|json")
|
||||
command.Flags().StringVar(&cmdutil.LogLevel, "loglevel", env.StringFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_LOGLEVEL", "info"), "Set the logging level. One of: debug|info|warn|error")
|
||||
command.Flags().BoolVar(&dryRun, "dry-run", env.ParseBoolFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_DRY_RUN", false), "Enable dry run mode")
|
||||
command.Flags().BoolVar(&enableProgressiveRollouts, "enable-progressive-rollouts", env.ParseBoolFromEnv("ARGOCD_APPLICATIONSET_ENABLE_PROGRESSIVE_ROLLOUTS", false), "Enable use of the experimental progressive rollouts feature.")
|
||||
command.Flags().BoolVar(&enableProgressiveRollouts, "enable-progressive-rollouts", env.ParseBoolFromEnv("ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_PROGRESSIVE_ROLLOUTS", false), "Enable use of the experimental progressive rollouts feature.")
|
||||
return &command
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ spec:
|
||||
* `repo`: Required name of the GitHub repository.
|
||||
* `api`: If using GitHub Enterprise, the URL to access it. (Optional)
|
||||
* `tokenRef`: A `Secret` name and key containing the GitHub access token to use for requests. If not specified, will make anonymous requests which have a lower rate limit and can only see public repositories. (Optional)
|
||||
* `labels`: Labels is used to filter the PRs that you want to target. (Optional)
|
||||
* `labels`: Filter the PRs to those containing **all** of the labels listed. (Optional)
|
||||
* `appSecretName`: A `Secret` name containing a GitHub App secret in [repo-creds format][repo-creds].
|
||||
|
||||
[repo-creds]: ../declarative-setup.md#repository-credentials
|
||||
|
||||
@@ -12,8 +12,9 @@ The Progressive Rollouts feature set is intended to be light and flexible. The f
|
||||
|
||||
## Enabling Progressive Rollouts
|
||||
As an experimental feature, progressive rollouts must be explicitly enabled, in one of these ways.
|
||||
|
||||
1. Pass `--enable-progressive-rollouts` to the ApplicationSet controller args.
|
||||
1. Set `ARGOCD_APPLICATIONSET_ENABLE_PROGRESSIVE_ROLLOUTS=true` in the ApplicationSet controller environment variables.
|
||||
1. Set `ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_PROGRESSIVE_ROLLOUTS=true` in the ApplicationSet controller environment variables.
|
||||
1. Set `applicationsetcontroller.enable.progressive.rollouts: true` in the ArgoCD ConfigMap.
|
||||
|
||||
## Strategies
|
||||
@@ -46,6 +47,7 @@ When the ApplicationSet changes, the changes will be applied to each group of Ap
|
||||
The following example illustrates how to stage a progressive rollout over Applications with explicitly configured environment labels.
|
||||
|
||||
Once a change is pushed, the following will happen in order.
|
||||
|
||||
* All `env-dev` Applications will be updated simultaneously.
|
||||
* The rollout will wait for all `env-qa` Applications to be manually synced via the `argocd` CLI or by clicking the Sync button in the UI.
|
||||
* 10% of all `env-prod` Applications will be updated at a time until all `env-prod` Applications have been updated.
|
||||
|
||||
@@ -47,7 +47,7 @@ data:
|
||||
help.download.windows-amd64: "path-or-url-to-download"
|
||||
|
||||
# A dex connector configuration (optional). See SSO configuration documentation:
|
||||
# https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/sso
|
||||
# https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/user-management/index.md#sso
|
||||
# https://dexidp.io/docs/connectors/
|
||||
dex.config: |
|
||||
connectors:
|
||||
@@ -330,4 +330,4 @@ data:
|
||||
resource.links: |
|
||||
- url: https://mycompany.splunk.com?search={{.metadata.namespace}}
|
||||
title: Splunk
|
||||
if: kind == "Pod" || kind == "Deployment"
|
||||
if: kind == "Pod" || kind == "Deployment"
|
||||
|
||||
@@ -26,14 +26,14 @@ There are two ways to install a Config Management Plugin:
|
||||
2. Add the plugin as a sidecar to the repo-server Pod.
|
||||
This is a good option for a more complex plugin that would clutter the Argo CD ConfigMap. A copy of the repository is
|
||||
sent to the sidecar container as a tarball and processed individually per application, which makes it a good option
|
||||
for [concurrent processing of monorepos](../operator-manual/high_availability.md#enable-concurrent-processing).
|
||||
for [concurrent processing of monorepos](high_availability.md#enable-concurrent-processing).
|
||||
|
||||
### Option 1: Configure plugins via Argo CD configmap (deprecated)
|
||||
|
||||
The following changes are required to configure a new plugin:
|
||||
|
||||
1. Make sure required binaries are available in `argocd-repo-server` pod. The binaries can be added via volume mounts or
|
||||
using a custom image (see [custom_tools](../operator-manual/custom_tools.md) for examples of both).
|
||||
using a custom image (see [custom_tools](custom_tools.md) for examples of both).
|
||||
2. Register a new plugin in `argocd-cm` ConfigMap:
|
||||
|
||||
:::yaml
|
||||
@@ -246,7 +246,7 @@ volumes:
|
||||
Plugin commands have access to
|
||||
|
||||
1. The system environment variables (of the repo-server container for argocd-cm plugins or of the sidecar for sidecar plugins)
|
||||
2. [Standard build environment variables](build-environment.md)
|
||||
2. [Standard build environment variables](../user-guide/build-environment.md)
|
||||
3. Variables in the Application spec (References to system and build variables will get interpolated in the variables' values):
|
||||
|
||||
```yaml
|
||||
@@ -7,7 +7,7 @@ other than what Argo CD bundles. Some reasons to do this might be:
|
||||
* To upgrade/downgrade to a specific version of a tool due to bugs or bug fixes.
|
||||
* To install additional dependencies to be used by kustomize's configmap/secret generators.
|
||||
(e.g. curl, vault, gpg, AWS CLI)
|
||||
* To install a [config management plugin](../user-guide/config-management-plugins.md).
|
||||
* To install a [config management plugin](config-management-plugins.md).
|
||||
|
||||
As the Argo CD repo-server is the single service responsible for generating Kubernetes manifests, it
|
||||
can be customized to use alternative toolchain required by your environment.
|
||||
@@ -51,7 +51,7 @@ following example builds an entirely customized repo-server from a Dockerfile, i
|
||||
dependencies that may be needed for generating manifests.
|
||||
|
||||
```Dockerfile
|
||||
FROM argoproj/argocd:latest
|
||||
FROM argoproj/argocd:v2.5.4 # Replace tag with the appropriate argo version
|
||||
|
||||
# Switch to root for the ability to perform install
|
||||
USER root
|
||||
|
||||
63
docs/operator-manual/deep_links.md
Normal file
63
docs/operator-manual/deep_links.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# Deep Links
|
||||
|
||||
Deep links allow users to quickly redirect to third-party systems, such as Splunk, Datadog, etc. from the Argo CD
|
||||
user interface.
|
||||
|
||||
Argo CD administrator will be able to configure links to third-party systems by providing
|
||||
deep link templates configured in `argocd-cm`. The templates can be conditionally rendered and are able
|
||||
to reference different types of resources relating to where the links show up, this includes projects, applications,
|
||||
or individual resources (pods, services, etc.).
|
||||
|
||||
## Configuring Deep Links
|
||||
|
||||
The configuration for Deep Links is present in `argocd-cm` as `<location>.links` fields where
|
||||
`<location>` determines where it will be displayed. The possible values for `<location>` are :
|
||||
- `project` : all links under this field will show up in the project tab in the Argo CD UI
|
||||
- `application` : all links under this field will show up in the application summary tab
|
||||
- `resource` : all links under this field will show up in the resource (deployments, pods, services, etc.) summary tab
|
||||
|
||||
Each link in the list has five subfields :
|
||||
1. `title` : title/tag that will be displayed in the UI corresponding to that link
|
||||
2. `url` : the actual URL where the deep link will redirect to, this field can be templated to use data from the
|
||||
corresponing application, project or resource objects (depending on where it is located). This uses [text/template](pkg.go.dev/text/template) pkg for templating
|
||||
3. `description` (optional) : a description for what the deep link is about
|
||||
4. `icon.class` (optional) : a font-awesome icon class to be used when displaying the links in dropdown menus
|
||||
5. `if` (optional) : a conditional statement that results in either `true` or `false`, it also has access to the same
|
||||
data as the `url` field. If the condition resolves to `true` the deep link will be displayed - else it will be hidden. If
|
||||
the field is omitted, by default the deep links will be displayed. This uses [antonmedv/expr](https://github.com/antonmedv/expr/tree/master/docs) for evaluating conditions
|
||||
|
||||
!!!note
|
||||
For resources of kind Secret the data fields are redacted but other fields are accessible for templating the deep links.
|
||||
|
||||
!!!warning
|
||||
Make sure to validate the url templates and inputs to prevent data leaks or possible generation of any malicious links.
|
||||
|
||||
|
||||
An example `argocd-cm.yaml` file with deep links and their variations :
|
||||
|
||||
```yaml
|
||||
# sample project level links
|
||||
project.links: |
|
||||
- url: https://myaudit-system.com?project={{.metadata.name}}
|
||||
title: Audit
|
||||
description: system audit logs
|
||||
icon.class: "fa-book"
|
||||
# sample application level links
|
||||
application.links: |
|
||||
# pkg.go.dev/text/template is used for evaluating url templates
|
||||
- url: https://mycompany.splunk.com?search={{.spec.destination.namespace}}
|
||||
title: Splunk
|
||||
# conditionally show link e.g. for specific project
|
||||
# github.com/antonmedv/expr is used for evaluation of conditions
|
||||
- url: https://mycompany.splunk.com?search={{.spec.destination.namespace}}
|
||||
title: Splunk
|
||||
if: spec.project == "default"
|
||||
- url: https://{{.metadata.annotations.splunkhost}}?search={{.spec.destination.namespace}}
|
||||
title: Splunk
|
||||
if: metadata.annotations.splunkhost
|
||||
# sample resource level links
|
||||
resource.links: |
|
||||
- url: https://mycompany.splunk.com?search={{.metadata.namespace}}
|
||||
title: Splunk
|
||||
if: kind == "Pod" || kind == "Deployment"
|
||||
```
|
||||
@@ -16,6 +16,8 @@ with at least one value for `hostname` or `IP`.
|
||||
### Ingress
|
||||
* The `status.loadBalancer.ingress` list is non-empty, with at least one value for `hostname` or `IP`.
|
||||
|
||||
### Job
|
||||
* If job `.spec.suspended` is set to 'true', then the job and app health will be marked as suspended.
|
||||
### PersistentVolumeClaim
|
||||
* The `status.phase` is `Bound`
|
||||
|
||||
@@ -38,7 +40,7 @@ metadata:
|
||||
data:
|
||||
resource.customizations: |
|
||||
argoproj.io/Application:
|
||||
health.lua: |
|
||||
health.lua: |
|
||||
hs = {}
|
||||
hs.status = "Progressing"
|
||||
hs.message = ""
|
||||
@@ -64,11 +66,11 @@ There are two ways to configure a custom health check. The next two sections des
|
||||
|
||||
### Way 1. Define a Custom Health Check in `argocd-cm` ConfigMap
|
||||
|
||||
Custom health checks can be defined in
|
||||
Custom health checks can be defined in
|
||||
```yaml
|
||||
resource.customizations: |
|
||||
<group/kind>:
|
||||
health.lua: |
|
||||
health.lua: |
|
||||
```
|
||||
field of `argocd-cm`. If you are using argocd-operator, this is overridden by [the argocd-operator resourceCustomizations](https://argocd-operator.readthedocs.io/en/latest/reference/argocd/#resource-customizations).
|
||||
|
||||
@@ -101,15 +103,24 @@ data:
|
||||
hs.message = "Waiting for certificate"
|
||||
return hs
|
||||
```
|
||||
In order to prevent duplication of the same custom health check for potentially multiple resources, it is also possible to specify a wildcard in the resource kind, like this:
|
||||
In order to prevent duplication of the custom health check for potentially multiple resources, it is also possible to specify a wildcard in the resource kind, and anywhere in the resource group, like this:
|
||||
|
||||
```yaml
|
||||
resource.customizations: |
|
||||
ec2.aws.crossplane.io/*:
|
||||
health.lua: |
|
||||
...
|
||||
```
|
||||
|
||||
```yaml
|
||||
resource.customizations: |
|
||||
*.aws.crossplane.io/*:
|
||||
health.lua: |
|
||||
...
|
||||
```
|
||||
|
||||
|
||||
|
||||
The `obj` is a global variable which contains the resource. The script must return an object with status and optional message field.
|
||||
The custom health check might return one of the following health statuses:
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ A set of HA manifests are provided for users who wish to run Argo CD in a highly
|
||||
|
||||
[Manifests ⧉](https://github.com/argoproj/argo-cd/tree/master/manifests)
|
||||
|
||||
!!! note
|
||||
The HA installation will require at least three different nodes due to pod anti-affinity roles in the specs.
|
||||
> **NOTE:** The HA installation will require at least three different nodes due to pod anti-affinity roles in the
|
||||
> specs. Additionally, IPv6 only clusters are not supported.
|
||||
|
||||
## Scaling Up
|
||||
|
||||
@@ -188,4 +188,4 @@ spec:
|
||||
targetRevision: HEAD
|
||||
path: my-application
|
||||
# ...
|
||||
```
|
||||
```
|
||||
@@ -15,9 +15,11 @@ spec:
|
||||
- '*'
|
||||
|
||||
# Only permit applications to deploy to the guestbook namespace in the same cluster
|
||||
# Destination clusters can be identified by 'server', 'name', or both.
|
||||
destinations:
|
||||
- namespace: guestbook
|
||||
server: https://kubernetes.default.svc
|
||||
name: in-cluster
|
||||
|
||||
# Deny all cluster-scoped resources from being created, except for Namespace
|
||||
clusterResourceWhitelist:
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
# Secret Management
|
||||
|
||||
Argo CD is un-opinionated about how secrets are managed. There's many ways to do it and there's no one-size-fits-all solution. Here's some ways people are doing GitOps secrets:
|
||||
Argo CD is un-opinionated about how secrets are managed. There are many ways to do it, and there's no one-size-fits-all solution.
|
||||
|
||||
Many solutions use plugins to inject secrets into the application manifests. See [Mitigating Risks of Secret-Injection Plugins](#mitigating-risks-of-secret-injection-plugins)
|
||||
below to make sure you use those plugins securely.
|
||||
|
||||
Here are some ways people are doing GitOps secrets:
|
||||
|
||||
* [Bitnami Sealed Secrets](https://github.com/bitnami-labs/sealed-secrets)
|
||||
* [External Secrets Operator](https://github.com/external-secrets/external-secrets)
|
||||
@@ -15,3 +20,17 @@ Argo CD is un-opinionated about how secrets are managed. There's many ways to do
|
||||
* [Kubernetes Secrets Store CSI Driver](https://github.com/kubernetes-sigs/secrets-store-csi-driver)
|
||||
|
||||
For discussion, see [#1364](https://github.com/argoproj/argo-cd/issues/1364)
|
||||
|
||||
## Mitigating Risks of Secret-Injection Plugins
|
||||
|
||||
Argo CD caches the manifests generated by plugins, along with the injected secrets, in its Redis instance. Those
|
||||
manifests are also available via the repo-server API (a gRPC service). This means that the secrets are available to
|
||||
anyone who has access to the Redis instance or to the repo-server.
|
||||
|
||||
Consider these steps to mitigate the risks of secret-injection plugins:
|
||||
|
||||
1. Set up network policies to prevent direct access to Argo CD components (Redis and the repo-server). Make sure your
|
||||
cluster supports those network policies and can actually enforce them.
|
||||
2. Consider running Argo CD on its own cluster, with no other applications running on it.
|
||||
3. [Enable password authentication on the Redis instance](https://github.com/argoproj/argo-cd/issues/3130) (currently
|
||||
only supported for non-HA Argo CD installations).
|
||||
|
||||
@@ -36,7 +36,7 @@ data:
|
||||
|
||||
## Removed Python from the base image
|
||||
|
||||
If you are using a [Config Management Plugin](../../user-guide/config-management-plugins.md) that relies on Python, you
|
||||
If you are using a [Config Management Plugin](../config-management-plugins.md) that relies on Python, you
|
||||
will need to build a custom image on the Argo CD base to install Python.
|
||||
|
||||
## Upgraded Kustomize Version
|
||||
|
||||
@@ -176,7 +176,7 @@ that uses the Service Account for auth), be sure to test before deploying the 2.
|
||||
|
||||
### Remove the shared volume from any sidecar plugins
|
||||
|
||||
As a security enhancement, [sidecar plugins](../../user-guide/config-management-plugins.md#option-2-configure-plugin-via-sidecar)
|
||||
As a security enhancement, [sidecar plugins](../config-management-plugins.md#option-2-configure-plugin-via-sidecar)
|
||||
no longer share the /tmp directory with the repo-server.
|
||||
|
||||
If you have one or more sidecar plugins enabled, replace the /tmp volume mount for each sidecar to use a volume specific
|
||||
|
||||
@@ -6,3 +6,8 @@ Argo CD 2.5 introduced [Go templating in ApplicationSets](https://argo-cd.readth
|
||||
Argo CD 2.6 upgrades Sprig to v3. That upgrade includes an upgrade of [Masterminds/semver](https://github.com/Masterminds/semver/releases) to v3.
|
||||
|
||||
Masterminds/semver v3 changed the behavior of the `^` prefix in semantic version constraints. If you are using Go-templated ApplicationSets which include references to [Sprig's semver functions](https://masterminds.github.io/sprig/semver.html) and use the `^` prefix, read the [Masterminds/semver changelog](https://github.com/Masterminds/semver/releases/tag/v3.0.0) to understand how your ApplicationSets' behavior may change.
|
||||
|
||||
## Applications with suspended jobs now marked "Suspended" instead of "Progressing"
|
||||
Prior to Argo CD v2.6, an Application managing a suspended Job would be marked as "Progressing". This was confusing/unexpected behavior for many. Starting with v2.6, Argo CD will mark such Applications as "Suspended".
|
||||
|
||||
If you have processes which rely on the previous behavior (for example, a CI job with an argocd app wait call), update those before upgrading to v2.6.
|
||||
@@ -7,7 +7,7 @@ Argo CD supports several different ways in which Kubernetes manifests can be def
|
||||
* [Kustomize](kustomize.md) applications
|
||||
* [Helm](helm.md) charts
|
||||
* A directory of YAML/JSON/Jsonnet manifests, including [Jsonnet](jsonnet.md).
|
||||
* Any [custom config management tool](config-management-plugins.md) configured as a config management plugin
|
||||
* Any [custom config management tool](../operator-manual/config-management-plugins.md) configured as a config management plugin
|
||||
|
||||
## Development
|
||||
Argo CD also supports uploading local manifests directly. Since this is an anti-pattern of the
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Build Environment
|
||||
|
||||
[Custom tools](config-management-plugins.md), [Helm](helm.md), [Jsonnet](jsonnet.md), and [Kustomize](kustomize.md) support the following build env vars:
|
||||
[Custom tools](../operator-manual/config-management-plugins.md), [Helm](helm.md), [Jsonnet](jsonnet.md), and [Kustomize](kustomize.md) support the following build env vars:
|
||||
|
||||
| Variable | Description |
|
||||
| ----------------------------------- | ----------------------------------------------------------------------- |
|
||||
|
||||
@@ -69,7 +69,7 @@ spec:
|
||||
source:
|
||||
repoURL: https://github.com/argoproj/argocd-example-apps.git
|
||||
targetRevision: HEAD
|
||||
path: guestbook-kustomize
|
||||
path: kustomize-guestbook
|
||||
|
||||
kustomize:
|
||||
version: v3.5.4
|
||||
@@ -84,7 +84,7 @@ argocd app set <appName> --kustomize-version v3.5.4
|
||||
|
||||
## Build Environment
|
||||
|
||||
Kustomize apps have access to the [standard build environment](build-environment.md) which can be used in combination with a [config managment plugin](config-management-plugins.md) to alter the rendered manifests.
|
||||
Kustomize apps have access to the [standard build environment](build-environment.md) which can be used in combination with a [config managment plugin](../operator-manual/config-management-plugins.md) to alter the rendered manifests.
|
||||
|
||||
## Kustomizing Helm charts
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ spec:
|
||||
sources:
|
||||
- chart: elasticsearch
|
||||
repoURL: https://helm.elastic.co
|
||||
targetRevision: 7.6.0
|
||||
targetRevision: 8.5.1
|
||||
- repoURL: https://github.com/argoproj/argocd-example-apps.git
|
||||
path: guestbook
|
||||
targetRevision: HEAD
|
||||
|
||||
2
go.mod
2
go.mod
@@ -8,7 +8,7 @@ require (
|
||||
github.com/Masterminds/semver/v3 v3.2.0
|
||||
github.com/TomOnTime/utfutil v0.0.0-20180511104225-09c41003ee1d
|
||||
github.com/alicebob/miniredis/v2 v2.23.1
|
||||
github.com/argoproj/gitops-engine v0.7.1-0.20221108210551-e284fd71cb96
|
||||
github.com/argoproj/gitops-engine v0.7.1-0.20221208230615-917f5a0f16d5
|
||||
github.com/argoproj/notifications-engine v0.3.1-0.20221203221941-490d98afd1d6
|
||||
github.com/argoproj/pkg v0.13.7-0.20221115212233-27bd8ce31415
|
||||
github.com/aws/aws-sdk-go v1.44.156
|
||||
|
||||
4
go.sum
4
go.sum
@@ -137,8 +137,8 @@ github.com/antonmedv/expr v1.9.0/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmH
|
||||
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/appscode/go v0.0.0-20191119085241-0887d8ec2ecc/go.mod h1:OawnOmAL4ZX3YaPdN+8HTNwBveT1jMsqP74moa9XUbE=
|
||||
github.com/argoproj/gitops-engine v0.7.1-0.20221108210551-e284fd71cb96 h1:4CQn3gY9aAsQwHWGnADGyfGfBjE+yEw4zoy5SN7uuZc=
|
||||
github.com/argoproj/gitops-engine v0.7.1-0.20221108210551-e284fd71cb96/go.mod h1:WpA/B7tgwfz+sdNE3LqrTrb7ArEY1FOPI2pAGI0hfPc=
|
||||
github.com/argoproj/gitops-engine v0.7.1-0.20221208230615-917f5a0f16d5 h1:iRpHi7X3q9G55KTaMjxKicgNnS2blFHaEfOOgsmP8lE=
|
||||
github.com/argoproj/gitops-engine v0.7.1-0.20221208230615-917f5a0f16d5/go.mod h1:WpA/B7tgwfz+sdNE3LqrTrb7ArEY1FOPI2pAGI0hfPc=
|
||||
github.com/argoproj/notifications-engine v0.3.1-0.20221203221941-490d98afd1d6 h1:b92Xft7MQv/SP56FW08zt5CMTE1rySH8UPDKOAgSzOM=
|
||||
github.com/argoproj/notifications-engine v0.3.1-0.20221203221941-490d98afd1d6/go.mod h1:pgPU59KCsBOMhyw9amRWPoSuBmUWvx3Xsc5r0mUriLg=
|
||||
github.com/argoproj/pkg v0.13.7-0.20221115212233-27bd8ce31415 h1:/5UtDHntvwPxbe/j2+xmQgvG83PQueGHko+9sf8+FA0=
|
||||
|
||||
@@ -86,6 +86,12 @@ spec:
|
||||
key: applicationsetcontroller.enable.git.submodule
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
- name: ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_PROGRESSIVE_ROLLOUTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: applicationsetcontroller.enable.progressive.rollouts
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
volumeMounts:
|
||||
- mountPath: /app/config/ssh
|
||||
name: ssh-known-hosts
|
||||
|
||||
@@ -5,7 +5,7 @@ kind: Kustomization
|
||||
images:
|
||||
- name: quay.io/argoproj/argocd
|
||||
newName: quay.io/argoproj/argocd
|
||||
newTag: latest
|
||||
newTag: v2.6.0-rc3
|
||||
resources:
|
||||
- ./application-controller
|
||||
- ./dex
|
||||
|
||||
@@ -23,7 +23,7 @@ spec:
|
||||
serviceAccountName: argocd-redis
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- "--save"
|
||||
|
||||
@@ -5476,7 +5476,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
@@ -7367,7 +7366,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
@@ -10916,7 +10914,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
@@ -15551,7 +15548,13 @@ spec:
|
||||
key: applicationsetcontroller.enable.git.submodule
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
- name: ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_PROGRESSIVE_ROLLOUTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: applicationsetcontroller.enable.progressive.rollouts
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: argocd-applicationset-controller
|
||||
ports:
|
||||
@@ -15633,7 +15636,7 @@ spec:
|
||||
- ""
|
||||
- --appendonly
|
||||
- "no"
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: Always
|
||||
name: redis
|
||||
ports:
|
||||
@@ -15815,7 +15818,7 @@ spec:
|
||||
value: /helm-working-dir
|
||||
- name: HELM_DATA_HOME
|
||||
value: /helm-working-dir
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
@@ -15867,7 +15870,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /var/run/argocd/argocd-cmp-server
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
name: copyutil
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
@@ -16074,7 +16077,7 @@ spec:
|
||||
key: application.namespaces
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: argocd-application-controller
|
||||
ports:
|
||||
|
||||
@@ -12,4 +12,4 @@ resources:
|
||||
images:
|
||||
- name: quay.io/argoproj/argocd
|
||||
newName: quay.io/argoproj/argocd
|
||||
newTag: latest
|
||||
newTag: v2.6.0-rc3
|
||||
|
||||
@@ -1462,7 +1462,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
@@ -3353,7 +3352,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
@@ -6902,7 +6900,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
|
||||
@@ -11,7 +11,7 @@ patchesStrategicMerge:
|
||||
images:
|
||||
- name: quay.io/argoproj/argocd
|
||||
newName: quay.io/argoproj/argocd
|
||||
newTag: latest
|
||||
newTag: v2.6.0-rc3
|
||||
resources:
|
||||
- ../../base/application-controller
|
||||
- ../../base/applicationset-controller
|
||||
|
||||
@@ -41,6 +41,7 @@ data:
|
||||
port 6379
|
||||
rename-command FLUSHDB ""
|
||||
rename-command FLUSHALL ""
|
||||
bind 0.0.0.0
|
||||
maxmemory 0
|
||||
maxmemory-policy volatile-lru
|
||||
min-replicas-max-lag 5
|
||||
@@ -53,6 +54,7 @@ data:
|
||||
sentinel.conf: |
|
||||
dir "/data"
|
||||
port 26379
|
||||
bind 0.0.0.0
|
||||
sentinel down-after-milliseconds argocd 10000
|
||||
sentinel failover-timeout argocd 180000
|
||||
maxclients 10000
|
||||
@@ -618,7 +620,7 @@ data:
|
||||
timeout check 2s
|
||||
|
||||
listen health_check_http_url
|
||||
bind [::]:8888 v4v6
|
||||
bind :8888
|
||||
mode http
|
||||
monitor-uri /healthz
|
||||
option dontlognull
|
||||
@@ -665,7 +667,7 @@ data:
|
||||
# decide redis backend to use
|
||||
#master
|
||||
frontend ft_redis_master
|
||||
bind [::]:6379 v4v6
|
||||
bind :6379
|
||||
use_backend bk_redis_master
|
||||
# Check all redis servers to see if they think they are master
|
||||
backend bk_redis_master
|
||||
@@ -1045,7 +1047,7 @@ spec:
|
||||
release: argocd
|
||||
revision: "1"
|
||||
annotations:
|
||||
checksum/config: 1f7a9ffcacb3871ceb9b0741c0714e3f7fa656d426a398c1f727fffb01073f35
|
||||
checksum/config: 718bbb277da8610063a7c0fd810984577c2e8ab215815a71211dfa6e20f67321
|
||||
spec:
|
||||
# Needed when using unmodified rbac-setup.yml
|
||||
|
||||
@@ -1153,7 +1155,7 @@ spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/init-config: 84ccf6a9b8a7fa3ae5b62a8f17d6c65a5197e9605da9b2761179bf942828eefe
|
||||
checksum/init-config: 69130412bda04eacad3530cb7bcf26cf121401e725e15d0959dd71a7380afe75
|
||||
labels:
|
||||
release: argocd
|
||||
app: redis-ha
|
||||
@@ -1177,7 +1179,7 @@ spec:
|
||||
automountServiceAccountToken: false
|
||||
initContainers:
|
||||
- name: config-init
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
resources:
|
||||
{}
|
||||
@@ -1204,7 +1206,7 @@ spec:
|
||||
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- redis-server
|
||||
@@ -1254,7 +1256,7 @@ spec:
|
||||
- /bin/sh
|
||||
- /readonly-config/trigger-failover-if-master.sh
|
||||
- name: sentinel
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- redis-sentinel
|
||||
@@ -1298,7 +1300,7 @@ spec:
|
||||
{}
|
||||
|
||||
- name: split-brain-fix
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- sh
|
||||
|
||||
@@ -5,8 +5,11 @@ redis-ha:
|
||||
masterGroupName: argocd
|
||||
config:
|
||||
save: "\"\""
|
||||
bind: "0.0.0.0"
|
||||
haproxy:
|
||||
enabled: true
|
||||
IPv6:
|
||||
enabled: false
|
||||
image:
|
||||
tag: 2.6.2-alpine
|
||||
containerSecurityContext: null
|
||||
@@ -15,5 +18,7 @@ redis-ha:
|
||||
client: 6m
|
||||
checkInterval: 3s
|
||||
image:
|
||||
tag: 7.0.5-alpine
|
||||
tag: 7.0.7-alpine
|
||||
containerSecurityContext: null
|
||||
sentinel:
|
||||
bind: "0.0.0.0"
|
||||
|
||||
@@ -5476,7 +5476,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
@@ -7367,7 +7366,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
@@ -10916,7 +10914,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
@@ -15943,81 +15940,38 @@ data:
|
||||
fi
|
||||
fi
|
||||
done
|
||||
haproxy.cfg: |
|
||||
defaults REDIS
|
||||
mode tcp
|
||||
timeout connect 4s
|
||||
timeout server 6m
|
||||
timeout client 6m
|
||||
timeout check 2s
|
||||
|
||||
listen health_check_http_url
|
||||
bind [::]:8888 v4v6
|
||||
mode http
|
||||
monitor-uri /healthz
|
||||
option dontlognull
|
||||
# Check Sentinel and whether they are nominated master
|
||||
backend check_if_redis_is_master_0
|
||||
mode tcp
|
||||
option tcp-check
|
||||
tcp-check connect
|
||||
tcp-check send PING\r\n
|
||||
tcp-check expect string +PONG
|
||||
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
|
||||
tcp-check expect string REPLACE_ANNOUNCE0
|
||||
tcp-check send QUIT\r\n
|
||||
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
|
||||
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
|
||||
server R2 argocd-redis-ha-announce-2:26379 check inter 3s
|
||||
# Check Sentinel and whether they are nominated master
|
||||
backend check_if_redis_is_master_1
|
||||
mode tcp
|
||||
option tcp-check
|
||||
tcp-check connect
|
||||
tcp-check send PING\r\n
|
||||
tcp-check expect string +PONG
|
||||
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
|
||||
tcp-check expect string REPLACE_ANNOUNCE1
|
||||
tcp-check send QUIT\r\n
|
||||
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
|
||||
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
|
||||
server R2 argocd-redis-ha-announce-2:26379 check inter 3s
|
||||
# Check Sentinel and whether they are nominated master
|
||||
backend check_if_redis_is_master_2
|
||||
mode tcp
|
||||
option tcp-check
|
||||
tcp-check connect
|
||||
tcp-check send PING\r\n
|
||||
tcp-check expect string +PONG
|
||||
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
|
||||
tcp-check expect string REPLACE_ANNOUNCE2
|
||||
tcp-check send QUIT\r\n
|
||||
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
|
||||
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
|
||||
server R2 argocd-redis-ha-announce-2:26379 check inter 3s
|
||||
|
||||
# decide redis backend to use
|
||||
#master
|
||||
frontend ft_redis_master
|
||||
bind [::]:6379 v4v6
|
||||
use_backend bk_redis_master
|
||||
# Check all redis servers to see if they think they are master
|
||||
backend bk_redis_master
|
||||
mode tcp
|
||||
option tcp-check
|
||||
tcp-check connect
|
||||
tcp-check send PING\r\n
|
||||
tcp-check expect string +PONG
|
||||
tcp-check send info\ replication\r\n
|
||||
tcp-check expect string role:master
|
||||
tcp-check send QUIT\r\n
|
||||
tcp-check expect string +OK
|
||||
use-server R0 if { srv_is_up(R0) } { nbsrv(check_if_redis_is_master_0) ge 2 }
|
||||
server R0 argocd-redis-ha-announce-0:6379 check inter 3s fall 1 rise 1
|
||||
use-server R1 if { srv_is_up(R1) } { nbsrv(check_if_redis_is_master_1) ge 2 }
|
||||
server R1 argocd-redis-ha-announce-1:6379 check inter 3s fall 1 rise 1
|
||||
use-server R2 if { srv_is_up(R2) } { nbsrv(check_if_redis_is_master_2) ge 2 }
|
||||
server R2 argocd-redis-ha-announce-2:6379 check inter 3s fall 1 rise 1
|
||||
haproxy.cfg: "defaults REDIS\n mode tcp\n timeout connect 4s\n timeout server
|
||||
6m\n timeout client 6m\n timeout check 2s\n\nlisten health_check_http_url\n
|
||||
\ bind :8888 \n mode http\n monitor-uri /healthz\n option dontlognull\n#
|
||||
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_0\n
|
||||
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
|
||||
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
|
||||
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE0\n tcp-check send QUIT\\r\\n\n
|
||||
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
|
||||
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n#
|
||||
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_1\n
|
||||
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
|
||||
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
|
||||
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE1\n tcp-check send QUIT\\r\\n\n
|
||||
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
|
||||
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n#
|
||||
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_2\n
|
||||
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
|
||||
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
|
||||
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE2\n tcp-check send QUIT\\r\\n\n
|
||||
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
|
||||
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n\n#
|
||||
decide redis backend to use\n#master\nfrontend ft_redis_master\n bind :6379 \n
|
||||
\ use_backend bk_redis_master\n# Check all redis servers to see if they think
|
||||
they are master\nbackend bk_redis_master\n mode tcp\n option tcp-check\n tcp-check
|
||||
connect\n tcp-check send PING\\r\\n\n tcp-check expect string +PONG\n tcp-check
|
||||
send info\\ replication\\r\\n\n tcp-check expect string role:master\n tcp-check
|
||||
send QUIT\\r\\n\n tcp-check expect string +OK\n use-server R0 if { srv_is_up(R0)
|
||||
} { nbsrv(check_if_redis_is_master_0) ge 2 }\n server R0 argocd-redis-ha-announce-0:6379
|
||||
check inter 3s fall 1 rise 1\n use-server R1 if { srv_is_up(R1) } { nbsrv(check_if_redis_is_master_1)
|
||||
ge 2 }\n server R1 argocd-redis-ha-announce-1:6379 check inter 3s fall 1 rise
|
||||
1\n use-server R2 if { srv_is_up(R2) } { nbsrv(check_if_redis_is_master_2) ge
|
||||
2 }\n server R2 argocd-redis-ha-announce-2:6379 check inter 3s fall 1 rise 1\n"
|
||||
haproxy_init.sh: |
|
||||
HAPROXY_CONF=/data/haproxy.cfg
|
||||
cp /readonly/haproxy.cfg "$HAPROXY_CONF"
|
||||
@@ -16316,6 +16270,7 @@ data:
|
||||
port 6379
|
||||
rename-command FLUSHDB ""
|
||||
rename-command FLUSHALL ""
|
||||
bind 0.0.0.0
|
||||
maxmemory 0
|
||||
maxmemory-policy volatile-lru
|
||||
min-replicas-max-lag 5
|
||||
@@ -16327,6 +16282,7 @@ data:
|
||||
sentinel.conf: |
|
||||
dir "/data"
|
||||
port 26379
|
||||
bind 0.0.0.0
|
||||
sentinel down-after-milliseconds argocd 10000
|
||||
sentinel failover-timeout argocd 180000
|
||||
maxclients 10000
|
||||
@@ -16793,7 +16749,13 @@ spec:
|
||||
key: applicationsetcontroller.enable.git.submodule
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
- name: ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_PROGRESSIVE_ROLLOUTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: applicationsetcontroller.enable.progressive.rollouts
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: argocd-applicationset-controller
|
||||
ports:
|
||||
@@ -16903,7 +16865,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /shared/argocd-dex
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
securityContext:
|
||||
@@ -16956,7 +16918,7 @@ spec:
|
||||
containers:
|
||||
- command:
|
||||
- argocd-notifications
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
@@ -17014,7 +16976,7 @@ spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/config: 1f7a9ffcacb3871ceb9b0741c0714e3f7fa656d426a398c1f727fffb01073f35
|
||||
checksum/config: 718bbb277da8610063a7c0fd810984577c2e8ab215815a71211dfa6e20f67321
|
||||
labels:
|
||||
app.kubernetes.io/name: argocd-redis-ha-haproxy
|
||||
name: argocd-redis-ha-haproxy
|
||||
@@ -17259,7 +17221,7 @@ spec:
|
||||
value: /helm-working-dir
|
||||
- name: HELM_DATA_HOME
|
||||
value: /helm-working-dir
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
@@ -17311,7 +17273,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /var/run/argocd/argocd-cmp-server
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
name: copyutil
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
@@ -17590,7 +17552,7 @@ spec:
|
||||
key: server.enable.proxy.extension
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -17826,7 +17788,7 @@ spec:
|
||||
key: application.namespaces
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: argocd-application-controller
|
||||
ports:
|
||||
@@ -17886,7 +17848,7 @@ spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/init-config: 84ccf6a9b8a7fa3ae5b62a8f17d6c65a5197e9605da9b2761179bf942828eefe
|
||||
checksum/init-config: 69130412bda04eacad3530cb7bcf26cf121401e725e15d0959dd71a7380afe75
|
||||
labels:
|
||||
app.kubernetes.io/name: argocd-redis-ha
|
||||
spec:
|
||||
@@ -17903,7 +17865,7 @@ spec:
|
||||
- /data/conf/redis.conf
|
||||
command:
|
||||
- redis-server
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
lifecycle:
|
||||
preStop:
|
||||
@@ -17956,7 +17918,7 @@ spec:
|
||||
- /data/conf/sentinel.conf
|
||||
command:
|
||||
- redis-sentinel
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
lifecycle: {}
|
||||
livenessProbe:
|
||||
@@ -18008,7 +17970,7 @@ spec:
|
||||
value: 40000915ab58c3fa8fd888fb8b24711944e6cbb4
|
||||
- name: SENTINEL_ID_2
|
||||
value: 2bbec7894d954a8af3bb54d13eaec53cb024e2ca
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: split-brain-fix
|
||||
resources: {}
|
||||
@@ -18037,7 +17999,7 @@ spec:
|
||||
value: 40000915ab58c3fa8fd888fb8b24711944e6cbb4
|
||||
- name: SENTINEL_ID_2
|
||||
value: 2bbec7894d954a8af3bb54d13eaec53cb024e2ca
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: config-init
|
||||
securityContext:
|
||||
|
||||
@@ -747,81 +747,38 @@ data:
|
||||
fi
|
||||
fi
|
||||
done
|
||||
haproxy.cfg: |
|
||||
defaults REDIS
|
||||
mode tcp
|
||||
timeout connect 4s
|
||||
timeout server 6m
|
||||
timeout client 6m
|
||||
timeout check 2s
|
||||
|
||||
listen health_check_http_url
|
||||
bind [::]:8888 v4v6
|
||||
mode http
|
||||
monitor-uri /healthz
|
||||
option dontlognull
|
||||
# Check Sentinel and whether they are nominated master
|
||||
backend check_if_redis_is_master_0
|
||||
mode tcp
|
||||
option tcp-check
|
||||
tcp-check connect
|
||||
tcp-check send PING\r\n
|
||||
tcp-check expect string +PONG
|
||||
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
|
||||
tcp-check expect string REPLACE_ANNOUNCE0
|
||||
tcp-check send QUIT\r\n
|
||||
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
|
||||
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
|
||||
server R2 argocd-redis-ha-announce-2:26379 check inter 3s
|
||||
# Check Sentinel and whether they are nominated master
|
||||
backend check_if_redis_is_master_1
|
||||
mode tcp
|
||||
option tcp-check
|
||||
tcp-check connect
|
||||
tcp-check send PING\r\n
|
||||
tcp-check expect string +PONG
|
||||
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
|
||||
tcp-check expect string REPLACE_ANNOUNCE1
|
||||
tcp-check send QUIT\r\n
|
||||
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
|
||||
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
|
||||
server R2 argocd-redis-ha-announce-2:26379 check inter 3s
|
||||
# Check Sentinel and whether they are nominated master
|
||||
backend check_if_redis_is_master_2
|
||||
mode tcp
|
||||
option tcp-check
|
||||
tcp-check connect
|
||||
tcp-check send PING\r\n
|
||||
tcp-check expect string +PONG
|
||||
tcp-check send SENTINEL\ get-master-addr-by-name\ argocd\r\n
|
||||
tcp-check expect string REPLACE_ANNOUNCE2
|
||||
tcp-check send QUIT\r\n
|
||||
server R0 argocd-redis-ha-announce-0:26379 check inter 3s
|
||||
server R1 argocd-redis-ha-announce-1:26379 check inter 3s
|
||||
server R2 argocd-redis-ha-announce-2:26379 check inter 3s
|
||||
|
||||
# decide redis backend to use
|
||||
#master
|
||||
frontend ft_redis_master
|
||||
bind [::]:6379 v4v6
|
||||
use_backend bk_redis_master
|
||||
# Check all redis servers to see if they think they are master
|
||||
backend bk_redis_master
|
||||
mode tcp
|
||||
option tcp-check
|
||||
tcp-check connect
|
||||
tcp-check send PING\r\n
|
||||
tcp-check expect string +PONG
|
||||
tcp-check send info\ replication\r\n
|
||||
tcp-check expect string role:master
|
||||
tcp-check send QUIT\r\n
|
||||
tcp-check expect string +OK
|
||||
use-server R0 if { srv_is_up(R0) } { nbsrv(check_if_redis_is_master_0) ge 2 }
|
||||
server R0 argocd-redis-ha-announce-0:6379 check inter 3s fall 1 rise 1
|
||||
use-server R1 if { srv_is_up(R1) } { nbsrv(check_if_redis_is_master_1) ge 2 }
|
||||
server R1 argocd-redis-ha-announce-1:6379 check inter 3s fall 1 rise 1
|
||||
use-server R2 if { srv_is_up(R2) } { nbsrv(check_if_redis_is_master_2) ge 2 }
|
||||
server R2 argocd-redis-ha-announce-2:6379 check inter 3s fall 1 rise 1
|
||||
haproxy.cfg: "defaults REDIS\n mode tcp\n timeout connect 4s\n timeout server
|
||||
6m\n timeout client 6m\n timeout check 2s\n\nlisten health_check_http_url\n
|
||||
\ bind :8888 \n mode http\n monitor-uri /healthz\n option dontlognull\n#
|
||||
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_0\n
|
||||
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
|
||||
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
|
||||
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE0\n tcp-check send QUIT\\r\\n\n
|
||||
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
|
||||
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n#
|
||||
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_1\n
|
||||
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
|
||||
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
|
||||
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE1\n tcp-check send QUIT\\r\\n\n
|
||||
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
|
||||
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n#
|
||||
Check Sentinel and whether they are nominated master\nbackend check_if_redis_is_master_2\n
|
||||
\ mode tcp\n option tcp-check\n tcp-check connect\n tcp-check send PING\\r\\n\n
|
||||
\ tcp-check expect string +PONG\n tcp-check send SENTINEL\\ get-master-addr-by-name\\
|
||||
argocd\\r\\n\n tcp-check expect string REPLACE_ANNOUNCE2\n tcp-check send QUIT\\r\\n\n
|
||||
\ server R0 argocd-redis-ha-announce-0:26379 check inter 3s\n server R1 argocd-redis-ha-announce-1:26379
|
||||
check inter 3s\n server R2 argocd-redis-ha-announce-2:26379 check inter 3s\n\n#
|
||||
decide redis backend to use\n#master\nfrontend ft_redis_master\n bind :6379 \n
|
||||
\ use_backend bk_redis_master\n# Check all redis servers to see if they think
|
||||
they are master\nbackend bk_redis_master\n mode tcp\n option tcp-check\n tcp-check
|
||||
connect\n tcp-check send PING\\r\\n\n tcp-check expect string +PONG\n tcp-check
|
||||
send info\\ replication\\r\\n\n tcp-check expect string role:master\n tcp-check
|
||||
send QUIT\\r\\n\n tcp-check expect string +OK\n use-server R0 if { srv_is_up(R0)
|
||||
} { nbsrv(check_if_redis_is_master_0) ge 2 }\n server R0 argocd-redis-ha-announce-0:6379
|
||||
check inter 3s fall 1 rise 1\n use-server R1 if { srv_is_up(R1) } { nbsrv(check_if_redis_is_master_1)
|
||||
ge 2 }\n server R1 argocd-redis-ha-announce-1:6379 check inter 3s fall 1 rise
|
||||
1\n use-server R2 if { srv_is_up(R2) } { nbsrv(check_if_redis_is_master_2) ge
|
||||
2 }\n server R2 argocd-redis-ha-announce-2:6379 check inter 3s fall 1 rise 1\n"
|
||||
haproxy_init.sh: |
|
||||
HAPROXY_CONF=/data/haproxy.cfg
|
||||
cp /readonly/haproxy.cfg "$HAPROXY_CONF"
|
||||
@@ -1120,6 +1077,7 @@ data:
|
||||
port 6379
|
||||
rename-command FLUSHDB ""
|
||||
rename-command FLUSHALL ""
|
||||
bind 0.0.0.0
|
||||
maxmemory 0
|
||||
maxmemory-policy volatile-lru
|
||||
min-replicas-max-lag 5
|
||||
@@ -1131,6 +1089,7 @@ data:
|
||||
sentinel.conf: |
|
||||
dir "/data"
|
||||
port 26379
|
||||
bind 0.0.0.0
|
||||
sentinel down-after-milliseconds argocd 10000
|
||||
sentinel failover-timeout argocd 180000
|
||||
maxclients 10000
|
||||
@@ -1597,7 +1556,13 @@ spec:
|
||||
key: applicationsetcontroller.enable.git.submodule
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
- name: ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_PROGRESSIVE_ROLLOUTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: applicationsetcontroller.enable.progressive.rollouts
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: argocd-applicationset-controller
|
||||
ports:
|
||||
@@ -1707,7 +1672,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /shared/argocd-dex
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
securityContext:
|
||||
@@ -1760,7 +1725,7 @@ spec:
|
||||
containers:
|
||||
- command:
|
||||
- argocd-notifications
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
@@ -1818,7 +1783,7 @@ spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/config: 1f7a9ffcacb3871ceb9b0741c0714e3f7fa656d426a398c1f727fffb01073f35
|
||||
checksum/config: 718bbb277da8610063a7c0fd810984577c2e8ab215815a71211dfa6e20f67321
|
||||
labels:
|
||||
app.kubernetes.io/name: argocd-redis-ha-haproxy
|
||||
name: argocd-redis-ha-haproxy
|
||||
@@ -2063,7 +2028,7 @@ spec:
|
||||
value: /helm-working-dir
|
||||
- name: HELM_DATA_HOME
|
||||
value: /helm-working-dir
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
@@ -2115,7 +2080,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /var/run/argocd/argocd-cmp-server
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
name: copyutil
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
@@ -2394,7 +2359,7 @@ spec:
|
||||
key: server.enable.proxy.extension
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -2630,7 +2595,7 @@ spec:
|
||||
key: application.namespaces
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: argocd-application-controller
|
||||
ports:
|
||||
@@ -2690,7 +2655,7 @@ spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/init-config: 84ccf6a9b8a7fa3ae5b62a8f17d6c65a5197e9605da9b2761179bf942828eefe
|
||||
checksum/init-config: 69130412bda04eacad3530cb7bcf26cf121401e725e15d0959dd71a7380afe75
|
||||
labels:
|
||||
app.kubernetes.io/name: argocd-redis-ha
|
||||
spec:
|
||||
@@ -2707,7 +2672,7 @@ spec:
|
||||
- /data/conf/redis.conf
|
||||
command:
|
||||
- redis-server
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
lifecycle:
|
||||
preStop:
|
||||
@@ -2760,7 +2725,7 @@ spec:
|
||||
- /data/conf/sentinel.conf
|
||||
command:
|
||||
- redis-sentinel
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
lifecycle: {}
|
||||
livenessProbe:
|
||||
@@ -2812,7 +2777,7 @@ spec:
|
||||
value: 40000915ab58c3fa8fd888fb8b24711944e6cbb4
|
||||
- name: SENTINEL_ID_2
|
||||
value: 2bbec7894d954a8af3bb54d13eaec53cb024e2ca
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: split-brain-fix
|
||||
resources: {}
|
||||
@@ -2841,7 +2806,7 @@ spec:
|
||||
value: 40000915ab58c3fa8fd888fb8b24711944e6cbb4
|
||||
- name: SENTINEL_ID_2
|
||||
value: 2bbec7894d954a8af3bb54d13eaec53cb024e2ca
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: config-init
|
||||
securityContext:
|
||||
|
||||
@@ -5476,7 +5476,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
@@ -7367,7 +7366,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
@@ -10916,7 +10914,6 @@ spec:
|
||||
- spec
|
||||
type: object
|
||||
required:
|
||||
- pathParamPrefix
|
||||
- repoURL
|
||||
- revision
|
||||
type: object
|
||||
@@ -15871,7 +15868,13 @@ spec:
|
||||
key: applicationsetcontroller.enable.git.submodule
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
- name: ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_PROGRESSIVE_ROLLOUTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: applicationsetcontroller.enable.progressive.rollouts
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: argocd-applicationset-controller
|
||||
ports:
|
||||
@@ -15981,7 +15984,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /shared/argocd-dex
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
securityContext:
|
||||
@@ -16034,7 +16037,7 @@ spec:
|
||||
containers:
|
||||
- command:
|
||||
- argocd-notifications
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
@@ -16111,7 +16114,7 @@ spec:
|
||||
- ""
|
||||
- --appendonly
|
||||
- "no"
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: Always
|
||||
name: redis
|
||||
ports:
|
||||
@@ -16293,7 +16296,7 @@ spec:
|
||||
value: /helm-working-dir
|
||||
- name: HELM_DATA_HOME
|
||||
value: /helm-working-dir
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
@@ -16345,7 +16348,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /var/run/argocd/argocd-cmp-server
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
name: copyutil
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
@@ -16620,7 +16623,7 @@ spec:
|
||||
key: server.enable.proxy.extension
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -16854,7 +16857,7 @@ spec:
|
||||
key: application.namespaces
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: argocd-application-controller
|
||||
ports:
|
||||
|
||||
@@ -675,7 +675,13 @@ spec:
|
||||
key: applicationsetcontroller.enable.git.submodule
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
- name: ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_PROGRESSIVE_ROLLOUTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: applicationsetcontroller.enable.progressive.rollouts
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: argocd-applicationset-controller
|
||||
ports:
|
||||
@@ -785,7 +791,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /shared/argocd-dex
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
securityContext:
|
||||
@@ -838,7 +844,7 @@ spec:
|
||||
containers:
|
||||
- command:
|
||||
- argocd-notifications
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
@@ -915,7 +921,7 @@ spec:
|
||||
- ""
|
||||
- --appendonly
|
||||
- "no"
|
||||
image: redis:7.0.5-alpine
|
||||
image: redis:7.0.7-alpine
|
||||
imagePullPolicy: Always
|
||||
name: redis
|
||||
ports:
|
||||
@@ -1097,7 +1103,7 @@ spec:
|
||||
value: /helm-working-dir
|
||||
- name: HELM_DATA_HOME
|
||||
value: /helm-working-dir
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
@@ -1149,7 +1155,7 @@ spec:
|
||||
- -n
|
||||
- /usr/local/bin/argocd
|
||||
- /var/run/argocd/argocd-cmp-server
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
name: copyutil
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
@@ -1424,7 +1430,7 @@ spec:
|
||||
key: server.enable.proxy.extension
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
@@ -1658,7 +1664,7 @@ spec:
|
||||
key: application.namespaces
|
||||
name: argocd-cmd-params-cm
|
||||
optional: true
|
||||
image: quay.io/argoproj/argocd:latest
|
||||
image: quay.io/argoproj/argocd:v2.6.0-rc3
|
||||
imagePullPolicy: Always
|
||||
name: argocd-application-controller
|
||||
ports:
|
||||
|
||||
@@ -50,6 +50,8 @@ nav:
|
||||
- operator-manual/custom-styles.md
|
||||
- operator-manual/metrics.md
|
||||
- operator-manual/web_based_terminal.md
|
||||
- operator-manual/config-management-plugins.md
|
||||
- operator-manual/deep_links.md
|
||||
- Notification:
|
||||
- Overview: operator-manual/notifications/index.md
|
||||
- operator-manual/notifications/triggers.md
|
||||
@@ -132,7 +134,6 @@ nav:
|
||||
- user-guide/import.md
|
||||
- user-guide/jsonnet.md
|
||||
- user-guide/directory.md
|
||||
- user-guide/config-management-plugins.md
|
||||
- user-guide/tool_detection.md
|
||||
- user-guide/projects.md
|
||||
- user-guide/private-repositories.md
|
||||
|
||||
@@ -47,6 +47,11 @@ type ApplicationSet struct {
|
||||
Status ApplicationSetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
|
||||
}
|
||||
|
||||
// RBACName formats fully qualified application name for RBAC check.
|
||||
func (a *ApplicationSet) RBACName() string {
|
||||
return fmt.Sprintf("%s/%s", a.Spec.Template.Spec.GetProject(), a.ObjectMeta.Name)
|
||||
}
|
||||
|
||||
// ApplicationSetSpec represents a class of application set state.
|
||||
type ApplicationSetSpec struct {
|
||||
GoTemplate bool `json:"goTemplate,omitempty" protobuf:"bytes,1,name=goTemplate"`
|
||||
@@ -308,7 +313,7 @@ type GitGenerator struct {
|
||||
Revision string `json:"revision" protobuf:"bytes,4,name=revision"`
|
||||
RequeueAfterSeconds *int64 `json:"requeueAfterSeconds,omitempty" protobuf:"bytes,5,name=requeueAfterSeconds"`
|
||||
Template ApplicationSetTemplate `json:"template,omitempty" protobuf:"bytes,6,name=template"`
|
||||
PathParamPrefix string `json:"pathParamPrefix" protobuf:"bytes,7,name=pathParamPrefix"`
|
||||
PathParamPrefix string `json:"pathParamPrefix,omitempty" protobuf:"bytes,7,name=pathParamPrefix"`
|
||||
}
|
||||
|
||||
type GitDirectoryGeneratorItem struct {
|
||||
|
||||
@@ -3066,13 +3066,12 @@ func schema_pkg_apis_application_v1alpha1_GitGenerator(ref common.ReferenceCallb
|
||||
},
|
||||
"pathParamPrefix": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"repoURL", "revision", "pathParamPrefix"},
|
||||
Required: []string{"repoURL", "revision"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
|
||||
@@ -35,6 +35,7 @@ import (
|
||||
|
||||
"github.com/argoproj/argo-cd/v2/util/collections"
|
||||
"github.com/argoproj/argo-cd/v2/util/helm"
|
||||
"github.com/argoproj/argo-cd/v2/util/security"
|
||||
)
|
||||
|
||||
// Application is a definition of Application resource.
|
||||
@@ -2695,9 +2696,5 @@ func (a *Application) QualifiedName() string {
|
||||
// RBACName returns the full qualified RBAC resource name for the application
|
||||
// in a backwards-compatible way.
|
||||
func (a *Application) RBACName(defaultNS string) string {
|
||||
if defaultNS != "" && a.Namespace != defaultNS && a.Namespace != "" {
|
||||
return fmt.Sprintf("%s/%s/%s", a.Spec.GetProject(), a.Namespace, a.Name)
|
||||
} else {
|
||||
return fmt.Sprintf("%s/%s", a.Spec.GetProject(), a.Name)
|
||||
}
|
||||
return security.AppRBACName(defaultNS, a.Spec.GetProject(), a.Namespace, a.Name)
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ func (s *Service) runRepoOperation(
|
||||
if hasMultipleSources && source.Path == "" && source.Chart == "" {
|
||||
log.WithFields(map[string]interface{}{
|
||||
"source": source,
|
||||
}).Warnf("not generating manifests as path and chart fields are empty")
|
||||
}).Debugf("not generating manifests as path and chart fields are empty")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ import (
|
||||
"github.com/argoproj/argo-cd/v2/util/lua"
|
||||
"github.com/argoproj/argo-cd/v2/util/manifeststream"
|
||||
"github.com/argoproj/argo-cd/v2/util/rbac"
|
||||
"github.com/argoproj/argo-cd/v2/util/security"
|
||||
"github.com/argoproj/argo-cd/v2/util/session"
|
||||
"github.com/argoproj/argo-cd/v2/util/settings"
|
||||
)
|
||||
@@ -210,7 +211,7 @@ func (s *Server) Create(ctx context.Context, q *application.ApplicationCreateReq
|
||||
appNs := s.appNamespaceOrDefault(a.Namespace)
|
||||
|
||||
if !s.isNamespaceEnabled(appNs) {
|
||||
return nil, namespaceNotPermittedError(appNs)
|
||||
return nil, security.NamespaceNotPermittedError(appNs)
|
||||
}
|
||||
|
||||
created, err := s.appclientset.ArgoprojV1alpha1().Applications(appNs).Create(ctx, a, metav1.CreateOptions{})
|
||||
@@ -343,7 +344,7 @@ func (s *Server) GetManifests(ctx context.Context, q *application.ApplicationMan
|
||||
}
|
||||
|
||||
if !s.isNamespaceEnabled(a.Namespace) {
|
||||
return nil, namespaceNotPermittedError(a.Namespace)
|
||||
return nil, security.NamespaceNotPermittedError(a.Namespace)
|
||||
}
|
||||
|
||||
var manifestInfo *apiclient.ManifestResponse
|
||||
@@ -2350,9 +2351,5 @@ func (s *Server) appNamespaceOrDefault(appNs string) string {
|
||||
}
|
||||
|
||||
func (s *Server) isNamespaceEnabled(namespace string) bool {
|
||||
return namespace == s.ns || glob.MatchStringInList(s.enabledNamespaces, namespace, false)
|
||||
}
|
||||
|
||||
func namespaceNotPermittedError(namespace string) error {
|
||||
return fmt.Errorf("namespace '%s' is not permitted", namespace)
|
||||
return security.IsNamespaceEnabled(namespace, s.ns, s.enabledNamespaces)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package application
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
@@ -24,6 +23,7 @@ import (
|
||||
"github.com/argoproj/argo-cd/v2/util/argo"
|
||||
"github.com/argoproj/argo-cd/v2/util/db"
|
||||
"github.com/argoproj/argo-cd/v2/util/rbac"
|
||||
"github.com/argoproj/argo-cd/v2/util/security"
|
||||
sessionmgr "github.com/argoproj/argo-cd/v2/util/session"
|
||||
)
|
||||
|
||||
@@ -35,10 +35,11 @@ type terminalHandler struct {
|
||||
appResourceTreeFn func(ctx context.Context, app *appv1.Application) (*appv1.ApplicationTree, error)
|
||||
allowedShells []string
|
||||
namespace string
|
||||
enabledNamespaces []string
|
||||
}
|
||||
|
||||
// NewHandler returns a new terminal handler.
|
||||
func NewHandler(appLister applisters.ApplicationLister, namespace string, db db.ArgoDB, enf *rbac.Enforcer, cache *servercache.Cache,
|
||||
func NewHandler(appLister applisters.ApplicationLister, namespace string, enabledNamespaces []string, db db.ArgoDB, enf *rbac.Enforcer, cache *servercache.Cache,
|
||||
appResourceTree AppResourceTreeFn, allowedShells []string) *terminalHandler {
|
||||
return &terminalHandler{
|
||||
appLister: appLister,
|
||||
@@ -48,6 +49,7 @@ func NewHandler(appLister applisters.ApplicationLister, namespace string, db db.
|
||||
appResourceTreeFn: appResourceTree,
|
||||
allowedShells: allowedShells,
|
||||
namespace: namespace,
|
||||
enabledNamespaces: enabledNamespaces,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +109,8 @@ func (s *terminalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
appNamespace := q.Get("appNamespace")
|
||||
|
||||
if !isValidPodName(podName) {
|
||||
http.Error(w, "Pod name is not valid", http.StatusBadRequest)
|
||||
return
|
||||
@@ -127,11 +131,26 @@ func (s *terminalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "Namespace name is not valid", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if !isValidNamespaceName(appNamespace) {
|
||||
http.Error(w, "App namespace name is not valid", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
ns := appNamespace
|
||||
if ns == "" {
|
||||
ns = s.namespace
|
||||
}
|
||||
|
||||
if !security.IsNamespaceEnabled(ns, s.namespace, s.enabledNamespaces) {
|
||||
http.Error(w, security.NamespaceNotPermittedError(ns).Error(), http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
shell := q.Get("shell") // No need to validate. Will only be used if it's in the allow-list.
|
||||
|
||||
ctx := r.Context()
|
||||
|
||||
appRBACName := fmt.Sprintf("%s/%s", project, app)
|
||||
appRBACName := security.AppRBACName(s.namespace, project, appNamespace, app)
|
||||
if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplications, rbacpolicy.ActionGet, appRBACName); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusUnauthorized)
|
||||
return
|
||||
@@ -143,9 +162,9 @@ func (s *terminalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
fieldLog := log.WithFields(log.Fields{"application": app, "userName": sessionmgr.Username(ctx), "container": container,
|
||||
"podName": podName, "namespace": namespace, "cluster": project})
|
||||
"podName": podName, "namespace": namespace, "project": project, "appNamespace": appNamespace})
|
||||
|
||||
a, err := s.appLister.Applications(s.namespace).Get(app)
|
||||
a, err := s.appLister.Applications(ns).Get(app)
|
||||
if err != nil {
|
||||
if apierr.IsNotFound(err) {
|
||||
http.Error(w, "App not found", http.StatusNotFound)
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
appv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
|
||||
"github.com/argoproj/argo-cd/v2/util/security"
|
||||
)
|
||||
|
||||
func TestPodExists(t *testing.T) {
|
||||
@@ -195,24 +196,24 @@ func TestTerminalHandler_ServeHTTP_empty_params(t *testing.T) {
|
||||
for _, testValue := range testValues {
|
||||
testValueCopy := testValue
|
||||
|
||||
t.Run(testKeyCopy+ " " + testValueCopy, func(t *testing.T) {
|
||||
t.Run(testKeyCopy+" "+testValueCopy, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
handler := terminalHandler{}
|
||||
params := map[string]string{
|
||||
"pod": "valid",
|
||||
"pod": "valid",
|
||||
"container": "valid",
|
||||
"app": "valid",
|
||||
"project": "valid",
|
||||
"app": "valid",
|
||||
"project": "valid",
|
||||
"namespace": "valid",
|
||||
}
|
||||
params[testKeyCopy] = testValueCopy
|
||||
var paramsArray []string
|
||||
for key, value := range params {
|
||||
paramsArray = append(paramsArray, key + "=" + value)
|
||||
paramsArray = append(paramsArray, key+"="+value)
|
||||
}
|
||||
paramsString := strings.Join(paramsArray, "&")
|
||||
request := httptest.NewRequest("GET", "https://argocd.example.com/api/v1/terminal?" + paramsString, nil)
|
||||
request := httptest.NewRequest("GET", "https://argocd.example.com/api/v1/terminal?"+paramsString, nil)
|
||||
recorder := httptest.NewRecorder()
|
||||
handler.ServeHTTP(recorder, request)
|
||||
response := recorder.Result()
|
||||
@@ -221,3 +222,13 @@ func TestTerminalHandler_ServeHTTP_empty_params(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestTerminalHandler_ServeHTTP_disallowed_namespace(t *testing.T) {
|
||||
handler := terminalHandler{namespace: "argocd", enabledNamespaces: []string{"allowed"}}
|
||||
request := httptest.NewRequest("GET", "https://argocd.example.com/api/v1/terminal?pod=valid&container=valid&appName=valid&projectName=valid&namespace=test&appNamespace=disallowed", nil)
|
||||
recorder := httptest.NewRecorder()
|
||||
handler.ServeHTTP(recorder, request)
|
||||
response := recorder.Result()
|
||||
assert.Equal(t, http.StatusForbidden, response.StatusCode)
|
||||
assert.Equal(t, security.NamespaceNotPermittedError("disallowed").Error()+"\n", recorder.Body.String())
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import (
|
||||
applisters "github.com/argoproj/argo-cd/v2/pkg/client/listers/application/v1alpha1"
|
||||
servercache "github.com/argoproj/argo-cd/v2/server/cache"
|
||||
"github.com/argoproj/argo-cd/v2/server/rbacpolicy"
|
||||
apputil "github.com/argoproj/argo-cd/v2/util/appset"
|
||||
"github.com/argoproj/argo-cd/v2/util/argo"
|
||||
argoutil "github.com/argoproj/argo-cd/v2/util/argo"
|
||||
"github.com/argoproj/argo-cd/v2/util/db"
|
||||
@@ -89,7 +88,7 @@ func (s *Server) Get(ctx context.Context, q *applicationset.ApplicationSetGetQue
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting ApplicationSet: %w", err)
|
||||
}
|
||||
if err = s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionGet, apputil.AppSetRBACName(a)); err != nil {
|
||||
if err = s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionGet, a.RBACName()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -111,7 +110,7 @@ func (s *Server) List(ctx context.Context, q *applicationset.ApplicationSetListQ
|
||||
|
||||
newItems := make([]v1alpha1.ApplicationSet, 0)
|
||||
for _, a := range appsetList.Items {
|
||||
if s.enf.Enforce(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionGet, apputil.AppSetRBACName(&a)) {
|
||||
if s.enf.Enforce(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionGet, a.RBACName()) {
|
||||
newItems = append(newItems, a)
|
||||
}
|
||||
}
|
||||
@@ -182,7 +181,7 @@ func (s *Server) Create(ctx context.Context, q *applicationset.ApplicationSetCre
|
||||
if !q.Upsert {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "existing ApplicationSet spec is different, use upsert flag to force update")
|
||||
}
|
||||
if err = s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionUpdate, apputil.AppSetRBACName(appset)); err != nil {
|
||||
if err = s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionUpdate, appset.RBACName()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
updated, err := s.updateAppSet(existing, appset, ctx, true)
|
||||
@@ -210,11 +209,11 @@ func (s *Server) updateAppSet(appset *v1alpha1.ApplicationSet, newAppset *v1alph
|
||||
if appset != nil && appset.Spec.Template.Spec.Project != newAppset.Spec.Template.Spec.Project {
|
||||
// When changing projects, caller must have applicationset create and update privileges in new project
|
||||
// NOTE: the update check was already verified in the caller to this function
|
||||
if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionCreate, apputil.AppSetRBACName(newAppset)); err != nil {
|
||||
if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionCreate, newAppset.RBACName()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// They also need 'update' privileges in the old project
|
||||
if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionUpdate, apputil.AppSetRBACName(appset)); err != nil {
|
||||
if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionUpdate, appset.RBACName()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
@@ -254,7 +253,7 @@ func (s *Server) Delete(ctx context.Context, q *applicationset.ApplicationSetDel
|
||||
return nil, fmt.Errorf("error getting ApplicationSets: %w", err)
|
||||
}
|
||||
|
||||
if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionDelete, apputil.AppSetRBACName(appset)); err != nil {
|
||||
if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionDelete, appset.RBACName()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -290,7 +289,7 @@ func (s *Server) validateAppSet(ctx context.Context, appset *v1alpha1.Applicatio
|
||||
|
||||
func (s *Server) checkCreatePermissions(ctx context.Context, appset *v1alpha1.ApplicationSet, projectName string) error {
|
||||
|
||||
if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionCreate, apputil.AppSetRBACName(appset)); err != nil {
|
||||
if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplicationSets, rbacpolicy.ActionCreate, appset.RBACName()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -906,7 +906,7 @@ func (a *ArgoCDServer) newHTTPServer(ctx context.Context, port int, grpcWebHandl
|
||||
}
|
||||
mux.Handle("/api/", handler)
|
||||
|
||||
terminalHandler := application.NewHandler(a.appLister, a.Namespace, a.db, a.enf, a.Cache, appResourceTreeFn, a.settings.ExecShells)
|
||||
terminalHandler := application.NewHandler(a.appLister, a.Namespace, a.ApplicationNamespaces, a.db, a.enf, a.Cache, appResourceTreeFn, a.settings.ExecShells)
|
||||
mux.HandleFunc("/terminal", func(writer http.ResponseWriter, request *http.Request) {
|
||||
argocdSettings, err := a.settingsMgr.GetSettings()
|
||||
if err != nil {
|
||||
|
||||
@@ -764,6 +764,17 @@ func TestNamespacedResourceDiffing(t *testing.T) {
|
||||
}).
|
||||
Given().
|
||||
When().
|
||||
// Now we migrate from client-side apply to server-side apply
|
||||
// This is necessary, as starting with kubectl 1.26, all previously
|
||||
// client-side owned fields have ownership migrated to the manager from
|
||||
// the first ssa.
|
||||
// More details: https://github.com/kubernetes/kubectl/issues/1337
|
||||
PatchApp(`[{
|
||||
"op": "add",
|
||||
"path": "/spec/syncPolicy",
|
||||
"value": { "syncOptions": ["ServerSideApply=true"] }
|
||||
}]`).
|
||||
Sync().
|
||||
And(func() {
|
||||
output, err := RunWithStdin(testdata.SSARevisionHistoryDeployment, "", "kubectl", "apply", "-n", DeploymentNamespace(), "--server-side=true", "--field-manager=revision-history-manager", "--validate=false", "--force-conflicts", "-f", "-")
|
||||
assert.NoError(t, err)
|
||||
|
||||
@@ -742,6 +742,17 @@ func TestResourceDiffing(t *testing.T) {
|
||||
}).
|
||||
Given().
|
||||
When().
|
||||
// Now we migrate from client-side apply to server-side apply
|
||||
// This is necessary, as starting with kubectl 1.26, all previously
|
||||
// client-side owned fields have ownership migrated to the manager from
|
||||
// the first ssa.
|
||||
// More details: https://github.com/kubernetes/kubectl/issues/1337
|
||||
PatchApp(`[{
|
||||
"op": "add",
|
||||
"path": "/spec/syncPolicy",
|
||||
"value": { "syncOptions": ["ServerSideApply=true"] }
|
||||
}]`).
|
||||
Sync().
|
||||
And(func() {
|
||||
output, err := RunWithStdin(testdata.SSARevisionHistoryDeployment, "", "kubectl", "apply", "-n", DeploymentNamespace(), "--server-side=true", "--field-manager=revision-history-manager", "--validate=false", "--force-conflicts", "-f", "-")
|
||||
assert.NoError(t, err)
|
||||
|
||||
3
test/e2e/testdata/data.go
vendored
3
test/e2e/testdata/data.go
vendored
@@ -5,4 +5,7 @@ import _ "embed"
|
||||
var (
|
||||
//go:embed ssa-revision-history/deployment.yaml
|
||||
SSARevisionHistoryDeployment string
|
||||
|
||||
//go:embed guestbook/guestbook-ui-deployment.yaml
|
||||
GuestbookDeployment string
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {DropDownMenu, NotificationType, SlidingPanel} from 'argo-ui';
|
||||
import {DropDownMenu, NotificationType, SlidingPanel, Tooltip} from 'argo-ui';
|
||||
import * as classNames from 'classnames';
|
||||
import * as PropTypes from 'prop-types';
|
||||
import * as React from 'react';
|
||||
@@ -24,7 +24,7 @@ import {ResourceDetails} from '../resource-details/resource-details';
|
||||
import * as AppUtils from '../utils';
|
||||
import {ApplicationResourceList} from './application-resource-list';
|
||||
import {Filters, FiltersProps} from './application-resource-filter';
|
||||
import {getAppDefaultSource, urlPattern} from '../utils';
|
||||
import {getAppDefaultSource, urlPattern, helpTip} from '../utils';
|
||||
import {ResourceStatus} from '../../../shared/models';
|
||||
import {ApplicationsDetailsAppDropdown} from './application-details-app-dropdown';
|
||||
import {useSidebarTarget} from '../../../sidebar/sidebar';
|
||||
@@ -613,6 +613,7 @@ export class ApplicationDetails extends React.Component<RouteComponentProps<{app
|
||||
const refreshing = app.metadata.annotations && app.metadata.annotations[appModels.AnnotationRefreshKey];
|
||||
const fullName = AppUtils.nodeKey({group: 'argoproj.io', kind: app.kind, name: app.metadata.name, namespace: app.metadata.namespace});
|
||||
const ActionMenuItem = (prop: {actionLabel: string}) => <span className={needOverlapLabelOnNarrowScreen ? 'show-for-large' : ''}>{prop.actionLabel}</span>;
|
||||
const hasMultipleSources = app.spec.sources && app.spec.sources.length > 0;
|
||||
return [
|
||||
{
|
||||
iconClassName: 'fa fa-info-circle',
|
||||
@@ -638,9 +639,18 @@ export class ApplicationDetails extends React.Component<RouteComponentProps<{app
|
||||
},
|
||||
{
|
||||
iconClassName: 'fa fa-history',
|
||||
title: <ActionMenuItem actionLabel='History and rollback' />,
|
||||
action: () => this.setRollbackPanelVisible(0),
|
||||
disabled: !app.status.operationState
|
||||
title: hasMultipleSources ? (
|
||||
<React.Fragment>
|
||||
<ActionMenuItem actionLabel=' History and rollback' />
|
||||
{helpTip('Rollback is not supported for apps with multiple sources')}
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<ActionMenuItem actionLabel='History and rollback' />
|
||||
),
|
||||
action: () => {
|
||||
this.setRollbackPanelVisible(0);
|
||||
},
|
||||
disabled: !app.status.operationState || hasMultipleSources
|
||||
},
|
||||
{
|
||||
iconClassName: 'fa fa-times-circle',
|
||||
|
||||
@@ -222,8 +222,8 @@ export const ApplicationSummary = (props: ApplicationSummaryProps) => {
|
||||
{
|
||||
title: 'PATH',
|
||||
view: (
|
||||
<Revision repoUrl={source.repoURL} revision={source.targetRevision || 'HEAD'} path={source.path}>
|
||||
{source.path}
|
||||
<Revision repoUrl={source.repoURL} revision={source.targetRevision || 'HEAD'} path={source.path} isForPath={true}>
|
||||
{source.path ?? ''}
|
||||
</Revision>
|
||||
),
|
||||
edit: (formApi: FormApi) => <FormField formApi={formApi} field='spec.source.path' component={Text} />
|
||||
|
||||
@@ -11,6 +11,7 @@ import {Context} from '../../../shared/context';
|
||||
import {ErrorNotification, NotificationType} from 'argo-ui';
|
||||
export interface PodTerminalViewerProps {
|
||||
applicationName: string;
|
||||
applicationNamespace: string;
|
||||
projectName: string;
|
||||
selectedNode: models.ResourceNode;
|
||||
podState: models.State;
|
||||
@@ -24,7 +25,15 @@ export interface ShellFrame {
|
||||
cols?: number;
|
||||
}
|
||||
|
||||
export const PodTerminalViewer: React.FC<PodTerminalViewerProps> = ({selectedNode, applicationName, projectName, podState, containerName, onClickContainer}) => {
|
||||
export const PodTerminalViewer: React.FC<PodTerminalViewerProps> = ({
|
||||
selectedNode,
|
||||
applicationName,
|
||||
applicationNamespace,
|
||||
projectName,
|
||||
podState,
|
||||
containerName,
|
||||
onClickContainer
|
||||
}) => {
|
||||
const terminalRef = React.useRef(null);
|
||||
const appContext = React.useContext(Context); // used to show toast
|
||||
const fitAddon = new FitAddon();
|
||||
@@ -145,7 +154,7 @@ export const PodTerminalViewer: React.FC<PodTerminalViewerProps> = ({selectedNod
|
||||
webSocket = new WebSocket(
|
||||
`${
|
||||
location.protocol === 'https:' ? 'wss' : 'ws'
|
||||
}://${url}/terminal?pod=${name}&container=${containerName}&appName=${applicationName}&projectName=${projectName}&namespace=${namespace}`
|
||||
}://${url}/terminal?pod=${name}&container=${containerName}&appName=${applicationName}&appNamespace=${applicationNamespace}&projectName=${projectName}&namespace=${namespace}`
|
||||
);
|
||||
webSocket.onopen = onConnectionOpen;
|
||||
webSocket.onclose = onConnectionClose;
|
||||
|
||||
@@ -129,6 +129,7 @@ export const ResourceDetails = (props: ResourceDetailsProps) => {
|
||||
content: (
|
||||
<PodTerminalViewer
|
||||
applicationName={application.metadata.name}
|
||||
applicationNamespace={application.metadata.namespace}
|
||||
projectName={application.spec.project}
|
||||
podState={podState}
|
||||
selectedNode={selectedNode}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import * as React from 'react';
|
||||
import {revisionUrl} from './urls';
|
||||
|
||||
export const Revision = ({repoUrl, revision, path, children}: {repoUrl: string; revision: string; path?: string; children?: React.ReactNode}) => {
|
||||
export const Revision = ({repoUrl, revision, path, isForPath, children}: {repoUrl: string; revision: string; path?: string; isForPath?: boolean; children?: React.ReactNode}) => {
|
||||
if (isForPath && !path) {
|
||||
// This source literally has no path, so we won't show one.
|
||||
return <span />;
|
||||
}
|
||||
revision = revision || '';
|
||||
const hasPath = path && path !== '.';
|
||||
let url = revisionUrl(repoUrl, revision, hasPath);
|
||||
|
||||
@@ -26,7 +26,12 @@ export function repoUrl(url: string): string {
|
||||
}
|
||||
|
||||
export function revisionUrl(url: string, revision: string, forPath: boolean): string {
|
||||
const parsed = GitUrlParse(url);
|
||||
let parsed;
|
||||
try {
|
||||
parsed = GitUrlParse(url);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
let urlSubPath = isSHA(revision) ? 'commit' : 'tree';
|
||||
|
||||
if (url.indexOf('bitbucket') >= 0) {
|
||||
|
||||
33
ui/yarn.lock
33
ui/yarn.lock
@@ -3544,10 +3544,10 @@ detect-node@^2.0.4:
|
||||
resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1"
|
||||
integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==
|
||||
|
||||
dezalgo@1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456"
|
||||
integrity sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=
|
||||
dezalgo@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.4.tgz#751235260469084c132157dfa857f386d4c33d81"
|
||||
integrity sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==
|
||||
dependencies:
|
||||
asap "^2.0.0"
|
||||
wrappy "1"
|
||||
@@ -4425,14 +4425,14 @@ form-data@^4.0.0:
|
||||
mime-types "^2.1.12"
|
||||
|
||||
formidable@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/formidable/-/formidable-2.0.1.tgz#4310bc7965d185536f9565184dee74fbb75557ff"
|
||||
integrity sha512-rjTMNbp2BpfQShhFbR3Ruk3qk2y9jKpvMW78nJgx8QKtxjDVrwbZG+wvDOmVbifHyOUOQJXxqEy6r0faRrPzTQ==
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/formidable/-/formidable-2.1.1.tgz#81269cbea1a613240049f5f61a9d97731517414f"
|
||||
integrity sha512-0EcS9wCFEzLvfiks7omJ+SiYJAiD+TzK4Pcw1UlUoGnhUxDcMKjt0P7x8wEb0u6OHu8Nb98WG3nxtlF5C7bvUQ==
|
||||
dependencies:
|
||||
dezalgo "1.0.3"
|
||||
hexoid "1.0.0"
|
||||
once "1.4.0"
|
||||
qs "6.9.3"
|
||||
dezalgo "^1.0.4"
|
||||
hexoid "^1.0.0"
|
||||
once "^1.4.0"
|
||||
qs "^6.11.0"
|
||||
|
||||
forwarded@0.2.0:
|
||||
version "0.2.0"
|
||||
@@ -4702,7 +4702,7 @@ he@^1.2.0:
|
||||
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
|
||||
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
|
||||
|
||||
hexoid@1.0.0:
|
||||
hexoid@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/hexoid/-/hexoid-1.0.0.tgz#ad10c6573fb907de23d9ec63a711267d9dc9bc18"
|
||||
integrity sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==
|
||||
@@ -6671,7 +6671,7 @@ on-headers@~1.0.2:
|
||||
resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f"
|
||||
integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==
|
||||
|
||||
once@1.4.0, once@^1.3.0, once@^1.3.1, once@^1.4.0:
|
||||
once@^1.3.0, once@^1.3.1, once@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
|
||||
@@ -7178,18 +7178,13 @@ punycode@^2.1.0, punycode@^2.1.1:
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
|
||||
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
|
||||
|
||||
qs@6.11.0, qs@^6.10.3:
|
||||
qs@6.11.0, qs@^6.10.3, qs@^6.11.0:
|
||||
version "6.11.0"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a"
|
||||
integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==
|
||||
dependencies:
|
||||
side-channel "^1.0.4"
|
||||
|
||||
qs@6.9.3:
|
||||
version "6.9.3"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.3.tgz#bfadcd296c2d549f1dffa560619132c977f5008e"
|
||||
integrity sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==
|
||||
|
||||
querystring@0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package appset
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
|
||||
)
|
||||
|
||||
// AppRBACName formats fully qualified application name for RBAC check
|
||||
func AppSetRBACName(appSet *v1alpha1.ApplicationSet) string {
|
||||
return fmt.Sprintf("%s/%s", appSet.Spec.Template.Spec.GetProject(), appSet.ObjectMeta.Name)
|
||||
}
|
||||
@@ -348,9 +348,9 @@ func GetRefSources(ctx context.Context, spec argoappv1.ApplicationSpec, db db.Ar
|
||||
refKeys := make(map[string]bool)
|
||||
for _, source := range spec.Sources {
|
||||
if source.Ref != "" {
|
||||
isValidRefKey := regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString
|
||||
isValidRefKey := regexp.MustCompile(`^[a-zA-Z0-9_-]+$`).MatchString
|
||||
if !isValidRefKey(source.Ref) {
|
||||
return nil, fmt.Errorf("source.ref %s cannot contain any special characters except '_' and '-'", source.Ref)
|
||||
return nil, fmt.Errorf("sources.ref %s cannot contain any special characters except '_' and '-'", source.Ref)
|
||||
}
|
||||
refKey := "$" + source.Ref
|
||||
if _, ok := refKeys[refKey]; ok {
|
||||
|
||||
@@ -1043,14 +1043,14 @@ func Test_GetRefSources(t *testing.T) {
|
||||
repoDB.On("GetRepository", context.Background(), repo.Repo).Return(repo, nil)
|
||||
|
||||
argoSpec := getMultiSourceAppSpec(argoappv1.ApplicationSources{
|
||||
{RepoURL: fmt.Sprintf("file://%s", repoPath), Ref: "source1"},
|
||||
{RepoURL: fmt.Sprintf("file://%s", repoPath), Ref: "source-1_2"},
|
||||
{RepoURL: fmt.Sprintf("file://%s", repoPath)},
|
||||
})
|
||||
|
||||
refSources, err := GetRefSources(context.TODO(), *argoSpec, repoDB)
|
||||
|
||||
expectedRefSource := argoappv1.RefTargetRevisionMapping{
|
||||
"$source1": &argoappv1.RefTarget{
|
||||
"$source-1_2": &argoappv1.RefTarget{
|
||||
Repo: *repo,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/casbin/casbin/v2"
|
||||
"github.com/casbin/casbin/v2/model"
|
||||
"github.com/casbin/casbin/v2/util"
|
||||
jwt "github.com/golang-jwt/jwt/v4"
|
||||
"github.com/golang-jwt/jwt/v4"
|
||||
gocache "github.com/patrickmn/go-cache"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc/codes"
|
||||
|
||||
15
util/security/application_namespaces.go
Normal file
15
util/security/application_namespaces.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package security
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/argoproj/argo-cd/v2/util/glob"
|
||||
)
|
||||
|
||||
func IsNamespaceEnabled(namespace string, serverNamespace string, enabledNamespaces []string) bool {
|
||||
return namespace == serverNamespace || glob.MatchStringInList(enabledNamespaces, namespace, false)
|
||||
}
|
||||
|
||||
func NamespaceNotPermittedError(namespace string) error {
|
||||
return fmt.Errorf("namespace '%s' is not permitted", namespace)
|
||||
}
|
||||
62
util/security/application_namespaces_test.go
Normal file
62
util/security/application_namespaces_test.go
Normal file
@@ -0,0 +1,62 @@
|
||||
package security
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_IsNamespaceEnabled(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
namespace string
|
||||
serverNamespace string
|
||||
enabledNamespaces []string
|
||||
expectedResult bool
|
||||
}{
|
||||
{
|
||||
"namespace is empty",
|
||||
"argocd",
|
||||
"argocd",
|
||||
[]string{},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"namespace is explicitly server namespace",
|
||||
"argocd",
|
||||
"argocd",
|
||||
[]string{},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"namespace is allowed namespace",
|
||||
"allowed",
|
||||
"argocd",
|
||||
[]string{"allowed"},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"namespace matches pattern",
|
||||
"test-ns",
|
||||
"argocd",
|
||||
[]string{"test-*"},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"namespace is not allowed namespace",
|
||||
"disallowed",
|
||||
"argocd",
|
||||
[]string{"allowed"},
|
||||
false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tcc := tc
|
||||
t.Run(tcc.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := IsNamespaceEnabled(tcc.namespace, tcc.serverNamespace, tcc.enabledNamespaces)
|
||||
assert.Equal(t, tcc.expectedResult, result)
|
||||
})
|
||||
}
|
||||
}
|
||||
14
util/security/rbac.go
Normal file
14
util/security/rbac.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package security
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// AppRBACName constructs name of the app for use in RBAC checks.
|
||||
func AppRBACName(defaultNS string, project string, namespace string, name string) string {
|
||||
if defaultNS != "" && namespace != defaultNS && namespace != "" {
|
||||
return fmt.Sprintf("%s/%s/%s", project, namespace, name)
|
||||
} else {
|
||||
return fmt.Sprintf("%s/%s", project, name)
|
||||
}
|
||||
}
|
||||
52
util/security/rbac_test.go
Normal file
52
util/security/rbac_test.go
Normal file
@@ -0,0 +1,52 @@
|
||||
package security
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_AppRBACName(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
defaultNS string
|
||||
project string
|
||||
namespace string
|
||||
appName string
|
||||
expectedResult string
|
||||
}{
|
||||
{
|
||||
"namespace is empty",
|
||||
"argocd",
|
||||
"default",
|
||||
"",
|
||||
"app",
|
||||
"default/app",
|
||||
},
|
||||
{
|
||||
"namespace is default namespace",
|
||||
"argocd",
|
||||
"default",
|
||||
"argocd",
|
||||
"app",
|
||||
"default/app",
|
||||
},
|
||||
{
|
||||
"namespace is not default namespace",
|
||||
"argocd",
|
||||
"default",
|
||||
"test",
|
||||
"app",
|
||||
"default/test/app",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tcc := tc
|
||||
t.Run(tcc.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := AppRBACName(tcc.defaultNS, tcc.project, tcc.namespace, tcc.appName)
|
||||
assert.Equal(t, tcc.expectedResult, result)
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user