mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 09:38:49 +01:00
Compare commits
2 Commits
appsetdocs
...
v0.11.0-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
476e351d12 | ||
|
|
e0bc94dcf6 |
@@ -592,9 +592,7 @@ func getLocalObjects(app *argoappv1.Application, local string, env string, value
|
||||
log.Fatal("--env option invalid when performing local diff on Kustomize application")
|
||||
}
|
||||
k := kustomize.NewKustomizeApp(local)
|
||||
opts := kustomize.KustomizeBuildOpts{
|
||||
Namespace: app.Namespace,
|
||||
}
|
||||
opts := kustomize.KustomizeBuildOpts{}
|
||||
if app.Spec.Source.Kustomize != nil {
|
||||
opts.NamePrefix = app.Spec.Source.Kustomize.NamePrefix
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@ resources:
|
||||
|
||||
imageTags:
|
||||
- name: argoproj/argocd
|
||||
newTag: latest
|
||||
newTag: v0.11.0-rc1
|
||||
- name: argoproj/argocd-ui
|
||||
newTag: latest
|
||||
newTag: v0.11.0-rc1
|
||||
|
||||
@@ -165,6 +165,7 @@ rules:
|
||||
- '*'
|
||||
verbs:
|
||||
- delete
|
||||
- get
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
@@ -348,7 +349,7 @@ spec:
|
||||
- "20"
|
||||
- --operation-processors
|
||||
- "10"
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v0.11.0-rc1
|
||||
imagePullPolicy: Always
|
||||
name: application-controller
|
||||
ports:
|
||||
@@ -377,7 +378,7 @@ spec:
|
||||
containers:
|
||||
- command:
|
||||
- argocd-repo-server
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v0.11.0-rc1
|
||||
imagePullPolicy: Always
|
||||
name: argocd-repo-server
|
||||
ports:
|
||||
@@ -406,7 +407,7 @@ spec:
|
||||
- argocd-server
|
||||
- --staticassets
|
||||
- /shared/app
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v0.11.0-rc1
|
||||
imagePullPolicy: Always
|
||||
name: argocd-server
|
||||
ports:
|
||||
@@ -426,7 +427,7 @@ spec:
|
||||
- -r
|
||||
- /app
|
||||
- /shared
|
||||
image: argoproj/argocd-ui:latest
|
||||
image: argoproj/argocd-ui:v0.11.0-rc1
|
||||
imagePullPolicy: Always
|
||||
name: ui
|
||||
volumeMounts:
|
||||
@@ -468,7 +469,7 @@ spec:
|
||||
- cp
|
||||
- /usr/local/bin/argocd-util
|
||||
- /shared
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v0.11.0-rc1
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
volumeMounts:
|
||||
|
||||
@@ -281,7 +281,7 @@ spec:
|
||||
- "20"
|
||||
- --operation-processors
|
||||
- "10"
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v0.11.0-rc1
|
||||
imagePullPolicy: Always
|
||||
name: application-controller
|
||||
ports:
|
||||
@@ -310,7 +310,7 @@ spec:
|
||||
containers:
|
||||
- command:
|
||||
- argocd-repo-server
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v0.11.0-rc1
|
||||
imagePullPolicy: Always
|
||||
name: argocd-repo-server
|
||||
ports:
|
||||
@@ -339,7 +339,7 @@ spec:
|
||||
- argocd-server
|
||||
- --staticassets
|
||||
- /shared/app
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v0.11.0-rc1
|
||||
imagePullPolicy: Always
|
||||
name: argocd-server
|
||||
ports:
|
||||
@@ -359,7 +359,7 @@ spec:
|
||||
- -r
|
||||
- /app
|
||||
- /shared
|
||||
image: argoproj/argocd-ui:latest
|
||||
image: argoproj/argocd-ui:v0.11.0-rc1
|
||||
imagePullPolicy: Always
|
||||
name: ui
|
||||
volumeMounts:
|
||||
@@ -401,7 +401,7 @@ spec:
|
||||
- cp
|
||||
- /usr/local/bin/argocd-util
|
||||
- /shared
|
||||
image: argoproj/argocd:latest
|
||||
image: argoproj/argocd:v0.11.0-rc1
|
||||
imagePullPolicy: Always
|
||||
name: copyutil
|
||||
volumeMounts:
|
||||
|
||||
@@ -183,9 +183,7 @@ func helmOpts(q *ManifestRequest) helm.HelmTemplateOpts {
|
||||
}
|
||||
|
||||
func kustomizeOpts(q *ManifestRequest) kustomize.KustomizeBuildOpts {
|
||||
opts := kustomize.KustomizeBuildOpts{
|
||||
Namespace: q.Namespace,
|
||||
}
|
||||
opts := kustomize.KustomizeBuildOpts{}
|
||||
if q.ApplicationSource.Kustomize != nil {
|
||||
opts.NamePrefix = q.ApplicationSource.Kustomize.NamePrefix
|
||||
}
|
||||
|
||||
@@ -28,22 +28,11 @@ type kustomize struct {
|
||||
|
||||
// KustomizeBuildOpts are options to a `kustomize build` command
|
||||
type KustomizeBuildOpts struct {
|
||||
// Namespace will run `kustomize edit set namespace` during manifest generation
|
||||
Namespace string
|
||||
// NamePrefix will run `kustomize edit set nameprefix` during manifest generation
|
||||
NamePrefix string
|
||||
}
|
||||
|
||||
func (k *kustomize) Build(opts KustomizeBuildOpts, overrides []*v1alpha1.ComponentParameter) ([]*unstructured.Unstructured, []*v1alpha1.ComponentParameter, error) {
|
||||
if opts.Namespace != "" {
|
||||
cmd := exec.Command("kustomize", "edit", "set", "namespace", opts.Namespace)
|
||||
cmd.Dir = k.path
|
||||
_, err := argoexec.RunCommandExt(cmd)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if opts.NamePrefix != "" {
|
||||
cmd := exec.Command("kustomize", "edit", "set", "nameprefix", opts.NamePrefix)
|
||||
cmd.Dir = k.path
|
||||
|
||||
@@ -29,7 +29,6 @@ func TestKustomizeBuild(t *testing.T) {
|
||||
namePrefix := "namePrefix-"
|
||||
kustomize := NewKustomizeApp(appPath)
|
||||
opts := KustomizeBuildOpts{
|
||||
Namespace: "mynamespace",
|
||||
NamePrefix: namePrefix,
|
||||
}
|
||||
objs, params, err := kustomize.Build(opts, []*v1alpha1.ComponentParameter{{
|
||||
@@ -49,7 +48,6 @@ func TestKustomizeBuild(t *testing.T) {
|
||||
case "Deployment":
|
||||
assert.Equal(t, namePrefix+"nginx-deployment", obj.GetName())
|
||||
}
|
||||
assert.Equal(t, "mynamespace", obj.GetNamespace())
|
||||
}
|
||||
|
||||
for _, param := range params {
|
||||
|
||||
Reference in New Issue
Block a user