From 15e1a78c95e82606bdd0255b795dd6035344aed2 Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Fri, 18 Sep 2020 14:02:55 -0700 Subject: [PATCH] fix linter --- pkg/skaffold/deploy/kpt.go | 13 +++++++------ pkg/skaffold/deploy/kpt_test.go | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pkg/skaffold/deploy/kpt.go b/pkg/skaffold/deploy/kpt.go index 79401dd64b1..978371d9628 100644 --- a/pkg/skaffold/deploy/kpt.go +++ b/pkg/skaffold/deploy/kpt.go @@ -28,14 +28,15 @@ import ( "regexp" "strings" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + k8syaml "sigs.k8s.io/yaml" + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/build" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/config" deploy "github.com/GoogleContainerTools/skaffold/pkg/skaffold/deploy/kubectl" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/event" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - k8syaml "sigs.k8s.io/yaml" ) const ( @@ -190,8 +191,8 @@ func (k *KptDeployer) renderManifests(ctx context.Context, _ io.Writer, builds [ return nil, nil } - // Remove the kpt function from the manipulated resources. - manifests, err = k.ExcludeKptFn(manifests) + // exclude the kpt function from the manipulated resources. + manifests, err = k.excludeKptFn(manifests) if err != nil { return nil, fmt.Errorf("exclude kpt fn from manipulated resources: %w", err) } @@ -280,9 +281,9 @@ func (k *KptDeployer) kptFnRun(ctx context.Context) (deploy.ManifestList, error) return manifests, nil } -// ExcludeKptFn adds an annotation "config.kubernetes.io/local-config: 'true'" to kpt function. +// excludeKptFn adds an annotation "config.kubernetes.io/local-config: 'true'" to kpt function. // This will exclude kpt functions from deployed to the cluster in kpt live apply. -func (k *KptDeployer) ExcludeKptFn(manifest deploy.ManifestList) (deploy.ManifestList, error) { +func (k *KptDeployer) excludeKptFn(manifest deploy.ManifestList) (deploy.ManifestList, error) { var newManifest deploy.ManifestList for _, yByte := range manifest { // Convert yaml byte config to unstructured.Unstructured diff --git a/pkg/skaffold/deploy/kpt_test.go b/pkg/skaffold/deploy/kpt_test.go index de79ade7bec..dd203b72bc0 100644 --- a/pkg/skaffold/deploy/kpt_test.go +++ b/pkg/skaffold/deploy/kpt_test.go @@ -983,7 +983,7 @@ spec: for _, test := range tests { testutil.Run(t, test.description, func(t *testutil.T) { k := NewKptDeployer(&kptConfig{}, nil) - actualManifest, err := k.ExcludeKptFn(test.manifests) + actualManifest, err := k.excludeKptFn(test.manifests) t.CheckErrorAndDeepEqual(false, err, test.expected.String(), actualManifest.String()) }) }