Skip to content

Commit

Permalink
Use stash@v0.9.0-rc.2 (#460)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Oct 23, 2019
1 parent 6fa677b commit bed5a9c
Show file tree
Hide file tree
Showing 71 changed files with 466 additions and 186 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ require (
github.com/orcaman/concurrent-map v0.0.0-20190314100340-2693aad1ed75
github.com/pkg/errors v0.8.1
github.com/robfig/cron/v3 v3.0.0
gomodules.xyz/stow v0.2.0
gomodules.xyz/stow v0.2.2
k8s.io/api v0.0.0-20190503110853-61630f889b3c
k8s.io/apiextensions-apiserver v0.0.0-20190516231611-bf6753f2aa24
k8s.io/apimachinery v0.0.0-20190508063446-a3da69d3723c
k8s.io/client-go v11.0.0+incompatible
k8s.io/kube-openapi v0.0.0-20190502190224-411b2483e503
kmodules.xyz/client-go v0.0.0-20191016085444-3044854ca625
kmodules.xyz/client-go v0.0.0-20191023042933-b12d1ccfaf57
kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045
kmodules.xyz/monitoring-agent-api v0.0.0-20190808150221-601a4005b7f7
kmodules.xyz/objectstore-api v0.0.0-20191014210450-ac380fa650a3
kmodules.xyz/offshoot-api v0.0.0-20190901210649-de049192326c
kmodules.xyz/webhook-runtime v0.0.0-20190808145328-4186c470d56b
stash.appscode.dev/stash v0.9.0-rc.1.0.20191018180359-9ef3cfeba2a2
stash.appscode.dev/stash v0.9.0-rc.2
)

replace (
Expand All @@ -40,6 +40,6 @@ replace (
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.0.0-20190314000639-da8327669ac5
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30
k8s.io/metrics => k8s.io/metrics v0.0.0-20190314001731-1bd6a4002213
k8s.io/utils => k8s.io/utils v0.0.0-20190221042446-c2654d5206da
k8s.io/utils => k8s.io/utils v0.0.0-20190514214443-0a167cbac756
sigs.k8s.io/structured-merge-diff => sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2
)
16 changes: 9 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,9 @@ gomodules.xyz/cert v1.0.0/go.mod h1:MG5H3SxZdkG8nng6QuQhXMTs+qt/qDLNXgUtbme82hQ=
gomodules.xyz/envsubst v0.1.0/go.mod h1:2o5f7bd13XIITbE2ZKieE05YkqB2KDoZkqKccGebduA=
gomodules.xyz/jsonpatch/v2 v2.0.0 h1:OyHbl+7IOECpPKfVK42oFr6N7+Y2dR+Jsb/IiDV3hOo=
gomodules.xyz/jsonpatch/v2 v2.0.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU=
gomodules.xyz/stow v0.2.0 h1:GYymuy7sxAifaL0IXEmoHApeguXHK0hFT7ZQiYA8KTU=
gomodules.xyz/stow v0.2.0/go.mod h1:YDDPM4nmJgQhxq4I5aGtLM/xrvJzDSVM/fbc7NGizpY=
gomodules.xyz/stow v0.2.2 h1:t9TGRul+LZUdKHpnW4qZb1VkMylEaIXXGHMzXTB8uXk=
gomodules.xyz/stow v0.2.2/go.mod h1:YDDPM4nmJgQhxq4I5aGtLM/xrvJzDSVM/fbc7NGizpY=
gomodules.xyz/version v0.0.0-20190507203204-7cec7ee542d3/go.mod h1:Y8xuV02mL/45psyPKG3NCVOwvAOy6T5Kx0l3rCjKSjU=
gomodules.xyz/version v0.1.0 h1:inGItCg/egI0jPMeIE0SQkiDIJaodOMoCrxYqasQLR0=
gomodules.xyz/version v0.1.0/go.mod h1:Y8xuV02mL/45psyPKG3NCVOwvAOy6T5Kx0l3rCjKSjU=
Expand Down Expand Up @@ -624,11 +625,12 @@ k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86
k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw=
k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/utils v0.0.0-20190221042446-c2654d5206da h1:ElyM7RPonbKnQqOcw7dG2IK5uvQQn3b/WPHqD5mBvP4=
k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0=
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-20191016085444-3044854ca625 h1:A/ceKV+HXdheKSpaY2CF7Q70E/iDKoysxiWtAuYMXyE=
kmodules.xyz/client-go v0.0.0-20191016085444-3044854ca625/go.mod h1:wFUBDofZzgkLW1sFJT5SSt6/G3ph2P8zUi5v81q5BKQ=
kmodules.xyz/client-go v0.0.0-20191023042933-b12d1ccfaf57 h1:4IsITvsVOl0W8IRABEMOqEMyJYwTCmhmfpJVIpwD4lM=
kmodules.xyz/client-go v0.0.0-20191023042933-b12d1ccfaf57/go.mod h1:BChXGI3zd3lNSjUUfDcGmvufMdqrofLI/nrndcZ4LUo=
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=
kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045/go.mod h1:vlKyFcCXC+2Kfn3Fa5Z7RnBWyp4t46FSeEutNqpqMm8=
kmodules.xyz/monitoring-agent-api v0.0.0-20190808150221-601a4005b7f7 h1:2NexswbEqyeI1bL0O7WZ3ZcQgXJ+kATJK++roRXfYDU=
Expand All @@ -647,5 +649,5 @@ sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2 h1:9r5DY45e
sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
stash.appscode.dev/stash v0.9.0-rc.1.0.20191018180359-9ef3cfeba2a2 h1:H2a7zLOI7Q6OxHuI8gzQKYJx/BPREOgQjbkVCLVUXYY=
stash.appscode.dev/stash v0.9.0-rc.1.0.20191018180359-9ef3cfeba2a2/go.mod h1:N8pJqTaV01TZpspiGEGfRBkJTNHkJ0ihflN0LYx3wPw=
stash.appscode.dev/stash v0.9.0-rc.2 h1:oZTmaDDTjANefmsNWYjqb0cqZYGl4JAeiewAlJJPnlE=
stash.appscode.dev/stash v0.9.0-rc.2/go.mod h1:DgbSJa5P8tV+V9dX/CxURZDnudLvgnKyuZksJF/Fp7Q=
2 changes: 1 addition & 1 deletion vendor/gomodules.xyz/stow/s3/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func newS3Client(config stow.Config, region string) (client *s3.S3, endpoint str
}

awsConfig := aws.NewConfig().
WithHTTPClient(http.DefaultClient).
WithHTTPClient(new(http.Client)).
WithMaxRetries(aws.UseServiceDefaultRetries).
WithLogger(aws.NewDefaultLogger()).
WithLogLevel(aws.LogOff).
Expand Down
5 changes: 5 additions & 0 deletions vendor/kmodules.xyz/client-go/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ dist/
**/.env
.vscode/
coverage.txt

/bin
/.go

apiserver.local.config/**
25 changes: 0 additions & 25 deletions vendor/kmodules.xyz/client-go/.travis.yml

This file was deleted.

220 changes: 220 additions & 0 deletions vendor/kmodules.xyz/client-go/Makefile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion vendor/kmodules.xyz/client-go/README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion vendor/kmodules.xyz/client-go/discovery/restmapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions vendor/kmodules.xyz/client-go/dynamic/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down
Loading

0 comments on commit bed5a9c

Please sign in to comment.