├── .dockerignore ├── .gitignore ├── OWNERS ├── Dockerfile ├── pkg ├── discovery │ ├── doc.go │ ├── interfaces.go │ ├── apiserver.go │ ├── local.go │ └── local_discovery.go └── utils │ ├── utils.go │ └── utils_test.go ├── .lighthouse ├── triggers.yaml ├── pullrequest.yaml └── release.yaml ├── api-versions.txt ├── Makefile ├── go.mod ├── cmd └── kfmt │ ├── main.go │ ├── options_test.go │ └── options.go ├── hack └── discovery-gen.go ├── api-resources.txt ├── README.md ├── LICENSE └── go.sum /.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !/bin/kfmt 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | 3 | /k8s.io 4 | /bin 5 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - dippynark 3 | reviewers: 4 | - dippynark 5 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | 3 | COPY bin/kfmt /kfmt 4 | 5 | ENTRYPOINT ["/kfmt"] 6 | -------------------------------------------------------------------------------- /pkg/discovery/doc.go: -------------------------------------------------------------------------------- 1 | // package discovery implements a way to retrieve discovery information from 2 | // Kubernetes to determine whether resources are namespace or cluster scoped. 3 | package discovery 4 | -------------------------------------------------------------------------------- /.lighthouse/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: pr 6 | always_run: true 7 | source: pullrequest.yaml 8 | postsubmits: 9 | - name: release 10 | source: release.yaml 11 | branches: 12 | - main 13 | - ^v\d+\.\d+\.\d+$ 14 | -------------------------------------------------------------------------------- /pkg/discovery/interfaces.go: -------------------------------------------------------------------------------- 1 | package discovery 2 | 3 | import ( 4 | "k8s.io/apimachinery/pkg/runtime/schema" 5 | ) 6 | 7 | type ResourceInspector interface { 8 | // IsNamespaced returns true if the given GroupVersionKind is for a 9 | // namespace-scoped object. 10 | IsNamespaced(schema.GroupVersionKind) (bool, error) 11 | // AddGVKToScope adds GVK scope mapping to discovery 12 | AddGVKToScope(schema.GroupVersionKind, bool) 13 | // IsCoreGroup returns true if group is core 14 | IsCoreGroup(string) bool 15 | } 16 | -------------------------------------------------------------------------------- /api-versions.txt: -------------------------------------------------------------------------------- 1 | admissionregistration.k8s.io/v1 2 | admissionregistration.k8s.io/v1beta1 3 | apiextensions.k8s.io/v1 4 | apiextensions.k8s.io/v1beta1 5 | apiregistration.k8s.io/v1 6 | apiregistration.k8s.io/v1beta1 7 | apps/v1 8 | authentication.k8s.io/v1 9 | authentication.k8s.io/v1beta1 10 | authorization.k8s.io/v1 11 | authorization.k8s.io/v1beta1 12 | autoscaling/v1 13 | autoscaling/v2beta1 14 | autoscaling/v2beta2 15 | batch/v1 16 | batch/v1beta1 17 | certificates.k8s.io/v1 18 | certificates.k8s.io/v1beta1 19 | coordination.k8s.io/v1 20 | coordination.k8s.io/v1beta1 21 | discovery.k8s.io/v1beta1 22 | events.k8s.io/v1 23 | events.k8s.io/v1beta1 24 | extensions/v1beta1 25 | networking.k8s.io/v1 26 | networking.k8s.io/v1beta1 27 | node.k8s.io/v1beta1 28 | policy/v1beta1 29 | rbac.authorization.k8s.io/v1 30 | rbac.authorization.k8s.io/v1beta1 31 | scheduling.k8s.io/v1 32 | scheduling.k8s.io/v1beta1 33 | storage.k8s.io/v1 34 | storage.k8s.io/v1beta1 35 | v1 36 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | KFMT = ./cmd/kfmt 2 | 3 | BIN_DIR = bin 4 | K8S_DIR = k8s.io 5 | 6 | VERSION = $(shell git describe --tags) 7 | BUILD_FLAGS = -tags netgo -ldflags "-X main.version=$(VERSION)" 8 | DOCKER_BUILD_IMAGE = dippynark/kfmt:$(VERSION) 9 | 10 | generate: 11 | mkdir -p $(K8S_DIR) 12 | ls $(K8S_DIR)/api || git clone https://github.com/kubernetes/api $(K8S_DIR)/api 13 | ls $(K8S_DIR)/kube-aggregator || git clone https://github.com/kubernetes/kube-aggregator $(K8S_DIR)/kube-aggregator 14 | ls $(K8S_DIR)/apiextensions-apiserver || git clone https://github.com/kubernetes/apiextensions-apiserver $(K8S_DIR)/apiextensions-apiserver 15 | go run hack/discovery-gen.go -- $(K8S_DIR) pkg/discovery/local_discovery.go 16 | go fmt pkg/discovery/local_discovery.go 17 | 18 | test: 19 | # https://github.com/golang/go/issues/28065#issuecomment-725632025 20 | CGO_ENABLED=0 go test -v ./... 21 | 22 | build: 23 | CGO_ENABLED=0 go build -o $(BIN_DIR)/kfmt $(BUILD_FLAGS) $(KFMT) 24 | 25 | install: 26 | CGO_ENABLED=0 go install $(BUILD_FLAGS) $(KFMT) 27 | 28 | release: 29 | CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BIN_DIR)/kfmt-linux-amd64 $(BUILD_FLAGS) $(KFMT) 30 | CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o $(BIN_DIR)/kfmt-darwin-amd64 $(BUILD_FLAGS) $(KFMT) 31 | CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o $(BIN_DIR)/kfmt-darwin-arm64 $(BUILD_FLAGS) $(KFMT) 32 | CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o $(BIN_DIR)/kfmt-windows-amd64.exe $(BUILD_FLAGS) $(KFMT) 33 | cd $(BIN_DIR) && sha256sum kfmt-linux-amd64 kfmt-darwin-amd64 kfmt-darwin-arm64 kfmt-windows-amd64.exe > checksums.txt 34 | 35 | docker_build_push: 36 | docker buildx build \ 37 | -t $(DOCKER_BUILD_IMAGE) \ 38 | --build-arg=VERSION=$(VERSION) \ 39 | --platform linux/amd64,linux/arm64 \ 40 | --push \ 41 | . 42 | -------------------------------------------------------------------------------- /.lighthouse/pullrequest.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: pullrequest 5 | spec: 6 | serviceAccountName: tekton-bot 7 | pipelineSpec: 8 | params: 9 | - name: REPO_URL 10 | type: string 11 | - name: PULL_NUMBER 12 | type: string 13 | tasks: 14 | - name: git-clone-test 15 | params: 16 | - name: REPO_URL 17 | value: $(params.REPO_URL) 18 | - name: PULL_NUMBER 19 | value: $(params.PULL_NUMBER) 20 | taskSpec: 21 | params: 22 | - name: REPO_URL 23 | type: string 24 | - name: PULL_NUMBER 25 | type: string 26 | steps: 27 | - name: git-clone 28 | image: alpine/git:v2.34.2 29 | command: 30 | - /bin/sh 31 | args: 32 | - -ce 33 | - | 34 | git clone $(inputs.params.REPO_URL) . 35 | git config --unset-all remote.origin.fetch 36 | # https://gist.github.com/piscisaureus/3342247 37 | git config --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*' 38 | git fetch origin 39 | git merge origin/pr/$(inputs.params.PULL_NUMBER) 40 | workingDir: /workspace 41 | - name: test 42 | image: golang:1.18-alpine 43 | command: 44 | - /bin/sh 45 | args: 46 | - -ce 47 | - | 48 | apk add --update make 49 | make test 50 | workingDir: /workspace 51 | volumeMounts: 52 | - name: go-pkg-mod 53 | mountPath: /go/pkg/mod 54 | volumes: 55 | - name: workspace 56 | emptyDir: {} 57 | - name: go-pkg-mod 58 | hostPath: 59 | path: /mnt/ssd/data/go/pkg/mod 60 | -------------------------------------------------------------------------------- /pkg/discovery/apiserver.go: -------------------------------------------------------------------------------- 1 | package discovery 2 | 3 | import ( 4 | "fmt" 5 | 6 | "k8s.io/apimachinery/pkg/api/meta" 7 | "k8s.io/apimachinery/pkg/runtime/schema" 8 | kdiscov "k8s.io/client-go/discovery" 9 | "k8s.io/client-go/discovery/cached/memory" 10 | "k8s.io/client-go/rest" 11 | "k8s.io/client-go/restmapper" 12 | ) 13 | 14 | // APIServerResourceInspector implements ResourceInspector using the Kubernetes 15 | // discovery API. 16 | // It relies on a Kubernetes apiserver that has discovery information for all 17 | // inputted resource types. 18 | type APIServerResourceInspector struct { 19 | localResourceInspector *LocalResourceInspector 20 | mapper *restmapper.DeferredDiscoveryRESTMapper 21 | } 22 | 23 | func NewAPIServerResourceInspector(cfg *rest.Config) (*APIServerResourceInspector, error) { 24 | cl, err := kdiscov.NewDiscoveryClientForConfig(cfg) 25 | if err != nil { 26 | return nil, err 27 | } 28 | 29 | mapper := restmapper.NewDeferredDiscoveryRESTMapper(memory.NewMemCacheClient(cl)) 30 | localResourceInspector, err := NewLocalResourceInspector() 31 | if err != nil { 32 | return nil, err 33 | } 34 | 35 | return &APIServerResourceInspector{ 36 | mapper: mapper, 37 | localResourceInspector: localResourceInspector, 38 | }, nil 39 | } 40 | 41 | func (a *APIServerResourceInspector) IsNamespaced(gvk schema.GroupVersionKind) (bool, error) { 42 | // First check local discovery... 43 | namespaced, err := a.localResourceInspector.IsNamespaced(gvk) 44 | // Ignore error if local discovery is unsuccessful 45 | // TODO: use multi-error struct 46 | if err == nil { 47 | return namespaced, nil 48 | } 49 | 50 | // ...now check API Server discovery 51 | mapping, err := a.mapper.RESTMapping(gvk.GroupKind(), gvk.Version) 52 | if err != nil { 53 | return false, fmt.Errorf("could not find REST mapping for resource %v: %w", gvk.String(), err) 54 | } 55 | 56 | return mapping.Scope.Name() == meta.RESTScopeNameNamespace, nil 57 | } 58 | 59 | func (a *APIServerResourceInspector) IsCoreGroup(group string) bool { 60 | return a.localResourceInspector.IsCoreGroup(group) 61 | } 62 | 63 | func (a *APIServerResourceInspector) AddGVKToScope(gvk schema.GroupVersionKind, namespaced bool) { 64 | a.localResourceInspector.AddGVKToScope(gvk, namespaced) 65 | } 66 | 67 | var _ ResourceInspector = &APIServerResourceInspector{} 68 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/dippynark/kfmt 2 | 3 | go 1.15 4 | 5 | //https://github.com/kubernetes/kubernetes/issues/79384#issuecomment-505627280 6 | replace ( 7 | k8s.io/api => k8s.io/api v0.20.2 8 | k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.20.2 9 | k8s.io/apimachinery => k8s.io/apimachinery v0.20.2 10 | k8s.io/apiserver => k8s.io/apiserver v0.20.2 11 | k8s.io/cli-runtime => k8s.io/cli-runtime v0.20.2 12 | k8s.io/client-go => k8s.io/client-go v0.20.2 13 | k8s.io/cloud-provider => k8s.io/cloud-provider v0.20.2 14 | k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.20.2 15 | k8s.io/code-generator => k8s.io/code-generator v0.20.2 16 | k8s.io/component-base => k8s.io/component-base v0.20.2 17 | k8s.io/component-helpers => k8s.io/component-helpers v0.20.2 18 | k8s.io/controller-manager => k8s.io/controller-manager v0.20.2 19 | k8s.io/cri-api => k8s.io/cri-api v0.20.2 20 | k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.20.2 21 | k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.20.2 22 | k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.20.2 23 | k8s.io/kube-proxy => k8s.io/kube-proxy v0.20.2 24 | k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.20.2 25 | k8s.io/kubectl => k8s.io/kubectl v0.20.2 26 | k8s.io/kubelet => k8s.io/kubelet v0.20.2 27 | k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.20.2 28 | k8s.io/metrics => k8s.io/metrics v0.20.2 29 | k8s.io/mount-utils => k8s.io/mount-utils v0.20.2 30 | k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.20.2 31 | ) 32 | 33 | require ( 34 | github.com/Azure/go-autorest/autorest v0.11.17 // indirect 35 | github.com/Azure/go-autorest/autorest/adal v0.9.10 // indirect 36 | github.com/go-logr/logr v0.2.1 // indirect 37 | github.com/go-openapi/spec v0.19.7 // indirect 38 | github.com/gogo/protobuf v1.3.2 // indirect 39 | github.com/googleapis/gnostic v0.4.2 // indirect 40 | github.com/imdario/mergo v0.3.11 // indirect 41 | github.com/kr/text v0.2.0 // indirect 42 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect 43 | github.com/pkg/errors v0.9.1 44 | github.com/spf13/afero v1.2.2 45 | github.com/spf13/cobra v1.1.1 46 | github.com/stretchr/testify v1.6.1 47 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect 48 | golang.org/x/text v0.3.5 // indirect 49 | google.golang.org/appengine v1.6.7 // indirect 50 | gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect 51 | gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect 52 | k8s.io/api v0.20.2 53 | k8s.io/apiextensions-apiserver v0.20.4 54 | k8s.io/apimachinery v0.20.2 55 | k8s.io/client-go v0.20.2 56 | sigs.k8s.io/kustomize/kyaml v0.10.6 57 | ) 58 | -------------------------------------------------------------------------------- /cmd/kfmt/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path/filepath" 7 | 8 | "github.com/spf13/afero" 9 | "github.com/spf13/cobra" 10 | corev1 "k8s.io/api/core/v1" 11 | _ "k8s.io/client-go/plugin/pkg/client/auth" 12 | "k8s.io/client-go/util/homedir" 13 | ) 14 | 15 | // Set to `git describe --tags` 16 | var version = "v0.0.0" 17 | 18 | const ( 19 | // Namespaces to copy resource into 20 | annotationNamespacesKey = "kfmt.dev/namespaces" 21 | annotationNamespacesAll = "*" 22 | 23 | kubeconfigEnvVar = "KUBECONFIG" 24 | 25 | manifestSeparator = "---\n" 26 | 27 | nonNamespacedDirectory = "cluster" 28 | namespacedDirectory = "namespaces" 29 | 30 | defaultFilePerms = 0644 31 | defaultDirectoryPerms = 0755 32 | ) 33 | 34 | func main() { 35 | o := &options{} 36 | 37 | cmd := &cobra.Command{ 38 | Use: "kfmt", 39 | Short: "kfmt organises Kubernetes manifests into a standard format.", 40 | RunE: func(cmd *cobra.Command, args []string) error { 41 | return o.run(afero.NewOsFs()) 42 | }, 43 | SilenceUsage: true, 44 | } 45 | 46 | cmd.Flags().BoolP("help", "h", false, "Print help text") 47 | cmd.Flags().BoolVarP(&o.version, "version", "v", false, "Print version") 48 | cmd.Flags().StringArrayVarP(&o.inputs, "input", "i", []string{}, fmt.Sprintf("Input files or directories containing manifests. If no input is specified %s will be used", os.Stdin.Name())) 49 | cmd.Flags().StringVarP(&o.output, "output", "o", "", "Output directory to write organised manifests") 50 | cmd.Flags().StringArrayVarP(&o.filters, "filter", "f", []string{}, "Filter Kind.group from output manifests (e.g. Deployment.apps or Secret)") 51 | cmd.Flags().StringArrayVarP(&o.gvkScopes, "gvk-scope", "g", []string{}, "Add GVK scope mapping Kind.group/version:Cluster or Kind.group/version:Namespaced to discovery") 52 | cmd.Flags().StringVarP(&o.namespace, "namespace", "n", corev1.NamespaceDefault, "Set metadata.namespace field if missing from namespaced resources") 53 | cmd.Flags().BoolVar(&o.clean, "clean", false, "Remove metadata.namespace field from non-namespaced resources") 54 | cmd.Flags().BoolVar(&o.strict, "strict", false, "Require metadata.namespace field is not set for non-namespaced resources") 55 | cmd.Flags().BoolVar(&o.remove, "remove", false, "Remove processed input files") 56 | cmd.Flags().BoolVar(&o.comment, "comment", false, "Comment each output file with the path of the corresponding input file") 57 | cmd.Flags().BoolVar(&o.overwrite, "overwrite", false, "Overwrite existing output files") 58 | cmd.Flags().BoolVar(&o.createMissingNamespaces, "create-missing-namespaces", false, "Create missing Namespace manifests") 59 | cmd.Flags().BoolVarP(&o.discovery, "discovery", "d", false, "Use API Server for discovery") 60 | // https://github.com/kubernetes/client-go/blob/b72204b2445de5ac815ae2bb993f6182d271fdb4/examples/out-of-cluster-client-configuration/main.go#L45-L49 61 | if kubeconfigEnvVarValue := os.Getenv(kubeconfigEnvVar); kubeconfigEnvVarValue != "" { 62 | cmd.Flags().StringVarP(&o.kubeconfig, "kubeconfig", "k", kubeconfigEnvVarValue, "Path to the kubeconfig file used for discovery") 63 | } else if home := homedir.HomeDir(); home != "" { 64 | cmd.Flags().StringVarP(&o.kubeconfig, "kubeconfig", "k", filepath.Join(home, ".kube", "config"), "Path to the kubeconfig file used for discovery") 65 | } else { 66 | cmd.Flags().StringVarP(&o.kubeconfig, "kubeconfig", "k", "", "Path to the kubeconfig file used for discovery") 67 | } 68 | 69 | if err := cmd.Execute(); err != nil { 70 | if err != nil { 71 | os.Exit(1) 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /pkg/discovery/local.go: -------------------------------------------------------------------------------- 1 | package discovery 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "os" 7 | "strconv" 8 | "strings" 9 | 10 | "k8s.io/apimachinery/pkg/runtime/schema" 11 | ) 12 | 13 | // LocalResourceInspector implements ResourceInspector using local manifests 14 | type LocalResourceInspector struct { 15 | gvkToScope map[schema.GroupVersionKind]bool 16 | } 17 | 18 | func NewLocalResourceInspector() (*LocalResourceInspector, error) { 19 | cachedGVKToScope, err := parseCachedAPIResources() 20 | if err != nil { 21 | return nil, err 22 | } 23 | 24 | gvkToScope := copyMap(coreGVKToScope) 25 | for k, v := range cachedGVKToScope { 26 | gvkToScope[k] = v 27 | } 28 | 29 | return &LocalResourceInspector{ 30 | gvkToScope: gvkToScope, 31 | }, nil 32 | } 33 | 34 | func (l *LocalResourceInspector) IsNamespaced(gvk schema.GroupVersionKind) (bool, error) { 35 | namespaced, ok := l.gvkToScope[gvk] 36 | if !ok { 37 | return false, fmt.Errorf("could not find REST mapping for resource %v", gvk.String()) 38 | } 39 | 40 | return namespaced, nil 41 | } 42 | 43 | func (l *LocalResourceInspector) IsCoreGroup(group string) bool { 44 | for gvk, _ := range coreGVKToScope { 45 | if group == gvk.Group { 46 | return true 47 | } 48 | } 49 | 50 | return false 51 | } 52 | 53 | func (l *LocalResourceInspector) AddGVKToScope(gvk schema.GroupVersionKind, namespaced bool) { 54 | l.gvkToScope[gvk] = namespaced 55 | } 56 | 57 | var _ ResourceInspector = &LocalResourceInspector{} 58 | 59 | func copyMap(m map[schema.GroupVersionKind]bool) map[schema.GroupVersionKind]bool { 60 | cp := make(map[schema.GroupVersionKind]bool) 61 | for k, v := range m { 62 | cp[k] = v 63 | } 64 | 65 | return cp 66 | } 67 | 68 | func parseCachedAPIResources() (map[schema.GroupVersionKind]bool, error) { 69 | cachedGVKToScope := map[schema.GroupVersionKind]bool{} 70 | 71 | // TODO: allow paths to be user-specified 72 | apiResourcesFile := "api-resources.txt" 73 | apiVersionsFile := "api-versions.txt" 74 | 75 | if _, err := os.Stat(apiResourcesFile); os.IsNotExist(err) { 76 | return cachedGVKToScope, nil 77 | } 78 | 79 | file, err := os.Open(apiResourcesFile) 80 | if err != nil { 81 | return cachedGVKToScope, err 82 | } 83 | defer file.Close() 84 | 85 | scanner := bufio.NewScanner(file) 86 | for scanner.Scan() { 87 | line := scanner.Text() 88 | 89 | words := strings.Fields(line) 90 | if len(words) == 0 { 91 | continue 92 | } 93 | if words[0] == "NAME" { 94 | continue 95 | } 96 | 97 | gv, err := schema.ParseGroupVersion(words[len(words)-3]) 98 | if err != nil { 99 | return cachedGVKToScope, err 100 | } 101 | namespaced, err := strconv.ParseBool(words[len(words)-2]) 102 | if err != nil { 103 | return cachedGVKToScope, err 104 | } 105 | kind := words[len(words)-1] 106 | 107 | gvk := schema.GroupVersionKind{ 108 | Group: gv.Group, 109 | Version: gv.Version, 110 | Kind: kind, 111 | } 112 | cachedGVKToScope[gvk] = namespaced 113 | } 114 | 115 | if _, err := os.Stat(apiVersionsFile); os.IsNotExist(err) { 116 | return cachedGVKToScope, nil 117 | } 118 | 119 | file, err = os.Open(apiVersionsFile) 120 | if err != nil { 121 | return cachedGVKToScope, err 122 | } 123 | defer file.Close() 124 | 125 | scanner = bufio.NewScanner(file) 126 | for scanner.Scan() { 127 | line := scanner.Text() 128 | 129 | gv, err := schema.ParseGroupVersion(line) 130 | if err != nil { 131 | return cachedGVKToScope, err 132 | } 133 | 134 | for gvk, namespaced := range cachedGVKToScope { 135 | if gvk.Group == gv.Group { 136 | newGVK := gvk 137 | newGVK.Version = gv.Version 138 | cachedGVKToScope[newGVK] = namespaced 139 | } 140 | } 141 | } 142 | 143 | return cachedGVKToScope, nil 144 | } 145 | -------------------------------------------------------------------------------- /hack/discovery-gen.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "os" 7 | "path/filepath" 8 | "sort" 9 | "strconv" 10 | "strings" 11 | 12 | "k8s.io/apimachinery/pkg/runtime/schema" 13 | ) 14 | 15 | func main() { 16 | 17 | // TODO: map from group/kind to namespaced (ignore version) 18 | // schema.GroupKind 19 | gvkToScope, err := parseGVKToScope() 20 | if err != nil { 21 | fmt.Print(err) 22 | os.Exit(1) 23 | } 24 | 25 | file, err := os.OpenFile(os.Args[len(os.Args)-1], os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755) 26 | if err != nil { 27 | os.Exit(1) 28 | } 29 | 30 | file.WriteString(fmt.Sprintf("package discovery\n\n")) 31 | file.WriteString(fmt.Sprintf("import \"k8s.io/apimachinery/pkg/runtime/schema\"\n\n")) 32 | file.WriteString(fmt.Sprintf("var coreGVKToScope = map[schema.GroupVersionKind]bool{\n")) 33 | 34 | var keys []schema.GroupVersionKind 35 | for k := range gvkToScope { 36 | keys = append(keys, k) 37 | } 38 | sort.Slice(keys[:], func(i, j int) bool { 39 | if keys[i].Group != keys[j].Group { 40 | return keys[i].Group < keys[j].Group 41 | } 42 | if keys[i].Version != keys[j].Version { 43 | return keys[i].Version < keys[j].Version 44 | } 45 | return keys[i].Kind < keys[j].Kind 46 | }) 47 | 48 | for _, k := range keys { 49 | file.WriteString(fmt.Sprintf(" {Group: \"%s\", Version: \"%s\", Kind: \"%s\"}: %s,\n", k.Group, k.Version, k.Kind, strconv.FormatBool(gvkToScope[k]))) 50 | } 51 | 52 | file.WriteString(fmt.Sprintf("}")) 53 | 54 | if err := file.Close(); err != nil { 55 | os.Exit(1) 56 | } 57 | } 58 | 59 | func extractGVKNamespacedMapping(typesFileName, group, version string) (map[schema.GroupVersionKind]bool, error) { 60 | gvkNamespaced := map[schema.GroupVersionKind]bool{} 61 | 62 | file, err := os.Open(typesFileName) 63 | if err != nil { 64 | return gvkNamespaced, err 65 | } 66 | defer file.Close() 67 | 68 | scanner := bufio.NewScanner(file) 69 | for scanner.Scan() { 70 | line := scanner.Text() 71 | // Find kind marker 72 | if line == "// +genclient" { 73 | gvk := schema.GroupVersionKind{ 74 | Group: group, 75 | Version: version, 76 | } 77 | // Determine whether type is Namespaced 78 | namespaced := true 79 | for scanner.Scan() { 80 | line := scanner.Text() 81 | // Break if line is not a comment 82 | if !strings.HasPrefix(line, "//") { 83 | break 84 | } 85 | if line == "// +genclient:nonNamespaced" { 86 | namespaced = false 87 | break 88 | } 89 | } 90 | // Extract kind 91 | for scanner.Scan() { 92 | line := scanner.Text() 93 | // Break if line is not a comment, whitespace or a type definition 94 | if !strings.HasPrefix(line, "//") && line != "" && !strings.HasPrefix(line, "type ") { 95 | break 96 | } 97 | if strings.HasPrefix(line, "type ") { 98 | gvk.Kind = strings.Split(line, " ")[1] 99 | } 100 | } 101 | if gvk.Kind == "" { 102 | return gvkNamespaced, fmt.Errorf("Unable to find kind: %s", typesFileName) 103 | } 104 | gvkNamespaced[gvk] = namespaced 105 | } 106 | } 107 | 108 | return gvkNamespaced, nil 109 | } 110 | 111 | func extractSubstring(registerFileName, prefix, suffix string) (string, error) { 112 | file, err := os.Open(registerFileName) 113 | if err != nil { 114 | return "", err 115 | } 116 | defer file.Close() 117 | 118 | scanner := bufio.NewScanner(file) 119 | for scanner.Scan() { 120 | line := scanner.Text() 121 | if strings.HasPrefix(line, prefix) && strings.HasSuffix(line, suffix) { 122 | return strings.TrimSuffix(strings.TrimPrefix(line, prefix), suffix), nil 123 | } 124 | } 125 | 126 | return "", fmt.Errorf("failed to find substring: %s %s %s", registerFileName, prefix, suffix) 127 | } 128 | 129 | func parseGVKToScope() (map[schema.GroupVersionKind]bool, error) { 130 | 131 | gvkToScope := map[schema.GroupVersionKind]bool{} 132 | 133 | // Walk directory containing core resource definitions 134 | err := filepath.Walk(os.Args[len(os.Args)-2], 135 | func(fileName string, info os.FileInfo, err error) error { 136 | if err != nil { 137 | return err 138 | } 139 | if strings.HasSuffix(fileName, "/types.go") { 140 | group, err := extractSubstring(strings.TrimSuffix(fileName, "/types.go")+"/register.go", "const GroupName = \"", "\"") 141 | if err != nil { 142 | // Ignore errors here due to apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/register.go 143 | // return err 144 | return nil 145 | } 146 | version, err := extractSubstring(strings.TrimSuffix(fileName, "/types.go")+"/register.go", "var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: \"", "\"}") 147 | if err != nil { 148 | // Ignore errors here due to kube-aggregator/pkg/apis/apiregistration/register.go 149 | // return err 150 | return nil 151 | } 152 | extractedGVKNamespaced, err := extractGVKNamespacedMapping(fileName, group, version) 153 | if err != nil { 154 | return err 155 | } 156 | for k, v := range extractedGVKNamespaced { 157 | gvkToScope[k] = v 158 | } 159 | } 160 | return nil 161 | }) 162 | if err != nil { 163 | return gvkToScope, err 164 | } 165 | 166 | return gvkToScope, nil 167 | } 168 | -------------------------------------------------------------------------------- /pkg/utils/utils.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/pkg/errors" 7 | "k8s.io/apimachinery/pkg/runtime/schema" 8 | _ "k8s.io/client-go/plugin/pkg/client/auth" 9 | "sigs.k8s.io/kustomize/kyaml/yaml" 10 | ) 11 | 12 | var quotes = []string{"'", "\""} 13 | 14 | func GetAnnotations(node *yaml.RNode) (map[string]string, error) { 15 | annotations := map[string]string{} 16 | 17 | valueNode, err := node.Pipe(yaml.Lookup("metadata", "annotations")) 18 | if err != nil { 19 | return annotations, err 20 | } 21 | 22 | m := valueNode.Map() 23 | for k, v := range m { 24 | // Ignore empty annotations 25 | if v == nil { 26 | continue 27 | } 28 | annotations[k] = v.(string) 29 | } 30 | 31 | return annotations, nil 32 | } 33 | 34 | func GetNamespace(node *yaml.RNode) (string, error) { 35 | namespace, err := GetStringField(node, "metadata", "namespace") 36 | if err != nil { 37 | return "", err 38 | } 39 | 40 | return namespace, nil 41 | } 42 | 43 | func GetName(node *yaml.RNode) (string, error) { 44 | name, err := GetStringField(node, "metadata", "name") 45 | if err != nil { 46 | return "", err 47 | } 48 | 49 | if name == "" { 50 | return "", errors.New("name is empty") 51 | } 52 | 53 | return name, nil 54 | } 55 | 56 | func GetAPIVersion(node *yaml.RNode) (string, error) { 57 | kind, err := GetStringField(node, "apiVersion") 58 | if err != nil { 59 | return "", err 60 | } 61 | 62 | if kind == "" { 63 | return "", errors.New("apiVersion is empty") 64 | } 65 | 66 | return kind, nil 67 | } 68 | 69 | func GetKind(node *yaml.RNode) (string, error) { 70 | kind, err := GetStringField(node, "kind") 71 | if err != nil { 72 | return "", err 73 | } 74 | 75 | if kind == "" { 76 | return "", errors.New("kind is empty") 77 | } 78 | 79 | return kind, nil 80 | } 81 | func GetCRDGroup(node *yaml.RNode) (string, error) { 82 | group, err := GetStringField(node, "spec", "group") 83 | if err != nil { 84 | return "", err 85 | } 86 | 87 | if group == "" { 88 | return "", errors.New("group is empty") 89 | } 90 | 91 | return group, nil 92 | } 93 | 94 | func GetCRDKind(node *yaml.RNode) (string, error) { 95 | kind, err := GetStringField(node, "spec", "names", "kind") 96 | if err != nil { 97 | return "", err 98 | } 99 | 100 | if kind == "" { 101 | return "", errors.New("CRD kind is empty") 102 | } 103 | 104 | return kind, nil 105 | } 106 | 107 | func GetCRDScope(node *yaml.RNode) (string, error) { 108 | scope, err := GetStringField(node, "spec", "scope") 109 | if err != nil { 110 | return "", err 111 | } 112 | 113 | if scope == "" { 114 | return "", errors.New("scope is empty") 115 | } 116 | 117 | return scope, nil 118 | } 119 | 120 | func GetCRDVersions(node *yaml.RNode) ([]string, error) { 121 | valueNode, err := node.Pipe(yaml.Lookup("spec", "versions")) 122 | if err != nil { 123 | return nil, err 124 | } 125 | 126 | versions, err := valueNode.ElementValues("name") 127 | if err != nil { 128 | return nil, err 129 | } 130 | 131 | if len(versions) > 0 { 132 | return versions, nil 133 | } 134 | 135 | version, err := GetStringField(node, "spec", "version") 136 | if err != nil { 137 | return nil, err 138 | } 139 | 140 | return []string{version}, nil 141 | } 142 | 143 | func GetStringField(node *yaml.RNode, fields ...string) (string, error) { 144 | 145 | valueNode, err := node.Pipe(yaml.Lookup(fields...)) 146 | if err != nil { 147 | return "", err 148 | } 149 | 150 | // Return empty string if value not found 151 | if valueNode == nil { 152 | return "", nil 153 | } 154 | 155 | value, err := valueNode.String() 156 | if err != nil { 157 | return "", nil 158 | } 159 | 160 | return trimSpaceAndQuotes(value), nil 161 | } 162 | 163 | // trimSpaceAndQuotes trims any whitespace and quotes around a value 164 | func trimSpaceAndQuotes(value string) string { 165 | text := strings.TrimSpace(value) 166 | for _, q := range quotes { 167 | if strings.HasPrefix(text, q) && strings.HasSuffix(text, q) { 168 | return strings.TrimPrefix(strings.TrimSuffix(text, q), q) 169 | } 170 | } 171 | return text 172 | } 173 | 174 | func Pluralise(lowercaseKind string) string { 175 | 176 | // e.g. ingress 177 | if strings.HasSuffix(lowercaseKind, "s") { 178 | return lowercaseKind + "es" 179 | } 180 | // e.g. networkpolicy 181 | if strings.HasSuffix(lowercaseKind, "cy") { 182 | return strings.TrimRight(lowercaseKind, "y") + "ies" 183 | } 184 | 185 | return lowercaseKind + "s" 186 | } 187 | 188 | func IsWhitespaceOrComments(input string) bool { 189 | lines := strings.Split(input, "\n") 190 | for _, line := range lines { 191 | t := strings.TrimSpace(line) 192 | if t != "" && !strings.HasPrefix(t, "#") && !strings.HasPrefix(t, "--") { 193 | return false 194 | } 195 | } 196 | return true 197 | } 198 | 199 | func GetGVK(node *yaml.RNode) (gvk schema.GroupVersionKind, err error) { 200 | apiVersion, err := GetAPIVersion(node) 201 | if err != nil { 202 | return gvk, errors.Wrap(err, "failed to get apiVersion") 203 | } 204 | 205 | kind, err := GetKind(node) 206 | if err != nil { 207 | return gvk, errors.Wrap(err, "failed to get kind") 208 | } 209 | 210 | gvk = schema.FromAPIVersionAndKind(apiVersion, kind) 211 | 212 | return gvk, nil 213 | } 214 | -------------------------------------------------------------------------------- /api-resources.txt: -------------------------------------------------------------------------------- 1 | NAME SHORTNAMES APIVERSION NAMESPACED KIND 2 | bindings v1 true Binding 3 | componentstatuses cs v1 false ComponentStatus 4 | configmaps cm v1 true ConfigMap 5 | endpoints ep v1 true Endpoints 6 | events ev v1 true Event 7 | limitranges limits v1 true LimitRange 8 | namespaces ns v1 false Namespace 9 | nodes no v1 false Node 10 | persistentvolumeclaims pvc v1 true PersistentVolumeClaim 11 | persistentvolumes pv v1 false PersistentVolume 12 | pods po v1 true Pod 13 | podtemplates v1 true PodTemplate 14 | replicationcontrollers rc v1 true ReplicationController 15 | resourcequotas quota v1 true ResourceQuota 16 | secrets v1 true Secret 17 | serviceaccounts sa v1 true ServiceAccount 18 | services svc v1 true Service 19 | mutatingwebhookconfigurations admissionregistration.k8s.io/v1 false MutatingWebhookConfiguration 20 | validatingwebhookconfigurations admissionregistration.k8s.io/v1 false ValidatingWebhookConfiguration 21 | customresourcedefinitions crd,crds apiextensions.k8s.io/v1 false CustomResourceDefinition 22 | apiservices apiregistration.k8s.io/v1 false APIService 23 | controllerrevisions apps/v1 true ControllerRevision 24 | daemonsets ds apps/v1 true DaemonSet 25 | deployments deploy apps/v1 true Deployment 26 | replicasets rs apps/v1 true ReplicaSet 27 | statefulsets sts apps/v1 true StatefulSet 28 | tokenreviews authentication.k8s.io/v1 false TokenReview 29 | localsubjectaccessreviews authorization.k8s.io/v1 true LocalSubjectAccessReview 30 | selfsubjectaccessreviews authorization.k8s.io/v1 false SelfSubjectAccessReview 31 | selfsubjectrulesreviews authorization.k8s.io/v1 false SelfSubjectRulesReview 32 | subjectaccessreviews authorization.k8s.io/v1 false SubjectAccessReview 33 | horizontalpodautoscalers hpa autoscaling/v1 true HorizontalPodAutoscaler 34 | cronjobs cj batch/v1beta1 true CronJob 35 | jobs batch/v1 true Job 36 | certificatesigningrequests csr certificates.k8s.io/v1 false CertificateSigningRequest 37 | leases coordination.k8s.io/v1 true Lease 38 | endpointslices discovery.k8s.io/v1beta1 true EndpointSlice 39 | events ev events.k8s.io/v1 true Event 40 | ingresses ing extensions/v1beta1 true Ingress 41 | ingressclasses networking.k8s.io/v1 false IngressClass 42 | ingresses ing networking.k8s.io/v1 true Ingress 43 | networkpolicies netpol networking.k8s.io/v1 true NetworkPolicy 44 | runtimeclasses node.k8s.io/v1beta1 false RuntimeClass 45 | poddisruptionbudgets pdb policy/v1beta1 true PodDisruptionBudget 46 | podsecuritypolicies psp policy/v1beta1 false PodSecurityPolicy 47 | clusterrolebindings rbac.authorization.k8s.io/v1 false ClusterRoleBinding 48 | clusterroles rbac.authorization.k8s.io/v1 false ClusterRole 49 | rolebindings rbac.authorization.k8s.io/v1 true RoleBinding 50 | roles rbac.authorization.k8s.io/v1 true Role 51 | priorityclasses pc scheduling.k8s.io/v1 false PriorityClass 52 | csidrivers storage.k8s.io/v1 false CSIDriver 53 | csinodes storage.k8s.io/v1 false CSINode 54 | storageclasses sc storage.k8s.io/v1 false StorageClass 55 | volumeattachments storage.k8s.io/v1 false VolumeAttachment 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kfmt 2 | 3 | kfmt takes input files and directories containing Kubernetes manifests and organises them into a 4 | standard format: 5 | 6 | ```t 7 | # Output directory 8 | output 9 | | # Directory containing cluster scoped resources 10 | ├── cluster 11 | | | # Each cluster scoped resource is given a directory named after its plural and group 12 | │   └── . 13 | | | # Files are named after the resource name 14 | │   └── .yaml 15 | | # Directory containing namespace scoped resources 16 | └── namespaces 17 | | # Each Namespace is given its own directory 18 | └── 19 | | # Files are named after the resource name, kind and group 20 | └── .-.yaml 21 | ``` 22 | 23 | Inspiration is taken from a number of other tools: 24 | 25 | - [manifest-splitter](https://github.com/munnerz/manifest-splitter) 26 | - [nomos](https://cloud.google.com/anthos-config-management/docs/how-to/nomos-command) 27 | - [jx gitops split](https://github.com/jenkins-x/jx-gitops/blob/master/docs/cmd/jx-gitops_split.md) 28 | - [jx gitops 29 | rename](https://github.com/jenkins-x/jx-gitops/blob/master/docs/cmd/jx-gitops_rename.md) 30 | - [jx gitops helmfile 31 | move](https://github.com/jenkins-x/jx-gitops/blob/master/docs/cmd/jx-gitops_helmfile_move.md) 32 | 33 | ## Use Cases 34 | 35 | kfmt is useful in any situation where it's beneficial to have a collection of manifests organised 36 | into a standard format. This could be to tidy up a large collection of manifests or just to make 37 | them easier to browse. 38 | 39 | GitOps tools such as [Flux](https://github.com/fluxcd/flux2) and [Anthos Config 40 | Management](https://cloud.google.com/anthos/config-management) that sync manifests from a Git 41 | repository could also benefit from kfmt by running it as a final step in CI, taking in all the 42 | manifests to be synced and verifying there are no clashes. Using the `kfmt.dev/namespaces` 43 | annotation can also be used to copy policy resources across Namespaces and having a standard format 44 | may make any changes easier to review. 45 | 46 | ## Installation 47 | 48 | ```sh 49 | GO111MODULE=on go get github.com/dippynark/kfmt 50 | ``` 51 | 52 | kfmt is also distributed as a [binary](https://github.com/dippynark/kfmt/releases) and a [Docker 53 | image](https://hub.docker.com/repository/docker/dippynark/kfmt). 54 | 55 | ## Usage 56 | 57 | The simplest usage is to format manifests coming from stdin: 58 | 59 | ```sh 60 | cat < api-resources.txt 128 | ``` 129 | 130 | Similarly, this cached discovery information can be augmented with all available versions: 131 | 132 | ```sh 133 | kubectl api-versions > api-versions.txt 134 | ``` 135 | 136 | In addition, kfmt supports the `--discovery` flag to enable use of the Kubernetes discovery API. 137 | kfmt will only attempt to use the Kubernetes discovery API if the required discovery information is 138 | not provided using another method. 139 | -------------------------------------------------------------------------------- /.lighthouse/release.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: release 5 | spec: 6 | serviceAccountName: tekton-bot 7 | pipelineSpec: 8 | params: 9 | - name: REPO_URL 10 | type: string 11 | - default: main 12 | # PULL_BASE_REF isn't the best name: https://stackoverflow.com/a/55460756/6180803 13 | # https://github.com/jenkins-x/lighthouse/blob/cde789ba2cd6835613553351978420be6a583f55/pkg/engines/tekton/test_data/controller/start-batch-pullrequest/observed-lhjob.yml#L32-L33 14 | name: PULL_BASE_REF 15 | type: string 16 | tasks: 17 | - name: determine-image-tag 18 | params: 19 | - name: PULL_BASE_REF 20 | value: $(params.PULL_BASE_REF) 21 | taskSpec: 22 | params: 23 | - name: PULL_BASE_REF 24 | type: string 25 | results: 26 | - name: IMAGE_TAG 27 | steps: 28 | - name: determine-image-tag 29 | image: busybox:1.35 30 | command: 31 | - /bin/sh 32 | args: 33 | - -ce 34 | - | 35 | IMAGE_TAG="$(inputs.params.PULL_BASE_REF)" 36 | if [ "$IMAGE_TAG" = "main" ]; then 37 | IMAGE_TAG="latest" 38 | fi 39 | echo -n $IMAGE_TAG > $(results.IMAGE_TAG.path) 40 | - name: git-clone-test-build-release 41 | params: 42 | - name: REPO_URL 43 | value: $(params.REPO_URL) 44 | - name: PULL_BASE_REF 45 | value: $(params.PULL_BASE_REF) 46 | - name: IMAGE_TAG 47 | value: $(tasks.determine-image-tag.results.IMAGE_TAG) 48 | taskSpec: 49 | params: 50 | - name: REPO_URL 51 | type: string 52 | - name: PULL_BASE_REF 53 | type: string 54 | - name: IMAGE_TAG 55 | type: string 56 | steps: 57 | - name: git-clone 58 | image: alpine/git:v2.34.2 59 | command: 60 | - /bin/sh 61 | args: 62 | - -ce 63 | - | 64 | git clone $(inputs.params.REPO_URL) . 65 | git checkout $(inputs.params.PULL_BASE_REF) 66 | workingDir: /workspace 67 | volumeMounts: 68 | - name: workspace 69 | mountPath: /workspace 70 | - name: test-build 71 | image: golang:1.18-alpine 72 | command: 73 | - /bin/sh 74 | args: 75 | - -ce 76 | - | 77 | apk add --update make 78 | make test build VERSION=$(params.PULL_BASE_REF) 79 | workingDir: /workspace 80 | volumeMounts: 81 | - name: workspace 82 | mountPath: /workspace 83 | - name: go-pkg-mod 84 | mountPath: /go/pkg/mod 85 | - name: kaniko-build 86 | image: gcr.io/kaniko-project/executor:v1.8.1 87 | command: 88 | - /kaniko/executor 89 | args: 90 | - --dockerfile=Dockerfile 91 | - --context=dir:///workspace 92 | - --destination=dippynark/kfmt:$(inputs.params.IMAGE_TAG) 93 | - --cache 94 | - --cache-repo=dippynark/kfmt-cache 95 | - --build-arg=VERSION=$(params.PULL_BASE_REF) 96 | # https://github.com/tektoncd/catalog/blob/37e8a986d97930fb009a25271166accbe14338c7/task/kaniko/0.1/kaniko.yaml#L45-L49 97 | env: 98 | - name: DOCKER_CONFIG 99 | value: /tekton/creds/.docker 100 | volumeMounts: 101 | - name: workspace 102 | mountPath: /workspace 103 | - name: release 104 | image: golang:1.18-alpine 105 | command: 106 | - /bin/sh 107 | args: 108 | - -ce 109 | - | 110 | if [ "$(inputs.params.PULL_BASE_REF)" = "main" ]; then 111 | exit 0 112 | fi 113 | apk add --update make 114 | make release VERSION=$(params.PULL_BASE_REF) 115 | workingDir: /workspace 116 | volumeMounts: 117 | - name: workspace 118 | mountPath: /workspace 119 | - name: go-pkg-mod 120 | mountPath: /go/pkg/mod 121 | # https://github.com/tektoncd/catalog/blob/master/task/create-github-release/0.1/create-github-release.yaml 122 | - name: github-release 123 | image: quay.io/diagrawa/github-hub@sha256:a002e05e3c3362f49dc31b8c16c10d76c6dbd854fdb0f596eaae8ac8b792adfb #tag: latest 124 | env: 125 | - name: GITHUB_TOKEN 126 | valueFrom: 127 | secretKeyRef: 128 | name: tekton-git 129 | key: password 130 | script: | 131 | #!/usr/bin/env bash 132 | set -euo pipefail 133 | 134 | if [ "$(inputs.params.PULL_BASE_REF)" = "main" ]; then 135 | exit 0 136 | fi 137 | 138 | # Create release title 139 | echo -e "$(inputs.params.PULL_BASE_REF)\n" > release.txt 140 | 141 | # Create release description 142 | # https://stackoverflow.com/a/40256763/6180803 143 | if git describe --tags $(inputs.params.PULL_BASE_REF)^ >/dev/null 2>&1; then 144 | # A previous tag exists so retrieve commit messages between tags 145 | git log $(git describe --tags --abbrev=0 $(inputs.params.PULL_BASE_REF)^)..$(inputs.params.PULL_BASE_REF) --oneline >> release.txt 146 | else 147 | # No previous tag exists so retrieve all commit messages before tag 148 | git log $(inputs.params.PULL_BASE_REF) --oneline >> release.txt 149 | fi 150 | 151 | # Creating release 152 | hub release create \ 153 | --file release.txt \ 154 | --attach bin/checksums.txt \ 155 | --attach bin/kfmt-darwin-amd64 \ 156 | --attach bin/kfmt-darwin-arm64 \ 157 | --attach bin/kfmt-linux-amd64 \ 158 | --attach bin/kfmt-windows-amd64.exe \ 159 | $(inputs.params.PULL_BASE_REF) 160 | workingDir: /workspace 161 | volumeMounts: 162 | - name: workspace 163 | mountPath: /workspace 164 | volumes: 165 | - name: workspace 166 | emptyDir: {} 167 | - name: go-pkg-mod 168 | hostPath: 169 | path: /mnt/ssd/data/go/pkg/mod 170 | -------------------------------------------------------------------------------- /pkg/utils/utils_test.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "sigs.k8s.io/kustomize/kyaml/kio" 8 | ) 9 | 10 | func TestGetAnnotations(t *testing.T) { 11 | manifests := ` 12 | apiVersion: v1 13 | kind: Namespace 14 | metadata: 15 | name: test 16 | annotations: 17 | foo: bah 18 | --- 19 | apiVersion: v1 20 | kind: Namespace 21 | metadata: 22 | name: test 23 | annotations: {} 24 | --- 25 | apiVersion: v1 26 | kind: Namespace 27 | metadata: 28 | name: test 29 | ` 30 | nodes, err := kio.FromBytes([]byte(manifests)) 31 | if err != nil { 32 | t.Error(err) 33 | } 34 | 35 | if len(nodes) != 3 { 36 | t.Error("failed to ingest manifests") 37 | } 38 | 39 | annotations, err := GetAnnotations(nodes[0]) 40 | if err != nil { 41 | t.Error(err) 42 | } 43 | 44 | value, ok := annotations["foo"] 45 | if !ok { 46 | t.Error("failed to retrieve annotation key foo") 47 | } 48 | 49 | if value != "bah" { 50 | t.Error("failed to retrieve annotation value bah") 51 | } 52 | 53 | if len(annotations) > 1 { 54 | t.Error("exactly one annotation was expected") 55 | } 56 | 57 | annotations, err = GetAnnotations(nodes[1]) 58 | if err != nil { 59 | t.Error(err) 60 | } 61 | 62 | if len(annotations) > 0 { 63 | t.Error("exactly zero annotations were expected") 64 | } 65 | 66 | annotations, err = GetAnnotations(nodes[2]) 67 | if err != nil { 68 | t.Error(err) 69 | } 70 | 71 | if len(annotations) > 0 { 72 | t.Error("exactly zero annotations were expected") 73 | } 74 | } 75 | 76 | func TestGetNamespace(t *testing.T) { 77 | manifests := ` 78 | apiVersion: v1 79 | kind: ConfigMap 80 | metadata: 81 | name: test 82 | namespace: foo 83 | --- 84 | apiVersion: v1 85 | kind: ConfigMap 86 | metadata: 87 | name: test 88 | ` 89 | nodes, err := kio.FromBytes([]byte(manifests)) 90 | if err != nil { 91 | t.Error(err) 92 | } 93 | 94 | if len(nodes) != 2 { 95 | t.Error("failed to ingest manifests") 96 | } 97 | 98 | namespace, err := GetNamespace(nodes[0]) 99 | if err != nil { 100 | t.Error(err) 101 | } 102 | 103 | if namespace != "foo" { 104 | t.Error("failed to retrieve namespace foo") 105 | } 106 | 107 | namespace, err = GetNamespace(nodes[1]) 108 | if err != nil { 109 | t.Error(err) 110 | } 111 | 112 | if namespace != "" { 113 | t.Error(fmt.Sprintf("found unknown namespace %s", namespace)) 114 | } 115 | } 116 | 117 | func TestGetName(t *testing.T) { 118 | manifests := ` 119 | apiVersion: v1 120 | kind: ConfigMap 121 | metadata: 122 | name: test 123 | --- 124 | apiVersion: v1 125 | kind: ConfigMap 126 | ` 127 | nodes, err := kio.FromBytes([]byte(manifests)) 128 | if err != nil { 129 | t.Error(err) 130 | } 131 | 132 | if len(nodes) != 2 { 133 | t.Error("failed to ingest manifests") 134 | } 135 | 136 | name, err := GetName(nodes[0]) 137 | if err != nil { 138 | t.Error(err) 139 | } 140 | 141 | if name != "test" { 142 | t.Error("failed to retrieve name test") 143 | } 144 | 145 | name, err = GetName(nodes[1]) 146 | if err == nil { 147 | t.Error("expected error due to missing name") 148 | } 149 | } 150 | 151 | func TestGetAPIVersion(t *testing.T) { 152 | manifests := ` 153 | apiVersion: v1 154 | kind: ConfigMap 155 | --- 156 | kind: ConfigMap 157 | ` 158 | nodes, err := kio.FromBytes([]byte(manifests)) 159 | if err != nil { 160 | t.Error(err) 161 | } 162 | 163 | if len(nodes) != 2 { 164 | t.Error("failed to ingest manifests") 165 | } 166 | 167 | apiVersion, err := GetAPIVersion(nodes[0]) 168 | if err != nil { 169 | t.Error(err) 170 | } 171 | 172 | if apiVersion != "v1" { 173 | t.Error("failed to retrieve apiVersion v1") 174 | } 175 | 176 | apiVersion, err = GetAPIVersion(nodes[1]) 177 | if err == nil { 178 | t.Error("expected error due to missing apiVersion") 179 | } 180 | } 181 | 182 | func TestGetKind(t *testing.T) { 183 | manifests := ` 184 | apiVersion: v1 185 | kind: ConfigMap 186 | --- 187 | apiVersion: v1 188 | ` 189 | nodes, err := kio.FromBytes([]byte(manifests)) 190 | if err != nil { 191 | t.Error(err) 192 | } 193 | 194 | if len(nodes) != 2 { 195 | t.Error("failed to ingest manifests") 196 | } 197 | 198 | kind, err := GetKind(nodes[0]) 199 | if err != nil { 200 | t.Error(err) 201 | } 202 | 203 | if kind != "ConfigMap" { 204 | t.Error("failed to retrieve kind ConfigMap") 205 | } 206 | 207 | kind, err = GetKind(nodes[1]) 208 | if err == nil { 209 | t.Error("expected error due to missing kind") 210 | } 211 | } 212 | 213 | func TestGetCRDGroup(t *testing.T) { 214 | manifests := ` 215 | apiVersion: apiextensions.k8s.io/v1 216 | kind: CustomResourceDefinition 217 | spec: 218 | group: 219 | kfmt.dev 220 | --- 221 | apiVersion: apiextensions.k8s.io/v1 222 | kind: CustomResourceDefinition 223 | ` 224 | nodes, err := kio.FromBytes([]byte(manifests)) 225 | if err != nil { 226 | t.Error(err) 227 | } 228 | 229 | if len(nodes) != 2 { 230 | t.Error("failed to ingest manifests") 231 | } 232 | 233 | crdGroup, err := GetCRDGroup(nodes[0]) 234 | if err != nil { 235 | t.Error(err) 236 | } 237 | 238 | if crdGroup != "kfmt.dev" { 239 | t.Error("failed to retrieve CRD group") 240 | } 241 | 242 | crdGroup, err = GetCRDGroup(nodes[1]) 243 | if err == nil { 244 | t.Error("expected error due to missing CRD group") 245 | } 246 | } 247 | 248 | func TestGetCRDKind(t *testing.T) { 249 | manifests := ` 250 | apiVersion: apiextensions.k8s.io/v1 251 | kind: CustomResourceDefinition 252 | spec: 253 | names: 254 | kind: Test 255 | --- 256 | apiVersion: apiextensions.k8s.io/v1 257 | kind: CustomResourceDefinition 258 | ` 259 | nodes, err := kio.FromBytes([]byte(manifests)) 260 | if err != nil { 261 | t.Error(err) 262 | } 263 | 264 | if len(nodes) != 2 { 265 | t.Error("failed to ingest manifests") 266 | } 267 | 268 | crdKind, err := GetCRDKind(nodes[0]) 269 | if err != nil { 270 | t.Error(err) 271 | } 272 | 273 | if crdKind != "Test" { 274 | t.Error("failed to retrieve CRD kind") 275 | } 276 | 277 | crdKind, err = GetCRDKind(nodes[1]) 278 | if err == nil { 279 | t.Error("expected error due to missing CRD kind") 280 | } 281 | } 282 | 283 | func TestGetCRDScope(t *testing.T) { 284 | manifests := ` 285 | apiVersion: apiextensions.k8s.io/v1 286 | kind: CustomResourceDefinition 287 | spec: 288 | scope: Namespaced 289 | --- 290 | apiVersion: apiextensions.k8s.io/v1 291 | kind: CustomResourceDefinition 292 | ` 293 | nodes, err := kio.FromBytes([]byte(manifests)) 294 | if err != nil { 295 | t.Error(err) 296 | } 297 | 298 | if len(nodes) != 2 { 299 | t.Error("failed to ingest manifests") 300 | } 301 | 302 | crdScope, err := GetCRDScope(nodes[0]) 303 | if err != nil { 304 | t.Error(err) 305 | } 306 | 307 | if crdScope != "Namespaced" { 308 | t.Error("failed to retrieve CRD scope") 309 | } 310 | 311 | crdScope, err = GetCRDScope(nodes[1]) 312 | if err == nil { 313 | t.Error("expected error due to missing CRD scope") 314 | } 315 | } 316 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /pkg/discovery/local_discovery.go: -------------------------------------------------------------------------------- 1 | package discovery 2 | 3 | import "k8s.io/apimachinery/pkg/runtime/schema" 4 | 5 | var coreGVKToScope = map[schema.GroupVersionKind]bool{ 6 | {Group: "", Version: "v1", Kind: "ComponentStatus"}: false, 7 | {Group: "", Version: "v1", Kind: "ConfigMap"}: true, 8 | {Group: "", Version: "v1", Kind: "Endpoints"}: true, 9 | {Group: "", Version: "v1", Kind: "Event"}: true, 10 | {Group: "", Version: "v1", Kind: "LimitRange"}: true, 11 | {Group: "", Version: "v1", Kind: "Namespace"}: false, 12 | {Group: "", Version: "v1", Kind: "Node"}: false, 13 | {Group: "", Version: "v1", Kind: "PersistentVolume"}: false, 14 | {Group: "", Version: "v1", Kind: "PersistentVolumeClaim"}: true, 15 | {Group: "", Version: "v1", Kind: "Pod"}: true, 16 | {Group: "", Version: "v1", Kind: "PodTemplate"}: true, 17 | {Group: "", Version: "v1", Kind: "ReplicationController"}: true, 18 | {Group: "", Version: "v1", Kind: "ResourceQuota"}: true, 19 | {Group: "", Version: "v1", Kind: "Secret"}: true, 20 | {Group: "", Version: "v1", Kind: "Service"}: true, 21 | {Group: "", Version: "v1", Kind: "ServiceAccount"}: true, 22 | {Group: "admissionregistration.k8s.io", Version: "v1", Kind: "MutatingWebhookConfiguration"}: false, 23 | {Group: "admissionregistration.k8s.io", Version: "v1", Kind: "ValidatingWebhookConfiguration"}: false, 24 | {Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "ValidatingAdmissionPolicy"}: false, 25 | {Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "ValidatingAdmissionPolicyBinding"}: false, 26 | {Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "MutatingWebhookConfiguration"}: false, 27 | {Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "ValidatingAdmissionPolicy"}: false, 28 | {Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "ValidatingAdmissionPolicyBinding"}: false, 29 | {Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "ValidatingWebhookConfiguration"}: false, 30 | {Group: "apiextensions.k8s.io", Version: "v1", Kind: "CustomResourceDefinition"}: false, 31 | {Group: "apiextensions.k8s.io", Version: "v1beta1", Kind: "CustomResourceDefinition"}: false, 32 | {Group: "apiregistration.k8s.io", Version: "v1", Kind: "APIService"}: false, 33 | {Group: "apiregistration.k8s.io", Version: "v1beta1", Kind: "APIService"}: false, 34 | {Group: "apps", Version: "v1", Kind: "ControllerRevision"}: true, 35 | {Group: "apps", Version: "v1", Kind: "DaemonSet"}: true, 36 | {Group: "apps", Version: "v1", Kind: "Deployment"}: true, 37 | {Group: "apps", Version: "v1", Kind: "ReplicaSet"}: true, 38 | {Group: "apps", Version: "v1", Kind: "StatefulSet"}: true, 39 | {Group: "apps", Version: "v1beta1", Kind: "ControllerRevision"}: true, 40 | {Group: "apps", Version: "v1beta1", Kind: "Deployment"}: true, 41 | {Group: "apps", Version: "v1beta1", Kind: "StatefulSet"}: true, 42 | {Group: "apps", Version: "v1beta2", Kind: "ControllerRevision"}: true, 43 | {Group: "apps", Version: "v1beta2", Kind: "DaemonSet"}: true, 44 | {Group: "apps", Version: "v1beta2", Kind: "Deployment"}: true, 45 | {Group: "apps", Version: "v1beta2", Kind: "ReplicaSet"}: true, 46 | {Group: "apps", Version: "v1beta2", Kind: "StatefulSet"}: true, 47 | {Group: "authentication.k8s.io", Version: "v1", Kind: "SelfSubjectReview"}: false, 48 | {Group: "authentication.k8s.io", Version: "v1", Kind: "TokenReview"}: false, 49 | {Group: "authentication.k8s.io", Version: "v1alpha1", Kind: "SelfSubjectReview"}: false, 50 | {Group: "authentication.k8s.io", Version: "v1beta1", Kind: "SelfSubjectReview"}: false, 51 | {Group: "authentication.k8s.io", Version: "v1beta1", Kind: "TokenReview"}: false, 52 | {Group: "authorization.k8s.io", Version: "v1", Kind: "LocalSubjectAccessReview"}: true, 53 | {Group: "authorization.k8s.io", Version: "v1", Kind: "SelfSubjectAccessReview"}: false, 54 | {Group: "authorization.k8s.io", Version: "v1", Kind: "SelfSubjectRulesReview"}: false, 55 | {Group: "authorization.k8s.io", Version: "v1", Kind: "SubjectAccessReview"}: false, 56 | {Group: "authorization.k8s.io", Version: "v1beta1", Kind: "LocalSubjectAccessReview"}: true, 57 | {Group: "authorization.k8s.io", Version: "v1beta1", Kind: "SelfSubjectAccessReview"}: false, 58 | {Group: "authorization.k8s.io", Version: "v1beta1", Kind: "SelfSubjectRulesReview"}: false, 59 | {Group: "authorization.k8s.io", Version: "v1beta1", Kind: "SubjectAccessReview"}: false, 60 | {Group: "autoscaling", Version: "v1", Kind: "HorizontalPodAutoscaler"}: true, 61 | {Group: "autoscaling", Version: "v2", Kind: "HorizontalPodAutoscaler"}: true, 62 | {Group: "autoscaling", Version: "v2beta1", Kind: "HorizontalPodAutoscaler"}: true, 63 | {Group: "autoscaling", Version: "v2beta2", Kind: "HorizontalPodAutoscaler"}: true, 64 | {Group: "batch", Version: "v1", Kind: "CronJob"}: true, 65 | {Group: "batch", Version: "v1", Kind: "Job"}: true, 66 | {Group: "batch", Version: "v1beta1", Kind: "CronJob"}: true, 67 | {Group: "certificates.k8s.io", Version: "v1", Kind: "CertificateSigningRequest"}: false, 68 | {Group: "certificates.k8s.io", Version: "v1alpha1", Kind: "ClusterTrustBundle"}: false, 69 | {Group: "certificates.k8s.io", Version: "v1beta1", Kind: "CertificateSigningRequest"}: false, 70 | {Group: "coordination.k8s.io", Version: "v1", Kind: "Lease"}: true, 71 | {Group: "coordination.k8s.io", Version: "v1beta1", Kind: "Lease"}: true, 72 | {Group: "discovery.k8s.io", Version: "v1", Kind: "EndpointSlice"}: true, 73 | {Group: "discovery.k8s.io", Version: "v1beta1", Kind: "EndpointSlice"}: true, 74 | {Group: "events.k8s.io", Version: "v1", Kind: "Event"}: true, 75 | {Group: "events.k8s.io", Version: "v1beta1", Kind: "Event"}: true, 76 | {Group: "extensions", Version: "v1beta1", Kind: "DaemonSet"}: true, 77 | {Group: "extensions", Version: "v1beta1", Kind: "Deployment"}: true, 78 | {Group: "extensions", Version: "v1beta1", Kind: "Ingress"}: true, 79 | {Group: "extensions", Version: "v1beta1", Kind: "NetworkPolicy"}: true, 80 | {Group: "extensions", Version: "v1beta1", Kind: "ReplicaSet"}: true, 81 | {Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1", Kind: "FlowSchema"}: false, 82 | {Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1", Kind: "PriorityLevelConfiguration"}: false, 83 | {Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "FlowSchema"}: false, 84 | {Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Kind: "PriorityLevelConfiguration"}: false, 85 | {Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta3", Kind: "FlowSchema"}: false, 86 | {Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta3", Kind: "PriorityLevelConfiguration"}: false, 87 | {Group: "imagepolicy.k8s.io", Version: "v1alpha1", Kind: "ImageReview"}: false, 88 | {Group: "internal.apiserver.k8s.io", Version: "v1alpha1", Kind: "StorageVersion"}: false, 89 | {Group: "networking.k8s.io", Version: "v1", Kind: "Ingress"}: true, 90 | {Group: "networking.k8s.io", Version: "v1", Kind: "IngressClass"}: false, 91 | {Group: "networking.k8s.io", Version: "v1", Kind: "NetworkPolicy"}: true, 92 | {Group: "networking.k8s.io", Version: "v1alpha1", Kind: "ClusterCIDR"}: false, 93 | {Group: "networking.k8s.io", Version: "v1alpha1", Kind: "IPAddress"}: false, 94 | {Group: "networking.k8s.io", Version: "v1beta1", Kind: "Ingress"}: true, 95 | {Group: "networking.k8s.io", Version: "v1beta1", Kind: "IngressClass"}: false, 96 | {Group: "node.k8s.io", Version: "v1", Kind: "RuntimeClass"}: false, 97 | {Group: "node.k8s.io", Version: "v1alpha1", Kind: "RuntimeClass"}: false, 98 | {Group: "node.k8s.io", Version: "v1beta1", Kind: "RuntimeClass"}: false, 99 | {Group: "policy", Version: "v1", Kind: "Eviction"}: true, 100 | {Group: "policy", Version: "v1", Kind: "PodDisruptionBudget"}: true, 101 | {Group: "policy", Version: "v1beta1", Kind: "Eviction"}: true, 102 | {Group: "policy", Version: "v1beta1", Kind: "PodDisruptionBudget"}: true, 103 | {Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRole"}: false, 104 | {Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRoleBinding"}: false, 105 | {Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "Role"}: true, 106 | {Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "RoleBinding"}: true, 107 | {Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Kind: "ClusterRole"}: false, 108 | {Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Kind: "ClusterRoleBinding"}: false, 109 | {Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Kind: "Role"}: true, 110 | {Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Kind: "RoleBinding"}: true, 111 | {Group: "rbac.authorization.k8s.io", Version: "v1beta1", Kind: "ClusterRole"}: false, 112 | {Group: "rbac.authorization.k8s.io", Version: "v1beta1", Kind: "ClusterRoleBinding"}: false, 113 | {Group: "rbac.authorization.k8s.io", Version: "v1beta1", Kind: "Role"}: true, 114 | {Group: "rbac.authorization.k8s.io", Version: "v1beta1", Kind: "RoleBinding"}: true, 115 | {Group: "resource.k8s.io", Version: "v1alpha2", Kind: "PodSchedulingContext"}: true, 116 | {Group: "resource.k8s.io", Version: "v1alpha2", Kind: "ResourceClaim"}: true, 117 | {Group: "resource.k8s.io", Version: "v1alpha2", Kind: "ResourceClaimTemplate"}: true, 118 | {Group: "resource.k8s.io", Version: "v1alpha2", Kind: "ResourceClass"}: false, 119 | {Group: "scheduling.k8s.io", Version: "v1", Kind: "PriorityClass"}: false, 120 | {Group: "scheduling.k8s.io", Version: "v1alpha1", Kind: "PriorityClass"}: false, 121 | {Group: "scheduling.k8s.io", Version: "v1beta1", Kind: "PriorityClass"}: false, 122 | {Group: "storage.k8s.io", Version: "v1", Kind: "CSIDriver"}: false, 123 | {Group: "storage.k8s.io", Version: "v1", Kind: "CSINode"}: false, 124 | {Group: "storage.k8s.io", Version: "v1", Kind: "CSIStorageCapacity"}: true, 125 | {Group: "storage.k8s.io", Version: "v1", Kind: "StorageClass"}: false, 126 | {Group: "storage.k8s.io", Version: "v1", Kind: "VolumeAttachment"}: false, 127 | {Group: "storage.k8s.io", Version: "v1alpha1", Kind: "CSIStorageCapacity"}: true, 128 | {Group: "storage.k8s.io", Version: "v1alpha1", Kind: "VolumeAttachment"}: false, 129 | {Group: "storage.k8s.io", Version: "v1beta1", Kind: "CSIDriver"}: false, 130 | {Group: "storage.k8s.io", Version: "v1beta1", Kind: "CSINode"}: false, 131 | {Group: "storage.k8s.io", Version: "v1beta1", Kind: "CSIStorageCapacity"}: true, 132 | {Group: "storage.k8s.io", Version: "v1beta1", Kind: "StorageClass"}: false, 133 | {Group: "storage.k8s.io", Version: "v1beta1", Kind: "VolumeAttachment"}: false, 134 | } 135 | -------------------------------------------------------------------------------- /cmd/kfmt/options_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "os" 7 | "path" 8 | "testing" 9 | 10 | "github.com/pkg/errors" 11 | "github.com/spf13/afero" 12 | "github.com/stretchr/testify/require" 13 | ) 14 | 15 | const ( 16 | outputDirectory = "output" 17 | ) 18 | 19 | // requireDirectory checks that the path is a directory in the filesystem 20 | func requireDirectory(fs afero.Fs, path string) error { 21 | info, err := fs.Stat(path) 22 | if err != nil { 23 | return errors.Errorf(err.Error()) 24 | } 25 | if !info.IsDir() { 26 | return errors.Errorf("%s is not a directory", path) 27 | } 28 | return nil 29 | } 30 | 31 | // requireRegularFileContents checks that the path is a regular file in the filesystem with the provided contents 32 | func requireRegularFileContents(fs afero.Fs, path string, contents string) error { 33 | info, err := fs.Stat(path) 34 | if err != nil { 35 | return errors.Errorf(err.Error()) 36 | } 37 | if !info.Mode().IsRegular() { 38 | return errors.Errorf("%s is not a regular file", path) 39 | } 40 | fileBytes, err := afero.ReadFile(fs, path) 41 | if err != nil { 42 | return err 43 | } 44 | expectedBytes := []byte(contents) 45 | if bytes.Compare(fileBytes, expectedBytes) != 0 { 46 | return errors.Errorf("unexpected file contents:\n%s", fileBytes) 47 | } 48 | return nil 49 | } 50 | 51 | // requireFileIsNotExist checks that the path does not exist 52 | func requireFileIsNotExist(fs afero.Fs, path string) error { 53 | _, err := fs.Stat(path) 54 | if err == nil { 55 | return errors.Errorf("%s exists", path) 56 | } 57 | if !os.IsNotExist(err) { 58 | return errors.Errorf(err.Error()) 59 | } 60 | return nil 61 | } 62 | 63 | func TestFilters(t *testing.T) { 64 | // Setup options 65 | o := &options{ 66 | inputs: []string{"input.yaml"}, 67 | output: outputDirectory, 68 | filters: []string{"Secret"}, 69 | } 70 | 71 | // Setup memory backed filesystem 72 | fs := afero.NewMemMapFs() 73 | 74 | // Create input manifests 75 | manifests := ` 76 | apiVersion: v1 77 | kind: Secret 78 | metadata: 79 | name: test 80 | ` 81 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 82 | require.Nil(t, err) 83 | 84 | // Format input manifests 85 | err = o.run(fs) 86 | require.Nil(t, err) 87 | 88 | // Ensure Secret has not been formatted 89 | err = requireFileIsNotExist(fs, path.Join(outputDirectory, namespacedDirectory, "default/secret-test.yaml")) 90 | require.Nil(t, err) 91 | 92 | // Remove filter and ensure Secret is formatted 93 | o.filters = []string{} 94 | err = o.run(fs) 95 | require.Nil(t, err) 96 | err = requireRegularFileContents(fs, path.Join(outputDirectory, namespacedDirectory, "default/secret-test.yaml"), `--- 97 | apiVersion: v1 98 | kind: Secret 99 | metadata: 100 | name: test 101 | namespace: default 102 | `) 103 | require.Nil(t, err) 104 | } 105 | 106 | func TestGVKScopes(t *testing.T) { 107 | // Setup options 108 | o := &options{ 109 | inputs: []string{"input.yaml"}, 110 | output: outputDirectory, 111 | gvkScopes: []string{"Tester.test.io/v1:Namespaced"}, 112 | } 113 | 114 | // Setup memory backed filesystem 115 | fs := afero.NewMemMapFs() 116 | 117 | // Create input manifests 118 | manifests := ` 119 | apiVersion: test.io/v1 120 | kind: Tester 121 | metadata: 122 | name: example 123 | ` 124 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 125 | require.Nil(t, err) 126 | 127 | // Format input manifests 128 | err = o.run(fs) 129 | require.Nil(t, err) 130 | 131 | // Ensure tester resource is formatted 132 | err = requireRegularFileContents(fs, path.Join(outputDirectory, namespacedDirectory, "default/tester.test.io-example.yaml"), `--- 133 | apiVersion: test.io/v1 134 | kind: Tester 135 | metadata: 136 | name: example 137 | namespace: default 138 | `) 139 | require.Nil(t, err) 140 | 141 | // Use cluster scope 142 | o.gvkScopes = []string{"Tester.test.io/v1:Cluster"} 143 | err = o.run(fs) 144 | require.Nil(t, err) 145 | err = requireRegularFileContents(fs, path.Join(outputDirectory, nonNamespacedDirectory, "testers.test.io/example.yaml"), `--- 146 | apiVersion: test.io/v1 147 | kind: Tester 148 | metadata: 149 | name: example 150 | `) 151 | require.Nil(t, err) 152 | 153 | // Use unrecognised scope 154 | o.gvkScopes = []string{"Tester.test.io/v1:Foo"} 155 | err = o.run(fs) 156 | require.Equal(t, err.Error(), "unrecognised scope Foo") 157 | } 158 | 159 | func TestCRDScope(t *testing.T) { 160 | // Setup options 161 | o := &options{ 162 | inputs: []string{"input.yaml"}, 163 | output: outputDirectory, 164 | } 165 | 166 | // Setup memory backed filesystem 167 | fs := afero.NewMemMapFs() 168 | 169 | // Create input manifests 170 | manifests := ` 171 | apiVersion: test.io/v1 172 | kind: Tester 173 | metadata: 174 | name: example 175 | ` 176 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 177 | require.Nil(t, err) 178 | 179 | // Check that formatting fails to determine scope 180 | err = o.run(fs) 181 | require.Equal(t, err.Error(), "failed to find Namespaces in input.yaml: could not find REST mapping for resource test.io/v1, Kind=Tester") 182 | 183 | // Create corresponding CRD and ensure resource is now formatted correctly 184 | crd := ` 185 | apiVersion: apiextensions.k8s.io/v1 186 | kind: CustomResourceDefinition 187 | metadata: 188 | name: testers.test.io 189 | spec: 190 | group: test.io 191 | names: 192 | kind: Tester 193 | scope: Namespaced 194 | versions: 195 | - name: v1 196 | ` 197 | err = afero.WriteFile(fs, "crd.yaml", []byte(crd), 0644) 198 | require.Nil(t, err) 199 | o.inputs = append(o.inputs, "crd.yaml") 200 | err = o.run(fs) 201 | require.Nil(t, err) 202 | err = requireRegularFileContents(fs, path.Join(outputDirectory, namespacedDirectory, "default/tester.test.io-example.yaml"), `--- 203 | apiVersion: test.io/v1 204 | kind: Tester 205 | metadata: 206 | name: example 207 | namespace: default 208 | `) 209 | require.Nil(t, err) 210 | } 211 | 212 | func TestNamespace(t *testing.T) { 213 | // Setup options 214 | o := &options{ 215 | inputs: []string{"input.yaml"}, 216 | output: outputDirectory, 217 | namespace: "test", 218 | } 219 | 220 | // Setup memory backed filesystem 221 | fs := afero.NewMemMapFs() 222 | 223 | // Create input manifests 224 | manifests := ` 225 | apiVersion: v1 226 | kind: Secret 227 | metadata: 228 | name: test 229 | ` 230 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 231 | require.Nil(t, err) 232 | 233 | // Format input manifests 234 | err = o.run(fs) 235 | require.Nil(t, err) 236 | 237 | // Ensure Secret is formatted 238 | err = requireRegularFileContents(fs, path.Join(outputDirectory, namespacedDirectory, "test/secret-test.yaml"), `--- 239 | apiVersion: v1 240 | kind: Secret 241 | metadata: 242 | name: test 243 | namespace: test 244 | `) 245 | require.Nil(t, err) 246 | } 247 | 248 | func TestClean(t *testing.T) { 249 | // Setup options 250 | o := &options{ 251 | inputs: []string{"input.yaml"}, 252 | output: outputDirectory, 253 | clean: true, 254 | } 255 | 256 | // Setup memory backed filesystem 257 | fs := afero.NewMemMapFs() 258 | 259 | // Create input manifests 260 | manifests := ` 261 | apiVersion: rbac.authorization.k8s.io/v1 262 | kind: ClusterRole 263 | metadata: 264 | name: foo 265 | namespace: test 266 | ` 267 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 268 | require.Nil(t, err) 269 | 270 | // Format input manifests 271 | err = o.run(fs) 272 | require.Nil(t, err) 273 | 274 | // Ensure resource is formatted 275 | err = requireRegularFileContents(fs, path.Join(outputDirectory, nonNamespacedDirectory, "clusterroles/foo.yaml"), `--- 276 | apiVersion: rbac.authorization.k8s.io/v1 277 | kind: ClusterRole 278 | metadata: 279 | name: foo 280 | `) 281 | require.Nil(t, err) 282 | 283 | // Disable clean 284 | o.clean = false 285 | manifests = ` 286 | apiVersion: rbac.authorization.k8s.io/v1 287 | kind: ClusterRole 288 | metadata: 289 | name: bar 290 | namespace: test 291 | ` 292 | err = afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 293 | require.Nil(t, err) 294 | err = o.run(fs) 295 | require.Nil(t, err) 296 | err = requireRegularFileContents(fs, path.Join(outputDirectory, nonNamespacedDirectory, "clusterroles/bar.yaml"), `--- 297 | apiVersion: rbac.authorization.k8s.io/v1 298 | kind: ClusterRole 299 | metadata: 300 | name: bar 301 | namespace: test 302 | `) 303 | require.Nil(t, err) 304 | } 305 | 306 | func TestStrict(t *testing.T) { 307 | // Setup options 308 | o := &options{ 309 | inputs: []string{"input.yaml"}, 310 | output: outputDirectory, 311 | strict: true, 312 | } 313 | 314 | // Setup memory backed filesystem 315 | fs := afero.NewMemMapFs() 316 | 317 | // Attempt to format ClusterRole with a namespace specified 318 | manifests := ` 319 | apiVersion: rbac.authorization.k8s.io/v1 320 | kind: ClusterRole 321 | metadata: 322 | name: foo 323 | namespace: test 324 | ` 325 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 326 | require.Nil(t, err) 327 | err = o.run(fs) 328 | require.Equal(t, err.Error(), "metadata.namespace field should not be set for cluster-scoped resource: rbac.authorization.k8s.io/v1, Kind=ClusterRole") 329 | 330 | // Disable strict 331 | o.strict = false 332 | err = o.run(fs) 333 | require.Nil(t, err) 334 | err = requireRegularFileContents(fs, path.Join(outputDirectory, nonNamespacedDirectory, "clusterroles/foo.yaml"), `--- 335 | apiVersion: rbac.authorization.k8s.io/v1 336 | kind: ClusterRole 337 | metadata: 338 | name: foo 339 | namespace: test 340 | `) 341 | require.Nil(t, err) 342 | } 343 | 344 | func TestRemove(t *testing.T) { 345 | // Setup options 346 | o := &options{ 347 | inputs: []string{"input.yaml"}, 348 | output: outputDirectory, 349 | remove: false, 350 | } 351 | 352 | // Setup memory backed filesystem 353 | fs := afero.NewMemMapFs() 354 | 355 | // Create input manifests 356 | manifests := ` 357 | apiVersion: v1 358 | kind: Secret 359 | metadata: 360 | name: test 361 | ` 362 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 363 | require.Nil(t, err) 364 | err = o.run(fs) 365 | require.Nil(t, err) 366 | err = requireRegularFileContents(fs, "input.yaml", ` 367 | apiVersion: v1 368 | kind: Secret 369 | metadata: 370 | name: test 371 | `) 372 | require.Nil(t, err) 373 | 374 | // Remove formatted resource 375 | err = fs.Remove(path.Join(outputDirectory, namespacedDirectory, "default/secret-test.yaml")) 376 | require.Nil(t, err) 377 | 378 | // Enable remove and verify input file is removed 379 | o.remove = true 380 | err = o.run(fs) 381 | require.Nil(t, err) 382 | err = requireFileIsNotExist(fs, "input.yaml") 383 | require.Nil(t, err) 384 | } 385 | 386 | func TestComment(t *testing.T) { 387 | // Setup options 388 | o := &options{ 389 | inputs: []string{"input.yaml"}, 390 | output: outputDirectory, 391 | comment: true, 392 | } 393 | 394 | // Setup memory backed filesystem 395 | fs := afero.NewMemMapFs() 396 | 397 | // Create input manifests 398 | manifests := ` 399 | apiVersion: v1 400 | kind: Secret 401 | metadata: 402 | name: test 403 | ` 404 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 405 | require.Nil(t, err) 406 | err = o.run(fs) 407 | require.Nil(t, err) 408 | err = requireRegularFileContents(fs, path.Join(outputDirectory, namespacedDirectory, "default/secret-test.yaml"), `--- 409 | # Source: input.yaml 410 | apiVersion: v1 411 | kind: Secret 412 | metadata: 413 | name: test 414 | namespace: default 415 | `) 416 | require.Nil(t, err) 417 | } 418 | 419 | func TestOverwrite(t *testing.T) { 420 | // Setup options 421 | o := &options{ 422 | inputs: []string{"input.yaml"}, 423 | output: outputDirectory, 424 | } 425 | 426 | // Setup memory backed filesystem 427 | fs := afero.NewMemMapFs() 428 | 429 | // Create input manifests 430 | manifests := ` 431 | apiVersion: v1 432 | kind: Secret 433 | metadata: 434 | name: test 435 | ` 436 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 437 | require.Nil(t, err) 438 | err = o.run(fs) 439 | require.Nil(t, err) 440 | err = o.run(fs) 441 | require.Equal(t, err.Error(), "file already exists: output/namespaces/default/secret-test.yaml") 442 | 443 | // Set overwrite 444 | o.overwrite = true 445 | err = o.run(fs) 446 | require.Nil(t, err) 447 | } 448 | 449 | func TestCreateMissingNamespaces(t *testing.T) { 450 | // Setup options 451 | o := &options{ 452 | inputs: []string{"input.yaml"}, 453 | output: outputDirectory, 454 | createMissingNamespaces: true, 455 | } 456 | 457 | // Setup memory backed filesystem 458 | fs := afero.NewMemMapFs() 459 | 460 | // Create input manifests 461 | manifests := ` 462 | apiVersion: apps/v1 463 | kind: Deployment 464 | metadata: 465 | name: nginx 466 | namespace: nginx 467 | spec: 468 | selector: 469 | matchLabels: 470 | app: nginx 471 | template: 472 | metadata: 473 | labels: 474 | app: nginx 475 | spec: 476 | containers: 477 | - name: nginx 478 | image: nginx 479 | ports: 480 | - containerPort: 80 481 | ` 482 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 483 | require.Nil(t, err) 484 | 485 | // Format input manifests 486 | err = o.run(fs) 487 | require.Nil(t, err) 488 | 489 | // Ensure nginx namespace is created 490 | err = requireRegularFileContents(fs, path.Join(outputDirectory, nonNamespacedDirectory, "namespaces/nginx.yaml"), `--- 491 | apiVersion: v1 492 | kind: Namespace 493 | metadata: 494 | name: nginx 495 | `) 496 | require.Nil(t, err) 497 | } 498 | 499 | func TestVersion(t *testing.T) { 500 | // Setup options 501 | o := &options{ 502 | inputs: []string{"input.yaml"}, 503 | output: outputDirectory, 504 | version: true, 505 | } 506 | 507 | // Setup memory backed filesystem 508 | fs := afero.NewMemMapFs() 509 | 510 | // Create input manifests 511 | manifests := ` 512 | apiVersion: v1 513 | kind: Secret 514 | metadata: 515 | name: test 516 | ` 517 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 518 | require.Nil(t, err) 519 | err = o.run(fs) 520 | require.Nil(t, err) 521 | err = requireFileIsNotExist(fs, path.Join(outputDirectory, namespacedDirectory, "default/secret-test.yaml")) 522 | require.Nil(t, err) 523 | 524 | // Disable version 525 | o.version = false 526 | err = o.run(fs) 527 | require.Nil(t, err) 528 | err = requireRegularFileContents(fs, path.Join(outputDirectory, namespacedDirectory, "default/secret-test.yaml"), `--- 529 | apiVersion: v1 530 | kind: Secret 531 | metadata: 532 | name: test 533 | namespace: default 534 | `) 535 | require.Nil(t, err) 536 | } 537 | 538 | func TestNamespacesAnnotation(t *testing.T) { 539 | // Setup options 540 | o := &options{ 541 | inputs: []string{"input.yaml"}, 542 | output: outputDirectory, 543 | } 544 | 545 | // Setup memory backed filesystem 546 | fs := afero.NewMemMapFs() 547 | 548 | // Create input manifests 549 | manifests := fmt.Sprintf(` 550 | apiVersion: v1 551 | kind: ResourceQuota 552 | metadata: 553 | name: pods-high 554 | namespace: test 555 | annotations: 556 | %s: "%s,-bar" 557 | another: annotation 558 | spec: 559 | hard: 560 | pods: "20" 561 | --- 562 | apiVersion: v1 563 | kind: Namespace 564 | metadata: 565 | name: foo 566 | --- 567 | apiVersion: v1 568 | kind: Namespace 569 | metadata: 570 | name: bar 571 | `, annotationNamespacesKey, annotationNamespacesAll) 572 | err := afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 573 | require.Nil(t, err) 574 | err = o.run(fs) 575 | require.Nil(t, err) 576 | 577 | // Require ResourceQuota exists in the foo Namespace 578 | err = requireRegularFileContents(fs, path.Join(outputDirectory, namespacedDirectory, "foo/resourcequota-pods-high.yaml"), `--- 579 | apiVersion: v1 580 | kind: ResourceQuota 581 | metadata: 582 | name: pods-high 583 | namespace: foo 584 | annotations: 585 | another: annotation 586 | spec: 587 | hard: 588 | pods: "20" 589 | `) 590 | require.Nil(t, err) 591 | 592 | // Require ResourceQuota is missing in the bar Namespace 593 | err = requireFileIsNotExist(fs, path.Join(outputDirectory, namespacedDirectory, "bar/resourcequota-pods-high.yaml")) 594 | require.Nil(t, err) 595 | 596 | // Require ResourceQuota is missing in the default Namespace 597 | err = requireFileIsNotExist(fs, path.Join(outputDirectory, namespacedDirectory, "default/resourcequota-pods-high.yaml")) 598 | require.Nil(t, err) 599 | 600 | // Verify that specifying a missing Namespace causes an error 601 | manifests = fmt.Sprintf(` 602 | apiVersion: v1 603 | kind: ResourceQuota 604 | metadata: 605 | name: pods-high 606 | annotations: 607 | %s: example 608 | spec: 609 | hard: 610 | pods: "20" 611 | `, annotationNamespacesKey) 612 | err = afero.WriteFile(fs, "input.yaml", []byte(manifests), 0644) 613 | require.Nil(t, err) 614 | err = o.run(fs) 615 | require.Equal(t, err.Error(), fmt.Sprintf("Namespace \"example\" not found when processing annotation %s", annotationNamespacesKey)) 616 | } 617 | 618 | // TODO: Test discovery and kubeconfig 619 | -------------------------------------------------------------------------------- /cmd/kfmt/options.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path/filepath" 7 | "strings" 8 | 9 | "github.com/dippynark/kfmt/pkg/discovery" 10 | "github.com/dippynark/kfmt/pkg/utils" 11 | "github.com/pkg/errors" 12 | "github.com/spf13/afero" 13 | corev1 "k8s.io/api/core/v1" 14 | "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" 15 | "k8s.io/apimachinery/pkg/runtime/schema" 16 | "k8s.io/client-go/tools/clientcmd" 17 | "sigs.k8s.io/kustomize/kyaml/kio" 18 | "sigs.k8s.io/kustomize/kyaml/yaml" 19 | ) 20 | 21 | type options struct { 22 | output string 23 | inputs []string 24 | filters []string 25 | gvkScopes []string 26 | namespace string 27 | clean bool 28 | strict bool 29 | remove bool 30 | comment bool 31 | overwrite bool 32 | createMissingNamespaces bool 33 | discovery bool 34 | kubeconfig string 35 | version bool 36 | } 37 | 38 | func (o *options) run(fs afero.Fs) error { 39 | // Print version 40 | if o.version { 41 | fmt.Println(version) 42 | return nil 43 | } 44 | 45 | // Validate options 46 | if o.output == "" { 47 | return errors.Errorf("output directory not specified") 48 | } 49 | 50 | // Initialise discovery to determine whether resources are namespaced or not 51 | resourceInspector, err := o.getResourceInspector() 52 | if err != nil { 53 | return err 54 | } 55 | 56 | // Find all YAML files specified as input 57 | yamlFiles, err := o.findYAMLFiles(fs) 58 | if err != nil { 59 | return err 60 | } 61 | 62 | // Map input files to nodes (parsed YAML documents) 63 | yamlFileNodes, err := o.findYAMLFileNodes(fs, yamlFiles) 64 | if err != nil { 65 | return err 66 | } 67 | 68 | // Add local CRDs to discovery 69 | err = o.localDiscovery(yamlFileNodes, resourceInspector) 70 | if err != nil { 71 | return err 72 | } 73 | 74 | // Add manually specified GVK scopes to discovery 75 | err = o.manualDiscovery(resourceInspector) 76 | if err != nil { 77 | return err 78 | } 79 | 80 | // Find all Namespaces either declared as resources or appearing in the metadata.namespace field 81 | allNamespaces, err := o.findAllNamespaces(yamlFileNodes, resourceInspector) 82 | if err != nil { 83 | return err 84 | } 85 | 86 | // Remove nodes that match filters 87 | err = o.filterNodes(yamlFileNodes) 88 | if err != nil { 89 | return err 90 | } 91 | 92 | // Apply Namespace field defaults to namespaced resources and remove Namespace field from 93 | // non-namespaced resources 94 | err = o.defaultNamespaces(yamlFileNodes, resourceInspector) 95 | if err != nil { 96 | return err 97 | } 98 | 99 | // Apply `kfmt.dev/namespaces` annotation 100 | err = o.mirrorNodes(yamlFileNodes, allNamespaces, resourceInspector) 101 | if err != nil { 102 | return err 103 | } 104 | 105 | // Write nodes to disk into output directory 106 | err = o.writeManifests(yamlFileNodes, resourceInspector, fs) 107 | if err != nil { 108 | return err 109 | } 110 | 111 | // Remove processed YAML files 112 | err = o.removeYAMLFiles(yamlFileNodes, fs) 113 | if err != nil { 114 | return err 115 | } 116 | 117 | // Create missing Namespace manifests 118 | if err := o.createMissingNamespaceManifests(allNamespaces, fs); err != nil { 119 | return err 120 | } 121 | 122 | return nil 123 | } 124 | 125 | func (o *options) getResourceInspector() (discovery.ResourceInspector, error) { 126 | var resourceInspector discovery.ResourceInspector 127 | if o.discovery { 128 | restcfg, err := clientcmd.BuildConfigFromFlags("", o.kubeconfig) 129 | if err != nil { 130 | return resourceInspector, errors.Wrap(err, "failed to build kubernetes REST client config") 131 | } 132 | resourceInspector, err = discovery.NewAPIServerResourceInspector(restcfg) 133 | if err != nil { 134 | return resourceInspector, errors.Wrap(err, "failed to construct APIServer backed resource inspector") 135 | } 136 | } else { 137 | var err error 138 | resourceInspector, err = discovery.NewLocalResourceInspector() 139 | if err != nil { 140 | return resourceInspector, errors.Wrap(err, "failed to construct locally backed resource inspector") 141 | } 142 | } 143 | 144 | return resourceInspector, nil 145 | } 146 | 147 | func (o *options) findYAMLFiles(fs afero.Fs) ([]string, error) { 148 | var yamlFiles []string 149 | if len(o.inputs) > 0 { 150 | for _, input := range o.inputs { 151 | info, err := fs.Stat(input) 152 | if err != nil { 153 | return yamlFiles, err 154 | } 155 | switch mode := info.Mode(); { 156 | case mode.IsDir(): 157 | inputFiles, err := listYAMLFiles(fs, input) 158 | if err != nil { 159 | return yamlFiles, err 160 | } 161 | yamlFiles = append(yamlFiles, inputFiles...) 162 | default: 163 | yamlFiles = append(yamlFiles, input) 164 | } 165 | } 166 | } else { 167 | // Read from stdin if no input specified 168 | yamlFiles = []string{os.Stdin.Name()} 169 | } 170 | return yamlFiles, nil 171 | } 172 | 173 | func (o *options) findYAMLFileNodes(fs afero.Fs, yamlFiles []string) (map[string][]*yaml.RNode, error) { 174 | yamlFileNodes := map[string][]*yaml.RNode{} 175 | for _, yamlFile := range yamlFiles { 176 | b, err := afero.ReadFile(fs, yamlFile) 177 | if err != nil { 178 | return yamlFileNodes, err 179 | } 180 | newNodes, err := kio.FromBytes(b) 181 | if err != nil { 182 | return yamlFileNodes, err 183 | } 184 | yamlFileNodes[yamlFile] = newNodes 185 | } 186 | return yamlFileNodes, nil 187 | } 188 | 189 | func (o *options) localDiscovery(yamlFileNodes map[string][]*yaml.RNode, resourceInspector discovery.ResourceInspector) error { 190 | for yamlFile, nodes := range yamlFileNodes { 191 | resources, err := findResources(nodes) 192 | if err != nil { 193 | return errors.Wrapf(err, "failed to find CRDs in %s", yamlFile) 194 | } 195 | for gvk, namespaced := range resources { 196 | resourceInspector.AddGVKToScope(gvk, namespaced) 197 | } 198 | } 199 | return nil 200 | } 201 | 202 | func (o *options) manualDiscovery(resourceInspector discovery.ResourceInspector) error { 203 | for _, gvkScope := range o.gvkScopes { 204 | i := strings.Index(gvkScope, ":") 205 | if i == -1 { 206 | return fmt.Errorf("failed to parse GVK scope: %s", gvkScope) 207 | } 208 | 209 | gvkString := gvkScope[:i] 210 | scope := gvkScope[i+1:] 211 | 212 | var namespaced bool 213 | switch apiextensions.ResourceScope(scope) { 214 | case apiextensions.ClusterScoped: 215 | namespaced = false 216 | case apiextensions.NamespaceScoped: 217 | namespaced = true 218 | default: 219 | return fmt.Errorf("unrecognised scope %s", scope) 220 | } 221 | 222 | i = strings.Index(gvkString, ".") 223 | if i == -1 { 224 | return fmt.Errorf("failed to parse GVK: %s", gvkString) 225 | } 226 | 227 | kind := gvkString[:i] 228 | gvString := gvkString[i+1:] 229 | 230 | gv, err := schema.ParseGroupVersion(gvString) 231 | if err != nil { 232 | return err 233 | } 234 | 235 | gvk := schema.GroupVersionKind{ 236 | Group: gv.Group, 237 | Version: gv.Version, 238 | Kind: kind, 239 | } 240 | 241 | resourceInspector.AddGVKToScope(gvk, namespaced) 242 | } 243 | 244 | return nil 245 | } 246 | 247 | func (o *options) findAllNamespaces(yamlFileNodes map[string][]*yaml.RNode, resourceInspector discovery.ResourceInspector) (map[string]struct{}, error) { 248 | allNamespaces := map[string]struct{}{} 249 | for yamlFile, nodes := range yamlFileNodes { 250 | newNamespaces, err := o.findNamespaces(nodes, resourceInspector) 251 | if err != nil { 252 | return allNamespaces, errors.Wrapf(err, "failed to find Namespaces in %s", yamlFile) 253 | } 254 | for k, v := range newNamespaces { 255 | allNamespaces[k] = v 256 | } 257 | } 258 | return allNamespaces, nil 259 | } 260 | 261 | func (o *options) filterNodes(yamlFileNodes map[string][]*yaml.RNode) error { 262 | for yamlFile, nodes := range yamlFileNodes { 263 | filteredNodes := []*yaml.RNode{} 264 | for _, node := range nodes { 265 | isFiltered, err := o.isFiltered(node) 266 | if err != nil { 267 | return err 268 | } 269 | if isFiltered { 270 | continue 271 | } 272 | filteredNodes = append(filteredNodes, node) 273 | } 274 | yamlFileNodes[yamlFile] = filteredNodes 275 | } 276 | return nil 277 | } 278 | 279 | func (o *options) defaultNamespaces(yamlFileNodes map[string][]*yaml.RNode, resourceInspector discovery.ResourceInspector) error { 280 | for yamlFile, nodes := range yamlFileNodes { 281 | newNodes := []*yaml.RNode{} 282 | for _, node := range nodes { 283 | 284 | namespace, err := utils.GetNamespace(node) 285 | if err != nil { 286 | return errors.Wrap(err, "failed to get namespace") 287 | } 288 | 289 | gvk, err := utils.GetGVK(node) 290 | if err != nil { 291 | return err 292 | } 293 | 294 | isNamespaced, err := resourceInspector.IsNamespaced(gvk) 295 | if err != nil { 296 | return err 297 | } 298 | 299 | if isNamespaced { 300 | if namespace == "" { 301 | if o.namespace != "" { 302 | namespace = o.namespace 303 | } else { 304 | namespace = corev1.NamespaceDefault 305 | } 306 | err = node.SetNamespace(namespace) 307 | if err != nil { 308 | return err 309 | } 310 | } 311 | } else { 312 | if namespace != "" { 313 | if o.clean { 314 | err = node.SetNamespace("") 315 | if err != nil { 316 | return err 317 | } 318 | namespace = "" 319 | } 320 | } 321 | 322 | if o.strict { 323 | if namespace != "" { 324 | return fmt.Errorf("metadata.namespace field should not be set for cluster-scoped resource: %s", gvk.String()) 325 | } 326 | } 327 | } 328 | newNodes = append(newNodes, node) 329 | } 330 | yamlFileNodes[yamlFile] = newNodes 331 | } 332 | return nil 333 | } 334 | 335 | func (o *options) mirrorNodes(yamlFileNodes map[string][]*yaml.RNode, allNamespaces map[string]struct{}, resourceInspector discovery.ResourceInspector) error { 336 | for yamlFile, nodes := range yamlFileNodes { 337 | newNodes := []*yaml.RNode{} 338 | for _, node := range nodes { 339 | 340 | gvk, err := utils.GetGVK(node) 341 | if err != nil { 342 | return err 343 | } 344 | 345 | isNamespaced, err := resourceInspector.IsNamespaced(gvk) 346 | if err != nil { 347 | return err 348 | } 349 | 350 | if isNamespaced { 351 | originalNamespace, err := utils.GetNamespace(node) 352 | if err != nil { 353 | return errors.Wrap(err, "failed to get namespace") 354 | } 355 | if originalNamespace == "" { 356 | return errors.New("failed to get namespace") 357 | } 358 | 359 | annotations, err := utils.GetAnnotations(node) 360 | if err != nil { 361 | return err 362 | } 363 | namespaces := map[string]struct{}{originalNamespace: {}} 364 | excludedNamespaces := map[string]struct{}{} 365 | namespacesAnnotation, ok := annotations[annotationNamespacesKey] 366 | if ok { 367 | for _, namespacesAnnotationNamespace := range strings.Split(namespacesAnnotation, ",") { 368 | if namespacesAnnotationNamespace == annotationNamespacesAll { 369 | for namespace := range allNamespaces { 370 | namespaces[namespace] = struct{}{} 371 | } 372 | } else if strings.HasPrefix(namespacesAnnotationNamespace, "-") { 373 | excludedNamespaces[strings.TrimPrefix(namespacesAnnotationNamespace, "-")] = struct{}{} 374 | } else { 375 | if _, ok := allNamespaces[namespacesAnnotationNamespace]; !ok { 376 | // We cannot allow this annotation to create new Namespaces because otherwise the meaning of "*" (annotationNamespacesAll) is inconsistent 377 | return fmt.Errorf("Namespace \"%s\" not found when processing annotation %s", namespacesAnnotationNamespace, annotationNamespacesKey) 378 | } 379 | namespaces[namespacesAnnotationNamespace] = struct{}{} 380 | } 381 | } 382 | // Clear annotation 383 | delete(annotations, annotationNamespacesKey) 384 | node.SetAnnotations(annotations) 385 | } 386 | 387 | for namespace := range namespaces { 388 | // Do not copy if namespace is excluded 389 | if _, ok := excludedNamespaces[namespace]; ok { 390 | continue 391 | } 392 | 393 | // Check if node matches another node once the namespace is modified. This allows `*` to 394 | // be used to specifiy a Namespace default but allow it to be overridden on a 395 | // per-Namespace basis 396 | nodeCopy := node.Copy() 397 | err = nodeCopy.SetNamespace(namespace) 398 | if err != nil { 399 | return err 400 | } 401 | if namespace != originalNamespace { 402 | clashing, err := o.isClashing(nodeCopy, yamlFileNodes, resourceInspector) 403 | if err != nil { 404 | return err 405 | } 406 | 407 | if clashing { 408 | continue 409 | } 410 | } 411 | 412 | newNodes = append(newNodes, nodeCopy) 413 | } 414 | } else { 415 | newNodes = append(newNodes, node) 416 | } 417 | } 418 | yamlFileNodes[yamlFile] = newNodes 419 | } 420 | return nil 421 | } 422 | 423 | func (o *options) writeManifests(yamlFileNodes map[string][]*yaml.RNode, resourceInspector discovery.ResourceInspector, fs afero.Fs) error { 424 | for yamlFile, nodes := range yamlFileNodes { 425 | for _, node := range nodes { 426 | 427 | outputFile, err := o.getOutputFile(node, resourceInspector) 428 | if err != nil { 429 | return errors.Wrapf(err, "failed to get output file for resource in input file %s", yamlFile) 430 | } 431 | 432 | err = o.writeManifest(yamlFile, outputFile, node, fs) 433 | if err != nil { 434 | return err 435 | } 436 | } 437 | } 438 | return nil 439 | } 440 | 441 | func (o *options) removeYAMLFiles(yamlFileNodes map[string][]*yaml.RNode, fs afero.Fs) error { 442 | if o.remove { 443 | for yamlFile := range yamlFileNodes { 444 | // Ignore stdin 445 | if yamlFile == os.Stdin.Name() { 446 | continue 447 | } 448 | err := fs.Remove(yamlFile) 449 | if err != nil { 450 | return errors.Wrapf(err, "failed to remove input file %s", yamlFile) 451 | } 452 | } 453 | } 454 | return nil 455 | } 456 | 457 | // createMissingNamespaceManifests creates missing Namespace manifests 458 | func (o *options) createMissingNamespaceManifests(allNamespaces map[string]struct{}, fs afero.Fs) error { 459 | if o.createMissingNamespaces { 460 | for namespace := range allNamespaces { 461 | namespaceFile := filepath.Join(o.output, nonNamespacedDirectory, "namespaces", namespace+".yaml") 462 | 463 | if _, err := fs.Stat(namespaceFile); os.IsNotExist(err) { 464 | err = fs.MkdirAll(filepath.Dir(namespaceFile), defaultDirectoryPerms) 465 | if err != nil { 466 | return err 467 | } 468 | 469 | namespaceManifest := fmt.Sprintf(manifestSeparator+`apiVersion: v1 470 | kind: Namespace 471 | metadata: 472 | name: %s 473 | `, namespace) 474 | err = afero.WriteFile(fs, namespaceFile, []byte(namespaceManifest), defaultFilePerms) 475 | if err != nil { 476 | return err 477 | } 478 | } 479 | } 480 | } 481 | return nil 482 | } 483 | 484 | func (o *options) getOutputFile(node *yaml.RNode, resourceInspector discovery.ResourceInspector) (string, error) { 485 | var outputFile string 486 | 487 | gvk, err := utils.GetGVK(node) 488 | if err != nil { 489 | return outputFile, err 490 | } 491 | 492 | isNamespaced, err := resourceInspector.IsNamespaced(gvk) 493 | if err != nil { 494 | return outputFile, err 495 | } 496 | 497 | name, err := utils.GetName(node) 498 | if err != nil { 499 | return outputFile, errors.Wrap(err, "failed to get name") 500 | } 501 | 502 | if isNamespaced { 503 | namespace, err := utils.GetNamespace(node) 504 | if err != nil || namespace == "" { 505 | return outputFile, errors.Wrap(err, "failed to get namespace") 506 | } 507 | 508 | outputFile = o.getNamespacedOutputFile(name, namespace, gvk, resourceInspector) 509 | } else { 510 | outputFile = o.getNonNamespacedOutputFile(name, gvk, resourceInspector) 511 | } 512 | 513 | return outputFile, nil 514 | } 515 | 516 | func (o *options) isClashing(candidateNode *yaml.RNode, yamlFileNodes map[string][]*yaml.RNode, resourceInspector discovery.ResourceInspector) (bool, error) { 517 | candidateOutputFile, err := o.getOutputFile(candidateNode, resourceInspector) 518 | if err != nil { 519 | return false, err 520 | } 521 | 522 | for _, nodes := range yamlFileNodes { 523 | for _, node := range nodes { 524 | outputFile, err := o.getOutputFile(node, resourceInspector) 525 | if err != nil { 526 | return false, err 527 | } 528 | 529 | if candidateOutputFile == outputFile { 530 | return true, nil 531 | } 532 | } 533 | } 534 | 535 | return false, nil 536 | } 537 | 538 | func (o *options) isFiltered(node *yaml.RNode) (bool, error) { 539 | gvk, err := utils.GetGVK(node) 540 | if err != nil { 541 | return false, err 542 | } 543 | 544 | for _, filter := range o.filters { 545 | if gvk.GroupKind().String() == filter { 546 | return true, nil 547 | } 548 | } 549 | return false, nil 550 | } 551 | 552 | // findNamespaces finds used namespaces 553 | func (o *options) findNamespaces(nodes []*yaml.RNode, resourceInspector discovery.ResourceInspector) (map[string]struct{}, error) { 554 | namespaces := map[string]struct{}{} 555 | 556 | // Look for namespaces in each manifest 557 | for _, node := range nodes { 558 | 559 | kind, err := utils.GetKind(node) 560 | if err != nil { 561 | return namespaces, errors.Wrap(err, "failed to get kind") 562 | } 563 | 564 | if kind == "Namespace" { 565 | name, err := utils.GetName(node) 566 | if err != nil { 567 | return namespaces, err 568 | } 569 | 570 | namespaces[name] = struct{}{} 571 | } else { 572 | 573 | apiVersion, err := utils.GetAPIVersion(node) 574 | if err != nil { 575 | return namespaces, errors.Wrap(err, "failed to get apiVersion") 576 | } 577 | 578 | gvk := schema.FromAPIVersionAndKind(apiVersion, kind) 579 | 580 | // Ignore filtered resources 581 | isFiltered := false 582 | for _, filter := range o.filters { 583 | if gvk.GroupKind().String() == filter { 584 | isFiltered = true 585 | break 586 | } 587 | } 588 | if isFiltered { 589 | continue 590 | } 591 | 592 | isNamespaced, err := resourceInspector.IsNamespaced(gvk) 593 | if err != nil { 594 | return namespaces, err 595 | } 596 | 597 | if isNamespaced { 598 | namespace, err := utils.GetNamespace(node) 599 | if err != nil { 600 | return namespaces, err 601 | } 602 | if namespace == "" { 603 | if o.namespace != "" { 604 | namespace = o.namespace 605 | } else { 606 | namespace = corev1.NamespaceDefault 607 | } 608 | } 609 | namespaces[namespace] = struct{}{} 610 | } 611 | } 612 | } 613 | 614 | return namespaces, nil 615 | } 616 | 617 | // listYAMLFiles lists YAML files to be processed 618 | func listYAMLFiles(fs afero.Fs, inputDir string) ([]string, error) { 619 | var files []string 620 | 621 | err := afero.Walk(fs, inputDir, 622 | func(path string, info os.FileInfo, err error) error { 623 | if err != nil { 624 | return err 625 | } 626 | 627 | // Assume regular file is valid YAML file if it has an appropriate extension 628 | if info.Mode().IsRegular() && (strings.HasSuffix(path, ".yaml") || strings.HasSuffix(path, ".yml")) { 629 | files = append(files, path) 630 | } 631 | return nil 632 | }) 633 | if err != nil { 634 | return files, err 635 | } 636 | 637 | return files, err 638 | } 639 | 640 | // findResources finds resources defined as CRDs to add to discovery 641 | func findResources(nodes []*yaml.RNode) (map[schema.GroupVersionKind]bool, error) { 642 | resources := map[schema.GroupVersionKind]bool{} 643 | 644 | // Look for a resource definition in each manifest 645 | for _, node := range nodes { 646 | 647 | kind, err := utils.GetKind(node) 648 | if err != nil { 649 | return resources, err 650 | } 651 | 652 | if kind != "CustomResourceDefinition" { 653 | continue 654 | } 655 | 656 | resourceGroup, err := utils.GetCRDGroup(node) 657 | if err != nil { 658 | return resources, err 659 | } 660 | 661 | resourceKind, err := utils.GetCRDKind(node) 662 | if err != nil { 663 | return resources, err 664 | } 665 | 666 | resourceScope, err := utils.GetCRDScope(node) 667 | if err != nil { 668 | return resources, err 669 | } 670 | namespaced := false 671 | if resourceScope == "Namespaced" { 672 | namespaced = true 673 | } 674 | 675 | resourceVersions, err := utils.GetCRDVersions(node) 676 | if err != nil { 677 | return resources, err 678 | } 679 | 680 | for _, resourceVersion := range resourceVersions { 681 | gvk := schema.GroupVersionKind{ 682 | Group: resourceGroup, 683 | Version: resourceVersion, 684 | Kind: resourceKind, 685 | } 686 | // TODO: should we allow discovery information to be overwritten? 687 | // if _, ok := resources[gvk]; ok { 688 | // return resources, fmt.Errorf("resource already exists: %s", gvk.String()) 689 | // } 690 | resources[gvk] = namespaced 691 | } 692 | } 693 | 694 | return resources, nil 695 | } 696 | 697 | func (o *options) writeManifest(inputFile string, outputFile string, node *yaml.RNode, fs afero.Fs) error { 698 | 699 | if !o.overwrite { 700 | // https://stackoverflow.com/a/12518877/6180803 701 | if _, err := fs.Stat(outputFile); err == nil { 702 | return fmt.Errorf("file already exists: %s", outputFile) 703 | } 704 | } 705 | 706 | s, err := node.String() 707 | if err != nil { 708 | return err 709 | } 710 | 711 | err = fs.MkdirAll(filepath.Dir(outputFile), defaultDirectoryPerms) 712 | if err != nil { 713 | return err 714 | } 715 | 716 | comment := "" 717 | if o.comment { 718 | comment = fmt.Sprintf("# Source: %s\n", inputFile) 719 | } 720 | err = afero.WriteFile(fs, outputFile, []byte(manifestSeparator+comment+s), defaultFilePerms) 721 | if err != nil { 722 | return err 723 | } 724 | return nil 725 | } 726 | 727 | func (o *options) getNonNamespacedOutputFile(name string, gvk schema.GroupVersionKind, resourceInspector discovery.ResourceInspector) string { 728 | subdirectory := utils.Pluralise(strings.ToLower(gvk.Kind)) 729 | // Prefix with group if not core 730 | if !resourceInspector.IsCoreGroup(gvk.Group) { 731 | subdirectory = utils.Pluralise(strings.ToLower(gvk.Kind)) + "." + gvk.Group 732 | } 733 | return filepath.Join(o.output, nonNamespacedDirectory, subdirectory, name+".yaml") 734 | } 735 | 736 | func (o *options) getNamespacedOutputFile(name, namespace string, gvk schema.GroupVersionKind, resourceInspector discovery.ResourceInspector) string { 737 | fileName := strings.ToLower(gvk.Kind) + "-" + name + ".yaml" 738 | // Prefix with group if not core 739 | if !resourceInspector.IsCoreGroup(gvk.Group) { 740 | fileName = strings.ToLower(gvk.Kind) + "." + gvk.Group + "-" + name + ".yaml" 741 | } 742 | 743 | return filepath.Join(o.output, namespacedDirectory, namespace, fileName) 744 | } 745 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 3 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 4 | cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= 5 | cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= 6 | cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= 7 | cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= 8 | cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= 9 | cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= 10 | cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= 11 | cloud.google.com/go v0.54.0 h1:3ithwDMr7/3vpAMXiH+ZQnYbuIsh+OPhUPMFC9enmn0= 12 | cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= 13 | cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= 14 | cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= 15 | cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= 16 | cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= 17 | cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= 18 | cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= 19 | cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= 20 | cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= 21 | cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= 22 | cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= 23 | cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= 24 | cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= 25 | dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 26 | github.com/360EntSecGroup-Skylar/excelize v1.4.1/go.mod h1:vnax29X2usfl7HHkBrX5EvSCJcmH3dT9luvxzu8iGAE= 27 | github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= 28 | github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= 29 | github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= 30 | github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= 31 | github.com/Azure/go-autorest/autorest v0.11.17 h1:2zCdHwNgRH+St1J+ZMf66xI8aLr/5KMy+wWLH97zwYM= 32 | github.com/Azure/go-autorest/autorest v0.11.17/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= 33 | github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= 34 | github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= 35 | github.com/Azure/go-autorest/autorest/adal v0.9.10 h1:r6fZHMaHD8B6LDCn0o5vyBFHIHrM6Ywwx7mb49lPItI= 36 | github.com/Azure/go-autorest/autorest/adal v0.9.10/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= 37 | github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= 38 | github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= 39 | github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= 40 | github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= 41 | github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= 42 | github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE= 43 | github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= 44 | github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= 45 | github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= 46 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 47 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 48 | github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= 49 | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 50 | github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg= 51 | github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= 52 | github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= 53 | github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= 54 | github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= 55 | github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= 56 | github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= 57 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 58 | github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 59 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 60 | github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 61 | github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= 62 | github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= 63 | github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= 64 | github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= 65 | github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= 66 | github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= 67 | github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= 68 | github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= 69 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 70 | github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 71 | github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= 72 | github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= 73 | github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= 74 | github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= 75 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 76 | github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 77 | github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 78 | github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= 79 | github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= 80 | github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 81 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 82 | github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= 83 | github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= 84 | github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= 85 | github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= 86 | github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= 87 | github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 88 | github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 89 | github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 90 | github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 91 | github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 92 | github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 93 | github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 94 | github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= 95 | github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 96 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 97 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 98 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 99 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 100 | github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 101 | github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= 102 | github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= 103 | github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= 104 | github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= 105 | github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 106 | github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 107 | github.com/dustmop/soup v1.1.2-0.20190516214245-38228baa104e/go.mod h1:CgNC6SGbT+Xb8wGGvzilttZL1mc5sQ/5KkcxsZttMIk= 108 | github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= 109 | github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= 110 | github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= 111 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 112 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 113 | github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= 114 | github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= 115 | github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 116 | github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= 117 | github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= 118 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 119 | github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= 120 | github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= 121 | github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 122 | github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 123 | github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= 124 | github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= 125 | github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= 126 | github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= 127 | github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= 128 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 129 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 130 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 131 | github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 132 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 133 | github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= 134 | github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= 135 | github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= 136 | github.com/go-logr/logr v0.2.1 h1:fV3MLmabKIZ383XifUjFSwcoGee0v9qgPp8wy5svibE= 137 | github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= 138 | github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= 139 | github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= 140 | github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= 141 | github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= 142 | github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= 143 | github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= 144 | github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= 145 | github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= 146 | github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= 147 | github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= 148 | github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= 149 | github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= 150 | github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= 151 | github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= 152 | github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= 153 | github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= 154 | github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= 155 | github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= 156 | github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= 157 | github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= 158 | github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= 159 | github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= 160 | github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= 161 | github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= 162 | github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= 163 | github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= 164 | github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= 165 | github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= 166 | github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= 167 | github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= 168 | github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= 169 | github.com/go-openapi/spec v0.19.7 h1:0xWSeMd35y5avQAThZR2PkEuqSosoS5t6gDH4L8n11M= 170 | github.com/go-openapi/spec v0.19.7/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= 171 | github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= 172 | github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= 173 | github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= 174 | github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= 175 | github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= 176 | github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= 177 | github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= 178 | github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= 179 | github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= 180 | github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= 181 | github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= 182 | github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= 183 | github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= 184 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 185 | github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= 186 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 187 | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= 188 | github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= 189 | github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= 190 | github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= 191 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 192 | github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 193 | github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 194 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 195 | github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 196 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 197 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 198 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 199 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 200 | github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 201 | github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 202 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 203 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 204 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 205 | github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 206 | github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 207 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 208 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 209 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 210 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 211 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 212 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 213 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 214 | github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= 215 | github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 216 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 217 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 218 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 219 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 220 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 221 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 222 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 223 | github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= 224 | github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 225 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 226 | github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= 227 | github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 228 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 229 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 230 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 231 | github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 232 | github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 233 | github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 234 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 235 | github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 236 | github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 237 | github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 238 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 239 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 240 | github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= 241 | github.com/googleapis/gnostic v0.4.2 h1:uh5EXM/5/ki6d0p/FoUxuiN8KHpo1w572UXQdB2MnTg= 242 | github.com/googleapis/gnostic v0.4.2/go.mod h1:P0d+GwDcJO8XvMi7aihGGl/CkivFa9JX/V/FfjyYzI0= 243 | github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= 244 | github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= 245 | github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= 246 | github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 247 | github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= 248 | github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= 249 | github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= 250 | github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= 251 | github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 252 | github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 253 | github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= 254 | github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= 255 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 256 | github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 257 | github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= 258 | github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 259 | github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= 260 | github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= 261 | github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= 262 | github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= 263 | github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 264 | github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 265 | github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 266 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 267 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 268 | github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= 269 | github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= 270 | github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= 271 | github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= 272 | github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= 273 | github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= 274 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 275 | github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= 276 | github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= 277 | github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= 278 | github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= 279 | github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= 280 | github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 281 | github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= 282 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 283 | github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 284 | github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= 285 | github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 286 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 287 | github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= 288 | github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 289 | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 290 | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= 291 | github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 292 | github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= 293 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 294 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 295 | github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 296 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 297 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 298 | github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= 299 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 300 | github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= 301 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 302 | github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 303 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 304 | github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 305 | github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 306 | github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 307 | github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 308 | github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 309 | github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 310 | github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= 311 | github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= 312 | github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= 313 | github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 314 | github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 315 | github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 316 | github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= 317 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 318 | github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= 319 | github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= 320 | github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= 321 | github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 322 | github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 323 | github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= 324 | github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= 325 | github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= 326 | github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 327 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 328 | github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= 329 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 330 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 331 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 332 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 333 | github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= 334 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 335 | github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= 336 | github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= 337 | github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= 338 | github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= 339 | github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= 340 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 341 | github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= 342 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= 343 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= 344 | github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 345 | github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= 346 | github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 347 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 348 | github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= 349 | github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 350 | github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= 351 | github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= 352 | github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 353 | github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 354 | github.com/paulmach/orb v0.1.3/go.mod h1:VFlX/8C+IQ1p6FTRRKzKoOPJnvEtA5G0Veuqwbu//Vk= 355 | github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= 356 | github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= 357 | github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= 358 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 359 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 360 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 361 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 362 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 363 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 364 | github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= 365 | github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= 366 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 367 | github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= 368 | github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= 369 | github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= 370 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 371 | github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 372 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 373 | github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 374 | github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 375 | github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 376 | github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 377 | github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= 378 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 379 | github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 380 | github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 381 | github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= 382 | github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= 383 | github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= 384 | github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d/go.mod h1:7DPO4domFU579Ga6E61sB9VFNaniPVwJP5C4bBCu3wA= 385 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= 386 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 387 | github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 388 | github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= 389 | github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 390 | github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= 391 | github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= 392 | github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 393 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 394 | github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 395 | github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= 396 | github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= 397 | github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= 398 | github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= 399 | github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 400 | github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 401 | github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= 402 | github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= 403 | github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= 404 | github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= 405 | github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= 406 | github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= 407 | github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= 408 | github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= 409 | github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 410 | github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 411 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 412 | github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= 413 | github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 414 | github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= 415 | github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= 416 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 417 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 418 | github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= 419 | github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= 420 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 421 | github.com/stretchr/testify v1.2.3-0.20181224173747-660f15d67dbb/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 422 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 423 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 424 | github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= 425 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 426 | github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= 427 | github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= 428 | github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= 429 | github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= 430 | github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= 431 | github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= 432 | github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= 433 | github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= 434 | github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca h1:1CFlNzQhALwjS9mBAUkycX616GzgsuYUOCHA5+HSlXI= 435 | github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= 436 | github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= 437 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 438 | github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 439 | go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= 440 | go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= 441 | go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= 442 | go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= 443 | go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= 444 | go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= 445 | go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= 446 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 447 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 448 | go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 449 | go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 450 | go.starlark.net v0.0.0-20190528202925-30ae18b8564f/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg= 451 | go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= 452 | go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 453 | go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 454 | go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= 455 | go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 456 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 457 | golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 458 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 459 | golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 460 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 461 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 462 | golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 463 | golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 464 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 465 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 466 | golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE= 467 | golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 468 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 469 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 470 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 471 | golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= 472 | golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= 473 | golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 474 | golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 475 | golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 476 | golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= 477 | golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= 478 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 479 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 480 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 481 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 482 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 483 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 484 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 485 | golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 486 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 487 | golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= 488 | golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 489 | golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 490 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 491 | golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= 492 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 493 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 494 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 495 | golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 496 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 497 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 498 | golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 499 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 500 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 501 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 502 | golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 503 | golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 504 | golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 505 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 506 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 507 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 508 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 509 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 510 | golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 511 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 512 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 513 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 514 | golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 515 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 516 | golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 517 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 518 | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 519 | golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 520 | golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 521 | golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 522 | golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 523 | golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 524 | golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 525 | golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 526 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 527 | golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 528 | golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 529 | golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 530 | golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= 531 | golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 532 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 533 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 534 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 535 | golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 536 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= 537 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 538 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 539 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 540 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 541 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 542 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 543 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 544 | golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 545 | golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 546 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 547 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 548 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 549 | golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 550 | golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 551 | golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 552 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 553 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 554 | golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 555 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 556 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 557 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 558 | golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 559 | golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 560 | golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 561 | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 562 | golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 563 | golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 564 | golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 565 | golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 566 | golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 567 | golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 568 | golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 569 | golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 570 | golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 571 | golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 572 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 573 | golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 574 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 575 | golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 576 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 577 | golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 578 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 579 | golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 580 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= 581 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 582 | golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 583 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 584 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 585 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 586 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 587 | golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 588 | golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= 589 | golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 590 | golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 591 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 592 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 593 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 594 | golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= 595 | golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 596 | golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 597 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 598 | golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 599 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 600 | golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 601 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 602 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 603 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 604 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 605 | golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 606 | golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 607 | golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 608 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 609 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 610 | golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 611 | golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 612 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 613 | golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 614 | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 615 | golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 616 | golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 617 | golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 618 | golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 619 | golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 620 | golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 621 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 622 | golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 623 | golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 624 | golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 625 | golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 626 | golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 627 | golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 628 | golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 629 | golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 630 | golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 631 | golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 632 | golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 633 | golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 634 | golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 635 | golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 636 | golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 637 | golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 638 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 639 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 640 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 641 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= 642 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 643 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 644 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 645 | google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 646 | google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 647 | google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 648 | google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 649 | google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 650 | google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 651 | google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 652 | google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 653 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 654 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 655 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 656 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 657 | google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 658 | google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= 659 | google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 660 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 661 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 662 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 663 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 664 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 665 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 666 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 667 | google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= 668 | google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 669 | google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 670 | google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 671 | google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 672 | google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 673 | google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 674 | google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= 675 | google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 676 | google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 677 | google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 678 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 679 | google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 680 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 681 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 682 | google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 683 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 684 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 685 | google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 686 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 687 | google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 688 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 689 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 690 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 691 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 692 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 693 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 694 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 695 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 696 | google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 697 | google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= 698 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 699 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 700 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 701 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 702 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 703 | gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= 704 | gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 705 | gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= 706 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 707 | gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= 708 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 709 | gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= 710 | gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= 711 | gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= 712 | gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= 713 | gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 714 | gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= 715 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 716 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 717 | gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 718 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 719 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 720 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 721 | gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 722 | gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 723 | gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 724 | gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= 725 | gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 726 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 727 | gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= 728 | gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 729 | gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= 730 | gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= 731 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 732 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 733 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 734 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 735 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 736 | honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 737 | k8s.io/api v0.20.2 h1:y/HR22XDZY3pniu9hIFDLpUCPq2w5eQ6aV/VFQ7uJMw= 738 | k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= 739 | k8s.io/apiextensions-apiserver v0.20.2 h1:rfrMWQ87lhd8EzQWRnbQ4gXrniL/yTRBgYH1x1+BLlo= 740 | k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8821ogLGwb6Zs= 741 | k8s.io/apimachinery v0.20.2 h1:hFx6Sbt1oG0n6DZ+g4bFt5f6BoMkOjKWsQFu077M3Vg= 742 | k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= 743 | k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA= 744 | k8s.io/client-go v0.20.2 h1:uuf+iIAbfnCSw8IGAv/Rg0giM+2bOzHLOsbbrwrdhNQ= 745 | k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= 746 | k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= 747 | k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptpKh0= 748 | k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= 749 | k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= 750 | k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= 751 | k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= 752 | k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= 753 | k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= 754 | k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c= 755 | k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= 756 | k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= 757 | k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= 758 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 759 | rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= 760 | rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= 761 | sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= 762 | sigs.k8s.io/kustomize/kyaml v0.10.6 h1:xUJxc/k8JoWqHUahaB8DTqY0KwEPxTbTGStvW8TOcDc= 763 | sigs.k8s.io/kustomize/kyaml v0.10.6/go.mod h1:K9yg1k/HB/6xNOf5VH3LhTo1DK9/5ykSZO5uIv+Y/1k= 764 | sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= 765 | sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= 766 | sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= 767 | sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= 768 | sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= 769 | --------------------------------------------------------------------------------