diff --git a/pkg/apiclient/account/account.pb.go b/pkg/apiclient/account/account.pb.go index 2f43e40d68f63..c3fa335418947 100644 --- a/pkg/apiclient/account/account.pb.go +++ b/pkg/apiclient/account/account.pb.go @@ -3,23 +3,16 @@ package account // import "github.com/argoproj/argo-cd/pkg/apiclient/account" -import ( - fmt "fmt" +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "google.golang.org/genproto/googleapis/api/annotations" - proto "github.com/gogo/protobuf/proto" +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" - math "math" - - _ "github.com/gogo/protobuf/gogoproto" - - _ "google.golang.org/genproto/googleapis/api/annotations" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" - - io "io" -) +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/pkg/apiclient/application/application.pb.go b/pkg/apiclient/application/application.pb.go index acc194d985833..269712fb29b70 100644 --- a/pkg/apiclient/application/application.pb.go +++ b/pkg/apiclient/application/application.pb.go @@ -9,33 +9,22 @@ package application // import "github.com/argoproj/argo-cd/pkg/apiclient/applica Application Service API performs CRUD actions against application resources */ -import ( - fmt "fmt" - - proto "github.com/gogo/protobuf/proto" - - math "math" - - v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" - - apiclient "github.com/argoproj/argo-cd/reposerver/apiclient" - - _ "github.com/gogo/protobuf/gogoproto" - - _ "google.golang.org/genproto/googleapis/api/annotations" - - v11 "k8s.io/api/core/v1" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" - - github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" - - io "io" -) +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" +import apiclient "github.com/argoproj/argo-cd/reposerver/apiclient" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import v11 "k8s.io/api/core/v1" +import v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" + +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" + +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/pkg/apiclient/certificate/certificate.pb.go b/pkg/apiclient/certificate/certificate.pb.go index 8ab1ac10b93c1..ef7eaf043e748 100644 --- a/pkg/apiclient/certificate/certificate.pb.go +++ b/pkg/apiclient/certificate/certificate.pb.go @@ -10,25 +10,17 @@ package certificate // import "github.com/argoproj/argo-cd/pkg/apiclient/certifi resources. */ -import ( - fmt "fmt" +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "google.golang.org/genproto/googleapis/api/annotations" - proto "github.com/gogo/protobuf/proto" +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" - math "math" - - v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" - - _ "github.com/gogo/protobuf/gogoproto" - - _ "google.golang.org/genproto/googleapis/api/annotations" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" - - io "io" -) +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/pkg/apiclient/cluster/cluster.pb.go b/pkg/apiclient/cluster/cluster.pb.go index 2bc61eb9ff59a..b9ede75faf6bb 100644 --- a/pkg/apiclient/cluster/cluster.pb.go +++ b/pkg/apiclient/cluster/cluster.pb.go @@ -9,27 +9,18 @@ package cluster // import "github.com/argoproj/argo-cd/pkg/apiclient/cluster" Cluster Service API performs CRUD actions against cluster resources */ -import ( - fmt "fmt" - - proto "github.com/gogo/protobuf/proto" - - math "math" - - v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" - - _ "github.com/gogo/protobuf/gogoproto" - - _ "google.golang.org/genproto/googleapis/api/annotations" - - _ "k8s.io/api/core/v1" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" - - io "io" -) +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "k8s.io/api/core/v1" + +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" + +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/pkg/apiclient/project/project.pb.go b/pkg/apiclient/project/project.pb.go index 5a095316cfdc9..38070846d15f7 100644 --- a/pkg/apiclient/project/project.pb.go +++ b/pkg/apiclient/project/project.pb.go @@ -9,29 +9,19 @@ package project // import "github.com/argoproj/argo-cd/pkg/apiclient/project" Project Service API performs CRUD actions against project resources */ -import ( - fmt "fmt" - - proto "github.com/gogo/protobuf/proto" - - math "math" - - v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" - - _ "github.com/gogo/protobuf/gogoproto" - - _ "google.golang.org/genproto/googleapis/api/annotations" - - v1 "k8s.io/api/core/v1" - - _ "k8s.io/apimachinery/pkg/apis/meta/v1" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" - - io "io" -) +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import v1 "k8s.io/api/core/v1" +import _ "k8s.io/apimachinery/pkg/apis/meta/v1" + +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" + +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/pkg/apiclient/repository/repository.pb.go b/pkg/apiclient/repository/repository.pb.go index 83cef2fabd96a..a89e5cf6a1dc0 100644 --- a/pkg/apiclient/repository/repository.pb.go +++ b/pkg/apiclient/repository/repository.pb.go @@ -9,29 +9,19 @@ package repository // import "github.com/argoproj/argo-cd/pkg/apiclient/reposito Repository Service API performs CRUD actions against repository resources */ -import ( - fmt "fmt" - - proto "github.com/gogo/protobuf/proto" - - math "math" - - v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" - - apiclient "github.com/argoproj/argo-cd/reposerver/apiclient" - - _ "github.com/gogo/protobuf/gogoproto" - - _ "google.golang.org/genproto/googleapis/api/annotations" - - _ "k8s.io/api/core/v1" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" - - io "io" -) +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" +import apiclient "github.com/argoproj/argo-cd/reposerver/apiclient" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "k8s.io/api/core/v1" + +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" + +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/pkg/apiclient/session/session.pb.go b/pkg/apiclient/session/session.pb.go index 14cc0f4b25cdf..9d33f72f80453 100644 --- a/pkg/apiclient/session/session.pb.go +++ b/pkg/apiclient/session/session.pb.go @@ -9,27 +9,18 @@ package session // import "github.com/argoproj/argo-cd/pkg/apiclient/session" Session Service API performs CRUD actions against session resources */ -import ( - fmt "fmt" - - proto "github.com/gogo/protobuf/proto" - - math "math" - - _ "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" - - _ "github.com/gogo/protobuf/gogoproto" - - _ "google.golang.org/genproto/googleapis/api/annotations" - - _ "k8s.io/api/core/v1" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" - - io "io" -) +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "k8s.io/api/core/v1" + +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" + +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/pkg/apiclient/settings/settings.pb.go b/pkg/apiclient/settings/settings.pb.go index 4a01bdc6ba48c..dc84a6356039e 100644 --- a/pkg/apiclient/settings/settings.pb.go +++ b/pkg/apiclient/settings/settings.pb.go @@ -9,27 +9,18 @@ package settings // import "github.com/argoproj/argo-cd/pkg/apiclient/settings" Settings Service API retrieves Argo CD settings */ -import ( - fmt "fmt" - - proto "github.com/gogo/protobuf/proto" - - math "math" - - v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" - - oidc "github.com/argoproj/argo-cd/server/settings/oidc" - - _ "github.com/gogo/protobuf/gogoproto" - - _ "google.golang.org/genproto/googleapis/api/annotations" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" - - io "io" -) +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" +import oidc "github.com/argoproj/argo-cd/server/settings/oidc" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" + +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/pkg/apiclient/version/version.pb.go b/pkg/apiclient/version/version.pb.go index 509ba1a3bb157..b3825af4c009a 100644 --- a/pkg/apiclient/version/version.pb.go +++ b/pkg/apiclient/version/version.pb.go @@ -9,23 +9,16 @@ package version // import "github.com/argoproj/argo-cd/pkg/apiclient/version" Version Service API returns the version of the API server. */ -import ( - fmt "fmt" +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import empty "github.com/golang/protobuf/ptypes/empty" +import _ "google.golang.org/genproto/googleapis/api/annotations" - proto "github.com/gogo/protobuf/proto" +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" - math "math" - - empty "github.com/golang/protobuf/ptypes/empty" - - _ "google.golang.org/genproto/googleapis/api/annotations" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" - - io "io" -) +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/pkg/apis/application/v1alpha1/generated.pb.go b/pkg/apis/application/v1alpha1/generated.pb.go index e2b2fe4e1ca4a..02029ce05eb55 100644 --- a/pkg/apis/application/v1alpha1/generated.pb.go +++ b/pkg/apis/application/v1alpha1/generated.pb.go @@ -3,27 +3,21 @@ package v1alpha1 -import ( - fmt "fmt" +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" - proto "github.com/gogo/protobuf/proto" +import v11 "k8s.io/api/core/v1" +import v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - math "math" +import k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch" - v11 "k8s.io/api/core/v1" +import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +import strings "strings" +import reflect "reflect" - k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch" - - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - - strings "strings" - - reflect "reflect" - - io "io" -) +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/reposerver/apiclient/repository.pb.go b/reposerver/apiclient/repository.pb.go index c67bf181a38b3..a1b2a8fca1103 100644 --- a/reposerver/apiclient/repository.pb.go +++ b/reposerver/apiclient/repository.pb.go @@ -3,27 +3,18 @@ package apiclient // import "github.com/argoproj/argo-cd/reposerver/apiclient" -import ( - fmt "fmt" - - proto "github.com/gogo/protobuf/proto" - - math "math" - - v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" - - _ "github.com/gogo/protobuf/gogoproto" - - _ "google.golang.org/genproto/googleapis/api/annotations" - - _ "k8s.io/api/core/v1" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" - - io "io" -) +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "google.golang.org/genproto/googleapis/api/annotations" +import _ "k8s.io/api/core/v1" + +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" + +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/server/settings/oidc/claims.pb.go b/server/settings/oidc/claims.pb.go index 4173bbf321ec1..fdd5ef2ca91cf 100644 --- a/server/settings/oidc/claims.pb.go +++ b/server/settings/oidc/claims.pb.go @@ -3,15 +3,11 @@ package oidc // import "github.com/argoproj/argo-cd/server/settings/oidc" -import ( - fmt "fmt" +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" - proto "github.com/gogo/protobuf/proto" - - math "math" - - io "io" -) +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/util/helm/helm.go b/util/helm/helm.go index e5e3c5e9f999e..2c93ceab08a74 100644 --- a/util/helm/helm.go +++ b/util/helm/helm.go @@ -78,6 +78,7 @@ func (h *helm) Template(appName, namespace, kubeVersion string, opts *argoappv1. } templateOpts.values = append(templateOpts.values, p) } + cleanHelmParameters(opts.Parameters) for _, p := range opts.Parameters { if p.ForceString { templateOpts.setString[p.Name] = p.Value @@ -183,9 +184,13 @@ func flatVals(input map[string]interface{}, output map[string]string, prefixes . } } -func cleanHelmParameters(params []string) { +func cleanHelmParameters(params []argoappv1.HelmParameter) { re := regexp.MustCompile(`([^\\]),`) for i, param := range params { - params[i] = re.ReplaceAllString(param, `$1\,`) + params[i] = argoappv1.HelmParameter{ + Name: param.Name, + Value: re.ReplaceAllString(param.Value, `$1\,`), + ForceString: param.ForceString, + } } } diff --git a/util/helm/helm_test.go b/util/helm/helm_test.go index eb91efede14ef..4356477a3b127 100644 --- a/util/helm/helm_test.go +++ b/util/helm/helm_test.go @@ -170,21 +170,28 @@ func TestHelmTemplateReleaseName(t *testing.T) { } func TestHelmArgCleaner(t *testing.T) { - cleanArgs := []string{`--these-args`, `are-clean`, `--foo`, `bar`} - argsToBeCleaned := make([]string, len(cleanArgs)) + cleanArgs := []argoappv1.HelmParameter{ + {Name: "app", Value: `val`, ForceString: true}, + {Name: "foo", Value: `bar`, ForceString: false}, + } + argsToBeCleaned := make([]argoappv1.HelmParameter, len(cleanArgs)) copy(argsToBeCleaned, cleanArgs) cleanHelmParameters(argsToBeCleaned) - assert.Equal(t, cleanArgs, argsToBeCleaned) + assert.EqualValues(t, cleanArgs, argsToBeCleaned) - dirtyArgs := []string{`--these-args`, `are-not, clean`, `--foo`, `b\,a,r`} - argsToBeCleaned = make([]string, len(dirtyArgs)) + dirtyArgs := []argoappv1.HelmParameter{ + {Name: "app", Value: `val`, ForceString: true}, + {Name: "test", Value: `not, clean`, ForceString: false}, + {Name: "foo", Value: `a\,b,c`, ForceString: true}, + } + argsToBeCleaned = make([]argoappv1.HelmParameter, len(dirtyArgs)) copy(argsToBeCleaned, dirtyArgs) cleanHelmParameters(argsToBeCleaned) - assert.NotEqual(t, cleanArgs, argsToBeCleaned) - assert.Contains(t, argsToBeCleaned, `are-not\, clean`) - assert.Contains(t, argsToBeCleaned, `b\,a\,r`) + assert.False(t, assert.ObjectsAreEqualValues(cleanArgs, argsToBeCleaned)) + assert.Contains(t, argsToBeCleaned, argoappv1.HelmParameter{Name: "test", Value: `not\, clean`, ForceString: false}) + assert.Contains(t, argsToBeCleaned, argoappv1.HelmParameter{Name: "foo", Value: `a\,b\,c`, ForceString: true}) }