mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-23 09:18:26 +00:00
Fix ability to unset ApplicationSource specific parameters (#1041)
This commit is contained in:
parent
8da5fd9bb7
commit
ea428eb722
2 changed files with 23 additions and 0 deletions
|
|
@ -421,6 +421,10 @@ func setKsonnetOpt(src *argoappv1.ApplicationSource, env *string) {
|
|||
}
|
||||
if env != nil {
|
||||
src.Ksonnet.Environment = *env
|
||||
src.Environment = *env
|
||||
}
|
||||
if src.Ksonnet.IsZero() {
|
||||
src.Ksonnet = nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -431,6 +435,9 @@ func setKustomizeOpt(src *argoappv1.ApplicationSource, namePrefix *string) {
|
|||
if namePrefix != nil {
|
||||
src.Kustomize.NamePrefix = *namePrefix
|
||||
}
|
||||
if src.Kustomize.IsZero() {
|
||||
src.Kustomize = nil
|
||||
}
|
||||
}
|
||||
|
||||
func setHelmOpt(src *argoappv1.ApplicationSource, valueFiles []string) {
|
||||
|
|
@ -439,6 +446,10 @@ func setHelmOpt(src *argoappv1.ApplicationSource, valueFiles []string) {
|
|||
}
|
||||
if valueFiles != nil {
|
||||
src.Helm.ValueFiles = valueFiles
|
||||
src.ValuesFiles = valueFiles
|
||||
}
|
||||
if src.Helm.IsZero() {
|
||||
src.Helm = nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,18 +91,30 @@ type ApplicationSourceHelm struct {
|
|||
ValueFiles []string `json:"valueFiles,omitempty" protobuf:"bytes,1,opt,name=valueFiles"`
|
||||
}
|
||||
|
||||
func (h *ApplicationSourceHelm) IsZero() bool {
|
||||
return len(h.ValueFiles) == 0
|
||||
}
|
||||
|
||||
// ApplicationSourceKustomize holds kustomize specific options
|
||||
type ApplicationSourceKustomize struct {
|
||||
// NamePrefix is a prefix appended to resources for kustomize apps
|
||||
NamePrefix string `json:"namePrefix" protobuf:"bytes,1,opt,name=namePrefix"`
|
||||
}
|
||||
|
||||
func (k *ApplicationSourceKustomize) IsZero() bool {
|
||||
return k.NamePrefix == ""
|
||||
}
|
||||
|
||||
// ApplicationSourceKsonnet holds ksonnet specific options
|
||||
type ApplicationSourceKsonnet struct {
|
||||
// Environment is a ksonnet application environment name
|
||||
Environment string `json:"environment,omitempty" protobuf:"bytes,1,opt,name=environment"`
|
||||
}
|
||||
|
||||
func (k *ApplicationSourceKsonnet) IsZero() bool {
|
||||
return k.Environment == ""
|
||||
}
|
||||
|
||||
// ApplicationDestination contains deployment destination information
|
||||
type ApplicationDestination struct {
|
||||
// Server overrides the environment server value in the ksonnet app.yaml
|
||||
|
|
|
|||
Loading…
Reference in a new issue