From 027b7d61ea8b4b38d84f187604063c52fe8d109f Mon Sep 17 00:00:00 2001 From: brianpursley Date: Sun, 18 Oct 2020 20:09:42 -0400 Subject: [PATCH 01/66] Implemented the following WNode methods: * GetFieldValue * GetSlice * GetString * Map * SetAnnotations * SetGvk * SetLabels * SetName * SetNamespace --- api/go.mod | 1 + api/internal/wrappy/factory_test.go | 2 +- api/internal/wrappy/wnode.go | 110 +++++++++++--- api/internal/wrappy/wnode_test.go | 218 +++++++++++++++++++++++++++- 4 files changed, 309 insertions(+), 22 deletions(-) diff --git a/api/go.mod b/api/go.mod index f667e752e..164127ee0 100644 --- a/api/go.mod +++ b/api/go.mod @@ -6,6 +6,7 @@ require ( github.com/evanphx/json-patch v4.5.0+incompatible github.com/go-openapi/spec v0.19.5 github.com/golangci/golangci-lint v1.21.0 + github.com/google/go-cmp v0.3.0 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/pkg/errors v0.8.1 github.com/stretchr/testify v1.4.0 diff --git a/api/internal/wrappy/factory_test.go b/api/internal/wrappy/factory_test.go index 7db433cb6..4eea8268b 100644 --- a/api/internal/wrappy/factory_test.go +++ b/api/internal/wrappy/factory_test.go @@ -1,4 +1,4 @@ // Copyright 2020 The Kubernetes Authors. // SPDX-License-Identifier: Apache-2.0 -package wrappy_test +package wrappy diff --git a/api/internal/wrappy/wnode.go b/api/internal/wrappy/wnode.go index be3bb8485..0989dbc09 100644 --- a/api/internal/wrappy/wnode.go +++ b/api/internal/wrappy/wnode.go @@ -4,7 +4,9 @@ package wrappy import ( + "fmt" "log" + "strings" "sigs.k8s.io/kustomize/api/ifc" "sigs.k8s.io/kustomize/api/resid" @@ -54,10 +56,41 @@ func (wn *WNode) GetAnnotations() map[string]string { // GetFieldValue implements ifc.Kunstructured. func (wn *WNode) GetFieldValue(path string) (interface{}, error) { - // The argument is a json path, e.g. "metadata.name" - // fields := strings.Split(path, ".") - // return wn.node.Pipe(yaml.Lookup(fields...)) - panic("TODO(#WNode): GetFieldValue; implement or drop from API") + fields := strings.Split(path, ".") + rn, err := wn.node.Pipe(yaml.Lookup(fields...)) + if err != nil { + return nil, err + } + if rn == nil { + return nil, NoFieldError{path} + } + yn := rn.YNode() + + // If this is an alias node, resolve it + if yn.Kind == yaml.AliasNode { + yn = yn.Alias + } + + // Return value as map for DocumentNode and MappingNode kinds + if yn.Kind == yaml.DocumentNode || yn.Kind == yaml.MappingNode { + var result map[string]interface{} + if err := yn.Decode(&result); err != nil { + return nil, err + } + return result, err + } + + // Return value as slice for SequenceNode kind + if yn.Kind == yaml.SequenceNode { + var result []interface{} + for _, node := range yn.Content { + result = append(result, node.Value) + } + return result, nil + } + + // Return value value directly for all other (ScalarNode) kinds + return yn.Value, nil } // GetGvk implements ifc.Kunstructured. @@ -83,18 +116,37 @@ func (wn *WNode) GetName() string { } // GetSlice implements ifc.Kunstructured. -func (wn *WNode) GetSlice(string) ([]interface{}, error) { - panic("TODO(#WNode) GetSlice; implement or drop from API") +func (wn *WNode) GetSlice(path string) ([]interface{}, error) { + value, err := wn.GetFieldValue(path) + if err != nil { + return nil, err + } + if sliceValue, ok := value.([]interface{}); ok { + return sliceValue, nil + } + return nil, fmt.Errorf("node %s is not a slice", path) } // GetSlice implements ifc.Kunstructured. -func (wn *WNode) GetString(string) (string, error) { - panic("TODO(#WNode) GetString; implement or drop from API") +func (wn *WNode) GetString(path string) (string, error) { + value, err := wn.GetFieldValue(path) + if err != nil { + return "", err + } + if v, ok := value.(string); ok { + return v, nil + } + return "", fmt.Errorf("node %s is not a string: %v", path, value) } // Map implements ifc.Kunstructured. func (wn *WNode) Map() map[string]interface{} { - panic("TODO(#WNode) Map; implement or drop from API") + var result map[string]interface{} + if err := wn.node.YNode().Decode(&result); err != nil { + // Log and die since interface doesn't allow error. + log.Fatalf("failed to decode ynode: %v", err) + } + return result } // MarshalJSON implements ifc.Kunstructured. @@ -113,31 +165,51 @@ func (wn *WNode) MatchesLabelSelector(string) (bool, error) { } // SetAnnotations implements ifc.Kunstructured. -func (wn *WNode) SetAnnotations(map[string]string) { - panic("TODO(#WNode) SetAnnotations; implement or drop from API") +func (wn *WNode) SetAnnotations(annotations map[string]string) { + wn.setField(yaml.NewMapRNode(&annotations), yaml.MetadataField, yaml.AnnotationsField) } // SetGvk implements ifc.Kunstructured. -func (wn *WNode) SetGvk(resid.Gvk) { - panic("TODO(#WNode) SetGvk; implement or drop from API") +func (wn *WNode) SetGvk(gvk resid.Gvk) { + wn.setField(yaml.NewScalarRNode(gvk.Kind), yaml.KindField) + wn.setField(yaml.NewScalarRNode(fmt.Sprintf("%s/%s", gvk.Group, gvk.Version)), yaml.APIVersionField) } // SetLabels implements ifc.Kunstructured. -func (wn *WNode) SetLabels(map[string]string) { - panic("TODO(#WNode) SetLabels; implement or drop from API") +func (wn *WNode) SetLabels(labels map[string]string) { + wn.setField(yaml.NewMapRNode(&labels), yaml.MetadataField, yaml.LabelsField) } // SetName implements ifc.Kunstructured. -func (wn *WNode) SetName(string) { - panic("TODO(#WNode) SetName; implement or drop from API") +func (wn *WNode) SetName(name string) { + wn.setField(yaml.NewScalarRNode(name), yaml.MetadataField, yaml.NameField) } // SetNamespace implements ifc.Kunstructured. -func (wn *WNode) SetNamespace(string) { - panic("TODO(#WNode) SetNamespace; implement or drop from API") +func (wn *WNode) SetNamespace(ns string) { + wn.setField(yaml.NewScalarRNode(ns), yaml.MetadataField, yaml.NamespaceField) +} + +func (wn *WNode) setField(value *yaml.RNode, path ...string) { + err := wn.node.PipeE( + yaml.LookupCreate(yaml.MappingNode, path[0:len(path)-1]...), + yaml.SetField(path[len(path)-1], value), + ) + if err != nil { + // Log and die since interface doesn't allow error. + log.Fatalf("failed to set field %v: %v", path, err) + } } // UnmarshalJSON implements ifc.Kunstructured. func (wn *WNode) UnmarshalJSON(data []byte) error { return wn.node.UnmarshalJSON(data) } + +type NoFieldError struct { + Field string +} + +func (e NoFieldError) Error() string { + return fmt.Sprintf("no field named '%s'", e.Field) +} diff --git a/api/internal/wrappy/wnode_test.go b/api/internal/wrappy/wnode_test.go index 072373a23..379c8b7d3 100644 --- a/api/internal/wrappy/wnode_test.go +++ b/api/internal/wrappy/wnode_test.go @@ -1,14 +1,16 @@ // Copyright 2019 The Kubernetes Authors. // SPDX-License-Identifier: Apache-2.0 -package wrappy_test +package wrappy import ( "strings" "testing" + "github.com/google/go-cmp/cmp" + "sigs.k8s.io/kustomize/api/resid" + "gopkg.in/yaml.v3" - . "sigs.k8s.io/kustomize/api/internal/wrappy" kyaml "sigs.k8s.io/kustomize/kyaml/yaml" ) @@ -337,3 +339,215 @@ func TestGettingFields(t *testing.T) { t.Fatalf("unexpected annotations '%v'", actualMap) } } + +func TestGetFieldValueReturnsMap(t *testing.T) { + wn := NewWNode() + if err := wn.UnmarshalJSON([]byte(deploymentBiggerJson)); err != nil { + t.Fatalf("unexpected unmarshaljson err: %v", err) + } + expected := map[string]interface{}{ + "fruit": "apple", + "veggie": "carrot", + } + actual, err := wn.GetFieldValue("metadata.labels") + if err != nil { + t.Fatalf("error getting field value: %v", err) + } + if diff := cmp.Diff(expected, actual); diff != "" { + t.Fatalf("actual map does not deep equal expected map:\n%v", diff) + } +} + +func TestGetFieldValueReturnsSlice(t *testing.T) { + bytes, err := yaml.Marshal(makeBigMap()) + if err != nil { + t.Fatalf("unexpected yaml.Marshal err: %v", err) + } + rNode, err := kyaml.Parse(string(bytes)) + if err != nil { + t.Fatalf("unexpected yaml.Marshal err: %v", err) + } + wn := FromRNode(rNode) + expected := []interface{}{"idx0", "idx1", "idx2", "idx3"} + actual, err := wn.GetFieldValue("that") + if err != nil { + t.Fatalf("error getting slice: %v", err) + } + if diff := cmp.Diff(expected, actual); diff != "" { + t.Fatalf("actual slice does not deep equal expected slice:\n%v", diff) + } +} + +func TestGetFieldValueReturnsString(t *testing.T) { + wn := NewWNode() + if err := wn.UnmarshalJSON([]byte(deploymentBiggerJson)); err != nil { + t.Fatalf("unexpected unmarshaljson err: %v", err) + } + actual, err := wn.GetFieldValue("metadata.labels.fruit") + if err != nil { + t.Fatalf("error getting field value: %v", err) + } + v, ok := actual.(string) + if !ok || v != "apple" { + t.Fatalf("unexpected value '%v'", actual) + } +} + +func TestGetFieldValueResolvesAlias(t *testing.T) { + yamlWithAlias := ` +foo: &a theValue +bar: *a +` + rNode, err := kyaml.Parse(yamlWithAlias) + if err != nil { + t.Fatalf("unexpected yaml parse error: %v", err) + } + wn := FromRNode(rNode) + actual, err := wn.GetFieldValue("bar") + if err != nil { + t.Fatalf("error getting field value: %v", err) + } + v, ok := actual.(string) + if !ok || v != "theValue" { + t.Fatalf("unexpected value '%v'", actual) + } +} + +func TestGetString(t *testing.T) { + wn := NewWNode() + if err := wn.UnmarshalJSON([]byte(deploymentBiggerJson)); err != nil { + t.Fatalf("unexpected unmarshaljson err: %v", err) + } + expected := "carrot" + actual, err := wn.GetString("metadata.labels.veggie") + if err != nil { + t.Fatalf("error getting string: %v", err) + } + if expected != actual { + t.Fatalf("expected '%s', got '%s'", expected, actual) + } +} + +func TestGetSlice(t *testing.T) { + bytes, err := yaml.Marshal(makeBigMap()) + if err != nil { + t.Fatalf("unexpected yaml.Marshal err: %v", err) + } + rNode, err := kyaml.Parse(string(bytes)) + if err != nil { + t.Fatalf("unexpected yaml.Marshal err: %v", err) + } + wn := FromRNode(rNode) + expected := []interface{}{"idx0", "idx1", "idx2", "idx3"} + actual, err := wn.GetSlice("that") + if err != nil { + t.Fatalf("error getting slice: %v", err) + } + if diff := cmp.Diff(expected, actual); diff != "" { + t.Fatalf("actual slice does not deep equal expected slice:\n%v", diff) + } +} + +func TestMap(t *testing.T) { + wn := NewWNode() + if err := wn.UnmarshalJSON([]byte(deploymentLittleJson)); err != nil { + t.Fatalf("unexpected unmarshaljson err: %v", err) + } + + expected := map[string]interface{}{ + "apiVersion": "apps/v1", + "kind": "Deployment", + "metadata": map[string]interface{}{ + "name": "homer", + "namespace": "simpsons", + }, + } + + actual := wn.Map() + if diff := cmp.Diff(expected, actual); diff != "" { + t.Fatalf("actual map does not deep equal expected map:\n%v", diff) + } +} + +func TestSetName(t *testing.T) { + wn := NewWNode() + if err := wn.UnmarshalJSON([]byte(deploymentBiggerJson)); err != nil { + t.Fatalf("unexpected unmarshaljson err: %v", err) + } + wn.SetName("marge") + if expected, actual := "marge", wn.GetName(); expected != actual { + t.Fatalf("expected '%s', got '%s'", expected, actual) + } +} + +func TestSetNamespace(t *testing.T) { + wn := NewWNode() + if err := wn.UnmarshalJSON([]byte(deploymentBiggerJson)); err != nil { + t.Fatalf("unexpected unmarshaljson err: %v", err) + } + wn.SetNamespace("flanders") + meta, _ := wn.node.GetMeta() + if expected, actual := "flanders", meta.Namespace; expected != actual { + t.Fatalf("expected '%s', got '%s'", expected, actual) + } +} + +func TestSetLabels(t *testing.T) { + wn := NewWNode() + if err := wn.UnmarshalJSON([]byte(deploymentBiggerJson)); err != nil { + t.Fatalf("unexpected unmarshaljson err: %v", err) + } + wn.SetLabels(map[string]string{ + "label1": "foo", + "label2": "bar", + }) + labels := wn.GetLabels() + if expected, actual := 2, len(labels); expected != actual { + t.Fatalf("expected '%d', got '%d'", expected, actual) + } + if expected, actual := "foo", labels["label1"]; expected != actual { + t.Fatalf("expected '%s', got '%s'", expected, actual) + } + if expected, actual := "bar", labels["label2"]; expected != actual { + t.Fatalf("expected '%s', got '%s'", expected, actual) + } +} + +func TestGetAnnotations(t *testing.T) { + wn := NewWNode() + if err := wn.UnmarshalJSON([]byte(deploymentBiggerJson)); err != nil { + t.Fatalf("unexpected unmarshaljson err: %v", err) + } + wn.SetAnnotations(map[string]string{ + "annotation1": "foo", + "annotation2": "bar", + }) + annotations := wn.GetAnnotations() + if expected, actual := 2, len(annotations); expected != actual { + t.Fatalf("expected '%d', got '%d'", expected, actual) + } + if expected, actual := "foo", annotations["annotation1"]; expected != actual { + t.Fatalf("expected '%s', got '%s'", expected, actual) + } + if expected, actual := "bar", annotations["annotation2"]; expected != actual { + t.Fatalf("expected '%s', got '%s'", expected, actual) + } +} + +func TestSetGvk(t *testing.T) { + wn := NewWNode() + if err := wn.UnmarshalJSON([]byte(deploymentBiggerJson)); err != nil { + t.Fatalf("unexpected unmarshaljson err: %v", err) + } + wn.SetGvk(resid.GvkFromString("grp_ver_knd")) + gvk := wn.GetGvk() + if expected, actual := "grp", gvk.Group; expected != actual { + t.Fatalf("expected '%s', got '%s'", expected, actual) + } + if expected, actual := "ver", gvk.Version; expected != actual { + t.Fatalf("expected '%s', got '%s'", expected, actual) + } + if expected, actual := "knd", gvk.Kind; expected != actual { + t.Fatalf("expected '%s', got '%s'", expected, actual) + } +} From 9ae07634f2cd28b28605e0be832f38c0bad105db Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Fri, 30 Oct 2020 11:45:40 -0700 Subject: [PATCH 02/66] update cloudbuild for image pushing job --- releasing/cloudbuild_kustomize_image.yaml | 32 +++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/releasing/cloudbuild_kustomize_image.yaml b/releasing/cloudbuild_kustomize_image.yaml index a31a93e82..2311e3444 100644 --- a/releasing/cloudbuild_kustomize_image.yaml +++ b/releasing/cloudbuild_kustomize_image.yaml @@ -7,12 +7,8 @@ steps: - "Cloud build substitution check: " - "BUILD_ID=$BUILD_ID" - "PROJECT_ID=$PROJECT_ID" - - "REVISION_ID=$REVISION_ID" - - "REPO_NAME=$REPO_NAME" - - "COMMIT_SHA=$COMMIT_SHA" - - "BRANCH_NAME=$BRANCH_NAME" - - "TAG_NAME=$TAG_NAME" - + - "_GIT_TAG=$_GIT_TAG" + - "_PULL_BASE_REF=$_PULL_BASE_REF" # We need to use bash to configure the build date properly. - name: "gcr.io/cloud-builders/docker" entrypoint: /bin/bash @@ -22,23 +18,31 @@ steps: docker build -t - gcr.io/$PROJECT_ID/$_MODULE_NAME:$_MODULE_VERSION + gcr.io/$PROJECT_ID/kustomize:${_GIT_TAG} -t - gcr.io/$PROJECT_ID/$_MODULE_NAME:latest + gcr.io/$PROJECT_ID/kustomize:latest -f kustomize.Dockerfile --build-arg - VERSION=$TAG_NAME + VERSION=${_VERSION} --build-arg - COMMIT=$COMMIT_SHA + COMMIT=$(git rev-parse HEAD) --build-arg DATE=`date -u +%FT%TZ` . images: - - "gcr.io/$PROJECT_ID/$_MODULE_NAME:$_MODULE_VERSION" - - "gcr.io/$PROJECT_ID/$_MODULE_NAME:latest" + - "gcr.io/$PROJECT_ID/kustomize:${_GIT_TAG}" + - "gcr.io/$PROJECT_ID/kustomize:latest" substitutions: - _MODULE_NAME: ${TAG_NAME%/*} - _MODULE_VERSION: ${TAG_NAME#*/} + # _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and + # can be used as a substitution + _GIT_TAG: "12345" + # _PULL_BASE_REF will contain the ref that was pushed to to trigger this build - + # a branch like 'master' or 'release-0.2', or a tag like 'v0.2'. + _PULL_BASE_REF: "master" + _VERSION: ${_PULL_BASE_REF#*/} + +options: + substitution_option: ALLOW_LOOSE From e75d4fc87d48e815d468b04b785522cbb6e15ec8 Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Fri, 30 Oct 2020 14:53:42 -0700 Subject: [PATCH 03/66] convert helm inflator to builtin plugin --- Makefile | 15 +- api/builtins/HelmChartInflationGenerator.go | 180 ++++++ .../plugins/builtinhelpers/builtins.go | 6 +- .../target/kusttarget_configplugin.go | 18 + .../helmchartinflationgenerator_test.go | 75 +++ api/types/helmchartargs.go | 19 + api/types/kustomization.go | 5 + examples/chart.md | 108 ++-- .../HelmChartInflationGenerator.go | 182 ++++++ .../HelmChartInflationGenerator_test.go | 298 ++++++++++ .../helmchartinflationgenerator/go.mod | 11 + .../helmchartinflationgenerator/go.sum | 530 ++++++++++++++++++ site/content/en/guides/plugins/builtins.md | 167 ++++-- 13 files changed, 1511 insertions(+), 103 deletions(-) create mode 100644 api/builtins/HelmChartInflationGenerator.go create mode 100644 api/krusty/helmchartinflationgenerator_test.go create mode 100644 api/types/helmchartargs.go create mode 100644 plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go create mode 100644 plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go create mode 100644 plugin/builtin/helmchartinflationgenerator/go.mod create mode 100644 plugin/builtin/helmchartinflationgenerator/go.sum diff --git a/Makefile b/Makefile index cf299c7bc..865ae6a20 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,8 @@ install-tools: \ $(MYGOBIN)/mdrip \ $(MYGOBIN)/pluginator \ $(MYGOBIN)/prchecker \ - $(MYGOBIN)/stringer + $(MYGOBIN)/stringer \ + $(MYGOBIN)/helm ### Begin kustomize plugin rules. # @@ -133,7 +134,8 @@ _builtinplugins = \ PrefixSuffixTransformer.go \ ReplicaCountTransformer.go \ SecretGenerator.go \ - ValueAddTransformer.go + ValueAddTransformer.go \ + HelmChartInflationGenerator.go # Maintaining this explicit list of generated files, and # adding it as a dependency to a few targets, to assure @@ -159,6 +161,7 @@ $(pGen)/PrefixSuffixTransformer.go: $(pSrc)/prefixsuffixtransformer/PrefixSuffix $(pGen)/ReplicaCountTransformer.go: $(pSrc)/replicacounttransformer/ReplicaCountTransformer.go $(pGen)/SecretGenerator.go: $(pSrc)/secretgenerator/SecretGenerator.go $(pGen)/ValueAddTransformer.go: $(pSrc)/valueaddtransformer/ValueAddTransformer.go +$(pGen)/HelmChartInflationGenerator.go: $(pSrc)/helmchartinflationgenerator/HelmChartInflationGenerator.go # The (verbose but portable) Makefile way to convert to lowercase. toLowerCase = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1)))))))))))))))))))))))))) @@ -304,16 +307,16 @@ $(MYGOBIN)/helmV3: ( \ set -e; \ d=$(shell mktemp -d); cd $$d; \ - tgzFile=helm-v3.2.0-rc.1-linux-amd64.tar.gz; \ + tgzFile=helm-v3.4.0-linux-amd64.tar.gz; \ wget https://get.helm.sh/$$tgzFile; \ tar -xvzf $$tgzFile; \ mv linux-amd64/helm $(MYGOBIN)/helmV3; \ rm -rf $$d \ ) -# Default version of helm is v2 for the time being. -$(MYGOBIN)/helm: $(MYGOBIN)/helmV2 - ln -s $(MYGOBIN)/helmV2 $(MYGOBIN)/helm +# Default version of helm is v3. +$(MYGOBIN)/helm: $(MYGOBIN)/helmV3 + ln -s $(MYGOBIN)/helmV3 $(MYGOBIN)/helm $(MYGOBIN)/kind: ( \ diff --git a/api/builtins/HelmChartInflationGenerator.go b/api/builtins/HelmChartInflationGenerator.go new file mode 100644 index 000000000..0fa4e8ca4 --- /dev/null +++ b/api/builtins/HelmChartInflationGenerator.go @@ -0,0 +1,180 @@ +// Code generated by pluginator on HelmChartInflationGenerator; DO NOT EDIT. +// pluginator {unknown 1970-01-01T00:00:00Z } + + + +package builtins + +import ( + "bytes" + "fmt" + "os" + "os/exec" + "path" + "regexp" + "strings" + + "github.com/pkg/errors" + "sigs.k8s.io/kustomize/api/filesys" + "sigs.k8s.io/kustomize/api/resmap" + "sigs.k8s.io/kustomize/api/types" + "sigs.k8s.io/yaml" +) + +// HelmChartInflationGeneratorPlugin is a plugin to generate resources +// from a remote or local helm chart. +type HelmChartInflationGeneratorPlugin struct { + h *resmap.PluginHelpers + types.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + runHelmCommand func([]string) ([]byte, error) + types.HelmChartArgs + tmpDir string +} + +var KustomizePlugin HelmChartInflationGeneratorPlugin + +// Config uses the input plugin configurations `config` to setup the generator +// options +func (p *HelmChartInflationGeneratorPlugin) Config(h *resmap.PluginHelpers, config []byte) error { + p.h = h + err := yaml.Unmarshal(config, p) + if err != nil { + return err + } + tmpDir, err := filesys.NewTmpConfirmedDir() + if err != nil { + return err + } + p.tmpDir = string(tmpDir) + if p.ChartName == "" { + return fmt.Errorf("chartName cannot be empty") + } + if p.ChartHome == "" { + p.ChartHome = path.Join(p.tmpDir, "chart") + } + if p.ChartRepoName == "" { + p.ChartRepoName = "stable" + } + if p.HelmBin == "" { + p.HelmBin = "helm" + } + if p.HelmHome == "" { + p.HelmHome = path.Join(p.tmpDir, ".helm") + } + if p.Values == "" { + p.Values = path.Join(p.ChartHome, p.ChartName, "values.yaml") + } + // runHelmCommand will run `helm` command with args provided. Return stdout + // and error if there is any. + p.runHelmCommand = func(args []string) ([]byte, error) { + stdout := new(bytes.Buffer) + stderr := new(bytes.Buffer) + cmd := exec.Command(p.HelmBin, args...) + cmd.Stdout = stdout + cmd.Stderr = stderr + cmd.Env = append(cmd.Env, + fmt.Sprintf("HELM_CONFIG_HOME=%s", p.HelmHome), + fmt.Sprintf("HELM_CACHE_HOME=%s/.cache", p.HelmHome), + fmt.Sprintf("HELM_DATA_HOME=%s/.data", p.HelmHome), + ) + err := cmd.Run() + if err != nil { + return stdout.Bytes(), + errors.Wrap( + fmt.Errorf("failed to run command %s %s", p.HelmBin, strings.Join(args, " ")), + stderr.String(), + ) + } + return stdout.Bytes(), nil + } + return nil +} + +// Generate implements generator +func (p *HelmChartInflationGeneratorPlugin) Generate() (resmap.ResMap, error) { + // cleanup + defer os.RemoveAll(p.tmpDir) + // check helm version. we only support V3 + err := p.checkHelmVersion() + if err != nil { + return nil, err + } + // pull the chart + if !p.checkLocalChart() { + _, err := p.runHelmCommand(p.getPullCommandArgs()) + if err != nil { + return nil, err + } + } + // render the charts + stdout, err := p.runHelmCommand(p.getTemplateCommandArgs()) + if err != nil { + return nil, err + } + + return p.h.ResmapFactory().NewResMapFromBytes(stdout) +} + +func (p *HelmChartInflationGeneratorPlugin) getTemplateCommandArgs() []string { + args := []string{"template"} + if p.ReleaseName != "" { + args = append(args, p.ReleaseName) + } + args = append(args, path.Join(p.ChartHome, p.ChartName)) + if p.ReleaseNamespace != "" { + args = append(args, "--namespace", p.ReleaseNamespace) + } + if p.Values != "" { + args = append(args, "--values", p.Values) + } + return args +} + +func (p *HelmChartInflationGeneratorPlugin) getPullCommandArgs() []string { + args := []string{"pull", "--untar", "--untardir", p.ChartHome} + chartName := fmt.Sprintf("%s/%s", p.ChartRepoName, p.ChartName) + if p.ChartVersion != "" { + args = append(args, "--version", p.ChartVersion) + } + if p.ChartRepoURL != "" { + args = append(args, "--repo", p.ChartRepoURL) + chartName = p.ChartName + } + + args = append(args, chartName) + + return args +} + +// checkLocalChart will return true if the chart does exist in +// local chart home. +func (p *HelmChartInflationGeneratorPlugin) checkLocalChart() bool { + path := path.Join(p.ChartHome, p.ChartName) + s, err := os.Stat(path) + if err != nil { + return false + } + return s.IsDir() +} + +// checkHelmVersion will return an error if the helm version is not V3 +func (p *HelmChartInflationGeneratorPlugin) checkHelmVersion() error { + stdout, err := p.runHelmCommand([]string{"version", "-c", "--short"}) + if err != nil { + return err + } + r, err := regexp.Compile(`v\d+(\.\d+)+`) + if err != nil { + return err + } + v := string(r.Find(stdout))[1:] + majorVersion := strings.Split(v, ".")[0] + if majorVersion != "3" { + return fmt.Errorf("this plugin requires helm V3 but got v%s", v) + } + return nil +} + +func NewHelmChartInflationGeneratorPlugin() resmap.GeneratorPlugin { + return &HelmChartInflationGeneratorPlugin{} +} diff --git a/api/internal/plugins/builtinhelpers/builtins.go b/api/internal/plugins/builtinhelpers/builtins.go index 60934fde8..f53583981 100644 --- a/api/internal/plugins/builtinhelpers/builtins.go +++ b/api/internal/plugins/builtinhelpers/builtins.go @@ -27,6 +27,7 @@ const ( ReplicaCountTransformer SecretGenerator ValueAddTransformer + HelmChartInflationGenerator ) var stringToBuiltinPluginTypeMap map[string]BuiltinPluginType @@ -55,8 +56,9 @@ func GetBuiltinPluginType(n string) BuiltinPluginType { } var GeneratorFactories = map[BuiltinPluginType]func() resmap.GeneratorPlugin{ - ConfigMapGenerator: builtins.NewConfigMapGeneratorPlugin, - SecretGenerator: builtins.NewSecretGeneratorPlugin, + ConfigMapGenerator: builtins.NewConfigMapGeneratorPlugin, + SecretGenerator: builtins.NewSecretGeneratorPlugin, + HelmChartInflationGenerator: builtins.NewHelmChartInflationGeneratorPlugin, } var TransformerFactories = map[BuiltinPluginType]func() resmap.TransformerPlugin{ diff --git a/api/internal/target/kusttarget_configplugin.go b/api/internal/target/kusttarget_configplugin.go index 324dc8999..418931a8c 100644 --- a/api/internal/target/kusttarget_configplugin.go +++ b/api/internal/target/kusttarget_configplugin.go @@ -32,6 +32,7 @@ func (kt *KustTarget) configureBuiltinGenerators() ( for _, bpt := range []builtinhelpers.BuiltinPluginType{ builtinhelpers.ConfigMapGenerator, builtinhelpers.SecretGenerator, + builtinhelpers.HelmChartInflationGenerator, } { r, err := generatorConfigurators[bpt]( kt, bpt, builtinhelpers.GeneratorFactories[bpt]) @@ -110,6 +111,23 @@ var generatorConfigurators = map[builtinhelpers.BuiltinPluginType]func( } return }, + + builtinhelpers.HelmChartInflationGenerator: func(kt *KustTarget, bpt builtinhelpers.BuiltinPluginType, f gFactory) ( + result []resmap.Generator, err error) { + var c struct { + types.HelmChartArgs + } + for _, args := range kt.kustomization.HelmChartInflationGenerator { + c.HelmChartArgs = args + p := f() + err := kt.configureBuiltinPlugin(p, c, bpt) + if err != nil { + return nil, err + } + result = append(result, p) + } + return + }, } type tFactory func() resmap.TransformerPlugin diff --git a/api/krusty/helmchartinflationgenerator_test.go b/api/krusty/helmchartinflationgenerator_test.go new file mode 100644 index 000000000..6b72c729c --- /dev/null +++ b/api/krusty/helmchartinflationgenerator_test.go @@ -0,0 +1,75 @@ +// Copyright 2020 The Kubernetes Authors. +// SPDX-License-Identifier: Apache-2.0 + +package krusty_test + +import ( + "testing" + + kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest" +) + +func TestHelmChartInflationGenerator(t *testing.T) { + th := kusttest_test.MakeHarness(t) + th.WriteK("/app", ` +helmChartInflationGenerator: +- chartName: minecraft + chartRepoUrl: https://kubernetes-charts.storage.googleapis.com + chartVersion: v1.2.0 + releaseName: test + releaseNamespace: testNamespace +`) + + m := th.Run("/app", th.MakeDefaultOptions()) + th.AssertActualEqualsExpected(m, ` +apiVersion: v1 +data: + rcon-password: Q0hBTkdFTUUh +kind: Secret +metadata: + labels: + app: test-minecraft + chart: minecraft-1.2.0 + heritage: Helm + release: test + name: test-minecraft +type: Opaque +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + annotations: + volume.alpha.kubernetes.io/storage-class: default + labels: + app: test-minecraft + chart: minecraft-1.2.0 + heritage: Helm + release: test + name: test-minecraft-datadir +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: test-minecraft + chart: minecraft-1.2.0 + heritage: Helm + release: test + name: test-minecraft +spec: + ports: + - name: minecraft + port: 25565 + protocol: TCP + targetPort: minecraft + selector: + app: test-minecraft + type: LoadBalancer +`) +} diff --git a/api/types/helmchartargs.go b/api/types/helmchartargs.go new file mode 100644 index 000000000..96ebdb949 --- /dev/null +++ b/api/types/helmchartargs.go @@ -0,0 +1,19 @@ +// Copyright 2019 The Kubernetes Authors. +// SPDX-License-Identifier: Apache-2.0 + +package types + +// HelmChartArgs contains the metadata of how to generate a secret. +type HelmChartArgs struct { + ChartName string `json:"chartName,omitempty" yaml:"chartName,omitempty"` + ChartVersion string `json:"chartVersion,omitempty" yaml:"chartVersion,omitempty"` + ChartRepoURL string `json:"chartRepoUrl,omitempty" yaml:"chartRepoUrl,omitempty"` + ChartHome string `json:"chartHome,omitempty" yaml:"chartHome,omitempty"` + // Use chartRelease to keep compatible with old exec plugin + ChartRepoName string `json:"chartRelease,omitempty" yaml:"chartRelease,omitempty"` + HelmBin string `json:"helmBin,omitempty" yaml:"helmBin,omitempty"` + HelmHome string `json:"helmHome,omitempty" yaml:"helmHome,omitempty"` + Values string `json:"values,omitempty" yaml:"values,omitempty"` + ReleaseName string `json:"releaseName,omitempty" yaml:"releaseName,omitempty"` + ReleaseNamespace string `json:"releaseNamespace,omitempty" yaml:"releaseNamespace,omitempty"` +} diff --git a/api/types/kustomization.go b/api/types/kustomization.go index 6be8053f4..da7e24c72 100644 --- a/api/types/kustomization.go +++ b/api/types/kustomization.go @@ -122,6 +122,11 @@ type Kustomization struct { // the map will have a suffix hash generated from its contents. SecretGenerator []SecretArgs `json:"secretGenerator,omitempty" yaml:"secretGenerator,omitempty"` + // HelmChartInflationGenerator is a list of helm chart configurations. + // The resulting resource is a normal operand rendered from + // a remote chart by `helm template` + HelmChartInflationGenerator []HelmChartArgs `json:"helmChartInflationGenerator,omitempty" yaml:"helmChartInflationGenerator,omitempty"` + // GeneratorOptions modify behavior of all ConfigMap and Secret generators. GeneratorOptions *GeneratorOptions `json:"generatorOptions,omitempty" yaml:"generatorOptions,omitempty"` diff --git a/examples/chart.md b/examples/chart.md index 0ab44b90c..e0d48dd07 100644 --- a/examples/chart.md +++ b/examples/chart.md @@ -2,12 +2,12 @@ [last mile]: https://testingclouds.wordpress.com/2018/07/20/844/ [stable chart]: https://github.com/helm/charts/tree/master/stable -[Helm charts]: https://github.com/helm/charts +[helm charts]: https://github.com/helm/charts [_minecraft_]: https://github.com/helm/charts/tree/master/stable/minecraft [plugin]: ../docs/plugins [Helm charts] aren't natively read by kustomize, but -kustomize has a [plugin] system that allows one to +kustomize has a built in HelmChartInflationGenerator that allows one to access helm charts. One pattern combining kustomize and helm is @@ -16,17 +16,16 @@ one uses an inflated chart as a base, then modifies it on the way to the cluster using kustomize. -The plugin used in the example below is coded to work -only for charts found in the [stable chart] repo. The -example arbitrarily uses [_minecraft_], but should work -for any chart. +The example arbitrarily uses [_minecraft_] in [stable chart] repository, +but should work for any chart in any valid chart repository. The following example assumes you have `helm` -on your `$PATH`. +on your `$PATH`. The plugin only supports helm V3 or later. Make a place to work: + ``` DEMO_HOME=$(mktemp -d) mkdir -p $DEMO_HOME/base @@ -44,6 +43,7 @@ other examples), but in this case just add the name prefix `dev-` to all resources: + ``` cat <<'EOF' >$DEMO_HOME/dev/kustomization.yaml namePrefix: dev- @@ -56,6 +56,7 @@ Likewise define a _production_ variant, with a name prefix `prod-`: + ``` cat <<'EOF' >$DEMO_HOME/prod/kustomization.yaml namePrefix: prod- @@ -69,6 +70,7 @@ These two variants refer to a common base. Define this base: + ``` cat <<'EOF' >$DEMO_HOME/base/kustomization.yaml generators: @@ -84,42 +86,26 @@ and other things like a path to a values file, defaulting to the `values.yaml` that comes with the chart. Create the config file `chartInflator.yaml`, specifying -the arbitrarily chosen chart name _minecraft_: +the arbitrarily chosen chart name _minecraft_ and the repository +url that will be used to find the chart: + ``` cat <<'EOF' >$DEMO_HOME/base/chartInflator.yaml -apiVersion: someteam.example.com/v1 -kind: ChartInflator +apiVersion: builtin +kind: HelmChartInflationGenerator metadata: name: notImportantHere chartName: minecraft +chartRepoUrl: https://kubernetes-charts.storage.googleapis.com EOF ``` -Because this particular YAML file is listed in the -`generators:` stanza of a kustomization file, it is -treated as the binding between a generator plugin - -identified by the _apiVersion_ and _kind_ fields - and -other fields that configure the plugin. - -Download the plugin to your `DEMO_HOME` and make it -executable: - - -``` -plugin=plugin/someteam.example.com/v1/chartinflator/ChartInflator -curl -s --create-dirs -o \ -"$DEMO_HOME/kustomize/$plugin" \ -"https://raw.githubusercontent.com/\ -kubernetes-sigs/kustomize/master/$plugin" - -chmod a+x $DEMO_HOME/kustomize/$plugin -``` - Check the directory layout: + ``` tree $DEMO_HOME ``` @@ -133,12 +119,6 @@ Expect something like: > │   └── kustomization.yaml > ├── dev > │   └── kustomization.yaml -> ├── kustomize -> │   └── plugin -> │   └── someteam.example.com -> │   └── v1 -> │   └── chartinflator -> │   └── ChartInflator > └── prod > └── kustomization.yaml > ``` @@ -147,6 +127,7 @@ Define a helper function to run kustomize with the correct environment and flags for plugins: + ``` function kustomizeIt { XDG_CONFIG_HOME=$DEMO_HOME \ @@ -155,10 +136,11 @@ function kustomizeIt { } ``` -Finally, build the `prod` variant. Notice that all -resource names now have the `prod-` prefix: +Finally, build the `prod` variant. Notice that all +resource names now have the `prod-` prefix: + ``` clear kustomizeIt prod @@ -167,24 +149,25 @@ kustomizeIt prod Compare `dev` to `prod`: + ``` diff <(kustomizeIt dev) <(kustomizeIt prod) | more ``` To see the unmodified but inflated chart, run kustomize -on the base. Every invocation here is re-downloading +on the base. Every invocation here is re-downloading and re-inflating the chart. + ``` kustomizeIt base ``` - ## Use a local chart The example above fetches a new copy of the chart -to a temporary directory with each kustomize +and render it with each kustomize build, because a local chart home isn't specified in the configuration. @@ -195,42 +178,46 @@ there. To demo this so that it won't interfere with your existing helm environment, do this: +**This demo uses Helm V3** + + ``` helmHome=$DEMO_HOME/dothelm chartHome=$DEMO_HOME/base/charts +repoUrl=https://kubernetes-charts.storage.googleapis.com function doHelm { helm --home $helmHome $@ } - -# Create helm config files in a new location. -# The init command is extremely chatty -doHelm init --client-only >& /dev/null ``` Now download a chart; again use _minecraft_ (but you could use anything): + ``` -doHelm fetch --untar \ +doHelm pull --untar \ --untardir $chartHome \ - stable/minecraft + --repo $repoUrl \ + minecraft ``` The tree has more stuff now; helm config data and a complete copy of the chart: + + ``` tree $DEMO_HOME ``` - Add a `chartHome` field to the generator config file so that it knows where to find the local chart: + ``` echo "chartHome: $chartHome" >>$DEMO_HOME/base/chartInflator.yaml ``` @@ -239,6 +226,7 @@ Change the values file, to show that the results generated below are from the _locally_ stored chart: + ``` sed -i 's/CHANGEME!/SOMETHINGELSE/' $chartHome/minecraft/values.yaml sed -i 's/LoadBalancer/NodePort/' $chartHome/minecraft/values.yaml @@ -247,9 +235,31 @@ sed -i 's/LoadBalancer/NodePort/' $chartHome/minecraft/values.yaml Finally, built it + ``` kustomizeIt prod ``` -and observe the change from `LoadBalancer` to `NodePort`, and +and observe the change from `LoadBalancer` to `NodePort`, and the change in the encoded password. + +Clean the directory. + + + +``` +rm -r $DEMO_HOME +``` + +## How to migrate from old plugin to builtin plugin + +Before, we have [chartinflator](https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/chartinflator) +plugin which servers as an external plugin. Although you can continue +using it but we recommend to migrate to builtin one if you are using +Helm V3. For Helm V2 user, we haven't implemented V2 support in builtin +plugin. + +What you need to do for your generator config file: + +- Change the `apiVersion` to `builtin`. +- Change the `kind` to `HelmChartInflationGenerator` diff --git a/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go new file mode 100644 index 000000000..53fe9c092 --- /dev/null +++ b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go @@ -0,0 +1,182 @@ +// Copyright 2019 The Kubernetes Authors. +// SPDX-License-Identifier: Apache-2.0 + +// Helm chart generator +// +// Fetches the given chart from {ChartRepo}/{ChartName}, +// and inflates it to stdout, using the given values file. +// This generator expects helm V3 or later. + +//go:generate pluginator +package main + +import ( + "bytes" + "fmt" + "os" + "os/exec" + "path" + "regexp" + "strings" + + "github.com/pkg/errors" + "sigs.k8s.io/kustomize/api/filesys" + "sigs.k8s.io/kustomize/api/resmap" + "sigs.k8s.io/kustomize/api/types" + "sigs.k8s.io/yaml" +) + +// HelmChartInflationGeneratorPlugin is a plugin to generate resources +// from a remote or local helm chart. +type HelmChartInflationGeneratorPlugin struct { + h *resmap.PluginHelpers + types.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + runHelmCommand func([]string) ([]byte, error) + types.HelmChartArgs + tmpDir string +} + +//noinspection GoUnusedGlobalVariable +var KustomizePlugin HelmChartInflationGeneratorPlugin + +// Config uses the input plugin configurations `config` to setup the generator +// options +func (p *HelmChartInflationGeneratorPlugin) Config(h *resmap.PluginHelpers, config []byte) error { + p.h = h + err := yaml.Unmarshal(config, p) + if err != nil { + return err + } + tmpDir, err := filesys.NewTmpConfirmedDir() + if err != nil { + return err + } + p.tmpDir = string(tmpDir) + if p.ChartName == "" { + return fmt.Errorf("chartName cannot be empty") + } + if p.ChartHome == "" { + p.ChartHome = path.Join(p.tmpDir, "chart") + } + if p.ChartRepoName == "" { + p.ChartRepoName = "stable" + } + if p.HelmBin == "" { + p.HelmBin = "helm" + } + if p.HelmHome == "" { + p.HelmHome = path.Join(p.tmpDir, ".helm") + } + if p.Values == "" { + p.Values = path.Join(p.ChartHome, p.ChartName, "values.yaml") + } + // runHelmCommand will run `helm` command with args provided. Return stdout + // and error if there is any. + p.runHelmCommand = func(args []string) ([]byte, error) { + stdout := new(bytes.Buffer) + stderr := new(bytes.Buffer) + cmd := exec.Command(p.HelmBin, args...) + cmd.Stdout = stdout + cmd.Stderr = stderr + cmd.Env = append(cmd.Env, + fmt.Sprintf("HELM_CONFIG_HOME=%s", p.HelmHome), + fmt.Sprintf("HELM_CACHE_HOME=%s/.cache", p.HelmHome), + fmt.Sprintf("HELM_DATA_HOME=%s/.data", p.HelmHome), + ) + err := cmd.Run() + if err != nil { + return stdout.Bytes(), + errors.Wrap( + fmt.Errorf("failed to run command %s %s", p.HelmBin, strings.Join(args, " ")), + stderr.String(), + ) + } + return stdout.Bytes(), nil + } + return nil +} + +// Generate implements generator +func (p *HelmChartInflationGeneratorPlugin) Generate() (resmap.ResMap, error) { + // cleanup + defer os.RemoveAll(p.tmpDir) + // check helm version. we only support V3 + err := p.checkHelmVersion() + if err != nil { + return nil, err + } + // pull the chart + if !p.checkLocalChart() { + _, err := p.runHelmCommand(p.getPullCommandArgs()) + if err != nil { + return nil, err + } + } + // render the charts + stdout, err := p.runHelmCommand(p.getTemplateCommandArgs()) + if err != nil { + return nil, err + } + + return p.h.ResmapFactory().NewResMapFromBytes(stdout) +} + +func (p *HelmChartInflationGeneratorPlugin) getTemplateCommandArgs() []string { + args := []string{"template"} + if p.ReleaseName != "" { + args = append(args, p.ReleaseName) + } + args = append(args, path.Join(p.ChartHome, p.ChartName)) + if p.ReleaseNamespace != "" { + args = append(args, "--namespace", p.ReleaseNamespace) + } + if p.Values != "" { + args = append(args, "--values", p.Values) + } + return args +} + +func (p *HelmChartInflationGeneratorPlugin) getPullCommandArgs() []string { + args := []string{"pull", "--untar", "--untardir", p.ChartHome} + chartName := fmt.Sprintf("%s/%s", p.ChartRepoName, p.ChartName) + if p.ChartVersion != "" { + args = append(args, "--version", p.ChartVersion) + } + if p.ChartRepoURL != "" { + args = append(args, "--repo", p.ChartRepoURL) + chartName = p.ChartName + } + + args = append(args, chartName) + + return args +} + +// checkLocalChart will return true if the chart does exist in +// local chart home. +func (p *HelmChartInflationGeneratorPlugin) checkLocalChart() bool { + path := path.Join(p.ChartHome, p.ChartName) + s, err := os.Stat(path) + if err != nil { + return false + } + return s.IsDir() +} + +// checkHelmVersion will return an error if the helm version is not V3 +func (p *HelmChartInflationGeneratorPlugin) checkHelmVersion() error { + stdout, err := p.runHelmCommand([]string{"version", "-c", "--short"}) + if err != nil { + return err + } + r, err := regexp.Compile(`v\d+(\.\d+)+`) + if err != nil { + return err + } + v := string(r.Find(stdout))[1:] + majorVersion := strings.Split(v, ".")[0] + if majorVersion != "3" { + return fmt.Errorf("this plugin requires helm V3 but got v%s", v) + } + return nil +} diff --git a/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go new file mode 100644 index 000000000..99ab39a4d --- /dev/null +++ b/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go @@ -0,0 +1,298 @@ +package main_test + +import ( + "fmt" + "io/ioutil" + "os" + "path" + "testing" + + "sigs.k8s.io/kustomize/api/filesys" + kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest" +) + +func TestHelmChartInflationGenerator(t *testing.T) { + th := kusttest_test.MakeEnhancedHarness(t). + PrepBuiltin("HelmChartInflationGenerator") + defer th.Reset() + + rm := th.LoadAndRunGenerator(` +apiVersion: builtin +kind: HelmChartInflationGenerator +metadata: + name: myMap +chartName: minecraft +chartRepoUrl: https://kubernetes-charts.storage.googleapis.com +chartVersion: v1.2.0 +releaseName: test +releaseNamespace: testNamespace +`) + + th.AssertActualEqualsExpected(rm, ` +apiVersion: v1 +data: + rcon-password: Q0hBTkdFTUUh +kind: Secret +metadata: + labels: + app: test-minecraft + chart: minecraft-1.2.0 + heritage: Helm + release: test + name: test-minecraft +type: Opaque +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + annotations: + volume.alpha.kubernetes.io/storage-class: default + labels: + app: test-minecraft + chart: minecraft-1.2.0 + heritage: Helm + release: test + name: test-minecraft-datadir +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: test-minecraft + chart: minecraft-1.2.0 + heritage: Helm + release: test + name: test-minecraft +spec: + ports: + - name: minecraft + port: 25565 + protocol: TCP + targetPort: minecraft + selector: + app: test-minecraft + type: LoadBalancer +`) +} + +func TestHelmChartInflationGeneratorWithValues(t *testing.T) { + th := kusttest_test.MakeEnhancedHarness(t). + PrepBuiltin("HelmChartInflationGenerator") + defer th.Reset() + + tempDirConfirmed, err := filesys.NewTmpConfirmedDir() + if err != nil { + t.Fatal(err) + } + tempDir := string(tempDirConfirmed) + defer os.RemoveAll(tempDir) + valuesPath := path.Join(tempDir, "values.yaml") + ioutil.WriteFile(valuesPath, []byte(` +minecraftServer: + eula: TRUE +`), 0644) + + rm := th.LoadAndRunGenerator(fmt.Sprintf(` +apiVersion: builtin +kind: HelmChartInflationGenerator +metadata: + name: myMap +chartName: minecraft +chartRepoUrl: https://kubernetes-charts.storage.googleapis.com +chartVersion: v1.2.0 +helmBin: helm +helmHome: %s +chartHome: %s +releaseName: test +releaseNamespace: testNamespace +values: %s +`, tempDir, tempDir, valuesPath)) + + th.AssertActualEqualsExpected(rm, ` +apiVersion: v1 +data: + rcon-password: Q0hBTkdFTUUh +kind: Secret +metadata: + labels: + app: test-minecraft + chart: minecraft-1.2.0 + heritage: Helm + release: test + name: test-minecraft +type: Opaque +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + annotations: + volume.alpha.kubernetes.io/storage-class: default + labels: + app: test-minecraft + chart: minecraft-1.2.0 + heritage: Helm + release: test + name: test-minecraft-datadir +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: test-minecraft + chart: minecraft-1.2.0 + heritage: Helm + release: test + name: test-minecraft +spec: + ports: + - name: minecraft + port: 25565 + protocol: TCP + targetPort: minecraft + selector: + app: test-minecraft + type: LoadBalancer +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: test-minecraft + chart: minecraft-1.2.0 + heritage: Helm + release: test + name: test-minecraft +spec: + selector: + matchLabels: + app: test-minecraft + strategy: + type: Recreate + template: + metadata: + labels: + app: test-minecraft + spec: + containers: + - env: + - name: EULA + value: "true" + - name: TYPE + value: VANILLA + - name: VERSION + value: 1.14.4 + - name: DIFFICULTY + value: easy + - name: WHITELIST + value: "" + - name: OPS + value: "" + - name: ICON + value: "" + - name: MAX_PLAYERS + value: "20" + - name: MAX_WORLD_SIZE + value: "10000" + - name: ALLOW_NETHER + value: "true" + - name: ANNOUNCE_PLAYER_ACHIEVEMENTS + value: "true" + - name: ENABLE_COMMAND_BLOCK + value: "true" + - name: FORCE_gameMode + value: "false" + - name: GENERATE_STRUCTURES + value: "true" + - name: HARDCORE + value: "false" + - name: MAX_BUILD_HEIGHT + value: "256" + - name: MAX_TICK_TIME + value: "60000" + - name: SPAWN_ANIMALS + value: "true" + - name: SPAWN_MONSTERS + value: "true" + - name: SPAWN_NPCS + value: "true" + - name: VIEW_DISTANCE + value: "10" + - name: SEED + value: "" + - name: MODE + value: survival + - name: MOTD + value: Welcome to Minecraft on Kubernetes! + - name: PVP + value: "false" + - name: LEVEL_TYPE + value: DEFAULT + - name: GENERATOR_SETTINGS + value: "" + - name: LEVEL + value: world + - name: ONLINE_MODE + value: "true" + - name: MEMORY + value: 512M + - name: JVM_OPTS + value: "" + - name: JVM_XX_OPTS + value: "" + image: itzg/minecraft-server:latest + imagePullPolicy: Always + livenessProbe: + exec: + command: + - mcstatus + - localhost:25565 + - status + failureThreshold: 10 + initialDelaySeconds: 30 + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 1 + name: test-minecraft + ports: + - containerPort: 25565 + name: minecraft + protocol: TCP + readinessProbe: + exec: + command: + - mcstatus + - localhost:25565 + - status + failureThreshold: 10 + initialDelaySeconds: 30 + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 1 + resources: + requests: + cpu: 500m + memory: 512Mi + volumeMounts: + - mountPath: /data + name: datadir + securityContext: + fsGroup: 2000 + runAsUser: 1000 + volumes: + - name: datadir + persistentVolumeClaim: + claimName: test-minecraft-datadir +`) +} diff --git a/plugin/builtin/helmchartinflationgenerator/go.mod b/plugin/builtin/helmchartinflationgenerator/go.mod new file mode 100644 index 000000000..861c6889c --- /dev/null +++ b/plugin/builtin/helmchartinflationgenerator/go.mod @@ -0,0 +1,11 @@ +module sigs.k8s.io/kustomize/plugin/builtin/helmchartinflationgenerator + +go 1.14 + +require ( + github.com/pkg/errors v0.8.1 + sigs.k8s.io/kustomize/api v0.6.3 + sigs.k8s.io/yaml v1.2.0 +) + +replace sigs.k8s.io/kustomize/api v0.6.3 => ../../../api diff --git a/plugin/builtin/helmchartinflationgenerator/go.sum b/plugin/builtin/helmchartinflationgenerator/go.sum new file mode 100644 index 000000000..d34de195d --- /dev/null +++ b/plugin/builtin/helmchartinflationgenerator/go.sum @@ -0,0 +1,530 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +github.com/360EntSecGroup-Skylar/excelize v1.4.1/go.mod h1:vnax29X2usfl7HHkBrX5EvSCJcmH3dT9luvxzu8iGAE= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= +github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= +github.com/bombsimon/wsl v1.2.5/go.mod h1:43lEF/i0kpXbLCeDXL9LMT8c92HyBywXb0AsgMHYngM= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/dustmop/soup v1.1.2-0.20190516214245-38228baa104e/go.mod h1:CgNC6SGbT+Xb8wGGvzilttZL1mc5sQ/5KkcxsZttMIk= +github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= +github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-critic/go-critic v0.3.5-0.20190904082202-d79a9f0c64db/go.mod h1:+sE8vrLDS2M0pZkBk0wy6+nLdKexVDrl/jBqQOTDThA= +github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= +github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= +github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= +github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= +github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= +github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= +github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.19.5 h1:Xm0Ao53uqnk9QE/LlYV5DEU09UAgpliA85QoT9LzqPw= +github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= +github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= +github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= +github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= +github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= +github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= +github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg= +github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= +github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU= +github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk= +github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= +github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks= +github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc= +github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= +github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= +github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= +github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= +github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= +github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o= +github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= +github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= +github.com/golangci/golangci-lint v1.21.0/go.mod h1:phxpHK52q7SE+5KpPnti4oZTdFCEsn/tKN+nFvCKXfk= +github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= +github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= +github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= +github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= +github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= +github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= +github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= +github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= +github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/paulmach/orb v0.1.3/go.mod h1:VFlX/8C+IQ1p6FTRRKzKoOPJnvEtA5G0Veuqwbu//Vk= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d h1:K6eOUihrFLdZjZnA4XlRp864fmWXv9YTIk7VPLhRacA= +github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d/go.mod h1:7DPO4domFU579Ga6E61sB9VFNaniPVwJP5C4bBCu3wA= +github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/securego/gosec v0.0.0-20191002120514-e680875ea14d/go.mod h1:w5+eXa0mYznDkHaMCXA4XYffjlH+cy1oyKbfzJXa2Do= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= +github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.3-0.20181224173747-660f15d67dbb/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= +github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= +github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= +github.com/uudashr/gocognit v0.0.0-20190926065955-1655d0de0517/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= +github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca h1:1CFlNzQhALwjS9mBAUkycX616GzgsuYUOCHA5+HSlXI= +github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yujunz/go-getter v1.4.1-lite h1:FhvNc94AXMZkfqUwfMKhnQEC9phkphSGdPTL7tIdhOM= +github.com/yujunz/go-getter v1.4.1-lite/go.mod h1:sbmqxXjyLunH1PkF3n7zSlnVeMvmYUuIl9ZVs/7NyCc= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.starlark.net v0.0.0-20190528202925-30ae18b8564f/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg= +go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc= +go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c h1:Vco5b+cuG5NNfORVxZy6bYZQ7rsigisU1WQFkvQ0L5E= +golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= +golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190930201159-7c411dea38b0/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e h1:aZzprAO9/8oim3qStq3wc1Xuxx4QmAGriC4VU4ojemQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71 h1:Xe2gvTZUJpsvOWUnvmL/tmhVBZUmHSvLbMjRj6NUUKo= +gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +k8s.io/api v0.17.0 h1:H9d/lw+VkZKEVIUc8F3wgiQ+FUXTTr21M87jXLU7yqM= +k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= +k8s.io/apimachinery v0.17.0 h1:xRBnuie9rXcPxUkDizUsGvPf1cnlZCFu210op7J7LJo= +k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= +k8s.io/client-go v0.17.0 h1:8QOGvUGdqDMFrm9sD6IUFl256BcffynGoe80sxgTEDg= +k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6 h1:4s3/R4+OYYYUKptXPhZKjQ04WJ6EhQQVFdjOFvCazDk= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= +mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= +mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw= +sigs.k8s.io/kustomize/kyaml v0.9.3 h1:kZ5HnNmmnbndSXFivrAVM6u3Ik1dwu4kbpaV8KNwy8I= +sigs.k8s.io/kustomize/kyaml v0.9.3/go.mod h1:UTm64bSWVdBUA8EQoYCxVOaBQxUdIOr5LKWxA4GNbkw= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/site/content/en/guides/plugins/builtins.md b/site/content/en/guides/plugins/builtins.md index d9a9661d0..dba2bd8a1 100644 --- a/site/content/en/guides/plugins/builtins.md +++ b/site/content/en/guides/plugins/builtins.md @@ -3,10 +3,9 @@ title: "Builtin Plugins" linkTitle: "Builtin Plugins" type: docs description: > - Builtin Plugins + Builtin Plugins --- - # Builtin Plugins A list of kustomize's builtin plugins - both @@ -14,31 +13,31 @@ generators and transformers. For each plugin, an example is given for -* implicitly triggering -the plugin via a dedicated kustomization -file field (e.g. the `AnnotationsTransformer` is -triggered by the `commonAnnotations` field). +- implicitly triggering + the plugin via a dedicated kustomization + file field (e.g. the `AnnotationsTransformer` is + triggered by the `commonAnnotations` field). -* explicitly triggering the plugin -via the `generators` or `transformers` field -(by providing a config file specifying the -plugin). +- explicitly triggering the plugin + via the `generators` or `transformers` field + (by providing a config file specifying the + plugin). The former method is convenient but limited in power as most of the plugins arguments must -be defaulted. The latter method allows for +be defaulted. The latter method allows for complete plugin argument specification. -[types.GeneratorOptions]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/generatoroptions.go -[types.SecretArgs]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/secretargs.go -[types.ConfigMapArgs]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/configmapargs.go -[config.FieldSpec]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/fieldspec.go -[types.ObjectMeta]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/objectmeta.go -[types.Selector]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/selector.go -[types.Replica]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/replica.go -[types.PatchStrategicMerge]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/patchstrategicmerge.go -[types.PatchTarget]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/patchtarget.go -[image.Image]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/image.go +[types.generatoroptions]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/generatoroptions.go +[types.secretargs]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/secretargs.go +[types.configmapargs]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/configmapargs.go +[config.fieldspec]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/fieldspec.go +[types.objectmeta]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/objectmeta.go +[types.selector]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/selector.go +[types.replica]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/replica.go +[types.patchstrategicmerge]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/patchstrategicmerge.go +[types.patchtarget]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/patchtarget.go +[image.image]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/image.go ## _AnnotationTransformer_ @@ -61,10 +60,10 @@ commonAnnotations: > Annotations map\[string\]string > -> FieldSpecs \[\][config.FieldSpec] +> FieldSpecs \[\][config.FieldSpec] #### Example -> + > ``` > apiVersion: builtin > kind: AnnotationsTransformer @@ -98,13 +97,13 @@ replace an existing configMap from the parent. Also, each entry has an `options` field, that has the same subfields as the kustomization file's `generatorOptions` field. - + This `options` field allows one to add labels and/or annotations to the generated instance, or to individually disable the name suffix hash for that instance. Labels and annotations added here will not be overwritten by the global options associated with the kustomization -file `generatorOptions` field. However, due to how +file `generatorOptions` field. However, due to how booleans behave, if the global `generatorOptions` field specifies `disableNameSuffixHash: true`, this will trump any attempt to locally override it. @@ -122,7 +121,7 @@ configMapGenerator: - application.properties - more.properties - name: my-java-server-env-vars - literals: + literals: - JAVA_HOME=/opt/java/jdk - JAVA_TOOL_OPTIONS=-agentlib:hprof options: @@ -162,7 +161,7 @@ configMapGenerator: > [types.ConfigMapArgs] #### Example -> + > ``` > apiVersion: builtin > kind: ConfigMapGenerator @@ -183,7 +182,7 @@ configMapGenerator: #### field name: `images` Images modify the name, tags and/or digest for images -without creating patches. E.g. Given this +without creating patches. E.g. Given this kubernetes Deployment fragment: ``` @@ -205,7 +204,7 @@ one can change the `image` in the following ways: - image name `my-demo-app` to `my-app`, - alpine's tag `3.7` to a digest value -all with the following *kustomization*: +all with the following _kustomization_: ``` images: @@ -224,12 +223,12 @@ images: #### Arguments -> ImageTag [image.Image] +> ImageTag [image.Image] > > FieldSpecs \[\][config.FieldSpec] #### Example -> + > ``` > apiVersion: builtin > kind: ImageTagTransformer @@ -259,12 +258,12 @@ commonLabels: #### Arguments -> Labels map\[string\]string +> Labels map\[string\]string > > FieldSpecs \[\][config.FieldSpec] #### Example -> + > ``` > apiVersion: builtin > kind: LabelTransformer @@ -299,7 +298,7 @@ namespace: my-namespace > FieldSpecs \[\][config.FieldSpec] #### Example -> + > ``` > apiVersion: builtin > kind: NamespaceTransformer @@ -338,7 +337,7 @@ The content in this patch file can be either in JSON format as {"op": "add", "path": "/some/new/path", "value": "value"}, {"op": "replace", "path": "/some/existing/path", "value": "new value"} ] - ``` +``` or in YAML format as @@ -388,12 +387,12 @@ patchesJson6902: > Target [types.PatchTarget] > -> Path string +> Path string > > JsonOp string #### Example -> + > ``` > apiVersion: builtin > kind: PatchJson6902Transformer @@ -420,12 +419,12 @@ definition. The names in these (possibly partial) resource files must match names already loaded via the -`resources` field. These entries are used to +`resources` field. These entries are used to _patch_ (modify) the known resources. Small patches that do one thing are best, e.g. modify a memory request/limit, change an env var in a -ConfigMap, etc. Small patches are easy to review and +ConfigMap, etc. Small patches are easy to review and easy to mix together in overlays. ``` @@ -466,7 +465,7 @@ patch that performs all the needed deletions. > Patches string #### Example -> + > ``` > apiVersion: builtin > kind: PatchStrategicMergeTransformer @@ -526,7 +525,7 @@ is equivalent to `^myapp$`. > Target \*[types.Selector] #### Example -> + > ``` > apiVersion: builtin > kind: PatchTransformer @@ -548,7 +547,7 @@ Prepends or postfixes the value to the names of all resources. E.g. a deployment named `wordpress` could -become `alices-wordpress` or `wordpress-v2` +become `alices-wordpress` or `wordpress-v2` or `alices-wordpress-v2`. ``` @@ -563,14 +562,14 @@ the resource type is ConfigMap or Secret. #### Arguments -> Prefix string +> Prefix string > -> Suffix string +> Suffix string > > FieldSpecs \[\][config.FieldSpec] #### Example -> + > ``` > apiVersion: builtin > kind: PrefixSuffixTransformer @@ -632,7 +631,7 @@ For more complex use cases, revert to using a patch. > FieldSpecs \[\][config.FieldSpec] #### Example -> + > ``` > apiVersion: builtin > kind: ReplicaCountTransformer @@ -720,3 +719,79 @@ secretGenerator: > - FRUIT=apple > - VEGETABLE=carrot > ``` + +## _HelmChartInflationGenerator_ + +### Usage via `kustomization.yaml` + +#### field name: `helmChartInflationGenerator` + +Each entry in the argument list results in the pulling +and rendering of a helm chart. + +Each entry can have following fields: + +- `chartName`: The name of the chart that you want to use. +- `chartRepoUrl`: [Optional] The URL of the repository which contains the chart. If + this is provided, the plugin will try to fetch remote charts. Otherwise it will + try to load local chart in `chartHome`. +- `chartVersion`: [Optional] Version of the chart. Will use latest version + if this is omitted. +- `chartHome`: [Optional] Provide the path to the parent directory for local chart. +- `chartRelease`: [Optional] The name of the repo where to find the chart. +- `values`: [Optional] A path to the values file. +- `releaseName`: [Optional] The release name that will be set in the chart. +- `releaseNamespace`: [Optional] The namespace which will be used by `--namespace` + flag in `helm template` command. +- `helmBin`: [Optional] Path to helm binary. Default is `helm`. +- `helmHome`: [Optional] Path to helm home directory. + +``` +helmChartInflationGenerator: +- chartName: minecraft + chartRepoUrl: https://kubernetes-charts.storage.googleapis.com + chartVersion: v1.2.0 + releaseName: test + releaseNamespace: testNamespace +``` + +### Usage via plugin + +#### Arguments + +> ChartName string +> +> ChartVersion string +> +> ChartRepoURL string +> +> ChartHome string +> +> ChartRepoName string +> +> HelmBin string +> +> HelmHome string +> +> Values string +> +> ReleaseName string +> +> ReleaseNamespace string + +#### Example + +> ``` +> apiVersion: builtin +> kind: HelmChartInflationGenerator +> metadata: +> name: myMap +> chartName: minecraft +> chartRepoUrl: https://kubernetes-charts.storage.googleapis.com +> chartVersion: v1.2.0 +> helmBin: /usr/bin/helm +> helmHome: /tmp/helmHome +> releaseName: test +> releaseNamespace: testNamespace +> values: values.yaml +> ``` From b2df55e9d7c17b59515de51129b0d80e71b83cbd Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Mon, 2 Nov 2020 09:52:23 -0800 Subject: [PATCH 04/66] update version in image creation --- releasing/cloudbuild_kustomize_image.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/releasing/cloudbuild_kustomize_image.yaml b/releasing/cloudbuild_kustomize_image.yaml index 2311e3444..aa81f4ca3 100644 --- a/releasing/cloudbuild_kustomize_image.yaml +++ b/releasing/cloudbuild_kustomize_image.yaml @@ -9,6 +9,7 @@ steps: - "PROJECT_ID=$PROJECT_ID" - "_GIT_TAG=$_GIT_TAG" - "_PULL_BASE_REF=$_PULL_BASE_REF" + - "_VERSION=$_VERSION" # We need to use bash to configure the build date properly. - name: "gcr.io/cloud-builders/docker" entrypoint: /bin/bash @@ -21,10 +22,12 @@ steps: gcr.io/$PROJECT_ID/kustomize:${_GIT_TAG} -t gcr.io/$PROJECT_ID/kustomize:latest + -t + gcr.io/$PROJECT_ID/kustomize:${_PULL_BASE_REF#*/} -f kustomize.Dockerfile --build-arg - VERSION=${_VERSION} + VERSION=${_PULL_BASE_REF#*/} --build-arg COMMIT=$(git rev-parse HEAD) --build-arg @@ -42,7 +45,7 @@ substitutions: # _PULL_BASE_REF will contain the ref that was pushed to to trigger this build - # a branch like 'master' or 'release-0.2', or a tag like 'v0.2'. _PULL_BASE_REF: "master" - _VERSION: ${_PULL_BASE_REF#*/} + # Other substitutions will not be evaluated options: substitution_option: ALLOW_LOOSE From 877da8da6df522f72b203cb71991bd52dfb42fad Mon Sep 17 00:00:00 2001 From: Sam Wronski Date: Fri, 30 Oct 2020 16:03:30 -0700 Subject: [PATCH 05/66] Update module span to check commits - Use regex to detect if check should run - Update scan to be per-commit --- cmd/prchecker/main.go | 230 ++++++++++++++++++++++------ cmd/prchecker/main_test.go | 303 +++++++++++++++++++++++++++++++++++++ 2 files changed, 488 insertions(+), 45 deletions(-) create mode 100644 cmd/prchecker/main_test.go diff --git a/cmd/prchecker/main.go b/cmd/prchecker/main.go index 369b764bd..0c13eeeda 100644 --- a/cmd/prchecker/main.go +++ b/cmd/prchecker/main.go @@ -19,11 +19,61 @@ import ( "flag" "fmt" "os" + "regexp" "strings" "github.com/google/go-github/github" ) +// splitCommitsHelp is a help message displayed when a PR has commits which +// span modules. +const splitCommitsHelp = "\nModifications to multiple restricted directories occurred.\n" + + "To resolve this please limit code changes in a commit to a single go module.\n\n" + + "You may learn more about how to split your existing commits at: https://git-scm.com/docs/git-rebase#_splitting_commits\n" + +// Ignore span pattern defines a regular expression pattern that, when matched, +// causes this check to be ignored. +// Pattern expects "ALLOW_MODULE_SPAN" in CAPS on a line by itself. +// Spaces may be included before or after but no other characters with one +// exception. ">" may be used to quote the exclusion. +// Pattern may be provided at any point in the pull request description. +// +// Ex: "ALLOW_MODULE_SPAN", "> ALLOW_MODULE_SPAN", " ALLOW_MODULE_SPAN " +const ignoreSpanPattern = "(?m)^>?\\s*ALLOW_MODULE_SPAN\\s*$" + +// Changeset represents a set of file modifications associated with a commit +type Changeset struct { + files []string + id string +} + +// GitHubRepository represents a pairing of the owner and repository to make +// passing around references to specific projects simpler +type GitHubRepository struct { + client *github.Client + owner *string + repo *string +} + +// GitHubService is the collection of GitHub API interactions this service consumes +type GitHubService interface { + GetPullRequest(prId int) (*github.PullRequest, *github.Response, error) + GetCommit(commitSha string) (*github.RepositoryCommit, *github.Response, error) + ListCommits(prId int, options *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error) +} + +func (repository GitHubRepository) GetPullRequest(prId int) (*github.PullRequest, *github.Response, error) { + return repository.client.PullRequests.Get(context.Background(), *repository.owner, *repository.repo, prId) +} + +func (repository GitHubRepository) GetCommit(commitSha string) (*github.RepositoryCommit, *github.Response, error) { + return repository.client.Repositories.GetCommit(context.Background(), *repository.owner, *repository.repo, commitSha) +} + +func (repository GitHubRepository) ListCommits(prId int, options *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error) { + return repository.client.PullRequests.ListCommits(context.Background(), *repository.owner, *repository.repo, prId, options) +} + func main() { owner := flag.String("owner", "", "the github repository owner name") repo := flag.String("repo", "", "the github repository name") @@ -41,79 +91,169 @@ func main() { client := github.NewClient(nil) - files, err := ListAllPullRequestFiles(client, owner, pullrequest, repo) + githubRepo := &GitHubRepository{ + client: client, + owner: owner, + repo: repo, + } + + // Check if module span is allowed before scanning on commits + isSpanAllowed, err := ModuleSpanAllowed(githubRepo, *pullrequest) if err != nil { - fmt.Println("Unable to retrieve pull request details:", err.Error()) + fmt.Printf("unable to retrieve pull request details: %v", err.Error()) os.Exit(2) } - contributedRestrictedPaths := CountRestrictedPathUses(files, restrictedPaths) - modifiedRestrictedDirectories := CountModifiedRestrictedDirectories(contributedRestrictedPaths) + if isSpanAllowed { + fmt.Println("Check not run. Module spanning was allowed in this Pull Request.") + os.Exit(0) + } + + isSpanningPull, _, err := PullRequestSpanningPathList(githubRepo, *pullrequest, restrictedPaths) + + if err != nil { + fmt.Printf("unable to retrieve pull request details: %v", err) + os.Exit(2) + } // Exit with error if two or more restricted directories where modified - if modifiedRestrictedDirectories > 1 { - fmt.Println("Modifications to multiple restricted directories occurred.") + if isSpanningPull { + // Provide a suggestion for potential solution if the check fails. + fmt.Println(splitCommitsHelp) os.Exit(1) } } -// ListAllPullRequestFiles retrieves as many files as possible for the -// target pull request. -// -// Note: GitHub API limits ListFiles to a maximum of 3000 files. Very large -// changes which exceed this limit may pass this check even if they -// do contain spanning changes. -// see: https://developer.github.com/v3/pulls/#list-pull-requests-files -func ListAllPullRequestFiles(client *github.Client, owner *string, pullrequest *int, repo *string) ([]*github.CommitFile, error) { +// ConstructChangeset creates a changeset from a GitHub Commit object +func ConstructChangeset(commit *github.RepositoryCommit) *Changeset { + id := commit.SHA + fileset := []string{} + + for _, file := range commit.Files { + fileset = append(fileset, *file.Filename) + } + + return &Changeset{ + files: fileset, + id: *id, + } +} + +// StringAllowsModuleSpan tests if a string matches the allow span regex +func StringAllowsModuleSpan(body string) (bool, error) { + return regexp.MatchString(ignoreSpanPattern, body) +} + +// IsModuleSpanAllowed tests a Pull Requests description for a regular +// expression. If the expression matches then spanning modules are allowed. +func ModuleSpanAllowed(repository GitHubService, pullId int) (bool, error) { + + // Note: There are multiple ways to pull a github commit object + // we want a RepositoryCommit. + pullRequest, _, err := repository.GetPullRequest(pullId) + + if err != nil { + return false, err + } + + return StringAllowsModuleSpan(*pullRequest.Body) +} + +// GetCommitChanges looks up a github commit by SHA and returns a Changeset +// containing the modified files in the specified commit. +func GetCommitChanges(repository GitHubService, commitSha string) (*Changeset, error) { + + // Note: There are multiple ways to pull a github commit object + // we want a RepositoryCommit. + commit, _, err := repository.GetCommit(commitSha) + + if err != nil { + return nil, err + } + + return ConstructChangeset(commit), nil +} + +// GetPullRequestCommits constructs a list of all commits and the associated +// files changes in the given pull request +func GetPullRequestCommits(repository GitHubService, pullrequest int) ([]*Changeset, error) { + // foundFiles across all pages from github api - var foundFiles []*github.CommitFile - // GitHub returns the first 30 files by default, increase this value - // Note: Page 1 is the first page of results. Page 0 is an end of list mark. - // Github only returns (max) 100 results per page and PR's may exceed this - // so loop until all pages have been enumerated. - options := &github.ListOptions{PerPage: 100, Page: 1} + var collectedCommits []*github.RepositoryCommit + // Github only returns a limited set of commits per request and PR's may + // exceed this so loop until all pages have been enumerated. + options := &github.ListOptions{Page: 1} for options.Page != 0 { - files, response, err := client.PullRequests.ListFiles(context.Background(), *owner, *repo, *pullrequest, options) + commits, response, err := repository.ListCommits(pullrequest, options) // If an error has occurred while querying api exit early, report error if err != nil { return nil, err } - foundFiles = append(foundFiles, files...) + collectedCommits = append(collectedCommits, commits...) // setup next page to continue loop - options = &github.ListOptions{PerPage: 100, Page: response.NextPage} + options = &github.ListOptions{Page: response.NextPage} } - return foundFiles, nil + + var changesetResults []*Changeset + for _, commit := range collectedCommits { + // The repository commits from list commits are not hydrated + // We will need to retrieve the complete object: + changeset, err := GetCommitChanges(repository, *commit.SHA) + if err != nil { + return nil, err + } + + changesetResults = append(changesetResults, changeset) + } + return changesetResults, nil } -// CountModifiedRestrictedDirectories Accepts a map of paths and the number of -// occurances and returns the count of the paths which had a non-zero value. -func CountModifiedRestrictedDirectories(contributedRestrictedPaths map[string]int) int { - modifiedRestrictedDirectories := 0 - for _, occurance := range contributedRestrictedPaths { - if occurance != 0 { - modifiedRestrictedDirectories++ +// IsPullRequestSpanningPathList tests if a pull request spans multiple +// directory paths +func PullRequestSpanningPathList(repository GitHubService, pullrequest int, paths []string) (bool, []*Changeset, error) { + // Create a buffer for commits + changesets, err := GetPullRequestCommits(repository, pullrequest) + + if err != nil { + return false, nil, err + } + + spanningChangesExist := false + for _, changeset := range changesets { + if ChangesetSpanningPathList(changeset, paths) { + // When detecting the first spanning changeset print a prefix message + if !spanningChangesExist { + fmt.Printf("Spanning changesets detected in the following commits:\n\n") + } + + fmt.Printf("\t* %s\n", changeset.id) + // In order provide a full list of outstanding commits, do not shortcircuit this check + spanningChangesExist = true } } - return modifiedRestrictedDirectories + + return spanningChangesExist, changesets, nil } -// CountRestrictedPathUses Constructs a map that contains the number of -// references keyed to each restricted path. This provides details about how -// many files in the list are associated with each restricted path. -func CountRestrictedPathUses(files []*github.CommitFile, restrictedPaths []string) map[string]int { - contributedRestrictedPaths := make(map[string]int) - for _, path := range restrictedPaths { - contributedRestrictedPaths[path] = 0 - } +// IsChangesetSpanningPathList tests if a changeset is spanning +// multiple directory paths. +func ChangesetSpanningPathList(changeset *Changeset, paths []string) bool { + matchedPath := "" - for _, file := range files { - for path := range contributedRestrictedPaths { - if strings.HasPrefix(*file.Filename, path) { - contributedRestrictedPaths[path]++ + for _, file := range changeset.files { + for _, path := range paths { + if strings.HasPrefix(file, path) { + // If a different path has already matched then the changeset spans multiple restricted paths + if matchedPath != "" && matchedPath != path { + return true + } + matchedPath = path } } } - return contributedRestrictedPaths + + // If more than 1 matched paths then the changeset spans paths + return false } diff --git a/cmd/prchecker/main_test.go b/cmd/prchecker/main_test.go new file mode 100644 index 000000000..edb6f9dbe --- /dev/null +++ b/cmd/prchecker/main_test.go @@ -0,0 +1,303 @@ +package main + +import ( + "testing" + + "github.com/google/go-github/github" +) + +func TestStringAllowsModuleSpan(t *testing.T) { + var tests = []struct { + name string + body string + matchExpected bool + }{ + { + "exception not included", + "foo", + false, + }, + { + "exception mentioned in sentence does not exempt span check", + "don't ALLOW_MODULE_SPAN", + false, + }, + { + "PR body is just exception", + "ALLOW_MODULE_SPAN", + true, + }, + { + "support markdown quoting exception", + "> ALLOW_MODULE_SPAN", + true, + }, + { + "support whitespace padding", + "\t ALLOW_MODULE_SPAN\t ", + true, + }, + { + "module span exemption allowed at start of string", + "ALLOW_MODULE_SPAN\nat start of file", + true, + }, + { + "module span exemption allowed at end of string", + "at end of file\nALLOW_MODULE_SPAN", + true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result, err := StringAllowsModuleSpan(tt.body) + + if err != nil { + t.Errorf(err.Error()) + } + + if result != tt.matchExpected { + t.Errorf("got %t, want %t", result, tt.matchExpected) + } + }) + } +} + +func TestIsModuleSpanAllowed(t *testing.T) { + var tests = []struct { + name string + body string + matchExpected bool + }{ + { + "module spanning not allowed", + "don't ALLOW_MODULE_SPAN", + false, + }, + { + "module spanning allowed", + "ALLOW_MODULE_SPAN", + true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + + client := FakeGitHubService{ + pullRequest: &github.PullRequest{ + Body: &tt.body, + }, + } + + result, _ := ModuleSpanAllowed(&client, 1) + + if result != tt.matchExpected { + t.Errorf("got %t, want %t", result, tt.matchExpected) + } + }) + } +} + +func TestGetCommitChanges(t *testing.T) { + client := FakeGitHubService{ + commit: &github.RepositoryCommit{ + SHA: github.String("abc123"), + Files: []github.CommitFile{{Filename: github.String("foo")}, {Filename: github.String("bar")}}, + }, + } + + result, _ := GetCommitChanges(&client, "abc123") + + if result.id != "abc123" { + t.Errorf("got %v, want %v", result.id, "abc123") + } + + if len(result.files) != 2 { + t.Errorf("got %v, want %v", len(result.files), "2") + } + + expectedFiles := []string{"foo", "bar"} + if !StringSliceAreEqual(result.files, expectedFiles) { + t.Errorf("got %v, want %v", result.files, expectedFiles) + } +} + +func TestGetPullRequestCommits(t *testing.T) { + client := FakeGitHubService{ + commit: &github.RepositoryCommit{ + SHA: github.String("abc123"), + Files: []github.CommitFile{{Filename: github.String("foo")}, {Filename: github.String("bar")}}, + }, + commitList: []*github.RepositoryCommit{ + { + SHA: github.String("abc123"), + }, + { + SHA: github.String("abc123"), + }, + }, + } + + result, _ := GetPullRequestCommits(&client, 42) + + if len(result) != 2 { + t.Errorf("got %v, want %v", len(result), 2) + } + + expectedFiles := []string{"foo", "bar"} + if !StringSliceAreEqual(result[0].files, expectedFiles) { + t.Errorf("[%d] got %v, want %v", 0, result[0].files, expectedFiles) + } + if !StringSliceAreEqual(result[1].files, expectedFiles) { + t.Errorf("[%d] got %v, want %v", 1, result[1].files, expectedFiles) + } +} + +func TestContstructingChangeset(t *testing.T) { + var tests = []struct { + name string + sha string + files []github.CommitFile + expected Changeset + }{ + { + "construct from single file", + "abc123", + []github.CommitFile{{Filename: github.String("foo")}}, + Changeset{id: "abc123", files: []string{"foo"}}, + }, + { + "construct from multiple files", + "1234", + []github.CommitFile{{Filename: github.String("foo")}, {Filename: github.String("bar")}}, + Changeset{id: "1234", files: []string{"foo", "bar"}}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + commit := &github.RepositoryCommit{SHA: github.String(tt.sha), Files: tt.files} + result := ConstructChangeset(commit) + + if tt.expected.id != result.id { + t.Errorf("got %v, want %v", result.id, tt.expected.id) + } + + if !StringSliceAreEqual(tt.expected.files, result.files) { + t.Errorf("got %v, want %v", result.files, tt.expected.files) + } + }) + } +} + +func TestIsChangesetSpanning(t *testing.T) { + var tests = []struct { + name string + changeset []string + files []string + expected bool + }{ + { + "matching sets of 1 element do not span", + []string{"1"}, + []string{"1"}, + false, + }, + { + "subdirectories do not match top level directories", + []string{"a/1"}, + []string{"1"}, + false, + }, + { + "distinct sets do not span", + []string{"1", "2"}, + []string{"a", "b"}, + false, + }, + { + "single matching path does not span", + []string{"1", "a"}, + []string{"1", "2"}, + false, + }, + { + "path and subdirectory of same restriction do not span", + []string{"1", "1/a"}, + []string{"1", "2", "3"}, + false, + }, + { + "matching sets span", + []string{"1", "2"}, + []string{"1", "2"}, + true, + }, + { + "superset of restricted paths spans", + []string{"1", "2", "3"}, + []string{"1", "2"}, + true, + }, + { + "subset of restricted paths spans", + []string{"1", "3"}, + []string{"1", "2", "3"}, + true, + }, + { + "subdirectories of restricted paths span", + []string{"1/a", "3/b"}, + []string{"1", "2", "3"}, + true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + + changeset := &Changeset{files: tt.changeset} + + result := ChangesetSpanningPathList(changeset, tt.files) + + if result != tt.expected { + t.Errorf("got %t, want %t", result, tt.expected) + } + }) + } +} + +type FakeGitHubService struct { + pullRequest *github.PullRequest + commit *github.RepositoryCommit + commitList []*github.RepositoryCommit +} + +func (repository FakeGitHubService) GetPullRequest(prId int) (*github.PullRequest, *github.Response, error) { + return repository.pullRequest, nil, nil +} + +func (repository FakeGitHubService) GetCommit(commitSha string) (*github.RepositoryCommit, *github.Response, error) { + return repository.commit, nil, nil + +} + +func (repository FakeGitHubService) ListCommits(prId int, options *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error) { + return repository.commitList, &github.Response{NextPage: 0}, nil +} + +func StringSliceAreEqual(left []string, right []string) bool { + if len(left) != len(right) { + return false + } + + for i, elem := range left { + if elem != right[i] { + return false + } + } + + return true +} From d141f9b97303ec1ddf6f529123f05e3ee88c43f5 Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Mon, 2 Nov 2020 10:43:52 -0800 Subject: [PATCH 06/66] fix version --- releasing/cloudbuild_kustomize_image.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/releasing/cloudbuild_kustomize_image.yaml b/releasing/cloudbuild_kustomize_image.yaml index aa81f4ca3..87b0212db 100644 --- a/releasing/cloudbuild_kustomize_image.yaml +++ b/releasing/cloudbuild_kustomize_image.yaml @@ -9,8 +9,7 @@ steps: - "PROJECT_ID=$PROJECT_ID" - "_GIT_TAG=$_GIT_TAG" - "_PULL_BASE_REF=$_PULL_BASE_REF" - - "_VERSION=$_VERSION" -# We need to use bash to configure the build date properly. +# We need to use bash to configure the build date and version properly. - name: "gcr.io/cloud-builders/docker" entrypoint: /bin/bash args: @@ -23,15 +22,15 @@ steps: -t gcr.io/$PROJECT_ID/kustomize:latest -t - gcr.io/$PROJECT_ID/kustomize:${_PULL_BASE_REF#*/} + gcr.io/$PROJECT_ID/kustomize:${_PULL_BASE_REF} -f kustomize.Dockerfile --build-arg - VERSION=${_PULL_BASE_REF#*/} + VERSION=${_PULL_BASE_REF} --build-arg COMMIT=$(git rev-parse HEAD) --build-arg - DATE=`date -u +%FT%TZ` + DATE=$(date -u +%FT%TZ) . images: From d2c7db6ca0dea8a768e115a0dd747f665f62338c Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Mon, 2 Nov 2020 11:03:31 -0800 Subject: [PATCH 07/66] update chart examples --- examples/chart.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/chart.md b/examples/chart.md index e0d48dd07..df473861d 100644 --- a/examples/chart.md +++ b/examples/chart.md @@ -7,7 +7,7 @@ [plugin]: ../docs/plugins [Helm charts] aren't natively read by kustomize, but -kustomize has a built in HelmChartInflationGenerator that allows one to +kustomize has a builtin HelmChartInflationGenerator that allows one to access helm charts. One pattern combining kustomize and helm is @@ -253,13 +253,17 @@ rm -r $DEMO_HOME ## How to migrate from old plugin to builtin plugin -Before, we have [chartinflator](https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/chartinflator) -plugin which servers as an external plugin. Although you can continue -using it but we recommend to migrate to builtin one if you are using -Helm V3. For Helm V2 user, we haven't implemented V2 support in builtin -plugin. +[bash-based helm chart inflator]: https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/chartinflator +[go-based builtin helm chart inflator]: https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/builtin/helmchartinflationgenerator -What you need to do for your generator config file: +The [bash-based helm chart inflator] is intended as an example of using bash +to write a generator plugin. -- Change the `apiVersion` to `builtin`. -- Change the `kind` to `HelmChartInflationGenerator` +It proved to be popular for inflating helm charts, +so there's now a [go-based builtin helm chart inflator]. + +This newer generator is supported as part of the core code, so anyone using the +old bash-based example plugin would probably benefit from switching to the +newer built-in plugin. + +Be advised that at the time of writing, the built-in plugin only supports helm v3. From b5d8b8d2585a46de1515d6e77b5d11eb5c4d6b57 Mon Sep 17 00:00:00 2001 From: Naveen Gogineni Date: Sun, 6 Sep 2020 20:01:59 -0400 Subject: [PATCH 08/66] Add ability to specify behavior when running "kustomize edit add configmap" command --- .../internal/commands/edit/add/configmap.go | 15 +++++++- .../commands/edit/add/configmap_test.go | 38 +++++++++++++++++++ .../commands/edit/add/flagsandargs.go | 8 ++++ .../commands/edit/add/flagsandargs_test.go | 16 ++++++++ .../internal/commands/edit/add/secret.go | 3 ++ 5 files changed, 79 insertions(+), 1 deletion(-) diff --git a/kustomize/internal/commands/edit/add/configmap.go b/kustomize/internal/commands/edit/add/configmap.go index 25272c141..7e928fcac 100644 --- a/kustomize/internal/commands/edit/add/configmap.go +++ b/kustomize/internal/commands/edit/add/configmap.go @@ -18,7 +18,7 @@ func newCmdAddConfigMap( kf ifc.KunstructuredFactory) *cobra.Command { var flags flagsAndArgs cmd := &cobra.Command{ - Use: "configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1]", + Use: "configmap NAME [--behavior={create|merge|replace}] [--from-file=[key=]source] [--from-literal=key1=value1]", Short: "Adds a configmap to the kustomization file.", Long: "", Example: ` @@ -30,6 +30,9 @@ func newCmdAddConfigMap( # Adds a configmap from env-file kustomize edit add configmap my-configmap --from-env-file=env/path.env + + # Adds a configmap from env-file with behavior merge + kustomize edit add configmap my-configmap --behavior=merge --from-env-file=env/path.env `, RunE: func(_ *cobra.Command, args []string) error { err := flags.ExpandFileSource(fSys) @@ -86,6 +89,13 @@ func newCmdAddConfigMap( "disableNameSuffixHash", false, "Disable the name suffix for the configmap") + cmd.Flags().StringVar( + &flags.Behavior, + "behavior", + "", + "Specify the behavior for config map generation, i.e whether to create a new configmap (the default), "+ + "to merge with a previously defined one, or to replace an existing one. Merge and replace should be used only "+ + " when overriding an existing configmap defined in a base") return cmd } @@ -136,4 +146,7 @@ func mergeFlagsIntoCmArgs(args *types.ConfigMapArgs, flags flagsAndArgs) { DisableNameSuffixHash: true, } } + if flags.Behavior != "" { + args.Behavior = flags.Behavior + } } diff --git a/kustomize/internal/commands/edit/add/configmap_test.go b/kustomize/internal/commands/edit/add/configmap_test.go index 84ed55373..a1e64469d 100644 --- a/kustomize/internal/commands/edit/add/configmap_test.go +++ b/kustomize/internal/commands/edit/add/configmap_test.go @@ -110,3 +110,41 @@ func TestMergeFlagsIntoConfigMapArgs_EnvSource(t *testing.T) { t.Fatalf("expected env2") } } + +func TestMergeFlagsIntoConfigMapArgs_Behavior(t *testing.T) { + k := &types.Kustomization{} + args := findOrMakeConfigMapArgs(k, "foo") + + createBehaviorFlags := flagsAndArgs{ + Behavior: "create", + EnvFileSource: "env1", + } + mergeFlagsIntoGeneratorArgs( + &args.GeneratorArgs, + createBehaviorFlags) + if k.ConfigMapGenerator[0].Behavior != "create" { + t.Fatalf("expected create") + } + + mergeBehaviorFlags := flagsAndArgs{ + Behavior: "merge", + EnvFileSource: "env1", + } + mergeFlagsIntoGeneratorArgs( + &args.GeneratorArgs, + mergeBehaviorFlags) + if k.ConfigMapGenerator[0].Behavior != "merge" { + t.Fatalf("expected merge") + } + + replaceBehaviorFlags := flagsAndArgs{ + Behavior: "replace", + EnvFileSource: "env1", + } + mergeFlagsIntoGeneratorArgs( + &args.GeneratorArgs, + replaceBehaviorFlags) + if k.ConfigMapGenerator[0].Behavior != "replace" { + t.Fatalf("expected replace") + } +} diff --git a/kustomize/internal/commands/edit/add/flagsandargs.go b/kustomize/internal/commands/edit/add/flagsandargs.go index 5f24fe6bf..1a896e4ff 100644 --- a/kustomize/internal/commands/edit/add/flagsandargs.go +++ b/kustomize/internal/commands/edit/add/flagsandargs.go @@ -7,6 +7,8 @@ import ( "fmt" "strings" + "sigs.k8s.io/kustomize/api/types" + "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/util" ) @@ -22,6 +24,8 @@ type flagsAndArgs struct { // EnvFileSource to derive the configMap/Secret from (optional) // TODO: Rationalize this name with Generic.EnvSource EnvFileSource string + // Resource generation behavior (optional) + Behavior string // Type of secret to create Type string // Namespace of secret @@ -42,6 +46,10 @@ func (a *flagsAndArgs) Validate(args []string) error { if len(a.EnvFileSource) > 0 && (len(a.FileSources) > 0 || len(a.LiteralSources) > 0) { return fmt.Errorf("from-env-file cannot be combined with from-file or from-literal") } + if len(a.Behavior) > 0 && types.NewGenerationBehavior(a.Behavior) == types.BehaviorUnspecified { + return fmt.Errorf(`invalid behavior: must be one of "%s", "%s", or "%s"`, + types.BehaviorCreate, types.BehaviorMerge, types.BehaviorReplace) + } // TODO: Should we check if the path exists? if it's valid, if it's within the same (sub-)directory? return nil } diff --git a/kustomize/internal/commands/edit/add/flagsandargs_test.go b/kustomize/internal/commands/edit/add/flagsandargs_test.go index 80b4f160b..98bf03e8f 100644 --- a/kustomize/internal/commands/edit/add/flagsandargs_test.go +++ b/kustomize/internal/commands/edit/add/flagsandargs_test.go @@ -61,6 +61,22 @@ func TestDataConfigValidation_Flags(t *testing.T) { }, shouldFail: false, }, + { + name: "correct behavior", + fa: flagsAndArgs{ + EnvFileSource: "foo", + Behavior: "merge", + }, + shouldFail: false, + }, + { + name: "incorrect behavior", + fa: flagsAndArgs{ + EnvFileSource: "foo", + Behavior: "merge-unknown", + }, + shouldFail: true, + }, } for _, test := range tests { diff --git a/kustomize/internal/commands/edit/add/secret.go b/kustomize/internal/commands/edit/add/secret.go index 4a87080d7..4fc93c616 100644 --- a/kustomize/internal/commands/edit/add/secret.go +++ b/kustomize/internal/commands/edit/add/secret.go @@ -149,4 +149,7 @@ func mergeFlagsIntoGeneratorArgs(args *types.GeneratorArgs, flags flagsAndArgs) DisableNameSuffixHash: true, } } + if flags.Behavior != "" { + args.Behavior = flags.Behavior + } } From 072ae36fe629c6424715e5f98af3bcbdac3ed5c4 Mon Sep 17 00:00:00 2001 From: Mike Borozdin Date: Mon, 2 Nov 2020 12:30:56 -0800 Subject: [PATCH 09/66] removing travis references --- .github/workflows/go.yml | 2 +- Makefile | 4 +- api/internal/plugins/doc.go | 2 +- docs/contributing/windows/index.html | 2 +- docs/zh/contributing/windows/index.html | 2 +- examples/README.md | 2 +- examples/zh/README.md | 2 +- {travis => scripts}/Invoke-PreCommit.ps1 | 0 {travis => scripts}/check-go-mod.sh | 0 {travis => scripts}/kyaml-pre-commit.sh | 0 .../content/en/contributing/windows/_index.md | 2 +- .../content/zh/contributing/windows/_index.md | 2 +- travis/consider-early-travis-exit.sh | 40 ------------------- 13 files changed, 10 insertions(+), 50 deletions(-) rename {travis => scripts}/Invoke-PreCommit.ps1 (100%) rename {travis => scripts}/check-go-mod.sh (100%) rename {travis => scripts}/kyaml-pre-commit.sh (100%) delete mode 100644 travis/consider-early-travis-exit.sh diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 46c733331..6ae40730b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v2 - name: Lint - run: ./travis/kyaml-pre-commit.sh + run: ./scripts/kyaml-pre-commit.sh env: KUSTOMIZE_DOCKER_E2E: false # don't need to do e2e tests for linting diff --git a/Makefile b/Makefile index cf299c7bc..eb4c64d85 100644 --- a/Makefile +++ b/Makefile @@ -221,10 +221,10 @@ test-unit-kustomize-all: \ test-unit-kustomize-plugins test-unit-cmd-all: - ./travis/kyaml-pre-commit.sh + ./scripts/kyaml-pre-commit.sh test-go-mod: - ./travis/check-go-mod.sh + ./scripts/check-go-mod.sh .PHONY: test-examples-e2e-kustomize: $(MYGOBIN)/mdrip $(MYGOBIN)/kind diff --git a/api/internal/plugins/doc.go b/api/internal/plugins/doc.go index 83e428352..74d8ae378 100644 --- a/api/internal/plugins/doc.go +++ b/api/internal/plugins/doc.go @@ -94,7 +94,7 @@ TO GENERATE CODE cd $repo/plugin/builtin go generate ./... -See travis/kyaml-pre-commit.sh for canonical way +See scripts/kyaml-pre-commit.sh for canonical way to execute the above. This creates diff --git a/docs/contributing/windows/index.html b/docs/contributing/windows/index.html index dfd340618..c786c4635 100644 --- a/docs/contributing/windows/index.html +++ b/docs/contributing/windows/index.html @@ -514,7 +514,7 @@ Usage: C:\_go\bin\mdrip.exe {fileName}...
  • Navigate to the Kustomize travis directory
      -
    • Example: C:\_go\src\sigs.k8s.io\kustomize\travis
    • +
    • Example: C:\_go\src\sigs.k8s.io\kustomize\scripts
  • Now Execute: diff --git a/docs/zh/contributing/windows/index.html b/docs/zh/contributing/windows/index.html index 4545a364c..28a22f5d2 100644 --- a/docs/zh/contributing/windows/index.html +++ b/docs/zh/contributing/windows/index.html @@ -514,7 +514,7 @@ Usage: C:\_go\bin\mdrip.exe {fileName}...
  • Navigate to the Kustomize travis directory
      -
    • Example: C:\_go\src\sigs.k8s.io\kustomize\travis
    • +
    • Example: C:\_go\src\sigs.k8s.io\kustomize\scripts
  • Now Execute: diff --git a/examples/README.md b/examples/README.md index d1c1dd1d7..2819d5408 100644 --- a/examples/README.md +++ b/examples/README.md @@ -5,7 +5,7 @@ English | [简体中文](zh/README.md) To run these examples, your `$PATH` must contain `kustomize`. See the [installation instructions](../docs/INSTALL.md). -These examples are [tested](../travis/kyaml-pre-commit.sh) +These examples are [tested](../scripts/kyaml-pre-commit.sh) to work with the latest _released_ version of kustomize. Basic Usage diff --git a/examples/zh/README.md b/examples/zh/README.md index 1673e1598..b4a69360a 100644 --- a/examples/zh/README.md +++ b/examples/zh/README.md @@ -4,7 +4,7 @@ 这些示例默认 `kustomize` 在您的 `$PATH` 中。 -这些示例通过了 [pre-commit](../../travis/kyaml-pre-commit.sh) 测试,并且应该与 HEAD 一起使用。 +这些示例通过了 [pre-commit](../../scripts/kyaml-pre-commit.sh) 测试,并且应该与 HEAD 一起使用。 ``` go get sigs.k8s.io/kustomize/v3/cmd/kustomize diff --git a/travis/Invoke-PreCommit.ps1 b/scripts/Invoke-PreCommit.ps1 similarity index 100% rename from travis/Invoke-PreCommit.ps1 rename to scripts/Invoke-PreCommit.ps1 diff --git a/travis/check-go-mod.sh b/scripts/check-go-mod.sh similarity index 100% rename from travis/check-go-mod.sh rename to scripts/check-go-mod.sh diff --git a/travis/kyaml-pre-commit.sh b/scripts/kyaml-pre-commit.sh similarity index 100% rename from travis/kyaml-pre-commit.sh rename to scripts/kyaml-pre-commit.sh diff --git a/site/content/en/contributing/windows/_index.md b/site/content/en/contributing/windows/_index.md index 4430b4273..a0ec49a13 100644 --- a/site/content/en/contributing/windows/_index.md +++ b/site/content/en/contributing/windows/_index.md @@ -59,7 +59,7 @@ Usage: C:\_go\bin\mdrip.exe {fileName}... - In your GoRoot src - ```Example: C:\_go\src``` - Navigate to the Kustomize `travis` directory - - ```Example: C:\_go\src\sigs.k8s.io\kustomize\travis``` + - ```Example: C:\_go\src\sigs.k8s.io\kustomize\scripts``` - Now Execute: - ```.\Invoke-PreCommit.ps1``` diff --git a/site/content/zh/contributing/windows/_index.md b/site/content/zh/contributing/windows/_index.md index 4430b4273..a0ec49a13 100644 --- a/site/content/zh/contributing/windows/_index.md +++ b/site/content/zh/contributing/windows/_index.md @@ -59,7 +59,7 @@ Usage: C:\_go\bin\mdrip.exe {fileName}... - In your GoRoot src - ```Example: C:\_go\src``` - Navigate to the Kustomize `travis` directory - - ```Example: C:\_go\src\sigs.k8s.io\kustomize\travis``` + - ```Example: C:\_go\src\sigs.k8s.io\kustomize\scripts``` - Now Execute: - ```.\Invoke-PreCommit.ps1``` diff --git a/travis/consider-early-travis-exit.sh b/travis/consider-early-travis-exit.sh deleted file mode 100644 index b979c8eea..000000000 --- a/travis/consider-early-travis-exit.sh +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2019 The Kubernetes Authors. -# SPDX-License-Identifier: Apache-2.0 - -# Exits with status 0 if it can be determined that the -# current PR should not trigger all travis checks. -# -# This could be done with a "git ...|grep -vqE" oneliner -# but as travis triggering is refined it's useful to check -# travis logs to see how branch files were considered. -function consider-early-travis-exit { - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - echo "Unknown pull request." - return - fi - # Might use this to improve checks on multi-commit PRs. - echo "TRAVIS_COMMIT_RANGE=$TRAVIS_COMMIT_RANGE" - echo "Branch Files ('T'==trigger tests, ' '=ignore):" - echo "---" - local triggers=0 - local invisibles=0 - for fn in $(git diff --name-only HEAD origin/master); do - if [[ "$fn" =~ (\.md$)|(^docs/) ]]; then - echo " $fn" - let invisibles+=1 - else - echo " T $fn" - let triggers+=1 - fi - done - echo "---" - printf >&2 "%6d files invisible to travis.\n" $invisibles - printf >&2 "%6d files trigger travis.\n" $triggers - if [ $triggers -eq 0 ]; then - echo "No files triggered travis test, exiting early." - # see https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/templates/header.sh - travis_terminate 0 - fi -} -consider-early-travis-exit -unset -f consider-early-travis-exit From be327e744380573663a41912e9614732061436ef Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Tue, 3 Nov 2020 11:54:44 -0800 Subject: [PATCH 10/66] add tests for ElementSetter --- kyaml/yaml/fns_test.go | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/kyaml/yaml/fns_test.go b/kyaml/yaml/fns_test.go index e7dda5f71..046e6e370 100644 --- a/kyaml/yaml/fns_test.go +++ b/kyaml/yaml/fns_test.go @@ -97,6 +97,76 @@ func TestGetElementByKey(t *testing.T) { assert.Equal(t, "f: g\n", assertNoErrorString(t)(rn.String())) } +func TestElementSetter(t *testing.T) { + orig := MustParse(` +- a: b +- scalarValue +- c: d +# null will be removed +- null +`) + + // ElementSetter will update node, so make a copy + node := orig.Copy() + // Remove an element + rn, err := node.Pipe(ElementSetter{Key: "a", Value: "b"}) + assert.NoError(t, err) + assert.Nil(t, rn) + assert.Equal(t, `- scalarValue +- c: d +`, assertNoErrorString(t)(node.String())) + + node = orig.Copy() + // Set an element + newElement := NewMapRNode(&map[string]string{ + "e": "f", + }) + rn, err = node.Pipe(ElementSetter{ + Key: "a", + Value: "b", + Element: newElement.YNode(), + }) + assert.NoError(t, err) + assert.Equal(t, rn, newElement) + assert.Equal(t, `- e: f +- scalarValue +- c: d +`, assertNoErrorString(t)(node.String())) + + node = orig.Copy() + // Set an element with scalar + newElement = NewScalarRNode("foo") + rn, err = node.Pipe(ElementSetter{ + Key: "a", + Value: "b", + Element: newElement.YNode(), + }) + assert.NoError(t, err) + assert.Equal(t, rn, newElement) + assert.Equal(t, `- foo +- scalarValue +- c: d +`, assertNoErrorString(t)(node.String())) + + node = orig.Copy() + // Append an element + newElement = NewMapRNode(&map[string]string{ + "e": "f", + }) + rn, err = node.Pipe(ElementSetter{ + Key: "x", + Value: "y", + Element: newElement.YNode(), + }) + assert.NoError(t, err) + assert.Equal(t, rn, newElement) + assert.Equal(t, `- a: b +- scalarValue +- c: d +- e: f +`, assertNoErrorString(t)(node.String())) +} + func TestElementMatcherWithNoValue(t *testing.T) { node, err := Parse(` - a: c From 0e59c36d03dfeeec4176c17afc65216464b35680 Mon Sep 17 00:00:00 2001 From: Natasha Sarkar Date: Mon, 2 Nov 2020 18:08:27 -0800 Subject: [PATCH 11/66] added StringList set --- kyaml/sets/sets_test.go | 54 +++++++++++++++++++++++++++++++ kyaml/sets/{sets.go => string.go} | 0 kyaml/sets/stringlist.go | 44 +++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 kyaml/sets/sets_test.go rename kyaml/sets/{sets.go => string.go} (100%) create mode 100644 kyaml/sets/stringlist.go diff --git a/kyaml/sets/sets_test.go b/kyaml/sets/sets_test.go new file mode 100644 index 000000000..8fe5b1692 --- /dev/null +++ b/kyaml/sets/sets_test.go @@ -0,0 +1,54 @@ +// Copyright 2019 The Kubernetes Authors. +// SPDX-License-Identifier: Apache-2.0 + +package sets + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestStringList_Len(t *testing.T) { + var sl0 StringList = [][]string{} + assert.Equal(t, 0, sl0.Len()) + + var sl1 StringList = [][]string{ + {""}, + } + assert.Equal(t, 1, sl1.Len()) + + var sl2 StringList = [][]string{ + {"a", "b"}, + {"b", "c"}, + } + assert.Equal(t, 2, sl2.Len()) +} + +func TestStringList_Insert(t *testing.T) { + var sl StringList + assert.Equal(t, 0, sl.Len()) + + sl = sl.Insert([]string{"a", "b", "c"}) + assert.Equal(t, 1, sl.Len()) + + sl = sl.Insert([]string{"c", "b", "a"}) + assert.Equal(t, 2, sl.Len()) + + sl = sl.Insert([]string{"a", "b", "c"}) + assert.Equal(t, 2, sl.Len()) +} + +func TestStringList_Has(t *testing.T) { + var sl StringList + + assert.False(t, sl.Has([]string{})) + assert.False(t, sl.Has([]string{"a", "b", "c"})) + + sl = sl.Insert([]string{"a", "b", "c"}) + assert.True(t, sl.Has([]string{"a", "b", "c"})) + assert.False(t, sl.Has([]string{"b", "c", "a"})) + + sl = sl.Insert([]string{}) + assert.True(t, sl.Has([]string{})) +} diff --git a/kyaml/sets/sets.go b/kyaml/sets/string.go similarity index 100% rename from kyaml/sets/sets.go rename to kyaml/sets/string.go diff --git a/kyaml/sets/stringlist.go b/kyaml/sets/stringlist.go new file mode 100644 index 000000000..c3181cac9 --- /dev/null +++ b/kyaml/sets/stringlist.go @@ -0,0 +1,44 @@ +// Copyright 2019 The Kubernetes Authors. +// SPDX-License-Identifier: Apache-2.0 + +package sets + +// StringList is a set, where each element of +// the set is a string slice. +type StringList [][]string + +func (s StringList) Len() int { + return len(s) +} + +func (s StringList) Insert(val []string) StringList { + if !s.Has(val) { + return append(s, val) + } + return s +} + +func (s StringList) Has(val []string) bool { + if len(s) == 0 { + return false + } + + for i := range s { + if isStringSliceEqual(s[i], val) { + return true + } + } + return false +} + +func isStringSliceEqual (s []string, t []string) bool { + if len(s) != len(t) { + return false + } + for i := range s { + if s[i] != t[i] { + return false + } + } + return true +} From 3fed68b694200a96e4241967f037738b68f895c5 Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Tue, 3 Nov 2020 13:09:12 -0800 Subject: [PATCH 12/66] clarify the comments --- kyaml/yaml/fns.go | 8 +++++++- kyaml/yaml/fns_test.go | 9 +++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/kyaml/yaml/fns.go b/kyaml/yaml/fns.go index 45b107618..ad69d3bef 100644 --- a/kyaml/yaml/fns.go +++ b/kyaml/yaml/fns.go @@ -41,8 +41,14 @@ func (a ElementAppender) Filter(rn *RNode) (*RNode, error) { return nil, nil } -// ElementSetter sets the value for an Element in an associative list. ElementSetter +// ElementSetter sets the value for an Element in an associative list. ElementSetter // will remove any elements which are empty. +// ElementSetter will append, replace or delete an element in an associative list. +// To append, user a key-value pair that doesn't exist in the sequence. Note: this +// behavior is intended to handle the case that not matching element found. It's +// not designed for this purpose. To append an element, please use ElementAppender. +// To replace, set the key-value pair and a non-nil Element. +// To delete, set the key-value pair and leave the Element as nil. type ElementSetter struct { Kind string `yaml:"kind,omitempty"` diff --git a/kyaml/yaml/fns_test.go b/kyaml/yaml/fns_test.go index 046e6e370..dc6ae3d25 100644 --- a/kyaml/yaml/fns_test.go +++ b/kyaml/yaml/fns_test.go @@ -108,7 +108,7 @@ func TestElementSetter(t *testing.T) { // ElementSetter will update node, so make a copy node := orig.Copy() - // Remove an element + // Remove an element, because ElementSetter.Element is left nil. rn, err := node.Pipe(ElementSetter{Key: "a", Value: "b"}) assert.NoError(t, err) assert.Nil(t, rn) @@ -117,7 +117,7 @@ func TestElementSetter(t *testing.T) { `, assertNoErrorString(t)(node.String())) node = orig.Copy() - // Set an element + // Set an element, replacing 'a: b' with 'e: f' newElement := NewMapRNode(&map[string]string{ "e": "f", }) @@ -134,7 +134,7 @@ func TestElementSetter(t *testing.T) { `, assertNoErrorString(t)(node.String())) node = orig.Copy() - // Set an element with scalar + // Set an element with scalar, {"a": "b"} to "foo" newElement = NewScalarRNode("foo") rn, err = node.Pipe(ElementSetter{ Key: "a", @@ -149,7 +149,8 @@ func TestElementSetter(t *testing.T) { `, assertNoErrorString(t)(node.String())) node = orig.Copy() - // Append an element + // Append an element, {"x": "y"} is not in the list + // so the element will be appended. newElement = NewMapRNode(&map[string]string{ "e": "f", }) From 6bed2752340cff20246a1640e8249f76ac5874b5 Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Tue, 3 Nov 2020 15:23:34 -0800 Subject: [PATCH 13/66] add more tests for ElementSetter --- kyaml/yaml/fns.go | 5 ++--- kyaml/yaml/fns_test.go | 49 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/kyaml/yaml/fns.go b/kyaml/yaml/fns.go index ad69d3bef..bec46eeb0 100644 --- a/kyaml/yaml/fns.go +++ b/kyaml/yaml/fns.go @@ -41,10 +41,9 @@ func (a ElementAppender) Filter(rn *RNode) (*RNode, error) { return nil, nil } -// ElementSetter sets the value for an Element in an associative list. ElementSetter -// will remove any elements which are empty. +// ElementSetter sets the value for an Element in an associative list. // ElementSetter will append, replace or delete an element in an associative list. -// To append, user a key-value pair that doesn't exist in the sequence. Note: this +// To append, user a key-value pair that doesn't exist in the sequence. this // behavior is intended to handle the case that not matching element found. It's // not designed for this purpose. To append an element, please use ElementAppender. // To replace, set the key-value pair and a non-nil Element. diff --git a/kyaml/yaml/fns_test.go b/kyaml/yaml/fns_test.go index dc6ae3d25..fef18557f 100644 --- a/kyaml/yaml/fns_test.go +++ b/kyaml/yaml/fns_test.go @@ -116,6 +116,55 @@ func TestElementSetter(t *testing.T) { - c: d `, assertNoErrorString(t)(node.String())) + node = orig.Copy() + // Nothing happens because no element is matched + rn, err = node.Pipe(ElementSetter{Key: "a", Value: "zebra"}) + assert.NoError(t, err) + assert.Nil(t, rn) + assert.Equal(t, `- a: b +- scalarValue +- c: d +`, assertNoErrorString(t)(node.String())) + + node = orig.Copy() + // Return error because ElementSetter doesn't support a single key + // when there is a scalar value in the list + rn, err = node.Pipe(ElementSetter{Key: "a"}) + assert.EqualError(t, err, "wrong Node Kind for expected: MappingNode was ScalarNode: value: {scalarValue}") + + node = MustParse(` +- a: b +- c: d +`) + // {a: b} is removed since the value is omitted and only key is used + // to match and no Element specified. + rn, err = node.Pipe(ElementSetter{Key: "a"}) + assert.NoError(t, err) + assert.Nil(t, rn) + assert.Equal(t, `- c: d +`, assertNoErrorString(t)(node.String())) + + node = MustParse(` +- a: b +- c: d +`) + // Return error because ElementSetter will assume all elements are scalar when + // there is only value provided. + rn, err = node.Pipe(ElementSetter{Value: "b"}) + assert.EqualError(t, err, "wrong Node Kind for expected: ScalarNode was MappingNode: value: {a: b}") + + node = MustParse(` +- a +- b +`) + // b is removed since ElementSetter use the value "b" to match the + // scalar values. + rn, err = node.Pipe(ElementSetter{Value: "b"}) + assert.NoError(t, err) + assert.Nil(t, rn) + assert.Equal(t, `- a +`, assertNoErrorString(t)(node.String())) + node = orig.Copy() // Set an element, replacing 'a: b' with 'e: f' newElement := NewMapRNode(&map[string]string{ From c803ca83a4f0bbe7e4b3adb300a474110e0a8b68 Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Tue, 3 Nov 2020 15:29:01 -0800 Subject: [PATCH 14/66] fix linter error --- kyaml/yaml/fns_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kyaml/yaml/fns_test.go b/kyaml/yaml/fns_test.go index fef18557f..1b8628c97 100644 --- a/kyaml/yaml/fns_test.go +++ b/kyaml/yaml/fns_test.go @@ -129,7 +129,7 @@ func TestElementSetter(t *testing.T) { node = orig.Copy() // Return error because ElementSetter doesn't support a single key // when there is a scalar value in the list - rn, err = node.Pipe(ElementSetter{Key: "a"}) + _, err = node.Pipe(ElementSetter{Key: "a"}) assert.EqualError(t, err, "wrong Node Kind for expected: MappingNode was ScalarNode: value: {scalarValue}") node = MustParse(` @@ -150,7 +150,7 @@ func TestElementSetter(t *testing.T) { `) // Return error because ElementSetter will assume all elements are scalar when // there is only value provided. - rn, err = node.Pipe(ElementSetter{Value: "b"}) + _, err = node.Pipe(ElementSetter{Value: "b"}) assert.EqualError(t, err, "wrong Node Kind for expected: ScalarNode was MappingNode: value: {a: b}") node = MustParse(` From 3b79944190dfd25982ef2891c289b9c8235e0ee9 Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Tue, 3 Nov 2020 17:13:43 -0800 Subject: [PATCH 15/66] improve target in JSON6902 transformer --- api/builtins/PatchJson6902Transformer.go | 33 +++++++++---------- .../target/kusttarget_configplugin.go | 8 ++--- api/types/kustomization.go | 6 ++-- api/types/patchjson6902.go | 27 --------------- api/types/patchtarget.go | 20 ----------- 5 files changed, 22 insertions(+), 72 deletions(-) delete mode 100644 api/types/patchjson6902.go delete mode 100644 api/types/patchtarget.go diff --git a/api/builtins/PatchJson6902Transformer.go b/api/builtins/PatchJson6902Transformer.go index 7d56a15f3..2051c874a 100644 --- a/api/builtins/PatchJson6902Transformer.go +++ b/api/builtins/PatchJson6902Transformer.go @@ -10,7 +10,6 @@ import ( "github.com/pkg/errors" "sigs.k8s.io/kustomize/api/filters/patchjson6902" "sigs.k8s.io/kustomize/api/ifc" - "sigs.k8s.io/kustomize/api/resid" "sigs.k8s.io/kustomize/api/resmap" "sigs.k8s.io/kustomize/api/types" "sigs.k8s.io/kustomize/kyaml/filtersutil" @@ -20,9 +19,9 @@ import ( type PatchJson6902TransformerPlugin struct { ldr ifc.Loader decodedPatch jsonpatch.Patch - Target types.PatchTarget `json:"target,omitempty" yaml:"target,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - JsonOp string `json:"jsonOp,omitempty" yaml:"jsonOp,omitempty"` + Target *types.Selector `json:"target,omitempty" yaml:"target,omitempty"` + Path string `json:"path,omitempty" yaml:"path,omitempty"` + JsonOp string `json:"jsonOp,omitempty" yaml:"jsonOp,omitempty"` } func (p *PatchJson6902TransformerPlugin) Config( @@ -72,22 +71,22 @@ func (p *PatchJson6902TransformerPlugin) Config( } func (p *PatchJson6902TransformerPlugin) Transform(m resmap.ResMap) error { - id := resid.NewResIdWithNamespace( - resid.Gvk{ - Group: p.Target.Group, - Version: p.Target.Version, - Kind: p.Target.Kind, - }, - p.Target.Name, - p.Target.Namespace, - ) - obj, err := m.GetById(id) + if p.Target == nil { + return fmt.Errorf("must specify a target for patch %s", p.JsonOp) + } + resources, err := m.Select(*p.Target) if err != nil { return err } - return filtersutil.ApplyToJSON(patchjson6902.Filter{ - Patch: p.JsonOp, - }, obj) + for _, res := range resources { + err = filtersutil.ApplyToJSON(patchjson6902.Filter{ + Patch: p.JsonOp, + }, res) + if err != nil { + return err + } + } + return nil } func NewPatchJson6902TransformerPlugin() resmap.TransformerPlugin { diff --git a/api/internal/target/kusttarget_configplugin.go b/api/internal/target/kusttarget_configplugin.go index 418931a8c..a46b2e6ba 100644 --- a/api/internal/target/kusttarget_configplugin.go +++ b/api/internal/target/kusttarget_configplugin.go @@ -159,12 +159,12 @@ var transformerConfigurators = map[builtinhelpers.BuiltinPluginType]func( kt *KustTarget, bpt builtinhelpers.BuiltinPluginType, f tFactory, _ *builtinconfig.TransformerConfig) ( result []resmap.Transformer, err error) { var c struct { - Target types.PatchTarget `json:"target,omitempty" yaml:"target,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - JsonOp string `json:"jsonOp,omitempty" yaml:"jsonOp,omitempty"` + Target *types.Selector `json:"target,omitempty" yaml:"target,omitempty"` + Path string `json:"path,omitempty" yaml:"path,omitempty"` + JsonOp string `json:"jsonOp,omitempty" yaml:"jsonOp,omitempty"` } for _, args := range kt.kustomization.PatchesJson6902 { - c.Target = *args.Target + c.Target = args.Target c.Path = args.Path c.JsonOp = args.Patch p := f() diff --git a/api/types/kustomization.go b/api/types/kustomization.go index da7e24c72..b290da35c 100644 --- a/api/types/kustomization.go +++ b/api/types/kustomization.go @@ -55,7 +55,7 @@ type Kustomization struct { // JSONPatches is a list of JSONPatch for applying JSON patch. // Format documented at https://tools.ietf.org/html/rfc6902 // and http://jsonpatch.com - PatchesJson6902 []PatchJson6902 `json:"patchesJson6902,omitempty" yaml:"patchesJson6902,omitempty"` + PatchesJson6902 []Patch `json:"patchesJson6902,omitempty" yaml:"patchesJson6902,omitempty"` // Patches is a list of patches, where each one can be either a // Strategic Merge Patch or a JSON patch. @@ -172,9 +172,7 @@ func (k *Kustomization) FixKustomizationPostUnmarshalling() { // has been processed. func (k *Kustomization) FixKustomizationPreMarshalling() { // PatchesJson6902 should be under the Patches field. - for _, patch := range k.PatchesJson6902 { - k.Patches = append(k.Patches, patch.ToPatch()) - } + k.Patches = append(k.Patches, k.PatchesJson6902...) k.PatchesJson6902 = nil } diff --git a/api/types/patchjson6902.go b/api/types/patchjson6902.go deleted file mode 100644 index 4c90ce201..000000000 --- a/api/types/patchjson6902.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2019 The Kubernetes Authors. -// SPDX-License-Identifier: Apache-2.0 - -package types - -// PatchJson6902 represents a json patch for an object -// with format documented https://tools.ietf.org/html/rfc6902. -type PatchJson6902 struct { - // PatchTarget refers to a Kubernetes object that the json patch will be - // applied to. It must refer to a Kubernetes resource under the - // purview of this kustomization. PatchTarget should use the - // raw name of the object (the name specified in its YAML, - // before addition of a namePrefix and a nameSuffix). - Target *PatchTarget `json:"target" yaml:"target"` - - // relative file path for a json patch file inside a kustomization - Path string `json:"path,omitempty" yaml:"path,omitempty"` - - // inline patch string - Patch string `json:"patch,omitempty" yaml:"patch,omitempty"` -} - -// ToPatch converts a PatchJson6902 to its superset Patch. -func (patch *PatchJson6902) ToPatch() Patch { - selector := patch.Target.ToSelector() - return Patch{Path: patch.Path, Patch: patch.Patch, Target: &selector} -} diff --git a/api/types/patchtarget.go b/api/types/patchtarget.go deleted file mode 100644 index 85f804574..000000000 --- a/api/types/patchtarget.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2019 The Kubernetes Authors. -// SPDX-License-Identifier: Apache-2.0 - -package types - -import ( - "sigs.k8s.io/kustomize/api/resid" -) - -// PatchTarget represents the kubernetes object that the patch is applied to -type PatchTarget struct { - resid.Gvk `json:",inline,omitempty" yaml:",inline,omitempty"` - Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` - Name string `json:"name" yaml:"name"` -} - -// ToSelector converts a PatchTarget to a Selector. -func (target *PatchTarget) ToSelector() Selector { - return Selector{Name: target.Name, Namespace: target.Namespace, Gvk: target.Gvk} -} From ff276af3173618332e593de98286ee431a533bd8 Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Tue, 3 Nov 2020 17:14:08 -0800 Subject: [PATCH 16/66] use same logic with path transformer --- .../PatchJson6902Transformer.go | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/plugin/builtin/patchjson6902transformer/PatchJson6902Transformer.go b/plugin/builtin/patchjson6902transformer/PatchJson6902Transformer.go index f07226fc9..340d1abb0 100644 --- a/plugin/builtin/patchjson6902transformer/PatchJson6902Transformer.go +++ b/plugin/builtin/patchjson6902transformer/PatchJson6902Transformer.go @@ -11,7 +11,6 @@ import ( "github.com/pkg/errors" "sigs.k8s.io/kustomize/api/filters/patchjson6902" "sigs.k8s.io/kustomize/api/ifc" - "sigs.k8s.io/kustomize/api/resid" "sigs.k8s.io/kustomize/api/resmap" "sigs.k8s.io/kustomize/api/types" "sigs.k8s.io/kustomize/kyaml/filtersutil" @@ -21,9 +20,9 @@ import ( type plugin struct { ldr ifc.Loader decodedPatch jsonpatch.Patch - Target types.PatchTarget `json:"target,omitempty" yaml:"target,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - JsonOp string `json:"jsonOp,omitempty" yaml:"jsonOp,omitempty"` + Target *types.Selector `json:"target,omitempty" yaml:"target,omitempty"` + Path string `json:"path,omitempty" yaml:"path,omitempty"` + JsonOp string `json:"jsonOp,omitempty" yaml:"jsonOp,omitempty"` } //noinspection GoUnusedGlobalVariable @@ -76,20 +75,20 @@ func (p *plugin) Config( } func (p *plugin) Transform(m resmap.ResMap) error { - id := resid.NewResIdWithNamespace( - resid.Gvk{ - Group: p.Target.Group, - Version: p.Target.Version, - Kind: p.Target.Kind, - }, - p.Target.Name, - p.Target.Namespace, - ) - obj, err := m.GetById(id) + if p.Target == nil { + return fmt.Errorf("must specify a target for patch %s", p.JsonOp) + } + resources, err := m.Select(*p.Target) if err != nil { return err } - return filtersutil.ApplyToJSON(patchjson6902.Filter{ - Patch: p.JsonOp, - }, obj) + for _, res := range resources { + err = filtersutil.ApplyToJSON(patchjson6902.Filter{ + Patch: p.JsonOp, + }, res) + if err != nil { + return err + } + } + return nil } From 0834e152b203ffeccfbbf1ddd3c1f49debdac341 Mon Sep 17 00:00:00 2001 From: Phillip Wittrock Date: Wed, 4 Nov 2020 11:15:40 -0800 Subject: [PATCH 17/66] Redirect kustomize docs to the new unified site. --- site/content/en/api-reference/_index.md | 2 ++ site/content/en/api-reference/glossary/_index.md | 3 +++ site/content/en/api-reference/kustomization/_index.md | 1 + site/content/en/api-reference/kustomization/bases/_index.md | 2 ++ .../en/api-reference/kustomization/commonannotations/_index.md | 2 ++ .../en/api-reference/kustomization/commonlabels/_index.md | 3 +++ .../en/api-reference/kustomization/components/_index.md | 3 +++ .../api-reference/kustomization/configmapgenerator/_index.md | 3 +++ site/content/en/api-reference/kustomization/crds/_index.md | 3 +++ .../en/api-reference/kustomization/generatoroptions/_index.md | 1 + site/content/en/api-reference/kustomization/images/_index.md | 3 +++ .../en/api-reference/kustomization/nameprefix/_index.md | 3 +++ .../content/en/api-reference/kustomization/namespace/_index.md | 3 +++ .../en/api-reference/kustomization/namesuffix/_index.md | 3 +++ site/content/en/api-reference/kustomization/patches/_index.md | 3 +++ .../kustomization/patchesStrategicMerge/_index.md | 3 +++ .../en/api-reference/kustomization/patchesjson6902/_index.md | 3 +++ site/content/en/api-reference/kustomization/replicas/_index.md | 3 +++ .../content/en/api-reference/kustomization/resources/_index.md | 3 +++ .../en/api-reference/kustomization/secretegenerator/_index.md | 3 +++ site/content/en/api-reference/kustomization/vars/_index.md | 3 +++ site/content/en/blog/_index.md | 2 ++ site/content/en/blog/releases/_index.md | 1 + site/content/en/contributing/_index.md | 3 +++ site/content/en/contributing/bugs/_index.md | 2 ++ site/content/en/contributing/community/_index.md | 3 +++ site/content/en/contributing/docs/_index.md | 3 +++ site/content/en/contributing/features/_index.md | 2 ++ site/content/en/contributing/howitworks/_index.md | 3 +++ site/content/en/contributing/mac/_index.md | 1 + site/content/en/contributing/windows/_index.md | 2 ++ site/content/en/faq/_index.md | 2 ++ site/content/en/faq/eschewedfeatures/_index.md | 2 ++ site/content/en/faq/versioningPolicy.md | 2 ++ site/content/en/guides/_index.md | 1 + site/content/en/guides/bespoke/_index.md | 3 +++ site/content/en/guides/components/_index.md | 3 +++ site/content/en/guides/offtheshelf/_index.md | 3 +++ site/content/en/guides/plugins/_index.md | 2 ++ site/content/en/guides/plugins/builtins.md | 3 +++ site/content/en/guides/plugins/execPluginGuidedExample.md | 3 +++ site/content/en/guides/plugins/goPluginCaveats.md | 2 ++ site/content/en/guides/plugins/goPluginGuidedExample.md | 3 +++ site/content/en/installation/_index.md | 2 ++ site/content/en/installation/binaries/_index.md | 2 ++ site/content/en/installation/chocolatey/_index.md | 3 +++ site/content/en/installation/homebrew/_index.md | 3 +++ site/content/en/installation/source/_index.md | 2 ++ 48 files changed, 119 insertions(+) diff --git a/site/content/en/api-reference/_index.md b/site/content/en/api-reference/_index.md index 2b3f824b5..1c6be44dd 100644 --- a/site/content/en/api-reference/_index.md +++ b/site/content/en/api-reference/_index.md @@ -9,3 +9,5 @@ menu: description: > Reference for Kustomize client-side APIs --- + + \ No newline at end of file diff --git a/site/content/en/api-reference/glossary/_index.md b/site/content/en/api-reference/glossary/_index.md index 99f72748c..2c72782ff 100644 --- a/site/content/en/api-reference/glossary/_index.md +++ b/site/content/en/api-reference/glossary/_index.md @@ -7,6 +7,9 @@ description: > Glossary of terms --- + + + # Glossary [CRD spec]: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ diff --git a/site/content/en/api-reference/kustomization/_index.md b/site/content/en/api-reference/kustomization/_index.md index 29443fbff..c7c048d14 100644 --- a/site/content/en/api-reference/kustomization/_index.md +++ b/site/content/en/api-reference/kustomization/_index.md @@ -7,5 +7,6 @@ description: > kustomization.yaml fields and API --- + diff --git a/site/content/en/api-reference/kustomization/bases/_index.md b/site/content/en/api-reference/kustomization/bases/_index.md index 77d09108b..a2c61ecec 100644 --- a/site/content/en/api-reference/kustomization/bases/_index.md +++ b/site/content/en/api-reference/kustomization/bases/_index.md @@ -6,6 +6,8 @@ description: > Add resources from a kustomization dir. --- + + {{% pageinfo color="warning" %}} The `bases` field was deprecated in v2.1.0 {{% /pageinfo %}} diff --git a/site/content/en/api-reference/kustomization/commonannotations/_index.md b/site/content/en/api-reference/kustomization/commonannotations/_index.md index fe27b2155..af5becd99 100644 --- a/site/content/en/api-reference/kustomization/commonannotations/_index.md +++ b/site/content/en/api-reference/kustomization/commonannotations/_index.md @@ -6,6 +6,8 @@ description: > Add annotations to all resources. --- + + Add annotations to all resources. If the annotation key is already present on the resource, the value will be overridden. diff --git a/site/content/en/api-reference/kustomization/commonlabels/_index.md b/site/content/en/api-reference/kustomization/commonlabels/_index.md index 0186772a1..af840a2da 100644 --- a/site/content/en/api-reference/kustomization/commonlabels/_index.md +++ b/site/content/en/api-reference/kustomization/commonlabels/_index.md @@ -6,6 +6,9 @@ description: > Add labels and selectors to add all resources. --- + + + Add labels and selectors to all resources. If the label key already is present on the resource, the value will be overridden. diff --git a/site/content/en/api-reference/kustomization/components/_index.md b/site/content/en/api-reference/kustomization/components/_index.md index 7ba60f812..f0eca288e 100644 --- a/site/content/en/api-reference/kustomization/components/_index.md +++ b/site/content/en/api-reference/kustomization/components/_index.md @@ -6,4 +6,7 @@ description: > Compose kustomizations. --- + + + *Coming soon* diff --git a/site/content/en/api-reference/kustomization/configmapgenerator/_index.md b/site/content/en/api-reference/kustomization/configmapgenerator/_index.md index 7622890fe..4131e4c87 100644 --- a/site/content/en/api-reference/kustomization/configmapgenerator/_index.md +++ b/site/content/en/api-reference/kustomization/configmapgenerator/_index.md @@ -6,6 +6,9 @@ description: > Generate ConfigMap resources. --- + + + Each entry in this list results in the creation of one ConfigMap resource (it's a generator of n maps). diff --git a/site/content/en/api-reference/kustomization/crds/_index.md b/site/content/en/api-reference/kustomization/crds/_index.md index d2448ad06..e89031af8 100644 --- a/site/content/en/api-reference/kustomization/crds/_index.md +++ b/site/content/en/api-reference/kustomization/crds/_index.md @@ -6,6 +6,9 @@ description: > Adding CRD support --- + + + Each entry in this list should be a relative path to a file for custom resource definition (CRD). diff --git a/site/content/en/api-reference/kustomization/generatoroptions/_index.md b/site/content/en/api-reference/kustomization/generatoroptions/_index.md index 2f5fbde51..79719cd6f 100644 --- a/site/content/en/api-reference/kustomization/generatoroptions/_index.md +++ b/site/content/en/api-reference/kustomization/generatoroptions/_index.md @@ -7,6 +7,7 @@ description: > [Secret](/kustomize/api-reference/kustomization/secretgenerator) generators. --- + Additionally, generatorOptions can be set on a per resource level within each diff --git a/site/content/en/api-reference/kustomization/images/_index.md b/site/content/en/api-reference/kustomization/images/_index.md index f245b16df..6d9465ce6 100644 --- a/site/content/en/api-reference/kustomization/images/_index.md +++ b/site/content/en/api-reference/kustomization/images/_index.md @@ -6,6 +6,9 @@ description: > Modify the name, tags and/or digest for images. --- + + + Images modify the name, tags and/or digest for images without creating patches. E.g. Given this kubernetes Deployment fragment: diff --git a/site/content/en/api-reference/kustomization/nameprefix/_index.md b/site/content/en/api-reference/kustomization/nameprefix/_index.md index 5a2be7c38..eff83839a 100644 --- a/site/content/en/api-reference/kustomization/nameprefix/_index.md +++ b/site/content/en/api-reference/kustomization/nameprefix/_index.md @@ -6,6 +6,9 @@ description: > Prepends the value to the names of all resources and references. --- + + + ```yaml apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization diff --git a/site/content/en/api-reference/kustomization/namespace/_index.md b/site/content/en/api-reference/kustomization/namespace/_index.md index 1f8aabd29..ba5943ec1 100644 --- a/site/content/en/api-reference/kustomization/namespace/_index.md +++ b/site/content/en/api-reference/kustomization/namespace/_index.md @@ -6,6 +6,9 @@ description: > Adds namespace to all resources. --- + + + ```yaml apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization diff --git a/site/content/en/api-reference/kustomization/namesuffix/_index.md b/site/content/en/api-reference/kustomization/namesuffix/_index.md index 43f3eaa1e..a79fc7e3e 100644 --- a/site/content/en/api-reference/kustomization/namesuffix/_index.md +++ b/site/content/en/api-reference/kustomization/namesuffix/_index.md @@ -6,6 +6,9 @@ description: > Appends the value to the names of all resources and references. --- + + + ```yaml apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization diff --git a/site/content/en/api-reference/kustomization/patches/_index.md b/site/content/en/api-reference/kustomization/patches/_index.md index e499d2d84..21a4acf24 100644 --- a/site/content/en/api-reference/kustomization/patches/_index.md +++ b/site/content/en/api-reference/kustomization/patches/_index.md @@ -6,6 +6,9 @@ description: > Patch resources --- + + + [strategic merge]: /kustomize/api-reference/glossary#patchstrategicmerge [JSON]: /kustomize/api-reference/glossary#patchjson6902 diff --git a/site/content/en/api-reference/kustomization/patchesStrategicMerge/_index.md b/site/content/en/api-reference/kustomization/patchesStrategicMerge/_index.md index 0786e81da..58f47760d 100644 --- a/site/content/en/api-reference/kustomization/patchesStrategicMerge/_index.md +++ b/site/content/en/api-reference/kustomization/patchesStrategicMerge/_index.md @@ -6,6 +6,9 @@ description: > Patch resources using the strategic merge patch standard. --- + + + Each entry in this list should be either a relative file path or an inline content resolving to a partial or complete resource diff --git a/site/content/en/api-reference/kustomization/patchesjson6902/_index.md b/site/content/en/api-reference/kustomization/patchesjson6902/_index.md index fe748140a..932a1a7c2 100644 --- a/site/content/en/api-reference/kustomization/patchesjson6902/_index.md +++ b/site/content/en/api-reference/kustomization/patchesjson6902/_index.md @@ -6,6 +6,9 @@ description: > Patch resources using the [json 6902 standard](https://tools.ietf.org/html/rfc6902) --- + + + Each entry in this list should resolve to a kubernetes object and a JSON patch that will be applied to the object. The JSON patch is documented at diff --git a/site/content/en/api-reference/kustomization/replicas/_index.md b/site/content/en/api-reference/kustomization/replicas/_index.md index e21e5eb73..b021fbc95 100644 --- a/site/content/en/api-reference/kustomization/replicas/_index.md +++ b/site/content/en/api-reference/kustomization/replicas/_index.md @@ -6,6 +6,9 @@ description: > Change the number of replicas for a resource. --- + + + Given this kubernetes Deployment fragment: ``` diff --git a/site/content/en/api-reference/kustomization/resources/_index.md b/site/content/en/api-reference/kustomization/resources/_index.md index 3586b031f..12190a358 100644 --- a/site/content/en/api-reference/kustomization/resources/_index.md +++ b/site/content/en/api-reference/kustomization/resources/_index.md @@ -6,6 +6,9 @@ description: > Resources to include. --- + + + Each entry in this list must be a path to a _file_, or a path (or URL) referring to another kustomization _directory_, e.g. diff --git a/site/content/en/api-reference/kustomization/secretegenerator/_index.md b/site/content/en/api-reference/kustomization/secretegenerator/_index.md index 445b4d81f..49a1e05bf 100644 --- a/site/content/en/api-reference/kustomization/secretegenerator/_index.md +++ b/site/content/en/api-reference/kustomization/secretegenerator/_index.md @@ -6,6 +6,9 @@ description: > Generate Secret resources. --- + + + Each entry in the argument list results in the creation of one Secret resource (it's a generator of N secrets). This works like the [configMapGenerator](/kustomize/api-reference/kustomization/configmapgenerator). diff --git a/site/content/en/api-reference/kustomization/vars/_index.md b/site/content/en/api-reference/kustomization/vars/_index.md index 9cf96591c..d84d0157e 100644 --- a/site/content/en/api-reference/kustomization/vars/_index.md +++ b/site/content/en/api-reference/kustomization/vars/_index.md @@ -6,6 +6,9 @@ description: > Substitute name references. --- + + + Vars are used to capture text from one resource's field and insert that text elsewhere - a reflection feature. diff --git a/site/content/en/blog/_index.md b/site/content/en/blog/_index.md index 250a849c0..eda933bf5 100644 --- a/site/content/en/blog/_index.md +++ b/site/content/en/blog/_index.md @@ -5,3 +5,5 @@ menu: main: weight: 80 --- + + diff --git a/site/content/en/blog/releases/_index.md b/site/content/en/blog/releases/_index.md index ffae15b86..747493b71 100644 --- a/site/content/en/blog/releases/_index.md +++ b/site/content/en/blog/releases/_index.md @@ -4,3 +4,4 @@ linkTitle: "Releases" weight: 20 --- + diff --git a/site/content/en/contributing/_index.md b/site/content/en/contributing/_index.md index 2bd12baf7..028ae24e0 100644 --- a/site/content/en/contributing/_index.md +++ b/site/content/en/contributing/_index.md @@ -7,4 +7,7 @@ menu: weight: 99 --- + + + Follow are resources for Kustomize contributors. diff --git a/site/content/en/contributing/bugs/_index.md b/site/content/en/contributing/bugs/_index.md index a8a7ed4c8..6f4e17cdb 100644 --- a/site/content/en/contributing/bugs/_index.md +++ b/site/content/en/contributing/bugs/_index.md @@ -7,6 +7,8 @@ description: > How to file bugs and fix Kustomize bugs --- + + [krusty package]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/krusty [reusable custom transformer test]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/krusty/customconfigreusable_test.go diff --git a/site/content/en/contributing/community/_index.md b/site/content/en/contributing/community/_index.md index 4fd045497..f0c355400 100644 --- a/site/content/en/contributing/community/_index.md +++ b/site/content/en/contributing/community/_index.md @@ -7,6 +7,9 @@ description: > Joining SIG-CLI and the Kubernetes community --- + + + [CLI special interest group]: https://github.com/kubernetes/community/tree/master/sig-cli#cli-special-interest-group [contributor roles]: https://github.com/kubernetes/community/blob/master/community-membership.md#community-membership [mailing list]: https://groups.google.com/forum/#!forum/kubernetes-sig-cli diff --git a/site/content/en/contributing/docs/_index.md b/site/content/en/contributing/docs/_index.md index d57e48d8f..6d913b7f4 100644 --- a/site/content/en/contributing/docs/_index.md +++ b/site/content/en/contributing/docs/_index.md @@ -7,6 +7,9 @@ description: > How to make Kustomize docs contributions --- + + + Kustomize uses [Docsy](https://www.docsy.dev) for the site, and was forked from the [docsy-example](https://github.com/google/docsy-example) diff --git a/site/content/en/contributing/features/_index.md b/site/content/en/contributing/features/_index.md index d241a136a..cb19916aa 100644 --- a/site/content/en/contributing/features/_index.md +++ b/site/content/en/contributing/features/_index.md @@ -6,6 +6,8 @@ weight: 21 description: > How to contribute features --- + + [issue]: https://github.com/kubernetes-sigs/kustomize/issues [sig-cli]: /kustomize/contributing/community/ diff --git a/site/content/en/contributing/howitworks/_index.md b/site/content/en/contributing/howitworks/_index.md index 1e204efe4..364b12b85 100644 --- a/site/content/en/contributing/howitworks/_index.md +++ b/site/content/en/contributing/howitworks/_index.md @@ -7,6 +7,9 @@ description: > How to modify Kustomize --- + + + {{% pageinfo color="info" %}} To build kustomize using the locally modified modules, `replace` statements must be added to the `kustomize/go.mod`. diff --git a/site/content/en/contributing/mac/_index.md b/site/content/en/contributing/mac/_index.md index 0960c30ae..31f8d8911 100644 --- a/site/content/en/contributing/mac/_index.md +++ b/site/content/en/contributing/mac/_index.md @@ -6,6 +6,7 @@ weight: 50 description: > How to develop on MacOS --- + First install the tools to build and run tests diff --git a/site/content/en/contributing/windows/_index.md b/site/content/en/contributing/windows/_index.md index a0ec49a13..cc76a4255 100644 --- a/site/content/en/contributing/windows/_index.md +++ b/site/content/en/contributing/windows/_index.md @@ -7,6 +7,8 @@ description: > How to develop on Windows --- + + This is the PowerShell script to run all go tests for Kustomize on a windows based platform which mimics /build/pre-commit.sh ## Pre-Reqs diff --git a/site/content/en/faq/_index.md b/site/content/en/faq/_index.md index 6d6a471a2..a1e4e4728 100644 --- a/site/content/en/faq/_index.md +++ b/site/content/en/faq/_index.md @@ -7,6 +7,8 @@ menu: weight: 70 --- + + ## kubectl doesn't have the latest kustomize, when will it be updated? TLDR: This is blocked on either moving kubectl into its own repo, or changing its dependencies. ETA k8s ~1.20. diff --git a/site/content/en/faq/eschewedfeatures/_index.md b/site/content/en/faq/eschewedfeatures/_index.md index dc6332a14..7c53dfa86 100644 --- a/site/content/en/faq/eschewedfeatures/_index.md +++ b/site/content/en/faq/eschewedfeatures/_index.md @@ -7,6 +7,8 @@ description: > Eschewed Features --- + + The maintainers established this list to place bounds on the kustomize feature set. The bounds can be changed with diff --git a/site/content/en/faq/versioningPolicy.md b/site/content/en/faq/versioningPolicy.md index fa44f3937..c2ecddb3b 100644 --- a/site/content/en/faq/versioningPolicy.md +++ b/site/content/en/faq/versioningPolicy.md @@ -5,6 +5,8 @@ weight: 99 type: docs --- + + Running `kustomize` means one is running a particular version of a program (a CLI), using a particular version of underlying packages (a Go diff --git a/site/content/en/guides/_index.md b/site/content/en/guides/_index.md index e78b8f401..ee2c1b4ba 100644 --- a/site/content/en/guides/_index.md +++ b/site/content/en/guides/_index.md @@ -9,3 +9,4 @@ menu: description: > Reference for Kustomize usage and best practices --- + \ No newline at end of file diff --git a/site/content/en/guides/bespoke/_index.md b/site/content/en/guides/bespoke/_index.md index 9feb38eb2..f96f801ba 100644 --- a/site/content/en/guides/bespoke/_index.md +++ b/site/content/en/guides/bespoke/_index.md @@ -7,6 +7,9 @@ description: > Workflow for bespoke applications --- + + + In this workflow, all configuration (resource YAML) files are owned by the user. No content is incorporated from version control repositories owned by others. diff --git a/site/content/en/guides/components/_index.md b/site/content/en/guides/components/_index.md index 6bcaa7d0c..10cd329dc 100644 --- a/site/content/en/guides/components/_index.md +++ b/site/content/en/guides/components/_index.md @@ -6,6 +6,9 @@ description: > Kustomize components guide --- + + + As of ``v3.7.0`` Kustomize supports a special type of kustomization that allows one to define reusable pieces of configuration logic that can be included from multiple overlays. diff --git a/site/content/en/guides/offtheshelf/_index.md b/site/content/en/guides/offtheshelf/_index.md index 5694b0d8b..9aed80a10 100644 --- a/site/content/en/guides/offtheshelf/_index.md +++ b/site/content/en/guides/offtheshelf/_index.md @@ -7,6 +7,9 @@ description: > Workflow for off the shelf applications --- + + + In this workflow, all files are owned by the user and maintained in a repository under their control, but they are based on an [off-the-shelf] configuration that is periodically consulted for updates. diff --git a/site/content/en/guides/plugins/_index.md b/site/content/en/guides/plugins/_index.md index 095361844..9c60d55b1 100644 --- a/site/content/en/guides/plugins/_index.md +++ b/site/content/en/guides/plugins/_index.md @@ -7,6 +7,8 @@ description: > Kustomize plugins guide --- + + Kustomize offers a plugin framework allowing people to write their own resource _generators_ and _transformers_. diff --git a/site/content/en/guides/plugins/builtins.md b/site/content/en/guides/plugins/builtins.md index dba2bd8a1..4599635b0 100644 --- a/site/content/en/guides/plugins/builtins.md +++ b/site/content/en/guides/plugins/builtins.md @@ -6,6 +6,9 @@ description: > Builtin Plugins --- + + + # Builtin Plugins A list of kustomize's builtin plugins - both diff --git a/site/content/en/guides/plugins/execPluginGuidedExample.md b/site/content/en/guides/plugins/execPluginGuidedExample.md index 3b75514b1..ecd91c5dc 100644 --- a/site/content/en/guides/plugins/execPluginGuidedExample.md +++ b/site/content/en/guides/plugins/execPluginGuidedExample.md @@ -6,6 +6,9 @@ description: > Exec plugin on linux in 60 seconds --- + + + This is a (no reading allowed!) 60 second copy/paste guided example. Full plugin docs [here](..). diff --git a/site/content/en/guides/plugins/goPluginCaveats.md b/site/content/en/guides/plugins/goPluginCaveats.md index 74ce2f461..3a09a412c 100644 --- a/site/content/en/guides/plugins/goPluginCaveats.md +++ b/site/content/en/guides/plugins/goPluginCaveats.md @@ -6,6 +6,8 @@ description: > Go plugin Caveats --- + + [plugin package]: https://golang.org/pkg/plugin [Go modules]: https://github.com/golang/go/wiki/Modules [ELF]: https://en.wikipedia.org/wiki/Executable_and_Linkable_Format diff --git a/site/content/en/guides/plugins/goPluginGuidedExample.md b/site/content/en/guides/plugins/goPluginGuidedExample.md index 2591a3dca..e06b92f02 100644 --- a/site/content/en/guides/plugins/goPluginGuidedExample.md +++ b/site/content/en/guides/plugins/goPluginGuidedExample.md @@ -6,6 +6,9 @@ description: > Go plugin example --- + + + # Go Plugin Guided Example for Linux [SopsEncodedSecrets repository]: https://github.com/monopole/sopsencodedsecrets diff --git a/site/content/en/installation/_index.md b/site/content/en/installation/_index.md index a12e0984b..eacb9d161 100644 --- a/site/content/en/installation/_index.md +++ b/site/content/en/installation/_index.md @@ -7,3 +7,5 @@ menu: main: weight: 10 --- + + diff --git a/site/content/en/installation/binaries/_index.md b/site/content/en/installation/binaries/_index.md index e42958379..0e10a1799 100644 --- a/site/content/en/installation/binaries/_index.md +++ b/site/content/en/installation/binaries/_index.md @@ -7,6 +7,8 @@ description: > Install Kustomize by downloading precompiled binaries. --- + + Binaries at various versions for linux, MacOs and Windows are published on the [releases page]. The following [script] detects your OS and downloads the appropriate kustomize binary to your diff --git a/site/content/en/installation/chocolatey/_index.md b/site/content/en/installation/chocolatey/_index.md index e41f90371..e2e723608 100644 --- a/site/content/en/installation/chocolatey/_index.md +++ b/site/content/en/installation/chocolatey/_index.md @@ -7,6 +7,9 @@ description: > Install Kustomize for Windows using Chocolatey --- + + + ``` choco install kustomize ``` diff --git a/site/content/en/installation/homebrew/_index.md b/site/content/en/installation/homebrew/_index.md index 7d6c434d6..5e422f8fb 100644 --- a/site/content/en/installation/homebrew/_index.md +++ b/site/content/en/installation/homebrew/_index.md @@ -7,6 +7,9 @@ description: > Install Kustomize for MacOS using Homebrew or MacPorts --- + + + For [Homebrew](https://brew.sh) users: ``` diff --git a/site/content/en/installation/source/_index.md b/site/content/en/installation/source/_index.md index 2c44f95ea..f4099b6c1 100644 --- a/site/content/en/installation/source/_index.md +++ b/site/content/en/installation/source/_index.md @@ -7,6 +7,8 @@ description: > Install Kustomize from the Go source code --- + + Requires [Go] to be installed. ## Install the kustomize CLI from source without cloning the repo From 4d99217a7ceb020e39024ff33e9d2c50be3d21b2 Mon Sep 17 00:00:00 2001 From: Phillip Wittrock Date: Wed, 4 Nov 2020 11:18:56 -0800 Subject: [PATCH 18/66] Build kustomize docs site with redirects to new unified at cli-experimental --- docs/api-reference/glossary/index.html | 18 +- docs/api-reference/index.html | 13 +- .../kustomization/bases/index.html | 14 +- .../commonannotations/index.html | 48 +- .../kustomization/commonlabels/index.html | 94 +- .../kustomization/components/index.html | 14 +- .../configmapgenerator/index.html | 54 +- .../kustomization/crds/index.html | 28 +- .../kustomization/generatoroptions/index.html | 22 +- .../kustomization/images/index.html | 54 +- docs/api-reference/kustomization/index.html | 16 +- docs/api-reference/kustomization/index.xml | 559 ++++++------ .../kustomization/nameprefix/index.html | 18 +- .../kustomization/namespace/index.html | 18 +- .../kustomization/namesuffix/index.html | 18 +- .../kustomization/patches/index.html | 98 +-- .../kustomization/patchesjson6902/index.html | 74 +- .../patchesstrategicmerge/index.html | 54 +- .../kustomization/replicas/index.html | 14 +- .../kustomization/resources/index.html | 30 +- .../kustomization/secretegenerator/index.html | 44 +- .../kustomization/vars/index.html | 85 +- docs/blog/2018/05/21/v1.0.1/index.html | 11 +- docs/blog/2019/02/05/v2.0.0/index.html | 11 +- docs/blog/2019/06/18/v2.1.0/index.html | 11 +- docs/blog/2019/07/03/v3.0.0/index.html | 11 +- docs/blog/2019/07/26/v3.1.0/index.html | 79 +- docs/blog/2019/09/17/v3.2.0/index.html | 11 +- docs/blog/2019/09/26/v3.2.1/index.html | 11 +- docs/blog/2019/10/24/v3.3.0/index.html | 11 +- docs/blog/index.html | 9 +- docs/blog/index.xml | 68 +- docs/blog/releases/index.html | 9 +- docs/blog/releases/index.xml | 68 +- docs/contributing/bugs/index.html | 14 +- docs/contributing/community/index.html | 14 +- docs/contributing/docs/index.html | 14 +- docs/contributing/features/index.html | 14 +- docs/contributing/howitworks/index.html | 14 +- docs/contributing/index.html | 14 +- docs/contributing/mac/index.html | 14 +- docs/contributing/windows/index.html | 14 +- docs/en/sitemap.xml | 148 ++-- docs/faq/eschewedfeatures/index.html | 14 +- docs/faq/index.html | 20 +- docs/faq/versioningpolicy/index.html | 18 +- docs/guides/bespoke/index.html | 264 +++++- docs/guides/cmd/build/index.html | 763 ++++++++++++++++ docs/guides/cmd/build/index.xml | 17 + docs/guides/cmd/cfg/index.html | 763 ++++++++++++++++ docs/guides/cmd/cfg/index.xml | 17 + docs/guides/cmd/create/index.html | 763 ++++++++++++++++ docs/guides/cmd/create/index.xml | 17 + docs/guides/cmd/edit/index.html | 763 ++++++++++++++++ docs/guides/cmd/edit/index.xml | 17 + docs/guides/cmd/fn/index.html | 763 ++++++++++++++++ docs/guides/cmd/fn/index.xml | 17 + docs/guides/cmd/help/index.html | 797 +++++++++++++++++ docs/guides/cmd/help/index.xml | 17 + docs/guides/cmd/index.html | 816 ++++++++++++++++++ docs/guides/cmd/index.xml | 173 ++++ docs/guides/cmd/install-completion/index.html | 763 ++++++++++++++++ docs/guides/cmd/install-completion/index.xml | 17 + docs/guides/cmd/live/index.html | 763 ++++++++++++++++ docs/guides/cmd/live/index.xml | 17 + docs/guides/cmd/version/index.html | 768 +++++++++++++++++ docs/guides/cmd/version/index.xml | 17 + docs/guides/components/index.html | 298 ++++++- docs/guides/index.html | 278 +++++- docs/guides/offtheshelf/index.html | 264 +++++- docs/guides/plugins/builtins/index.html | 339 +++++++- .../execpluginguidedexample/index.html | 248 +++++- .../guides/plugins/goplugincaveats/index.html | 248 +++++- .../plugins/gopluginguidedexample/index.html | 248 +++++- docs/guides/plugins/index.html | 280 +++++- docs/guides/plugins/index.xml | 95 +- docs/index.html | 9 +- docs/index.json | 9 +- docs/index.xml | 68 +- docs/installation/binaries/index.html | 14 +- docs/installation/chocolatey/index.html | 14 +- docs/installation/homebrew/index.html | 14 +- docs/installation/index.html | 14 +- docs/installation/source/index.html | 14 +- ...92923ad85f8bcab133e53e7ec8af9ce8dd2ca5.css | 7 + docs/search/index.html | 9 +- docs/sitemap.xml | 30 +- docs/zh/api-reference/glossary/index.html | 9 +- docs/zh/api-reference/index.html | 9 +- .../kustomization/bases/index.html | 9 +- .../commonannotations/index.html | 35 +- .../kustomization/commonlabels/index.html | 89 +- .../kustomization/components/index.html | 9 +- .../configmapgenerator/index.html | 49 +- .../kustomization/crds/index.html | 23 +- .../kustomization/generatoroptions/index.html | 17 +- .../kustomization/images/index.html | 49 +- .../zh/api-reference/kustomization/index.html | 9 +- docs/zh/api-reference/kustomization/index.xml | 488 +++++------ .../kustomization/nameprefix/index.html | 15 +- .../kustomization/namespace/index.html | 15 +- .../kustomization/namesuffix/index.html | 15 +- .../kustomization/patches/index.html | 95 +- .../kustomization/patchesjson6902/index.html | 69 +- .../patchesstrategicmerge/index.html | 49 +- .../kustomization/replicas/index.html | 19 +- .../kustomization/resources/index.html | 25 +- .../kustomization/secretegenerator/index.html | 39 +- .../kustomization/vars/index.html | 47 +- docs/zh/blog/2018/05/21/v1.0.1/index.html | 11 +- docs/zh/blog/2019/02/05/v2.0.0/index.html | 13 +- docs/zh/blog/2019/06/18/v2.1.0/index.html | 11 +- docs/zh/blog/2019/07/03/v3.0.0/index.html | 11 +- docs/zh/blog/2019/07/26/v3.1.0/index.html | 79 +- docs/zh/blog/2019/09/17/v3.2.0/index.html | 11 +- docs/zh/blog/2019/09/26/v3.2.1/index.html | 13 +- docs/zh/blog/2019/10/24/v3.3.0/index.html | 11 +- docs/zh/blog/index.html | 9 +- docs/zh/blog/index.xml | 68 +- docs/zh/blog/releases/index.html | 9 +- docs/zh/blog/releases/index.xml | 68 +- docs/zh/contributing/bugs/index.html | 9 +- docs/zh/contributing/community/index.html | 9 +- docs/zh/contributing/docs/index.html | 9 +- docs/zh/contributing/features/index.html | 9 +- docs/zh/contributing/howitworks/index.html | 9 +- docs/zh/contributing/index.html | 9 +- docs/zh/contributing/mac/index.html | 9 +- docs/zh/contributing/windows/index.html | 11 +- docs/zh/faq/eschewedfeatures/index.html | 9 +- docs/zh/faq/index.html | 15 +- docs/zh/faq/versioningpolicy/index.html | 9 +- docs/zh/guides/bespoke/index.html | 9 +- docs/zh/guides/index.html | 9 +- docs/zh/guides/offtheshelf/index.html | 9 +- docs/zh/guides/plugins/builtins/index.html | 361 ++++---- .../execpluginguidedexample/index.html | 13 +- .../guides/plugins/goplugincaveats/index.html | 9 +- .../plugins/gopluginguidedexample/index.html | 9 +- docs/zh/guides/plugins/index.html | 45 +- docs/zh/guides/plugins/index.xml | 354 ++++---- docs/zh/index.html | 9 +- docs/zh/index.json | 11 +- docs/zh/index.xml | 68 +- docs/zh/installation/binaries/index.html | 9 +- docs/zh/installation/chocolatey/index.html | 9 +- docs/zh/installation/homebrew/index.html | 9 +- docs/zh/installation/index.html | 9 +- docs/zh/installation/source/index.html | 9 +- docs/zh/search/index.html | 11 +- docs/zh/sitemap.xml | 6 +- ...s_4853eb546e7a6c0898ed71feae7357c0.content | 2 +- ...scss_4853eb546e7a6c0898ed71feae7357c0.json | 2 +- ...s_9fadf33d895a46083cdd64396b57ef68.content | 74 +- 154 files changed, 13057 insertions(+), 2414 deletions(-) create mode 100644 docs/guides/cmd/build/index.html create mode 100644 docs/guides/cmd/build/index.xml create mode 100644 docs/guides/cmd/cfg/index.html create mode 100644 docs/guides/cmd/cfg/index.xml create mode 100644 docs/guides/cmd/create/index.html create mode 100644 docs/guides/cmd/create/index.xml create mode 100644 docs/guides/cmd/edit/index.html create mode 100644 docs/guides/cmd/edit/index.xml create mode 100644 docs/guides/cmd/fn/index.html create mode 100644 docs/guides/cmd/fn/index.xml create mode 100644 docs/guides/cmd/help/index.html create mode 100644 docs/guides/cmd/help/index.xml create mode 100644 docs/guides/cmd/index.html create mode 100644 docs/guides/cmd/index.xml create mode 100644 docs/guides/cmd/install-completion/index.html create mode 100644 docs/guides/cmd/install-completion/index.xml create mode 100644 docs/guides/cmd/live/index.html create mode 100644 docs/guides/cmd/live/index.xml create mode 100644 docs/guides/cmd/version/index.html create mode 100644 docs/guides/cmd/version/index.xml create mode 100644 docs/scss/main.min.0084926537b5667d9dea1d1fd692923ad85f8bcab133e53e7ec8af9ce8dd2ca5.css diff --git a/docs/api-reference/glossary/index.html b/docs/api-reference/glossary/index.html index 20b312b8a..861eeedb1 100644 --- a/docs/api-reference/glossary/index.html +++ b/docs/api-reference/glossary/index.html @@ -3,7 +3,7 @@ - + @@ -29,7 +29,8 @@ +"> + @@ -38,8 +39,8 @@ - - + + + + + + + + build | Kustomize + + +
    + + + +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +

    build

    +
    Print configuration per contents of kustomization.yaml
    + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + © 2020 Kubernetes Authors All Rights Reserved + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/guides/cmd/build/index.xml b/docs/guides/cmd/build/index.xml new file mode 100644 index 000000000..a3e86ad84 --- /dev/null +++ b/docs/guides/cmd/build/index.xml @@ -0,0 +1,17 @@ + + + Kustomize – build + https://kubernetes-sigs.github.io/kustomize/guides/cmd/build/ + Recent content in build on Kustomize + Hugo -- gohugo.io + + + + + + + + + + + diff --git a/docs/guides/cmd/cfg/index.html b/docs/guides/cmd/cfg/index.html new file mode 100644 index 000000000..7e237940c --- /dev/null +++ b/docs/guides/cmd/cfg/index.html @@ -0,0 +1,763 @@ + + + + + + + + + + + + + + + + + + + + + + + +cfg | Kustomize + + + + + + + + + + + + + + + + + + + + + + + + + cfg | Kustomize + + +
    + + + +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +

    cfg

    +
    Commands for reading and writing configuration.
    + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + © 2020 Kubernetes Authors All Rights Reserved + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/guides/cmd/cfg/index.xml b/docs/guides/cmd/cfg/index.xml new file mode 100644 index 000000000..0edbcd279 --- /dev/null +++ b/docs/guides/cmd/cfg/index.xml @@ -0,0 +1,17 @@ + + + Kustomize – cfg + https://kubernetes-sigs.github.io/kustomize/guides/cmd/cfg/ + Recent content in cfg on Kustomize + Hugo -- gohugo.io + + + + + + + + + + + diff --git a/docs/guides/cmd/create/index.html b/docs/guides/cmd/create/index.html new file mode 100644 index 000000000..de38afd3f --- /dev/null +++ b/docs/guides/cmd/create/index.html @@ -0,0 +1,763 @@ + + + + + + + + + + + + + + + + + + + + + + + +create | Kustomize + + + + + + + + + + + + + + + + + + + + + + + + + create | Kustomize + + +
    + + + +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +

    create

    +
    Create a new kustomization in the current directory
    + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + © 2020 Kubernetes Authors All Rights Reserved + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/guides/cmd/create/index.xml b/docs/guides/cmd/create/index.xml new file mode 100644 index 000000000..9988f60e2 --- /dev/null +++ b/docs/guides/cmd/create/index.xml @@ -0,0 +1,17 @@ + + + Kustomize – create + https://kubernetes-sigs.github.io/kustomize/guides/cmd/create/ + Recent content in create on Kustomize + Hugo -- gohugo.io + + + + + + + + + + + diff --git a/docs/guides/cmd/edit/index.html b/docs/guides/cmd/edit/index.html new file mode 100644 index 000000000..aa28ee8dc --- /dev/null +++ b/docs/guides/cmd/edit/index.html @@ -0,0 +1,763 @@ + + + + + + + + + + + + + + + + + + + + + + + +edit | Kustomize + + + + + + + + + + + + + + + + + + + + + + + + + edit | Kustomize + + +
    + + + +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +

    edit

    +
    Edits a kustomization file
    + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + © 2020 Kubernetes Authors All Rights Reserved + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/guides/cmd/edit/index.xml b/docs/guides/cmd/edit/index.xml new file mode 100644 index 000000000..56339c930 --- /dev/null +++ b/docs/guides/cmd/edit/index.xml @@ -0,0 +1,17 @@ + + + Kustomize – edit + https://kubernetes-sigs.github.io/kustomize/guides/cmd/edit/ + Recent content in edit on Kustomize + Hugo -- gohugo.io + + + + + + + + + + + diff --git a/docs/guides/cmd/fn/index.html b/docs/guides/cmd/fn/index.html new file mode 100644 index 000000000..6de9910af --- /dev/null +++ b/docs/guides/cmd/fn/index.html @@ -0,0 +1,763 @@ + + + + + + + + + + + + + + + + + + + + + + + +fn | Kustomize + + + + + + + + + + + + + + + + + + + + + + + + + fn | Kustomize + + +
    + + + +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +

    fn

    +
    Commands for running functions against configuration
    + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + © 2020 Kubernetes Authors All Rights Reserved + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/guides/cmd/fn/index.xml b/docs/guides/cmd/fn/index.xml new file mode 100644 index 000000000..c841063e9 --- /dev/null +++ b/docs/guides/cmd/fn/index.xml @@ -0,0 +1,17 @@ + + + Kustomize – fn + https://kubernetes-sigs.github.io/kustomize/guides/cmd/fn/ + Recent content in fn on Kustomize + Hugo -- gohugo.io + + + + + + + + + + + diff --git a/docs/guides/cmd/help/index.html b/docs/guides/cmd/help/index.html new file mode 100644 index 000000000..9e5a3f185 --- /dev/null +++ b/docs/guides/cmd/help/index.html @@ -0,0 +1,797 @@ + + + + + + + + + + + + + + + + + + + + + + + +help | Kustomize + + + + + + + + + + + + + + + + + + + + + + + + + help | Kustomize + + +
    + + + +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +

    help

    +
    Help about any command
    +
    +
    kustomize help
    +
    +Manages declarative configuration of Kubernetes.
    +See https://sigs.k8s.io/kustomize
    +
    +Usage:
    +  kustomize [command]
    +
    +Available Commands:
    +  build                     Print configuration per contents of kustomization.yaml
    +  cfg                       Commands for reading and writing configuration.
    +  create                    Create a new kustomization in the current directory
    +  edit                      Edits a kustomization file
    +  fn                        Commands for running functions against configuration.
    +  help                      Help about any command
    +  install-completion        Install shell completion.
    +  live                      Commands for reading and writing resources to a cluster.
    +  version                   Prints the kustomize version
    +
    +Flags:
    +  -h, --help          help for kustomize
    +      --stack-trace   print a stack-trace on error
    +
    +Additional help topics:
    +  kustomize docs-fn                   [Alpha] Documentation for developing and invoking Configuration Functions.
    +  kustomize docs-fn-spec              [Alpha] Documentation for Configuration Functions Specification.
    +  kustomize docs-io-annotations       [Alpha] Documentation for annotations used by io.
    +  kustomize docs-merge                [Alpha] Documentation for merging Resources (2-way merge).
    +  kustomize docs-merge3               [Alpha] Documentation for merging Resources (3-way merge).
    +  kustomize tutorials-command-basics  [Alpha] Tutorials for using basic config commands.
    +  kustomize tutorials-function-basics [Alpha] Tutorials for using functions.
    +
    +Use "kustomize [command] --help" for more information about a command.
    + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + © 2020 Kubernetes Authors All Rights Reserved + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/guides/cmd/help/index.xml b/docs/guides/cmd/help/index.xml new file mode 100644 index 000000000..71fe051e0 --- /dev/null +++ b/docs/guides/cmd/help/index.xml @@ -0,0 +1,17 @@ + + + Kustomize – help + https://kubernetes-sigs.github.io/kustomize/guides/cmd/help/ + Recent content in help on Kustomize + Hugo -- gohugo.io + + + + + + + + + + + diff --git a/docs/guides/cmd/index.html b/docs/guides/cmd/index.html new file mode 100644 index 000000000..03462dea4 --- /dev/null +++ b/docs/guides/cmd/index.html @@ -0,0 +1,816 @@ + + + + + + + + + + + + + + + + + + + + + + + +Command Line Options | Kustomize + + + + + + + + + + + + + + + + + + + + + + + + + Command Line Options | Kustomize + + +
    + + + +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +

    Command Line Options

    +
    Usage of command line options
    + +
    + + + + +
    + + + + + + + + + + +
    +
    + build +
    +

    Print configuration per contents of kustomization.yaml

    +
    + + + + + +
    +
    + cfg +
    +

    Commands for reading and writing configuration.

    +
    + + + + + +
    +
    + create +
    +

    Create a new kustomization in the current directory

    +
    + + + +
    +
    + edit +
    +

    Edits a kustomization file

    +
    + + + + + +
    +
    + fn +
    +

    Commands for running functions against configuration

    +
    + + + + + + + +
    +
    + help +
    +

    Help about any command

    +
    + + + +
    +
    + install-completion +
    +

    Installs shell completion

    +
    + + + + + +
    +
    + live +
    +

    Commands for reading and writing resources to a cluster.

    +
    + + + +
    +
    + version +
    +

    Prints the kustomize version

    +
    + + + +
    + + + + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + © 2020 Kubernetes Authors All Rights Reserved + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/guides/cmd/index.xml b/docs/guides/cmd/index.xml new file mode 100644 index 000000000..32cd1301e --- /dev/null +++ b/docs/guides/cmd/index.xml @@ -0,0 +1,173 @@ + + + Kustomize – Command Line Options + https://kubernetes-sigs.github.io/kustomize/guides/cmd/ + Recent content in Command Line Options on Kustomize + Hugo -- gohugo.io + + + + + + + + + + + Guides: build + https://kubernetes-sigs.github.io/kustomize/guides/cmd/build/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://kubernetes-sigs.github.io/kustomize/guides/cmd/build/ + + + + + + + + + Guides: cfg + https://kubernetes-sigs.github.io/kustomize/guides/cmd/cfg/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://kubernetes-sigs.github.io/kustomize/guides/cmd/cfg/ + + + + + + + + + Guides: create + https://kubernetes-sigs.github.io/kustomize/guides/cmd/create/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://kubernetes-sigs.github.io/kustomize/guides/cmd/create/ + + + + + + + + + Guides: edit + https://kubernetes-sigs.github.io/kustomize/guides/cmd/edit/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://kubernetes-sigs.github.io/kustomize/guides/cmd/edit/ + + + + + + + + + Guides: fn + https://kubernetes-sigs.github.io/kustomize/guides/cmd/fn/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://kubernetes-sigs.github.io/kustomize/guides/cmd/fn/ + + + + + + + + + Guides: help + https://kubernetes-sigs.github.io/kustomize/guides/cmd/help/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://kubernetes-sigs.github.io/kustomize/guides/cmd/help/ + + + + <blockquote> +<pre><code>kustomize help + +Manages declarative configuration of Kubernetes. +See https://sigs.k8s.io/kustomize + +Usage: + kustomize [command] + +Available Commands: + build Print configuration per contents of kustomization.yaml + cfg Commands for reading and writing configuration. + create Create a new kustomization in the current directory + edit Edits a kustomization file + fn Commands for running functions against configuration. + help Help about any command + install-completion Install shell completion. + live Commands for reading and writing resources to a cluster. + version Prints the kustomize version + +Flags: + -h, --help help for kustomize + --stack-trace print a stack-trace on error + +Additional help topics: + kustomize docs-fn [Alpha] Documentation for developing and invoking Configuration Functions. + kustomize docs-fn-spec [Alpha] Documentation for Configuration Functions Specification. + kustomize docs-io-annotations [Alpha] Documentation for annotations used by io. + kustomize docs-merge [Alpha] Documentation for merging Resources (2-way merge). + kustomize docs-merge3 [Alpha] Documentation for merging Resources (3-way merge). + kustomize tutorials-command-basics [Alpha] Tutorials for using basic config commands. + kustomize tutorials-function-basics [Alpha] Tutorials for using functions. + +Use &quot;kustomize [command] --help&quot; for more information about a command.</code></pre></blockquote> + + + + + + Guides: install-completion + https://kubernetes-sigs.github.io/kustomize/guides/cmd/install-completion/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://kubernetes-sigs.github.io/kustomize/guides/cmd/install-completion/ + + + + + + + + + Guides: live + https://kubernetes-sigs.github.io/kustomize/guides/cmd/live/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://kubernetes-sigs.github.io/kustomize/guides/cmd/live/ + + + + + + + + + Guides: version + https://kubernetes-sigs.github.io/kustomize/guides/cmd/version/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://kubernetes-sigs.github.io/kustomize/guides/cmd/version/ + + + + <p>Prints the current kustomize version</p> +<blockquote> +<pre><code>kustomize version +{Version:kustomize/v3.8.1 GitCommit:0b359d0ef0272e6545eda0e99aacd63aef99c4d0 BuildDate:2020-07-16T00:58:46Z GoOs:linux GoArch:amd64} +</code></pre></blockquote> + + + + + + diff --git a/docs/guides/cmd/install-completion/index.html b/docs/guides/cmd/install-completion/index.html new file mode 100644 index 000000000..ae3cd9aec --- /dev/null +++ b/docs/guides/cmd/install-completion/index.html @@ -0,0 +1,763 @@ + + + + + + + + + + + + + + + + + + + + + + + +install-completion | Kustomize + + + + + + + + + + + + + + + + + + + + + + + + + install-completion | Kustomize + + +
    + + + +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +

    install-completion

    +
    Installs shell completion
    + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + © 2020 Kubernetes Authors All Rights Reserved + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/guides/cmd/install-completion/index.xml b/docs/guides/cmd/install-completion/index.xml new file mode 100644 index 000000000..3e22040e2 --- /dev/null +++ b/docs/guides/cmd/install-completion/index.xml @@ -0,0 +1,17 @@ + + + Kustomize – install-completion + https://kubernetes-sigs.github.io/kustomize/guides/cmd/install-completion/ + Recent content in install-completion on Kustomize + Hugo -- gohugo.io + + + + + + + + + + + diff --git a/docs/guides/cmd/live/index.html b/docs/guides/cmd/live/index.html new file mode 100644 index 000000000..6d0454579 --- /dev/null +++ b/docs/guides/cmd/live/index.html @@ -0,0 +1,763 @@ + + + + + + + + + + + + + + + + + + + + + + + +live | Kustomize + + + + + + + + + + + + + + + + + + + + + + + + + live | Kustomize + + +
    + + + +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +

    live

    +
    Commands for reading and writing resources to a cluster.
    + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + © 2020 Kubernetes Authors All Rights Reserved + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/guides/cmd/live/index.xml b/docs/guides/cmd/live/index.xml new file mode 100644 index 000000000..28d554ea4 --- /dev/null +++ b/docs/guides/cmd/live/index.xml @@ -0,0 +1,17 @@ + + + Kustomize – live + https://kubernetes-sigs.github.io/kustomize/guides/cmd/live/ + Recent content in live on Kustomize + Hugo -- gohugo.io + + + + + + + + + + + diff --git a/docs/guides/cmd/version/index.html b/docs/guides/cmd/version/index.html new file mode 100644 index 000000000..98e42875c --- /dev/null +++ b/docs/guides/cmd/version/index.html @@ -0,0 +1,768 @@ + + + + + + + + + + + + + + + + + + + + + + + +version | Kustomize + + + + + + + + + + + + + + + + + + + + + + + + + version | Kustomize + + +
    + + + +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +

    version

    +
    Prints the kustomize version
    +

    Prints the current kustomize version

    +
    +
    kustomize version
    +{Version:kustomize/v3.8.1 GitCommit:0b359d0ef0272e6545eda0e99aacd63aef99c4d0 BuildDate:2020-07-16T00:58:46Z GoOs:linux GoArch:amd64}
    +
    + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + © 2020 Kubernetes Authors All Rights Reserved + + + + +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/guides/cmd/version/index.xml b/docs/guides/cmd/version/index.xml new file mode 100644 index 000000000..3ef5b7b91 --- /dev/null +++ b/docs/guides/cmd/version/index.xml @@ -0,0 +1,17 @@ + + + Kustomize – version + https://kubernetes-sigs.github.io/kustomize/guides/cmd/version/ + Recent content in version on Kustomize + Hugo -- gohugo.io + + + + + + + + + + + diff --git a/docs/guides/components/index.html b/docs/guides/components/index.html index d246f2501..4ec79f581 100644 --- a/docs/guides/components/index.html +++ b/docs/guides/components/index.html @@ -3,7 +3,7 @@ - + @@ -29,7 +29,8 @@ +"> + @@ -38,8 +39,8 @@ - - + +