Compare commits

...

16 Commits

Author SHA1 Message Date
github-actions[bot]
791b036d98 Bump version to 3.1.2 on release-3.1 branch (#24395)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: crenshaw-dev <350466+crenshaw-dev@users.noreply.github.com>
2025-09-04 11:45:55 -04:00
Michael Crenshaw
60c62a944b fix(security): repository.GetDetailedProject exposes repo secrets (#24391)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2025-09-04 11:32:13 -04:00
Michael Crenshaw
fe6efec8f4 fix(appset): add applicationsets to the built-in readonly role (#24190) (#24318) (#24321)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2025-09-03 21:45:58 -04:00
Peter Jiang
6de4f7739b fix(cherry-pick-3.1): handle missing resources on UI (#24357)
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
2025-09-03 09:36:05 -04:00
Adrian Berger
ed9149beea fix(cherry-pick-3.1): custom resource health for flux helm repository of type oci (#24341)
Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>
2025-09-02 15:18:58 -04:00
Blake Pettersson
20447f7f57 fix: downgrade go-git (#24288) (release-3.1) (#24317)
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2025-08-29 09:53:30 -04:00
jan-mrm
7982a74600 fix(discovery): add missing lua syntax and return to discovery (fixes #24257) - 3.1 (#24268)
Signed-off-by: jan-mrm <67435696+jan-mrm@users.noreply.github.com>
2025-08-28 11:35:37 -04:00
Nitish Kumar
b3ad040b2c chore(cherry-pick-3.1): replace bitnami images (#24101) (#24286)
Signed-off-by: nitishfy <justnitish06@gmail.com>
2025-08-27 14:03:19 +02:00
Anand Francis Joseph
30d8ce66e2 fix(appset): prevent idle connection buildup by cloning http.DefaultTransport in Bitbucket SCM/PR generator (#24264)
Signed-off-by: portly-halicore-76 <170707699+portly-halicore-76@users.noreply.github.com>
Signed-off-by: anandf <anjoseph@redhat.com>
Co-authored-by: portly-halicore-76 <170707699+portly-halicore-76@users.noreply.github.com>
2025-08-26 09:53:30 -04:00
github-actions[bot]
fa342d153e Bump version to 3.1.1 on release-3.1 branch (#24260)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: crenshaw-dev <350466+crenshaw-dev@users.noreply.github.com>
2025-08-25 11:30:18 -04:00
raweber
c140eb27f8 fix: resolve argocd ui error for externalSecrets, fixes #23886 (#24232) (#24236)
Signed-off-by: ralf.weber <ralf.weber@cistec.com>
Co-authored-by: ralf.weber <ralf.weber@cistec.com>
2025-08-22 23:00:48 +02:00
Codey Jenkins
70dde2c27b chore: cherry pick #24235 to release-3.1 (#24238)
Signed-off-by: Codey Jenkins <FourFifthsCode@users.noreply.github.com>
Co-authored-by: Matthew Bennett <mtbennett@godaddy.com>
2025-08-22 16:29:13 -04:00
rumstead
eb72a0bd3b fix(server): Send Azure DevOps token via git extra headers (#23478) (#23631) (#24223)
Signed-off-by: Mike Bordon <mikebordon@gmail.com>
Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
Co-authored-by: mikebordon <31316193+mikebordon@users.noreply.github.com>
2025-08-21 16:43:05 -04:00
Anand Francis Joseph
fdd099181c fix(util): Fix default key exchange algorthims used for SSH connection to be FIPS compliant (#24086) (cherry-pick 3.1) (#24166)
Signed-off-by: anandf <anjoseph@redhat.com>
2025-08-15 11:32:30 +02:00
Blake Pettersson
a0f065316b chore: add oci env vars to manifests (#24113) (cherry-pick 3.1) (#24153)
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2025-08-14 13:59:13 +02:00
Alexandre Gaudreault
b22566d001 fix(lua): allow actions to add items to array (#24137)
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2025-08-13 17:20:16 -04:00
57 changed files with 965 additions and 353 deletions

View File

@@ -1 +1 @@
3.1.0
3.1.2

View File

@@ -3,12 +3,11 @@ package pull_request
import (
"context"
"fmt"
"net/http"
bitbucketv1 "github.com/gfleury/go-bitbucket-v1"
log "github.com/sirupsen/logrus"
"github.com/argoproj/argo-cd/v3/applicationset/utils"
"github.com/argoproj/argo-cd/v3/applicationset/services"
)
type BitbucketService struct {
@@ -49,15 +48,10 @@ func NewBitbucketServiceNoAuth(ctx context.Context, url, projectKey, repositoryS
}
func newBitbucketService(ctx context.Context, bitbucketConfig *bitbucketv1.Configuration, projectKey, repositorySlug string, scmRootCAPath string, insecure bool, caCerts []byte) (PullRequestService, error) {
bitbucketConfig.BasePath = utils.NormalizeBitbucketBasePath(bitbucketConfig.BasePath)
tlsConfig := utils.GetTlsConfig(scmRootCAPath, insecure, caCerts)
bitbucketConfig.HTTPClient = &http.Client{Transport: &http.Transport{
TLSClientConfig: tlsConfig,
}}
bitbucketClient := bitbucketv1.NewAPIClient(ctx, bitbucketConfig)
bbClient := services.SetupBitbucketClient(ctx, bitbucketConfig, scmRootCAPath, insecure, caCerts)
return &BitbucketService{
client: bitbucketClient,
client: bbClient,
projectKey: projectKey,
repositorySlug: repositorySlug,
}, nil

View File

@@ -10,7 +10,7 @@ import (
bitbucketv1 "github.com/gfleury/go-bitbucket-v1"
log "github.com/sirupsen/logrus"
"github.com/argoproj/argo-cd/v3/applicationset/utils"
"github.com/argoproj/argo-cd/v3/applicationset/services"
)
type BitbucketServerProvider struct {
@@ -49,15 +49,10 @@ func NewBitbucketServerProviderNoAuth(ctx context.Context, url, projectKey strin
}
func newBitbucketServerProvider(ctx context.Context, bitbucketConfig *bitbucketv1.Configuration, projectKey string, allBranches bool, scmRootCAPath string, insecure bool, caCerts []byte) (*BitbucketServerProvider, error) {
bitbucketConfig.BasePath = utils.NormalizeBitbucketBasePath(bitbucketConfig.BasePath)
tlsConfig := utils.GetTlsConfig(scmRootCAPath, insecure, caCerts)
bitbucketConfig.HTTPClient = &http.Client{Transport: &http.Transport{
TLSClientConfig: tlsConfig,
}}
bitbucketClient := bitbucketv1.NewAPIClient(ctx, bitbucketConfig)
bbClient := services.SetupBitbucketClient(ctx, bitbucketConfig, scmRootCAPath, insecure, caCerts)
return &BitbucketServerProvider{
client: bitbucketClient,
client: bbClient,
projectKey: projectKey,
allBranches: allBranches,
}, nil

View File

@@ -0,0 +1,22 @@
package services
import (
"context"
"net/http"
bitbucketv1 "github.com/gfleury/go-bitbucket-v1"
"github.com/argoproj/argo-cd/v3/applicationset/utils"
)
// SetupBitbucketClient configures and creates a Bitbucket API client with TLS settings
func SetupBitbucketClient(ctx context.Context, config *bitbucketv1.Configuration, scmRootCAPath string, insecure bool, caCerts []byte) *bitbucketv1.APIClient {
config.BasePath = utils.NormalizeBitbucketBasePath(config.BasePath)
tlsConfig := utils.GetTlsConfig(scmRootCAPath, insecure, caCerts)
transport := http.DefaultTransport.(*http.Transport).Clone()
transport.TLSClientConfig = tlsConfig
config.HTTPClient = &http.Client{Transport: transport}
return bitbucketv1.NewAPIClient(ctx, config)
}

View File

@@ -0,0 +1,36 @@
package services
import (
"crypto/tls"
"net/http"
"testing"
"time"
bitbucketv1 "github.com/gfleury/go-bitbucket-v1"
"github.com/stretchr/testify/require"
)
func TestSetupBitbucketClient(t *testing.T) {
ctx := t.Context()
cfg := &bitbucketv1.Configuration{}
// Act
client := SetupBitbucketClient(ctx, cfg, "", false, nil)
// Assert
require.NotNil(t, client, "expected client to be created")
require.NotNil(t, cfg.HTTPClient, "expected HTTPClient to be set")
// The transport should be a clone of DefaultTransport
tr, ok := cfg.HTTPClient.Transport.(*http.Transport)
require.True(t, ok, "expected HTTPClient.Transport to be *http.Transport")
require.NotSame(t, http.DefaultTransport, tr, "transport should be a clone, not the global DefaultTransport")
// Ensure TLSClientConfig is set
require.IsType(t, &tls.Config{}, tr.TLSClientConfig)
// Defaults from http.DefaultTransport.Clone() should be preserved
require.Greater(t, tr.IdleConnTimeout, time.Duration(0), "IdleConnTimeout should be non-zero")
require.Positive(t, tr.MaxIdleConns, "MaxIdleConns should be non-zero")
require.Greater(t, tr.TLSHandshakeTimeout, time.Duration(0), "TLSHandshakeTimeout should be non-zero")
}

View File

@@ -7,6 +7,7 @@
# p, <role/user/group>, <resource>, <action>, <object>, <allow/deny>
p, role:readonly, applications, get, */*, allow
p, role:readonly, applicationsets, get, */*, allow
p, role:readonly, certificates, get, *, allow
p, role:readonly, clusters, get, *, allow
p, role:readonly, repositories, get, *, allow
1 # Built-in policy which defines two roles: role:readonly and role:admin,
7 # p, <role/user/group>, <resource>, <action>, <object>, <allow/deny>
8 p, role:readonly, applications, get, */*, allow
9 p, role:readonly, certificates, get, *, allow p, role:readonly, applicationsets, get, */*, allow
10 p, role:readonly, certificates, get, *, allow
11 p, role:readonly, clusters, get, *, allow
12 p, role:readonly, repositories, get, *, allow
13 p, role:readonly, write-repositories, get, *, allow

View File

@@ -205,6 +205,12 @@ data:
reposerver.streamed.manifest.max.tar.size: "100M"
# Maximum size of extracted manifests when streaming manifests to the repo server for generation
reposerver.streamed.manifest.max.extracted.size: "1G"
# Maximum size of extracted manifests when streaming manifests to the repo server for generation
reposerver.oci.manifest.max.extracted.size: "1G"
# Whether to disable manifest size check for OCI artifacts
reposerver.disable.oci.manifest.max.extracted.size: "false"
# The allowlist of the OCI media types which the repo-server will make use of. If an OCI media type for a given artifact is not in the given list, the repo-server will return an error.
reposerver.oci.layer.media.types: "application/vnd.oci.image.layer.v1.tar,application/vnd.oci.image.layer.v1.tar+gzip,application/vnd.cncf.helm.chart.content.v1.tar+gzip"
# Enable git submodule support
reposerver.enable.git.submodule: "true"
# Number of concurrent git ls-remote requests. Any value less than 1 means no limit.

View File

@@ -11,4 +11,12 @@ Eg, `https://github.com/argoproj/argo-cd/manifests/ha/cluster-install?ref=v2.14.
## Upgraded Helm Version
Helm was upgraded to 3.16.2 and the skipSchemaValidation Flag was added to
the [CLI and Application CR](https://argo-cd.readthedocs.io/en/latest/user-guide/helm/#helm-skip-schema-validation).
the [CLI and Application CR](https://argo-cd.readthedocs.io/en/latest/user-guide/helm/#helm-skip-schema-validation).
## Breaking Changes
## Sanitized project API response
Due to security reasons ([GHSA-786q-9hcg-v9ff](https://github.com/argoproj/argo-cd/security/advisories/GHSA-786q-9hcg-v9ff)),
the project API response was sanitized to remove sensitive information. This includes
credentials of project-scoped repositories and clusters.

View File

@@ -492,3 +492,9 @@ resource.customizations.ignoreDifferences.apiextensions.k8s.io_CustomResourceDef
```
More details for ignored resource updates in the [Diffing customization](../../user-guide/diffing.md) documentation.
### Sanitized project API response
Due to security reasons ([GHSA-786q-9hcg-v9ff](https://github.com/argoproj/argo-cd/security/advisories/GHSA-786q-9hcg-v9ff)),
the project API response was sanitized to remove sensitive information. This includes
credentials of project-scoped repositories and clusters.

View File

@@ -55,3 +55,11 @@ Argo CD v3.1 upgrades the bundled Helm version to 3.18.4. There are no breaking
Argo CD v3.1 upgrades the bundled Kustomize version to 5.7.0. There are no breaking changes in Kustomize 5.7 according
to the [release notes](https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv5.7.0).
## Breaking Changes
## Sanitized project API response
Due to security reasons ([GHSA-786q-9hcg-v9ff](https://github.com/argoproj/argo-cd/security/advisories/GHSA-786q-9hcg-v9ff)),
the project API response was sanitized to remove sensitive information. This includes
credentials of project-scoped repositories and clusters.

5
go.mod
View File

@@ -33,8 +33,9 @@ require (
github.com/felixge/httpsnoop v1.0.4
github.com/fsnotify/fsnotify v1.9.0
github.com/gfleury/go-bitbucket-v1 v0.0.0-20240917142304-df385efaac68
github.com/go-git/go-git/v5 v5.16.2
github.com/go-jose/go-jose/v4 v4.1.0
// DO NOT BUMP UNTIL go-git/go-git#1551 is fixed
github.com/go-git/go-git/v5 v5.14.0
github.com/go-jose/go-jose/v4 v4.1.2
github.com/go-logr/logr v1.4.3
github.com/go-openapi/loads v0.22.0
github.com/go-openapi/runtime v0.28.0

8
go.sum
View File

@@ -301,13 +301,13 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN
github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
github.com/go-git/go-git/v5 v5.16.2 h1:fT6ZIOjE5iEnkzKyxTHK1W4HGAsPhqEqiSAssSO77hM=
github.com/go-git/go-git/v5 v5.16.2/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8=
github.com/go-git/go-git/v5 v5.14.0 h1:/MD3lCrGjCen5WfEAzKg00MJJffKhC8gzS80ycmCi60=
github.com/go-git/go-git/v5 v5.14.0/go.mod h1:Z5Xhoia5PcWA3NF8vRLURn9E5FRhSl7dGj9ItW3Wk5k=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-jose/go-jose/v4 v4.1.0 h1:cYSYxd3pw5zd2FSXk2vGdn9igQU2PS8MuxrCOCl0FdY=
github.com/go-jose/go-jose/v4 v4.1.0/go.mod h1:GG/vqmYm3Von2nYiB2vGTXzdoNKE5tix5tuc6iAd+sw=
github.com/go-jose/go-jose/v4 v4.1.2 h1:TK/7NqRQZfgAh+Td8AlsrvtPoUyiHh0LqVvokh+1vHI=
github.com/go-jose/go-jose/v4 v4.1.2/go.mod h1:22cg9HWM1pOlnRiY+9cQYJ9XHmya1bYW8OeDM6Ku6Oo=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=

View File

@@ -12,4 +12,4 @@ resources:
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v3.1.0
newTag: v3.1.2

View File

@@ -5,7 +5,7 @@ kind: Kustomization
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v3.1.0
newTag: v3.1.2
resources:
- ./application-controller
- ./dex

View File

@@ -197,6 +197,24 @@ spec:
name: argocd-cmd-params-cm
key: reposerver.disable.helm.manifest.max.extracted.size
optional: true
- name: ARGOCD_REPO_SERVER_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_LAYER_MEDIA_TYPES
valueFrom:
configMapKeyRef:
key: reposerver.oci.layer.media.types
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
valueFrom:
configMapKeyRef:

View File

@@ -24699,7 +24699,7 @@ spec:
key: applicationsetcontroller.requeue.after
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -24825,7 +24825,7 @@ spec:
key: log.format.timestamp
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -24953,7 +24953,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -25184,6 +25184,24 @@ spec:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_LAYER_MEDIA_TYPES
valueFrom:
configMapKeyRef:
key: reposerver.oci.layer.media.types
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
valueFrom:
configMapKeyRef:
@@ -25226,7 +25244,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -25278,7 +25296,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -25620,7 +25638,7 @@ spec:
optional: true
- name: KUBECACHEDIR
value: /tmp/kubecache
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -24667,7 +24667,7 @@ spec:
key: applicationsetcontroller.requeue.after
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -24787,7 +24787,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -25018,6 +25018,24 @@ spec:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_LAYER_MEDIA_TYPES
valueFrom:
configMapKeyRef:
key: reposerver.oci.layer.media.types
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
valueFrom:
configMapKeyRef:
@@ -25060,7 +25078,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -25112,7 +25130,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -25454,7 +25472,7 @@ spec:
optional: true
- name: KUBECACHEDIR
value: /tmp/kubecache
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -12,4 +12,4 @@ resources:
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v3.1.0
newTag: v3.1.2

View File

@@ -12,7 +12,7 @@ patches:
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v3.1.0
newTag: v3.1.2
resources:
- ../../base/application-controller
- ../../base/applicationset-controller

View File

@@ -26065,7 +26065,7 @@ spec:
key: applicationsetcontroller.requeue.after
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -26191,7 +26191,7 @@ spec:
key: log.format.timestamp
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -26342,7 +26342,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -26438,7 +26438,7 @@ spec:
key: notificationscontroller.repo.server.plaintext
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -26562,7 +26562,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -26819,6 +26819,24 @@ spec:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_LAYER_MEDIA_TYPES
valueFrom:
configMapKeyRef:
key: reposerver.oci.layer.media.types
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
valueFrom:
configMapKeyRef:
@@ -26861,7 +26879,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -26913,7 +26931,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -27287,7 +27305,7 @@ spec:
key: server.sync.replace.allowed
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -27665,7 +27683,7 @@ spec:
optional: true
- name: KUBECACHEDIR
value: /tmp/kubecache
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -26035,7 +26035,7 @@ spec:
key: applicationsetcontroller.requeue.after
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -26178,7 +26178,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -26274,7 +26274,7 @@ spec:
key: notificationscontroller.repo.server.plaintext
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -26398,7 +26398,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -26655,6 +26655,24 @@ spec:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_LAYER_MEDIA_TYPES
valueFrom:
configMapKeyRef:
key: reposerver.oci.layer.media.types
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
valueFrom:
configMapKeyRef:
@@ -26697,7 +26715,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -26749,7 +26767,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -27123,7 +27141,7 @@ spec:
key: server.sync.replace.allowed
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -27501,7 +27519,7 @@ spec:
optional: true
- name: KUBECACHEDIR
value: /tmp/kubecache
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -1868,7 +1868,7 @@ spec:
key: applicationsetcontroller.requeue.after
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -1994,7 +1994,7 @@ spec:
key: log.format.timestamp
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -2145,7 +2145,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -2241,7 +2241,7 @@ spec:
key: notificationscontroller.repo.server.plaintext
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -2365,7 +2365,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -2622,6 +2622,24 @@ spec:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_LAYER_MEDIA_TYPES
valueFrom:
configMapKeyRef:
key: reposerver.oci.layer.media.types
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
valueFrom:
configMapKeyRef:
@@ -2664,7 +2682,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -2716,7 +2734,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -3090,7 +3108,7 @@ spec:
key: server.sync.replace.allowed
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -3468,7 +3486,7 @@ spec:
optional: true
- name: KUBECACHEDIR
value: /tmp/kubecache
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -1838,7 +1838,7 @@ spec:
key: applicationsetcontroller.requeue.after
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -1981,7 +1981,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -2077,7 +2077,7 @@ spec:
key: notificationscontroller.repo.server.plaintext
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -2201,7 +2201,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -2458,6 +2458,24 @@ spec:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_LAYER_MEDIA_TYPES
valueFrom:
configMapKeyRef:
key: reposerver.oci.layer.media.types
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
valueFrom:
configMapKeyRef:
@@ -2500,7 +2518,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -2552,7 +2570,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -2926,7 +2944,7 @@ spec:
key: server.sync.replace.allowed
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -3304,7 +3322,7 @@ spec:
optional: true
- name: KUBECACHEDIR
value: /tmp/kubecache
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -25159,7 +25159,7 @@ spec:
key: applicationsetcontroller.requeue.after
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -25285,7 +25285,7 @@ spec:
key: log.format.timestamp
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -25436,7 +25436,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -25532,7 +25532,7 @@ spec:
key: notificationscontroller.repo.server.plaintext
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -25634,7 +25634,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -25865,6 +25865,24 @@ spec:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_LAYER_MEDIA_TYPES
valueFrom:
configMapKeyRef:
key: reposerver.oci.layer.media.types
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
valueFrom:
configMapKeyRef:
@@ -25907,7 +25925,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -25959,7 +25977,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -26331,7 +26349,7 @@ spec:
key: server.sync.replace.allowed
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -26709,7 +26727,7 @@ spec:
optional: true
- name: KUBECACHEDIR
value: /tmp/kubecache
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-application-controller
ports:

34
manifests/install.yaml generated
View File

@@ -25127,7 +25127,7 @@ spec:
key: applicationsetcontroller.requeue.after
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -25270,7 +25270,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -25366,7 +25366,7 @@ spec:
key: notificationscontroller.repo.server.plaintext
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -25468,7 +25468,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -25699,6 +25699,24 @@ spec:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_LAYER_MEDIA_TYPES
valueFrom:
configMapKeyRef:
key: reposerver.oci.layer.media.types
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
valueFrom:
configMapKeyRef:
@@ -25741,7 +25759,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -25793,7 +25811,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -26165,7 +26183,7 @@ spec:
key: server.sync.replace.allowed
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -26543,7 +26561,7 @@ spec:
optional: true
- name: KUBECACHEDIR
value: /tmp/kubecache
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -962,7 +962,7 @@ spec:
key: applicationsetcontroller.requeue.after
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -1088,7 +1088,7 @@ spec:
key: log.format.timestamp
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -1239,7 +1239,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -1335,7 +1335,7 @@ spec:
key: notificationscontroller.repo.server.plaintext
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -1437,7 +1437,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -1668,6 +1668,24 @@ spec:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_LAYER_MEDIA_TYPES
valueFrom:
configMapKeyRef:
key: reposerver.oci.layer.media.types
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
valueFrom:
configMapKeyRef:
@@ -1710,7 +1728,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -1762,7 +1780,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -2134,7 +2152,7 @@ spec:
key: server.sync.replace.allowed
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -2512,7 +2530,7 @@ spec:
optional: true
- name: KUBECACHEDIR
value: /tmp/kubecache
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -930,7 +930,7 @@ spec:
key: applicationsetcontroller.requeue.after
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -1073,7 +1073,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -1169,7 +1169,7 @@ spec:
key: notificationscontroller.repo.server.plaintext
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -1271,7 +1271,7 @@ spec:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
@@ -1502,6 +1502,24 @@ spec:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_OCI_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.oci.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_OCI_LAYER_MEDIA_TYPES
valueFrom:
configMapKeyRef:
key: reposerver.oci.layer.media.types
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
valueFrom:
configMapKeyRef:
@@ -1544,7 +1562,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -1596,7 +1614,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -1968,7 +1986,7 @@ spec:
key: server.sync.replace.allowed
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -2346,7 +2364,7 @@ spec:
optional: true
- name: KUBECACHEDIR
value: /tmp/kubecache
image: quay.io/argoproj/argocd:v3.1.0
image: quay.io/argoproj/argocd:v3.1.2
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -347,7 +347,6 @@ func (repo *Repository) Sanitized() *Repository {
Repo: repo.Repo,
Type: repo.Type,
Name: repo.Name,
Username: repo.Username,
Insecure: repo.IsInsecure(),
EnableLFS: repo.EnableLFS,
EnableOCI: repo.EnableOCI,

View File

@@ -2234,6 +2234,32 @@ type Cluster struct {
Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,13,opt,name=annotations"`
}
func (c *Cluster) Sanitized() *Cluster {
return &Cluster{
ID: c.ID,
Server: c.Server,
Name: c.Name,
Project: c.Project,
Namespaces: c.Namespaces,
Shard: c.Shard,
Labels: c.Labels,
Annotations: c.Annotations,
ClusterResources: c.ClusterResources,
ConnectionState: c.ConnectionState,
ServerVersion: c.ServerVersion,
Info: c.Info,
RefreshRequestedAt: c.RefreshRequestedAt,
Config: ClusterConfig{
AWSAuthConfig: c.Config.AWSAuthConfig,
ProxyUrl: c.Config.ProxyUrl,
DisableCompression: c.Config.DisableCompression,
TLSClientConfig: TLSClientConfig{
Insecure: c.Config.Insecure,
},
},
}
}
// Equals returns true if two cluster objects are considered to be equal
func (c *Cluster) Equals(other *Cluster) bool {
if c.Server != other.Server {

View File

@@ -4543,3 +4543,58 @@ func TestCluster_ParseProxyUrl(t *testing.T) {
}
}
}
func TestSanitized(t *testing.T) {
now := metav1.Now()
cluster := &Cluster{
ID: "123",
Server: "https://example.com",
Name: "example",
ServerVersion: "v1.0.0",
Namespaces: []string{"default", "kube-system"},
Project: "default",
Labels: map[string]string{
"env": "production",
},
Annotations: map[string]string{
"annotation-key": "annotation-value",
},
ConnectionState: ConnectionState{
Status: ConnectionStatusSuccessful,
Message: "Connection successful",
ModifiedAt: &now,
},
Config: ClusterConfig{
Username: "admin",
Password: "password123",
BearerToken: "abc",
TLSClientConfig: TLSClientConfig{
Insecure: true,
},
ExecProviderConfig: &ExecProviderConfig{
Command: "test",
},
},
}
assert.Equal(t, &Cluster{
ID: "123",
Server: "https://example.com",
Name: "example",
ServerVersion: "v1.0.0",
Namespaces: []string{"default", "kube-system"},
Project: "default",
Labels: map[string]string{"env": "production"},
Annotations: map[string]string{"annotation-key": "annotation-value"},
ConnectionState: ConnectionState{
Status: ConnectionStatusSuccessful,
Message: "Connection successful",
ModifiedAt: &now,
},
Config: ClusterConfig{
TLSClientConfig: TLSClientConfig{
Insecure: true,
},
},
}, cluster.Sanitized())
}

View File

@@ -2,3 +2,8 @@ actionTests:
- action: refresh
inputPath: testdata/external-secret.yaml
expectedOutputPath: testdata/external-secret-updated.yaml
discoveryTests:
- inputPath: testdata/external-secret.yaml
result:
- name: "refresh"

View File

@@ -3,11 +3,13 @@ local actions = {}
local disable_refresh = false
local time_units = {"ns", "us", "µs", "ms", "s", "m", "h"}
local digits = obj.spec.refreshInterval
for _, time_unit in ipairs(time_units) do
digits, _ = digits:gsub(time_unit, "")
if tonumber(digits) == 0 then
disable_refresh = true
break
if digits ~= nil then
digits = tostring(digits)
for _, time_unit in ipairs(time_units) do
if digits == "0" or digits == "0" .. time_unit then
disable_refresh = true
break
end
end
end

View File

@@ -2,3 +2,8 @@ actionTests:
- action: push
inputPath: testdata/push-secret.yaml
expectedOutputPath: testdata/push-secret-updated.yaml
discoveryTests:
- inputPath: testdata/push-secret.yaml
result:
- name: "push"

View File

@@ -3,11 +3,13 @@ local actions = {}
local disable_push = false
local time_units = {"ns", "us", "µs", "ms", "s", "m", "h"}
local digits = obj.spec.refreshInterval
for _, time_unit in ipairs(time_units) do
digits, _ = digits:gsub(time_unit, "")
if tonumber(digits) == 0 then
disable_push = true
break
if digits ~= nil then
digits = tostring(digits)
for _, time_unit in ipairs(time_units) do
if digits == "0" or digits == "0" .. time_unit then
disable_push = true
break
end
end
end

View File

@@ -15,4 +15,7 @@ end
if forcePromote then
actions["force-promote"]["disabled"] = false
else
actions["force-promote"]["disabled"] = true
actions["force-promote"]["disabled"] = true
end
return actions

View File

@@ -7,4 +7,28 @@ actionTests:
expectedOutputPath: testdata/monovertex.yaml
- action: force-promote
inputPath: testdata/monovertex.yaml
expectedOutputPath: testdata/monovertex-force-promote.yaml
expectedOutputPath: testdata/monovertex-force-promote.yaml
discoveryTests:
- inputPath: testdata/monovertex.yaml
result:
- name: pause
disabled: false
iconClass: 'fa-solid fa-fw fa-pause'
- name: unpause
disabled: true
iconClass: 'fa-solid fa-fw fa-play'
- name: force-promote
disabled: false
iconClass: 'fa-solid fa-fw fa-forward'
- inputPath: testdata/monovertex-paused.yaml
result:
- name: pause
disabled: true
iconClass: 'fa-solid fa-fw fa-pause'
- name: unpause
disabled: false
iconClass: 'fa-solid fa-fw fa-play'
- name: force-promote
disabled: false
iconClass: 'fa-solid fa-fw fa-forward'

View File

@@ -34,4 +34,7 @@ end
if forcePromote then
actions["force-promote"]["disabled"] = false
else
actions["force-promote"]["disabled"] = true
actions["force-promote"]["disabled"] = true
end
return actions

View File

@@ -7,4 +7,28 @@ actionTests:
expectedOutputPath: testdata/pipeline.yaml
- action: force-promote
inputPath: testdata/pipeline.yaml
expectedOutputPath: testdata/pipeline-force-promote.yaml
expectedOutputPath: testdata/pipeline-force-promote.yaml
discoveryTests:
- inputPath: testdata/pipeline.yaml
result:
- name: pause
disabled: false
iconClass: 'fa-solid fa-fw fa-pause'
- name: unpause
disabled: true
iconClass: 'fa-solid fa-fw fa-play'
- name: force-promote
disabled: false
iconClass: 'fa-solid fa-fw fa-forward'
- inputPath: testdata/pipeline-paused.yaml
result:
- name: pause
disabled: true
iconClass: 'fa-solid fa-fw fa-pause'
- name: unpause
disabled: false
iconClass: 'fa-solid fa-fw fa-play'
- name: force-promote
disabled: false
iconClass: 'fa-solid fa-fw fa-forward'

View File

@@ -34,4 +34,7 @@ end
if forcePromote then
actions["force-promote"]["disabled"] = false
else
actions["force-promote"]["disabled"] = true
actions["force-promote"]["disabled"] = true
end
return actions

View File

@@ -4,6 +4,13 @@ if obj.spec.suspend ~= nil and obj.spec.suspend == true then
hs.status = "Suspended"
return hs
end
-- Helm repositories of type "oci" do not contain any information in the status
-- https://fluxcd.io/flux/components/source/helmrepositories/#helmrepository-status
if obj.spec.type ~= nil and obj.spec.type == "oci" then
hs.message = "Helm repositories of type 'oci' do not contain any information in the status."
hs.status = "Healthy"
return hs
end
if obj.status ~= nil then
if obj.status.conditions ~= nil then
local numProgressing = 0

View File

@@ -11,3 +11,7 @@ tests:
status: Healthy
message: Succeeded
inputPath: testdata/healthy.yaml
- healthStatus:
status: Healthy
message: "Helm repositories of type 'oci' do not contain any information in the status."
inputPath: testdata/oci.yaml

View File

@@ -0,0 +1,10 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: podinfo
namespace: default
spec:
type: "oci"
interval: 5m0s
url: oci://ghcr.io/stefanprodan/charts
status: {}

View File

@@ -471,19 +471,8 @@ func (s *Server) RotateAuth(ctx context.Context, q *cluster.ClusterQuery) (*clus
}
func (s *Server) toAPIResponse(clust *appv1.Cluster) *appv1.Cluster {
clust = clust.Sanitized()
_ = s.cache.GetClusterInfo(clust.Server, &clust.Info)
clust.Config.Password = ""
clust.Config.BearerToken = ""
clust.Config.KeyData = nil
if clust.Config.ExecProviderConfig != nil {
// We can't know what the user has put into args or
// env vars on the exec provider that might be sensitive
// (e.g. --private-key=XXX, PASSWORD=XXX)
// Implicitly assumes the command executable name is non-sensitive
clust.Config.ExecProviderConfig.Env = make(map[string]string)
clust.Config.ExecProviderConfig.Args = nil
}
// populate deprecated fields for backward compatibility
//nolint:staticcheck
clust.ServerVersion = clust.Info.ServerVersion

View File

@@ -310,12 +310,20 @@ func (s *Server) GetDetailedProject(ctx context.Context, q *project.ProjectQuery
}
proj.NormalizeJWTTokens()
globalProjects := argo.GetGlobalProjects(proj, listersv1alpha1.NewAppProjectLister(s.projInformer.GetIndexer()), s.settingsMgr)
var apiRepos []*v1alpha1.Repository
for _, repo := range repositories {
apiRepos = append(apiRepos, repo.Normalize().Sanitized())
}
var apiClusters []*v1alpha1.Cluster
for _, cluster := range clusters {
apiClusters = append(apiClusters, cluster.Sanitized())
}
return &project.DetailedProjectsResponse{
GlobalProjects: globalProjects,
Project: proj,
Repositories: repositories,
Clusters: clusters,
Repositories: apiRepos,
Clusters: apiClusters,
}, err
}

View File

@@ -313,7 +313,7 @@ func TestRepositoryServer(t *testing.T) {
testRepo := &appsv1.Repository{
Repo: url,
Type: "git",
Username: "foo",
Username: "",
InheritedCreds: true,
}
db.On("ListRepositories", t.Context()).Return([]*appsv1.Repository{testRepo}, nil)

View File

@@ -12,7 +12,7 @@ FROM docker.io/library/golang:1.24.6@sha256:2c89c41fb9efc3807029b59af69645867cfe
FROM docker.io/library/registry:3.0@sha256:1fc7de654f2ac1247f0b67e8a459e273b0993be7d2beda1f3f56fbf1001ed3e7 AS registry
FROM docker.io/bitnami/kubectl:1.32@sha256:493d1b871556d48d6b25d471f192c2427571cd6f78523eebcaf4d263353c7487 AS kubectl
FROM docker.io/bitnamilegacy/kubectl:1.32@sha256:493d1b871556d48d6b25d471f192c2427571cd6f78523eebcaf4d263353c7487 AS kubectl
FROM docker.io/library/ubuntu:24.04@sha256:1e622c5f073b4f6bfad6632f2616c7f59ef256e96fe78bf6a595d1dc4376ac02

View File

@@ -548,65 +548,73 @@ export const deletePopup = async (
};
export async function getResourceActionsMenuItems(resource: ResourceTreeNode, metadata: models.ObjectMeta, apis: ContextApis): Promise<ActionMenuItem[]> {
return services.applications.getResourceActions(metadata.name, metadata.namespace, resource).then(actions => {
return actions.map(action => ({
title: action.displayName ?? action.name,
disabled: !!action.disabled,
iconClassName: action.iconClass,
action: async () => {
const confirmed = false;
const title = action.params ? `Enter input parameters for action: ${action.name}` : `Perform ${action.name} action?`;
await apis.popup.prompt(
title,
api => (
<div>
{!action.params && (
<div className='argo-form-row'>
<div> Are you sure you want to perform {action.name} action?</div>
</div>
)}
{action.params &&
action.params.map((param, index) => (
<div className='argo-form-row' key={index}>
<FormField label={param.name} field={param.name} formApi={api} component={Text} />
// Don't call API for missing resources
if (!resource.uid) {
return [];
}
return services.applications
.getResourceActions(metadata.name, metadata.namespace, resource)
.then(actions => {
return actions.map(action => ({
title: action.displayName ?? action.name,
disabled: !!action.disabled,
iconClassName: action.iconClass,
action: async () => {
const confirmed = false;
const title = action.params ? `Enter input parameters for action: ${action.name}` : `Perform ${action.name} action?`;
await apis.popup.prompt(
title,
api => (
<div>
{!action.params && (
<div className='argo-form-row'>
<div> Are you sure you want to perform {action.name} action?</div>
</div>
))}
</div>
),
{
submit: async (vals, _, close) => {
try {
const resourceActionParameters = action.params
? action.params.map(param => ({
name: param.name,
value: vals[param.name] || param.default,
type: param.type,
default: param.default
}))
: [];
await services.applications.runResourceAction(metadata.name, metadata.namespace, resource, action.name, resourceActionParameters);
close();
} catch (e) {
apis.notifications.show({
content: <ErrorNotification title='Unable to execute resource action' e={e} />,
type: NotificationType.Error
});
)}
{action.params &&
action.params.map((param, index) => (
<div className='argo-form-row' key={index}>
<FormField label={param.name} field={param.name} formApi={api} component={Text} />
</div>
))}
</div>
),
{
submit: async (vals, _, close) => {
try {
const resourceActionParameters = action.params
? action.params.map(param => ({
name: param.name,
value: vals[param.name] || param.default,
type: param.type,
default: param.default
}))
: [];
await services.applications.runResourceAction(metadata.name, metadata.namespace, resource, action.name, resourceActionParameters);
close();
} catch (e) {
apis.notifications.show({
content: <ErrorNotification title='Unable to execute resource action' e={e} />,
type: NotificationType.Error
});
}
}
}
},
null,
null,
action.params
? action.params.reduce((acc, res) => {
acc[res.name] = res.default;
return acc;
}, {} as any)
: {}
);
return confirmed;
}
}));
});
},
null,
null,
action.params
? action.params.reduce((acc, res) => {
acc[res.name] = res.default;
return acc;
}, {} as any)
: {}
);
return confirmed;
}
}));
})
.catch(() => [] as ActionMenuItem[]);
}
function getActionItems(
@@ -694,20 +702,22 @@ function getActionItems(
const resourceActions = getResourceActionsMenuItems(resource, application.metadata, apis);
const links = services.applications
.getResourceLinks(application.metadata.name, application.metadata.namespace, resource)
.then(data => {
return (data.items || []).map(
link =>
({
title: link.title,
iconClassName: `fa fa-fw ${link.iconClass ? link.iconClass : 'fa-external-link'}`,
action: () => window.open(link.url, '_blank'),
tooltip: link.description
}) as MenuItem
);
})
.catch(() => [] as MenuItem[]);
const links = !resource.uid
? Promise.resolve([])
: services.applications
.getResourceLinks(application.metadata.name, application.metadata.namespace, resource)
.then(data => {
return (data.items || []).map(
link =>
({
title: link.title,
iconClassName: `fa fa-fw ${link.iconClass ? link.iconClass : 'fa-external-link'}`,
action: () => window.open(link.url, '_blank'),
tooltip: link.description
}) as MenuItem
);
})
.catch(() => [] as MenuItem[]);
return combineLatest(
from([items]), // this resolves immediately

View File

@@ -94,12 +94,14 @@ func (db *db) ListClusters(_ context.Context) (*appv1.ClusterList, error) {
// CreateCluster creates a cluster
func (db *db) CreateCluster(ctx context.Context, c *appv1.Cluster) (*appv1.Cluster, error) {
settings, err := db.settingsMgr.GetSettings()
if err != nil {
return nil, err
}
if c.Server == appv1.KubernetesInternalAPIServerAddr && !settings.InClusterEnabled {
return nil, status.Errorf(codes.InvalidArgument, "cannot register cluster: in-cluster has been disabled")
if c.Server == appv1.KubernetesInternalAPIServerAddr {
settings, err := db.settingsMgr.GetSettings()
if err != nil {
return nil, err
}
if !settings.InClusterEnabled {
return nil, status.Errorf(codes.InvalidArgument, "cannot register cluster: in-cluster has been disabled")
}
}
secName, err := URIToSecretName("cluster", c.Server)
if err != nil {
@@ -226,12 +228,14 @@ func (db *db) getClusterSecret(server string) (*corev1.Secret, error) {
// GetCluster returns a cluster from a query
func (db *db) GetCluster(_ context.Context, server string) (*appv1.Cluster, error) {
argoSettings, err := db.settingsMgr.GetSettings()
if err != nil {
return nil, err
}
if server == appv1.KubernetesInternalAPIServerAddr && !argoSettings.InClusterEnabled {
return nil, status.Errorf(codes.NotFound, "cluster %q is disabled", server)
if server == appv1.KubernetesInternalAPIServerAddr {
argoSettings, err := db.settingsMgr.GetSettings()
if err != nil {
return nil, err
}
if !argoSettings.InClusterEnabled {
return nil, status.Errorf(codes.NotFound, "cluster %q is disabled", server)
}
}
informer, err := db.settingsMgr.GetSecretsInformer()

View File

@@ -710,6 +710,7 @@ func (creds AzureWorkloadIdentityCreds) Environ() (io.Closer, []string, error) {
}
nonce := creds.store.Add("", token)
env := creds.store.Environ(nonce)
env = append(env, fmt.Sprintf("%s=Authorization: Bearer %s", bearerAuthHeaderEnv, token))
return utilio.NewCloser(func() error {
creds.store.Remove(nonce)

View File

@@ -419,7 +419,7 @@ func TestAzureWorkloadIdentityCreds_Environ(t *testing.T) {
workloadIdentityMock := new(mocks.TokenProvider)
workloadIdentityMock.On("GetToken", azureDevopsEntraResourceId).Return(&workloadidentity.Token{AccessToken: "accessToken", ExpiresOn: time.Now().Add(time.Minute)}, nil)
creds := AzureWorkloadIdentityCreds{store, workloadIdentityMock}
_, _, err := creds.Environ()
_, env, err := creds.Environ()
require.NoError(t, err)
assert.Len(t, store.creds, 1)
@@ -427,6 +427,9 @@ func TestAzureWorkloadIdentityCreds_Environ(t *testing.T) {
assert.Empty(t, value.username)
assert.Equal(t, "accessToken", value.password)
}
require.Len(t, env, 1)
assert.Equal(t, "ARGOCD_GIT_BEARER_AUTH_HEADER=Authorization: Bearer accessToken", env[0], "ARGOCD_GIT_BEARER_AUTH_HEADER env var must be set")
}
func TestAzureWorkloadIdentityCreds_Environ_cleanup(t *testing.T) {

View File

@@ -1,13 +1,14 @@
package git
import (
"crypto/fips140"
"fmt"
gitssh "github.com/go-git/go-git/v5/plumbing/transport/ssh"
"golang.org/x/crypto/ssh"
)
// List of all currently supported algorithms for SSH key exchange
// SupportedSSHKeyExchangeAlgorithms is a list of all currently supported algorithms for SSH key exchange
// Unfortunately, crypto/ssh does not offer public constants or list for
// this.
var SupportedSSHKeyExchangeAlgorithms = []string{
@@ -21,10 +22,15 @@ var SupportedSSHKeyExchangeAlgorithms = []string{
"diffie-hellman-group14-sha1",
}
// List of default key exchange algorithms to use. We use those that are
// available by default, we can become more opinionated later on (when
// we support configuration of algorithms to use).
var DefaultSSHKeyExchangeAlgorithms = SupportedSSHKeyExchangeAlgorithms
// SupportedFIPSCompliantSSHKeyExchangeAlgorithms is a list of all currently supported algorithms for SSH key exchange
// that are FIPS compliant
var SupportedFIPSCompliantSSHKeyExchangeAlgorithms = []string{
"ecdh-sha2-nistp256",
"ecdh-sha2-nistp384",
"ecdh-sha2-nistp521",
"diffie-hellman-group-exchange-sha256",
"diffie-hellman-group14-sha256",
}
// PublicKeysWithOptions is an auth method for go-git's SSH client that
// inherits from PublicKeys, but provides the possibility to override
@@ -51,9 +57,17 @@ func (a *PublicKeysWithOptions) ClientConfig() (*ssh.ClientConfig, error) {
if len(a.KexAlgorithms) > 0 {
kexAlgos = a.KexAlgorithms
} else {
kexAlgos = DefaultSSHKeyExchangeAlgorithms
kexAlgos = getDefaultSSHKeyExchangeAlgorithms()
}
config := ssh.Config{KeyExchanges: kexAlgos}
opts := &ssh.ClientConfig{Config: config, User: a.User, Auth: []ssh.AuthMethod{ssh.PublicKeys(a.Signer)}}
return a.SetHostKeyCallback(opts)
}
// getDefaultSSHKeyExchangeAlgorithms returns the default key exchange algorithms to be used
func getDefaultSSHKeyExchangeAlgorithms() []string {
if fips140.Enabled() {
return SupportedFIPSCompliantSSHKeyExchangeAlgorithms
}
return SupportedSSHKeyExchangeAlgorithms
}

View File

@@ -49,101 +49,101 @@ The command removes all the Kubernetes components associated with the chart and
The following table lists the configurable parameters of the Redis chart and their default values.
| Parameter | Description | Default |
|--------------------------------------------|----------------------------------------------------------------------------------------------------------------|--------------------------------------|
| `image.registry` | Redis Image registry | `docker.io` |
| `image.repository` | Redis Image name | `bitnami/redis` |
| `image.tag` | Redis Image tag | `{VERSION}` |
| `image.pullPolicy` | Image pull policy | `Always` |
| `image.pullSecrets` | Specify docker-registry secret names as an array | `nil` |
| `cluster.enabled` | Use master-slave topology | `true` |
| `cluster.slaveCount` | Number of slaves | 1 |
| `existingSecret` | Name of existing secret object (for password authentication) | `nil` |
| `usePassword` | Use password | `true` |
| `password` | Redis password (ignored if existingSecret set) | Randomly generated |
| `networkPolicy.enabled` | Enable NetworkPolicy | `false` |
| `networkPolicy.allowExternal` | Don't require client label for connections | `true` |
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `false` |
| `serviceAccount.name` | The name of the ServiceAccount to create | Generated using the fullname template |
| `rbac.create` | Specifies whether RBAC resources should be created | `false` |
| `rbac.role.rules` | Rules to create | `[]` |
| `metrics.enabled` | Start a side-car prometheus exporter | `false` |
| `metrics.image.registry` | Redis exporter image registry | `docker.io` |
| `metrics.image.repository` | Redis exporter image name | `bitnami/redis` |
| `metrics.image.tag` | Redis exporter image tag | `v0.20.2` |
| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` |
| `metrics.podLabels` | Additional labels for Metrics exporter pod | {} |
| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | {} |
| `master.service.type` | Kubernetes Service type (redis metrics) | `LoadBalancer` |
| `metrics.service.annotations` | Annotations for the services to monitor (redis master and redis slave service) | {} |
| `metrics.service.loadBalancerIP` | loadBalancerIP if redis metrics service type is `LoadBalancer` | `nil` |
| `metrics.resources` | Exporter resource requests/limit | Memory: `256Mi`, CPU: `100m` |
| `persistence.existingClaim` | Provide an existing PersistentVolumeClaim | `nil` |
| `master.persistence.enabled` | Use a PVC to persist data (master node) | `true` |
| `master.persistence.path` | Path to mount the volume at, to use other images | `/bitnami` |
| `master.persistence.subPath` | Subdirectory of the volume to mount at | `""` |
| `master.persistence.storageClass` | Storage class of backing PVC | `generic` |
| `master.persistence.accessModes` | Persistent Volume Access Modes | `[ReadWriteOnce]` |
| `master.persistence.size` | Size of data volume | `8Gi` |
| `master.statefulset.updateStrategy` | Update strategy for StatefulSet | onDelete |
| `master.statefulset.rollingUpdatePartition`| Partition update strategy | `nil` |
| `master.podLabels` | Additional labels for Redis master pod | {} |
| `master.podAnnotations` | Additional annotations for Redis master pod | {} |
| `master.port` | Redis master port | 6379 |
| `master.args` | Redis master command-line args | [] |
| `master.disableCommands` | Comma-separated list of Redis commands to disable (master) | `FLUSHDB,FLUSHALL` |
| `master.extraFlags` | Redis master additional command line flags | [] |
| `master.nodeSelector` | Redis master Node labels for pod assignment | {"kubernetes.io/arch": "amd64"} |
| `master.tolerations` | Toleration labels for Redis master pod assignment | [] |
| `master.affinity ` | Affinity settings for Redis master pod assignment | [] |
| `master.schedulerName` | Name of an alternate scheduler | `nil` |
| `master.service.type` | Kubernetes Service type (redis master) | `ClusterIP` |
| `master.service.annotations` | annotations for redis master service | {} |
| `master.service.loadBalancerIP` | loadBalancerIP if redis master service type is `LoadBalancer` | `nil` |
| `master.securityContext.enabled` | Enable security context (redis master pod) | `true` |
| `master.securityContext.fsGroup` | Group ID for the container (redis master pod) | `1001` |
| `master.securityContext.runAsUser` | User ID for the container (redis master pod) | `1001` |
| `master.resources` | Redis master CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `100m` |
| `master.livenessProbe.enabled` | Turn on and off liveness probe (redis master pod) | `true` |
| `master.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (redis master pod) | `30` |
| `master.livenessProbe.periodSeconds` | How often to perform the probe (redis master pod) | `30` |
| `master.livenessProbe.timeoutSeconds` | When the probe times out (redis master pod) | `5` |
| `master.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis master pod) | `1` |
| `master.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` |
| `master.readinessProbe.enabled` | Turn on and off readiness probe (redis master pod) | `true` |
| `master.readinessProbe.initialDelaySeconds`| Delay before readiness probe is initiated (redis master pod) | `5` |
| `master.readinessProbe.periodSeconds` | How often to perform the probe (redis master pod) | `10` |
| `master.readinessProbe.timeoutSeconds` | When the probe times out (redis master pod) | `1` |
| `master.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis master pod) | `1` |
| `master.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` |
| `slave.serviceType` | Kubernetes Service type (redis slave) | `LoadBalancer` |
| `slave.service.annotations` | annotations for redis slave service | {} |
| `slave.service.loadBalancerIP` | LoadBalancerIP if Redis slave service type is `LoadBalancer` | `nil` |
| `slave.port` | Redis slave port | `master.port` |
| `slave.args` | Redis slave command-line args | `master.args` |
| `slave.disableCommands` | Comma-separated list of Redis commands to disable (slave) | `master.disableCommands` |
| `slave.extraFlags` | Redis slave additional command line flags | `master.extraFlags` |
| `slave.livenessProbe.enabled` | Turn on and off liveness probe (redis slave pod) | `master.livenessProbe.enabled` |
| `slave.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (redis slave pod) | `master.livenessProbe.initialDelaySeconds` |
| `slave.livenessProbe.periodSeconds` | How often to perform the probe (redis slave pod) | `master.livenessProbe.periodSeconds` |
| `slave.livenessProbe.timeoutSeconds` | When the probe times out (redis slave pod) | `master.livenessProbe.timeoutSeconds` |
| `slave.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis slave pod) | `master.livenessProbe.successThreshold` |
| `slave.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `master.livenessProbe.failureThreshold` |
| `slave.readinessProbe.enabled` | Turn on and off slave.readiness probe (redis slave pod) | `master.readinessProbe.enabled` |
| `slave.readinessProbe.initialDelaySeconds` | Delay before slave.readiness probe is initiated (redis slave pod) | `master.readinessProbe.initialDelaySeconds` |
| `slave.readinessProbe.periodSeconds` | How often to perform the probe (redis slave pod) | `master.readinessProbe.periodSeconds` |
| `slave.readinessProbe.timeoutSeconds` | When the probe times out (redis slave pod) | `master.readinessProbe.timeoutSeconds` |
| `slave.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis slave pod) | `master.readinessProbe.successThreshold` |
| `slave.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. (redis slave pod) | `master.readinessProbe.failureThreshold` |
| `slave.podLabels` | Additional labels for Redis slave pod | `master.podLabels` |
| `slave.podAnnotations` | Additional annotations for Redis slave pod | `master.podAnnotations` |
| `slave.schedulerName` | Name of an alternate scheduler | `nil` |
| `slave.securityContext.enabled` | Enable security context (redis slave pod) | `master.securityContext.enabled` |
| `slave.securityContext.fsGroup` | Group ID for the container (redis slave pod) | `master.securityContext.fsGroup` |
| `slave.securityContext.runAsUser` | User ID for the container (redis slave pod) | `master.securityContext.runAsUser` |
| `slave.resources` | Redis slave CPU/Memory resource requests/limits | `master.resources` |
| `slave.affinity` | Enable node/pod affinity for slaves | {} |
| Parameter | Description | Default |
|--------------------------------------------|----------------------------------------------------------------------------------------------------------------|---------------------------------------------|
| `image.registry` | Redis Image registry | `docker.io` |
| `image.repository` | Redis Image name | `bitnamilegacy/redis` |
| `image.tag` | Redis Image tag | `{VERSION}` |
| `image.pullPolicy` | Image pull policy | `Always` |
| `image.pullSecrets` | Specify docker-registry secret names as an array | `nil` |
| `cluster.enabled` | Use master-slave topology | `true` |
| `cluster.slaveCount` | Number of slaves | 1 |
| `existingSecret` | Name of existing secret object (for password authentication) | `nil` |
| `usePassword` | Use password | `true` |
| `password` | Redis password (ignored if existingSecret set) | Randomly generated |
| `networkPolicy.enabled` | Enable NetworkPolicy | `false` |
| `networkPolicy.allowExternal` | Don't require client label for connections | `true` |
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `false` |
| `serviceAccount.name` | The name of the ServiceAccount to create | Generated using the fullname template |
| `rbac.create` | Specifies whether RBAC resources should be created | `false` |
| `rbac.role.rules` | Rules to create | `[]` |
| `metrics.enabled` | Start a side-car prometheus exporter | `false` |
| `metrics.image.registry` | Redis exporter image registry | `docker.io` |
| `metrics.image.repository` | Redis exporter image name | `bitnamilegacy/redis` |
| `metrics.image.tag` | Redis exporter image tag | `v0.20.2` |
| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` |
| `metrics.podLabels` | Additional labels for Metrics exporter pod | {} |
| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | {} |
| `master.service.type` | Kubernetes Service type (redis metrics) | `LoadBalancer` |
| `metrics.service.annotations` | Annotations for the services to monitor (redis master and redis slave service) | {} |
| `metrics.service.loadBalancerIP` | loadBalancerIP if redis metrics service type is `LoadBalancer` | `nil` |
| `metrics.resources` | Exporter resource requests/limit | Memory: `256Mi`, CPU: `100m` |
| `persistence.existingClaim` | Provide an existing PersistentVolumeClaim | `nil` |
| `master.persistence.enabled` | Use a PVC to persist data (master node) | `true` |
| `master.persistence.path` | Path to mount the volume at, to use other images | `/bitnami` |
| `master.persistence.subPath` | Subdirectory of the volume to mount at | `""` |
| `master.persistence.storageClass` | Storage class of backing PVC | `generic` |
| `master.persistence.accessModes` | Persistent Volume Access Modes | `[ReadWriteOnce]` |
| `master.persistence.size` | Size of data volume | `8Gi` |
| `master.statefulset.updateStrategy` | Update strategy for StatefulSet | onDelete |
| `master.statefulset.rollingUpdatePartition`| Partition update strategy | `nil` |
| `master.podLabels` | Additional labels for Redis master pod | {} |
| `master.podAnnotations` | Additional annotations for Redis master pod | {} |
| `master.port` | Redis master port | 6379 |
| `master.args` | Redis master command-line args | [] |
| `master.disableCommands` | Comma-separated list of Redis commands to disable (master) | `FLUSHDB,FLUSHALL` |
| `master.extraFlags` | Redis master additional command line flags | [] |
| `master.nodeSelector` | Redis master Node labels for pod assignment | {"kubernetes.io/arch": "amd64"} |
| `master.tolerations` | Toleration labels for Redis master pod assignment | [] |
| `master.affinity ` | Affinity settings for Redis master pod assignment | [] |
| `master.schedulerName` | Name of an alternate scheduler | `nil` |
| `master.service.type` | Kubernetes Service type (redis master) | `ClusterIP` |
| `master.service.annotations` | annotations for redis master service | {} |
| `master.service.loadBalancerIP` | loadBalancerIP if redis master service type is `LoadBalancer` | `nil` |
| `master.securityContext.enabled` | Enable security context (redis master pod) | `true` |
| `master.securityContext.fsGroup` | Group ID for the container (redis master pod) | `1001` |
| `master.securityContext.runAsUser` | User ID for the container (redis master pod) | `1001` |
| `master.resources` | Redis master CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `100m` |
| `master.livenessProbe.enabled` | Turn on and off liveness probe (redis master pod) | `true` |
| `master.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (redis master pod) | `30` |
| `master.livenessProbe.periodSeconds` | How often to perform the probe (redis master pod) | `30` |
| `master.livenessProbe.timeoutSeconds` | When the probe times out (redis master pod) | `5` |
| `master.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis master pod) | `1` |
| `master.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` |
| `master.readinessProbe.enabled` | Turn on and off readiness probe (redis master pod) | `true` |
| `master.readinessProbe.initialDelaySeconds`| Delay before readiness probe is initiated (redis master pod) | `5` |
| `master.readinessProbe.periodSeconds` | How often to perform the probe (redis master pod) | `10` |
| `master.readinessProbe.timeoutSeconds` | When the probe times out (redis master pod) | `1` |
| `master.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis master pod) | `1` |
| `master.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` |
| `slave.serviceType` | Kubernetes Service type (redis slave) | `LoadBalancer` |
| `slave.service.annotations` | annotations for redis slave service | {} |
| `slave.service.loadBalancerIP` | LoadBalancerIP if Redis slave service type is `LoadBalancer` | `nil` |
| `slave.port` | Redis slave port | `master.port` |
| `slave.args` | Redis slave command-line args | `master.args` |
| `slave.disableCommands` | Comma-separated list of Redis commands to disable (slave) | `master.disableCommands` |
| `slave.extraFlags` | Redis slave additional command line flags | `master.extraFlags` |
| `slave.livenessProbe.enabled` | Turn on and off liveness probe (redis slave pod) | `master.livenessProbe.enabled` |
| `slave.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (redis slave pod) | `master.livenessProbe.initialDelaySeconds` |
| `slave.livenessProbe.periodSeconds` | How often to perform the probe (redis slave pod) | `master.livenessProbe.periodSeconds` |
| `slave.livenessProbe.timeoutSeconds` | When the probe times out (redis slave pod) | `master.livenessProbe.timeoutSeconds` |
| `slave.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis slave pod) | `master.livenessProbe.successThreshold` |
| `slave.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `master.livenessProbe.failureThreshold` |
| `slave.readinessProbe.enabled` | Turn on and off slave.readiness probe (redis slave pod) | `master.readinessProbe.enabled` |
| `slave.readinessProbe.initialDelaySeconds` | Delay before slave.readiness probe is initiated (redis slave pod) | `master.readinessProbe.initialDelaySeconds` |
| `slave.readinessProbe.periodSeconds` | How often to perform the probe (redis slave pod) | `master.readinessProbe.periodSeconds` |
| `slave.readinessProbe.timeoutSeconds` | When the probe times out (redis slave pod) | `master.readinessProbe.timeoutSeconds` |
| `slave.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis slave pod) | `master.readinessProbe.successThreshold` |
| `slave.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. (redis slave pod) | `master.readinessProbe.failureThreshold` |
| `slave.podLabels` | Additional labels for Redis slave pod | `master.podLabels` |
| `slave.podAnnotations` | Additional annotations for Redis slave pod | `master.podAnnotations` |
| `slave.schedulerName` | Name of an alternate scheduler | `nil` |
| `slave.securityContext.enabled` | Enable security context (redis slave pod) | `master.securityContext.enabled` |
| `slave.securityContext.fsGroup` | Group ID for the container (redis slave pod) | `master.securityContext.fsGroup` |
| `slave.securityContext.runAsUser` | User ID for the container (redis slave pod) | `master.securityContext.runAsUser` |
| `slave.resources` | Redis slave CPU/Memory resource requests/limits | `master.resources` |
| `slave.affinity` | Enable node/pod affinity for slaves | {} |
The above parameters map to the env variables defined in [bitnami/redis](https://github.com/bitnami/bitnami-docker-redis). For more information please refer to the [bitnami/redis](https://github.com/bitnami/bitnami-docker-redis) image documentation.

View File

@@ -3,7 +3,7 @@
##
image:
registry: docker.io
repository: bitnami/redis
repository: bitnamilegacy/redis
tag: 4.0.10-debian-9
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.

View File

@@ -3,7 +3,7 @@
##
image:
registry: docker.io
repository: bitnami/redis
repository: bitnamilegacy/redis
tag: 4.0.10-debian-9
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'

View File

@@ -26,13 +26,9 @@ func (t testNormalizer) Normalize(un *unstructured.Unstructured) error {
if un == nil {
return nil
}
if un.GetKind() == "Job" {
err := unstructured.SetNestedField(un.Object, map[string]any{"name": "not sure why this works"}, "metadata")
if err != nil {
return fmt.Errorf("failed to normalize Job: %w", err)
}
}
switch un.GetKind() {
case "Job":
return t.normalizeJob(un)
case "DaemonSet", "Deployment", "StatefulSet":
err := unstructured.SetNestedStringMap(un.Object, map[string]string{"kubectl.kubernetes.io/restartedAt": "0001-01-01T00:00:00Z"}, "spec", "template", "metadata", "annotations")
if err != nil {
@@ -85,6 +81,28 @@ func (t testNormalizer) Normalize(un *unstructured.Unstructured) error {
return nil
}
func (t testNormalizer) normalizeJob(un *unstructured.Unstructured) error {
if conditions, exist, err := unstructured.NestedSlice(un.Object, "status", "conditions"); err != nil {
return fmt.Errorf("failed to normalize %s: %w", un.GetKind(), err)
} else if exist {
changed := false
for i := range conditions {
condition := conditions[i].(map[string]any)
cType := condition["type"].(string)
if cType == "FailureTarget" {
condition["lastTransitionTime"] = "0001-01-01T00:00:00Z"
changed = true
}
}
if changed {
if err := unstructured.SetNestedSlice(un.Object, conditions, "status", "conditions"); err != nil {
return fmt.Errorf("failed to normalize %s: %w", un.GetKind(), err)
}
}
}
return nil
}
type ActionTestStructure struct {
DiscoveryTests []IndividualDiscoveryTest `yaml:"discoveryTests"`
ActionTests []IndividualActionTest `yaml:"actionTests"`
@@ -208,8 +226,7 @@ func TestLuaResourceActionsScript(t *testing.T) {
assert.Equal(t, sourceObj.GetNamespace(), result.GetNamespace())
case CreateOperation:
switch result.GetKind() {
case "Job":
case "Workflow":
case "Job", "Workflow":
// The name of the created resource is derived from the source object name, so the returned name is not actually equal to the testdata output name
result.SetName(expectedObj.GetName())
}

View File

@@ -290,7 +290,8 @@ func cleanReturnedObj(newObj, obj map[string]any) map[string]any {
switch oldValue := oldValueInterface.(type) {
case map[string]any:
if len(newValue) == 0 {
mapToReturn[key] = oldValue
// Lua incorrectly decoded the empty object as an empty array, so set it to an empty object
mapToReturn[key] = map[string]any{}
}
case []any:
newArray := cleanReturnedArray(newValue, oldValue)
@@ -307,6 +308,10 @@ func cleanReturnedObj(newObj, obj map[string]any) map[string]any {
func cleanReturnedArray(newObj, obj []any) []any {
arrayToReturn := newObj
for i := range newObj {
if i >= len(obj) {
// If the new object is longer than the old one, we added an item to the array
break
}
switch newValue := newObj[i].(type) {
case map[string]any:
if oldValue, ok := obj[i].(map[string]any); ok {

View File

@@ -707,7 +707,9 @@ func TestExecuteResourceActionInvalidUnstructured(t *testing.T) {
require.Error(t, err)
}
const objWithEmptyStruct = `
func TestCleanPatch(t *testing.T) {
t.Run("Empty Struct preserved", func(t *testing.T) {
const obj = `
apiVersion: argoproj.io/v1alpha1
kind: Test
metadata:
@@ -719,7 +721,8 @@ metadata:
resourceVersion: "123"
spec:
resources: {}
paused: true
updated:
something: true
containers:
- name: name1
test: {}
@@ -727,8 +730,7 @@ spec:
- name: name2
test2: {}
`
const expectedUpdatedObjWithEmptyStruct = `
const expected = `
apiVersion: argoproj.io/v1alpha1
kind: Test
metadata:
@@ -740,7 +742,7 @@ metadata:
resourceVersion: "123"
spec:
resources: {}
paused: false
updated: {}
containers:
- name: name1
test: {}
@@ -748,21 +750,133 @@ spec:
- name: name2
test2: {}
`
const pausedToFalseLua = `
obj.spec.paused = false
const luaAction = `
obj.spec.updated = {}
return obj
`
testObj := StrToUnstructured(obj)
expectedObj := StrToUnstructured(expected)
vm := VM{}
newObjects, err := vm.ExecuteResourceAction(testObj, luaAction, nil)
require.NoError(t, err)
assert.Len(t, newObjects, 1)
assert.Equal(t, newObjects[0].K8SOperation, K8SOperation("patch"))
assert.Equal(t, expectedObj, newObjects[0].UnstructuredObj)
})
func TestCleanPatch(t *testing.T) {
testObj := StrToUnstructured(objWithEmptyStruct)
expectedObj := StrToUnstructured(expectedUpdatedObjWithEmptyStruct)
vm := VM{}
newObjects, err := vm.ExecuteResourceAction(testObj, pausedToFalseLua, nil)
require.NoError(t, err)
assert.Len(t, newObjects, 1)
assert.Equal(t, newObjects[0].K8SOperation, K8SOperation("patch"))
assert.Equal(t, expectedObj, newObjects[0].UnstructuredObj)
t.Run("New item added to array", func(t *testing.T) {
const obj = `
apiVersion: argoproj.io/v1alpha1
kind: Test
metadata:
labels:
app.kubernetes.io/instance: helm-guestbook
test: test
name: helm-guestbook
namespace: default
resourceVersion: "123"
spec:
containers:
- name: name1
test: {}
anotherList:
- name: name2
test2: {}
`
const expected = `
apiVersion: argoproj.io/v1alpha1
kind: Test
metadata:
labels:
app.kubernetes.io/instance: helm-guestbook
test: test
name: helm-guestbook
namespace: default
resourceVersion: "123"
spec:
containers:
- name: name1
test: {}
anotherList:
- name: name2
test2: {}
- name: added
#test: {} ### would be decoded as an empty array and is not supported. The type is unknown
testArray: [] ### works since it is decoded in the correct type
another:
supported: true
`
// `test: {}` in new container would be decoded as an empty array and is not supported. The type is unknown
// `testArray: []` works since it is decoded in the correct type
const luaAction = `
table.insert(obj.spec.containers, {name = "added", testArray = {}, another = {supported = true}})
return obj
`
testObj := StrToUnstructured(obj)
expectedObj := StrToUnstructured(expected)
vm := VM{}
newObjects, err := vm.ExecuteResourceAction(testObj, luaAction, nil)
require.NoError(t, err)
assert.Len(t, newObjects, 1)
assert.Equal(t, newObjects[0].K8SOperation, K8SOperation("patch"))
assert.Equal(t, expectedObj, newObjects[0].UnstructuredObj)
})
t.Run("Last item removed from array", func(t *testing.T) {
const obj = `
apiVersion: argoproj.io/v1alpha1
kind: Test
metadata:
labels:
app.kubernetes.io/instance: helm-guestbook
test: test
name: helm-guestbook
namespace: default
resourceVersion: "123"
spec:
containers:
- name: name1
test: {}
anotherList:
- name: name2
test2: {}
- name: name3
test: {}
anotherList:
- name: name4
test2: {}
`
const expected = `
apiVersion: argoproj.io/v1alpha1
kind: Test
metadata:
labels:
app.kubernetes.io/instance: helm-guestbook
test: test
name: helm-guestbook
namespace: default
resourceVersion: "123"
spec:
containers:
- name: name1
test: {}
anotherList:
- name: name2
test2: {}
`
const luaAction = `
table.remove(obj.spec.containers)
return obj
`
testObj := StrToUnstructured(obj)
expectedObj := StrToUnstructured(expected)
vm := VM{}
newObjects, err := vm.ExecuteResourceAction(testObj, luaAction, nil)
require.NoError(t, err)
assert.Len(t, newObjects, 1)
assert.Equal(t, newObjects[0].K8SOperation, K8SOperation("patch"))
assert.Equal(t, expectedObj, newObjects[0].UnstructuredObj)
})
}
func TestGetResourceHealth(t *testing.T) {