Compare commits

...

6 Commits

Author SHA1 Message Date
github-actions[bot]
77556d9e64 Bump version to 2.8.3 (#15404)
Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: pasha-codefresh <pasha-codefresh@users.noreply.github.com>
2023-09-07 17:59:35 +03:00
Alexander Matyushentsev
1391ba7214 Merge pull request from GHSA-fwr2-64vr-xv9m
* fix: prevent seeing/editing 'kubectl.kubernetes.io/last-applied-configuration' cluster annotation

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>

* Update util/db/cluster_test.go

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-09-07 10:14:57 -04:00
pasha-codefresh
44e52c4ae7 Merge pull request from GHSA-g687-f2gx-6wm8
* feat: use untar with limiter

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* feat: use untar with limiter

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2023-09-07 10:12:15 -04:00
gcp-cherry-pick-bot[bot]
4b55084a8f docs: Update ApplicationSet docs (#15269) (#15270)
Signed-off-by: David Muckle <dvdmuckle@dvdmuckle.xyz>
Co-authored-by: David Muckle <dvdmuckle@dvdmuckle.xyz>
2023-08-28 20:36:18 -04:00
gcp-cherry-pick-bot[bot]
c689ea4957 docs: improve doc on labels parameter on scmProvider generator (#15255) (#15265)
Signed-off-by: Jedrzej Kotkowski <jedrzejk143@gmail.com>
Co-authored-by: Jędrzej Kotkowski <96917147+jjsiv@users.noreply.github.com>
2023-08-28 17:48:58 -04:00
gcp-cherry-pick-bot[bot]
ea9827791f fix(ui): Helm chart empty maintainers blow up Argo UI (#15225) (#15243)
Signed-off-by: Carlos Castro carlos.castro@jumo.world

Signed-off-by: Carlos Castro carlos.castro@jumo.world

Signed-off-by: Carlos Castro carlos.castro@jumo.world
Signed-off-by: Carlos Castro <carlos.castro@jumo.world>
Co-authored-by: Carlos Castro <carlos.castro@jumo.world>
2023-08-25 09:59:33 -04:00
23 changed files with 205 additions and 61 deletions

View File

@@ -1 +1 @@
2.8.2
2.8.3

View File

@@ -82,6 +82,8 @@ func NewCommand() *cobra.Command {
allowOutOfBoundsSymlinks bool
streamedManifestMaxTarSize string
streamedManifestMaxExtractedSize string
helmManifestMaxExtractedSize string
disableManifestMaxExtractedSize bool
)
var command = cobra.Command{
Use: cliName,
@@ -120,6 +122,9 @@ func NewCommand() *cobra.Command {
streamedManifestMaxExtractedSizeQuantity, err := resource.ParseQuantity(streamedManifestMaxExtractedSize)
errors.CheckError(err)
helmManifestMaxExtractedSizeQuantity, err := resource.ParseQuantity(helmManifestMaxExtractedSize)
errors.CheckError(err)
askPassServer := askpass.NewServer()
metricsServer := metrics.NewMetricsServer()
cacheutil.CollectMetrics(redisClient, metricsServer)
@@ -134,6 +139,7 @@ func NewCommand() *cobra.Command {
AllowOutOfBoundsSymlinks: allowOutOfBoundsSymlinks,
StreamedManifestMaxExtractedSize: streamedManifestMaxExtractedSizeQuantity.ToDec().Value(),
StreamedManifestMaxTarSize: streamedManifestMaxTarSizeQuantity.ToDec().Value(),
HelmManifestMaxExtractedSize: helmManifestMaxExtractedSizeQuantity.ToDec().Value(),
}, askPassServer)
errors.CheckError(err)
@@ -216,6 +222,8 @@ func NewCommand() *cobra.Command {
command.Flags().BoolVar(&allowOutOfBoundsSymlinks, "allow-oob-symlinks", env.ParseBoolFromEnv("ARGOCD_REPO_SERVER_ALLOW_OUT_OF_BOUNDS_SYMLINKS", false), "Allow out-of-bounds symlinks in repositories (not recommended)")
command.Flags().StringVar(&streamedManifestMaxTarSize, "streamed-manifest-max-tar-size", env.StringFromEnv("ARGOCD_REPO_SERVER_STREAMED_MANIFEST_MAX_TAR_SIZE", "100M"), "Maximum size of streamed manifest archives")
command.Flags().StringVar(&streamedManifestMaxExtractedSize, "streamed-manifest-max-extracted-size", env.StringFromEnv("ARGOCD_REPO_SERVER_STREAMED_MANIFEST_MAX_EXTRACTED_SIZE", "1G"), "Maximum size of streamed manifest archives when extracted")
command.Flags().StringVar(&helmManifestMaxExtractedSize, "helm-manifest-max-extracted-size", env.StringFromEnv("ARGOCD_REPO_SERVER_HELM_MANIFEST_MAX_EXTRACTED_SIZE", "1G"), "Maximum size of helm manifest archives when extracted")
command.Flags().BoolVar(&disableManifestMaxExtractedSize, "disable-helm-manifest-max-extracted-size", env.ParseBoolFromEnv("ARGOCD_REPO_SERVER_DISABLE_HELM_MANIFEST_MAX_EXTRACTED_SIZE", false), "Disable maximum size of helm manifest archives when extracted")
tlsConfigCustomizerSrc = tls.AddTLSFlagsToCmd(&command)
cacheSrc = reposervercache.AddCacheFlagsToCmd(&command, func(client *redis.Client) {
redisClient = client

View File

@@ -38,16 +38,16 @@ With the ApplicationSet v0.1.0 release, one could *only* specify `url` and `clus
spec:
generators:
- list:
elements:
# v0.1.0 form - requires cluster/url keys:
- cluster: engineering-dev
url: https://kubernetes.default.svc
values:
additional: value
# v0.2.0+ form - does not require cluster/URL keys
# (but they are still supported).
- staging: "true"
gitRepo: https://kubernetes.default.svc
elements:
# v0.1.0 form - requires cluster/url keys:
- cluster: engineering-dev
url: https://kubernetes.default.svc
values:
additional: value
# v0.2.0+ form - does not require cluster/URL keys
# (but they are still supported).
- staging: "true"
gitRepo: https://kubernetes.default.svc
# (...)
```
@@ -74,7 +74,6 @@ spec:
files:
- path: applicationset/examples/list-generator/list-elementsYaml-example.yaml
- list:
elements: []
elementsYaml: "{{ .key.components | toJson }}"
template:
metadata:

View File

@@ -406,7 +406,7 @@ spec:
* `sha`: The Git commit SHA for the branch.
* `short_sha`: The abbreviated Git commit SHA for the branch (8 chars or the length of the `sha` if it's shorter).
* `short_sha_7`: The abbreviated Git commit SHA for the branch (7 chars or the length of the `sha` if it's shorter).
* `labels`: A comma-separated list of repository labels.
* `labels`: A comma-separated list of repository labels in case of Gitea, repository topics in case of Gitlab and Github. Not supported by Bitbucket Cloud, Bitbucket Server, or Azure DevOps.
* `branchNormalized`: The value of `branch` normalized to contain only lowercase alphanumeric characters, '-' or '.'.
## Pass additional key-value pairs via `values` field

View File

@@ -103,6 +103,7 @@ generators' templating:
- `{{ path.filename }}` becomes `{{ .path.filename }}`
- `{{ path.filenameNormalized }}` becomes `{{ .path.filenameNormalized }}`
- `{{ path[n] }}` becomes `{{ index .path.segments n }}`
- `{{ values }}` if being used in the file generator becomes `{{ .values }}`
Here is an example:

View File

@@ -16,7 +16,9 @@ argocd-repo-server [flags]
--address string Listen on given address for incoming connections (default "0.0.0.0")
--allow-oob-symlinks Allow out-of-bounds symlinks in repositories (not recommended)
--default-cache-expiration duration Cache expiration default (default 24h0m0s)
--disable-helm-manifest-max-extracted-size Disable maximum size of helm manifest archives when extracted
--disable-tls Disable TLS on the gRPC endpoint
--helm-manifest-max-extracted-size string Maximum size of helm manifest archives when extracted (default "1G")
-h, --help help for argocd-repo-server
--logformat string Set the logging format. One of: text|json (default "text")
--loglevel string Set the logging level. One of: debug|info|warn|error (default "info")

View File

@@ -5,7 +5,7 @@ kind: Kustomization
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v2.8.2
newTag: v2.8.3
resources:
- ./application-controller
- ./dex

View File

@@ -150,6 +150,18 @@ spec:
key: reposerver.streamed.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: reposerver.disable.helm.manifest.max.extracted.size
optional: true
- name: ARGOCD_GIT_MODULES_ENABLED
valueFrom:
configMapKeyRef:

View File

@@ -18880,7 +18880,7 @@ spec:
key: applicationsetcontroller.allowed.scm.providers
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -19156,6 +19156,18 @@ spec:
key: reposerver.streamed.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_GIT_MODULES_ENABLED
valueFrom:
configMapKeyRef:
@@ -19168,7 +19180,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -19220,7 +19232,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -19439,7 +19451,7 @@ spec:
key: controller.kubectl.parallelism.limit
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
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: v2.8.2
newTag: v2.8.3

View File

@@ -12,7 +12,7 @@ patches:
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v2.8.2
newTag: v2.8.3
resources:
- ../../base/application-controller
- ../../base/applicationset-controller

View File

@@ -20117,7 +20117,7 @@ spec:
key: applicationsetcontroller.allowed.scm.providers
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -20240,7 +20240,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -20310,7 +20310,7 @@ spec:
key: notificationscontroller.log.level
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -20612,6 +20612,18 @@ spec:
key: reposerver.streamed.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_GIT_MODULES_ENABLED
valueFrom:
configMapKeyRef:
@@ -20624,7 +20636,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -20676,7 +20688,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -20965,7 +20977,7 @@ spec:
key: server.enable.proxy.extension
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -21211,7 +21223,7 @@ spec:
key: controller.kubectl.parallelism.limit
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -1635,7 +1635,7 @@ spec:
key: applicationsetcontroller.allowed.scm.providers
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -1758,7 +1758,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -1828,7 +1828,7 @@ spec:
key: notificationscontroller.log.level
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -2130,6 +2130,18 @@ spec:
key: reposerver.streamed.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_GIT_MODULES_ENABLED
valueFrom:
configMapKeyRef:
@@ -2142,7 +2154,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -2194,7 +2206,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -2483,7 +2495,7 @@ spec:
key: server.enable.proxy.extension
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -2729,7 +2741,7 @@ spec:
key: controller.kubectl.parallelism.limit
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -19218,7 +19218,7 @@ spec:
key: applicationsetcontroller.allowed.scm.providers
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -19341,7 +19341,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -19411,7 +19411,7 @@ spec:
key: notificationscontroller.log.level
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -19669,6 +19669,18 @@ spec:
key: reposerver.streamed.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_GIT_MODULES_ENABLED
valueFrom:
configMapKeyRef:
@@ -19681,7 +19693,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -19733,7 +19745,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -20020,7 +20032,7 @@ spec:
key: server.enable.proxy.extension
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -20266,7 +20278,7 @@ spec:
key: controller.kubectl.parallelism.limit
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -736,7 +736,7 @@ spec:
key: applicationsetcontroller.allowed.scm.providers
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
@@ -859,7 +859,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: copyutil
securityContext:
@@ -929,7 +929,7 @@ spec:
key: notificationscontroller.log.level
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
tcpSocket:
@@ -1187,6 +1187,18 @@ spec:
key: reposerver.streamed.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_GIT_MODULES_ENABLED
valueFrom:
configMapKeyRef:
@@ -1199,7 +1211,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -1251,7 +1263,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
name: copyutil
securityContext:
allowPrivilegeEscalation: false
@@ -1538,7 +1550,7 @@ spec:
key: server.enable.proxy.extension
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -1784,7 +1796,7 @@ spec:
key: controller.kubectl.parallelism.limit
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.2
image: quay.io/argoproj/argocd:v2.8.3
imagePullPolicy: Always
name: argocd-application-controller
ports:

View File

@@ -107,6 +107,8 @@ type RepoServerInitConstants struct {
AllowOutOfBoundsSymlinks bool
StreamedManifestMaxExtractedSize int64
StreamedManifestMaxTarSize int64
HelmManifestMaxExtractedSize int64
DisableHelmManifestMaxExtractedSize bool
}
// NewService returns a new instance of the Manifest service
@@ -346,7 +348,7 @@ func (s *Service) runRepoOperation(
if source.Helm != nil {
helmPassCredentials = source.Helm.PassCredentials
}
chartPath, closer, err := helmClient.ExtractChart(source.Chart, revision, helmPassCredentials)
chartPath, closer, err := helmClient.ExtractChart(source.Chart, revision, helmPassCredentials, s.initConstants.HelmManifestMaxExtractedSize, s.initConstants.DisableHelmManifestMaxExtractedSize)
if err != nil {
return err
}
@@ -2233,7 +2235,7 @@ func (s *Service) GetRevisionChartDetails(ctx context.Context, q *apiclient.Repo
if err != nil {
return nil, fmt.Errorf("helm client error: %v", err)
}
chartPath, closer, err := helmClient.ExtractChart(q.Name, revision, false)
chartPath, closer, err := helmClient.ExtractChart(q.Name, revision, false, s.initConstants.HelmManifestMaxExtractedSize, s.initConstants.DisableHelmManifestMaxExtractedSize)
if err != nil {
return nil, fmt.Errorf("error extracting chart: %v", err)
}

View File

@@ -32,7 +32,7 @@ export const RevisionMetadataRows = (props: {applicationName: string; applicatio
<div className='columns small-9'>{m.description}</div>
</div>
)}
{m.maintainers.length > 0 && (
{m.maintainers && m.maintainers.length > 0 && (
<div className='row'>
<div className='columns small-3'>Maintainers:</div>
<div className='columns small-9'>{m.maintainers.join(', ')}</div>

View File

@@ -669,7 +669,7 @@ export class ApplicationDetails extends React.Component<RouteComponentProps<{app
<div className='columns small-9'>{m.description}</div>
</div>
)}
{m.maintainers.length > 0 && (
{m.maintainers && m.maintainers.length > 0 && (
<div className='row white-box__details-row'>
<div className='columns small-3'>Maintainers:</div>
<div className='columns small-9'>{m.maintainers.join(', ')}</div>

View File

@@ -345,6 +345,9 @@ func clusterToSecret(c *appv1.Cluster, secret *apiv1.Secret) error {
secret.Data = data
secret.Labels = c.Labels
if c.Annotations != nil && c.Annotations[apiv1.LastAppliedConfigAnnotation] != "" {
return status.Errorf(codes.InvalidArgument, "annotation %s cannot be set", apiv1.LastAppliedConfigAnnotation)
}
secret.Annotations = c.Annotations
if secret.Annotations == nil {
@@ -403,6 +406,8 @@ func SecretToCluster(s *apiv1.Secret) (*appv1.Cluster, error) {
annotations := map[string]string{}
if s.Annotations != nil {
annotations = collections.CopyStringMap(s.Annotations)
// delete system annotations
delete(annotations, apiv1.LastAppliedConfigAnnotation)
delete(annotations, common.AnnotationKeyManagedBy)
}

View File

@@ -7,6 +7,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/fake"
@@ -56,6 +58,24 @@ func Test_secretToCluster(t *testing.T) {
})
}
func Test_secretToCluster_LastAppliedConfigurationDropped(t *testing.T) {
secret := &v1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: "mycluster",
Namespace: fakeNamespace,
Annotations: map[string]string{v1.LastAppliedConfigAnnotation: "val2"},
},
Data: map[string][]byte{
"name": []byte("test"),
"server": []byte("http://mycluster"),
"config": []byte("{\"username\":\"foo\"}"),
},
}
cluster, err := SecretToCluster(secret)
require.NoError(t, err)
assert.Len(t, cluster.Annotations, 0)
}
func TestClusterToSecret(t *testing.T) {
cluster := &appv1.Cluster{
Server: "server",
@@ -78,6 +98,21 @@ func TestClusterToSecret(t *testing.T) {
assert.Equal(t, cluster.Labels, s.Labels)
}
func TestClusterToSecret_LastAppliedConfigurationRejected(t *testing.T) {
cluster := &appv1.Cluster{
Server: "server",
Annotations: map[string]string{v1.LastAppliedConfigAnnotation: "val2"},
Name: "test",
Config: v1alpha1.ClusterConfig{},
Project: "project",
Namespaces: []string{"default"},
}
s := &v1.Secret{}
err := clusterToSecret(cluster, s)
require.Error(t, err)
require.Equal(t, codes.InvalidArgument, status.Code(err))
}
func Test_secretToCluster_NoConfig(t *testing.T) {
secret := &v1.Secret{
ObjectMeta: metav1.ObjectMeta{

View File

@@ -8,6 +8,7 @@ import (
"encoding/json"
"errors"
"fmt"
executil "github.com/argoproj/argo-cd/v2/util/exec"
"io"
"net/http"
"net/url"
@@ -25,7 +26,6 @@ import (
"oras.land/oras-go/v2/registry/remote/auth"
"github.com/argoproj/argo-cd/v2/util/cache"
executil "github.com/argoproj/argo-cd/v2/util/exec"
argoio "github.com/argoproj/argo-cd/v2/util/io"
"github.com/argoproj/argo-cd/v2/util/io/files"
"github.com/argoproj/argo-cd/v2/util/proxy"
@@ -52,7 +52,7 @@ type indexCache interface {
type Client interface {
CleanChartCache(chart string, version string) error
ExtractChart(chart string, version string, passCredentials bool) (string, argoio.Closer, error)
ExtractChart(chart string, version string, passCredentials bool, manifestMaxExtractedSize int64, disableManifestMaxExtractedSize bool) (string, argoio.Closer, error)
GetIndex(noCache bool) (*Index, error)
GetTags(chart string, noCache bool) (*TagsList, error)
TestHelmOCI() (bool, error)
@@ -122,7 +122,21 @@ func (c *nativeHelmChart) CleanChartCache(chart string, version string) error {
return os.RemoveAll(cachePath)
}
func (c *nativeHelmChart) ExtractChart(chart string, version string, passCredentials bool) (string, argoio.Closer, error) {
func untarChart(tempDir string, cachedChartPath string, manifestMaxExtractedSize int64, disableManifestMaxExtractedSize bool) error {
if disableManifestMaxExtractedSize {
cmd := exec.Command("tar", "-zxvf", cachedChartPath)
cmd.Dir = tempDir
_, err := executil.Run(cmd)
return err
}
reader, err := os.Open(cachedChartPath)
if err != nil {
return err
}
return files.Untgz(tempDir, reader, manifestMaxExtractedSize, false)
}
func (c *nativeHelmChart) ExtractChart(chart string, version string, passCredentials bool, manifestMaxExtractedSize int64, disableManifestMaxExtractedSize bool) (string, argoio.Closer, error) {
// always use Helm V3 since we don't have chart content to determine correct Helm version
helmCmd, err := NewCmdWithVersion("", HelmV3, c.enableOci, c.proxy)
@@ -196,15 +210,14 @@ func (c *nativeHelmChart) ExtractChart(chart string, version string, passCredent
if len(infos) != 1 {
return "", nil, fmt.Errorf("expected 1 file, found %v", len(infos))
}
err = os.Rename(filepath.Join(tempDest, infos[0].Name()), cachedChartPath)
if err != nil {
return "", nil, err
}
}
cmd := exec.Command("tar", "-zxvf", cachedChartPath)
cmd.Dir = tempDir
_, err = executil.Run(cmd)
err = untarChart(tempDir, cachedChartPath, manifestMaxExtractedSize, disableManifestMaxExtractedSize)
if err != nil {
_ = os.RemoveAll(tempDir)
return "", nil, err

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"math"
"os"
"strings"
"testing"
@@ -71,7 +72,7 @@ func TestIndex(t *testing.T) {
func Test_nativeHelmChart_ExtractChart(t *testing.T) {
client := NewClient("https://argoproj.github.io/argo-helm", Creds{}, false, "")
path, closer, err := client.ExtractChart("argo-cd", "0.7.1", false)
path, closer, err := client.ExtractChart("argo-cd", "0.7.1", false, math.MaxInt64, true)
assert.NoError(t, err)
defer io.Close(closer)
info, err := os.Stat(path)
@@ -79,9 +80,15 @@ func Test_nativeHelmChart_ExtractChart(t *testing.T) {
assert.True(t, info.IsDir())
}
func Test_nativeHelmChart_ExtractChartWithLimiter(t *testing.T) {
client := NewClient("https://argoproj.github.io/argo-helm", Creds{}, false, "")
_, _, err := client.ExtractChart("argo-cd", "0.7.1", false, 100, false)
assert.Error(t, err, "error while iterating on tar reader: unexpected EOF")
}
func Test_nativeHelmChart_ExtractChart_insecure(t *testing.T) {
client := NewClient("https://argoproj.github.io/argo-helm", Creds{InsecureSkipVerify: true}, false, "")
path, closer, err := client.ExtractChart("argo-cd", "0.7.1", false)
path, closer, err := client.ExtractChart("argo-cd", "0.7.1", false, math.MaxInt64, true)
assert.NoError(t, err)
defer io.Close(closer)
info, err := os.Stat(path)

View File

@@ -29,7 +29,7 @@ func (_m *Client) CleanChartCache(chart string, version string) error {
}
// ExtractChart provides a mock function with given fields: chart, version
func (_m *Client) ExtractChart(chart string, version string, passCredentials bool) (string, io.Closer, error) {
func (_m *Client) ExtractChart(chart string, version string, passCredentials bool, manifestMaxExtractedSize int64, disableManifestMaxExtractedSize bool) (string, io.Closer, error) {
ret := _m.Called(chart, version)
var r0 string