├── VERSION_22 ├── VERSION_23 ├── VERSION_24 ├── .gitignore ├── VERSION_25 ├── patches-gitops-engine-v0 └── series ├── patches-gitops-engine-v2.0.0 └── series ├── patches-gitops-engine-v2.2.0 └── series ├── VERSION_26 ├── VERSION_27 ├── VERSION_28 ├── VERSION_29 ├── VERSION_210 ├── patch_export.sh ├── try-patch.sh ├── fix-patch.sh ├── patches-argo-cd-v2.2 ├── series ├── 10-add-flux-options-to-the-ui.patch ├── 05-ui-show-kstatus-in-ui.patch ├── 06-show-custom-info.patch ├── 03-allow-flux-and-oci-schemes.patch ├── 01-build-with-local-gitops-engine.patch └── 04-ui-fix-find-leaf-pod-bug.patch ├── patches-argo-cd-v2.3 ├── series ├── 10-add-flux-options-to-the-ui.patch ├── 05-ui-show-kstatus-in-ui.patch ├── 01-build-with-local-gitops-engine.patch ├── 06-show-custom-info.patch ├── 03-allow-flux-and-oci-schemes.patch └── 04-ui-fix-find-leaf-pod-bug.patch ├── patches-argo-cd-v2.4 ├── series ├── 10-add-flux-options-to-the-ui.patch ├── 05-ui-show-kstatus-in-ui.patch ├── 01-build-with-local-gitops-engine.patch ├── 06-show-custom-info.patch ├── 03-allow-flux-and-oci-schemes.patch └── 04-ui-fix-find-leaf-pod-bug.patch ├── patches-argo-cd-v2.5 ├── series ├── 10-add-flux-options-to-the-ui.patch ├── 05-ui-show-kstatus-in-ui.patch ├── 01-build-with-local-gitops-engine.patch ├── 06-show-custom-info.patch ├── 03-allow-flux-and-oci-schemes.patch └── 04-ui-fix-find-leaf-pod-bug.patch ├── init-gitops-engine.sh ├── patches-argo-cd-v2.6 ├── series ├── 10-add-flux-options-to-the-ui.patch ├── 01-build-with-local-gitops-engine.patch ├── 05-ui-show-kstatus-in-ui.patch ├── 06-show-custom-info.patch ├── 03-allow-flux-and-oci-schemes.patch ├── 13-add-open-in-weave-gitops.patch ├── 04-ui-fix-find-leaf-pod-bug.patch └── 15-fix-branch-and-rev-info-of.patch ├── patches-argo-cd-v2.7 ├── series ├── 10-add-flux-options-to-the-ui.patch ├── 01-build-with-local-gitops-engine.patch ├── 05-ui-show-kstatus-in-ui.patch ├── 06-show-custom-info.patch ├── 03-allow-flux-and-oci-schemes.patch ├── 12-add-open-in-weave-gitops.patch ├── 04-ui-fix-find-leaf-pod-bug.patch └── 14-fix-branch-and-rev-info-of.patch ├── init.sh ├── patches-argo-cd-v2.8 ├── series ├── 21-fix-health-message-in.patch ├── 19-fix-special-supported-schemes.patch ├── 10-add-flux-options-to-the-ui.patch ├── 01-build-with-local-gitops-engine.patch ├── 05-ui-show-kstatus-in-ui.patch ├── 06-show-custom-info.patch ├── 03-allow-flux-and-oci-schemes.patch ├── 12-add-open-in-weave-gitops.patch ├── 04-ui-fix-find-leaf-pod-bug.patch ├── 16-override-workload-name-with.patch └── 14-fix-branch-and-rev-info-of.patch ├── README.md ├── patches-argo-cd-v2.10 ├── series ├── 21-fix-health-message-in.patch ├── 22-fix-flux-2.2-oci.patch ├── 19-fix-special-supported-schemes.patch ├── 10-add-flux-options-to-the-ui.patch ├── 01-build-with-local-gitops-engine.patch ├── 05-ui-show-kstatus-in-ui.patch ├── 06-show-custom-info.patch ├── 03-allow-flux-and-oci-schemes.patch ├── 12-add-open-in-weave-gitops.patch ├── 04-ui-fix-find-leaf-pod-bug.patch ├── 16-override-workload-name-with.patch └── 14-fix-branch-and-rev-info-of.patch ├── patches-argo-cd-v2.9 ├── series ├── 21-fix-health-message-in.patch ├── 22-fix-flux-2.2-oci.patch ├── 19-fix-special-supported-schemes.patch ├── 10-add-flux-options-to-the-ui.patch ├── 01-build-with-local-gitops-engine.patch ├── 05-ui-show-kstatus-in-ui.patch ├── 06-show-custom-info.patch ├── 03-allow-flux-and-oci-schemes.patch ├── 12-add-open-in-weave-gitops.patch ├── 04-ui-fix-find-leaf-pod-bug.patch ├── 16-override-workload-name-with.patch └── 14-fix-branch-and-rev-info-of.patch ├── .github └── workflows │ ├── build_v22.yaml │ ├── build_v23.yaml │ ├── build_v24.yaml │ ├── build_v25.yaml │ ├── build_v26.yaml │ ├── build_v27.yaml │ ├── build_v210.yaml │ ├── build_v28.yaml │ └── build_v29.yaml └── Makefile /VERSION_22: -------------------------------------------------------------------------------- 1 | BASE_VERSION=v2.2.16 2 | SUFFIX_VERSION=fl.3 3 | GITOPS_ENGINE_VERSION=v0.5.5 4 | -------------------------------------------------------------------------------- /VERSION_23: -------------------------------------------------------------------------------- 1 | BASE_VERSION=v2.3.17 2 | SUFFIX_VERSION=fl.3 3 | GITOPS_ENGINE_VERSION=v0.6.2 4 | -------------------------------------------------------------------------------- /VERSION_24: -------------------------------------------------------------------------------- 1 | BASE_VERSION=v2.4.28 2 | SUFFIX_VERSION=fl.3 3 | GITOPS_ENGINE_VERSION=v0.7.3 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | argo-cd/ 2 | gitops-engine/ 3 | 4 | VERSION 5 | patches-argo-cd 6 | patches-gitops-engine 7 | -------------------------------------------------------------------------------- /VERSION_25: -------------------------------------------------------------------------------- 1 | BASE_VERSION=v2.5.22 2 | SUFFIX_VERSION=fl.12 3 | GITOPS_ENGINE_VERSION=98ccd3d43fd9f4dbc3f6610b9701fbf56be53ded 4 | # touch -------------------------------------------------------------------------------- /patches-gitops-engine-v0/series: -------------------------------------------------------------------------------- 1 | # This series applies on GIT commit 917f5a0f16d57162a335e8134230e714de4faa05 2 | 01-fsa-add-flux-ks-and-hr.patch 3 | -------------------------------------------------------------------------------- /patches-gitops-engine-v2.0.0/series: -------------------------------------------------------------------------------- 1 | # This series applies on Git commit b0fffe419a0f0a40f9f2c0b6346b752ed6537385 2 | 01-fsa-add-flux-ks-and-hr.patch 3 | -------------------------------------------------------------------------------- /patches-gitops-engine-v2.2.0/series: -------------------------------------------------------------------------------- 1 | # This series applies on Git commit b0fffe419a0f0a40f9f2c0b6346b752ed6537385 2 | 01-fsa-add-flux-ks-and-hr.patch 3 | -------------------------------------------------------------------------------- /VERSION_26: -------------------------------------------------------------------------------- 1 | BASE_VERSION=v2.6.15 2 | SUFFIX_VERSION=fl.$(cat patches-argo-cd/series | cut -d- -f1 | tail -1) 3 | GITOPS_ENGINE_VERSION=b4dd8b8c3976d03f9928a393c2447830a3ef7449 4 | -------------------------------------------------------------------------------- /VERSION_27: -------------------------------------------------------------------------------- 1 | BASE_VERSION=v2.7.17 2 | SUFFIX_VERSION=fl.$(cat patches-argo-cd/series | cut -d- -f1 | tail -1) 3 | GITOPS_ENGINE_VERSION=ad9a694fe4bcc833d7619faa391b77dd587f852d 4 | -------------------------------------------------------------------------------- /VERSION_28: -------------------------------------------------------------------------------- 1 | BASE_VERSION=v2.8.13 2 | SUFFIX_VERSION=fl.$(cat patches-argo-cd/series | cut -d- -f1 | tail -1) 3 | GITOPS_ENGINE_VERSION=425d65e07695a741d90b248f2f365f6a4329c23d 4 | -------------------------------------------------------------------------------- /VERSION_29: -------------------------------------------------------------------------------- 1 | BASE_VERSION=v2.9.9 2 | SUFFIX_VERSION=fl.$(cat patches-argo-cd/series | cut -d- -f1 | tail -1) 3 | GITOPS_ENGINE_VERSION=b0fffe419a0f0a40f9f2c0b6346b752ed6537385 4 | -------------------------------------------------------------------------------- /VERSION_210: -------------------------------------------------------------------------------- 1 | BASE_VERSION=v2.10.5 2 | SUFFIX_VERSION=fl.$(cat patches-argo-cd/series | cut -d- -f1 | tail -1) 3 | GITOPS_ENGINE_VERSION=792124280fcc67d9b3498bc0a27e05844ddb1e30 4 | -------------------------------------------------------------------------------- /patch_export.sh: -------------------------------------------------------------------------------- 1 | (cd argo-cd && stg push --all || stg export -n -p -d ../patches-argo-cd) 2 | (cd argo-cd/gitops-engine && stg push --all || stg export -n -p -d ../../patches-gitops-engine) 3 | -------------------------------------------------------------------------------- /try-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | INDEX=$(printf "%02s" $1) 4 | # index is like 01, 02, 03 5 | 6 | # lookup patch from index for example: ../patches-argo-cd/05-a-b-c-d.patch 7 | PATCH="../patches-argo-cd/${INDEX}-*.patch" 8 | 9 | git apply -3 $PATCH 10 | git diff 11 | git status 12 | -------------------------------------------------------------------------------- /fix-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | INDEX=$(printf "%02s" $1) 4 | # index is like 01, 02, 03 5 | 6 | # lookup patch from index for example: ../patches-argo-cd/05-a-b-c-d.patch 7 | PATCH="../patches-argo-cd/${INDEX}-*.patch" 8 | 9 | COMMIT_MESSAGE=$(cat $PATCH | head -1) 10 | 11 | # do commit and convert into stg patch 12 | git commit -s -am "${COMMIT_MESSAGE}" 13 | stg repair 14 | 15 | # double check 16 | stg series 17 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.2/series: -------------------------------------------------------------------------------- 1 | # This series applies on GIT commit 41828a5fb178bc485bcbb5d08fb3f07c80695114 2 | 01-build-with-local-gitops-engine.patch 3 | 02-implement-loopback.patch 4 | 03-allow-flux-and-oci-schemes.patch 5 | 04-ui-fix-find-leaf-pod-bug.patch 6 | 05-ui-show-kstatus-in-ui.patch 7 | 06-show-custom-info.patch 8 | 07-ui-add-resource-icons.patch 9 | 08-ui-implement-health-checks-and.patch 10 | 09-auto-create-flux-resources.patch 11 | 10-add-flux-options-to-the-ui.patch 12 | 11-support-helm-oci-and.patch 13 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.3/series: -------------------------------------------------------------------------------- 1 | # This series applies on GIT commit 3ef61d737cf5f1f2c1e3d97712bd6a1085c33399 2 | 01-build-with-local-gitops-engine.patch 3 | 02-implement-loopback.patch 4 | 03-allow-flux-and-oci-schemes.patch 5 | 04-ui-fix-find-leaf-pod-bug.patch 6 | 05-ui-show-kstatus-in-ui.patch 7 | 06-show-custom-info.patch 8 | 07-ui-add-resource-icons.patch 9 | 08-ui-implement-health-checks-and.patch 10 | 09-auto-create-flux-resources.patch 11 | 10-add-flux-options-to-the-ui.patch 12 | 11-support-helm-oci-and.patch 13 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.4/series: -------------------------------------------------------------------------------- 1 | # This series applies on GIT commit 7b5899be33d16af7c57523d85ebacaa6f345cb95 2 | 01-build-with-local-gitops-engine.patch 3 | 02-implement-loopback.patch 4 | 03-allow-flux-and-oci-schemes.patch 5 | 04-ui-fix-find-leaf-pod-bug.patch 6 | 05-ui-show-kstatus-in-ui.patch 7 | 06-show-custom-info.patch 8 | 07-ui-add-resource-icons.patch 9 | 08-ui-implement-health-checks-and.patch 10 | 09-auto-create-flux-resources.patch 11 | 10-add-flux-options-to-the-ui.patch 12 | 11-support-helm-oci-and.patch 13 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.5/series: -------------------------------------------------------------------------------- 1 | # This series applies on GIT commit 86b2dde8e4bf1187acd2b4294e94451cd104dad8 2 | 01-build-with-local-gitops-engine.patch 3 | 02-implement-loopback.patch 4 | 03-allow-flux-and-oci-schemes.patch 5 | 04-ui-fix-find-leaf-pod-bug.patch 6 | 05-ui-show-kstatus-in-ui.patch 7 | 06-show-custom-info.patch 8 | 07-ui-add-resource-icons.patch 9 | 08-ui-implement-health-checks-and.patch 10 | 09-auto-create-flux-resources.patch 11 | 10-add-flux-options-to-the-ui.patch 12 | 11-support-helm-oci-and.patch 13 | 12-change-logo-to-flamingo.patch 14 | -------------------------------------------------------------------------------- /init-gitops-engine.sh: -------------------------------------------------------------------------------- 1 | source ./VERSION 2 | 3 | pushd . 4 | git clone https://github.com/argoproj/gitops-engine 5 | cd gitops-engine 6 | git checkout -b workspace ${GITOPS_ENGINE_VERSION} 7 | 8 | stg init 9 | stg import -t --series ../patches-gitops-engine/series 10 | stg_version_output=$(stg --version | grep -i stacked | head -n 1) 11 | if [ "$stg_version_output" == "Stacked Git 2.2.2" ]; then 12 | # for stg 2.2.2 13 | SERIES=$(stg series --color never --all -P) 14 | echo "$SERIES" | while read -r line; do 15 | cleaned_line=$(echo "$line" | sed -e 's/^[0-9]*-//') 16 | stg rename $line $cleaned_line 17 | done 18 | fi 19 | 20 | popd 21 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.6/series: -------------------------------------------------------------------------------- 1 | # This series applies on GIT commit 697fd7c9a36725fec0b345e4147e1d19e15773cc 2 | 01-build-with-local-gitops-engine.patch 3 | 02-implement-loopback.patch 4 | 03-allow-flux-and-oci-schemes.patch 5 | 04-ui-fix-find-leaf-pod-bug.patch 6 | 05-ui-show-kstatus-in-ui.patch 7 | 06-show-custom-info.patch 8 | 07-ui-add-resource-icons.patch 9 | 08-ui-implement-health-checks-and.patch 10 | 09-auto-create-flux-resources.patch 11 | 10-add-flux-options-to-the-ui.patch 12 | 11-support-helm-oci-and.patch 13 | 12-change-logo-to-flamingo.patch 14 | 13-add-open-in-weave-gitops.patch 15 | 14-upgrade-to-flux-v2-0-0-rc-1.patch 16 | 15-fix-branch-and-rev-info-of.patch 17 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.7/series: -------------------------------------------------------------------------------- 1 | # This series applies on Git commit 685040cf82178b1e5732bf2b839312ff0f9d6ef2 2 | 01-build-with-local-gitops-engine.patch 3 | 02-implement-loopback.patch 4 | 03-allow-flux-and-oci-schemes.patch 5 | 04-ui-fix-find-leaf-pod-bug.patch 6 | 05-ui-show-kstatus-in-ui.patch 7 | 06-show-custom-info.patch 8 | 07-ui-add-resource-icons.patch 9 | 08-ui-implement-health-checks-and.patch 10 | 09-auto-create-flux-resources.patch 11 | 10-add-flux-options-to-the-ui.patch 12 | 11-support-helm-oci-and.patch 13 | 12-add-open-in-weave-gitops.patch 14 | 13-upgrade-to-flux-v2-0-0-rc-1.patch 15 | 14-fix-branch-and-rev-info-of.patch 16 | 15-change-logo-to-flamingo.patch 17 | -------------------------------------------------------------------------------- /init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source ./VERSION 5 | 6 | bash -x ./init-gitops-engine.sh 7 | 8 | pushd . 9 | git clone https://github.com/argoproj/argo-cd 10 | cd argo-cd 11 | git checkout -b workspace ${BASE_VERSION} 12 | stg init 13 | stg import -t --series ../patches-argo-cd/series 14 | stg_version_output=$(stg --version | grep -i stacked | head -n 1) 15 | if [ "$stg_version_output" == "Stacked Git 2.2.2" ]; then 16 | # for stg 2.2.2 17 | SERIES=$(stg series --color never --all -P) 18 | echo "$SERIES" | while read -r line; do 19 | cleaned_line=$(echo "$line" | sed -e 's/^[0-9]*-//') 20 | stg rename $line $cleaned_line 21 | done 22 | fi 23 | 24 | mv ../gitops-engine . 25 | popd 26 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/series: -------------------------------------------------------------------------------- 1 | # This series applies on Git commit 2bc94af7bd081bc4682c2c6dc005f6336c754c2b 2 | 01-build-with-local-gitops-engine.patch 3 | 02-implement-loopback.patch 4 | 03-allow-flux-and-oci-schemes.patch 5 | 04-ui-fix-find-leaf-pod-bug.patch 6 | 05-ui-show-kstatus-in-ui.patch 7 | 06-show-custom-info.patch 8 | 07-ui-add-resource-icons.patch 9 | 08-ui-implement-health-checks-and.patch 10 | 09-auto-create-flux-resources.patch 11 | 10-add-flux-options-to-the-ui.patch 12 | 11-support-helm-oci-and.patch 13 | 12-add-open-in-weave-gitops.patch 14 | 13-upgrade-to-flux-v2-0-0-rc-1.patch 15 | 14-fix-branch-and-rev-info-of.patch 16 | 15-change-logo-to-flamingo.patch 17 | 16-override-workload-name-with.patch 18 | 17-add-tilt-dev-support.patch 19 | 18-add-oci-repository.patch 20 | 19-fix-special-supported-schemes.patch 21 | 20-add-health-message-for-helm.patch 22 | 21-fix-health-message-in.patch 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flux Subsystem for Argo (FSA) 2 | 3 | This repository contains patches that implement the Flux Subsystem for Argo (FSA). 4 | 5 | # Versioning System 6 | 7 | The versioning system used by FSA follows the format: 8 | 9 | {ArgoCD-base}-{fl suffix}.{Patch level}-{Branch}-{Commit} 10 | 11 | For example, `v2.7.5-fl.6-main-07ce8cf3` represents a specific version of the FSA with the following components: 12 | 13 | - `ArgoCD-base`: The base version of ArgoCD that FSA is built upon (in this case, version 2.7.5). 14 | - `fl suffix`: The suffix indicating that this version includes the Flux Subsystem. 15 | - `Patch level`: The specific patch level for FSA. 16 | - `Branch`: The Git branch where the changes are made (in this case, the main branch). 17 | - `Commit`: The commit identifier for the specific changes made in this version. 18 | 19 | Please refer to the documentation or release notes for more information on each version of FSA and the changes introduced. 20 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/series: -------------------------------------------------------------------------------- 1 | # This series applies on Git commit fcf5d8c2381b68ab1621b90be63913b12cca2eb7 2 | 01-build-with-local-gitops-engine.patch 3 | 02-implement-loopback.patch 4 | 03-allow-flux-and-oci-schemes.patch 5 | 04-ui-fix-find-leaf-pod-bug.patch 6 | 05-ui-show-kstatus-in-ui.patch 7 | 06-show-custom-info.patch 8 | 07-ui-add-resource-icons.patch 9 | 08-ui-implement-health-checks-and.patch 10 | 09-auto-create-flux-resources.patch 11 | 10-add-flux-options-to-the-ui.patch 12 | 11-support-helm-oci-and.patch 13 | 12-add-open-in-weave-gitops.patch 14 | 13-upgrade-to-flux-v2.0.0-rc.1.patch 15 | 14-fix-branch-and-rev-info-of.patch 16 | 15-change-logo-to-flamingo.patch 17 | 16-override-workload-name-with.patch 18 | 17-add-tilt-dev-support.patch 19 | 18-add-oci-repository.patch 20 | 19-fix-special-supported-schemes.patch 21 | 20-add-health-message-for-helm.patch 22 | 21-fix-health-message-in.patch 23 | 22-fix-flux-2.2-oci.patch 24 | 23-allow-overriding-flux-object.patch 25 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/series: -------------------------------------------------------------------------------- 1 | # This series applies on Git commit ba62a0a86d19f71a65ec2b510a39ea55497e1580 2 | 01-build-with-local-gitops-engine.patch 3 | 02-implement-loopback.patch 4 | 03-allow-flux-and-oci-schemes.patch 5 | 04-ui-fix-find-leaf-pod-bug.patch 6 | 05-ui-show-kstatus-in-ui.patch 7 | 06-show-custom-info.patch 8 | 07-ui-add-resource-icons.patch 9 | 08-ui-implement-health-checks-and.patch 10 | 09-auto-create-flux-resources.patch 11 | 10-add-flux-options-to-the-ui.patch 12 | 11-support-helm-oci-and.patch 13 | 12-add-open-in-weave-gitops.patch 14 | 13-upgrade-to-flux-v2.0.0-rc.1.patch 15 | 14-fix-branch-and-rev-info-of.patch 16 | 15-change-logo-to-flamingo.patch 17 | 16-override-workload-name-with.patch 18 | 17-add-tilt-dev-support.patch 19 | 18-add-oci-repository.patch 20 | 19-fix-special-supported-schemes.patch 21 | 20-add-health-message-for-helm.patch 22 | 21-fix-health-message-in.patch 23 | 22-fix-flux-2.2-oci.patch 24 | 23-allow-overriding-flux-object.patch 25 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/21-fix-health-message-in.patch: -------------------------------------------------------------------------------- 1 | fix health message in kustomization 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../Kustomization/health.lua | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua b/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua 11 | index 9a9122d44..496e5c025 100644 12 | --- a/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua 13 | +++ b/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua 14 | @@ -5,7 +5,7 @@ if obj.status ~= nil then 15 | for _, condition in ipairs(obj.status.conditions) do 16 | if condition.type == "Ready" then 17 | ready_status = condition.status 18 | - ready_message = condition.reason .. " - " .. condition.message 19 | + ready_message = condition.message 20 | end 21 | end 22 | if ready_status == "True" then 23 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/21-fix-health-message-in.patch: -------------------------------------------------------------------------------- 1 | fix health message in kustomization 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../Kustomization/health.lua | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua b/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua 11 | index 9a9122d44..496e5c025 100644 12 | --- a/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua 13 | +++ b/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua 14 | @@ -5,7 +5,7 @@ if obj.status ~= nil then 15 | for _, condition in ipairs(obj.status.conditions) do 16 | if condition.type == "Ready" then 17 | ready_status = condition.status 18 | - ready_message = condition.reason .. " - " .. condition.message 19 | + ready_message = condition.message 20 | end 21 | end 22 | if ready_status == "True" then 23 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/21-fix-health-message-in.patch: -------------------------------------------------------------------------------- 1 | fix health message in kustomization 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../Kustomization/health.lua | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua b/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua 11 | index 9a9122d44..496e5c025 100644 12 | --- a/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua 13 | +++ b/resource_customizations/kustomize.toolkit.fluxcd.io/Kustomization/health.lua 14 | @@ -5,7 +5,7 @@ if obj.status ~= nil then 15 | for _, condition in ipairs(obj.status.conditions) do 16 | if condition.type == "Ready" then 17 | ready_status = condition.status 18 | - ready_message = condition.reason .. " - " .. condition.message 19 | + ready_message = condition.message 20 | end 21 | end 22 | if ready_status == "True" then 23 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/22-fix-flux-2.2-oci.patch: -------------------------------------------------------------------------------- 1 | fix flux 2.2 oci helmrepository health check 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../HelmRepository/health.lua | 11 +++++++++++ 8 | 1 file changed, 11 insertions(+) 9 | 10 | diff --git a/resource_customizations/source.toolkit.fluxcd.io/HelmRepository/health.lua b/resource_customizations/source.toolkit.fluxcd.io/HelmRepository/health.lua 11 | index f5bd9b0bc..40d3d6853 100644 12 | --- a/resource_customizations/source.toolkit.fluxcd.io/HelmRepository/health.lua 13 | +++ b/resource_customizations/source.toolkit.fluxcd.io/HelmRepository/health.lua 14 | @@ -1,4 +1,15 @@ 15 | hs = {} 16 | + 17 | +if obj.spec.type == "oci" then 18 | +-- https://fluxcd.io/flux/components/source/helmrepositories/#helm-oci-repository 19 | +-- Because the OCI Helm repository is a data container, 20 | +-- there’s nothing to report for READY and STATUS columns above. 21 | +-- The existence of the object can be considered to be ready for use. 22 | + hs.status = "Healthy" 23 | + hs.message = "OCI HelmRepository is ready to use." 24 | + return hs 25 | +end 26 | + 27 | if obj.status ~= nil then 28 | if obj.status.conditions ~= nil then 29 | ready_status = "" 30 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/22-fix-flux-2.2-oci.patch: -------------------------------------------------------------------------------- 1 | fix flux 2.2 oci helmrepository health check 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../HelmRepository/health.lua | 11 +++++++++++ 8 | 1 file changed, 11 insertions(+) 9 | 10 | diff --git a/resource_customizations/source.toolkit.fluxcd.io/HelmRepository/health.lua b/resource_customizations/source.toolkit.fluxcd.io/HelmRepository/health.lua 11 | index f5bd9b0bc..40d3d6853 100644 12 | --- a/resource_customizations/source.toolkit.fluxcd.io/HelmRepository/health.lua 13 | +++ b/resource_customizations/source.toolkit.fluxcd.io/HelmRepository/health.lua 14 | @@ -1,4 +1,15 @@ 15 | hs = {} 16 | + 17 | +if obj.spec.type == "oci" then 18 | +-- https://fluxcd.io/flux/components/source/helmrepositories/#helm-oci-repository 19 | +-- Because the OCI Helm repository is a data container, 20 | +-- there’s nothing to report for READY and STATUS columns above. 21 | +-- The existence of the object can be considered to be ready for use. 22 | + hs.status = "Healthy" 23 | + hs.message = "OCI HelmRepository is ready to use." 24 | + return hs 25 | +end 26 | + 27 | if obj.status ~= nil then 28 | if obj.status.conditions ~= nil then 29 | ready_status = "" 30 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/19-fix-special-supported-schemes.patch: -------------------------------------------------------------------------------- 1 | fix special supported schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | server/application/application.go | 9 +++++---- 8 | 1 file changed, 5 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/server/application/application.go b/server/application/application.go 11 | index 83cef54ca..6253147f5 100644 12 | --- a/server/application/application.go 13 | +++ b/server/application/application.go 14 | @@ -2027,10 +2027,11 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 15 | // If it's already a commit SHA, then no need to look it up 16 | return ambiguousRevision, ambiguousRevision, nil 17 | } 18 | - if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 19 | - // Flux or OCI scheme are special cases 20 | - return ambiguousRevision, ambiguousRevision, nil 21 | - } 22 | + } 23 | + 24 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 25 | + // Flux or OCI scheme are special cases 26 | + return ambiguousRevision, ambiguousRevision, nil 27 | } 28 | 29 | resolveRevisionResponse, err := repoClient.ResolveRevision(ctx, &apiclient.ResolveRevisionRequest{ 30 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/19-fix-special-supported-schemes.patch: -------------------------------------------------------------------------------- 1 | fix special supported schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | server/application/application.go | 9 +++++---- 8 | 1 file changed, 5 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/server/application/application.go b/server/application/application.go 11 | index 534d1aa47..905f2b28e 100644 12 | --- a/server/application/application.go 13 | +++ b/server/application/application.go 14 | @@ -2010,10 +2010,11 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 15 | // If it's already a commit SHA, then no need to look it up 16 | return ambiguousRevision, ambiguousRevision, nil 17 | } 18 | - if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 19 | - // Flux or OCI scheme are special cases 20 | - return ambiguousRevision, ambiguousRevision, nil 21 | - } 22 | + } 23 | + 24 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 25 | + // Flux or OCI scheme are special cases 26 | + return ambiguousRevision, ambiguousRevision, nil 27 | } 28 | 29 | resolveRevisionResponse, err := repoClient.ResolveRevision(ctx, &apiclient.ResolveRevisionRequest{ 30 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/19-fix-special-supported-schemes.patch: -------------------------------------------------------------------------------- 1 | fix special supported schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | server/application/application.go | 9 +++++---- 8 | 1 file changed, 5 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/server/application/application.go b/server/application/application.go 11 | index aa6993cb0..05d02a090 100644 12 | --- a/server/application/application.go 13 | +++ b/server/application/application.go 14 | @@ -2019,10 +2019,11 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 15 | // If it's already a commit SHA, then no need to look it up 16 | return ambiguousRevision, ambiguousRevision, nil 17 | } 18 | - if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 19 | - // Flux or OCI scheme are special cases 20 | - return ambiguousRevision, ambiguousRevision, nil 21 | - } 22 | + } 23 | + 24 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 25 | + // Flux or OCI scheme are special cases 26 | + return ambiguousRevision, ambiguousRevision, nil 27 | } 28 | 29 | resolveRevisionResponse, err := repoClient.ResolveRevision(ctx, &apiclient.ResolveRevisionRequest{ 30 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.2/10-add-flux-options-to-the-ui.patch: -------------------------------------------------------------------------------- 1 | add flux options to the ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-sync-options.tsx | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 11 | index c8569a614..6cfb95f6a 100644 12 | --- a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 13 | +++ b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 14 | @@ -90,6 +90,8 @@ const syncOptions: Array<(props: ApplicationSyncOptionProps) => React.ReactNode> 15 | props => booleanOption('CreateNamespace', 'Auto-Create Namespace', false, props, false), 16 | props => booleanOption('PruneLast', 'Prune Last', false, props, false), 17 | props => booleanOption('ApplyOutOfSyncOnly', 'Apply Out of Sync Only', false, props, false), 18 | + props => booleanOption('FluxSubsystem', 'Use Flux Subsystem', false, props, false), 19 | + props => booleanOption('AutoCreateFluxResources', 'Auto-Create Flux Resources', false, props, false), 20 | props => selectOption('PrunePropagationPolicy', 'Prune Propagation Policy', 'foreground', ['foreground', 'background', 'orphan'], props) 21 | ]; 22 | 23 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.3/10-add-flux-options-to-the-ui.patch: -------------------------------------------------------------------------------- 1 | add flux options to the ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-sync-options.tsx | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 11 | index f5580d153..7f712efc5 100644 12 | --- a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 13 | +++ b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 14 | @@ -91,6 +91,8 @@ const syncOptions: Array<(props: ApplicationSyncOptionProps) => React.ReactNode> 15 | props => booleanOption('PruneLast', 'Prune Last', false, props, false), 16 | props => booleanOption('ApplyOutOfSyncOnly', 'Apply Out of Sync Only', false, props, false), 17 | props => booleanOption('RespectIgnoreDifferences', 'Respect Ignore Differences', false, props, false), 18 | + props => booleanOption('FluxSubsystem', 'Use Flux Subsystem', false, props, false), 19 | + props => booleanOption('AutoCreateFluxResources', 'Auto-Create Flux Resources', false, props, false), 20 | props => selectOption('PrunePropagationPolicy', 'Prune Propagation Policy', 'foreground', ['foreground', 'background', 'orphan'], props) 21 | ]; 22 | 23 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.4/10-add-flux-options-to-the-ui.patch: -------------------------------------------------------------------------------- 1 | add flux options to the ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-sync-options.tsx | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 11 | index c0cf79179..f770281fb 100644 12 | --- a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 13 | +++ b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 14 | @@ -92,6 +92,8 @@ const syncOptions: Array<(props: ApplicationSyncOptionProps) => React.ReactNode> 15 | props => booleanOption('PruneLast', 'Prune Last', false, props, false), 16 | props => booleanOption('ApplyOutOfSyncOnly', 'Apply Out of Sync Only', false, props, false), 17 | props => booleanOption('RespectIgnoreDifferences', 'Respect Ignore Differences', false, props, false), 18 | + props => booleanOption('FluxSubsystem', 'Use Flux Subsystem', false, props, false), 19 | + props => booleanOption('AutoCreateFluxResources', 'Auto-Create Flux Resources', false, props, false), 20 | props => selectOption('PrunePropagationPolicy', 'Prune Propagation Policy', 'foreground', ['foreground', 'background', 'orphan'], props) 21 | ]; 22 | 23 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/10-add-flux-options-to-the-ui.patch: -------------------------------------------------------------------------------- 1 | add flux options to the ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-sync-options.tsx | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 11 | index 7cc24173c..81f7a13ef 100644 12 | --- a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 13 | +++ b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 14 | @@ -94,6 +94,8 @@ const syncOptions: Array<(props: ApplicationSyncOptionProps) => React.ReactNode> 15 | props => booleanOption('ApplyOutOfSyncOnly', 'Apply Out of Sync Only', false, props, false), 16 | props => booleanOption('RespectIgnoreDifferences', 'Respect Ignore Differences', false, props, false), 17 | props => booleanOption('ServerSideApply', 'Server-Side Apply', false, props, false), 18 | + props => booleanOption('FluxSubsystem', 'Use Flux Subsystem', false, props, false), 19 | + props => booleanOption('AutoCreateFluxResources', 'Auto-Create Flux Resources', false, props, false), 20 | props => selectOption('PrunePropagationPolicy', 'Prune Propagation Policy', 'foreground', ['foreground', 'background', 'orphan'], props) 21 | ]; 22 | 23 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.5/10-add-flux-options-to-the-ui.patch: -------------------------------------------------------------------------------- 1 | add flux options to the ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-sync-options.tsx | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 11 | index fe4a0ae08..eda2c31d6 100644 12 | --- a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 13 | +++ b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 14 | @@ -93,6 +93,8 @@ const syncOptions: Array<(props: ApplicationSyncOptionProps) => React.ReactNode> 15 | props => booleanOption('ApplyOutOfSyncOnly', 'Apply Out of Sync Only', false, props, false), 16 | props => booleanOption('RespectIgnoreDifferences', 'Respect Ignore Differences', false, props, false), 17 | props => booleanOption('ServerSideApply', 'Server-Side Apply', false, props, false), 18 | + props => booleanOption('FluxSubsystem', 'Use Flux Subsystem', false, props, false), 19 | + props => booleanOption('AutoCreateFluxResources', 'Auto-Create Flux Resources', false, props, false), 20 | props => selectOption('PrunePropagationPolicy', 'Prune Propagation Policy', 'foreground', ['foreground', 'background', 'orphan'], props) 21 | ]; 22 | 23 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.6/10-add-flux-options-to-the-ui.patch: -------------------------------------------------------------------------------- 1 | add flux options to the ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-sync-options.tsx | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 11 | index 538d74455..bc5cddfb3 100644 12 | --- a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 13 | +++ b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 14 | @@ -93,6 +93,8 @@ const syncOptions: Array<(props: ApplicationSyncOptionProps) => React.ReactNode> 15 | props => booleanOption('ApplyOutOfSyncOnly', 'Apply Out of Sync Only', false, props, false), 16 | props => booleanOption('RespectIgnoreDifferences', 'Respect Ignore Differences', false, props, false), 17 | props => booleanOption('ServerSideApply', 'Server-Side Apply', false, props, false), 18 | + props => booleanOption('FluxSubsystem', 'Use Flux Subsystem', false, props, false), 19 | + props => booleanOption('AutoCreateFluxResources', 'Auto-Create Flux Resources', false, props, false), 20 | props => selectOption('PrunePropagationPolicy', 'Prune Propagation Policy', 'foreground', ['foreground', 'background', 'orphan'], props) 21 | ]; 22 | 23 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.7/10-add-flux-options-to-the-ui.patch: -------------------------------------------------------------------------------- 1 | add flux options to the ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-sync-options.tsx | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 11 | index 538d74455..bc5cddfb3 100644 12 | --- a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 13 | +++ b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 14 | @@ -93,6 +93,8 @@ const syncOptions: Array<(props: ApplicationSyncOptionProps) => React.ReactNode> 15 | props => booleanOption('ApplyOutOfSyncOnly', 'Apply Out of Sync Only', false, props, false), 16 | props => booleanOption('RespectIgnoreDifferences', 'Respect Ignore Differences', false, props, false), 17 | props => booleanOption('ServerSideApply', 'Server-Side Apply', false, props, false), 18 | + props => booleanOption('FluxSubsystem', 'Use Flux Subsystem', false, props, false), 19 | + props => booleanOption('AutoCreateFluxResources', 'Auto-Create Flux Resources', false, props, false), 20 | props => selectOption('PrunePropagationPolicy', 'Prune Propagation Policy', 'foreground', ['foreground', 'background', 'orphan'], props) 21 | ]; 22 | 23 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/10-add-flux-options-to-the-ui.patch: -------------------------------------------------------------------------------- 1 | add flux options to the ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-sync-options.tsx | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 11 | index 538d74455..bc5cddfb3 100644 12 | --- a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 13 | +++ b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 14 | @@ -93,6 +93,8 @@ const syncOptions: Array<(props: ApplicationSyncOptionProps) => React.ReactNode> 15 | props => booleanOption('ApplyOutOfSyncOnly', 'Apply Out of Sync Only', false, props, false), 16 | props => booleanOption('RespectIgnoreDifferences', 'Respect Ignore Differences', false, props, false), 17 | props => booleanOption('ServerSideApply', 'Server-Side Apply', false, props, false), 18 | + props => booleanOption('FluxSubsystem', 'Use Flux Subsystem', false, props, false), 19 | + props => booleanOption('AutoCreateFluxResources', 'Auto-Create Flux Resources', false, props, false), 20 | props => selectOption('PrunePropagationPolicy', 'Prune Propagation Policy', 'foreground', ['foreground', 'background', 'orphan'], props) 21 | ]; 22 | 23 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/10-add-flux-options-to-the-ui.patch: -------------------------------------------------------------------------------- 1 | add flux options to the ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-sync-options.tsx | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 11 | index 538d74455..bc5cddfb3 100644 12 | --- a/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 13 | +++ b/ui/src/app/applications/components/application-sync-options/application-sync-options.tsx 14 | @@ -93,6 +93,8 @@ const syncOptions: Array<(props: ApplicationSyncOptionProps) => React.ReactNode> 15 | props => booleanOption('ApplyOutOfSyncOnly', 'Apply Out of Sync Only', false, props, false), 16 | props => booleanOption('RespectIgnoreDifferences', 'Respect Ignore Differences', false, props, false), 17 | props => booleanOption('ServerSideApply', 'Server-Side Apply', false, props, false), 18 | + props => booleanOption('FluxSubsystem', 'Use Flux Subsystem', false, props, false), 19 | + props => booleanOption('AutoCreateFluxResources', 'Auto-Create Flux Resources', false, props, false), 20 | props => selectOption('PrunePropagationPolicy', 'Prune Propagation Policy', 'foreground', ['foreground', 'background', 'orphan'], props) 21 | ]; 22 | 23 | -------------------------------------------------------------------------------- /.github/workflows/build_v22.yaml: -------------------------------------------------------------------------------- 1 | name: build_v22 2 | on: 3 | workflow_dispatch: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - patches-argo-cd-v2.2/** 10 | - patches-gitops-engine/** 11 | - VERSION_22 12 | - .github/workflows/build_v22.yaml 13 | 14 | permissions: 15 | contents: write 16 | id-token: write 17 | packages: write 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v2 25 | - name: install stgit 26 | shell: bash 27 | run: | 28 | sudo apt-get install -y stgit 29 | git config --global user.name "Chanwit Kaewkasi" 30 | git config --global user.email "chanwit@gmail.com" 31 | - name: Get branch names 32 | id: branch-name 33 | uses: tj-actions/branch-names@v5.1 34 | - name: Prepare 35 | id: prep 36 | run: | 37 | VERSION="${{ steps.branch-name.outputs.current_branch }}-${GITHUB_SHA::8}" 38 | echo ::set-output name=VERSION::${VERSION} 39 | - name: Login to GitHub Container Registry 40 | uses: docker/login-action@v1 41 | with: 42 | registry: ghcr.io 43 | username: ${{ github.actor }} 44 | password: ${{ secrets.GITHUB_TOKEN }} 45 | - name: Build v2.2 46 | run: | 47 | ln -s VERSION_22 VERSION 48 | ln -s patches-argo-cd-v2.2 patches-argo-cd 49 | ln -s patches-gitops-engine-v0 patches-gitops-engine 50 | rm -rf argo-cd || true 51 | bash -x ./init.sh 52 | source ./VERSION 53 | VERSION=${BASE_VERSION}-${SUFFIX_VERSION}-${{ steps.prep.outputs.VERSION }} 54 | ( cd argo-cd && IMAGE_NAMESPACE=ghcr.io/flux-subsystem-argo/fsa IMAGE_TAG=$VERSION DOCKER_PUSH=true make image ) 55 | unlink patches-argo-cd 56 | unlink VERSION 57 | -------------------------------------------------------------------------------- /.github/workflows/build_v23.yaml: -------------------------------------------------------------------------------- 1 | name: build_v23 2 | on: 3 | workflow_dispatch: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - patches-argo-cd-v2.3/** 10 | - patches-gitops-engine/** 11 | - VERSION_23 12 | - .github/workflows/build_v23.yaml 13 | 14 | permissions: 15 | contents: write 16 | id-token: write 17 | packages: write 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v2 25 | - name: install stgit 26 | shell: bash 27 | run: | 28 | sudo apt-get install -y stgit 29 | git config --global user.name "Chanwit Kaewkasi" 30 | git config --global user.email "chanwit@gmail.com" 31 | - name: Get branch names 32 | id: branch-name 33 | uses: tj-actions/branch-names@v5.1 34 | - name: Prepare 35 | id: prep 36 | run: | 37 | VERSION="${{ steps.branch-name.outputs.current_branch }}-${GITHUB_SHA::8}" 38 | echo ::set-output name=VERSION::${VERSION} 39 | - name: Login to GitHub Container Registry 40 | uses: docker/login-action@v1 41 | with: 42 | registry: ghcr.io 43 | username: ${{ github.actor }} 44 | password: ${{ secrets.GITHUB_TOKEN }} 45 | - name: Build v2.3 46 | run: | 47 | ln -s VERSION_23 VERSION 48 | ln -s patches-argo-cd-v2.3 patches-argo-cd 49 | ln -s patches-gitops-engine-v0 patches-gitops-engine 50 | rm -rf argo-cd || true 51 | bash -x ./init.sh 52 | source ./VERSION 53 | VERSION=${BASE_VERSION}-${SUFFIX_VERSION}-${{ steps.prep.outputs.VERSION }} 54 | ( cd argo-cd && IMAGE_NAMESPACE=ghcr.io/flux-subsystem-argo/fsa IMAGE_TAG=$VERSION DOCKER_PUSH=true make image ) 55 | unlink patches-argo-cd 56 | unlink VERSION 57 | -------------------------------------------------------------------------------- /.github/workflows/build_v24.yaml: -------------------------------------------------------------------------------- 1 | name: build_v24 2 | on: 3 | workflow_dispatch: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - patches-argo-cd-v2.4/** 10 | - patches-gitops-engine/** 11 | - VERSION_24 12 | - .github/workflows/build_v24.yaml 13 | 14 | permissions: 15 | contents: write 16 | id-token: write 17 | packages: write 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v2 25 | - name: install stgit 26 | shell: bash 27 | run: | 28 | sudo apt-get install -y stgit 29 | git config --global user.name "Chanwit Kaewkasi" 30 | git config --global user.email "chanwit@gmail.com" 31 | - name: Get branch names 32 | id: branch-name 33 | uses: tj-actions/branch-names@v5.1 34 | - name: Prepare 35 | id: prep 36 | run: | 37 | VERSION="${{ steps.branch-name.outputs.current_branch }}-${GITHUB_SHA::8}" 38 | echo ::set-output name=VERSION::${VERSION} 39 | - name: Login to GitHub Container Registry 40 | uses: docker/login-action@v1 41 | with: 42 | registry: ghcr.io 43 | username: ${{ github.actor }} 44 | password: ${{ secrets.GITHUB_TOKEN }} 45 | - name: Build v2.4 46 | run: | 47 | ln -s VERSION_24 VERSION 48 | ln -s patches-argo-cd-v2.4 patches-argo-cd 49 | ln -s patches-gitops-engine-v0 patches-gitops-engine 50 | rm -rf argo-cd || true 51 | bash -x ./init.sh 52 | source ./VERSION 53 | VERSION=${BASE_VERSION}-${SUFFIX_VERSION}-${{ steps.prep.outputs.VERSION }} 54 | ( cd argo-cd && IMAGE_NAMESPACE=ghcr.io/flux-subsystem-argo/fsa IMAGE_TAG=$VERSION DOCKER_PUSH=true make image ) 55 | unlink patches-argo-cd 56 | unlink VERSION 57 | -------------------------------------------------------------------------------- /.github/workflows/build_v25.yaml: -------------------------------------------------------------------------------- 1 | name: build_v25 2 | on: 3 | workflow_dispatch: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - patches-argo-cd-v2.5/** 10 | - patches-gitops-engine/** 11 | - VERSION_25 12 | - .github/workflows/build_v25.yaml 13 | 14 | permissions: 15 | contents: write 16 | id-token: write 17 | packages: write 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v2 25 | - name: install stgit 26 | shell: bash 27 | run: | 28 | sudo apt-get install -y stgit 29 | git config --global user.name "Chanwit Kaewkasi" 30 | git config --global user.email "chanwit@gmail.com" 31 | - name: Get branch names 32 | id: branch-name 33 | uses: tj-actions/branch-names@v5.1 34 | - name: Prepare 35 | id: prep 36 | run: | 37 | VERSION="${{ steps.branch-name.outputs.current_branch }}-${GITHUB_SHA::8}" 38 | echo ::set-output name=VERSION::${VERSION} 39 | - name: Login to GitHub Container Registry 40 | uses: docker/login-action@v1 41 | with: 42 | registry: ghcr.io 43 | username: ${{ github.actor }} 44 | password: ${{ secrets.GITHUB_TOKEN }} 45 | - name: Build v2.5 46 | run: | 47 | ln -s VERSION_25 VERSION 48 | ln -s patches-argo-cd-v2.5 patches-argo-cd 49 | ln -s patches-gitops-engine-v0 patches-gitops-engine 50 | rm -rf argo-cd || true 51 | bash -x ./init.sh 52 | source ./VERSION 53 | VERSION=${BASE_VERSION}-${SUFFIX_VERSION}-${{ steps.prep.outputs.VERSION }} 54 | ( cd argo-cd && IMAGE_NAMESPACE=ghcr.io/flux-subsystem-argo/fsa IMAGE_TAG=$VERSION DOCKER_PUSH=true make image ) 55 | unlink patches-argo-cd 56 | unlink VERSION 57 | -------------------------------------------------------------------------------- /.github/workflows/build_v26.yaml: -------------------------------------------------------------------------------- 1 | name: build_v26 2 | on: 3 | workflow_dispatch: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - patches-argo-cd-v2.6/** 10 | - patches-gitops-engine/** 11 | - VERSION_26 12 | - .github/workflows/build_v26.yaml 13 | 14 | permissions: 15 | contents: write 16 | id-token: write 17 | packages: write 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v2 25 | - name: install stgit 26 | shell: bash 27 | run: | 28 | sudo apt-get install -y stgit 29 | git config --global user.name "Chanwit Kaewkasi" 30 | git config --global user.email "chanwit@gmail.com" 31 | - name: Get branch names 32 | id: branch-name 33 | uses: tj-actions/branch-names@v5.1 34 | - name: Prepare 35 | id: prep 36 | run: | 37 | VERSION="${{ steps.branch-name.outputs.current_branch }}-${GITHUB_SHA::8}" 38 | echo ::set-output name=VERSION::${VERSION} 39 | - name: Login to GitHub Container Registry 40 | uses: docker/login-action@v1 41 | with: 42 | registry: ghcr.io 43 | username: ${{ github.actor }} 44 | password: ${{ secrets.GITHUB_TOKEN }} 45 | - name: Build v2.6 46 | run: | 47 | ln -s VERSION_26 VERSION 48 | ln -s patches-argo-cd-v2.6 patches-argo-cd 49 | ln -s patches-gitops-engine-v2.0.0 patches-gitops-engine 50 | rm -rf argo-cd || true 51 | bash -x ./init.sh 52 | source ./VERSION 53 | VERSION=${BASE_VERSION}-${SUFFIX_VERSION}-${{ steps.prep.outputs.VERSION }} 54 | ( cd argo-cd && IMAGE_NAMESPACE=ghcr.io/flux-subsystem-argo/fsa IMAGE_TAG=$VERSION DOCKER_PUSH=true make image ) 55 | unlink patches-argo-cd 56 | unlink VERSION 57 | -------------------------------------------------------------------------------- /.github/workflows/build_v27.yaml: -------------------------------------------------------------------------------- 1 | name: build_v27 2 | on: 3 | workflow_dispatch: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - patches-argo-cd-v2.7/** 10 | - patches-gitops-engine-v2.0.0/** 11 | - VERSION_27 12 | - .github/workflows/build_v27.yaml 13 | 14 | permissions: 15 | contents: write 16 | id-token: write 17 | packages: write 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v2 25 | - name: install stgit 26 | shell: bash 27 | run: | 28 | sudo apt-get install -y stgit 29 | git config --global user.name "Chanwit Kaewkasi" 30 | git config --global user.email "chanwit@gmail.com" 31 | - name: Get branch names 32 | id: branch-name 33 | uses: tj-actions/branch-names@v5.1 34 | - name: Prepare 35 | id: prep 36 | run: | 37 | VERSION="${{ steps.branch-name.outputs.current_branch }}-${GITHUB_SHA::8}" 38 | echo ::set-output name=VERSION::${VERSION} 39 | - name: Login to GitHub Container Registry 40 | uses: docker/login-action@v1 41 | with: 42 | registry: ghcr.io 43 | username: ${{ github.actor }} 44 | password: ${{ secrets.GITHUB_TOKEN }} 45 | - name: Build v2.7 46 | run: | 47 | ln -s VERSION_27 VERSION 48 | ln -s patches-argo-cd-v2.7 patches-argo-cd 49 | ln -s patches-gitops-engine-v2.0.0 patches-gitops-engine 50 | rm -rf argo-cd || true 51 | bash -x ./init.sh 52 | source ./VERSION 53 | VERSION=${BASE_VERSION}-${SUFFIX_VERSION}-${{ steps.prep.outputs.VERSION }} 54 | ( cd argo-cd && IMAGE_NAMESPACE=ghcr.io/flux-subsystem-argo/fsa IMAGE_TAG=$VERSION DOCKER_PUSH=true make image ) 55 | unlink patches-argo-cd 56 | unlink VERSION 57 | -------------------------------------------------------------------------------- /.github/workflows/build_v210.yaml: -------------------------------------------------------------------------------- 1 | name: build_v210 2 | on: 3 | workflow_dispatch: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - patches-argo-cd-v2.10/** 10 | - patches-gitops-engine-v2.2.0/** 11 | - VERSION_210 12 | - .github/workflows/build_v210.yaml 13 | 14 | permissions: 15 | contents: write 16 | id-token: write 17 | packages: write 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v2 25 | - name: install stgit 26 | shell: bash 27 | run: | 28 | sudo apt-get install -y stgit 29 | git config --global user.name "Chanwit Kaewkasi" 30 | git config --global user.email "chanwit@gmail.com" 31 | - name: Get branch names 32 | id: branch-name 33 | uses: tj-actions/branch-names@v5.1 34 | - name: Prepare 35 | id: prep 36 | run: | 37 | VERSION="${{ steps.branch-name.outputs.current_branch }}-${GITHUB_SHA::8}" 38 | echo ::set-output name=VERSION::${VERSION} 39 | - name: Login to GitHub Container Registry 40 | uses: docker/login-action@v1 41 | with: 42 | registry: ghcr.io 43 | username: ${{ github.actor }} 44 | password: ${{ secrets.GITHUB_TOKEN }} 45 | - name: Build v2.10 46 | run: | 47 | ln -s VERSION_210 VERSION 48 | ln -s patches-argo-cd-v2.10 patches-argo-cd 49 | ln -s patches-gitops-engine-v2.2.0 patches-gitops-engine 50 | rm -rf argo-cd || true 51 | bash -x ./init.sh 52 | source ./VERSION 53 | VERSION=${BASE_VERSION}-${SUFFIX_VERSION}-${{ steps.prep.outputs.VERSION }} 54 | ( cd argo-cd && IMAGE_NAMESPACE=ghcr.io/flux-subsystem-argo/fsa IMAGE_TAG=$VERSION DOCKER_PUSH=true make image ) 55 | unlink patches-argo-cd 56 | unlink VERSION 57 | -------------------------------------------------------------------------------- /.github/workflows/build_v28.yaml: -------------------------------------------------------------------------------- 1 | name: build_v28 2 | on: 3 | workflow_dispatch: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - patches-argo-cd-v2.8/** 10 | - patches-gitops-engine-v2.0.0/** 11 | - VERSION_28 12 | - .github/workflows/build_v28.yaml 13 | 14 | permissions: 15 | contents: write 16 | id-token: write 17 | packages: write 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v2 25 | - name: install stgit 26 | shell: bash 27 | run: | 28 | sudo apt-get install -y stgit 29 | git config --global user.name "Chanwit Kaewkasi" 30 | git config --global user.email "chanwit@gmail.com" 31 | - name: Get branch names 32 | id: branch-name 33 | uses: tj-actions/branch-names@v5.1 34 | - name: Prepare 35 | id: prep 36 | run: | 37 | VERSION="${{ steps.branch-name.outputs.current_branch }}-${GITHUB_SHA::8}" 38 | echo ::set-output name=VERSION::${VERSION} 39 | - name: Login to GitHub Container Registry 40 | uses: docker/login-action@v1 41 | with: 42 | registry: ghcr.io 43 | username: ${{ github.actor }} 44 | password: ${{ secrets.GITHUB_TOKEN }} 45 | - name: Build v2.8 46 | if: github.repository == 'flux-subsystem-argo/fsa' 47 | run: | 48 | ln -s VERSION_28 VERSION 49 | ln -s patches-argo-cd-v2.8 patches-argo-cd 50 | ln -s patches-gitops-engine-v2.0.0 patches-gitops-engine 51 | rm -rf argo-cd || true 52 | bash -x ./init.sh 53 | source ./VERSION 54 | VERSION=${BASE_VERSION}-${SUFFIX_VERSION}-${{ steps.prep.outputs.VERSION }} 55 | ( cd argo-cd && IMAGE_NAMESPACE=ghcr.io/flux-subsystem-argo/fsa IMAGE_TAG=$VERSION DOCKER_PUSH=true make image ) 56 | unlink patches-argo-cd 57 | unlink VERSION 58 | -------------------------------------------------------------------------------- /.github/workflows/build_v29.yaml: -------------------------------------------------------------------------------- 1 | name: build_v29 2 | on: 3 | workflow_dispatch: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - patches-argo-cd-v2.9/** 10 | - patches-gitops-engine-v2.2.0/** 11 | - VERSION_29 12 | - .github/workflows/build_v29.yaml 13 | 14 | permissions: 15 | contents: write 16 | id-token: write 17 | packages: write 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v2 25 | - name: install stgit 26 | shell: bash 27 | run: | 28 | sudo apt-get install -y stgit 29 | git config --global user.name "Chanwit Kaewkasi" 30 | git config --global user.email "chanwit@gmail.com" 31 | - name: Get branch names 32 | id: branch-name 33 | uses: tj-actions/branch-names@v5.1 34 | - name: Prepare 35 | id: prep 36 | run: | 37 | VERSION="${{ steps.branch-name.outputs.current_branch }}-${GITHUB_SHA::8}" 38 | echo ::set-output name=VERSION::${VERSION} 39 | - name: Login to GitHub Container Registry 40 | uses: docker/login-action@v1 41 | with: 42 | registry: ghcr.io 43 | username: ${{ github.actor }} 44 | password: ${{ secrets.GITHUB_TOKEN }} 45 | - name: Build v2.9 46 | if: github.repository == 'flux-subsystem-argo/fsa' 47 | run: | 48 | ln -s VERSION_29 VERSION 49 | ln -s patches-argo-cd-v2.9 patches-argo-cd 50 | ln -s patches-gitops-engine-v2.2.0 patches-gitops-engine 51 | rm -rf argo-cd || true 52 | bash -x ./init.sh 53 | source ./VERSION 54 | VERSION=${BASE_VERSION}-${SUFFIX_VERSION}-${{ steps.prep.outputs.VERSION }} 55 | ( cd argo-cd && IMAGE_NAMESPACE=ghcr.io/flux-subsystem-argo/fsa IMAGE_TAG=$VERSION DOCKER_PUSH=true make image ) 56 | unlink patches-argo-cd 57 | unlink VERSION 58 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: init-v210 2 | init-v210: 3 | ln -s VERSION_210 VERSION 4 | ln -s patches-gitops-engine-v2.2.0 patches-gitops-engine 5 | ln -s patches-argo-cd-v2.10 patches-argo-cd 6 | make init 7 | 8 | .PHONY: init-v29 9 | init-v29: 10 | ln -s VERSION_29 VERSION 11 | ln -s patches-gitops-engine-v2.2.0 patches-gitops-engine 12 | ln -s patches-argo-cd-v2.9 patches-argo-cd 13 | make init 14 | 15 | .PHONY: init-v28 16 | init-v28: 17 | ln -s VERSION_28 VERSION 18 | ln -s patches-gitops-engine-v2.0.0 patches-gitops-engine 19 | ln -s patches-argo-cd-v2.8 patches-argo-cd 20 | make init 21 | 22 | .PHONY: init-v27 23 | init-v27: 24 | ln -s VERSION_27 VERSION 25 | ln -s patches-gitops-engine-v2.0.0 patches-gitops-engine 26 | ln -s patches-argo-cd-v2.7 patches-argo-cd 27 | make init 28 | 29 | .PHONY: init-v26 30 | init-v26: 31 | ln -s VERSION_26 VERSION 32 | ln -s patches-gitops-engine-v2.0.0 patches-gitops-engine 33 | ln -s patches-argo-cd-v2.6 patches-argo-cd 34 | make init 35 | 36 | .PHONY: init-v25 37 | init-v25: 38 | ln -s VERSION_25 VERSION 39 | ln -s patches-gitops-engine-v0 patches-gitops-engine 40 | ln -s patches-argo-cd-v2.5 patches-argo-cd 41 | make init 42 | 43 | .PHONY: init-v24 44 | init-v24: 45 | ln -s VERSION_24 VERSION 46 | ln -s patches-gitops-engine-v0 patches-gitops-engine 47 | ln -s patches-argo-cd-v2.4 patches-argo-cd 48 | make init 49 | 50 | .PHONY: init-v23 51 | init-v23: 52 | ln -s VERSION_23 VERSION 53 | ln -s patches-gitops-engine-v0 patches-gitops-engine 54 | ln -s patches-argo-cd-v2.3 patches-argo-cd 55 | make init 56 | 57 | .PHONY: init-v22 58 | init-v22: 59 | ln -s VERSION_22 VERSION 60 | ln -s patches-gitops-engine-v0 patches-gitops-engine 61 | ln -s patches-argo-cd-v2.2 patches-argo-cd 62 | make init 63 | 64 | .PHONY: uninit 65 | uninit: 66 | unlink VERSION 67 | unlink patches-argo-cd 68 | unlink patches-gitops-engine 69 | 70 | .PHONY: init 71 | init: 72 | bash -x ./init.sh 73 | 74 | .PHONY: init-gitops-engine 75 | init-gitops-engine: 76 | bash -x ./init-gitops-engine.sh 77 | 78 | .PHONY: image 79 | image: 80 | bash -x ./build.sh 81 | 82 | .PHONY: export-patches 83 | export-patches: 84 | bash -x ./patch_export.sh 85 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/01-build-with-local-gitops-engine.patch: -------------------------------------------------------------------------------- 1 | build with local gitops engine 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .gitignore | 2 ++ 8 | Dockerfile | 9 +++++++++ 9 | go.mod | 1 + 10 | 3 files changed, 12 insertions(+) 11 | 12 | diff --git a/.gitignore b/.gitignore 13 | index ab17deb0d..c28c77a6a 100644 14 | --- a/.gitignore 15 | +++ b/.gitignore 16 | @@ -25,3 +25,5 @@ cmd/argocd/argocd 17 | cmd/argocd-application-controller/argocd-application-controller 18 | cmd/argocd-repo-server/argocd-repo-server 19 | cmd/argocd-server/argocd-server 20 | + 21 | +gitops-engine/ 22 | diff --git a/Dockerfile b/Dockerfile 23 | index 2c31b5077..5e6bb92f0 100644 24 | --- a/Dockerfile 25 | +++ b/Dockerfile 26 | @@ -105,7 +105,9 @@ FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21.3@sha256:02d7116222 27 | 28 | WORKDIR /go/src/github.com/argoproj/argo-cd 29 | 30 | +COPY ./gitops-engine ./gitops-engine 31 | COPY go.* ./ 32 | + 33 | RUN go mod download 34 | 35 | # Perform the build 36 | @@ -130,9 +132,16 @@ RUN GIT_COMMIT=$GIT_COMMIT \ 37 | # Final image 38 | #################################################################################################### 39 | FROM argocd-base 40 | + 41 | +LABEL org.opencontainers.image.source https://github.com/flux-subsystem-argo/fsa 42 | + 43 | COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/local/bin/ 44 | 45 | USER root 46 | + 47 | +RUN chmod +x /usr/local/bin/gpg-wrapper.sh && \ 48 | + chmod +x /usr/local/bin/git-verify-wrapper.sh 49 | + 50 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server && \ 51 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server && \ 52 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server && \ 53 | diff --git a/go.mod b/go.mod 54 | index 7113f82d6..ca987953e 100644 55 | --- a/go.mod 56 | +++ b/go.mod 57 | @@ -334,4 +334,5 @@ replace ( 58 | k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.26.11 59 | k8s.io/sample-controller => k8s.io/sample-controller v0.26.11 60 | 61 | + github.com/argoproj/gitops-engine v0.7.1-0.20240122213038-792124280fcc => ./gitops-engine 62 | ) 63 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.2/05-ui-show-kstatus-in-ui.patch: -------------------------------------------------------------------------------- 1 | ui: show kstatus in ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-node-info.tsx | 13 ++++++++++++- 8 | 1 file changed, 12 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/ui/src/app/applications/components/application-node-info/application-node-info.tsx b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 11 | index f153e6679..b221dd2d1 100644 12 | --- a/ui/src/app/applications/components/application-node-info/application-node-info.tsx 13 | +++ b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 14 | @@ -7,7 +7,7 @@ import {YamlEditor} from '../../../shared/components'; 15 | import * as models from '../../../shared/models'; 16 | import {services} from '../../../shared/services'; 17 | import {ApplicationResourcesDiff} from '../application-resources-diff/application-resources-diff'; 18 | -import {ComparisonStatusIcon, getPodStateReason, HealthStatusIcon} from '../utils'; 19 | +import {ComparisonStatusIcon, getKstatusCondition, getPodStateReason, HealthStatusIcon} from '../utils'; 20 | 21 | require('./application-node-info.scss'); 22 | 23 | @@ -60,6 +60,17 @@ export const ApplicationNodeInfo = (props: { 24 | hostNames = (status.loadBalancer.ingress || []).map((item: any) => item.hostname || item.ip).join(', '); 25 | } 26 | attributes.push({title: 'HOSTNAMES', value: hostNames}); 27 | + } else if (props.node.kind == 'Kustomization' || 28 | + props.node.kind == "GitRepository" || 29 | + props.node.kind == "Bucket" || 30 | + props.node.kind == "HelmRelease" || 31 | + props.node.kind == "Terraform") { 32 | + const condition = getKstatusCondition("Ready", props.live) 33 | + if (condition) { 34 | + attributes.push({title: 'READY', value: condition.status}) 35 | + attributes.push({title: 'REASON', value: condition.reason}) 36 | + attributes.push({title: 'STATUS', value: condition.message}) 37 | + } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.3/05-ui-show-kstatus-in-ui.patch: -------------------------------------------------------------------------------- 1 | ui: show kstatus in ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-node-info.tsx | 13 ++++++++++++- 8 | 1 file changed, 12 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/ui/src/app/applications/components/application-node-info/application-node-info.tsx b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 11 | index f153e6679..b221dd2d1 100644 12 | --- a/ui/src/app/applications/components/application-node-info/application-node-info.tsx 13 | +++ b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 14 | @@ -7,7 +7,7 @@ import {YamlEditor} from '../../../shared/components'; 15 | import * as models from '../../../shared/models'; 16 | import {services} from '../../../shared/services'; 17 | import {ApplicationResourcesDiff} from '../application-resources-diff/application-resources-diff'; 18 | -import {ComparisonStatusIcon, getPodStateReason, HealthStatusIcon} from '../utils'; 19 | +import {ComparisonStatusIcon, getKstatusCondition, getPodStateReason, HealthStatusIcon} from '../utils'; 20 | 21 | require('./application-node-info.scss'); 22 | 23 | @@ -60,6 +60,17 @@ export const ApplicationNodeInfo = (props: { 24 | hostNames = (status.loadBalancer.ingress || []).map((item: any) => item.hostname || item.ip).join(', '); 25 | } 26 | attributes.push({title: 'HOSTNAMES', value: hostNames}); 27 | + } else if (props.node.kind == 'Kustomization' || 28 | + props.node.kind == "GitRepository" || 29 | + props.node.kind == "Bucket" || 30 | + props.node.kind == "HelmRelease" || 31 | + props.node.kind == "Terraform") { 32 | + const condition = getKstatusCondition("Ready", props.live) 33 | + if (condition) { 34 | + attributes.push({title: 'READY', value: condition.status}) 35 | + attributes.push({title: 'REASON', value: condition.reason}) 36 | + attributes.push({title: 'STATUS', value: condition.message}) 37 | + } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.4/05-ui-show-kstatus-in-ui.patch: -------------------------------------------------------------------------------- 1 | ui: show kstatus in ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-node-info.tsx | 13 ++++++++++++- 8 | 1 file changed, 12 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/ui/src/app/applications/components/application-node-info/application-node-info.tsx b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 11 | index f153e6679..b221dd2d1 100644 12 | --- a/ui/src/app/applications/components/application-node-info/application-node-info.tsx 13 | +++ b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 14 | @@ -7,7 +7,7 @@ import {YamlEditor} from '../../../shared/components'; 15 | import * as models from '../../../shared/models'; 16 | import {services} from '../../../shared/services'; 17 | import {ApplicationResourcesDiff} from '../application-resources-diff/application-resources-diff'; 18 | -import {ComparisonStatusIcon, getPodStateReason, HealthStatusIcon} from '../utils'; 19 | +import {ComparisonStatusIcon, getKstatusCondition, getPodStateReason, HealthStatusIcon} from '../utils'; 20 | 21 | require('./application-node-info.scss'); 22 | 23 | @@ -60,6 +60,17 @@ export const ApplicationNodeInfo = (props: { 24 | hostNames = (status.loadBalancer.ingress || []).map((item: any) => item.hostname || item.ip).join(', '); 25 | } 26 | attributes.push({title: 'HOSTNAMES', value: hostNames}); 27 | + } else if (props.node.kind == 'Kustomization' || 28 | + props.node.kind == "GitRepository" || 29 | + props.node.kind == "Bucket" || 30 | + props.node.kind == "HelmRelease" || 31 | + props.node.kind == "Terraform") { 32 | + const condition = getKstatusCondition("Ready", props.live) 33 | + if (condition) { 34 | + attributes.push({title: 'READY', value: condition.status}) 35 | + attributes.push({title: 'REASON', value: condition.reason}) 36 | + attributes.push({title: 'STATUS', value: condition.message}) 37 | + } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.4/01-build-with-local-gitops-engine.patch: -------------------------------------------------------------------------------- 1 | build with local gitops engine 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .gitignore | 2 ++ 8 | Dockerfile | 9 +++++++++ 9 | go.mod | 2 ++ 10 | 3 files changed, 13 insertions(+) 11 | 12 | diff --git a/.gitignore b/.gitignore 13 | index 3dbfd6f8b..b55d47ae7 100644 14 | --- a/.gitignore 15 | +++ b/.gitignore 16 | @@ -23,3 +23,5 @@ cmd/argocd/argocd 17 | cmd/argocd-application-controller/argocd-application-controller 18 | cmd/argocd-repo-server/argocd-repo-server 19 | cmd/argocd-server/argocd-server 20 | + 21 | +gitops-engine/ 22 | diff --git a/Dockerfile b/Dockerfile 23 | index 54dcb6a28..65bb272f8 100644 24 | --- a/Dockerfile 25 | +++ b/Dockerfile 26 | @@ -102,7 +102,9 @@ FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.18 AS argocd-build 27 | 28 | WORKDIR /go/src/github.com/argoproj/argo-cd 29 | 30 | +COPY ./gitops-engine ./gitops-engine 31 | COPY go.* ./ 32 | + 33 | RUN go mod download 34 | 35 | # Perform the build 36 | @@ -116,9 +118,16 @@ RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make argocd-all 37 | # Final image 38 | #################################################################################################### 39 | FROM argocd-base 40 | + 41 | +LABEL org.opencontainers.image.source https://github.com/flux-subsystem-argo/fsa 42 | + 43 | COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/local/bin/ 44 | 45 | USER root 46 | + 47 | +RUN chmod +x /usr/local/bin/gpg-wrapper.sh && \ 48 | + chmod +x /usr/local/bin/git-verify-wrapper.sh 49 | + 50 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server && \ 51 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server && \ 52 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server && \ 53 | diff --git a/go.mod b/go.mod 54 | index 6e5b70d45..a6f95b2a1 100644 55 | --- a/go.mod 56 | +++ b/go.mod 57 | @@ -286,4 +286,6 @@ replace ( 58 | k8s.io/mount-utils => k8s.io/mount-utils v0.23.1 59 | k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.23.1 60 | k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.1 61 | + 62 | + github.com/argoproj/gitops-engine v0.7.3 => ./gitops-engine 63 | ) 64 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.3/01-build-with-local-gitops-engine.patch: -------------------------------------------------------------------------------- 1 | build with local gitops engine 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .gitignore | 4 +++- 8 | Dockerfile | 9 +++++++++ 9 | go.mod | 2 ++ 10 | 3 files changed, 14 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/.gitignore b/.gitignore 13 | index b639ffa2c..3201ac6c9 100644 14 | --- a/.gitignore 15 | +++ b/.gitignore 16 | @@ -21,4 +21,6 @@ node_modules/ 17 | cmd/argocd/argocd 18 | cmd/argocd-application-controller/argocd-application-controller 19 | cmd/argocd-repo-server/argocd-repo-server 20 | -cmd/argocd-server/argocd-server 21 | \ No newline at end of file 22 | +cmd/argocd-server/argocd-server 23 | + 24 | +gitops-engine/ 25 | diff --git a/Dockerfile b/Dockerfile 26 | index 327a9f40f..165d65733 100644 27 | --- a/Dockerfile 28 | +++ b/Dockerfile 29 | @@ -106,6 +106,8 @@ FROM docker.io/library/golang:1.17 as argocd-build 30 | 31 | WORKDIR /go/src/github.com/argoproj/argo-cd 32 | 33 | +COPY ./gitops-engine ./gitops-engine 34 | + 35 | COPY go.mod go.mod 36 | COPY go.sum go.sum 37 | 38 | @@ -120,9 +122,16 @@ RUN make argocd-all 39 | # Final image 40 | #################################################################################################### 41 | FROM argocd-base 42 | + 43 | +LABEL org.opencontainers.image.source https://github.com/flux-subsystem-argo/fsa 44 | + 45 | COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/local/bin/ 46 | 47 | USER root 48 | + 49 | +RUN chmod +x /usr/local/bin/gpg-wrapper.sh 50 | +RUN chmod +x /usr/local/bin/git-verify-wrapper.sh 51 | + 52 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server 53 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server 54 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server 55 | diff --git a/go.mod b/go.mod 56 | index 3e2984cb2..18720740c 100644 57 | --- a/go.mod 58 | +++ b/go.mod 59 | @@ -254,4 +254,6 @@ replace ( 60 | k8s.io/mount-utils => k8s.io/mount-utils v0.23.1 61 | k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.23.1 62 | k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.1 63 | + 64 | + github.com/argoproj/gitops-engine v0.6.2 => ./gitops-engine 65 | ) 66 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/01-build-with-local-gitops-engine.patch: -------------------------------------------------------------------------------- 1 | build with local gitops engine 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .gitignore | 2 ++ 8 | Dockerfile | 9 +++++++++ 9 | go.mod | 2 ++ 10 | 3 files changed, 13 insertions(+) 11 | 12 | diff --git a/.gitignore b/.gitignore 13 | index ab17deb0d..c28c77a6a 100644 14 | --- a/.gitignore 15 | +++ b/.gitignore 16 | @@ -25,3 +25,5 @@ cmd/argocd/argocd 17 | cmd/argocd-application-controller/argocd-application-controller 18 | cmd/argocd-repo-server/argocd-repo-server 19 | cmd/argocd-server/argocd-server 20 | + 21 | +gitops-engine/ 22 | diff --git a/Dockerfile b/Dockerfile 23 | index f69e34cce..07e9df925 100644 24 | --- a/Dockerfile 25 | +++ b/Dockerfile 26 | @@ -105,7 +105,9 @@ FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.20.6@sha256:8e5a0067e6 27 | 28 | WORKDIR /go/src/github.com/argoproj/argo-cd 29 | 30 | +COPY ./gitops-engine ./gitops-engine 31 | COPY go.* ./ 32 | + 33 | RUN go mod download 34 | 35 | # Perform the build 36 | @@ -130,9 +132,16 @@ RUN GIT_COMMIT=$GIT_COMMIT \ 37 | # Final image 38 | #################################################################################################### 39 | FROM argocd-base 40 | + 41 | +LABEL org.opencontainers.image.source https://github.com/flux-subsystem-argo/fsa 42 | + 43 | COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/local/bin/ 44 | 45 | USER root 46 | + 47 | +RUN chmod +x /usr/local/bin/gpg-wrapper.sh && \ 48 | + chmod +x /usr/local/bin/git-verify-wrapper.sh 49 | + 50 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server && \ 51 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server && \ 52 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server && \ 53 | diff --git a/go.mod b/go.mod 54 | index de020933a..00b641f31 100644 55 | --- a/go.mod 56 | +++ b/go.mod 57 | @@ -306,4 +306,6 @@ replace ( 58 | k8s.io/mount-utils => k8s.io/mount-utils v0.24.2 59 | k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.24.2 60 | k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.24.2 61 | + 62 | + github.com/argoproj/gitops-engine v0.7.1-0.20230607163028-425d65e07695 => ./gitops-engine 63 | ) 64 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/01-build-with-local-gitops-engine.patch: -------------------------------------------------------------------------------- 1 | build with local gitops engine 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .gitignore | 2 ++ 8 | Dockerfile | 9 +++++++++ 9 | go.mod | 2 ++ 10 | 3 files changed, 13 insertions(+) 11 | 12 | diff --git a/.gitignore b/.gitignore 13 | index ab17deb0d..c28c77a6a 100644 14 | --- a/.gitignore 15 | +++ b/.gitignore 16 | @@ -25,3 +25,5 @@ cmd/argocd/argocd 17 | cmd/argocd-application-controller/argocd-application-controller 18 | cmd/argocd-repo-server/argocd-repo-server 19 | cmd/argocd-server/argocd-server 20 | + 21 | +gitops-engine/ 22 | diff --git a/Dockerfile b/Dockerfile 23 | index 2c31b5077..5e6bb92f0 100644 24 | --- a/Dockerfile 25 | +++ b/Dockerfile 26 | @@ -105,7 +105,9 @@ FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21.3@sha256:02d7116222 27 | 28 | WORKDIR /go/src/github.com/argoproj/argo-cd 29 | 30 | +COPY ./gitops-engine ./gitops-engine 31 | COPY go.* ./ 32 | + 33 | RUN go mod download 34 | 35 | # Perform the build 36 | @@ -130,9 +132,16 @@ RUN GIT_COMMIT=$GIT_COMMIT \ 37 | # Final image 38 | #################################################################################################### 39 | FROM argocd-base 40 | + 41 | +LABEL org.opencontainers.image.source https://github.com/flux-subsystem-argo/fsa 42 | + 43 | COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/local/bin/ 44 | 45 | USER root 46 | + 47 | +RUN chmod +x /usr/local/bin/gpg-wrapper.sh && \ 48 | + chmod +x /usr/local/bin/git-verify-wrapper.sh 49 | + 50 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server && \ 51 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server && \ 52 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server && \ 53 | diff --git a/go.mod b/go.mod 54 | index af07829a3..671c26d59 100644 55 | --- a/go.mod 56 | +++ b/go.mod 57 | @@ -324,4 +324,6 @@ replace ( 58 | k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.24.17 59 | k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.24.17 60 | k8s.io/sample-controller => k8s.io/sample-controller v0.24.17 61 | + 62 | + github.com/argoproj/gitops-engine v0.7.1-0.20230906152414-b0fffe419a0f => ./gitops-engine 63 | ) 64 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.5/05-ui-show-kstatus-in-ui.patch: -------------------------------------------------------------------------------- 1 | ui: show kstatus in ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-node-info.tsx | 13 ++++++++++++- 8 | 1 file changed, 12 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/ui/src/app/applications/components/application-node-info/application-node-info.tsx b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 11 | index 69194e309..0133b7c29 100644 12 | --- a/ui/src/app/applications/components/application-node-info/application-node-info.tsx 13 | +++ b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 14 | @@ -7,7 +7,7 @@ import {YamlEditor} from '../../../shared/components'; 15 | import * as models from '../../../shared/models'; 16 | import {services} from '../../../shared/services'; 17 | import {ApplicationResourcesDiff} from '../application-resources-diff/application-resources-diff'; 18 | -import {ComparisonStatusIcon, formatCreationTimestamp, getPodStateReason, HealthStatusIcon} from '../utils'; 19 | +import {ComparisonStatusIcon, formatCreationTimestamp, getKstatusCondition, getPodStateReason, HealthStatusIcon} from '../utils'; 20 | 21 | require('./application-node-info.scss'); 22 | 23 | @@ -57,6 +57,17 @@ export const ApplicationNodeInfo = (props: { 24 | hostNames = (status.loadBalancer.ingress || []).map((item: any) => item.hostname || item.ip).join(', '); 25 | } 26 | attributes.push({title: 'HOSTNAMES', value: hostNames}); 27 | + } else if (props.node.kind == 'Kustomization' || 28 | + props.node.kind == "GitRepository" || 29 | + props.node.kind == "Bucket" || 30 | + props.node.kind == "HelmRelease" || 31 | + props.node.kind == "Terraform") { 32 | + const condition = getKstatusCondition("Ready", props.live) 33 | + if (condition) { 34 | + attributes.push({title: 'READY', value: condition.status}) 35 | + attributes.push({title: 'REASON', value: condition.reason}) 36 | + attributes.push({title: 'STATUS', value: condition.message}) 37 | + } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.5/01-build-with-local-gitops-engine.patch: -------------------------------------------------------------------------------- 1 | build with local gitops engine 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .gitignore | 2 ++ 8 | Dockerfile | 9 +++++++++ 9 | go.mod | 2 ++ 10 | 3 files changed, 13 insertions(+) 11 | 12 | diff --git a/.gitignore b/.gitignore 13 | index 3dbfd6f8b..b55d47ae7 100644 14 | --- a/.gitignore 15 | +++ b/.gitignore 16 | @@ -23,3 +23,5 @@ cmd/argocd/argocd 17 | cmd/argocd-application-controller/argocd-application-controller 18 | cmd/argocd-repo-server/argocd-repo-server 19 | cmd/argocd-server/argocd-server 20 | + 21 | +gitops-engine/ 22 | diff --git a/Dockerfile b/Dockerfile 23 | index 3a434bc3b..6d69cfc51 100644 24 | --- a/Dockerfile 25 | +++ b/Dockerfile 26 | @@ -103,7 +103,9 @@ FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.18 AS argocd-build 27 | 28 | WORKDIR /go/src/github.com/argoproj/argo-cd 29 | 30 | +COPY ./gitops-engine ./gitops-engine 31 | COPY go.* ./ 32 | + 33 | RUN go mod download 34 | 35 | # Perform the build 36 | @@ -117,9 +119,16 @@ RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make argocd-all 37 | # Final image 38 | #################################################################################################### 39 | FROM argocd-base 40 | + 41 | +LABEL org.opencontainers.image.source https://github.com/flux-subsystem-argo/fsa 42 | + 43 | COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/local/bin/ 44 | 45 | USER root 46 | + 47 | +RUN chmod +x /usr/local/bin/gpg-wrapper.sh && \ 48 | + chmod +x /usr/local/bin/git-verify-wrapper.sh 49 | + 50 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server && \ 51 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server && \ 52 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server && \ 53 | diff --git a/go.mod b/go.mod 54 | index 617d57fb4..29aa7dae0 100644 55 | --- a/go.mod 56 | +++ b/go.mod 57 | @@ -289,4 +289,6 @@ replace ( 58 | k8s.io/mount-utils => k8s.io/mount-utils v0.24.2 59 | k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.24.2 60 | k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.24.2 61 | + 62 | + github.com/argoproj/gitops-engine v0.7.1-0.20221004132320-98ccd3d43fd9 => ./gitops-engine 63 | ) 64 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.6/01-build-with-local-gitops-engine.patch: -------------------------------------------------------------------------------- 1 | build with local gitops engine 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .gitignore | 2 ++ 8 | Dockerfile | 9 +++++++++ 9 | go.mod | 2 ++ 10 | 3 files changed, 13 insertions(+) 11 | 12 | diff --git a/.gitignore b/.gitignore 13 | index 869bb876f..e05fdda3e 100644 14 | --- a/.gitignore 15 | +++ b/.gitignore 16 | @@ -24,3 +24,5 @@ cmd/argocd/argocd 17 | cmd/argocd-application-controller/argocd-application-controller 18 | cmd/argocd-repo-server/argocd-repo-server 19 | cmd/argocd-server/argocd-server 20 | + 21 | +gitops-engine/ 22 | diff --git a/Dockerfile b/Dockerfile 23 | index 97c3257ec..d1b6433f0 100644 24 | --- a/Dockerfile 25 | +++ b/Dockerfile 26 | @@ -103,7 +103,9 @@ FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.19.10@sha256:83f9f8400 27 | 28 | WORKDIR /go/src/github.com/argoproj/argo-cd 29 | 30 | +COPY ./gitops-engine ./gitops-engine 31 | COPY go.* ./ 32 | + 33 | RUN go mod download 34 | 35 | # Perform the build 36 | @@ -117,9 +119,16 @@ RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make argocd-all 37 | # Final image 38 | #################################################################################################### 39 | FROM argocd-base 40 | + 41 | +LABEL org.opencontainers.image.source https://github.com/flux-subsystem-argo/fsa 42 | + 43 | COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/local/bin/ 44 | 45 | USER root 46 | + 47 | +RUN chmod +x /usr/local/bin/gpg-wrapper.sh && \ 48 | + chmod +x /usr/local/bin/git-verify-wrapper.sh 49 | + 50 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server && \ 51 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server && \ 52 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server && \ 53 | diff --git a/go.mod b/go.mod 54 | index e1cfa51fb..12b7dc6d5 100644 55 | --- a/go.mod 56 | +++ b/go.mod 57 | @@ -295,4 +295,6 @@ replace ( 58 | k8s.io/mount-utils => k8s.io/mount-utils v0.24.2 59 | k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.24.2 60 | k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.24.2 61 | + 62 | + github.com/argoproj/gitops-engine v0.7.1-0.20230512020822-b4dd8b8c3976 => ./gitops-engine 63 | ) 64 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.7/01-build-with-local-gitops-engine.patch: -------------------------------------------------------------------------------- 1 | build with local gitops engine 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .gitignore | 2 ++ 8 | Dockerfile | 9 +++++++++ 9 | go.mod | 2 ++ 10 | 3 files changed, 13 insertions(+) 11 | 12 | diff --git a/.gitignore b/.gitignore 13 | index 869bb876f..e05fdda3e 100644 14 | --- a/.gitignore 15 | +++ b/.gitignore 16 | @@ -24,3 +24,5 @@ cmd/argocd/argocd 17 | cmd/argocd-application-controller/argocd-application-controller 18 | cmd/argocd-repo-server/argocd-repo-server 19 | cmd/argocd-server/argocd-server 20 | + 21 | +gitops-engine/ 22 | diff --git a/Dockerfile b/Dockerfile 23 | index cf09f39ac..90be6a453 100644 24 | --- a/Dockerfile 25 | +++ b/Dockerfile 26 | @@ -105,7 +105,9 @@ FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.19.10@sha256:83f9f8400 27 | 28 | WORKDIR /go/src/github.com/argoproj/argo-cd 29 | 30 | +COPY ./gitops-engine ./gitops-engine 31 | COPY go.* ./ 32 | + 33 | RUN go mod download 34 | 35 | # Perform the build 36 | @@ -119,9 +121,16 @@ RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make argocd-all 37 | # Final image 38 | #################################################################################################### 39 | FROM argocd-base 40 | + 41 | +LABEL org.opencontainers.image.source https://github.com/flux-subsystem-argo/fsa 42 | + 43 | COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/local/bin/ 44 | 45 | USER root 46 | + 47 | +RUN chmod +x /usr/local/bin/gpg-wrapper.sh && \ 48 | + chmod +x /usr/local/bin/git-verify-wrapper.sh 49 | + 50 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server && \ 51 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server && \ 52 | ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server && \ 53 | diff --git a/go.mod b/go.mod 54 | index 95a95427c..7bf6ea9a4 100644 55 | --- a/go.mod 56 | +++ b/go.mod 57 | @@ -298,4 +298,6 @@ replace ( 58 | k8s.io/mount-utils => k8s.io/mount-utils v0.24.2 59 | k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.24.2 60 | k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.24.2 61 | + 62 | + github.com/argoproj/gitops-engine v0.7.1-0.20230526233214-ad9a694fe4bc => ./gitops-engine 63 | ) 64 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.7/05-ui-show-kstatus-in-ui.patch: -------------------------------------------------------------------------------- 1 | ui: show kstatus in ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-node-info.tsx | 13 +++++++++++++ 8 | 1 file changed, 13 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-node-info/application-node-info.tsx b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 11 | index 8ac1a46d5..e63b023a7 100644 12 | --- a/ui/src/app/applications/components/application-node-info/application-node-info.tsx 13 | +++ b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 14 | @@ -9,6 +9,7 @@ import {services} from '../../../shared/services'; 15 | import {ResourceTreeNode} from '../application-resource-tree/application-resource-tree'; 16 | import {ApplicationResourcesDiff} from '../application-resources-diff/application-resources-diff'; 17 | import {ComparisonStatusIcon, formatCreationTimestamp, getPodReadinessGatesState, getPodStateReason, HealthStatusIcon} from '../utils'; 18 | +import {getKstatusCondition} from '../utils'; 19 | import './application-node-info.scss'; 20 | import {ReadinessGatesNotPassedWarning} from './readiness-gates-not-passed-warning'; 21 | 22 | @@ -61,6 +62,18 @@ export const ApplicationNodeInfo = (props: { 23 | attributes.push({title: 'HOSTNAMES', value: hostNames}); 24 | } else if (props.node.kind === 'ReplicaSet') { 25 | attributes.push({title: 'REPLICAS', value: `${props.live.spec?.replicas || 0}/${props.live.status?.readyReplicas || 0}/${props.live.status?.replicas || 0}`}); 26 | + } else if (props.node.kind == 'Kustomization' || 27 | + props.node.kind == "HelmRelease" || 28 | + props.node.kind == "GitRepository" || 29 | + props.node.kind == "Bucket" || 30 | + props.node.kind == "OCIRepository" || 31 | + props.node.kind == "Terraform") { 32 | + const condition = getKstatusCondition("Ready", props.live) 33 | + if (condition) { 34 | + attributes.push({title: 'READY', value: condition.status}) 35 | + attributes.push({title: 'REASON', value: condition.reason}) 36 | + attributes.push({title: 'STATUS', value: condition.message}) 37 | + } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/05-ui-show-kstatus-in-ui.patch: -------------------------------------------------------------------------------- 1 | ui: show kstatus in ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-node-info.tsx | 13 +++++++++++++ 8 | 1 file changed, 13 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-node-info/application-node-info.tsx b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 11 | index 18ff44e38..dc5f1f539 100644 12 | --- a/ui/src/app/applications/components/application-node-info/application-node-info.tsx 13 | +++ b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 14 | @@ -10,6 +10,7 @@ import {services} from '../../../shared/services'; 15 | import {ResourceTreeNode} from '../application-resource-tree/application-resource-tree'; 16 | import {ApplicationResourcesDiff} from '../application-resources-diff/application-resources-diff'; 17 | import {ComparisonStatusIcon, formatCreationTimestamp, getPodReadinessGatesState, getPodStateReason, HealthStatusIcon} from '../utils'; 18 | +import {getKstatusCondition} from '../utils'; 19 | import './application-node-info.scss'; 20 | import {ReadinessGatesNotPassedWarning} from './readiness-gates-not-passed-warning'; 21 | 22 | @@ -138,6 +139,18 @@ export const ApplicationNodeInfo = (props: { 23 | attributes.push({title: 'HOSTNAMES', value: hostNames}); 24 | } else if (props.node.kind === 'ReplicaSet') { 25 | attributes.push({title: 'REPLICAS', value: `${props.live.spec?.replicas || 0}/${props.live.status?.readyReplicas || 0}/${props.live.status?.replicas || 0}`}); 26 | + } else if (props.node.kind == 'Kustomization' || 27 | + props.node.kind == "HelmRelease" || 28 | + props.node.kind == "GitRepository" || 29 | + props.node.kind == "Bucket" || 30 | + props.node.kind == "OCIRepository" || 31 | + props.node.kind == "Terraform") { 32 | + const condition = getKstatusCondition("Ready", props.live) 33 | + if (condition) { 34 | + attributes.push({title: 'READY', value: condition.status}) 35 | + attributes.push({title: 'REASON', value: condition.reason}) 36 | + attributes.push({title: 'STATUS', value: condition.message}) 37 | + } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/05-ui-show-kstatus-in-ui.patch: -------------------------------------------------------------------------------- 1 | ui: show kstatus in ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-node-info.tsx | 13 +++++++++++++ 8 | 1 file changed, 13 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-node-info/application-node-info.tsx b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 11 | index 18ff44e38..dc5f1f539 100644 12 | --- a/ui/src/app/applications/components/application-node-info/application-node-info.tsx 13 | +++ b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 14 | @@ -10,6 +10,7 @@ import {services} from '../../../shared/services'; 15 | import {ResourceTreeNode} from '../application-resource-tree/application-resource-tree'; 16 | import {ApplicationResourcesDiff} from '../application-resources-diff/application-resources-diff'; 17 | import {ComparisonStatusIcon, formatCreationTimestamp, getPodReadinessGatesState, getPodStateReason, HealthStatusIcon} from '../utils'; 18 | +import {getKstatusCondition} from '../utils'; 19 | import './application-node-info.scss'; 20 | import {ReadinessGatesNotPassedWarning} from './readiness-gates-not-passed-warning'; 21 | 22 | @@ -138,6 +139,18 @@ export const ApplicationNodeInfo = (props: { 23 | attributes.push({title: 'HOSTNAMES', value: hostNames}); 24 | } else if (props.node.kind === 'ReplicaSet') { 25 | attributes.push({title: 'REPLICAS', value: `${props.live.spec?.replicas || 0}/${props.live.status?.readyReplicas || 0}/${props.live.status?.replicas || 0}`}); 26 | + } else if (props.node.kind == 'Kustomization' || 27 | + props.node.kind == "HelmRelease" || 28 | + props.node.kind == "GitRepository" || 29 | + props.node.kind == "Bucket" || 30 | + props.node.kind == "OCIRepository" || 31 | + props.node.kind == "Terraform") { 32 | + const condition = getKstatusCondition("Ready", props.live) 33 | + if (condition) { 34 | + attributes.push({title: 'READY', value: condition.status}) 35 | + attributes.push({title: 'REASON', value: condition.reason}) 36 | + attributes.push({title: 'STATUS', value: condition.message}) 37 | + } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/05-ui-show-kstatus-in-ui.patch: -------------------------------------------------------------------------------- 1 | ui: show kstatus in ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-node-info.tsx | 13 +++++++++++++ 8 | 1 file changed, 13 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/application-node-info/application-node-info.tsx b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 11 | index 18ff44e38..dc5f1f539 100644 12 | --- a/ui/src/app/applications/components/application-node-info/application-node-info.tsx 13 | +++ b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 14 | @@ -10,6 +10,7 @@ import {services} from '../../../shared/services'; 15 | import {ResourceTreeNode} from '../application-resource-tree/application-resource-tree'; 16 | import {ApplicationResourcesDiff} from '../application-resources-diff/application-resources-diff'; 17 | import {ComparisonStatusIcon, formatCreationTimestamp, getPodReadinessGatesState, getPodStateReason, HealthStatusIcon} from '../utils'; 18 | +import {getKstatusCondition} from '../utils'; 19 | import './application-node-info.scss'; 20 | import {ReadinessGatesNotPassedWarning} from './readiness-gates-not-passed-warning'; 21 | 22 | @@ -138,6 +139,18 @@ export const ApplicationNodeInfo = (props: { 23 | attributes.push({title: 'HOSTNAMES', value: hostNames}); 24 | } else if (props.node.kind === 'ReplicaSet') { 25 | attributes.push({title: 'REPLICAS', value: `${props.live.spec?.replicas || 0}/${props.live.status?.readyReplicas || 0}/${props.live.status?.replicas || 0}`}); 26 | + } else if (props.node.kind == 'Kustomization' || 27 | + props.node.kind == "HelmRelease" || 28 | + props.node.kind == "GitRepository" || 29 | + props.node.kind == "Bucket" || 30 | + props.node.kind == "OCIRepository" || 31 | + props.node.kind == "Terraform") { 32 | + const condition = getKstatusCondition("Ready", props.live) 33 | + if (condition) { 34 | + attributes.push({title: 'READY', value: condition.status}) 35 | + attributes.push({title: 'REASON', value: condition.reason}) 36 | + attributes.push({title: 'STATUS', value: condition.message}) 37 | + } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.6/05-ui-show-kstatus-in-ui.patch: -------------------------------------------------------------------------------- 1 | ui: show kstatus in ui 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../application-node-info.tsx | 14 +++++++++++++- 8 | 1 file changed, 13 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/ui/src/app/applications/components/application-node-info/application-node-info.tsx b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 11 | index 17b7a5d85..64058f910 100644 12 | --- a/ui/src/app/applications/components/application-node-info/application-node-info.tsx 13 | +++ b/ui/src/app/applications/components/application-node-info/application-node-info.tsx 14 | @@ -9,7 +9,7 @@ import * as models from '../../../shared/models'; 15 | import {services} from '../../../shared/services'; 16 | import {ResourceTreeNode} from '../application-resource-tree/application-resource-tree'; 17 | import {ApplicationResourcesDiff} from '../application-resources-diff/application-resources-diff'; 18 | -import {ComparisonStatusIcon, formatCreationTimestamp, getPodStateReason, HealthStatusIcon} from '../utils'; 19 | +import {ComparisonStatusIcon, formatCreationTimestamp, getKstatusCondition, getPodStateReason, HealthStatusIcon} from '../utils'; 20 | 21 | import './application-node-info.scss'; 22 | 23 | @@ -62,6 +62,18 @@ export const ApplicationNodeInfo = (props: { 24 | attributes.push({title: 'HOSTNAMES', value: hostNames}); 25 | } else if (props.node.kind === 'ReplicaSet') { 26 | attributes.push({title: 'REPLICAS', value: `${props.live.spec?.replicas || 0}/${props.live.status?.readyReplicas || 0}/${props.live.spec?.replicas || 0}`}); 27 | + } else if (props.node.kind == 'Kustomization' || 28 | + props.node.kind == "HelmRelease" || 29 | + props.node.kind == "GitRepository" || 30 | + props.node.kind == "Bucket" || 31 | + props.node.kind == "OCIRepository" || 32 | + props.node.kind == "Terraform") { 33 | + const condition = getKstatusCondition("Ready", props.live) 34 | + if (condition) { 35 | + attributes.push({title: 'READY', value: condition.status}) 36 | + attributes.push({title: 'REASON', value: condition.reason}) 37 | + attributes.push({title: 'STATUS', value: condition.message}) 38 | + } 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.2/06-show-custom-info.patch: -------------------------------------------------------------------------------- 1 | show custom info 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 37 +++++++++++++++++++++++++++++++++++++ 8 | 1 file changed, 37 insertions(+) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index ab1357ee0..1414ab805 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -50,6 +50,43 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo) { 15 | populateIstioVirtualServiceInfo(un, res) 16 | return 17 | } 18 | + // TODO add Flux here 19 | + case "source.toolkit.fluxcd.io": 20 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 21 | + parts := strings.SplitN(revision, "/", 2) 22 | + if len(parts) == 1 { 23 | + if len(parts[0]) >= 8 { 24 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 25 | + } 26 | + } else if len(parts) == 2 { 27 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 28 | + if len(parts[1]) >= 8 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 30 | + } 31 | + } 32 | + } 33 | + case "helm.toolkit.fluxcd.io": 34 | + switch gvk.Kind { 35 | + case "HelmRelease": 36 | + if applied, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 37 | + if attempted, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 38 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: fmt.Sprintf("%s/%s", attempted, applied)}) 39 | + } 40 | + } 41 | + } 42 | + case "kustomize.toolkit.fluxcd.io", "infra.contrib.fluxcd.io": 43 | + switch gvk.Kind { 44 | + case "Kustomization", "Terraform": 45 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 46 | + parts := strings.SplitN(revision, "/", 2) 47 | + if len(parts) == 2 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 49 | + if len(parts[1]) >= 8 { 50 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 51 | + } 52 | + } 53 | + } 54 | + } 55 | } 56 | 57 | for k, v := range un.GetAnnotations() { 58 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.3/06-show-custom-info.patch: -------------------------------------------------------------------------------- 1 | show custom info 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 37 +++++++++++++++++++++++++++++++++++++ 8 | 1 file changed, 37 insertions(+) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index a6e5e419a..a079671bb 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -45,6 +45,43 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo) { 15 | case "VirtualService": 16 | populateIstioVirtualServiceInfo(un, res) 17 | } 18 | + // TODO add Flux here 19 | + case "source.toolkit.fluxcd.io": 20 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 21 | + parts := strings.SplitN(revision, "/", 2) 22 | + if len(parts) == 1 { 23 | + if len(parts[0]) >= 8 { 24 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 25 | + } 26 | + } else if len(parts) == 2 { 27 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 28 | + if len(parts[1]) >= 8 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 30 | + } 31 | + } 32 | + } 33 | + case "helm.toolkit.fluxcd.io": 34 | + switch gvk.Kind { 35 | + case "HelmRelease": 36 | + if applied, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 37 | + if attempted, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 38 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: fmt.Sprintf("%s/%s", attempted, applied)}) 39 | + } 40 | + } 41 | + } 42 | + case "kustomize.toolkit.fluxcd.io", "infra.contrib.fluxcd.io": 43 | + switch gvk.Kind { 44 | + case "Kustomization", "Terraform": 45 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 46 | + parts := strings.SplitN(revision, "/", 2) 47 | + if len(parts) == 2 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 49 | + if len(parts[1]) >= 8 { 50 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 51 | + } 52 | + } 53 | + } 54 | + } 55 | } 56 | 57 | for k, v := range un.GetAnnotations() { 58 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.4/06-show-custom-info.patch: -------------------------------------------------------------------------------- 1 | show custom info 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 37 +++++++++++++++++++++++++++++++++++++ 8 | 1 file changed, 37 insertions(+) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index a6e5e419a..a079671bb 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -45,6 +45,43 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo) { 15 | case "VirtualService": 16 | populateIstioVirtualServiceInfo(un, res) 17 | } 18 | + // TODO add Flux here 19 | + case "source.toolkit.fluxcd.io": 20 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 21 | + parts := strings.SplitN(revision, "/", 2) 22 | + if len(parts) == 1 { 23 | + if len(parts[0]) >= 8 { 24 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 25 | + } 26 | + } else if len(parts) == 2 { 27 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 28 | + if len(parts[1]) >= 8 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 30 | + } 31 | + } 32 | + } 33 | + case "helm.toolkit.fluxcd.io": 34 | + switch gvk.Kind { 35 | + case "HelmRelease": 36 | + if applied, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 37 | + if attempted, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 38 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: fmt.Sprintf("%s/%s", attempted, applied)}) 39 | + } 40 | + } 41 | + } 42 | + case "kustomize.toolkit.fluxcd.io", "infra.contrib.fluxcd.io": 43 | + switch gvk.Kind { 44 | + case "Kustomization", "Terraform": 45 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 46 | + parts := strings.SplitN(revision, "/", 2) 47 | + if len(parts) == 2 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 49 | + if len(parts[1]) >= 8 { 50 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 51 | + } 52 | + } 53 | + } 54 | + } 55 | } 56 | 57 | for k, v := range un.GetAnnotations() { 58 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.5/06-show-custom-info.patch: -------------------------------------------------------------------------------- 1 | show custom info 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 37 +++++++++++++++++++++++++++++++++++++ 8 | 1 file changed, 37 insertions(+) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index a6e5e419a..a079671bb 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -45,6 +45,43 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo) { 15 | case "VirtualService": 16 | populateIstioVirtualServiceInfo(un, res) 17 | } 18 | + // TODO add Flux here 19 | + case "source.toolkit.fluxcd.io": 20 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 21 | + parts := strings.SplitN(revision, "/", 2) 22 | + if len(parts) == 1 { 23 | + if len(parts[0]) >= 8 { 24 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 25 | + } 26 | + } else if len(parts) == 2 { 27 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 28 | + if len(parts[1]) >= 8 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 30 | + } 31 | + } 32 | + } 33 | + case "helm.toolkit.fluxcd.io": 34 | + switch gvk.Kind { 35 | + case "HelmRelease": 36 | + if applied, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 37 | + if attempted, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 38 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: fmt.Sprintf("%s/%s", attempted, applied)}) 39 | + } 40 | + } 41 | + } 42 | + case "kustomize.toolkit.fluxcd.io", "infra.contrib.fluxcd.io": 43 | + switch gvk.Kind { 44 | + case "Kustomization", "Terraform": 45 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 46 | + parts := strings.SplitN(revision, "/", 2) 47 | + if len(parts) == 2 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 49 | + if len(parts[1]) >= 8 { 50 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 51 | + } 52 | + } 53 | + } 54 | + } 55 | } 56 | 57 | for k, v := range un.GetAnnotations() { 58 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.6/06-show-custom-info.patch: -------------------------------------------------------------------------------- 1 | show custom info 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 37 +++++++++++++++++++++++++++++++++++++ 8 | 1 file changed, 37 insertions(+) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index 3cc7980ad..f97b04b4c 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -54,6 +54,43 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 15 | case "VirtualService": 16 | populateIstioVirtualServiceInfo(un, res) 17 | } 18 | + // TODO add Flux here 19 | + case "source.toolkit.fluxcd.io": 20 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 21 | + parts := strings.SplitN(revision, "/", 2) 22 | + if len(parts) == 1 { 23 | + if len(parts[0]) >= 8 { 24 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 25 | + } 26 | + } else if len(parts) == 2 { 27 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 28 | + if len(parts[1]) >= 8 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 30 | + } 31 | + } 32 | + } 33 | + case "helm.toolkit.fluxcd.io": 34 | + switch gvk.Kind { 35 | + case "HelmRelease": 36 | + if applied, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 37 | + if attempted, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 38 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: fmt.Sprintf("%s/%s", attempted, applied)}) 39 | + } 40 | + } 41 | + } 42 | + case "kustomize.toolkit.fluxcd.io", "infra.contrib.fluxcd.io": 43 | + switch gvk.Kind { 44 | + case "Kustomization", "Terraform": 45 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 46 | + parts := strings.SplitN(revision, "/", 2) 47 | + if len(parts) == 2 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 49 | + if len(parts[1]) >= 8 { 50 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 51 | + } 52 | + } 53 | + } 54 | + } 55 | } 56 | 57 | for k, v := range un.GetAnnotations() { 58 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.7/06-show-custom-info.patch: -------------------------------------------------------------------------------- 1 | show custom info 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 37 +++++++++++++++++++++++++++++++++++++ 8 | 1 file changed, 37 insertions(+) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index 3cc7980ad..f97b04b4c 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -54,6 +54,43 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 15 | case "VirtualService": 16 | populateIstioVirtualServiceInfo(un, res) 17 | } 18 | + // TODO add Flux here 19 | + case "source.toolkit.fluxcd.io": 20 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 21 | + parts := strings.SplitN(revision, "/", 2) 22 | + if len(parts) == 1 { 23 | + if len(parts[0]) >= 8 { 24 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 25 | + } 26 | + } else if len(parts) == 2 { 27 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 28 | + if len(parts[1]) >= 8 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 30 | + } 31 | + } 32 | + } 33 | + case "helm.toolkit.fluxcd.io": 34 | + switch gvk.Kind { 35 | + case "HelmRelease": 36 | + if applied, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 37 | + if attempted, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 38 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: fmt.Sprintf("%s/%s", attempted, applied)}) 39 | + } 40 | + } 41 | + } 42 | + case "kustomize.toolkit.fluxcd.io", "infra.contrib.fluxcd.io": 43 | + switch gvk.Kind { 44 | + case "Kustomization", "Terraform": 45 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 46 | + parts := strings.SplitN(revision, "/", 2) 47 | + if len(parts) == 2 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 49 | + if len(parts[1]) >= 8 { 50 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 51 | + } 52 | + } 53 | + } 54 | + } 55 | } 56 | 57 | for k, v := range un.GetAnnotations() { 58 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/06-show-custom-info.patch: -------------------------------------------------------------------------------- 1 | show custom info 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 37 +++++++++++++++++++++++++++++++++++++ 8 | 1 file changed, 37 insertions(+) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index cf0d12318..a81734fa1 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -57,6 +57,43 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 15 | case "VirtualService": 16 | populateIstioVirtualServiceInfo(un, res) 17 | } 18 | + // TODO add Flux here 19 | + case "source.toolkit.fluxcd.io": 20 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 21 | + parts := strings.SplitN(revision, "/", 2) 22 | + if len(parts) == 1 { 23 | + if len(parts[0]) >= 8 { 24 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 25 | + } 26 | + } else if len(parts) == 2 { 27 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 28 | + if len(parts[1]) >= 8 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 30 | + } 31 | + } 32 | + } 33 | + case "helm.toolkit.fluxcd.io": 34 | + switch gvk.Kind { 35 | + case "HelmRelease": 36 | + if applied, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 37 | + if attempted, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 38 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: fmt.Sprintf("%s/%s", attempted, applied)}) 39 | + } 40 | + } 41 | + } 42 | + case "kustomize.toolkit.fluxcd.io", "infra.contrib.fluxcd.io": 43 | + switch gvk.Kind { 44 | + case "Kustomization", "Terraform": 45 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 46 | + parts := strings.SplitN(revision, "/", 2) 47 | + if len(parts) == 2 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 49 | + if len(parts[1]) >= 8 { 50 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 51 | + } 52 | + } 53 | + } 54 | + } 55 | } 56 | 57 | for k, v := range un.GetAnnotations() { 58 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/06-show-custom-info.patch: -------------------------------------------------------------------------------- 1 | show custom info 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 37 +++++++++++++++++++++++++++++++++++++ 8 | 1 file changed, 37 insertions(+) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index cf0d12318..a81734fa1 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -57,6 +57,43 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 15 | case "VirtualService": 16 | populateIstioVirtualServiceInfo(un, res) 17 | } 18 | + // TODO add Flux here 19 | + case "source.toolkit.fluxcd.io": 20 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 21 | + parts := strings.SplitN(revision, "/", 2) 22 | + if len(parts) == 1 { 23 | + if len(parts[0]) >= 8 { 24 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 25 | + } 26 | + } else if len(parts) == 2 { 27 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 28 | + if len(parts[1]) >= 8 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 30 | + } 31 | + } 32 | + } 33 | + case "helm.toolkit.fluxcd.io": 34 | + switch gvk.Kind { 35 | + case "HelmRelease": 36 | + if applied, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 37 | + if attempted, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 38 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: fmt.Sprintf("%s/%s", attempted, applied)}) 39 | + } 40 | + } 41 | + } 42 | + case "kustomize.toolkit.fluxcd.io", "infra.contrib.fluxcd.io": 43 | + switch gvk.Kind { 44 | + case "Kustomization", "Terraform": 45 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 46 | + parts := strings.SplitN(revision, "/", 2) 47 | + if len(parts) == 2 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 49 | + if len(parts[1]) >= 8 { 50 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 51 | + } 52 | + } 53 | + } 54 | + } 55 | } 56 | 57 | for k, v := range un.GetAnnotations() { 58 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/06-show-custom-info.patch: -------------------------------------------------------------------------------- 1 | show custom info 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 37 +++++++++++++++++++++++++++++++++++++ 8 | 1 file changed, 37 insertions(+) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index 53512de6b..ffa4ae32f 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -67,6 +67,43 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 15 | case "VirtualService": 16 | populateIstioVirtualServiceInfo(un, res) 17 | } 18 | + // TODO add Flux here 19 | + case "source.toolkit.fluxcd.io": 20 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 21 | + parts := strings.SplitN(revision, "/", 2) 22 | + if len(parts) == 1 { 23 | + if len(parts[0]) >= 8 { 24 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 25 | + } 26 | + } else if len(parts) == 2 { 27 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 28 | + if len(parts[1]) >= 8 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 30 | + } 31 | + } 32 | + } 33 | + case "helm.toolkit.fluxcd.io": 34 | + switch gvk.Kind { 35 | + case "HelmRelease": 36 | + if applied, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 37 | + if attempted, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 38 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: fmt.Sprintf("%s/%s", attempted, applied)}) 39 | + } 40 | + } 41 | + } 42 | + case "kustomize.toolkit.fluxcd.io", "infra.contrib.fluxcd.io": 43 | + switch gvk.Kind { 44 | + case "Kustomization", "Terraform": 45 | + if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 46 | + parts := strings.SplitN(revision, "/", 2) 47 | + if len(parts) == 2 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 49 | + if len(parts[1]) >= 8 { 50 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 51 | + } 52 | + } 53 | + } 54 | + } 55 | } 56 | } 57 | 58 | or k, v := range un.GetAnnotations() { 59 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/03-allow-flux-and-oci-schemes.patch: -------------------------------------------------------------------------------- 1 | allow flux and oci schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | reposerver/repository/repository.go | 5 +++++ 8 | server/application/application.go | 4 ++++ 9 | util/argo/argo.go | 5 +++++ 10 | 3 files changed, 14 insertions(+) 11 | 12 | diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go 13 | index 5d11a6438..5085cd2a3 100644 14 | --- a/reposerver/repository/repository.go 15 | +++ b/reposerver/repository/repository.go 16 | @@ -2476,6 +2476,11 @@ func (s *Service) TestRepository(ctx context.Context, q *apiclient.TestRepositor 17 | } 18 | check := checks[repo.Type] 19 | apiResp := &apiclient.TestRepositoryResponse{VerifiedRepository: false} 20 | + 21 | + // Flux or OCI scheme are special cases 22 | + if strings.HasPrefix(repo.Repo, "flux://") || strings.HasPrefix(repo.Repo, "oci://") { 23 | + return apiResp, nil 24 | + } 25 | err := check() 26 | if err != nil { 27 | return apiResp, fmt.Errorf("error testing repository connectivity: %w", err) 28 | diff --git a/server/application/application.go b/server/application/application.go 29 | index 8ee16b934..83cef54ca 100644 30 | --- a/server/application/application.go 31 | +++ b/server/application/application.go 32 | @@ -2027,6 +2027,10 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 33 | // If it's already a commit SHA, then no need to look it up 34 | return ambiguousRevision, ambiguousRevision, nil 35 | } 36 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 37 | + // Flux or OCI scheme are special cases 38 | + return ambiguousRevision, ambiguousRevision, nil 39 | + } 40 | } 41 | 42 | resolveRevisionResponse, err := repoClient.ResolveRevision(ctx, &apiclient.ResolveRevisionRequest{ 43 | diff --git a/util/argo/argo.go b/util/argo/argo.go 44 | index 36e513cf0..ae3ceea5a 100644 45 | --- a/util/argo/argo.go 46 | +++ b/util/argo/argo.go 47 | @@ -291,6 +291,11 @@ func ValidateRepo( 48 | 49 | conditions := make([]argoappv1.ApplicationCondition, 0) 50 | 51 | + // Flux or OCI scheme are special cases 52 | + if strings.HasPrefix(spec.Source.RepoURL, "flux://") || strings.HasPrefix(spec.Source.RepoURL, "oci://") { 53 | + return conditions, nil 54 | + } 55 | + 56 | // Test the repo 57 | conn, repoClient, err := repoClientset.NewRepoServerClient() 58 | if err != nil { 59 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.6/03-allow-flux-and-oci-schemes.patch: -------------------------------------------------------------------------------- 1 | allow flux and oci schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | reposerver/repository/repository.go | 5 +++++ 8 | server/application/application.go | 4 ++++ 9 | util/argo/argo.go | 5 +++++ 10 | 3 files changed, 14 insertions(+) 11 | 12 | diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go 13 | index 4882fe7e0..dbd333fb8 100644 14 | --- a/reposerver/repository/repository.go 15 | +++ b/reposerver/repository/repository.go 16 | @@ -2437,6 +2437,11 @@ func (s *Service) TestRepository(ctx context.Context, q *apiclient.TestRepositor 17 | } 18 | check := checks[repo.Type] 19 | apiResp := &apiclient.TestRepositoryResponse{VerifiedRepository: false} 20 | + 21 | + // Flux or OCI scheme are special cases 22 | + if strings.HasPrefix(repo.Repo, "flux://") || strings.HasPrefix(repo.Repo, "oci://") { 23 | + return apiResp, nil 24 | + } 25 | err := check() 26 | if err != nil { 27 | return apiResp, fmt.Errorf("error testing repository connectivity: %w", err) 28 | diff --git a/server/application/application.go b/server/application/application.go 29 | index 1ae8412fc..8c8113e81 100644 30 | --- a/server/application/application.go 31 | +++ b/server/application/application.go 32 | @@ -1857,6 +1857,10 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 33 | // If it's already a commit SHA, then no need to look it up 34 | return ambiguousRevision, ambiguousRevision, nil 35 | } 36 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 37 | + // Flux or OCI scheme are special cases 38 | + return ambiguousRevision, ambiguousRevision, nil 39 | + } 40 | } 41 | 42 | resolveRevisionResponse, err := repoClient.ResolveRevision(ctx, &apiclient.ResolveRevisionRequest{ 43 | diff --git a/util/argo/argo.go b/util/argo/argo.go 44 | index e8384bcf7..388ce92c4 100644 45 | --- a/util/argo/argo.go 46 | +++ b/util/argo/argo.go 47 | @@ -190,6 +190,11 @@ func ValidateRepo( 48 | 49 | conditions := make([]argoappv1.ApplicationCondition, 0) 50 | 51 | + // Flux or OCI scheme are special cases 52 | + if strings.HasPrefix(spec.Source.RepoURL, "flux://") || strings.HasPrefix(spec.Source.RepoURL, "oci://") { 53 | + return conditions, nil 54 | + } 55 | + 56 | // Test the repo 57 | conn, repoClient, err := repoClientset.NewRepoServerClient() 58 | if err != nil { 59 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.7/03-allow-flux-and-oci-schemes.patch: -------------------------------------------------------------------------------- 1 | allow flux and oci schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | reposerver/repository/repository.go | 5 +++++ 8 | server/application/application.go | 4 ++++ 9 | util/argo/argo.go | 5 +++++ 10 | 3 files changed, 14 insertions(+) 11 | 12 | diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go 13 | index 3520250b2..7c520312f 100644 14 | --- a/reposerver/repository/repository.go 15 | +++ b/reposerver/repository/repository.go 16 | @@ -2460,6 +2460,11 @@ func (s *Service) TestRepository(ctx context.Context, q *apiclient.TestRepositor 17 | } 18 | check := checks[repo.Type] 19 | apiResp := &apiclient.TestRepositoryResponse{VerifiedRepository: false} 20 | + 21 | + // Flux or OCI scheme are special cases 22 | + if strings.HasPrefix(repo.Repo, "flux://") || strings.HasPrefix(repo.Repo, "oci://") { 23 | + return apiResp, nil 24 | + } 25 | err := check() 26 | if err != nil { 27 | return apiResp, fmt.Errorf("error testing repository connectivity: %w", err) 28 | diff --git a/server/application/application.go b/server/application/application.go 29 | index 67ceee171..ca6a5b426 100644 30 | --- a/server/application/application.go 31 | +++ b/server/application/application.go 32 | @@ -1929,6 +1929,10 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 33 | // If it's already a commit SHA, then no need to look it up 34 | return ambiguousRevision, ambiguousRevision, nil 35 | } 36 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 37 | + // Flux or OCI scheme are special cases 38 | + return ambiguousRevision, ambiguousRevision, nil 39 | + } 40 | } 41 | 42 | resolveRevisionResponse, err := repoClient.ResolveRevision(ctx, &apiclient.ResolveRevisionRequest{ 43 | diff --git a/util/argo/argo.go b/util/argo/argo.go 44 | index 14ba89b5b..1b9655a12 100644 45 | --- a/util/argo/argo.go 46 | +++ b/util/argo/argo.go 47 | @@ -286,6 +286,11 @@ func ValidateRepo( 48 | 49 | conditions := make([]argoappv1.ApplicationCondition, 0) 50 | 51 | + // Flux or OCI scheme are special cases 52 | + if strings.HasPrefix(spec.Source.RepoURL, "flux://") || strings.HasPrefix(spec.Source.RepoURL, "oci://") { 53 | + return conditions, nil 54 | + } 55 | + 56 | // Test the repo 57 | conn, repoClient, err := repoClientset.NewRepoServerClient() 58 | if err != nil { 59 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/03-allow-flux-and-oci-schemes.patch: -------------------------------------------------------------------------------- 1 | allow flux and oci schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | reposerver/repository/repository.go | 5 +++++ 8 | server/application/application.go | 4 ++++ 9 | util/argo/argo.go | 5 +++++ 10 | 3 files changed, 14 insertions(+) 11 | 12 | diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go 13 | index 02fb6a20d..aceb2ad6a 100644 14 | --- a/reposerver/repository/repository.go 15 | +++ b/reposerver/repository/repository.go 16 | @@ -2429,6 +2429,11 @@ func (s *Service) TestRepository(ctx context.Context, q *apiclient.TestRepositor 17 | } 18 | check := checks[repo.Type] 19 | apiResp := &apiclient.TestRepositoryResponse{VerifiedRepository: false} 20 | + 21 | + // Flux or OCI scheme are special cases 22 | + if strings.HasPrefix(repo.Repo, "flux://") || strings.HasPrefix(repo.Repo, "oci://") { 23 | + return apiResp, nil 24 | + } 25 | err := check() 26 | if err != nil { 27 | return apiResp, fmt.Errorf("error testing repository connectivity: %w", err) 28 | diff --git a/server/application/application.go b/server/application/application.go 29 | index a0323cde5..534d1aa47 100644 30 | --- a/server/application/application.go 31 | +++ b/server/application/application.go 32 | @@ -2010,6 +2010,10 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 33 | // If it's already a commit SHA, then no need to look it up 34 | return ambiguousRevision, ambiguousRevision, nil 35 | } 36 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 37 | + // Flux or OCI scheme are special cases 38 | + return ambiguousRevision, ambiguousRevision, nil 39 | + } 40 | } 41 | 42 | resolveRevisionResponse, err := repoClient.ResolveRevision(ctx, &apiclient.ResolveRevisionRequest{ 43 | diff --git a/util/argo/argo.go b/util/argo/argo.go 44 | index b32369ea7..f9ddd99d5 100644 45 | --- a/util/argo/argo.go 46 | +++ b/util/argo/argo.go 47 | @@ -287,6 +287,11 @@ func ValidateRepo( 48 | 49 | conditions := make([]argoappv1.ApplicationCondition, 0) 50 | 51 | + // Flux or OCI scheme are special cases 52 | + if strings.HasPrefix(spec.Source.RepoURL, "flux://") || strings.HasPrefix(spec.Source.RepoURL, "oci://") { 53 | + return conditions, nil 54 | + } 55 | + 56 | // Test the repo 57 | conn, repoClient, err := repoClientset.NewRepoServerClient() 58 | if err != nil { 59 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/03-allow-flux-and-oci-schemes.patch: -------------------------------------------------------------------------------- 1 | allow flux and oci schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | reposerver/repository/repository.go | 5 +++++ 8 | server/application/application.go | 4 ++++ 9 | util/argo/argo.go | 5 +++++ 10 | 3 files changed, 14 insertions(+) 11 | 12 | diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go 13 | index bff2983a1..2d910a5d6 100644 14 | --- a/reposerver/repository/repository.go 15 | +++ b/reposerver/repository/repository.go 16 | @@ -2465,6 +2465,11 @@ func (s *Service) TestRepository(ctx context.Context, q *apiclient.TestRepositor 17 | } 18 | check := checks[repo.Type] 19 | apiResp := &apiclient.TestRepositoryResponse{VerifiedRepository: false} 20 | + 21 | + // Flux or OCI scheme are special cases 22 | + if strings.HasPrefix(repo.Repo, "flux://") || strings.HasPrefix(repo.Repo, "oci://") { 23 | + return apiResp, nil 24 | + } 25 | err := check() 26 | if err != nil { 27 | return apiResp, fmt.Errorf("error testing repository connectivity: %w", err) 28 | diff --git a/server/application/application.go b/server/application/application.go 29 | index 12484685e..aa6993cb0 100644 30 | --- a/server/application/application.go 31 | +++ b/server/application/application.go 32 | @@ -2019,6 +2019,10 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 33 | // If it's already a commit SHA, then no need to look it up 34 | return ambiguousRevision, ambiguousRevision, nil 35 | } 36 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 37 | + // Flux or OCI scheme are special cases 38 | + return ambiguousRevision, ambiguousRevision, nil 39 | + } 40 | } 41 | 42 | resolveRevisionResponse, err := repoClient.ResolveRevision(ctx, &apiclient.ResolveRevisionRequest{ 43 | diff --git a/util/argo/argo.go b/util/argo/argo.go 44 | index 36e513cf0..ae3ceea5a 100644 45 | --- a/util/argo/argo.go 46 | +++ b/util/argo/argo.go 47 | @@ -291,6 +291,11 @@ func ValidateRepo( 48 | 49 | conditions := make([]argoappv1.ApplicationCondition, 0) 50 | 51 | + // Flux or OCI scheme are special cases 52 | + if strings.HasPrefix(spec.Source.RepoURL, "flux://") || strings.HasPrefix(spec.Source.RepoURL, "oci://") { 53 | + return conditions, nil 54 | + } 55 | + 56 | // Test the repo 57 | conn, repoClient, err := repoClientset.NewRepoServerClient() 58 | if err != nil { 59 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.2/03-allow-flux-and-oci-schemes.patch: -------------------------------------------------------------------------------- 1 | allow flux and oci schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | reposerver/repository/repository.go | 5 +++++ 8 | server/application/application.go | 4 ++++ 9 | util/argo/argo.go | 5 +++++ 10 | 3 files changed, 14 insertions(+) 11 | 12 | diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go 13 | index 98549cacd..3d16e7169 100644 14 | --- a/reposerver/repository/repository.go 15 | +++ b/reposerver/repository/repository.go 16 | @@ -1781,6 +1781,11 @@ func (s *Service) TestRepository(ctx context.Context, q *apiclient.TestRepositor 17 | } 18 | check := checks[repo.Type] 19 | apiResp := &apiclient.TestRepositoryResponse{VerifiedRepository: false} 20 | + 21 | + // Flux or OCI scheme are special cases 22 | + if strings.HasPrefix(repo.Repo, "flux://") || strings.HasPrefix(repo.Repo, "oci://") { 23 | + return apiResp, nil 24 | + } 25 | err := check() 26 | if err != nil { 27 | return apiResp, fmt.Errorf("error testing repository connectivity: %w", err) 28 | diff --git a/server/application/application.go b/server/application/application.go 29 | index e480851cf..41bdbb96c 100644 30 | --- a/server/application/application.go 31 | +++ b/server/application/application.go 32 | @@ -1560,6 +1560,10 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 33 | // If it's already a commit SHA, then no need to look it up 34 | return ambiguousRevision, ambiguousRevision, nil 35 | } 36 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 37 | + // Flux or OCI scheme are special cases 38 | + return ambiguousRevision, ambiguousRevision, nil 39 | + } 40 | repo, err := s.db.GetRepository(ctx, app.Spec.Source.RepoURL) 41 | if err != nil { 42 | return "", "", err 43 | diff --git a/util/argo/argo.go b/util/argo/argo.go 44 | index 40d33a078..461ffd935 100644 45 | --- a/util/argo/argo.go 46 | +++ b/util/argo/argo.go 47 | @@ -188,6 +188,11 @@ func ValidateRepo( 48 | spec := &app.Spec 49 | conditions := make([]argoappv1.ApplicationCondition, 0) 50 | 51 | + // Flux or OCI scheme are special cases 52 | + if strings.HasPrefix(spec.Source.RepoURL, "flux://") || strings.HasPrefix(spec.Source.RepoURL, "oci://") { 53 | + return conditions, nil 54 | + } 55 | + 56 | // Test the repo 57 | conn, repoClient, err := repoClientset.NewRepoServerClient() 58 | if err != nil { 59 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.3/03-allow-flux-and-oci-schemes.patch: -------------------------------------------------------------------------------- 1 | allow flux and oci schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | reposerver/repository/repository.go | 5 +++++ 8 | server/application/application.go | 4 ++++ 9 | util/argo/argo.go | 5 +++++ 10 | 3 files changed, 14 insertions(+) 11 | 12 | diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go 13 | index b435ae501..c2064bf9a 100644 14 | --- a/reposerver/repository/repository.go 15 | +++ b/reposerver/repository/repository.go 16 | @@ -1895,6 +1895,11 @@ func (s *Service) TestRepository(ctx context.Context, q *apiclient.TestRepositor 17 | } 18 | check := checks[repo.Type] 19 | apiResp := &apiclient.TestRepositoryResponse{VerifiedRepository: false} 20 | + 21 | + // Flux or OCI scheme are special cases 22 | + if strings.HasPrefix(repo.Repo, "flux://") || strings.HasPrefix(repo.Repo, "oci://") { 23 | + return apiResp, nil 24 | + } 25 | err := check() 26 | if err != nil { 27 | return apiResp, fmt.Errorf("error testing repository connectivity: %w", err) 28 | diff --git a/server/application/application.go b/server/application/application.go 29 | index 1b64dfb4d..5932ee0f0 100644 30 | --- a/server/application/application.go 31 | +++ b/server/application/application.go 32 | @@ -1557,6 +1557,10 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 33 | // If it's already a commit SHA, then no need to look it up 34 | return ambiguousRevision, ambiguousRevision, nil 35 | } 36 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 37 | + // Flux or OCI scheme are special cases 38 | + return ambiguousRevision, ambiguousRevision, nil 39 | + } 40 | } 41 | 42 | resolveRevisionResponse, err := repoClient.ResolveRevision(ctx, &apiclient.ResolveRevisionRequest{ 43 | diff --git a/util/argo/argo.go b/util/argo/argo.go 44 | index a84dc04a8..148f4eab2 100644 45 | --- a/util/argo/argo.go 46 | +++ b/util/argo/argo.go 47 | @@ -188,6 +188,11 @@ func ValidateRepo( 48 | spec := &app.Spec 49 | conditions := make([]argoappv1.ApplicationCondition, 0) 50 | 51 | + // Flux or OCI scheme are special cases 52 | + if strings.HasPrefix(spec.Source.RepoURL, "flux://") || strings.HasPrefix(spec.Source.RepoURL, "oci://") { 53 | + return conditions, nil 54 | + } 55 | + 56 | // Test the repo 57 | conn, repoClient, err := repoClientset.NewRepoServerClient() 58 | if err != nil { 59 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.4/03-allow-flux-and-oci-schemes.patch: -------------------------------------------------------------------------------- 1 | allow flux and oci schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | reposerver/repository/repository.go | 5 +++++ 8 | server/application/application.go | 4 ++++ 9 | util/argo/argo.go | 5 +++++ 10 | 3 files changed, 14 insertions(+) 11 | 12 | diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go 13 | index 2ebd2ef8e..468a14dc1 100644 14 | --- a/reposerver/repository/repository.go 15 | +++ b/reposerver/repository/repository.go 16 | @@ -1945,6 +1945,11 @@ func (s *Service) TestRepository(ctx context.Context, q *apiclient.TestRepositor 17 | } 18 | check := checks[repo.Type] 19 | apiResp := &apiclient.TestRepositoryResponse{VerifiedRepository: false} 20 | + 21 | + // Flux or OCI scheme are special cases 22 | + if strings.HasPrefix(repo.Repo, "flux://") || strings.HasPrefix(repo.Repo, "oci://") { 23 | + return apiResp, nil 24 | + } 25 | err := check() 26 | if err != nil { 27 | return apiResp, fmt.Errorf("error testing repository connectivity: %w", err) 28 | diff --git a/server/application/application.go b/server/application/application.go 29 | index 4595af577..915ac4e20 100644 30 | --- a/server/application/application.go 31 | +++ b/server/application/application.go 32 | @@ -1618,6 +1618,10 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 33 | // If it's already a commit SHA, then no need to look it up 34 | return ambiguousRevision, ambiguousRevision, nil 35 | } 36 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 37 | + // Flux or OCI scheme are special cases 38 | + return ambiguousRevision, ambiguousRevision, nil 39 | + } 40 | } 41 | 42 | resolveRevisionResponse, err := repoClient.ResolveRevision(ctx, &apiclient.ResolveRevisionRequest{ 43 | diff --git a/util/argo/argo.go b/util/argo/argo.go 44 | index d76fb34f8..8cc253cd4 100644 45 | --- a/util/argo/argo.go 46 | +++ b/util/argo/argo.go 47 | @@ -153,6 +153,11 @@ func ValidateRepo( 48 | spec := &app.Spec 49 | conditions := make([]argoappv1.ApplicationCondition, 0) 50 | 51 | + // Flux or OCI scheme are special cases 52 | + if strings.HasPrefix(spec.Source.RepoURL, "flux://") || strings.HasPrefix(spec.Source.RepoURL, "oci://") { 53 | + return conditions, nil 54 | + } 55 | + 56 | // Test the repo 57 | conn, repoClient, err := repoClientset.NewRepoServerClient() 58 | if err != nil { 59 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.5/03-allow-flux-and-oci-schemes.patch: -------------------------------------------------------------------------------- 1 | allow flux and oci schemes 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | reposerver/repository/repository.go | 5 +++++ 8 | server/application/application.go | 4 ++++ 9 | util/argo/argo.go | 5 +++++ 10 | 3 files changed, 14 insertions(+) 11 | 12 | diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go 13 | index 8b31f660f..001f7e301 100644 14 | --- a/reposerver/repository/repository.go 15 | +++ b/reposerver/repository/repository.go 16 | @@ -2084,6 +2084,11 @@ func (s *Service) TestRepository(ctx context.Context, q *apiclient.TestRepositor 17 | } 18 | check := checks[repo.Type] 19 | apiResp := &apiclient.TestRepositoryResponse{VerifiedRepository: false} 20 | + 21 | + // Flux or OCI scheme are special cases 22 | + if strings.HasPrefix(repo.Repo, "flux://") || strings.HasPrefix(repo.Repo, "oci://") { 23 | + return apiResp, nil 24 | + } 25 | err := check() 26 | if err != nil { 27 | return apiResp, fmt.Errorf("error testing repository connectivity: %w", err) 28 | diff --git a/server/application/application.go b/server/application/application.go 29 | index 4202e27d8..744d3c920 100644 30 | --- a/server/application/application.go 31 | +++ b/server/application/application.go 32 | @@ -1918,6 +1918,10 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy 33 | // If it's already a commit SHA, then no need to look it up 34 | return ambiguousRevision, ambiguousRevision, nil 35 | } 36 | + if strings.HasPrefix(app.Spec.Source.RepoURL, "flux://") || strings.HasPrefix(app.Spec.Source.RepoURL, "oci://") { 37 | + // Flux or OCI scheme are special cases 38 | + return ambiguousRevision, ambiguousRevision, nil 39 | + } 40 | } 41 | 42 | resolveRevisionResponse, err := repoClient.ResolveRevision(ctx, &apiclient.ResolveRevisionRequest{ 43 | diff --git a/util/argo/argo.go b/util/argo/argo.go 44 | index 1c5a2c204..ed613e80b 100644 45 | --- a/util/argo/argo.go 46 | +++ b/util/argo/argo.go 47 | @@ -189,6 +189,11 @@ func ValidateRepo( 48 | spec := &app.Spec 49 | conditions := make([]argoappv1.ApplicationCondition, 0) 50 | 51 | + // Flux or OCI scheme are special cases 52 | + if strings.HasPrefix(spec.Source.RepoURL, "flux://") || strings.HasPrefix(spec.Source.RepoURL, "oci://") { 53 | + return conditions, nil 54 | + } 55 | + 56 | // Test the repo 57 | conn, repoClient, err := repoClientset.NewRepoServerClient() 58 | if err != nil { 59 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.2/01-build-with-local-gitops-engine.patch: -------------------------------------------------------------------------------- 1 | build with local gitops engine 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .gitignore | 4 +++- 8 | Dockerfile | 11 ++++++++++- 9 | go.mod | 2 ++ 10 | 3 files changed, 15 insertions(+), 2 deletions(-) 11 | 12 | diff --git a/.gitignore b/.gitignore 13 | index b639ffa2c..3201ac6c9 100644 14 | --- a/.gitignore 15 | +++ b/.gitignore 16 | @@ -21,4 +21,6 @@ node_modules/ 17 | cmd/argocd/argocd 18 | cmd/argocd-application-controller/argocd-application-controller 19 | cmd/argocd-repo-server/argocd-repo-server 20 | -cmd/argocd-server/argocd-server 21 | \ No newline at end of file 22 | +cmd/argocd-server/argocd-server 23 | + 24 | +gitops-engine/ 25 | diff --git a/Dockerfile b/Dockerfile 26 | index d13580fc1..88aa35188 100644 27 | --- a/Dockerfile 28 | +++ b/Dockerfile 29 | @@ -68,7 +68,7 @@ RUN ln -s /usr/local/bin/entrypoint.sh /usr/local/bin/uid_entrypoint.sh 30 | # support for mounting configuration from a configmap 31 | RUN mkdir -p /app/config/ssh && \ 32 | touch /app/config/ssh/ssh_known_hosts && \ 33 | - ln -s /app/config/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts 34 | + ln -s /app/config/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts 35 | 36 | RUN mkdir -p /app/config/tls 37 | RUN mkdir -p /app/config/gpg/source && \ 38 | @@ -105,6 +105,8 @@ FROM docker.io/library/golang:1.16.11 as argocd-build 39 | 40 | WORKDIR /go/src/github.com/argoproj/argo-cd 41 | 42 | +COPY ./gitops-engine ./gitops-engine 43 | + 44 | COPY go.mod go.mod 45 | COPY go.sum go.sum 46 | 47 | @@ -125,9 +127,16 @@ RUN if [ "$BUILD_ALL_CLIS" = "true" ] ; then \ 48 | # Final image 49 | #################################################################################################### 50 | FROM argocd-base 51 | + 52 | +LABEL org.opencontainers.image.source https://github.com/flux-subsystem-argo/fsa 53 | + 54 | COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/local/bin/ 55 | 56 | USER root 57 | +RUN chmod +x /usr/local/bin/git-ask-pass.sh 58 | +RUN chmod +x /usr/local/bin/gpg-wrapper.sh 59 | +RUN chmod +x /usr/local/bin/git-verify-wrapper.sh 60 | + 61 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server 62 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server 63 | RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server 64 | diff --git a/go.mod b/go.mod 65 | index 8e9c73ff3..e640e61fe 100644 66 | --- a/go.mod 67 | +++ b/go.mod 68 | @@ -123,4 +123,6 @@ replace ( 69 | k8s.io/mount-utils => k8s.io/mount-utils v0.22.2 70 | k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.22.2 71 | k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.22.2 72 | + 73 | + github.com/argoproj/gitops-engine v0.5.5 => ./gitops-engine 74 | ) 75 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/12-add-open-in-weave-gitops.patch: -------------------------------------------------------------------------------- 1 | add open in weave gitops 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | ui/src/app/applications/components/utils.tsx | 45 ++++++++++++++++++++++++++ 8 | 1 file changed, 45 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 11 | index 4c0135927..1e4a60ef5 100644 12 | --- a/ui/src/app/applications/components/utils.tsx 13 | +++ b/ui/src/app/applications/components/utils.tsx 14 | @@ -424,6 +424,28 @@ function getResourceActionsMenuItems(resource: ResourceTreeNode, metadata: model 15 | .catch(() => [] as MenuItem[]); 16 | } 17 | 18 | +function getWeaveGitOpsKindPath(resourceKind: string): string { 19 | + switch(resourceKind) { 20 | + case "GitRepository": 21 | + return "git_repo" 22 | + case "Bucket": 23 | + return "bucket" 24 | + case "OCIRepository": 25 | + return "oci" 26 | + case "HelmChart": 27 | + return "helm_chart" 28 | + case "Kustomization": 29 | + return "kustomization" 30 | + case "HelmRelease": 31 | + return "helm_release" 32 | + case "Terraform": 33 | + return "terraform_object" 34 | + } 35 | + 36 | + // not match return the same string 37 | + return "not_implemented" 38 | +} 39 | + 40 | function getActionItems( 41 | resource: ResourceTreeNode, 42 | application: appModels.Application, 43 | @@ -467,6 +489,29 @@ function getActionItems( 44 | }); 45 | } 46 | 47 | + // CK: Open in Weave GitOps 48 | + if (resource.kind === 'GitRepository' || 49 | + resource.kind === 'Bucket' || 50 | + resource.kind === 'OCIRepository' || 51 | + resource.kind === 'Kustomization' || 52 | + resource.kind === 'HelmRelease' || 53 | + resource.kind === 'Terraform') { 54 | + // CK: parameterize 1. the base url, 2. the clusterName, 3. kind, 4. name and namespace 55 | + let baseUrl = "http://localhost:9001" 56 | + let clusterName = "Default" 57 | + if(application.metadata.annotations !== undefined) { 58 | + baseUrl = application.metadata.annotations["weave.gitops.flamingo/base-url"] 59 | + clusterName = application.metadata.annotations["weave.gitops.flamingo/cluster-name"] 60 | + } 61 | + let kind = getWeaveGitOpsKindPath(resource.kind) 62 | + let url = `${baseUrl}/${kind}/details?clusterName=${clusterName}&name=${resource.name}&namespace=${resource.namespace}` 63 | + items.unshift({ 64 | + title: 'Open in Weave GitOps ...', 65 | + iconClassName: 'fa fa-info-circle', 66 | + action: () => window.open(url, '_blank') 67 | + }); 68 | + } 69 | + 70 | if (isQuickStart) { 71 | return from([items]); 72 | } 73 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.6/13-add-open-in-weave-gitops.patch: -------------------------------------------------------------------------------- 1 | add open in weave gitops 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | ui/src/app/applications/components/utils.tsx | 45 ++++++++++++++++++++++++++ 8 | 1 file changed, 45 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 11 | index dc5f03c65..f76f48542 100644 12 | --- a/ui/src/app/applications/components/utils.tsx 13 | +++ b/ui/src/app/applications/components/utils.tsx 14 | @@ -428,6 +428,28 @@ function getResourceActionsMenuItems(resource: ResourceTreeNode, metadata: model 15 | .catch(() => [] as MenuItem[]); 16 | } 17 | 18 | +function getWeaveGitOpsKindPath(resourceKind: string): string { 19 | + switch(resourceKind) { 20 | + case "GitRepository": 21 | + return "git_repo" 22 | + case "Bucket": 23 | + return "bucket" 24 | + case "OCIRepository": 25 | + return "oci" 26 | + case "HelmChart": 27 | + return "helm_chart" 28 | + case "Kustomization": 29 | + return "kustomization" 30 | + case "HelmRelease": 31 | + return "helm_release" 32 | + case "Terraform": 33 | + return "terraform_object" 34 | + } 35 | + 36 | + // not match return the same string 37 | + return "not_implemented" 38 | +} 39 | + 40 | function getActionItems( 41 | resource: ResourceTreeNode, 42 | application: appModels.Application, 43 | @@ -471,6 +493,29 @@ function getActionItems( 44 | }); 45 | } 46 | 47 | + // CK: Open in Weave GitOps 48 | + if (resource.kind === 'GitRepository' || 49 | + resource.kind === 'Bucket' || 50 | + resource.kind === 'OCIRepository' || 51 | + resource.kind === 'Kustomization' || 52 | + resource.kind === 'HelmRelease' || 53 | + resource.kind === 'Terraform') { 54 | + // CK: parameterize 1. the base url, 2. the clusterName, 3. kind, 4. name and namespace 55 | + let baseUrl = "http://localhost:9001" 56 | + let clusterName = "Default" 57 | + if(application.metadata.annotations !== undefined) { 58 | + baseUrl = application.metadata.annotations["weave.gitops.flamingo/base-url"] 59 | + clusterName = application.metadata.annotations["weave.gitops.flamingo/cluster-name"] 60 | + } 61 | + let kind = getWeaveGitOpsKindPath(resource.kind) 62 | + let url = `${baseUrl}/${kind}/details?clusterName=${clusterName}&name=${resource.name}&namespace=${resource.namespace}` 63 | + items.unshift({ 64 | + title: 'Open in Weave GitOps ...', 65 | + iconClassName: 'fa fa-info-circle', 66 | + action: () => window.open(url, '_blank') 67 | + }); 68 | + } 69 | + 70 | if (isQuickStart) { 71 | return from([items]); 72 | } 73 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.7/12-add-open-in-weave-gitops.patch: -------------------------------------------------------------------------------- 1 | add open in weave gitops 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | ui/src/app/applications/components/utils.tsx | 45 ++++++++++++++++++++++++++ 8 | 1 file changed, 45 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 11 | index 62f5633b7..c19533d8a 100644 12 | --- a/ui/src/app/applications/components/utils.tsx 13 | +++ b/ui/src/app/applications/components/utils.tsx 14 | @@ -423,6 +423,28 @@ function getResourceActionsMenuItems(resource: ResourceTreeNode, metadata: model 15 | .catch(() => [] as MenuItem[]); 16 | } 17 | 18 | +function getWeaveGitOpsKindPath(resourceKind: string): string { 19 | + switch(resourceKind) { 20 | + case "GitRepository": 21 | + return "git_repo" 22 | + case "Bucket": 23 | + return "bucket" 24 | + case "OCIRepository": 25 | + return "oci" 26 | + case "HelmChart": 27 | + return "helm_chart" 28 | + case "Kustomization": 29 | + return "kustomization" 30 | + case "HelmRelease": 31 | + return "helm_release" 32 | + case "Terraform": 33 | + return "terraform_object" 34 | + } 35 | + 36 | + // not match return the same string 37 | + return "not_implemented" 38 | +} 39 | + 40 | function getActionItems( 41 | resource: ResourceTreeNode, 42 | application: appModels.Application, 43 | @@ -466,6 +488,29 @@ function getActionItems( 44 | }); 45 | } 46 | 47 | + // CK: Open in Weave GitOps 48 | + if (resource.kind === 'GitRepository' || 49 | + resource.kind === 'Bucket' || 50 | + resource.kind === 'OCIRepository' || 51 | + resource.kind === 'Kustomization' || 52 | + resource.kind === 'HelmRelease' || 53 | + resource.kind === 'Terraform') { 54 | + // CK: parameterize 1. the base url, 2. the clusterName, 3. kind, 4. name and namespace 55 | + let baseUrl = "http://localhost:9001" 56 | + let clusterName = "Default" 57 | + if(application.metadata.annotations !== undefined) { 58 | + baseUrl = application.metadata.annotations["weave.gitops.flamingo/base-url"] 59 | + clusterName = application.metadata.annotations["weave.gitops.flamingo/cluster-name"] 60 | + } 61 | + let kind = getWeaveGitOpsKindPath(resource.kind) 62 | + let url = `${baseUrl}/${kind}/details?clusterName=${clusterName}&name=${resource.name}&namespace=${resource.namespace}` 63 | + items.unshift({ 64 | + title: 'Open in Weave GitOps ...', 65 | + iconClassName: 'fa fa-info-circle', 66 | + action: () => window.open(url, '_blank') 67 | + }); 68 | + } 69 | + 70 | if (isQuickStart) { 71 | return from([items]); 72 | } 73 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/12-add-open-in-weave-gitops.patch: -------------------------------------------------------------------------------- 1 | add open in weave gitops 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | ui/src/app/applications/components/utils.tsx | 45 ++++++++++++++++++++++++++ 8 | 1 file changed, 45 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 11 | index 14385989d..88904f6fc 100644 12 | --- a/ui/src/app/applications/components/utils.tsx 13 | +++ b/ui/src/app/applications/components/utils.tsx 14 | @@ -424,6 +424,28 @@ function getResourceActionsMenuItems(resource: ResourceTreeNode, metadata: model 15 | .catch(() => [] as MenuItem[]); 16 | } 17 | 18 | +function getWeaveGitOpsKindPath(resourceKind: string): string { 19 | + switch(resourceKind) { 20 | + case "GitRepository": 21 | + return "git_repo" 22 | + case "Bucket": 23 | + return "bucket" 24 | + case "OCIRepository": 25 | + return "oci" 26 | + case "HelmChart": 27 | + return "helm_chart" 28 | + case "Kustomization": 29 | + return "kustomization" 30 | + case "HelmRelease": 31 | + return "helm_release" 32 | + case "Terraform": 33 | + return "terraform_object" 34 | + } 35 | + 36 | + // not match return the same string 37 | + return "not_implemented" 38 | +} 39 | + 40 | function getActionItems( 41 | resource: ResourceTreeNode, 42 | application: appModels.Application, 43 | @@ -467,6 +489,29 @@ function getActionItems( 44 | }); 45 | } 46 | 47 | + // CK: Open in Weave GitOps 48 | + if (resource.kind === 'GitRepository' || 49 | + resource.kind === 'Bucket' || 50 | + resource.kind === 'OCIRepository' || 51 | + resource.kind === 'Kustomization' || 52 | + resource.kind === 'HelmRelease' || 53 | + resource.kind === 'Terraform') { 54 | + // CK: parameterize 1. the base url, 2. the clusterName, 3. kind, 4. name and namespace 55 | + let baseUrl = "http://localhost:9001" 56 | + let clusterName = "Default" 57 | + if(application.metadata.annotations !== undefined) { 58 | + baseUrl = application.metadata.annotations["weave.gitops.flamingo/base-url"] 59 | + clusterName = application.metadata.annotations["weave.gitops.flamingo/cluster-name"] 60 | + } 61 | + let kind = getWeaveGitOpsKindPath(resource.kind) 62 | + let url = `${baseUrl}/${kind}/details?clusterName=${clusterName}&name=${resource.name}&namespace=${resource.namespace}` 63 | + items.unshift({ 64 | + title: 'Open in Weave GitOps ...', 65 | + iconClassName: 'fa fa-info-circle', 66 | + action: () => window.open(url, '_blank') 67 | + }); 68 | + } 69 | + 70 | if (isQuickStart) { 71 | return from([items]); 72 | } 73 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/12-add-open-in-weave-gitops.patch: -------------------------------------------------------------------------------- 1 | add open in weave gitops 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | ui/src/app/applications/components/utils.tsx | 45 ++++++++++++++++++++++++++ 8 | 1 file changed, 45 insertions(+) 9 | 10 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 11 | index f0c7642d7..f91234ee1 100644 12 | --- a/ui/src/app/applications/components/utils.tsx 13 | +++ b/ui/src/app/applications/components/utils.tsx 14 | @@ -424,6 +424,28 @@ function getResourceActionsMenuItems(resource: ResourceTreeNode, metadata: model 15 | .catch(() => [] as MenuItem[]); 16 | } 17 | 18 | +function getWeaveGitOpsKindPath(resourceKind: string): string { 19 | + switch(resourceKind) { 20 | + case "GitRepository": 21 | + return "git_repo" 22 | + case "Bucket": 23 | + return "bucket" 24 | + case "OCIRepository": 25 | + return "oci" 26 | + case "HelmChart": 27 | + return "helm_chart" 28 | + case "Kustomization": 29 | + return "kustomization" 30 | + case "HelmRelease": 31 | + return "helm_release" 32 | + case "Terraform": 33 | + return "terraform_object" 34 | + } 35 | + 36 | + // not match return the same string 37 | + return "not_implemented" 38 | +} 39 | + 40 | function getActionItems( 41 | resource: ResourceTreeNode, 42 | application: appModels.Application, 43 | @@ -467,6 +489,29 @@ function getActionItems( 44 | }); 45 | } 46 | 47 | + // CK: Open in Weave GitOps 48 | + if (resource.kind === 'GitRepository' || 49 | + resource.kind === 'Bucket' || 50 | + resource.kind === 'OCIRepository' || 51 | + resource.kind === 'Kustomization' || 52 | + resource.kind === 'HelmRelease' || 53 | + resource.kind === 'Terraform') { 54 | + // CK: parameterize 1. the base url, 2. the clusterName, 3. kind, 4. name and namespace 55 | + let baseUrl = "http://localhost:9001" 56 | + let clusterName = "Default" 57 | + if(application.metadata.annotations !== undefined) { 58 | + baseUrl = application.metadata.annotations["weave.gitops.flamingo/base-url"] 59 | + clusterName = application.metadata.annotations["weave.gitops.flamingo/cluster-name"] 60 | + } 61 | + let kind = getWeaveGitOpsKindPath(resource.kind) 62 | + let url = `${baseUrl}/${kind}/details?clusterName=${clusterName}&name=${resource.name}&namespace=${resource.namespace}` 63 | + items.unshift({ 64 | + title: 'Open in Weave GitOps ...', 65 | + iconClassName: 'fa fa-info-circle', 66 | + action: () => window.open(url, '_blank') 67 | + }); 68 | + } 69 | + 70 | if (isQuickStart) { 71 | return from([items]); 72 | } 73 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.2/04-ui-fix-find-leaf-pod-bug.patch: -------------------------------------------------------------------------------- 1 | ui: fix find leaf pod bug 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../resource-details/resource-details.tsx | 4 +++- 8 | ui/src/app/applications/components/utils.tsx | 13 ++++++++++++- 9 | 2 files changed, 15 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/ui/src/app/applications/components/resource-details/resource-details.tsx b/ui/src/app/applications/components/resource-details/resource-details.tsx 12 | index 839151e01..592c9fe9c 100644 13 | --- a/ui/src/app/applications/components/resource-details/resource-details.tsx 14 | +++ b/ui/src/app/applications/components/resource-details/resource-details.tsx 15 | @@ -250,10 +250,12 @@ export const ResourceDetails = (props: ResourceDetailsProps) => { 16 | if (selectedNode.kind === 'Pod') { 17 | podState = liveState; 18 | } else { 19 | + podState = null; 20 | + /* 21 | const childPod = AppUtils.findChildPod(selectedNode, tree); 22 | if (childPod) { 23 | podState = await services.applications.getResource(application.metadata.name, childPod).catch(() => null); 24 | - } 25 | + }*/ 26 | } 27 | 28 | return {controlledState, liveState, events, podState}; 29 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 30 | index 8de75efa6..b542cad77 100644 31 | --- a/ui/src/app/applications/components/utils.tsx 32 | +++ b/ui/src/app/applications/components/utils.tsx 33 | @@ -342,7 +342,8 @@ export function renderResourceMenu( 34 | } 35 | } 36 | ]; 37 | - if (findChildPod(resource, tree)) { 38 | + // CK: findChildPod(resource, tree) is too expensive 39 | + if (resource.kind === "Pod") { 40 | items.push({ 41 | title: 'Logs', 42 | action: () => appContext.apis.navigation.goto('.', {node: nodeKey(resource), tab: 'logs'}, {replace: true}) 43 | @@ -645,6 +646,16 @@ export const OperationState = ({app, quiet}: {app: appModels.Application; quiet? 44 | ); 45 | }; 46 | 47 | +export function getKstatusCondition(conditionType: string, ks: appModels.State): {status: string; message: string; reason: string} { 48 | + for (const condition of ks.status.conditions) { 49 | + if (condition["type"] === conditionType) { 50 | + return {message: condition.message, reason: condition.reason, status: condition.status}; 51 | + } 52 | + } 53 | + 54 | + return undefined; 55 | +} 56 | + 57 | export function getPodStateReason(pod: appModels.State): {message: string; reason: string} { 58 | let reason = pod.status.phase; 59 | let message = ''; 60 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.3/04-ui-fix-find-leaf-pod-bug.patch: -------------------------------------------------------------------------------- 1 | ui: fix find leaf pod bug 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../resource-details/resource-details.tsx | 10 ++++++---- 8 | ui/src/app/applications/components/utils.tsx | 13 ++++++++++++- 9 | 2 files changed, 18 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/ui/src/app/applications/components/resource-details/resource-details.tsx b/ui/src/app/applications/components/resource-details/resource-details.tsx 12 | index 839151e01..569e00400 100644 13 | --- a/ui/src/app/applications/components/resource-details/resource-details.tsx 14 | +++ b/ui/src/app/applications/components/resource-details/resource-details.tsx 15 | @@ -250,10 +250,12 @@ export const ResourceDetails = (props: ResourceDetailsProps) => { 16 | if (selectedNode.kind === 'Pod') { 17 | podState = liveState; 18 | } else { 19 | - const childPod = AppUtils.findChildPod(selectedNode, tree); 20 | - if (childPod) { 21 | - podState = await services.applications.getResource(application.metadata.name, childPod).catch(() => null); 22 | - } 23 | + podState = null; 24 | + // CK: findChildPod is expensive, so we only call it when we need to 25 | + // const childPod = AppUtils.findChildPod(selectedNode, tree); 26 | + // if (childPod) { 27 | + // podState = await services.applications.getResource(application.metadata.name, childPod).catch(() => null); 28 | + // } 29 | } 30 | 31 | return {controlledState, liveState, events, podState}; 32 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 33 | index d6222c445..3705979d1 100644 34 | --- a/ui/src/app/applications/components/utils.tsx 35 | +++ b/ui/src/app/applications/components/utils.tsx 36 | @@ -347,7 +347,8 @@ function getActionItems( 37 | }); 38 | } 39 | 40 | - if (findChildPod(resource, tree)) { 41 | + // CK: findChildPod(resource, tree) is too expensive, so we only call it for Pod resources 42 | + if (resource.kind === 'Pod') { 43 | items.push({ 44 | title: 'Logs', 45 | iconClassName: 'fa fa-align-left', 46 | @@ -721,6 +722,16 @@ export const OperationState = ({app, quiet}: {app: appModels.Application; quiet? 47 | ); 48 | }; 49 | 50 | +export function getKstatusCondition(conditionType: string, ks: appModels.State): {status: string; message: string; reason: string} { 51 | + for (const condition of ks.status.conditions) { 52 | + if (condition["type"] === conditionType) { 53 | + return {message: condition.message, reason: condition.reason, status: condition.status}; 54 | + } 55 | + } 56 | + 57 | + return undefined; 58 | +} 59 | + 60 | export function getPodStateReason(pod: appModels.State): {message: string; reason: string} { 61 | let reason = pod.status.phase; 62 | let message = ''; 63 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.4/04-ui-fix-find-leaf-pod-bug.patch: -------------------------------------------------------------------------------- 1 | ui: fix find leaf pod bug 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../resource-details/resource-details.tsx | 10 ++++++---- 8 | ui/src/app/applications/components/utils.tsx | 13 ++++++++++++- 9 | 2 files changed, 18 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/ui/src/app/applications/components/resource-details/resource-details.tsx b/ui/src/app/applications/components/resource-details/resource-details.tsx 12 | index c3057b178..b26802fec 100644 13 | --- a/ui/src/app/applications/components/resource-details/resource-details.tsx 14 | +++ b/ui/src/app/applications/components/resource-details/resource-details.tsx 15 | @@ -262,10 +262,12 @@ export const ResourceDetails = (props: ResourceDetailsProps) => { 16 | if (selectedNode.kind === 'Pod') { 17 | podState = liveState; 18 | } else { 19 | - const childPod = AppUtils.findChildPod(selectedNode, tree); 20 | - if (childPod) { 21 | - podState = await services.applications.getResource(application.metadata.name, childPod).catch(() => null); 22 | - } 23 | + podState = null; 24 | + // CK: findChildPod is expensive, so we only call it when we need to 25 | + // const childPod = AppUtils.findChildPod(selectedNode, tree); 26 | + // if (childPod) { 27 | + // podState = await services.applications.getResource(application.metadata.name, childPod).catch(() => null); 28 | + // } 29 | } 30 | 31 | const settings = await services.authService.settings(); 32 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 33 | index 059df1ace..a3f3f6cc6 100644 34 | --- a/ui/src/app/applications/components/utils.tsx 35 | +++ b/ui/src/app/applications/components/utils.tsx 36 | @@ -347,7 +347,8 @@ function getActionItems( 37 | }); 38 | } 39 | 40 | - if (findChildPod(resource, tree)) { 41 | + // CK: findChildPod(resource, tree) is too expensive, so we only call it for Pod resources 42 | + if (resource.kind === 'Pod') { 43 | items.push({ 44 | title: 'Logs', 45 | iconClassName: 'fa fa-align-left', 46 | @@ -747,6 +748,16 @@ export const OperationState = ({app, quiet}: {app: appModels.Application; quiet? 47 | ); 48 | }; 49 | 50 | +export function getKstatusCondition(conditionType: string, ks: appModels.State): {status: string; message: string; reason: string} { 51 | + for (const condition of ks.status.conditions) { 52 | + if (condition["type"] === conditionType) { 53 | + return {message: condition.message, reason: condition.reason, status: condition.status}; 54 | + } 55 | + } 56 | + 57 | + return undefined; 58 | +} 59 | + 60 | export function getPodStateReason(pod: appModels.State): {message: string; reason: string} { 61 | let reason = pod.status.phase; 62 | let message = ''; 63 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.5/04-ui-fix-find-leaf-pod-bug.patch: -------------------------------------------------------------------------------- 1 | ui: fix find leaf pod bug 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../resource-details/resource-details.tsx | 10 ++++++---- 8 | ui/src/app/applications/components/utils.tsx | 13 ++++++++++++- 9 | 2 files changed, 18 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/ui/src/app/applications/components/resource-details/resource-details.tsx b/ui/src/app/applications/components/resource-details/resource-details.tsx 12 | index eb94298ff..794b0edd6 100644 13 | --- a/ui/src/app/applications/components/resource-details/resource-details.tsx 14 | +++ b/ui/src/app/applications/components/resource-details/resource-details.tsx 15 | @@ -275,10 +275,12 @@ export const ResourceDetails = (props: ResourceDetailsProps) => { 16 | if (selectedNode.kind === 'Pod') { 17 | podState = liveState; 18 | } else { 19 | - const childPod = AppUtils.findChildPod(selectedNode, tree); 20 | - if (childPod) { 21 | - podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 22 | - } 23 | + podState = null; 24 | + // CK: findChildPod is expensive, so we only call it when we need to 25 | + // const childPod = AppUtils.findChildPod(selectedNode, tree); 26 | + // if (childPod) { 27 | + // podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 28 | + // } 29 | } 30 | 31 | const settings = await services.authService.settings(); 32 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 33 | index 75bdf9cdd..280abe83f 100644 34 | --- a/ui/src/app/applications/components/utils.tsx 35 | +++ b/ui/src/app/applications/components/utils.tsx 36 | @@ -426,7 +426,8 @@ function getActionItems( 37 | }); 38 | } 39 | 40 | - if (findChildPod(resource, tree)) { 41 | + // CK: findChildPod(resource, tree) is too expensive, so we only call it for Pod resources 42 | + if (resource.kind === 'Pod') { 43 | items.push({ 44 | title: 'Logs', 45 | iconClassName: 'fa fa-align-left', 46 | @@ -826,6 +827,16 @@ export const OperationState = ({app, quiet}: {app: appModels.Application; quiet? 47 | ); 48 | }; 49 | 50 | +export function getKstatusCondition(conditionType: string, ks: appModels.State): {status: string; message: string; reason: string} { 51 | + for (const condition of ks.status.conditions) { 52 | + if (condition["type"] === conditionType) { 53 | + return {message: condition.message, reason: condition.reason, status: condition.status}; 54 | + } 55 | + } 56 | + 57 | + return undefined; 58 | +} 59 | + 60 | export function getPodStateReason(pod: appModels.State): {message: string; reason: string} { 61 | let reason = pod.status.phase; 62 | let message = ''; 63 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.6/04-ui-fix-find-leaf-pod-bug.patch: -------------------------------------------------------------------------------- 1 | ui: fix find leaf pod bug 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../resource-details/resource-details.tsx | 10 ++++++---- 8 | ui/src/app/applications/components/utils.tsx | 13 ++++++++++++- 9 | 2 files changed, 18 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/ui/src/app/applications/components/resource-details/resource-details.tsx b/ui/src/app/applications/components/resource-details/resource-details.tsx 12 | index 90a521f3a..9b4fe4b03 100644 13 | --- a/ui/src/app/applications/components/resource-details/resource-details.tsx 14 | +++ b/ui/src/app/applications/components/resource-details/resource-details.tsx 15 | @@ -276,10 +276,12 @@ export const ResourceDetails = (props: ResourceDetailsProps) => { 16 | if (selectedNode.kind === 'Pod') { 17 | podState = liveState; 18 | } else { 19 | - const childPod = AppUtils.findChildPod(selectedNode, tree); 20 | - if (childPod) { 21 | - podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 22 | - } 23 | + podState = null; 24 | + // CK: findChildPod is expensive, so we only call it when we need to 25 | + // const childPod = AppUtils.findChildPod(selectedNode, tree); 26 | + // if (childPod) { 27 | + // podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 28 | + // } 29 | } 30 | 31 | const settings = await services.authService.settings(); 32 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 33 | index 45c8aba56..dc5f03c65 100644 34 | --- a/ui/src/app/applications/components/utils.tsx 35 | +++ b/ui/src/app/applications/components/utils.tsx 36 | @@ -462,7 +462,8 @@ function getActionItems( 37 | }); 38 | } 39 | 40 | - if (findChildPod(resource, tree)) { 41 | + // CK: findChildPod(resource, tree) is too expensive, so we only call it for Pod resources 42 | + if (resource.kind === 'Pod') { 43 | items.push({ 44 | title: 'Logs', 45 | iconClassName: 'fa fa-align-left', 46 | @@ -891,6 +892,16 @@ export const OperationState = ({app, quiet}: {app: appModels.Application; quiet? 47 | ); 48 | }; 49 | 50 | +export function getKstatusCondition(conditionType: string, ks: appModels.State): {status: string; message: string; reason: string} { 51 | + for (const condition of ks.status.conditions) { 52 | + if (condition["type"] === conditionType) { 53 | + return {message: condition.message, reason: condition.reason, status: condition.status}; 54 | + } 55 | + } 56 | + 57 | + return undefined; 58 | +} 59 | + 60 | export function getPodStateReason(pod: appModels.State): {message: string; reason: string} { 61 | let reason = pod.status.phase; 62 | let message = ''; 63 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.7/04-ui-fix-find-leaf-pod-bug.patch: -------------------------------------------------------------------------------- 1 | ui: fix find leaf pod bug 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../resource-details/resource-details.tsx | 10 ++++++---- 8 | ui/src/app/applications/components/utils.tsx | 13 ++++++++++++- 9 | 2 files changed, 18 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/ui/src/app/applications/components/resource-details/resource-details.tsx b/ui/src/app/applications/components/resource-details/resource-details.tsx 12 | index 647750937..a440f3db1 100644 13 | --- a/ui/src/app/applications/components/resource-details/resource-details.tsx 14 | +++ b/ui/src/app/applications/components/resource-details/resource-details.tsx 15 | @@ -271,10 +271,12 @@ export const ResourceDetails = (props: ResourceDetailsProps) => { 16 | if (selectedNode.kind === 'Pod') { 17 | podState = liveState; 18 | } else { 19 | - const childPod = AppUtils.findChildPod(selectedNode, tree); 20 | - if (childPod) { 21 | - podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 22 | - } 23 | + podState = null; 24 | + // CK: findChildPod is expensive, so we only call it when we need to 25 | + // const childPod = AppUtils.findChildPod(selectedNode, tree); 26 | + // if (childPod) { 27 | + // podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 28 | + // } 29 | } 30 | 31 | const settings = await services.authService.settings(); 32 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 33 | index b30ddc87f..62f5633b7 100644 34 | --- a/ui/src/app/applications/components/utils.tsx 35 | +++ b/ui/src/app/applications/components/utils.tsx 36 | @@ -457,7 +457,8 @@ function getActionItems( 37 | }); 38 | } 39 | 40 | - if (findChildPod(resource, tree)) { 41 | + // CK: findChildPod(resource, tree) is too expensive, so we only call it for Pod resources 42 | + if (resource.kind === 'Pod') { 43 | items.push({ 44 | title: 'Logs', 45 | iconClassName: 'fa fa-align-left', 46 | @@ -872,6 +873,16 @@ export const OperationState = ({app, quiet}: {app: appModels.Application; quiet? 47 | ); 48 | }; 49 | 50 | +export function getKstatusCondition(conditionType: string, ks: appModels.State): {status: string; message: string; reason: string} { 51 | + for (const condition of ks.status.conditions) { 52 | + if (condition["type"] === conditionType) { 53 | + return {message: condition.message, reason: condition.reason, status: condition.status}; 54 | + } 55 | + } 56 | + 57 | + return undefined; 58 | +} 59 | + 60 | export function getPodStateReason(pod: appModels.State): {message: string; reason: string} { 61 | let reason = pod.status.phase; 62 | let message = ''; 63 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/04-ui-fix-find-leaf-pod-bug.patch: -------------------------------------------------------------------------------- 1 | ui: fix find leaf pod bug 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../resource-details/resource-details.tsx | 10 ++++++---- 8 | ui/src/app/applications/components/utils.tsx | 13 ++++++++++++- 9 | 2 files changed, 18 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/ui/src/app/applications/components/resource-details/resource-details.tsx b/ui/src/app/applications/components/resource-details/resource-details.tsx 12 | index 52d2fef18..7e4459666 100644 13 | --- a/ui/src/app/applications/components/resource-details/resource-details.tsx 14 | +++ b/ui/src/app/applications/components/resource-details/resource-details.tsx 15 | @@ -271,10 +271,12 @@ export const ResourceDetails = (props: ResourceDetailsProps) => { 16 | if (selectedNode.kind === 'Pod') { 17 | podState = liveState; 18 | } else { 19 | - const childPod = AppUtils.findChildPod(selectedNode, tree); 20 | - if (childPod) { 21 | - podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 22 | - } 23 | + podState = null; 24 | + // CK: findChildPod is expensive, so we only call it when we need to 25 | + // const childPod = AppUtils.findChildPod(selectedNode, tree); 26 | + // if (childPod) { 27 | + // podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 28 | + // } 29 | } 30 | 31 | const settings = await services.authService.settings(); 32 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 33 | index cd39470bf..4c0135927 100644 34 | --- a/ui/src/app/applications/components/utils.tsx 35 | +++ b/ui/src/app/applications/components/utils.tsx 36 | @@ -458,7 +458,8 @@ function getActionItems( 37 | }); 38 | } 39 | 40 | - if (findChildPod(resource, tree)) { 41 | + // CK: findChildPod(resource, tree) is too expensive, so we only call it for Pod resources 42 | + if (resource.kind === 'Pod') { 43 | items.push({ 44 | title: 'Logs', 45 | iconClassName: 'fa fa-fw fa-align-left', 46 | @@ -873,6 +874,16 @@ export const OperationState = ({app, quiet}: {app: appModels.Application; quiet? 47 | ); 48 | }; 49 | 50 | +export function getKstatusCondition(conditionType: string, ks: appModels.State): {status: string; message: string; reason: string} { 51 | + for (const condition of ks.status.conditions) { 52 | + if (condition["type"] === conditionType) { 53 | + return {message: condition.message, reason: condition.reason, status: condition.status}; 54 | + } 55 | + } 56 | + 57 | + return undefined; 58 | +} 59 | + 60 | export function getPodStateReason(pod: appModels.State): {message: string; reason: string; netContainerStatuses: any[]} { 61 | let reason = pod.status.phase; 62 | let message = ''; 63 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/04-ui-fix-find-leaf-pod-bug.patch: -------------------------------------------------------------------------------- 1 | ui: fix find leaf pod bug 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../resource-details/resource-details.tsx | 10 ++++++---- 8 | ui/src/app/applications/components/utils.tsx | 13 ++++++++++++- 9 | 2 files changed, 18 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/ui/src/app/applications/components/resource-details/resource-details.tsx b/ui/src/app/applications/components/resource-details/resource-details.tsx 12 | index 647750937..a440f3db1 100644 13 | --- a/ui/src/app/applications/components/resource-details/resource-details.tsx 14 | +++ b/ui/src/app/applications/components/resource-details/resource-details.tsx 15 | @@ -271,10 +271,12 @@ export const ResourceDetails = (props: ResourceDetailsProps) => { 16 | if (selectedNode.kind === 'Pod') { 17 | podState = liveState; 18 | } else { 19 | - const childPod = AppUtils.findChildPod(selectedNode, tree); 20 | - if (childPod) { 21 | - podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 22 | - } 23 | + podState = null; 24 | + // CK: findChildPod is expensive, so we only call it when we need to 25 | + // const childPod = AppUtils.findChildPod(selectedNode, tree); 26 | + // if (childPod) { 27 | + // podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 28 | + // } 29 | } 30 | 31 | const settings = await services.authService.settings(); 32 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 33 | index 0df581ca0..14385989d 100644 34 | --- a/ui/src/app/applications/components/utils.tsx 35 | +++ b/ui/src/app/applications/components/utils.tsx 36 | @@ -458,7 +458,8 @@ function getActionItems( 37 | }); 38 | } 39 | 40 | - if (findChildPod(resource, tree)) { 41 | + // CK: findChildPod(resource, tree) is too expensive, so we only call it for Pod resources 42 | + if (resource.kind === 'Pod') { 43 | items.push({ 44 | title: 'Logs', 45 | iconClassName: 'fa fa-fw fa-align-left', 46 | @@ -873,6 +874,16 @@ export const OperationState = ({app, quiet}: {app: appModels.Application; quiet? 47 | ); 48 | }; 49 | 50 | +export function getKstatusCondition(conditionType: string, ks: appModels.State): {status: string; message: string; reason: string} { 51 | + for (const condition of ks.status.conditions) { 52 | + if (condition["type"] === conditionType) { 53 | + return {message: condition.message, reason: condition.reason, status: condition.status}; 54 | + } 55 | + } 56 | + 57 | + return undefined; 58 | +} 59 | + 60 | export function getPodStateReason(pod: appModels.State): {message: string; reason: string; netContainerStatuses: any[]} { 61 | let reason = pod.status.phase; 62 | let message = ''; 63 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/04-ui-fix-find-leaf-pod-bug.patch: -------------------------------------------------------------------------------- 1 | ui: fix find leaf pod bug 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | .../resource-details/resource-details.tsx | 10 ++++++---- 8 | ui/src/app/applications/components/utils.tsx | 13 ++++++++++++- 9 | 2 files changed, 18 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/ui/src/app/applications/components/resource-details/resource-details.tsx b/ui/src/app/applications/components/resource-details/resource-details.tsx 12 | index 647750937..a440f3db1 100644 13 | --- a/ui/src/app/applications/components/resource-details/resource-details.tsx 14 | +++ b/ui/src/app/applications/components/resource-details/resource-details.tsx 15 | @@ -271,10 +271,12 @@ export const ResourceDetails = (props: ResourceDetailsProps) => { 16 | if (selectedNode.kind === 'Pod') { 17 | podState = liveState; 18 | } else { 19 | - const childPod = AppUtils.findChildPod(selectedNode, tree); 20 | - if (childPod) { 21 | - podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 22 | - } 23 | + podState = null; 24 | + // CK: findChildPod is expensive, so we only call it when we need to 25 | + // const childPod = AppUtils.findChildPod(selectedNode, tree); 26 | + // if (childPod) { 27 | + // podState = await services.applications.getResource(application.metadata.name, application.metadata.namespace, childPod).catch(() => null); 28 | + // } 29 | } 30 | 31 | const settings = await services.authService.settings(); 32 | diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx 33 | index 674ffc672..f0c7642d7 100644 34 | --- a/ui/src/app/applications/components/utils.tsx 35 | +++ b/ui/src/app/applications/components/utils.tsx 36 | @@ -458,7 +458,8 @@ function getActionItems( 37 | }); 38 | } 39 | 40 | - if (findChildPod(resource, tree)) { 41 | + // CK: findChildPod(resource, tree) is too expensive, so we only call it for Pod resources 42 | + if (resource.kind === 'Pod') { 43 | items.push({ 44 | title: 'Logs', 45 | iconClassName: 'fa fa-fw fa-align-left', 46 | @@ -873,6 +874,16 @@ export const OperationState = ({app, quiet}: {app: appModels.Application; quiet? 47 | ); 48 | }; 49 | 50 | +export function getKstatusCondition(conditionType: string, ks: appModels.State): {status: string; message: string; reason: string} { 51 | + for (const condition of ks.status.conditions) { 52 | + if (condition["type"] === conditionType) { 53 | + return {message: condition.message, reason: condition.reason, status: condition.status}; 54 | + } 55 | + } 56 | + 57 | + return undefined; 58 | +} 59 | + 60 | export function getPodStateReason(pod: appModels.State): {message: string; reason: string; netContainerStatuses: any[]} { 61 | let reason = pod.status.phase; 62 | let message = ''; 63 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/16-override-workload-name-with.patch: -------------------------------------------------------------------------------- 1 | override workload name with label 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/state_fsa.go | 28 ++++++++++++++++++++++++++-- 8 | controller/sync_fsa.go | 4 ++-- 9 | 2 files changed, 28 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/controller/state_fsa.go b/controller/state_fsa.go 12 | index 28cd571cc..33a813cc8 100644 13 | --- a/controller/state_fsa.go 14 | +++ b/controller/state_fsa.go 15 | @@ -87,6 +87,30 @@ var supportedKinds = map[fluxKind]schema.GroupVersionKind{ 16 | }, 17 | } 18 | 19 | +const FlamingoWorkloadNameLabel = "flamingo/workload-name" 20 | + 21 | +func getWorkloadName(app *v1alpha1.Application) string { 22 | + // if app is nil, return empty string 23 | + if app == nil { 24 | + return "" 25 | + } 26 | + 27 | + // if app has no labels, return app name 28 | + if app.GetLabels() == nil { 29 | + return app.Name 30 | + } 31 | + 32 | + // if app has labels, check if it has the workload name label 33 | + // if it does, return the workload name 34 | + labels := app.GetLabels() 35 | + if name, ok := labels[FlamingoWorkloadNameLabel]; ok { 36 | + return name 37 | + } 38 | + 39 | + // otherwise, return app name 40 | + return app.Name 41 | +} 42 | + 43 | func (m *appStateManager) getFluxHelmTargetObjects(app *v1alpha1.Application, conditions []v1alpha1.ApplicationCondition, now v1.Time) ([]*unstructured.Unstructured, []v1alpha1.ApplicationCondition, bool) { 44 | var ( 45 | targetObjs []*unstructured.Unstructured 46 | @@ -121,7 +145,7 @@ func (m *appStateManager) getFluxHelmTargetObjects(app *v1alpha1.Application, co 47 | hl *unstructured.Unstructured 48 | hlNotFound bool 49 | ) 50 | - hl, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[HelmRelease], app.Name, app.Spec.Destination.Namespace) 51 | + hl, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[HelmRelease], getWorkloadName(app), app.Spec.Destination.Namespace) 52 | 53 | if err != nil { 54 | // err might be a "not found" one 55 | @@ -207,7 +231,7 @@ func (m *appStateManager) getFluxKustomizeTargetObjects(app *v1alpha1.Applicatio 56 | ks *unstructured.Unstructured 57 | ksNotFound bool 58 | ) 59 | - ks, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[Kustomization], app.Name, app.Spec.Destination.Namespace) 60 | + ks, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[Kustomization], getWorkloadName(app), app.Spec.Destination.Namespace) 61 | 62 | if err != nil { 63 | // err might be a "not found" one 64 | diff --git a/controller/sync_fsa.go b/controller/sync_fsa.go 65 | index e4b0f3ca6..9c4aaca6c 100644 66 | --- a/controller/sync_fsa.go 67 | +++ b/controller/sync_fsa.go 68 | @@ -95,7 +95,7 @@ spec: 69 | return nil, nil, err 70 | } 71 | releaseObj := &unstructured.Unstructured{Object: release} 72 | - releaseObj.SetName(app.GetName()) 73 | + releaseObj.SetName(getWorkloadName(app)) 74 | releaseObj.SetNamespace(app.Spec.Destination.Namespace) 75 | if err := unstructured.SetNestedField(release, app.Spec.Source.Chart, 76 | "spec", "chart", "spec", "chart"); err != nil { 77 | @@ -191,7 +191,7 @@ spec: 78 | return nil, nil, err 79 | } 80 | ksObj := &unstructured.Unstructured{Object: ks} 81 | - ksObj.SetName(app.GetName()) 82 | + ksObj.SetName(getWorkloadName(app)) 83 | ksObj.SetNamespace(app.Spec.Destination.Namespace) 84 | if err := unstructured.SetNestedField(ks, app.Spec.Source.Path, 85 | "spec", "path"); err != nil { 86 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/16-override-workload-name-with.patch: -------------------------------------------------------------------------------- 1 | override workload name with label 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/state_fsa.go | 28 ++++++++++++++++++++++++++-- 8 | controller/sync_fsa.go | 4 ++-- 9 | 2 files changed, 28 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/controller/state_fsa.go b/controller/state_fsa.go 12 | index 9e1c36e2f..e3aab0778 100644 13 | --- a/controller/state_fsa.go 14 | +++ b/controller/state_fsa.go 15 | @@ -87,6 +87,30 @@ var supportedKinds = map[fluxKind]schema.GroupVersionKind{ 16 | }, 17 | } 18 | 19 | +const FlamingoWorkloadNameLabel = "flamingo/workload-name" 20 | + 21 | +func getWorkloadName(app *v1alpha1.Application) string { 22 | + // if app is nil, return empty string 23 | + if app == nil { 24 | + return "" 25 | + } 26 | + 27 | + // if app has no labels, return app name 28 | + if app.GetLabels() == nil { 29 | + return app.Name 30 | + } 31 | + 32 | + // if app has labels, check if it has the workload name label 33 | + // if it does, return the workload name 34 | + labels := app.GetLabels() 35 | + if name, ok := labels[FlamingoWorkloadNameLabel]; ok { 36 | + return name 37 | + } 38 | + 39 | + // otherwise, return app name 40 | + return app.Name 41 | +} 42 | + 43 | func (m *appStateManager) getFluxHelmTargetObjects(app *v1alpha1.Application, conditions []v1alpha1.ApplicationCondition, now v1.Time) ([]*unstructured.Unstructured, []v1alpha1.ApplicationCondition, bool) { 44 | var ( 45 | targetObjs []*unstructured.Unstructured 46 | @@ -121,7 +145,7 @@ func (m *appStateManager) getFluxHelmTargetObjects(app *v1alpha1.Application, co 47 | hl *unstructured.Unstructured 48 | hlNotFound bool 49 | ) 50 | - hl, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[HelmRelease], app.Name, app.Spec.Destination.Namespace) 51 | + hl, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[HelmRelease], getWorkloadName(app), app.Spec.Destination.Namespace) 52 | 53 | if err != nil { 54 | // err might be a "not found" one 55 | @@ -207,7 +231,7 @@ func (m *appStateManager) getFluxKustomizeTargetObjects(app *v1alpha1.Applicatio 56 | ks *unstructured.Unstructured 57 | ksNotFound bool 58 | ) 59 | - ks, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[Kustomization], app.Name, app.Spec.Destination.Namespace) 60 | + ks, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[Kustomization], getWorkloadName(app), app.Spec.Destination.Namespace) 61 | 62 | if err != nil { 63 | // err might be a "not found" one 64 | diff --git a/controller/sync_fsa.go b/controller/sync_fsa.go 65 | index d9e1da5c8..b4b71f98d 100644 66 | --- a/controller/sync_fsa.go 67 | +++ b/controller/sync_fsa.go 68 | @@ -95,7 +95,7 @@ spec: 69 | return nil, nil, err 70 | } 71 | releaseObj := &unstructured.Unstructured{Object: release} 72 | - releaseObj.SetName(app.GetName()) 73 | + releaseObj.SetName(getWorkloadName(app)) 74 | releaseObj.SetNamespace(app.Spec.Destination.Namespace) 75 | if err := unstructured.SetNestedField(release, app.Spec.Source.Chart, 76 | "spec", "chart", "spec", "chart"); err != nil { 77 | @@ -191,7 +191,7 @@ spec: 78 | return nil, nil, err 79 | } 80 | ksObj := &unstructured.Unstructured{Object: ks} 81 | - ksObj.SetName(app.GetName()) 82 | + ksObj.SetName(getWorkloadName(app)) 83 | ksObj.SetNamespace(app.Spec.Destination.Namespace) 84 | if err := unstructured.SetNestedField(ks, app.Spec.Source.Path, 85 | "spec", "path"); err != nil { 86 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/16-override-workload-name-with.patch: -------------------------------------------------------------------------------- 1 | override workload name with label 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/state_fsa.go | 28 ++++++++++++++++++++++++++-- 8 | controller/sync_fsa.go | 4 ++-- 9 | 2 files changed, 28 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/controller/state_fsa.go b/controller/state_fsa.go 12 | index 9e1c36e2f..e3aab0778 100644 13 | --- a/controller/state_fsa.go 14 | +++ b/controller/state_fsa.go 15 | @@ -87,6 +87,30 @@ var supportedKinds = map[fluxKind]schema.GroupVersionKind{ 16 | }, 17 | } 18 | 19 | +const FlamingoWorkloadNameLabel = "flamingo/workload-name" 20 | + 21 | +func getWorkloadName(app *v1alpha1.Application) string { 22 | + // if app is nil, return empty string 23 | + if app == nil { 24 | + return "" 25 | + } 26 | + 27 | + // if app has no labels, return app name 28 | + if app.GetLabels() == nil { 29 | + return app.Name 30 | + } 31 | + 32 | + // if app has labels, check if it has the workload name label 33 | + // if it does, return the workload name 34 | + labels := app.GetLabels() 35 | + if name, ok := labels[FlamingoWorkloadNameLabel]; ok { 36 | + return name 37 | + } 38 | + 39 | + // otherwise, return app name 40 | + return app.Name 41 | +} 42 | + 43 | func (m *appStateManager) getFluxHelmTargetObjects(app *v1alpha1.Application, conditions []v1alpha1.ApplicationCondition, now v1.Time) ([]*unstructured.Unstructured, []v1alpha1.ApplicationCondition, bool) { 44 | var ( 45 | targetObjs []*unstructured.Unstructured 46 | @@ -121,7 +145,7 @@ func (m *appStateManager) getFluxHelmTargetObjects(app *v1alpha1.Application, co 47 | hl *unstructured.Unstructured 48 | hlNotFound bool 49 | ) 50 | - hl, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[HelmRelease], app.Name, app.Spec.Destination.Namespace) 51 | + hl, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[HelmRelease], getWorkloadName(app), app.Spec.Destination.Namespace) 52 | 53 | if err != nil { 54 | // err might be a "not found" one 55 | @@ -207,7 +231,7 @@ func (m *appStateManager) getFluxKustomizeTargetObjects(app *v1alpha1.Applicatio 56 | ks *unstructured.Unstructured 57 | ksNotFound bool 58 | ) 59 | - ks, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[Kustomization], app.Name, app.Spec.Destination.Namespace) 60 | + ks, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[Kustomization], getWorkloadName(app), app.Spec.Destination.Namespace) 61 | 62 | if err != nil { 63 | // err might be a "not found" one 64 | diff --git a/controller/sync_fsa.go b/controller/sync_fsa.go 65 | index d9e1da5c8..b4b71f98d 100644 66 | --- a/controller/sync_fsa.go 67 | +++ b/controller/sync_fsa.go 68 | @@ -95,7 +95,7 @@ spec: 69 | return nil, nil, err 70 | } 71 | releaseObj := &unstructured.Unstructured{Object: release} 72 | - releaseObj.SetName(app.GetName()) 73 | + releaseObj.SetName(getWorkloadName(app)) 74 | releaseObj.SetNamespace(app.Spec.Destination.Namespace) 75 | if err := unstructured.SetNestedField(release, app.Spec.Source.Chart, 76 | "spec", "chart", "spec", "chart"); err != nil { 77 | @@ -191,7 +191,7 @@ spec: 78 | return nil, nil, err 79 | } 80 | ksObj := &unstructured.Unstructured{Object: ks} 81 | - ksObj.SetName(app.GetName()) 82 | + ksObj.SetName(getWorkloadName(app)) 83 | ksObj.SetNamespace(app.Spec.Destination.Namespace) 84 | if err := unstructured.SetNestedField(ks, app.Spec.Source.Path, 85 | "spec", "path"); err != nil { 86 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.6/15-fix-branch-and-rev-info-of.patch: -------------------------------------------------------------------------------- 1 | fix branch and rev info of flux v2 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 58 ++++++++++++++++++++++++++++++++++++---------- 8 | 1 file changed, 45 insertions(+), 13 deletions(-) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index f97b04b4c..d9dbfa6e3 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -57,15 +57,31 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 15 | // TODO add Flux here 16 | case "source.toolkit.fluxcd.io": 17 | if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 18 | - parts := strings.SplitN(revision, "/", 2) 19 | - if len(parts) == 1 { 20 | - if len(parts[0]) >= 8 { 21 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 22 | + if strings.Contains(revision, "/") { 23 | + parts := strings.SplitN(revision, "/", 2) 24 | + if len(parts) == 1 { 25 | + if len(parts[0]) >= 8 { 26 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 27 | + } 28 | + } else if len(parts) == 2 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 30 | + if len(parts[1]) >= 8 { 31 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 32 | + } 33 | } 34 | - } else if len(parts) == 2 { 35 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 36 | - if len(parts[1]) >= 8 { 37 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 38 | + } else if strings.Contains(revision, "@") { 39 | + parts := strings.SplitN(revision, "@", 2) 40 | + // v2.6@sha256:c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 41 | + if len(parts) == 2 { 42 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Tag", Value: parts[0]}) 43 | + // split at : so => sha256 and c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 44 | + split := strings.SplitN(parts[1], ":", 2) 45 | + if len(split) == 2 { 46 | + // we discard the sha256 and only take the first 8 chars 47 | + if len(split[1]) >= 8 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: split[1][0:8]}) 49 | + } 50 | + } 51 | } 52 | } 53 | } 54 | @@ -82,11 +98,27 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 55 | switch gvk.Kind { 56 | case "Kustomization", "Terraform": 57 | if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 58 | - parts := strings.SplitN(revision, "/", 2) 59 | - if len(parts) == 2 { 60 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 61 | - if len(parts[1]) >= 8 { 62 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 63 | + if strings.Contains(revision, "/") { 64 | + parts := strings.SplitN(revision, "/", 2) 65 | + if len(parts) == 2 { 66 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 67 | + if len(parts[1]) >= 8 { 68 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 69 | + } 70 | + } 71 | + } else if strings.Contains(revision, "@") { 72 | + parts := strings.SplitN(revision, "@", 2) 73 | + // v2.6@sha256:c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 74 | + if len(parts) == 2 { 75 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Tag", Value: parts[0]}) 76 | + // split at : so => sha256 and c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 77 | + split := strings.SplitN(parts[1], ":", 2) 78 | + if len(split) == 2 { 79 | + // we discard the sha256 and only take the first 8 chars 80 | + if len(split[1]) >= 8 { 81 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: split[1][0:8]}) 82 | + } 83 | + } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.7/14-fix-branch-and-rev-info-of.patch: -------------------------------------------------------------------------------- 1 | fix branch and rev info of flux v2 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 58 ++++++++++++++++++++++++++++++++++++---------- 8 | 1 file changed, 45 insertions(+), 13 deletions(-) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index f97b04b4c..d9dbfa6e3 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -57,15 +57,31 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 15 | // TODO add Flux here 16 | case "source.toolkit.fluxcd.io": 17 | if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 18 | - parts := strings.SplitN(revision, "/", 2) 19 | - if len(parts) == 1 { 20 | - if len(parts[0]) >= 8 { 21 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 22 | + if strings.Contains(revision, "/") { 23 | + parts := strings.SplitN(revision, "/", 2) 24 | + if len(parts) == 1 { 25 | + if len(parts[0]) >= 8 { 26 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 27 | + } 28 | + } else if len(parts) == 2 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 30 | + if len(parts[1]) >= 8 { 31 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 32 | + } 33 | } 34 | - } else if len(parts) == 2 { 35 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 36 | - if len(parts[1]) >= 8 { 37 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 38 | + } else if strings.Contains(revision, "@") { 39 | + parts := strings.SplitN(revision, "@", 2) 40 | + // v2.6@sha256:c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 41 | + if len(parts) == 2 { 42 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Tag", Value: parts[0]}) 43 | + // split at : so => sha256 and c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 44 | + split := strings.SplitN(parts[1], ":", 2) 45 | + if len(split) == 2 { 46 | + // we discard the sha256 and only take the first 8 chars 47 | + if len(split[1]) >= 8 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: split[1][0:8]}) 49 | + } 50 | + } 51 | } 52 | } 53 | } 54 | @@ -82,11 +98,27 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 55 | switch gvk.Kind { 56 | case "Kustomization", "Terraform": 57 | if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 58 | - parts := strings.SplitN(revision, "/", 2) 59 | - if len(parts) == 2 { 60 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 61 | - if len(parts[1]) >= 8 { 62 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 63 | + if strings.Contains(revision, "/") { 64 | + parts := strings.SplitN(revision, "/", 2) 65 | + if len(parts) == 2 { 66 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 67 | + if len(parts[1]) >= 8 { 68 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 69 | + } 70 | + } 71 | + } else if strings.Contains(revision, "@") { 72 | + parts := strings.SplitN(revision, "@", 2) 73 | + // v2.6@sha256:c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 74 | + if len(parts) == 2 { 75 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Tag", Value: parts[0]}) 76 | + // split at : so => sha256 and c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 77 | + split := strings.SplitN(parts[1], ":", 2) 78 | + if len(split) == 2 { 79 | + // we discard the sha256 and only take the first 8 chars 80 | + if len(split[1]) >= 8 { 81 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: split[1][0:8]}) 82 | + } 83 | + } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.10/14-fix-branch-and-rev-info-of.patch: -------------------------------------------------------------------------------- 1 | fix branch and rev info of flux v2 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 58 ++++++++++++++++++++++++++++++++++++---------- 8 | 1 file changed, 45 insertions(+), 13 deletions(-) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index ffa4ae32f..25cb52e8c 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -70,15 +70,31 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 15 | // TODO add Flux here 16 | case "source.toolkit.fluxcd.io": 17 | if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 18 | - parts := strings.SplitN(revision, "/", 2) 19 | - if len(parts) == 1 { 20 | - if len(parts[0]) >= 8 { 21 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 22 | + if strings.Contains(revision, "/") { 23 | + parts := strings.SplitN(revision, "/", 2) 24 | + if len(parts) == 1 { 25 | + if len(parts[0]) >= 8 { 26 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 27 | + } 28 | + } else if len(parts) == 2 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 30 | + if len(parts[1]) >= 8 { 31 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 32 | + } 33 | } 34 | - } else if len(parts) == 2 { 35 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 36 | - if len(parts[1]) >= 8 { 37 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 38 | + } else if strings.Contains(revision, "@") { 39 | + parts := strings.SplitN(revision, "@", 2) 40 | + // v2.6@sha256:c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 41 | + if len(parts) == 2 { 42 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Tag", Value: parts[0]}) 43 | + // split at : so => sha256 and c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 44 | + split := strings.SplitN(parts[1], ":", 2) 45 | + if len(split) == 2 { 46 | + // we discard the sha256 and only take the first 8 chars 47 | + if len(split[1]) >= 8 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: split[1][0:8]}) 49 | + } 50 | + } 51 | } 52 | } 53 | } 54 | @@ -95,11 +111,27 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 55 | switch gvk.Kind { 56 | case "Kustomization", "Terraform": 57 | if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 58 | - parts := strings.SplitN(revision, "/", 2) 59 | - if len(parts) == 2 { 60 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 61 | - if len(parts[1]) >= 8 { 62 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 63 | + if strings.Contains(revision, "/") { 64 | + parts := strings.SplitN(revision, "/", 2) 65 | + if len(parts) == 2 { 66 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 67 | + if len(parts[1]) >= 8 { 68 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 69 | + } 70 | + } 71 | + } else if strings.Contains(revision, "@") { 72 | + parts := strings.SplitN(revision, "@", 2) 73 | + // v2.6@sha256:c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 74 | + if len(parts) == 2 { 75 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Tag", Value: parts[0]}) 76 | + // split at : so => sha256 and c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 77 | + split := strings.SplitN(parts[1], ":", 2) 78 | + if len(split) == 2 { 79 | + // we discard the sha256 and only take the first 8 chars 80 | + if len(split[1]) >= 8 { 81 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: split[1][0:8]}) 82 | + } 83 | + } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.8/14-fix-branch-and-rev-info-of.patch: -------------------------------------------------------------------------------- 1 | fix branch and rev info of flux v2 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 58 ++++++++++++++++++++++++++++++++++++---------- 8 | 1 file changed, 45 insertions(+), 13 deletions(-) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index a81734fa1..8f9ab229e 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -60,15 +60,31 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 15 | // TODO add Flux here 16 | case "source.toolkit.fluxcd.io": 17 | if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 18 | - parts := strings.SplitN(revision, "/", 2) 19 | - if len(parts) == 1 { 20 | - if len(parts[0]) >= 8 { 21 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 22 | + if strings.Contains(revision, "/") { 23 | + parts := strings.SplitN(revision, "/", 2) 24 | + if len(parts) == 1 { 25 | + if len(parts[0]) >= 8 { 26 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 27 | + } 28 | + } else if len(parts) == 2 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 30 | + if len(parts[1]) >= 8 { 31 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 32 | + } 33 | } 34 | - } else if len(parts) == 2 { 35 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 36 | - if len(parts[1]) >= 8 { 37 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 38 | + } else if strings.Contains(revision, "@") { 39 | + parts := strings.SplitN(revision, "@", 2) 40 | + // v2.6@sha256:c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 41 | + if len(parts) == 2 { 42 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Tag", Value: parts[0]}) 43 | + // split at : so => sha256 and c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 44 | + split := strings.SplitN(parts[1], ":", 2) 45 | + if len(split) == 2 { 46 | + // we discard the sha256 and only take the first 8 chars 47 | + if len(split[1]) >= 8 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: split[1][0:8]}) 49 | + } 50 | + } 51 | } 52 | } 53 | } 54 | @@ -85,11 +101,27 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 55 | switch gvk.Kind { 56 | case "Kustomization", "Terraform": 57 | if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 58 | - parts := strings.SplitN(revision, "/", 2) 59 | - if len(parts) == 2 { 60 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 61 | - if len(parts[1]) >= 8 { 62 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 63 | + if strings.Contains(revision, "/") { 64 | + parts := strings.SplitN(revision, "/", 2) 65 | + if len(parts) == 2 { 66 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 67 | + if len(parts[1]) >= 8 { 68 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 69 | + } 70 | + } 71 | + } else if strings.Contains(revision, "@") { 72 | + parts := strings.SplitN(revision, "@", 2) 73 | + // v2.6@sha256:c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 74 | + if len(parts) == 2 { 75 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Tag", Value: parts[0]}) 76 | + // split at : so => sha256 and c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 77 | + split := strings.SplitN(parts[1], ":", 2) 78 | + if len(split) == 2 { 79 | + // we discard the sha256 and only take the first 8 chars 80 | + if len(split[1]) >= 8 { 81 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: split[1][0:8]}) 82 | + } 83 | + } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /patches-argo-cd-v2.9/14-fix-branch-and-rev-info-of.patch: -------------------------------------------------------------------------------- 1 | fix branch and rev info of flux v2 2 | 3 | From: Chanwit Kaewkasi 4 | 5 | Signed-off-by: Chanwit Kaewkasi 6 | --- 7 | controller/cache/info.go | 58 ++++++++++++++++++++++++++++++++++++---------- 8 | 1 file changed, 45 insertions(+), 13 deletions(-) 9 | 10 | diff --git a/controller/cache/info.go b/controller/cache/info.go 11 | index a81734fa1..8f9ab229e 100644 12 | --- a/controller/cache/info.go 13 | +++ b/controller/cache/info.go 14 | @@ -60,15 +60,31 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 15 | // TODO add Flux here 16 | case "source.toolkit.fluxcd.io": 17 | if revision, found, err := unstructured.NestedString(un.Object, "status", "artifact", "revision"); found && err == nil { 18 | - parts := strings.SplitN(revision, "/", 2) 19 | - if len(parts) == 1 { 20 | - if len(parts[0]) >= 8 { 21 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 22 | + if strings.Contains(revision, "/") { 23 | + parts := strings.SplitN(revision, "/", 2) 24 | + if len(parts) == 1 { 25 | + if len(parts[0]) >= 8 { 26 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[0][0:8]}) 27 | + } 28 | + } else if len(parts) == 2 { 29 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 30 | + if len(parts[1]) >= 8 { 31 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 32 | + } 33 | } 34 | - } else if len(parts) == 2 { 35 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 36 | - if len(parts[1]) >= 8 { 37 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 38 | + } else if strings.Contains(revision, "@") { 39 | + parts := strings.SplitN(revision, "@", 2) 40 | + // v2.6@sha256:c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 41 | + if len(parts) == 2 { 42 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Tag", Value: parts[0]}) 43 | + // split at : so => sha256 and c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 44 | + split := strings.SplitN(parts[1], ":", 2) 45 | + if len(split) == 2 { 46 | + // we discard the sha256 and only take the first 8 chars 47 | + if len(split[1]) >= 8 { 48 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: split[1][0:8]}) 49 | + } 50 | + } 51 | } 52 | } 53 | } 54 | @@ -85,11 +101,27 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa 55 | switch gvk.Kind { 56 | case "Kustomization", "Terraform": 57 | if revision, found, err := unstructured.NestedString(un.Object, "status", "lastAppliedRevision"); found && err == nil { 58 | - parts := strings.SplitN(revision, "/", 2) 59 | - if len(parts) == 2 { 60 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 61 | - if len(parts[1]) >= 8 { 62 | - res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 63 | + if strings.Contains(revision, "/") { 64 | + parts := strings.SplitN(revision, "/", 2) 65 | + if len(parts) == 2 { 66 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Branch", Value: parts[0]}) 67 | + if len(parts[1]) >= 8 { 68 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: parts[1][0:8]}) 69 | + } 70 | + } 71 | + } else if strings.Contains(revision, "@") { 72 | + parts := strings.SplitN(revision, "@", 2) 73 | + // v2.6@sha256:c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 74 | + if len(parts) == 2 { 75 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Tag", Value: parts[0]}) 76 | + // split at : so => sha256 and c7fd0cc69b924aa5f9a6928477311737e439ca1b9e444855b0377e8a8ec65bb5 77 | + split := strings.SplitN(parts[1], ":", 2) 78 | + if len(split) == 2 { 79 | + // we discard the sha256 and only take the first 8 chars 80 | + if len(split[1]) >= 8 { 81 | + res.Info = append(res.Info, v1alpha1.InfoItem{Name: "Revision", Value: split[1][0:8]}) 82 | + } 83 | + } 84 | } 85 | } 86 | } 87 | --------------------------------------------------------------------------------