From efd614f97c5eaf1e8d05ab7559db129d04f32107 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Tue, 22 Oct 2019 20:04:35 -0700 Subject: [PATCH] Revendor Signed-off-by: Tamal Saha --- go.mod | 2 +- go.sum | 4 +- vendor/kmodules.xyz/client-go/.gitignore | 5 + vendor/kmodules.xyz/client-go/.travis.yml | 25 -- vendor/kmodules.xyz/client-go/Makefile | 220 ++++++++++++++++++ vendor/kmodules.xyz/client-go/README.md | 2 +- .../v1beta1/mutatingwebhookconfiguration.go | 54 +++-- .../v1beta1/validatingwebhookconfiguration.go | 54 +++-- .../admissionregistration/v1beta1/xray.go | 23 +- .../apiextensions/v1beta1/cli-utils.go | 2 +- .../apiextensions/v1beta1/convert_types.go | 3 +- .../apiextensions/v1beta1/crdvalidation.go | 3 +- .../apiregistration/v1beta1/kubernetes.go | 4 +- .../client-go/apps/v1/deployment.go | 3 +- .../client-go/apps/v1/statefulset.go | 3 +- .../client-go/discovery/restmapper.go | 2 +- .../client-go/dynamic/kubernetes.go | 5 +- vendor/kmodules.xyz/client-go/logs/logs.go | 7 +- .../client-go/tools/analytics/analytics.go | 9 +- .../kmodules.xyz/client-go/tools/cli/cli.go | 5 +- .../tools/clientcmd/client_config.go | 3 +- .../client-go/tools/queue/handler.go | 3 +- vendor/modules.txt | 2 +- 23 files changed, 328 insertions(+), 115 deletions(-) delete mode 100644 vendor/kmodules.xyz/client-go/.travis.yml create mode 100644 vendor/kmodules.xyz/client-go/Makefile diff --git a/go.mod b/go.mod index fe62519a4..0fbb13144 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( k8s.io/kube-aggregator v0.0.0-20190314000639-da8327669ac5 k8s.io/kube-openapi v0.0.0-20190502190224-411b2483e503 k8s.io/kubernetes v1.14.0 - kmodules.xyz/client-go v0.0.0-20191021083014-0be9e7d5b970 + kmodules.xyz/client-go v0.0.0-20191023014104-b4d8f6cd8cb5 kmodules.xyz/constants v0.0.0-20191009183447-fbd33067b8a6 kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045 kmodules.xyz/objectstore-api v0.0.0-20191014210450-ac380fa650a3 diff --git a/go.sum b/go.sum index dfb753ed4..05b743d6e 100644 --- a/go.sum +++ b/go.sum @@ -489,8 +489,8 @@ k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20190514214443-0a167cbac756 h1:2XBbostlqrw13zVYimyqcj/Om2P4B26oMzv+m2cj//k= k8s.io/utils v0.0.0-20190514214443-0a167cbac756/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= kmodules.xyz/client-go v0.0.0-20190808141354-bbb9e14f60ab/go.mod h1:1GI6h5D31op/2D+Hrn9DhXW6iUd5wsHBQRoLeY7fndM= -kmodules.xyz/client-go v0.0.0-20191021083014-0be9e7d5b970 h1:3XwVHSsPMMtTT4DWGRb97IyuuB4OtRSJf9KeaWTxdXQ= -kmodules.xyz/client-go v0.0.0-20191021083014-0be9e7d5b970/go.mod h1:BChXGI3zd3lNSjUUfDcGmvufMdqrofLI/nrndcZ4LUo= +kmodules.xyz/client-go v0.0.0-20191023014104-b4d8f6cd8cb5 h1:gjTt06FdWbXakzkDBU4UTgLHqNWwZkc16cbXpIJpd8Y= +kmodules.xyz/client-go v0.0.0-20191023014104-b4d8f6cd8cb5/go.mod h1:BChXGI3zd3lNSjUUfDcGmvufMdqrofLI/nrndcZ4LUo= kmodules.xyz/constants v0.0.0-20191009183447-fbd33067b8a6 h1:JEerfubBfd98TetzNFn9xOgkVUGuQrbrR/iwkxjenIo= kmodules.xyz/constants v0.0.0-20191009183447-fbd33067b8a6/go.mod h1:DbiFk1bJ1KEO94t1SlAn7tzc+Zz95rSXgyUKa2nzPmY= kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045 h1:DuvD64ouPDbv3egAUUCy5rBqs/vc218DeVVivcqfa+U= diff --git a/vendor/kmodules.xyz/client-go/.gitignore b/vendor/kmodules.xyz/client-go/.gitignore index 6b70172db..9aab71958 100644 --- a/vendor/kmodules.xyz/client-go/.gitignore +++ b/vendor/kmodules.xyz/client-go/.gitignore @@ -28,3 +28,8 @@ dist/ **/.env .vscode/ coverage.txt + +/bin +/.go + +apiserver.local.config/** diff --git a/vendor/kmodules.xyz/client-go/.travis.yml b/vendor/kmodules.xyz/client-go/.travis.yml deleted file mode 100644 index 7cc956592..000000000 --- a/vendor/kmodules.xyz/client-go/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: go -go: - - 1.x - - tip - -go_import_path: kmodules.xyz/client-go - -env: - global: - - GOFLAGS=-mod=vendor - - GO111MODULE=on - -cache: - directories: - - $HOME/.cache/go-build - - $GOPATH/pkg/mod - -install: true - -script: - - go build ./... - - ./hack/coverage.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/kmodules.xyz/client-go/Makefile b/vendor/kmodules.xyz/client-go/Makefile new file mode 100644 index 000000000..30c0e6e1d --- /dev/null +++ b/vendor/kmodules.xyz/client-go/Makefile @@ -0,0 +1,220 @@ +# Copyright 2019 AppsCode Inc. +# Copyright 2016 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +SHELL=/bin/bash -o pipefail + +GO_PKG := kmodules.xyz +REPO := $(notdir $(shell pwd)) +BIN := client-go + +# This version-strategy uses git tags to set the version string +git_branch := $(shell git rev-parse --abbrev-ref HEAD) +git_tag := $(shell git describe --exact-match --abbrev=0 2>/dev/null || echo "") +commit_hash := $(shell git rev-parse --verify HEAD) +commit_timestamp := $(shell date --date="@$$(git show -s --format=%ct)" --utc +%FT%T) + +VERSION := $(shell git describe --tags --always --dirty) +version_strategy := commit_hash +ifdef git_tag + VERSION := $(git_tag) + version_strategy := tag +else + ifeq (,$(findstring $(git_branch),master HEAD)) + ifneq (,$(patsubst release-%,,$(git_branch))) + VERSION := $(git_branch) + version_strategy := branch + endif + endif +endif + +### +### These variables should not need tweaking. +### + +SRC_DIRS := *.go admissionregistration apiextensions apiregistration apps batch bin certificates core discovery dynamic extensions logs meta openapi policy rbac storage tools + +DOCKER_PLATFORMS := linux/amd64 linux/arm linux/arm64 +BIN_PLATFORMS := $(DOCKER_PLATFORMS) + +# Used internally. Users should pass GOOS and/or GOARCH. +OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) +ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) + +BASEIMAGE_PROD ?= gcr.io/distroless/static +BASEIMAGE_DBG ?= debian:stretch + +GO_VERSION ?= 1.12.12 +BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION)-stretch + +OUTBIN = bin/$(OS)_$(ARCH)/$(BIN) +ifeq ($(OS),windows) + OUTBIN = bin/$(OS)_$(ARCH)/$(BIN).exe +endif + +# Directories that we need created to build/test. +BUILD_DIRS := bin/$(OS)_$(ARCH) \ + .go/bin/$(OS)_$(ARCH) \ + .go/cache \ + hack/config \ + $(HOME)/.credentials \ + $(HOME)/.kube \ + $(HOME)/.minikube + +# If you want to build all binaries, see the 'all-build' rule. +# If you want to build all containers, see the 'all-container' rule. +# If you want to build AND push all containers, see the 'all-push' rule. +all: fmt build + +# For the following OS/ARCH expansions, we transform OS/ARCH into OS_ARCH +# because make pattern rules don't match with embedded '/' characters. + +build-%: + @$(MAKE) build \ + --no-print-directory \ + GOOS=$(firstword $(subst _, ,$*)) \ + GOARCH=$(lastword $(subst _, ,$*)) + +all-build: $(addprefix build-, $(subst /,_, $(BIN_PLATFORMS))) + +version: + @echo version=$(VERSION) + @echo version_strategy=$(version_strategy) + @echo git_tag=$(git_tag) + @echo git_branch=$(git_branch) + @echo commit_hash=$(commit_hash) + @echo commit_timestamp=$(commit_timestamp) + +.PHONY: gen +gen: + @true + +fmt: $(BUILD_DIRS) + @docker run \ + -i \ + --rm \ + -u $$(id -u):$$(id -g) \ + -v $$(pwd):/src \ + -w /src \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \ + -v $$(pwd)/.go/cache:/.cache \ + --env HTTP_PROXY=$(HTTP_PROXY) \ + --env HTTPS_PROXY=$(HTTPS_PROXY) \ + $(BUILD_IMAGE) \ + /bin/bash -c " \ + REPO_PKG=$(GO_PKG)/$(REPO) \ + ./hack/fmt.sh $(SRC_DIRS) \ + " + +build: $(OUTBIN) + +.PHONY: .go/$(OUTBIN) +$(OUTBIN): $(BUILD_DIRS) + @echo "making $(OUTBIN)" + @docker run \ + -i \ + --rm \ + -u $$(id -u):$$(id -g) \ + -v $$(pwd):/src \ + -w /src \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \ + -v $$(pwd)/.go/cache:/.cache \ + --env HTTP_PROXY=$(HTTP_PROXY) \ + --env HTTPS_PROXY=$(HTTPS_PROXY) \ + $(BUILD_IMAGE) \ + /bin/bash -c " \ + ARCH=$(ARCH) \ + OS=$(OS) \ + VERSION=$(VERSION) \ + version_strategy=$(version_strategy) \ + git_branch=$(git_branch) \ + git_tag=$(git_tag) \ + commit_hash=$(commit_hash) \ + commit_timestamp=$(commit_timestamp) \ + ./hack/build.sh \ + " + @echo + +test: $(BUILD_DIRS) + @docker run \ + -i \ + --rm \ + -u $$(id -u):$$(id -g) \ + -v $$(pwd):/src \ + -w /src \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \ + -v $$(pwd)/.go/cache:/.cache \ + --env HTTP_PROXY=$(HTTP_PROXY) \ + --env HTTPS_PROXY=$(HTTPS_PROXY) \ + $(BUILD_IMAGE) \ + /bin/bash -c " \ + ARCH=$(ARCH) \ + OS=$(OS) \ + VERSION=$(VERSION) \ + ./hack/test.sh $(SRC_DIRS) \ + " + +ADDTL_LINTERS := goconst,gofmt,goimports,unparam + +.PHONY: lint +lint: $(BUILD_DIRS) + @echo "running linter" + @docker run \ + -i \ + --rm \ + -u $$(id -u):$$(id -g) \ + -v $$(pwd):/src \ + -w /src \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \ + -v $$(pwd)/.go/cache:/.cache \ + --env HTTP_PROXY=$(HTTP_PROXY) \ + --env HTTPS_PROXY=$(HTTPS_PROXY) \ + --env GO111MODULE=on \ + --env GOFLAGS="-mod=vendor" \ + $(BUILD_IMAGE) \ + golangci-lint run --enable $(ADDTL_LINTERS) --timeout=10m --skip-files="generated.*\.go$\" --skip-dirs-use-default + +$(BUILD_DIRS): + @mkdir -p $@ + +.PHONY: dev +dev: gen fmt push + +.PHONY: verify +verify: verify-modules verify-gen + +.PHONY: verify-modules +verify-modules: + GO111MODULE=on go mod tidy + GO111MODULE=on go mod vendor + @if !(git diff --exit-code HEAD); then \ + echo "go module files are out of date"; exit 1; \ + fi + +.PHONY: verify-gen +verify-gen: gen fmt + @if !(git diff --exit-code HEAD); then \ + echo "file formatting is out of date, run make gen fmt"; exit 1; \ + fi + +.PHONY: ci +ci: verify lint build test #cover + +.PHONY: clean +clean: + rm -rf .go bin diff --git a/vendor/kmodules.xyz/client-go/README.md b/vendor/kmodules.xyz/client-go/README.md index 5c7a8ed4a..a18fc91ed 100644 --- a/vendor/kmodules.xyz/client-go/README.md +++ b/vendor/kmodules.xyz/client-go/README.md @@ -1,6 +1,6 @@ [![Go Report Card](https://goreportcard.com/badge/kmodules.xyz/client-go)](https://goreportcard.com/report/kmodules.xyz/client-go) [![GoDoc](https://godoc.org/kmodules.xyz/client-go?status.svg "GoDoc")](https://godoc.org/kmodules.xyz/client-go) -[![Build Status](https://travis-ci.org/kmodules/client-go.svg?branch=master)](https://travis-ci.org/kmodules/client-go) +[![Build Status](https://github.com/kmodules/client-go/workflows/CI/badge.svg)](https://github.com/kmodules/client-go/actions?workflow=CI) [![codecov](https://codecov.io/gh/kmodules/client-go/branch/master/graph/badge.svg)](https://codecov.io/gh/kmodules/client-go) [![Slack](https://slack.appscode.com/badge.svg)](https://slack.appscode.com) [![Twitter](https://img.shields.io/twitter/follow/appscodehq.svg?style=social&logo=twitter&label=Follow)](https://twitter.com/intent/follow?screen_name=AppsCodeHQ) diff --git a/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 4b390c4b2..ae0460abb 100644 --- a/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -12,6 +12,7 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" @@ -167,32 +168,35 @@ func SyncMutatingWebhookCABundle(config *rest.Config, webhookConfigName string) }, } - go watchtools.UntilWithSync( - ctx, - lw, - ®.MutatingWebhookConfiguration{}, - nil, - func(event watch.Event) (bool, error) { - switch event.Type { - case watch.Deleted: - return false, nil - case watch.Error: - return false, errors.New("error watching") - case watch.Added, watch.Modified: - cur := event.Object.(*reg.MutatingWebhookConfiguration) - _, _, err := PatchMutatingWebhookConfiguration(kc, cur, func(in *reg.MutatingWebhookConfiguration) *reg.MutatingWebhookConfiguration { - for i := range in.Webhooks { - in.Webhooks[i].ClientConfig.CABundle = config.CAData + go func() { + _, err := watchtools.UntilWithSync( + ctx, + lw, + ®.MutatingWebhookConfiguration{}, + nil, + func(event watch.Event) (bool, error) { + switch event.Type { + case watch.Deleted: + return false, nil + case watch.Error: + return false, errors.New("error watching") + case watch.Added, watch.Modified: + cur := event.Object.(*reg.MutatingWebhookConfiguration) + _, _, err := PatchMutatingWebhookConfiguration(kc, cur, func(in *reg.MutatingWebhookConfiguration) *reg.MutatingWebhookConfiguration { + for i := range in.Webhooks { + in.Webhooks[i].ClientConfig.CABundle = config.CAData + } + return in + }) + if err != nil { + glog.Warning(err) } - return in - }) - if err != nil { - glog.Warning(err) + return false, nil // continue + default: + return false, fmt.Errorf("unexpected event type: %v", event.Type) } - return false, nil // continue - default: - return false, fmt.Errorf("unexpected event type: %v", event.Type) - } - }) + }) + utilruntime.Must(err) + }() return } diff --git a/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 93aa48433..37eabd231 100644 --- a/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -12,6 +12,7 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" @@ -167,32 +168,35 @@ func SyncValidatingWebhookCABundle(config *rest.Config, webhookConfigName string }, } - go watchtools.UntilWithSync( - ctx, - lw, - ®.ValidatingWebhookConfiguration{}, - nil, - func(event watch.Event) (bool, error) { - switch event.Type { - case watch.Deleted: - return false, nil - case watch.Error: - return false, errors.New("error watching") - case watch.Added, watch.Modified: - cur := event.Object.(*reg.ValidatingWebhookConfiguration) - _, _, err := PatchValidatingWebhookConfiguration(kc, cur, func(in *reg.ValidatingWebhookConfiguration) *reg.ValidatingWebhookConfiguration { - for i := range in.Webhooks { - in.Webhooks[i].ClientConfig.CABundle = config.CAData + go func() { + _, err := watchtools.UntilWithSync( + ctx, + lw, + ®.ValidatingWebhookConfiguration{}, + nil, + func(event watch.Event) (bool, error) { + switch event.Type { + case watch.Deleted: + return false, nil + case watch.Error: + return false, errors.New("error watching") + case watch.Added, watch.Modified: + cur := event.Object.(*reg.ValidatingWebhookConfiguration) + _, _, err := PatchValidatingWebhookConfiguration(kc, cur, func(in *reg.ValidatingWebhookConfiguration) *reg.ValidatingWebhookConfiguration { + for i := range in.Webhooks { + in.Webhooks[i].ClientConfig.CABundle = config.CAData + } + return in + }) + if err != nil { + glog.Warning(err) } - return in - }) - if err != nil { - glog.Warning(err) + return false, nil // continue + default: + return false, fmt.Errorf("unexpected event type: %v", event.Type) } - return false, nil // continue - default: - return false, fmt.Errorf("unexpected event type: %v", event.Type) - } - }) + }) + utilruntime.Must(err) + }() return } diff --git a/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/xray.go b/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/xray.go index d1841a6d7..2f832a355 100644 --- a/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/xray.go +++ b/vendor/kmodules.xyz/client-go/admissionregistration/v1beta1/xray.go @@ -4,6 +4,12 @@ import ( "fmt" "strings" + apireg_util "kmodules.xyz/client-go/apiregistration/v1beta1" + core_util "kmodules.xyz/client-go/core/v1" + "kmodules.xyz/client-go/discovery" + dynamic_util "kmodules.xyz/client-go/dynamic" + meta_util "kmodules.xyz/client-go/meta" + jsonpatch "github.com/evanphx/json-patch" "github.com/golang/glog" "github.com/pkg/errors" @@ -23,11 +29,6 @@ import ( apiregistration "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1" apireg_cs "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" kutil "kmodules.xyz/client-go" - apireg_util "kmodules.xyz/client-go/apiregistration/v1beta1" - core_util "kmodules.xyz/client-go/core/v1" - "kmodules.xyz/client-go/discovery" - dynamic_util "kmodules.xyz/client-go/dynamic" - meta_util "kmodules.xyz/client-go/meta" ) func init() { @@ -108,7 +109,7 @@ func (d ValidatingWebhookXray) IsActive() error { if bypassValidatingWebhookXray { apisvc, err := apireg.ApiregistrationV1beta1().APIServices().Get(d.apisvc, metav1.GetOptions{}) if err == nil { - d.updateAPIService(apireg, apisvc, nil) + _ = d.updateAPIService(apireg, apisvc, nil) } return nil } @@ -152,7 +153,7 @@ func (d ValidatingWebhookXray) IsActive() error { } err = retry(err) if active || err != nil { - d.updateAPIService(apireg, apisvc, err) + _ = d.updateAPIService(apireg, apisvc, err) } if err != nil { // log failures only if xray fails, otherwise don't confuse users with intermediate failures. @@ -263,7 +264,7 @@ func (d ValidatingWebhookXray) check() (bool, error) { return false, err } - dynamic_util.WaitUntilDeleted(ri, d.stopCh, accessor.GetName()) + _ = dynamic_util.WaitUntilDeleted(ri, d.stopCh, accessor.GetName()) return false, ErrWebhookNotActivated } else if d.op == v1beta1.Update { _, err := ri.Create(&u, metav1.CreateOptions{}) @@ -284,7 +285,7 @@ func (d ValidatingWebhookXray) check() (bool, error) { } _, err = ri.Patch(accessor.GetName(), types.MergePatchType, patch, metav1.PatchOptions{}) - defer dynamic_util.WaitUntilDeleted(ri, d.stopCh, accessor.GetName()) + defer func() { _ = dynamic_util.WaitUntilDeleted(ri, d.stopCh, accessor.GetName()) }() if kutil.AdmissionWebhookDeniedRequest(err) { glog.V(10).Infof("failed to update test object as expected with error: %s", err) @@ -316,10 +317,10 @@ func (d ValidatingWebhookXray) check() (bool, error) { return } - ri.Patch(accessor.GetName(), types.MergePatchType, patch, metav1.PatchOptions{}) + _, _ = ri.Patch(accessor.GetName(), types.MergePatchType, patch, metav1.PatchOptions{}) // delete - dynamic_util.WaitUntilDeleted(ri, d.stopCh, accessor.GetName()) + _ = dynamic_util.WaitUntilDeleted(ri, d.stopCh, accessor.GetName()) }() glog.V(10).Infof("failed to delete test object as expected with error: %s", err) diff --git a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/cli-utils.go b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/cli-utils.go index e25f2e78e..8c2f34de6 100644 --- a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/cli-utils.go +++ b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/cli-utils.go @@ -117,7 +117,7 @@ func NewCustomResourceDefinition(config Config, options ...func(map[string]commo AdditionalPrinterColumns: config.AdditionalPrinterColumns, }, } - if config.SpecDefinitionName != "" && config.EnableValidation == true { + if config.SpecDefinitionName != "" && config.EnableValidation { crd.Spec.Validation = GetCustomResourceValidation(config.SpecDefinitionName, config.GetOpenAPIDefinitions, options) } if config.EnableStatusSubresource || config.EnableScaleSubresource { diff --git a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/convert_types.go b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/convert_types.go index c143a644b..8be812730 100644 --- a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/convert_types.go +++ b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/convert_types.go @@ -62,8 +62,7 @@ func SchemaOrBoolToJSONProps(schemaOrBool *spec.SchemaOrBool, openapiSpec map[st // SchemPropsMapToJSONMap converts map[string]Schema to map[string]JSONSchemaProps func SchemPropsMapToJSONMap(schemaMap map[string]spec.Schema, openapiSpec map[string]common.OpenAPIDefinition, nested bool) map[string]extensionsobj.JSONSchemaProps { - var m map[string]extensionsobj.JSONSchemaProps - m = make(map[string]extensionsobj.JSONSchemaProps) + m := make(map[string]extensionsobj.JSONSchemaProps) for key, schema := range schemaMap { m[key] = *SchemaPropsToJSONProps(&schema, openapiSpec, nested) } diff --git a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/crdvalidation.go b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/crdvalidation.go index abacb92bb..f85c0a39d 100644 --- a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/crdvalidation.go +++ b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/crdvalidation.go @@ -24,8 +24,7 @@ type GetAPIDefinitions func(ref common.ReferenceCallback) map[string]common.Open // GetCustomResourceValidations returns a CRD validation spec map. It took the openapi generated definition from kube-openapi as argument func GetCustomResourceValidations(fn GetAPIDefinitions) map[string]*extensionsobj.CustomResourceValidation { openapiSpec := fn(OpenAPIRefCallBack) - var definitions map[string]*extensionsobj.CustomResourceValidation - definitions = make(map[string]*extensionsobj.CustomResourceValidation) + definitions := make(map[string]*extensionsobj.CustomResourceValidation) for key, definition := range openapiSpec { schema := definition.Schema definitions[key] = &extensionsobj.CustomResourceValidation{ diff --git a/vendor/kmodules.xyz/client-go/apiregistration/v1beta1/kubernetes.go b/vendor/kmodules.xyz/client-go/apiregistration/v1beta1/kubernetes.go index 4a4870cf1..0a014c365 100644 --- a/vendor/kmodules.xyz/client-go/apiregistration/v1beta1/kubernetes.go +++ b/vendor/kmodules.xyz/client-go/apiregistration/v1beta1/kubernetes.go @@ -1,7 +1,5 @@ package v1beta1 -import ( - "github.com/json-iterator/go" -) +import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigFastest diff --git a/vendor/kmodules.xyz/client-go/apps/v1/deployment.go b/vendor/kmodules.xyz/client-go/apps/v1/deployment.go index 5a0119897..70ef0c0d7 100644 --- a/vendor/kmodules.xyz/client-go/apps/v1/deployment.go +++ b/vendor/kmodules.xyz/client-go/apps/v1/deployment.go @@ -1,6 +1,8 @@ package v1 import ( + core_util "kmodules.xyz/client-go/core/v1" + . "github.com/appscode/go/types" "github.com/golang/glog" "github.com/pkg/errors" @@ -12,7 +14,6 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" kutil "kmodules.xyz/client-go" - core_util "kmodules.xyz/client-go/core/v1" ) func CreateOrPatchDeployment(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*apps.Deployment) *apps.Deployment) (*apps.Deployment, kutil.VerbType, error) { diff --git a/vendor/kmodules.xyz/client-go/apps/v1/statefulset.go b/vendor/kmodules.xyz/client-go/apps/v1/statefulset.go index 9e336b15a..0b3d2d0e8 100644 --- a/vendor/kmodules.xyz/client-go/apps/v1/statefulset.go +++ b/vendor/kmodules.xyz/client-go/apps/v1/statefulset.go @@ -1,6 +1,8 @@ package v1 import ( + core_util "kmodules.xyz/client-go/core/v1" + . "github.com/appscode/go/types" atypes "github.com/appscode/go/types" "github.com/golang/glog" @@ -13,7 +15,6 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" kutil "kmodules.xyz/client-go" - core_util "kmodules.xyz/client-go/core/v1" ) func CreateOrPatchStatefulSet(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*apps.StatefulSet) *apps.StatefulSet) (*apps.StatefulSet, kutil.VerbType, error) { diff --git a/vendor/kmodules.xyz/client-go/discovery/restmapper.go b/vendor/kmodules.xyz/client-go/discovery/restmapper.go index 73a56154b..6443078e1 100644 --- a/vendor/kmodules.xyz/client-go/discovery/restmapper.go +++ b/vendor/kmodules.xyz/client-go/discovery/restmapper.go @@ -112,7 +112,7 @@ func FilterSubResources(resources []schema.GroupVersionResource) []schema.GroupV func LoadRestMapper(client discovery.DiscoveryInterface) (*DefaultRESTMapper, error) { restMapper := NewDefaultRESTMapper([]schema.GroupVersion{}) - resourceLists, err := client.ServerResources() + _, resourceLists, err := client.ServerGroupsAndResources() if discovery.IsGroupDiscoveryFailedError(err) { glog.Errorf("Skipping failed API Groups: %v", err) } else if err != nil { diff --git a/vendor/kmodules.xyz/client-go/dynamic/kubernetes.go b/vendor/kmodules.xyz/client-go/dynamic/kubernetes.go index 13adac2f5..430f94074 100644 --- a/vendor/kmodules.xyz/client-go/dynamic/kubernetes.go +++ b/vendor/kmodules.xyz/client-go/dynamic/kubernetes.go @@ -5,6 +5,9 @@ import ( "fmt" "time" + v1 "kmodules.xyz/client-go/core/v1" + discovery_util "kmodules.xyz/client-go/discovery" + "github.com/pkg/errors" core "k8s.io/api/core/v1" kerr "k8s.io/apimachinery/pkg/api/errors" @@ -24,8 +27,6 @@ import ( "k8s.io/client-go/tools/cache" watchtools "k8s.io/client-go/tools/watch" kutil "kmodules.xyz/client-go" - v1 "kmodules.xyz/client-go/core/v1" - discovery_util "kmodules.xyz/client-go/discovery" ) func WaitUntilDeleted(ri dynamic.ResourceInterface, stopCh <-chan struct{}, name string, subresources ...string) error { diff --git a/vendor/kmodules.xyz/client-go/logs/logs.go b/vendor/kmodules.xyz/client-go/logs/logs.go index 0a64edda8..a0342d72b 100644 --- a/vendor/kmodules.xyz/client-go/logs/logs.go +++ b/vendor/kmodules.xyz/client-go/logs/logs.go @@ -24,6 +24,7 @@ import ( "github.com/golang/glog" "github.com/spf13/pflag" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/klog" ) @@ -37,7 +38,7 @@ const logFlushFreqFlagName = "log-flush-frequency" var logFlushFreq = pflag.Duration(logFlushFreqFlagName, 5*time.Second, "Maximum number of seconds between log flushes") func init() { - flag.Set("stderrthreshold", "INFO") + utilruntime.Must(flag.Set("stderrthreshold", "INFO")) } // AddFlags registers this package's flags on arbitrary FlagSets, such that they point to the @@ -65,7 +66,7 @@ func InitLogs() { func ParseFlags() { // ref: https://github.com/kubernetes/kubernetes/issues/17162#issuecomment-225596212 - flag.CommandLine.Parse([]string{}) + utilruntime.Must(flag.CommandLine.Parse([]string{})) klogFlags := flag.NewFlagSet("klog", flag.ExitOnError) klog.InitFlags(klogFlags) @@ -75,7 +76,7 @@ func ParseFlags() { f2 := klogFlags.Lookup(f1.Name) if f2 != nil { value := f1.Value.String() - f2.Value.Set(value) + utilruntime.Must(f2.Value.Set(value)) } }) } diff --git a/vendor/kmodules.xyz/client-go/tools/analytics/analytics.go b/vendor/kmodules.xyz/client-go/tools/analytics/analytics.go index c795d3e9b..0e4fd20cb 100644 --- a/vendor/kmodules.xyz/client-go/tools/analytics/analytics.go +++ b/vendor/kmodules.xyz/client-go/tools/analytics/analytics.go @@ -9,6 +9,8 @@ import ( "sort" "strings" + "kmodules.xyz/client-go/meta" + "github.com/appscode/go/analytics" net2 "github.com/appscode/go/net" "github.com/appscode/go/sets" @@ -19,7 +21,6 @@ import ( "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" - "kmodules.xyz/client-go/meta" ) const ( @@ -109,7 +110,7 @@ func ClientID() string { sort.Slice(ips, func(i, j int) bool { return bytes.Compare(ips[i], ips[j]) < 0 }) hasher := md5.New() for _, ip := range ips { - hasher.Write(ip) + _, _ = hasher.Write(ip) } return hex.EncodeToString(hasher.Sum(nil)) } @@ -146,7 +147,7 @@ func ClientID() string { sort.Slice(ips, func(i, j int) bool { return bytes.Compare(ips[i], ips[j]) < 0 }) hasher := md5.New() for _, ip := range ips { - hasher.Write(ip) + _, _ = hasher.Write(ip) } return hex.EncodeToString(hasher.Sum(nil)) } @@ -154,7 +155,7 @@ func ClientID() string { func hash(data ...string) string { hasher := md5.New() for _, x := range data { - hasher.Write([]byte(x)) + _, _ = hasher.Write([]byte(x)) } return hex.EncodeToString(hasher.Sum(nil)) } diff --git a/vendor/kmodules.xyz/client-go/tools/cli/cli.go b/vendor/kmodules.xyz/client-go/tools/cli/cli.go index 9e2ea3116..b5d82761f 100644 --- a/vendor/kmodules.xyz/client-go/tools/cli/cli.go +++ b/vendor/kmodules.xyz/client-go/tools/cli/cli.go @@ -5,10 +5,11 @@ import ( "strings" "time" + "kmodules.xyz/client-go/tools/analytics" + "github.com/appscode/go/log/golog" ga "github.com/jpillora/go-ogle-analytics" "github.com/spf13/cobra" - "kmodules.xyz/client-go/tools/analytics" ) const ( @@ -29,7 +30,7 @@ func SendAnalytics(c *cobra.Command, version string) { if client, err := ga.NewClient(gaTrackingCode); err == nil { client.ClientID(AnalyticsClientID) parts := strings.Split(c.CommandPath(), " ") - client.Send(ga.NewEvent(parts[0], strings.Join(parts[1:], "/")).Label(version)) + _ = client.Send(ga.NewEvent(parts[0], strings.Join(parts[1:], "/")).Label(version)) } } diff --git a/vendor/kmodules.xyz/client-go/tools/clientcmd/client_config.go b/vendor/kmodules.xyz/client-go/tools/clientcmd/client_config.go index de4e422dc..a300d3d35 100644 --- a/vendor/kmodules.xyz/client-go/tools/clientcmd/client_config.go +++ b/vendor/kmodules.xyz/client-go/tools/clientcmd/client_config.go @@ -4,6 +4,8 @@ import ( "net" "os" + "kmodules.xyz/client-go/meta" + "github.com/golang/glog" "github.com/pkg/errors" "github.com/spf13/pflag" @@ -11,7 +13,6 @@ import ( _ "k8s.io/client-go/plugin/pkg/client/auth" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - "kmodules.xyz/client-go/meta" ) // BuildConfigFromFlags is a helper function that builds configs from a master diff --git a/vendor/kmodules.xyz/client-go/tools/queue/handler.go b/vendor/kmodules.xyz/client-go/tools/queue/handler.go index 09cd5a941..da5817a37 100644 --- a/vendor/kmodules.xyz/client-go/tools/queue/handler.go +++ b/vendor/kmodules.xyz/client-go/tools/queue/handler.go @@ -1,6 +1,8 @@ package queue import ( + meta_util "kmodules.xyz/client-go/meta" + "github.com/golang/glog" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -9,7 +11,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" - meta_util "kmodules.xyz/client-go/meta" ) // QueueingEventHandler queues the key for the object on add and update events diff --git a/vendor/modules.txt b/vendor/modules.txt index 7004f5480..1e908b090 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -925,7 +925,7 @@ k8s.io/utils/integer k8s.io/utils/buffer k8s.io/utils/trace k8s.io/utils/pointer -# kmodules.xyz/client-go v0.0.0-20191021083014-0be9e7d5b970 +# kmodules.xyz/client-go v0.0.0-20191023014104-b4d8f6cd8cb5 kmodules.xyz/client-go/logs kmodules.xyz/client-go/apiextensions/v1beta1 kmodules.xyz/client-go/meta