diff --git a/.github/workflows/kubernetes-operator.yaml b/.github/workflows/kubernetes-operator.yaml new file mode 100644 index 00000000..f3d5eacd --- /dev/null +++ b/.github/workflows/kubernetes-operator.yaml @@ -0,0 +1,55 @@ +# Copyright 2020-2021 Alibaba Group Holding Limited. +# +# 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. + +name: Kubernetes Operator + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + env: + IMG: docker.pkg.github.com/v6d-io/v6d/vineyard-controller + strategy: + matrix: + os: [ubuntu-20.04] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - uses: actions/setup-go@v2 + with: + go-version: '^1.15.0' # The Go version to download (if necessary) and use. + + - name: Login docker registry + run: | + echo ${{ secrets.GITHUB_TOKEN }} | sudo docker login https://docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin + + - name: Operator + run: | + cd k8s + make + + - name: Docker images + run: | + cd k8s + sudo make docker-build IMG=${IMG}:${{ github.sha }} + sudo docker tag ${IMG}:${{ github.sha }} ${IMG}:nightly + + - name: Publish docker images + if: ${{ github.ref == 'refs/heads/main' && github.repository == 'v6d-io/v6d' }} + run: | + sudo make docker-push IMG=${IMG}:${{ github.sha }} + sudo docker push ${IMG}:nightly diff --git a/README.rst b/README.rst index 49330d49..9c5896ad 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ .. raw:: html

- vineyard + vineyard

an in-memory immutable data manager diff --git a/charts/hack/install-ubuntu.sh b/charts/hack/install-ubuntu.sh new file mode 100755 index 00000000..1132e4a5 --- /dev/null +++ b/charts/hack/install-ubuntu.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -x +set -e +set -o pipefail + +ROOT=$(dirname "${BASH_SOURCE[0]}")/.. + +helm install vineyard $ROOT/vineyard/ -n vineyard-system \ + --set image.repository="registry-vpc.cn-hongkong.aliyuncs.com/libvineyard/vineyardd" \ + --set image.tagPrefix=ubuntu \ + --set serviceAccountName=vineyard-server \ + --set env[0].name="VINEYARD_SYNC_CRDS",env[0].value="1" \ + --set vineyard.sharedMemorySize=8Gi + +set +x +set +e +set +o pipefail diff --git a/charts/hack/install.sh b/charts/hack/install.sh new file mode 100755 index 00000000..4357cb21 --- /dev/null +++ b/charts/hack/install.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -x +set -e +set -o pipefail + +ROOT=$(dirname "${BASH_SOURCE[0]}")/.. + +helm install vineyard $ROOT/vineyard/ -n vineyard-system \ + --set vineyard.sharedMemorySize=8Gi + +set +x +set +e +set +o pipefail diff --git a/charts/hack/uninstall.sh b/charts/hack/uninstall.sh new file mode 100755 index 00000000..55dbc3e0 --- /dev/null +++ b/charts/hack/uninstall.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +ROOT=$(dirname "${BASH_SOURCE[0]}")/.. + +helm uninstall vineyard -n vineyard-system + +kubectl -n vineyard-system delete localobjects --all 2>/dev/null || true +kubectl -n vineyard-system delete globalobjects --all 2>/dev/null || true + +set +x +set +e +set +o pipefail diff --git a/charts/vineyard/Chart.yaml b/charts/vineyard/Chart.yaml index ed816ce8..743805cc 100644 --- a/charts/vineyard/Chart.yaml +++ b/charts/vineyard/Chart.yaml @@ -36,4 +36,3 @@ version: 0.2.1 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. appVersion: 0.2.1 - diff --git a/charts/vineyard/templates/daemonset.yaml b/charts/vineyard/templates/daemonset.yaml index 7b078b41..d0636927 100644 --- a/charts/vineyard/templates/daemonset.yaml +++ b/charts/vineyard/templates/daemonset.yaml @@ -17,6 +17,9 @@ spec: labels: {{- include "vineyard.selectorLabels" . | nindent 8 }} spec: + {{- if .Values.serviceAccountName }} + serviceAccountName: {{ .Values.serviceAccountName }} + {{- end }} {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} @@ -27,11 +30,19 @@ spec: {{- end }} containers: - name: {{ .Chart.Name }} + {{- if .Values.image.tagPrefix }} + {{- if .Values.image.tag }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tagPrefix }}-{{ .Values.image.tag }}" + {{- else }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tagPrefix }}-v{{ default .Chart.AppVersion }}" + {{- end }} + {{- else }} {{- if .Values.image.tag }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" {{- else }} image: "{{ .Values.image.repository }}:v{{ default .Chart.AppVersion }}" {{- end }} + {{- end }} {{- if .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- end }} @@ -41,7 +52,7 @@ spec: - | /usr/bin/wait-for-it.sh -t 60 etcd-for-vineyard.{{ .Release.Namespace }}.svc.cluster.local:2379; sleep 1; - /usr/bin/vineyardd \ + /usr/local/bin/vineyardd \ {{- if .Values.vineyard.sharedMemorySize }} --size \ {{ .Values.vineyard.sharedMemorySize }} \ diff --git a/charts/vineyard/templates/etcd.yaml b/charts/vineyard/templates/etcd.yaml index b61087fc..30616f58 100644 --- a/charts/vineyard/templates/etcd.yaml +++ b/charts/vineyard/templates/etcd.yaml @@ -37,11 +37,11 @@ spec: - --advertise-client-urls - http://etcd0:2379 - --initial-cluster - - etcd0=http://etcd0:2380 + - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380 - --initial-cluster-state - new image: quay.io/coreos/etcd:latest - name: etcd0 + name: etcd ports: - containerPort: 2379 name: client @@ -71,3 +71,121 @@ spec: targetPort: 2380 selector: etcd_node: etcd0 + +--- + +apiVersion: v1 +kind: Pod +metadata: + labels: + app: etcd + etcd_node: etcd1 + name: etcd1 +spec: + containers: + - command: + - /usr/local/bin/etcd + - --name + - etcd1 + - --initial-advertise-peer-urls + - http://etcd1:2380 + - --listen-peer-urls + - http://0.0.0.0:2380 + - --listen-client-urls + - http://0.0.0.0:2379 + - --advertise-client-urls + - http://etcd1:2379 + - --initial-cluster + - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380 + - --initial-cluster-state + - new + image: quay.io/coreos/etcd:latest + name: etcd + ports: + - containerPort: 2379 + name: client + protocol: TCP + - containerPort: 2380 + name: server + protocol: TCP + restartPolicy: Always + +--- + +apiVersion: v1 +kind: Service +metadata: + labels: + etcd_node: etcd1 + name: etcd1 +spec: + ports: + - name: client + port: 2379 + protocol: TCP + targetPort: 2379 + - name: server + port: 2380 + protocol: TCP + targetPort: 2380 + selector: + etcd_node: etcd1 + +--- + +apiVersion: v1 +kind: Pod +metadata: + labels: + app: etcd + etcd_node: etcd2 + name: etcd2 +spec: + containers: + - command: + - /usr/local/bin/etcd + - --name + - etcd2 + - --initial-advertise-peer-urls + - http://etcd2:2380 + - --listen-peer-urls + - http://0.0.0.0:2380 + - --listen-client-urls + - http://0.0.0.0:2379 + - --advertise-client-urls + - http://etcd2:2379 + - --initial-cluster + - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380 + - --initial-cluster-state + - new + image: quay.io/coreos/etcd:latest + name: etcd + ports: + - containerPort: 2379 + name: client + protocol: TCP + - containerPort: 2380 + name: server + protocol: TCP + restartPolicy: Always + +--- + +apiVersion: v1 +kind: Service +metadata: + labels: + etcd_node: etcd2 + name: etcd2 +spec: + ports: + - name: client + port: 2379 + protocol: TCP + targetPort: 2379 + - name: server + port: 2380 + protocol: TCP + targetPort: 2380 + selector: + etcd_node: etcd2 diff --git a/charts/vineyard/values.yaml b/charts/vineyard/values.yaml index 6a7d74b0..c5ec10cc 100644 --- a/charts/vineyard/values.yaml +++ b/charts/vineyard/values.yaml @@ -2,12 +2,11 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 - image: repository: libvineyard/vineyardd - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. + tagPrefix: "" tag: "" imagePullSecrets: [] @@ -25,6 +24,7 @@ resources: {} # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # # limits: # cpu: 100m # memory: 128Mi @@ -39,6 +39,8 @@ affinity: {} vineyard: sharedMemorySize: "" +serviceAccountName: "" + tolerations: {} # this toleration is to have the daemonset runnable on master nodes # remove it if your masters can't run pods. diff --git a/cmake/FindRdkafka.cmake b/cmake/FindRdkafka.cmake index f53b0e3c..9b74c63c 100644 --- a/cmake/FindRdkafka.cmake +++ b/cmake/FindRdkafka.cmake @@ -8,32 +8,32 @@ # - Try to find librdkafka # # The following variables are optionally searched for defaults -# RDKAFKA_ROOT_DIR: Base directory where all RDKAFKA components are found +# Rdkafka_ROOT_DIR: Base directory where all rdkafka components are found # # The following are set after configuration is done: -# RDKAFKA_FOUND -# RDKAFKA_INCLUDE_DIRS -# RDKAFKA_LIBRARIES -# RDKAFKA_LIBRARY_DIRS +# Rdkafka_FOUND +# Rdkafka_INCLUDE_DIRS +# Rdkafka_LIBRARIES +# Rdkafka_LIBRARY_DIRS include(FindPackageHandleStandardArgs) -set(RDKAFKA_ROOT_DIR "" CACHE PATH "Folder contains librdkafka") +set(Rdkafka_ROOT_DIR "" CACHE PATH "Folder contains librdkafka") # We are testing only a couple of files in the include directories -find_path(RDKAFKA_INCLUDE_DIR librdkafka PATHS ${RDKAFKA_ROOT_DIR}/include) +find_path(Rdkafka_INCLUDE_DIR librdkafka PATHS ${Rdkafka_ROOT_DIR}/include) -find_library(RDKAFKA_LIBRARY rdkafka PATHS ${RDKAFKA_ROOT_DIR}/lib) -find_library(RDKAFKA++_LIBRARY rdkafka++ PATHS ${RDKAFKA_ROOT_DIR}/lib) +find_library(Rdkafka_LIBRARY rdkafka PATHS ${Rdkafka_ROOT_DIR}/lib) +find_library(Rdkafka++_LIBRARY rdkafka++ PATHS ${Rdkafka_ROOT_DIR}/lib) -find_package_handle_standard_args(RDKAFKA DEFAULT_MSG RDKAFKA_INCLUDE_DIR RDKAFKA_LIBRARY) +find_package_handle_standard_args(Rdkafka DEFAULT_MSG Rdkafka_INCLUDE_DIR Rdkafka_LIBRARY) -if(RDKAFKA_FOUND) - set(RDKAFKA_INCLUDE_DIRS ${RDKAFKA_INCLUDE_DIR}) - # The RDKAFKA_LIBRARY comes later, since it is depended by the former. - set(RDKAFKA_LIBRARIES ${RDKAFKA++_LIBRARY} ${RDKAFKA_LIBRARY}) - message(STATUS "Found rdkafka (include: ${RDKAFKA_INCLUDE_DIRS}, library: ${RDKAFKA_LIBRARIES})") - mark_as_advanced(RDKAFKA_LIBRARY_DEBUG RDKAFKA_LIBRARY_RELEASE - RDKAFKA_LIBRARY RDKAFKA_INCLUDE_DIR RDKAFKA_ROOT_DIR) +if(Rdkafka_FOUND) + set(Rdkafka_INCLUDE_DIRS ${Rdkafka_INCLUDE_DIR}) + # The Rdkafka_LIBRARY comes later, since it is depended by the former. + set(Rdkafka_LIBRARIES ${Rdkafka++_LIBRARY} ${Rdkafka_LIBRARY}) + message(STATUS "Found rdkafka (include: ${Rdkafka_INCLUDE_DIRS}, library: ${Rdkafka_LIBRARIES})") + mark_as_advanced(Rdkafka_LIBRARY_DEBUG Rdkafka_LIBRARY_RELEASE + Rdkafka_LIBRARY Rdkafka_INCLUDE_DIR Rdkafka_ROOT_DIR) endif() diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu new file mode 100644 index 00000000..42f3e2ce --- /dev/null +++ b/docker/Dockerfile.ubuntu @@ -0,0 +1,149 @@ +FROM ubuntu:20.04 + +# build command: +# +# docker build . -f docker/Dockerfile.ubuntu -t registry-vpc.cn-hongkong.aliyuncs.com/libvineyard/vineyardd:ubuntu + +WORKDIR /workspace +SHELL ["/bin/bash", "-c"] + +RUN export DEBIAN_FRONTEND="noninteractive" && \ + apt-get update -y && \ + apt-get install -y \ + automake \ + autoconf \ + ca-certificates \ + cmake \ + gcc \ + g++ \ + git \ + libboost-atomic-dev \ + libboost-chrono-dev \ + libboost-filesystem-dev \ + libboost-locale-dev \ + libboost-random-dev \ + libboost-regex-dev \ + libboost-system-dev \ + libboost-thread-dev \ + libcurl4-openssl-dev \ + libgflags-dev \ + libgoogle-glog-dev \ + libgrpc-dev \ + libgrpc++-dev \ + libprotobuf-dev \ + libpython3-dev \ + libssl-dev \ + libtinfo5 \ + libunwind-dev \ + libz-dev \ + lsb-release \ + protobuf-compiler-grpc \ + python3-pip \ + unzip \ + wget && \ + cd /tmp && \ + wget https://apache.bintray.com/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-archive-keyring-latest-$(lsb_release --codename --short).deb && \ + apt install -y -V ./apache-arrow-archive-keyring-latest-$(lsb_release --codename --short).deb && \ + apt update && \ + apt install -y libarrow-dev=1.0.1-1 libarrow-python-dev=1.0.1-1 && \ + rm -rf /tmp/apache-arrow-archive-keyring-latest-$(lsb_release --codename --short).deb && \ + apt-get clean autoclean + +# patchelf and auditwheel for wheel packaging +RUN cd /tmp && \ + git clone --depth=1 https://github.com/NixOS/patchelf.git && \ + pushd patchelf && \ + ./bootstrap.sh && \ + ./configure && \ + make install -j && \ + popd && \ + rm -rf patchelf/ && \ + pip3 install auditwheel && \ + sed -i 's/p.error/logger.warning/g' /usr/local/lib/python3.8/dist-packages/auditwheel/main_repair.py + +# install etcd +RUN cd /tmp && \ + wget https://github.com/etcd-io/etcd/releases/download/v3.4.13/etcd-v3.4.13-linux-amd64.tar.gz && \ + tar zxvf etcd-v3.4.13-linux-amd64.tar.gz && \ + mv etcd-v3.4.13-linux-amd64/etcd /usr/bin/ && \ + mv etcd-v3.4.13-linux-amd64/etcdctl /usr/bin/ && \ + rm -rf /tmp/etcd-v3.4.13-linux-amd64.tar.gz /tmp/etcd-v3.4.13-linux-amd64 + +# install kubectl +RUN cd /tmp && \ + wget https://dl.k8s.io/release/v1.19.0/bin/linux/amd64/kubectl && \ + chmod +x kubectl && \ + mv kubectl /usr/bin/kubectl + +# install wait-for-it +RUN cd /tmp && \ + wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && \ + chmod +x wait-for-it.sh && \ + mv wait-for-it.sh /usr/bin/wait-for-it.sh + +COPY thirdparty/ thirdparty/ + +# install cpprestsdk and etcd-cpp-apiv3 +RUN pushd thirdparty/cpprestsdk && \ + mkdir build && \ + pushd build && \ + cmake .. \ + -DBUILD_TESTS=OFF \ + -DBUILD_SAMPLES=OFF \ + -DCPPREST_EXCLUDE_WEBSOCKETS=ON && \ + make install -j`nproc` && \ + popd && \ + rm -rf build && \ + popd && \ + pushd thirdparty/etcd-cpp-apiv3 && \ + mkdir build && \ + pushd build && \ + cmake .. \ + -DBUILD_ETCD_TESTS=OFF && \ + make install -j`nproc` && \ + popd && \ + rm -rf build && \ + popd + +# copy to workspace +COPY cmake/ cmake/ +COPY README.rst README.rst +COPY setup.cfg.in setup.cfg.in +COPY setup.py setup.py +COPY vineyard-config-version.in.cmake vineyard-config-version.in.cmake +COPY vineyard-config.in.cmake vineyard-config.in.cmake + +COPY CMakeLists.txt CMakeLists.txt +COPY modules/ modules/ +COPY python/ python/ +COPY src/ src/ + +# build & install +RUN mkdir build && \ + cd build && \ + cmake .. \ + -DCMAKE_BUILD_TYPE=Debug \ + -DUSE_EXTERNAL_ETCD_LIBS=ON \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_VINEYARD_COVERAGE=OFF \ + -DBUILD_VINEYARD_PYTHON_BINDINGS=ON \ + -DBUILD_VINEYARD_SERVER=ON \ + -DBUILD_VINEYARD_CLIENT=ON \ + -DBUILD_VINEYARD_PYTHON_BINDINGS=OFF \ + -DBUILD_VINEYARD_PYPI_PACKAGES=ON \ + -DBUILD_VINEYARD_BASIC=OFF \ + -DBUILD_VINEYARD_GRAPH=OFF \ + -DBUILD_VINEYARD_IO=OFF \ + -DBUILD_VINEYARD_MIGRATION=ON \ + -DBUILD_VINEYARD_TESTS=OFF \ + -DBUILD_VINEYARD_TESTS_ALL=OFF \ + -DBUILD_VINEYARD_PROFILING=OFF && \ + make -j`nproc` && \ + make vineyard_client_python -j`nproc` && \ + make install && \ + cd .. && \ + python3 setup.py bdist_wheel && \ + cd dist && \ + auditwheel repair --plat=manylinux2014_x86_64 ./*.whl && \ + pip3 install wheelhouse/*.whl && \ + rm -rf /workspace diff --git a/docker/Dockerfile.vineyardd b/docker/Dockerfile.vineyardd index 79aac28e..83162227 100644 --- a/docker/Dockerfile.vineyardd +++ b/docker/Dockerfile.vineyardd @@ -62,4 +62,4 @@ COPY --from=builder /tmp/etcd-v3.4.13-linux-amd64/etcd /usr/bin/etcd COPY --from=builder /work/libvineyard/build/bin/vineyardd /usr/bin/vineyardd ENTRYPOINT ["/usr/bin/dumb-init", "--"] -CMD ["/usr/bin/vineyardd"] +CMD ["/usr/local/bin/vineyardd"] diff --git a/docker/Makefile b/docker/Makefile new file mode 100644 index 00000000..c0263691 --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,19 @@ +REGISTRY := registry-vpc.cn-hongkong.aliyuncs.com +IMAGE := libvineyard/vineyardd + +ALPINE_REGISTRY := docker.pkg.github.com/v6d-io +ALPINE_IMAGE := v6d/vineyardd + +ubuntu: ubuntu-build ubuntu-push + +ubuntu-build: Dockerfile.ubuntu + docker build .. -f Dockerfile.ubuntu -t $(REGISTRY)/$(IMAGE):ubuntu +.PHONY: ubuntu-build + +ubuntu-push: Dockerfile.ubuntu + docker push $(REGISTRY)/$(IMAGE):ubuntu +.PHONY: ubuntu-push + +alpine: + docker build .. -f Dockerfile.vineyardd -t $(ALPINE_REGISTRY)/$(ALPINE_IMAGE):alpine-latest +.PHONY: alpine diff --git a/docs/images/vineyard_logo.png b/docs/images/vineyard-logo-v6d.png similarity index 100% rename from docs/images/vineyard_logo.png rename to docs/images/vineyard-logo-v6d.png diff --git a/docs/images/vineyard-logo-vineyard.png b/docs/images/vineyard-logo.png similarity index 100% rename from docs/images/vineyard-logo-vineyard.png rename to docs/images/vineyard-logo.png diff --git a/k8s/.dockerignore b/k8s/.dockerignore new file mode 100644 index 00000000..42e32b71 --- /dev/null +++ b/k8s/.dockerignore @@ -0,0 +1,2 @@ +/bin/ +/vendor/ \ No newline at end of file diff --git a/k8s/.gitignore b/k8s/.gitignore new file mode 100644 index 00000000..223e507b --- /dev/null +++ b/k8s/.gitignore @@ -0,0 +1,28 @@ + +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib +bin + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Kubernetes Generated files - skip generated files, except for vendored files + +!vendor/**/zz_generated.* + +# editor and IDE paraphernalia +.idea +*.swp +*.swo +*~ + +# vendor, used for code-generate only +/vendor/ + diff --git a/k8s/Dockerfile b/k8s/Dockerfile new file mode 100644 index 00000000..8e6c4611 --- /dev/null +++ b/k8s/Dockerfile @@ -0,0 +1,32 @@ +# Build the manager binary +FROM golang:1.15 as builder + +WORKDIR /workspace +# Copy the Go Modules manifests +COPY go.mod go.mod +COPY go.sum go.sum +# cache deps before building and copying source so that we don't need to re-download as much +# and so that source changes don't invalidate our downloaded layer +RUN go mod download + +# Copy the go source +COPY main.go main.go +COPY api/ api/ +COPY config/scheduler/config.yaml scheduler-config.yaml +COPY controllers/ controllers/ +COPY generated/ generated/ +COPY hack/ hack/ +COPY schedulers/ schedulers/ + +# Build +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go + +# Use distroless as minimal base image to package the manager binary +# Refer to https://github.com/GoogleContainerTools/distroless for more details +FROM gcr.io/distroless/static:nonroot +WORKDIR / +COPY --from=builder /workspace/manager . +COPY --from=builder /workspace/scheduler-config.yaml /etc/kubernetes/scheduler.yaml +USER nonroot:nonroot + +ENTRYPOINT ["/manager"] diff --git a/k8s/Makefile b/k8s/Makefile new file mode 100644 index 00000000..202c8264 --- /dev/null +++ b/k8s/Makefile @@ -0,0 +1,150 @@ +# Current Operator version +VERSION ?= 0.0.1 +# Default bundle image tag +BUNDLE_IMG ?= controller-bundle:$(VERSION) +# Options for 'bundle-build' +ifneq ($(origin CHANNELS), undefined) +BUNDLE_CHANNELS := --channels=$(CHANNELS) +endif +ifneq ($(origin DEFAULT_CHANNEL), undefined) +BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL) +endif +BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) + +# Image URL to use all building/pushing image targets +IMG ?= registry-vpc.cn-hongkong.aliyuncs.com/libvineyard/vineyard-controller:latest +# Produce CRDs that work back to Kubernetes 1.11 (no version conversion) +CRD_OPTIONS ?= "crd:trivialVersions=true" + +# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) +ifeq (,$(shell go env GOBIN)) +GOBIN=$(shell go env GOPATH)/bin +else +GOBIN=$(shell go env GOBIN) +endif + +all: manager + +# Run tests +ENVTEST_ASSETS_DIR = $(shell pwd)/testbin +test: generate fmt vet manifests + mkdir -p $(ENVTEST_ASSETS_DIR) + test -f $(ENVTEST_ASSETS_DIR)/setup-envtest.sh || curl -sSLo $(ENVTEST_ASSETS_DIR)/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.6.3/hack/setup-envtest.sh + source $(ENVTEST_ASSETS_DIR)/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out + +# Build manager binary +manager: generate fmt vet + go build -o bin/manager main.go + +# Run against the configured Kubernetes cluster in ~/.kube/config +run: generate fmt vet manifests + go run ./main.go + +# Install CRDs into a cluster +install: manifests kustomize + $(KUSTOMIZE) build config/crd | kubectl apply -f - + +# Uninstall CRDs from a cluster +uninstall: manifests kustomize + $(KUSTOMIZE) build config/crd | kubectl delete -f - + +# Deploy controller in the configured Kubernetes cluster in ~/.kube/config +deploy: manifests kustomize + cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} + $(KUSTOMIZE) build config/default | kubectl apply -f - + +# Undeploy controller in the configured Kubernetes cluster in ~/.kube/config +undeploy: kustomize + kubectl -n vineyard-system delete deployment vineyard-controller-manager + +# Deploy namespace, CRDs, rbac, etc. except the controller in the configured Kubernetes cluster in ~/.kube/config +predeploy: manifests kustomize + cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} + $(KUSTOMIZE) build config/environment | kubectl apply -f - + +# dump the deployment configuration +dry-run: manifests kustomize + cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} + $(KUSTOMIZE) build config/environment > env.yaml + $(KUSTOMIZE) build config/default > controller.yaml + +# Generate manifests e.g. CRD, RBAC etc. +manifests: controller-gen + $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./api/..." output:crd:artifacts:config=config/crd/bases + +# Go modules +modules = ./api/... \ + ./controllers/... \ + ./schedulers/... + +# Run go fmt against code +fmt: + go fmt ./main.go + go fmt $(modules) + +# Run go vet against code +vet: + go vet ./main.go + go vet $(modules) + +# Generate code +generate: controller-gen + $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/..." + +# Vendor modules for code-generate +vendor: + go mod tidy + go mod vendor + +# Build the docker image +docker-build: + docker build . -t ${IMG} + +# Push the docker image +docker-push: + docker push ${IMG} + +# find or download controller-gen +# download controller-gen if necessary +controller-gen: +ifeq (, $(shell which controller-gen)) + @{ \ + set -e ;\ + CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\ + cd $$CONTROLLER_GEN_TMP_DIR ;\ + go mod init tmp ;\ + go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0 ;\ + rm -rf $$CONTROLLER_GEN_TMP_DIR ;\ + } +CONTROLLER_GEN=$(GOBIN)/controller-gen +else +CONTROLLER_GEN=$(shell which controller-gen) +endif + +kustomize: +ifeq (, $(shell which kustomize)) + @{ \ + set -e ;\ + KUSTOMIZE_GEN_TMP_DIR=$$(mktemp -d) ;\ + cd $$KUSTOMIZE_GEN_TMP_DIR ;\ + go mod init tmp ;\ + go get sigs.k8s.io/kustomize/kustomize/v3@v3.5.4 ;\ + rm -rf $$KUSTOMIZE_GEN_TMP_DIR ;\ + } +KUSTOMIZE=$(GOBIN)/kustomize +else +KUSTOMIZE=$(shell which kustomize) +endif + +# Generate bundle manifests and metadata, then validate generated files. +.PHONY: bundle +bundle: manifests kustomize + operator-sdk generate kustomize manifests -q + cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) + $(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) + operator-sdk bundle validate ./bundle + +# Build the bundle image. +.PHONY: bundle-build +bundle-build: + docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) . diff --git a/k8s/PROJECT b/k8s/PROJECT new file mode 100644 index 00000000..c94594c4 --- /dev/null +++ b/k8s/PROJECT @@ -0,0 +1,14 @@ +domain: v6d.io +layout: go.kubebuilder.io/v2 +projectName: vineyard +repo: github.com/v6d-io/v6d/k8s +resources: +- group: k8s + kind: LocalObject + version: v1alpha1 +- group: k8s + kind: GlobalObject + version: v1alpha1 +version: 3-alpha +plugins: + go.sdk.operatorframework.io/v2-alpha: {} diff --git a/k8s/README.md b/k8s/README.md new file mode 100644 index 00000000..59e8b705 --- /dev/null +++ b/k8s/README.md @@ -0,0 +1,49 @@ +Vineyard Operator +----------------- + +Vineyard operator is a kubernetes controller to operator the vineyard cluster. Within the +vineyard operator, there's a scheduler-plugin called `vineyard-scheduler` which performs +data aware job scheduling based on the locality information of objects in vineyard. + +### CRDs + +Vineyard operator defines two CRDs to represents objects in vineyard: + +- `GlobalObject` for global objects +- `LocalObject` for local objects + +### Scheduler Plugin + +The scheduler plugin works based the CRDs in the cluster. When vineyardd persists objects +to etcd, it will create a CRD entry in kubernetes as well. The metadata of CRD has location +information and scheduler plugin scores pod based on the data locality of required objects +by jobs. For jobs, some label annotation are used to describe which objects are required +in the pod spec. + +```yaml +labels: + app: pytorch + scheduling.k8s.v6d.io/job: pytorch + scheduling.k8s.v6d.io/required: "o0000022285553e22" + scheduling.k8s.v6d.io/replica: "4" +``` + +### Deploy + +To make the docker image for the controller, run + +```bash +make docker-build +``` + +To install CRDs and required k8s cluster roles, run + +```bash +make predeploy +``` + +To deploy the custom scheduler, run + +```bash +make deploy +``` diff --git a/k8s/api/k8s/v1alpha1/globalobject_types.go b/k8s/api/k8s/v1alpha1/globalobject_types.go new file mode 100644 index 00000000..734ef355 --- /dev/null +++ b/k8s/api/k8s/v1alpha1/globalobject_types.go @@ -0,0 +1,73 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// GlobalObjectSpec defines the desired state of GlobalObject +type GlobalObjectSpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "make" to regenerate code after modifying this file + + ObjectID string `json:"id"` + Name string `json:"name,omitempty"` + Signature string `json:"signature"` + Typename string `json:"typename,omitempty"` + Members []string `json:"members"` + Metadata string `json:"metadata"` +} + +// GlobalObjectStatus defines the observed state of GlobalObject +type GlobalObjectStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "make" to regenerate code after modifying this file +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=all,shortName=gobject +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Id",type=string,JSONPath=`.spec.id` +// +kubebuilder:printcolumn:name="Name",type=string,JSONPath=`.spec.name` +// +kubebuilder:printcolumn:name="Signature",type=string,JSONPath=`.spec.signature` +// +kubebuilder:printcolumn:name="Typename",type=string,JSONPath=`.spec.typename` +// +genclient + +// GlobalObject is the Schema for the globalobjects API +type GlobalObject struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec GlobalObjectSpec `json:"spec,omitempty"` + Status GlobalObjectStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// GlobalObjectList contains a list of GlobalObject +type GlobalObjectList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []GlobalObject `json:"items"` +} + +func init() { + SchemeBuilder.Register(&GlobalObject{}, &GlobalObjectList{}) +} diff --git a/k8s/api/k8s/v1alpha1/groupversion_info.go b/k8s/api/k8s/v1alpha1/groupversion_info.go new file mode 100644 index 00000000..7a274c68 --- /dev/null +++ b/k8s/api/k8s/v1alpha1/groupversion_info.go @@ -0,0 +1,48 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ + +// Package v1alpha1 contains API Schema definitions for the k8s v1alpha1 API group +// +kubebuilder:object:generate=true +// +groupName=k8s.v6d.io +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "k8s.v6d.io", Version: "v1alpha1"} + + // SchemeGroupVersion is the group version used for generated code by code-generator + SchemeGroupVersion = GroupVersion + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} diff --git a/k8s/api/k8s/v1alpha1/localobject_types.go b/k8s/api/k8s/v1alpha1/localobject_types.go new file mode 100644 index 00000000..7992e295 --- /dev/null +++ b/k8s/api/k8s/v1alpha1/localobject_types.go @@ -0,0 +1,76 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// LocalObjectSpec defines the desired state of LocalObject +type LocalObjectSpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "make" to regenerate code after modifying this file + + ObjectID string `json:"id"` + Name string `json:"name,omitempty"` + Signature string `json:"signature"` + Typename string `json:"typename,omitempty"` + InstanceID int `json:"instance_id"` + Hostname string `json:"hostname"` + Metadata string `json:"metadata"` +} + +// LocalObjectStatus defines the observed state of LocalObject +type LocalObjectStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "make" to regenerate code after modifying this file +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=all,shortName=lobject +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Id",type=string,JSONPath=`.spec.id` +// +kubebuilder:printcolumn:name="Name",type=string,JSONPath=`.spec.name` +// +kubebuilder:printcolumn:name="Signature",type=string,JSONPath=`.spec.signature` +// +kubebuilder:printcolumn:name="Typename",type=string,JSONPath=`.spec.typename` +// +kubebuilder:printcolumn:name="Instance",type=integer,JSONPath=`.spec.instance_id` +// +kubebuilder:printcolumn:name="Hostname",type=string,JSONPath=`.spec.hostname` +// +genclient + +// LocalObject is the Schema for the localobjects API +type LocalObject struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec LocalObjectSpec `json:"spec,omitempty"` + Status LocalObjectStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// LocalObjectList contains a list of LocalObject +type LocalObjectList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []LocalObject `json:"items"` +} + +func init() { + SchemeBuilder.Register(&LocalObject{}, &LocalObjectList{}) +} diff --git a/k8s/api/k8s/v1alpha1/zz_generated.deepcopy.go b/k8s/api/k8s/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 00000000..4110b950 --- /dev/null +++ b/k8s/api/k8s/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,207 @@ +// +build !ignore_autogenerated + +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalObject) DeepCopyInto(out *GlobalObject) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalObject. +func (in *GlobalObject) DeepCopy() *GlobalObject { + if in == nil { + return nil + } + out := new(GlobalObject) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GlobalObject) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalObjectList) DeepCopyInto(out *GlobalObjectList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GlobalObject, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalObjectList. +func (in *GlobalObjectList) DeepCopy() *GlobalObjectList { + if in == nil { + return nil + } + out := new(GlobalObjectList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GlobalObjectList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalObjectSpec) DeepCopyInto(out *GlobalObjectSpec) { + *out = *in + if in.Members != nil { + in, out := &in.Members, &out.Members + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalObjectSpec. +func (in *GlobalObjectSpec) DeepCopy() *GlobalObjectSpec { + if in == nil { + return nil + } + out := new(GlobalObjectSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalObjectStatus) DeepCopyInto(out *GlobalObjectStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalObjectStatus. +func (in *GlobalObjectStatus) DeepCopy() *GlobalObjectStatus { + if in == nil { + return nil + } + out := new(GlobalObjectStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalObject) DeepCopyInto(out *LocalObject) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObject. +func (in *LocalObject) DeepCopy() *LocalObject { + if in == nil { + return nil + } + out := new(LocalObject) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalObject) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalObjectList) DeepCopyInto(out *LocalObjectList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LocalObject, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObjectList. +func (in *LocalObjectList) DeepCopy() *LocalObjectList { + if in == nil { + return nil + } + out := new(LocalObjectList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalObjectList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalObjectSpec) DeepCopyInto(out *LocalObjectSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObjectSpec. +func (in *LocalObjectSpec) DeepCopy() *LocalObjectSpec { + if in == nil { + return nil + } + out := new(LocalObjectSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalObjectStatus) DeepCopyInto(out *LocalObjectStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObjectStatus. +func (in *LocalObjectStatus) DeepCopy() *LocalObjectStatus { + if in == nil { + return nil + } + out := new(LocalObjectStatus) + in.DeepCopyInto(out) + return out +} diff --git a/k8s/config/certmanager/certificate.yaml b/k8s/config/certmanager/certificate.yaml new file mode 100644 index 00000000..58db114f --- /dev/null +++ b/k8s/config/certmanager/certificate.yaml @@ -0,0 +1,26 @@ +# The following manifests contain a self-signed issuer CR and a certificate CR. +# More document can be found at https://docs.cert-manager.io +# WARNING: Targets CertManager 0.11 check https://docs.cert-manager.io/en/latest/tasks/upgrading/index.html for +# breaking changes +apiVersion: cert-manager.io/v1alpha2 +kind: Issuer +metadata: + name: selfsigned-issuer + namespace: system +spec: + selfSigned: {} +--- +apiVersion: cert-manager.io/v1alpha2 +kind: Certificate +metadata: + name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml + namespace: system +spec: + # $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize + dnsNames: + - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc + - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local + issuerRef: + kind: Issuer + name: selfsigned-issuer + secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize diff --git a/k8s/config/certmanager/kustomization.yaml b/k8s/config/certmanager/kustomization.yaml new file mode 100644 index 00000000..bebea5a5 --- /dev/null +++ b/k8s/config/certmanager/kustomization.yaml @@ -0,0 +1,5 @@ +resources: +- certificate.yaml + +configurations: +- kustomizeconfig.yaml diff --git a/k8s/config/certmanager/kustomizeconfig.yaml b/k8s/config/certmanager/kustomizeconfig.yaml new file mode 100644 index 00000000..90d7c313 --- /dev/null +++ b/k8s/config/certmanager/kustomizeconfig.yaml @@ -0,0 +1,16 @@ +# This configuration is for teaching kustomize how to update name ref and var substitution +nameReference: +- kind: Issuer + group: cert-manager.io + fieldSpecs: + - kind: Certificate + group: cert-manager.io + path: spec/issuerRef/name + +varReference: +- kind: Certificate + group: cert-manager.io + path: spec/commonName +- kind: Certificate + group: cert-manager.io + path: spec/dnsNames diff --git a/k8s/config/crd/bases/k8s.v6d.io_globalobjects.yaml b/k8s/config/crd/bases/k8s.v6d.io_globalobjects.yaml new file mode 100644 index 00000000..332ec826 --- /dev/null +++ b/k8s/config/crd/bases/k8s.v6d.io_globalobjects.yaml @@ -0,0 +1,90 @@ + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.3.0 + creationTimestamp: null + name: globalobjects.k8s.v6d.io +spec: + additionalPrinterColumns: + - JSONPath: .spec.id + name: Id + type: string + - JSONPath: .spec.name + name: Name + type: string + - JSONPath: .spec.signature + name: Signature + type: string + - JSONPath: .spec.typename + name: Typename + type: string + group: k8s.v6d.io + names: + categories: + - all + kind: GlobalObject + listKind: GlobalObjectList + plural: globalobjects + shortNames: + - gobject + singular: globalobject + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + description: GlobalObject is the Schema for the globalobjects API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: GlobalObjectSpec defines the desired state of GlobalObject + properties: + id: + type: string + members: + items: + type: string + type: array + metadata: + type: string + name: + type: string + signature: + type: string + typename: + type: string + required: + - id + - members + - metadata + - signature + type: object + status: + description: GlobalObjectStatus defines the observed state of GlobalObject + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/k8s/config/crd/bases/k8s.v6d.io_localobjects.yaml b/k8s/config/crd/bases/k8s.v6d.io_localobjects.yaml new file mode 100644 index 00000000..14cd09f0 --- /dev/null +++ b/k8s/config/crd/bases/k8s.v6d.io_localobjects.yaml @@ -0,0 +1,97 @@ + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.3.0 + creationTimestamp: null + name: localobjects.k8s.v6d.io +spec: + additionalPrinterColumns: + - JSONPath: .spec.id + name: Id + type: string + - JSONPath: .spec.name + name: Name + type: string + - JSONPath: .spec.signature + name: Signature + type: string + - JSONPath: .spec.typename + name: Typename + type: string + - JSONPath: .spec.instance_id + name: Instance + type: integer + - JSONPath: .spec.hostname + name: Hostname + type: string + group: k8s.v6d.io + names: + categories: + - all + kind: LocalObject + listKind: LocalObjectList + plural: localobjects + shortNames: + - lobject + singular: localobject + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + description: LocalObject is the Schema for the localobjects API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: LocalObjectSpec defines the desired state of LocalObject + properties: + hostname: + type: string + id: + type: string + instance_id: + type: integer + metadata: + type: string + name: + type: string + signature: + type: string + typename: + type: string + required: + - hostname + - id + - instance_id + - metadata + - signature + type: object + status: + description: LocalObjectStatus defines the observed state of LocalObject + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/k8s/config/crd/kustomization.yaml b/k8s/config/crd/kustomization.yaml new file mode 100644 index 00000000..9a48278b --- /dev/null +++ b/k8s/config/crd/kustomization.yaml @@ -0,0 +1,24 @@ +# This kustomization.yaml is not intended to be run by itself, +# since it depends on service name and namespace that are out of this kustomize package. +# It should be run by config/default +resources: +- bases/k8s.v6d.io_localobjects.yaml +- bases/k8s.v6d.io_globalobjects.yaml +# +kubebuilder:scaffold:crdkustomizeresource + +patchesStrategicMerge: +# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. +# patches here are for enabling the conversion webhook for each CRD +#- patches/webhook_in_localobjects.yaml +#- patches/webhook_in_globalobjects.yaml +# +kubebuilder:scaffold:crdkustomizewebhookpatch + +# [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix. +# patches here are for enabling the CA injection for each CRD +#- patches/cainjection_in_localobjects.yaml +#- patches/cainjection_in_globalobjects.yaml +# +kubebuilder:scaffold:crdkustomizecainjectionpatch + +# the following config is for teaching kustomize how to do kustomization for CRDs. +configurations: +- kustomizeconfig.yaml diff --git a/k8s/config/crd/kustomizeconfig.yaml b/k8s/config/crd/kustomizeconfig.yaml new file mode 100644 index 00000000..6f83d9a9 --- /dev/null +++ b/k8s/config/crd/kustomizeconfig.yaml @@ -0,0 +1,17 @@ +# This file is for teaching kustomize how to substitute name and namespace reference in CRD +nameReference: +- kind: Service + version: v1 + fieldSpecs: + - kind: CustomResourceDefinition + group: apiextensions.k8s.io + path: spec/conversion/webhookClientConfig/service/name + +namespace: +- kind: CustomResourceDefinition + group: apiextensions.k8s.io + path: spec/conversion/webhookClientConfig/service/namespace + create: false + +varReference: +- path: metadata/annotations diff --git a/k8s/config/crd/patches/cainjection_in_globalobjects.yaml b/k8s/config/crd/patches/cainjection_in_globalobjects.yaml new file mode 100644 index 00000000..83e89b35 --- /dev/null +++ b/k8s/config/crd/patches/cainjection_in_globalobjects.yaml @@ -0,0 +1,8 @@ +# The following patch adds a directive for certmanager to inject CA into the CRD +# CRD conversion requires k8s 1.13 or later. +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: globalobjects.k8s.v6d.io diff --git a/k8s/config/crd/patches/cainjection_in_localobjects.yaml b/k8s/config/crd/patches/cainjection_in_localobjects.yaml new file mode 100644 index 00000000..7d26a6b4 --- /dev/null +++ b/k8s/config/crd/patches/cainjection_in_localobjects.yaml @@ -0,0 +1,8 @@ +# The following patch adds a directive for certmanager to inject CA into the CRD +# CRD conversion requires k8s 1.13 or later. +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: localobjects.k8s.v6d.io diff --git a/k8s/config/crd/patches/webhook_in_globalobjects.yaml b/k8s/config/crd/patches/webhook_in_globalobjects.yaml new file mode 100644 index 00000000..e3b03f1f --- /dev/null +++ b/k8s/config/crd/patches/webhook_in_globalobjects.yaml @@ -0,0 +1,17 @@ +# The following patch enables conversion webhook for CRD +# CRD conversion requires k8s 1.13 or later. +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: globalobjects.k8s.v6d.io +spec: + conversion: + strategy: Webhook + webhookClientConfig: + # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, + # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) + caBundle: Cg== + service: + namespace: system + name: webhook-service + path: /convert diff --git a/k8s/config/crd/patches/webhook_in_localobjects.yaml b/k8s/config/crd/patches/webhook_in_localobjects.yaml new file mode 100644 index 00000000..f44cca3e --- /dev/null +++ b/k8s/config/crd/patches/webhook_in_localobjects.yaml @@ -0,0 +1,17 @@ +# The following patch enables conversion webhook for CRD +# CRD conversion requires k8s 1.13 or later. +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: localobjects.k8s.v6d.io +spec: + conversion: + strategy: Webhook + webhookClientConfig: + # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, + # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) + caBundle: Cg== + service: + namespace: system + name: webhook-service + path: /convert diff --git a/k8s/config/default/kustomization.yaml b/k8s/config/default/kustomization.yaml new file mode 100644 index 00000000..556643fd --- /dev/null +++ b/k8s/config/default/kustomization.yaml @@ -0,0 +1,68 @@ +# Adds namespace to all resources. +namespace: vineyard-system + +# Value of this field is prepended to the +# names of all resources, e.g. a deployment named +# "wordpress" becomes "alices-wordpress". +# Note that it should also match with the prefix (text before '-') of the namespace +# field above. +namePrefix: vineyard- + +# Labels to add to all resources and selectors. +#commonLabels: +# someName: someValue + +bases: +- ../manager +# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in +# crd/kustomization.yaml +#- ../webhook +# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. +#- ../certmanager +# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. +#- ../prometheus + +patchesStrategicMerge: + # Protect the /metrics endpoint by putting it behind auth. + # If you want your controller-manager to expose the /metrics + # endpoint w/o any authn/z, please comment the following line. +- manager_auth_proxy_patch.yaml + +# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in +# crd/kustomization.yaml +#- manager_webhook_patch.yaml + +# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. +# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. +# 'CERTMANAGER' needs to be enabled to use ca injection +#- webhookcainjection_patch.yaml + +# the following config is for teaching kustomize how to do var substitution +vars: +# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. +#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR +# objref: +# kind: Certificate +# group: cert-manager.io +# version: v1alpha2 +# name: serving-cert # this name should match the one in certificate.yaml +# fieldref: +# fieldpath: metadata.namespace +#- name: CERTIFICATE_NAME +# objref: +# kind: Certificate +# group: cert-manager.io +# version: v1alpha2 +# name: serving-cert # this name should match the one in certificate.yaml +#- name: SERVICE_NAMESPACE # namespace of the service +# objref: +# kind: Service +# version: v1 +# name: webhook-service +# fieldref: +# fieldpath: metadata.namespace +#- name: SERVICE_NAME +# objref: +# kind: Service +# version: v1 +# name: webhook-service diff --git a/k8s/config/default/manager_auth_proxy_patch.yaml b/k8s/config/default/manager_auth_proxy_patch.yaml new file mode 100644 index 00000000..e8b539d8 --- /dev/null +++ b/k8s/config/default/manager_auth_proxy_patch.yaml @@ -0,0 +1,25 @@ +# This patch inject a sidecar container which is a HTTP proxy for the +# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: controller-manager + namespace: system +spec: + template: + spec: + containers: + - name: kube-rbac-proxy + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0 + args: + - "--secure-listen-address=0.0.0.0:8443" + - "--upstream=http://127.0.0.1:8080/" + - "--logtostderr=true" + - "--v=10" + ports: + - containerPort: 8443 + name: https + - name: manager + args: + - "--metrics-addr=127.0.0.1:8080" + # - "--enable-leader-election" diff --git a/k8s/config/default/manager_webhook_patch.yaml b/k8s/config/default/manager_webhook_patch.yaml new file mode 100644 index 00000000..738de350 --- /dev/null +++ b/k8s/config/default/manager_webhook_patch.yaml @@ -0,0 +1,23 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: controller-manager + namespace: system +spec: + template: + spec: + containers: + - name: manager + ports: + - containerPort: 9443 + name: webhook-server + protocol: TCP + volumeMounts: + - mountPath: /tmp/k8s-webhook-server/serving-certs + name: cert + readOnly: true + volumes: + - name: cert + secret: + defaultMode: 420 + secretName: webhook-server-cert diff --git a/k8s/config/default/webhookcainjection_patch.yaml b/k8s/config/default/webhookcainjection_patch.yaml new file mode 100644 index 00000000..7e79bf99 --- /dev/null +++ b/k8s/config/default/webhookcainjection_patch.yaml @@ -0,0 +1,15 @@ +# This patch add annotation to admission webhook config and +# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize. +apiVersion: admissionregistration.k8s.io/v1beta1 +kind: MutatingWebhookConfiguration +metadata: + name: mutating-webhook-configuration + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) +--- +apiVersion: admissionregistration.k8s.io/v1beta1 +kind: ValidatingWebhookConfiguration +metadata: + name: validating-webhook-configuration + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) diff --git a/k8s/config/environment/kustomization.yaml b/k8s/config/environment/kustomization.yaml new file mode 100644 index 00000000..cc957dba --- /dev/null +++ b/k8s/config/environment/kustomization.yaml @@ -0,0 +1,18 @@ +# Adds namespace to all resources. +namespace: vineyard-system + +# Note that it should also match with the prefix (text before '-') of the namespace +# field above. +namePrefix: vineyard- + +# Labels to add to all resources and selectors. +#commonLabels: +# someName: someValue + +bases: +- ../namespace +- ../crd +- ../rbac + +# the following config is for teaching kustomize how to do var substitution +vars: diff --git a/k8s/config/manager/kustomization.yaml b/k8s/config/manager/kustomization.yaml new file mode 100644 index 00000000..2cb54f28 --- /dev/null +++ b/k8s/config/manager/kustomization.yaml @@ -0,0 +1,8 @@ +resources: +- manager.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +images: +- name: controller + newName: registry-vpc.cn-hongkong.aliyuncs.com/libvineyard/vineyard-controller + newTag: latest diff --git a/k8s/config/manager/manager.yaml b/k8s/config/manager/manager.yaml new file mode 100644 index 00000000..9bd17505 --- /dev/null +++ b/k8s/config/manager/manager.yaml @@ -0,0 +1,37 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: controller-manager + namespace: system + labels: + control-plane: controller-manager +spec: + selector: + matchLabels: + control-plane: controller-manager + replicas: 1 + template: + metadata: + labels: + control-plane: controller-manager + spec: + serviceAccountName: vineyard-manager + containers: + - command: + - /manager + # args: + # - --enable-leader-election + image: controller:latest + imagePullPolicy: Always + name: manager + resources: + limits: + cpu: 100m + memory: 30Mi + requests: + cpu: 100m + memory: 20Mi + env: + - name: GOTRACEBACK + value: system + terminationGracePeriodSeconds: 10 diff --git a/k8s/config/namespace/kustomization.yaml b/k8s/config/namespace/kustomization.yaml new file mode 100644 index 00000000..cdbd2f36 --- /dev/null +++ b/k8s/config/namespace/kustomization.yaml @@ -0,0 +1,4 @@ +resources: +- namespace.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization diff --git a/k8s/config/namespace/namespace.yaml b/k8s/config/namespace/namespace.yaml new file mode 100644 index 00000000..8b55c3cd --- /dev/null +++ b/k8s/config/namespace/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + labels: + control-plane: controller-manager + name: system diff --git a/k8s/config/prometheus/kustomization.yaml b/k8s/config/prometheus/kustomization.yaml new file mode 100644 index 00000000..ed137168 --- /dev/null +++ b/k8s/config/prometheus/kustomization.yaml @@ -0,0 +1,2 @@ +resources: +- monitor.yaml diff --git a/k8s/config/prometheus/monitor.yaml b/k8s/config/prometheus/monitor.yaml new file mode 100644 index 00000000..9b8047b7 --- /dev/null +++ b/k8s/config/prometheus/monitor.yaml @@ -0,0 +1,16 @@ + +# Prometheus Monitor Service (Metrics) +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + control-plane: controller-manager + name: controller-manager-metrics-monitor + namespace: system +spec: + endpoints: + - path: /metrics + port: https + selector: + matchLabels: + control-plane: controller-manager diff --git a/k8s/config/rbac/auth_proxy_client_clusterrole.yaml b/k8s/config/rbac/auth_proxy_client_clusterrole.yaml new file mode 100644 index 00000000..bd4af137 --- /dev/null +++ b/k8s/config/rbac/auth_proxy_client_clusterrole.yaml @@ -0,0 +1,7 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: metrics-reader +rules: +- nonResourceURLs: ["/metrics"] + verbs: ["get"] diff --git a/k8s/config/rbac/auth_proxy_role.yaml b/k8s/config/rbac/auth_proxy_role.yaml new file mode 100644 index 00000000..618f5e41 --- /dev/null +++ b/k8s/config/rbac/auth_proxy_role.yaml @@ -0,0 +1,13 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: proxy-role +rules: +- apiGroups: ["authentication.k8s.io"] + resources: + - tokenreviews + verbs: ["create"] +- apiGroups: ["authorization.k8s.io"] + resources: + - subjectaccessreviews + verbs: ["create"] diff --git a/k8s/config/rbac/auth_proxy_role_binding.yaml b/k8s/config/rbac/auth_proxy_role_binding.yaml new file mode 100644 index 00000000..48ed1e4b --- /dev/null +++ b/k8s/config/rbac/auth_proxy_role_binding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: proxy-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: proxy-role +subjects: +- kind: ServiceAccount + name: default + namespace: system diff --git a/k8s/config/rbac/auth_proxy_service.yaml b/k8s/config/rbac/auth_proxy_service.yaml new file mode 100644 index 00000000..6cf656be --- /dev/null +++ b/k8s/config/rbac/auth_proxy_service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + control-plane: controller-manager + name: controller-manager-metrics-service + namespace: system +spec: + ports: + - name: https + port: 8443 + targetPort: https + selector: + control-plane: controller-manager diff --git a/k8s/config/rbac/globalobject_editor_role.yaml b/k8s/config/rbac/globalobject_editor_role.yaml new file mode 100644 index 00000000..c87b9cf8 --- /dev/null +++ b/k8s/config/rbac/globalobject_editor_role.yaml @@ -0,0 +1,24 @@ +# permissions for end users to edit globalobjects. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: globalobject-editor-role +rules: +- apiGroups: + - k8s.v6d.io + resources: + - globalobjects + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - k8s.v6d.io + resources: + - globalobjects/status + verbs: + - get diff --git a/k8s/config/rbac/globalobject_viewer_role.yaml b/k8s/config/rbac/globalobject_viewer_role.yaml new file mode 100644 index 00000000..c9e71730 --- /dev/null +++ b/k8s/config/rbac/globalobject_viewer_role.yaml @@ -0,0 +1,20 @@ +# permissions for end users to view globalobjects. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: globalobject-viewer-role +rules: +- apiGroups: + - k8s.v6d.io + resources: + - globalobjects + verbs: + - get + - list + - watch +- apiGroups: + - k8s.v6d.io + resources: + - globalobjects/status + verbs: + - get diff --git a/k8s/config/rbac/kustomization.yaml b/k8s/config/rbac/kustomization.yaml new file mode 100644 index 00000000..f92ada4d --- /dev/null +++ b/k8s/config/rbac/kustomization.yaml @@ -0,0 +1,16 @@ +resources: +- role.yaml +- role_binding.yaml +- leader_election_role.yaml +- leader_election_role_binding.yaml +# Comment the following 4 lines if you want to disable +# the auth proxy (https://github.com/brancz/kube-rbac-proxy) +# which protects your /metrics endpoint. +- auth_proxy_service.yaml +- auth_proxy_role.yaml +- auth_proxy_role_binding.yaml +- auth_proxy_client_clusterrole.yaml + +# service account for vineyardd and vineyard scheduler. +- manager_account.yaml +- vineyardd_account.yaml diff --git a/k8s/config/rbac/leader_election_role.yaml b/k8s/config/rbac/leader_election_role.yaml new file mode 100644 index 00000000..7dc16c42 --- /dev/null +++ b/k8s/config/rbac/leader_election_role.yaml @@ -0,0 +1,33 @@ +# permissions to do leader election. +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: leader-election-role +rules: +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - "" + resources: + - configmaps/status + verbs: + - get + - update + - patch +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch diff --git a/k8s/config/rbac/leader_election_role_binding.yaml b/k8s/config/rbac/leader_election_role_binding.yaml new file mode 100644 index 00000000..eed16906 --- /dev/null +++ b/k8s/config/rbac/leader_election_role_binding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: leader-election-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: leader-election-role +subjects: +- kind: ServiceAccount + name: default + namespace: system diff --git a/k8s/config/rbac/localobject_editor_role.yaml b/k8s/config/rbac/localobject_editor_role.yaml new file mode 100644 index 00000000..10428f8b --- /dev/null +++ b/k8s/config/rbac/localobject_editor_role.yaml @@ -0,0 +1,24 @@ +# permissions for end users to edit localobjects. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: localobject-editor-role +rules: +- apiGroups: + - k8s.v6d.io + resources: + - localobjects + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - k8s.v6d.io + resources: + - localobjects/status + verbs: + - get diff --git a/k8s/config/rbac/localobject_viewer_role.yaml b/k8s/config/rbac/localobject_viewer_role.yaml new file mode 100644 index 00000000..1e2eda33 --- /dev/null +++ b/k8s/config/rbac/localobject_viewer_role.yaml @@ -0,0 +1,20 @@ +# permissions for end users to view localobjects. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: localobject-viewer-role +rules: +- apiGroups: + - k8s.v6d.io + resources: + - localobjects + verbs: + - get + - list + - watch +- apiGroups: + - k8s.v6d.io + resources: + - localobjects/status + verbs: + - get diff --git a/k8s/config/rbac/manager_account.yaml b/k8s/config/rbac/manager_account.yaml new file mode 100644 index 00000000..a7bebbbc --- /dev/null +++ b/k8s/config/rbac/manager_account.yaml @@ -0,0 +1,75 @@ + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: manager + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: scheduler-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: manager-role +subjects: +- kind: ServiceAccount + name: manager + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: kube-scheduler-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system:kube-scheduler +subjects: +- kind: ServiceAccount + name: manager + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: volume-scheduler-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system:volume-scheduler +subjects: +- kind: ServiceAccount + name: manager + + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: scheduler-plugin-role +rules: +- apiGroups: [""] + resources: ["configmaps"] + verbs: ["create", "get", "list", "update", "watch"] +- apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["create", "get", "list", "update"] +- apiGroups: ["events.k8s.io"] + resources: ["events"] + verbs: ["create", "patch", "update"] + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: scheduler-plugin-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: scheduler-plugin-role +subjects: +- kind: ServiceAccount + name: manager diff --git a/k8s/config/rbac/role.yaml b/k8s/config/rbac/role.yaml new file mode 100644 index 00000000..763eb16b --- /dev/null +++ b/k8s/config/rbac/role.yaml @@ -0,0 +1,48 @@ + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + name: manager-role +rules: +- apiGroups: + - k8s.v6d.io + resources: + - globalobjects + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - k8s.v6d.io + resources: + - globalobjects/status + verbs: + - get + - patch + - update +- apiGroups: + - k8s.v6d.io + resources: + - localobjects + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - k8s.v6d.io + resources: + - localobjects/status + verbs: + - get + - patch + - update diff --git a/k8s/config/rbac/role_binding.yaml b/k8s/config/rbac/role_binding.yaml new file mode 100644 index 00000000..8f265870 --- /dev/null +++ b/k8s/config/rbac/role_binding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: manager-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: manager-role +subjects: +- kind: ServiceAccount + name: default + namespace: system diff --git a/k8s/config/rbac/vineyardd_account.yaml b/k8s/config/rbac/vineyardd_account.yaml new file mode 100644 index 00000000..e42ecfd7 --- /dev/null +++ b/k8s/config/rbac/vineyardd_account.yaml @@ -0,0 +1,19 @@ + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: server + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: server-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: manager-role +subjects: +- kind: ServiceAccount + name: server diff --git a/k8s/config/samples/k8s_v1alpha1_globalobject.yaml b/k8s/config/samples/k8s_v1alpha1_globalobject.yaml new file mode 100644 index 00000000..0a0244e5 --- /dev/null +++ b/k8s/config/samples/k8s_v1alpha1_globalobject.yaml @@ -0,0 +1,15 @@ +apiVersion: k8s.v6d.io/v1alpha1 +kind: GlobalObject +metadata: + name: globalobject-sample +spec: + # Add fields here + id: o123 + signature: s111 + typename: vineyard::GlobalTensor + instance_id: 0 + members: + - a1 + - a2 + - a3 + metadata: "yyy" diff --git a/k8s/config/samples/k8s_v1alpha1_localobject.yaml b/k8s/config/samples/k8s_v1alpha1_localobject.yaml new file mode 100644 index 00000000..8e44e3b7 --- /dev/null +++ b/k8s/config/samples/k8s_v1alpha1_localobject.yaml @@ -0,0 +1,14 @@ +apiVersion: k8s.v6d.io/v1alpha1 +kind: LocalObject +metadata: + name: localobject-sample + labels: + k8s.v6d.io/signature: xxxx +spec: + # Add fields here + id: o123 + signature: s111 + typename: vineyard::Array + instance_id: 10 + hostname: h1 + metadata: "xxx" diff --git a/k8s/config/samples/kustomization.yaml b/k8s/config/samples/kustomization.yaml new file mode 100644 index 00000000..1c9c6e56 --- /dev/null +++ b/k8s/config/samples/kustomization.yaml @@ -0,0 +1,5 @@ +## Append samples you want in your CSV to this file as resources ## +resources: +# - k8s_v1alpha1_localobject.yaml +# - k8s_v1alpha1_globalobject.yaml +# +kubebuilder:scaffold:manifestskustomizesamples diff --git a/k8s/config/scheduler/config.yaml b/k8s/config/scheduler/config.yaml new file mode 100644 index 00000000..eeca9add --- /dev/null +++ b/k8s/config/scheduler/config.yaml @@ -0,0 +1,26 @@ +apiVersion: kubescheduler.config.k8s.io/v1beta1 +kind: KubeSchedulerConfiguration +leaderElection: + leaderElect: false + leaseDuration: 60s + resourceLock: leases + resourceName: vineyard-scheduler + resourceNamespace: vineyard-system +profiles: + - schedulerName: vineyard-scheduler + plugins: + score: + enabled: + - name: Vineyard + disabled: + - name: "*" + preFilter: + enabled: + - name: Vineyard + permit: + enabled: + - name: Vineyard + postBind: + enabled: + - name: Vineyard + diff --git a/k8s/config/scorecard/bases/config.yaml b/k8s/config/scorecard/bases/config.yaml new file mode 100644 index 00000000..c7704784 --- /dev/null +++ b/k8s/config/scorecard/bases/config.yaml @@ -0,0 +1,7 @@ +apiVersion: scorecard.operatorframework.io/v1alpha3 +kind: Configuration +metadata: + name: config +stages: +- parallel: true + tests: [] diff --git a/k8s/config/scorecard/kustomization.yaml b/k8s/config/scorecard/kustomization.yaml new file mode 100644 index 00000000..d73509ee --- /dev/null +++ b/k8s/config/scorecard/kustomization.yaml @@ -0,0 +1,16 @@ +resources: +- bases/config.yaml +patchesJson6902: +- path: patches/basic.config.yaml + target: + group: scorecard.operatorframework.io + version: v1alpha3 + kind: Configuration + name: config +- path: patches/olm.config.yaml + target: + group: scorecard.operatorframework.io + version: v1alpha3 + kind: Configuration + name: config +# +kubebuilder:scaffold:patchesJson6902 diff --git a/k8s/config/scorecard/patches/basic.config.yaml b/k8s/config/scorecard/patches/basic.config.yaml new file mode 100644 index 00000000..d4347861 --- /dev/null +++ b/k8s/config/scorecard/patches/basic.config.yaml @@ -0,0 +1,10 @@ +- op: add + path: /stages/0/tests/- + value: + entrypoint: + - scorecard-test + - basic-check-spec + image: quay.io/operator-framework/scorecard-test:v1.3.0 + labels: + suite: basic + test: basic-check-spec-test diff --git a/k8s/config/scorecard/patches/olm.config.yaml b/k8s/config/scorecard/patches/olm.config.yaml new file mode 100644 index 00000000..890bf057 --- /dev/null +++ b/k8s/config/scorecard/patches/olm.config.yaml @@ -0,0 +1,50 @@ +- op: add + path: /stages/0/tests/- + value: + entrypoint: + - scorecard-test + - olm-bundle-validation + image: quay.io/operator-framework/scorecard-test:v1.3.0 + labels: + suite: olm + test: olm-bundle-validation-test +- op: add + path: /stages/0/tests/- + value: + entrypoint: + - scorecard-test + - olm-crds-have-validation + image: quay.io/operator-framework/scorecard-test:v1.3.0 + labels: + suite: olm + test: olm-crds-have-validation-test +- op: add + path: /stages/0/tests/- + value: + entrypoint: + - scorecard-test + - olm-crds-have-resources + image: quay.io/operator-framework/scorecard-test:v1.3.0 + labels: + suite: olm + test: olm-crds-have-resources-test +- op: add + path: /stages/0/tests/- + value: + entrypoint: + - scorecard-test + - olm-spec-descriptors + image: quay.io/operator-framework/scorecard-test:v1.3.0 + labels: + suite: olm + test: olm-spec-descriptors-test +- op: add + path: /stages/0/tests/- + value: + entrypoint: + - scorecard-test + - olm-status-descriptors + image: quay.io/operator-framework/scorecard-test:v1.3.0 + labels: + suite: olm + test: olm-status-descriptors-test diff --git a/k8s/config/webhook/kustomization.yaml b/k8s/config/webhook/kustomization.yaml new file mode 100644 index 00000000..9cf26134 --- /dev/null +++ b/k8s/config/webhook/kustomization.yaml @@ -0,0 +1,6 @@ +resources: +- manifests.yaml +- service.yaml + +configurations: +- kustomizeconfig.yaml diff --git a/k8s/config/webhook/kustomizeconfig.yaml b/k8s/config/webhook/kustomizeconfig.yaml new file mode 100644 index 00000000..25e21e3c --- /dev/null +++ b/k8s/config/webhook/kustomizeconfig.yaml @@ -0,0 +1,25 @@ +# the following config is for teaching kustomize where to look at when substituting vars. +# It requires kustomize v2.1.0 or newer to work properly. +nameReference: +- kind: Service + version: v1 + fieldSpecs: + - kind: MutatingWebhookConfiguration + group: admissionregistration.k8s.io + path: webhooks/clientConfig/service/name + - kind: ValidatingWebhookConfiguration + group: admissionregistration.k8s.io + path: webhooks/clientConfig/service/name + +namespace: +- kind: MutatingWebhookConfiguration + group: admissionregistration.k8s.io + path: webhooks/clientConfig/service/namespace + create: true +- kind: ValidatingWebhookConfiguration + group: admissionregistration.k8s.io + path: webhooks/clientConfig/service/namespace + create: true + +varReference: +- path: metadata/annotations diff --git a/k8s/config/webhook/service.yaml b/k8s/config/webhook/service.yaml new file mode 100644 index 00000000..31e0f829 --- /dev/null +++ b/k8s/config/webhook/service.yaml @@ -0,0 +1,12 @@ + +apiVersion: v1 +kind: Service +metadata: + name: webhook-service + namespace: system +spec: + ports: + - port: 443 + targetPort: 9443 + selector: + control-plane: controller-manager diff --git a/k8s/controllers/globalobject_controller.go b/k8s/controllers/globalobject_controller.go new file mode 100644 index 00000000..35706126 --- /dev/null +++ b/k8s/controllers/globalobject_controller.go @@ -0,0 +1,52 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ + +package controllers + +import ( + "context" + + "github.com/go-logr/logr" + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + + k8sv1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" +) + +// GlobalObjectReconciler reconciles a GlobalObject object +type GlobalObjectReconciler struct { + client.Client + Log logr.Logger + Scheme *runtime.Scheme +} + +// +kubebuilder:rbac:groups=k8s.v6d.io,resources=globalobjects,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=k8s.v6d.io,resources=globalobjects/status,verbs=get;update;patch + +func (r *GlobalObjectReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { + _ = context.Background() + _ = r.Log.WithValues("globalobject", req.NamespacedName) + + // your logic here + + return ctrl.Result{}, nil +} + +func (r *GlobalObjectReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + For(&k8sv1alpha1.GlobalObject{}). + Complete(r) +} diff --git a/k8s/controllers/localobject_controller.go b/k8s/controllers/localobject_controller.go new file mode 100644 index 00000000..7da8d6ad --- /dev/null +++ b/k8s/controllers/localobject_controller.go @@ -0,0 +1,52 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ + +package controllers + +import ( + "context" + + "github.com/go-logr/logr" + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + + k8sv1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" +) + +// LocalObjectReconciler reconciles a LocalObject object +type LocalObjectReconciler struct { + client.Client + Log logr.Logger + Scheme *runtime.Scheme +} + +// +kubebuilder:rbac:groups=k8s.v6d.io,resources=localobjects,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=k8s.v6d.io,resources=localobjects/status,verbs=get;update;patch + +func (r *LocalObjectReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { + _ = context.Background() + _ = r.Log.WithValues("localobject", req.NamespacedName) + + // your logic here + + return ctrl.Result{}, nil +} + +func (r *LocalObjectReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + For(&k8sv1alpha1.LocalObject{}). + Complete(r) +} diff --git a/k8s/controllers/suite_test.go b/k8s/controllers/suite_test.go new file mode 100644 index 00000000..57c6a6e3 --- /dev/null +++ b/k8s/controllers/suite_test.go @@ -0,0 +1,83 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ + +package controllers + +import ( + "path/filepath" + "testing" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/envtest" + "sigs.k8s.io/controller-runtime/pkg/envtest/printer" + logf "sigs.k8s.io/controller-runtime/pkg/log" + "sigs.k8s.io/controller-runtime/pkg/log/zap" + + k8sv1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + // +kubebuilder:scaffold:imports +) + +// These tests use Ginkgo (BDD-style Go testing framework). Refer to +// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. + +var cfg *rest.Config +var k8sClient client.Client +var testEnv *envtest.Environment + +func TestAPIs(t *testing.T) { + RegisterFailHandler(Fail) + + RunSpecsWithDefaultAndCustomReporters(t, + "Controller Suite", + []Reporter{printer.NewlineReporter{}}) +} + +var _ = BeforeSuite(func(done Done) { + logf.SetLogger(zap.LoggerTo(GinkgoWriter, true)) + + By("bootstrapping test environment") + testEnv = &envtest.Environment{ + CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")}, + } + + var err error + cfg, err = testEnv.Start() + Expect(err).ToNot(HaveOccurred()) + Expect(cfg).ToNot(BeNil()) + + err = k8sv1alpha1.AddToScheme(scheme.Scheme) + Expect(err).NotTo(HaveOccurred()) + + err = k8sv1alpha1.AddToScheme(scheme.Scheme) + Expect(err).NotTo(HaveOccurred()) + + // +kubebuilder:scaffold:scheme + + k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) + Expect(err).ToNot(HaveOccurred()) + Expect(k8sClient).ToNot(BeNil()) + + close(done) +}, 60) + +var _ = AfterSuite(func() { + By("tearing down the test environment") + err := testEnv.Stop() + Expect(err).ToNot(HaveOccurred()) +}) diff --git a/k8s/generated/clientset/versioned/clientset.go b/k8s/generated/clientset/versioned/clientset.go new file mode 100644 index 00000000..eae2ffaf --- /dev/null +++ b/k8s/generated/clientset/versioned/clientset.go @@ -0,0 +1,95 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + + k8sv1alpha1 "github.com/v6d-io/v6d/k8s/generated/clientset/versioned/typed/k8s/v1alpha1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + K8sV1alpha1() k8sv1alpha1.K8sV1alpha1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + k8sV1alpha1 *k8sv1alpha1.K8sV1alpha1Client +} + +// K8sV1alpha1 retrieves the K8sV1alpha1Client +func (c *Clientset) K8sV1alpha1() k8sv1alpha1.K8sV1alpha1Interface { + return c.k8sV1alpha1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + var cs Clientset + var err error + cs.k8sV1alpha1, err = k8sv1alpha1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + var cs Clientset + cs.k8sV1alpha1 = k8sv1alpha1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.k8sV1alpha1 = k8sv1alpha1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/k8s/generated/clientset/versioned/doc.go b/k8s/generated/clientset/versioned/doc.go new file mode 100644 index 00000000..64f2e280 --- /dev/null +++ b/k8s/generated/clientset/versioned/doc.go @@ -0,0 +1,18 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/k8s/generated/clientset/versioned/fake/clientset_generated.go b/k8s/generated/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 00000000..227646dc --- /dev/null +++ b/k8s/generated/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,80 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/v6d-io/v6d/k8s/generated/clientset/versioned" + k8sv1alpha1 "github.com/v6d-io/v6d/k8s/generated/clientset/versioned/typed/k8s/v1alpha1" + fakek8sv1alpha1 "github.com/v6d-io/v6d/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// K8sV1alpha1 retrieves the K8sV1alpha1Client +func (c *Clientset) K8sV1alpha1() k8sv1alpha1.K8sV1alpha1Interface { + return &fakek8sv1alpha1.FakeK8sV1alpha1{Fake: &c.Fake} +} diff --git a/k8s/generated/clientset/versioned/fake/doc.go b/k8s/generated/clientset/versioned/fake/doc.go new file mode 100644 index 00000000..8d202185 --- /dev/null +++ b/k8s/generated/clientset/versioned/fake/doc.go @@ -0,0 +1,18 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/k8s/generated/clientset/versioned/fake/register.go b/k8s/generated/clientset/versioned/fake/register.go new file mode 100644 index 00000000..c0cc5b56 --- /dev/null +++ b/k8s/generated/clientset/versioned/fake/register.go @@ -0,0 +1,54 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + k8sv1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + k8sv1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/k8s/generated/clientset/versioned/scheme/doc.go b/k8s/generated/clientset/versioned/scheme/doc.go new file mode 100644 index 00000000..0ac516f0 --- /dev/null +++ b/k8s/generated/clientset/versioned/scheme/doc.go @@ -0,0 +1,18 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/k8s/generated/clientset/versioned/scheme/register.go b/k8s/generated/clientset/versioned/scheme/register.go new file mode 100644 index 00000000..8079a394 --- /dev/null +++ b/k8s/generated/clientset/versioned/scheme/register.go @@ -0,0 +1,54 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + k8sv1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + k8sv1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/doc.go b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/doc.go new file mode 100644 index 00000000..1e9fd714 --- /dev/null +++ b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/doc.go @@ -0,0 +1,18 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/doc.go b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/doc.go new file mode 100644 index 00000000..c594822c --- /dev/null +++ b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/doc.go @@ -0,0 +1,18 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/fake_globalobject.go b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/fake_globalobject.go new file mode 100644 index 00000000..d90e753e --- /dev/null +++ b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/fake_globalobject.go @@ -0,0 +1,140 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeGlobalObjects implements GlobalObjectInterface +type FakeGlobalObjects struct { + Fake *FakeK8sV1alpha1 + ns string +} + +var globalobjectsResource = schema.GroupVersionResource{Group: "k8s", Version: "v1alpha1", Resource: "globalobjects"} + +var globalobjectsKind = schema.GroupVersionKind{Group: "k8s", Version: "v1alpha1", Kind: "GlobalObject"} + +// Get takes name of the globalObject, and returns the corresponding globalObject object, and an error if there is any. +func (c *FakeGlobalObjects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GlobalObject, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(globalobjectsResource, c.ns, name), &v1alpha1.GlobalObject{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GlobalObject), err +} + +// List takes label and field selectors, and returns the list of GlobalObjects that match those selectors. +func (c *FakeGlobalObjects) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GlobalObjectList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(globalobjectsResource, globalobjectsKind, c.ns, opts), &v1alpha1.GlobalObjectList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.GlobalObjectList{ListMeta: obj.(*v1alpha1.GlobalObjectList).ListMeta} + for _, item := range obj.(*v1alpha1.GlobalObjectList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested globalObjects. +func (c *FakeGlobalObjects) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(globalobjectsResource, c.ns, opts)) + +} + +// Create takes the representation of a globalObject and creates it. Returns the server's representation of the globalObject, and an error, if there is any. +func (c *FakeGlobalObjects) Create(ctx context.Context, globalObject *v1alpha1.GlobalObject, opts v1.CreateOptions) (result *v1alpha1.GlobalObject, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(globalobjectsResource, c.ns, globalObject), &v1alpha1.GlobalObject{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GlobalObject), err +} + +// Update takes the representation of a globalObject and updates it. Returns the server's representation of the globalObject, and an error, if there is any. +func (c *FakeGlobalObjects) Update(ctx context.Context, globalObject *v1alpha1.GlobalObject, opts v1.UpdateOptions) (result *v1alpha1.GlobalObject, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(globalobjectsResource, c.ns, globalObject), &v1alpha1.GlobalObject{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GlobalObject), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeGlobalObjects) UpdateStatus(ctx context.Context, globalObject *v1alpha1.GlobalObject, opts v1.UpdateOptions) (*v1alpha1.GlobalObject, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(globalobjectsResource, "status", c.ns, globalObject), &v1alpha1.GlobalObject{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GlobalObject), err +} + +// Delete takes name of the globalObject and deletes it. Returns an error if one occurs. +func (c *FakeGlobalObjects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(globalobjectsResource, c.ns, name), &v1alpha1.GlobalObject{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGlobalObjects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(globalobjectsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.GlobalObjectList{}) + return err +} + +// Patch applies the patch and returns the patched globalObject. +func (c *FakeGlobalObjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.GlobalObject, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(globalobjectsResource, c.ns, name, pt, data, subresources...), &v1alpha1.GlobalObject{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GlobalObject), err +} diff --git a/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/fake_k8s_client.go b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/fake_k8s_client.go new file mode 100644 index 00000000..d032b172 --- /dev/null +++ b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/fake_k8s_client.go @@ -0,0 +1,42 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/v6d-io/v6d/k8s/generated/clientset/versioned/typed/k8s/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeK8sV1alpha1 struct { + *testing.Fake +} + +func (c *FakeK8sV1alpha1) GlobalObjects(namespace string) v1alpha1.GlobalObjectInterface { + return &FakeGlobalObjects{c, namespace} +} + +func (c *FakeK8sV1alpha1) LocalObjects(namespace string) v1alpha1.LocalObjectInterface { + return &FakeLocalObjects{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeK8sV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/fake_localobject.go b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/fake_localobject.go new file mode 100644 index 00000000..507dc42c --- /dev/null +++ b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/fake/fake_localobject.go @@ -0,0 +1,140 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeLocalObjects implements LocalObjectInterface +type FakeLocalObjects struct { + Fake *FakeK8sV1alpha1 + ns string +} + +var localobjectsResource = schema.GroupVersionResource{Group: "k8s", Version: "v1alpha1", Resource: "localobjects"} + +var localobjectsKind = schema.GroupVersionKind{Group: "k8s", Version: "v1alpha1", Kind: "LocalObject"} + +// Get takes name of the localObject, and returns the corresponding localObject object, and an error if there is any. +func (c *FakeLocalObjects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LocalObject, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(localobjectsResource, c.ns, name), &v1alpha1.LocalObject{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.LocalObject), err +} + +// List takes label and field selectors, and returns the list of LocalObjects that match those selectors. +func (c *FakeLocalObjects) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LocalObjectList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(localobjectsResource, localobjectsKind, c.ns, opts), &v1alpha1.LocalObjectList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.LocalObjectList{ListMeta: obj.(*v1alpha1.LocalObjectList).ListMeta} + for _, item := range obj.(*v1alpha1.LocalObjectList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested localObjects. +func (c *FakeLocalObjects) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(localobjectsResource, c.ns, opts)) + +} + +// Create takes the representation of a localObject and creates it. Returns the server's representation of the localObject, and an error, if there is any. +func (c *FakeLocalObjects) Create(ctx context.Context, localObject *v1alpha1.LocalObject, opts v1.CreateOptions) (result *v1alpha1.LocalObject, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(localobjectsResource, c.ns, localObject), &v1alpha1.LocalObject{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.LocalObject), err +} + +// Update takes the representation of a localObject and updates it. Returns the server's representation of the localObject, and an error, if there is any. +func (c *FakeLocalObjects) Update(ctx context.Context, localObject *v1alpha1.LocalObject, opts v1.UpdateOptions) (result *v1alpha1.LocalObject, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(localobjectsResource, c.ns, localObject), &v1alpha1.LocalObject{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.LocalObject), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeLocalObjects) UpdateStatus(ctx context.Context, localObject *v1alpha1.LocalObject, opts v1.UpdateOptions) (*v1alpha1.LocalObject, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(localobjectsResource, "status", c.ns, localObject), &v1alpha1.LocalObject{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.LocalObject), err +} + +// Delete takes name of the localObject and deletes it. Returns an error if one occurs. +func (c *FakeLocalObjects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(localobjectsResource, c.ns, name), &v1alpha1.LocalObject{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeLocalObjects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(localobjectsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.LocalObjectList{}) + return err +} + +// Patch applies the patch and returns the patched localObject. +func (c *FakeLocalObjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LocalObject, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(localobjectsResource, c.ns, name, pt, data, subresources...), &v1alpha1.LocalObject{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.LocalObject), err +} diff --git a/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/generated_expansion.go b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/generated_expansion.go new file mode 100644 index 00000000..a82330f2 --- /dev/null +++ b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/generated_expansion.go @@ -0,0 +1,21 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type GlobalObjectExpansion interface{} + +type LocalObjectExpansion interface{} diff --git a/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/globalobject.go b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/globalobject.go new file mode 100644 index 00000000..7985ff19 --- /dev/null +++ b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/globalobject.go @@ -0,0 +1,193 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + scheme "github.com/v6d-io/v6d/k8s/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// GlobalObjectsGetter has a method to return a GlobalObjectInterface. +// A group's client should implement this interface. +type GlobalObjectsGetter interface { + GlobalObjects(namespace string) GlobalObjectInterface +} + +// GlobalObjectInterface has methods to work with GlobalObject resources. +type GlobalObjectInterface interface { + Create(ctx context.Context, globalObject *v1alpha1.GlobalObject, opts v1.CreateOptions) (*v1alpha1.GlobalObject, error) + Update(ctx context.Context, globalObject *v1alpha1.GlobalObject, opts v1.UpdateOptions) (*v1alpha1.GlobalObject, error) + UpdateStatus(ctx context.Context, globalObject *v1alpha1.GlobalObject, opts v1.UpdateOptions) (*v1alpha1.GlobalObject, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.GlobalObject, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.GlobalObjectList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.GlobalObject, err error) + GlobalObjectExpansion +} + +// globalObjects implements GlobalObjectInterface +type globalObjects struct { + client rest.Interface + ns string +} + +// newGlobalObjects returns a GlobalObjects +func newGlobalObjects(c *K8sV1alpha1Client, namespace string) *globalObjects { + return &globalObjects{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the globalObject, and returns the corresponding globalObject object, and an error if there is any. +func (c *globalObjects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GlobalObject, err error) { + result = &v1alpha1.GlobalObject{} + err = c.client.Get(). + Namespace(c.ns). + Resource("globalobjects"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GlobalObjects that match those selectors. +func (c *globalObjects) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GlobalObjectList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.GlobalObjectList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("globalobjects"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested globalObjects. +func (c *globalObjects) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("globalobjects"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a globalObject and creates it. Returns the server's representation of the globalObject, and an error, if there is any. +func (c *globalObjects) Create(ctx context.Context, globalObject *v1alpha1.GlobalObject, opts v1.CreateOptions) (result *v1alpha1.GlobalObject, err error) { + result = &v1alpha1.GlobalObject{} + err = c.client.Post(). + Namespace(c.ns). + Resource("globalobjects"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalObject). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a globalObject and updates it. Returns the server's representation of the globalObject, and an error, if there is any. +func (c *globalObjects) Update(ctx context.Context, globalObject *v1alpha1.GlobalObject, opts v1.UpdateOptions) (result *v1alpha1.GlobalObject, err error) { + result = &v1alpha1.GlobalObject{} + err = c.client.Put(). + Namespace(c.ns). + Resource("globalobjects"). + Name(globalObject.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalObject). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *globalObjects) UpdateStatus(ctx context.Context, globalObject *v1alpha1.GlobalObject, opts v1.UpdateOptions) (result *v1alpha1.GlobalObject, err error) { + result = &v1alpha1.GlobalObject{} + err = c.client.Put(). + Namespace(c.ns). + Resource("globalobjects"). + Name(globalObject.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalObject). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the globalObject and deletes it. Returns an error if one occurs. +func (c *globalObjects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("globalobjects"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *globalObjects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("globalobjects"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched globalObject. +func (c *globalObjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.GlobalObject, err error) { + result = &v1alpha1.GlobalObject{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("globalobjects"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/k8s_client.go b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/k8s_client.go new file mode 100644 index 00000000..6cd998aa --- /dev/null +++ b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/k8s_client.go @@ -0,0 +1,92 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + "github.com/v6d-io/v6d/k8s/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type K8sV1alpha1Interface interface { + RESTClient() rest.Interface + GlobalObjectsGetter + LocalObjectsGetter +} + +// K8sV1alpha1Client is used to interact with features provided by the k8s group. +type K8sV1alpha1Client struct { + restClient rest.Interface +} + +func (c *K8sV1alpha1Client) GlobalObjects(namespace string) GlobalObjectInterface { + return newGlobalObjects(c, namespace) +} + +func (c *K8sV1alpha1Client) LocalObjects(namespace string) LocalObjectInterface { + return newLocalObjects(c, namespace) +} + +// NewForConfig creates a new K8sV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*K8sV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &K8sV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new K8sV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *K8sV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new K8sV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *K8sV1alpha1Client { + return &K8sV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *K8sV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/localobject.go b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/localobject.go new file mode 100644 index 00000000..8e869200 --- /dev/null +++ b/k8s/generated/clientset/versioned/typed/k8s/v1alpha1/localobject.go @@ -0,0 +1,193 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + scheme "github.com/v6d-io/v6d/k8s/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// LocalObjectsGetter has a method to return a LocalObjectInterface. +// A group's client should implement this interface. +type LocalObjectsGetter interface { + LocalObjects(namespace string) LocalObjectInterface +} + +// LocalObjectInterface has methods to work with LocalObject resources. +type LocalObjectInterface interface { + Create(ctx context.Context, localObject *v1alpha1.LocalObject, opts v1.CreateOptions) (*v1alpha1.LocalObject, error) + Update(ctx context.Context, localObject *v1alpha1.LocalObject, opts v1.UpdateOptions) (*v1alpha1.LocalObject, error) + UpdateStatus(ctx context.Context, localObject *v1alpha1.LocalObject, opts v1.UpdateOptions) (*v1alpha1.LocalObject, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.LocalObject, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.LocalObjectList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LocalObject, err error) + LocalObjectExpansion +} + +// localObjects implements LocalObjectInterface +type localObjects struct { + client rest.Interface + ns string +} + +// newLocalObjects returns a LocalObjects +func newLocalObjects(c *K8sV1alpha1Client, namespace string) *localObjects { + return &localObjects{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the localObject, and returns the corresponding localObject object, and an error if there is any. +func (c *localObjects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LocalObject, err error) { + result = &v1alpha1.LocalObject{} + err = c.client.Get(). + Namespace(c.ns). + Resource("localobjects"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of LocalObjects that match those selectors. +func (c *localObjects) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LocalObjectList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.LocalObjectList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("localobjects"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested localObjects. +func (c *localObjects) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("localobjects"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a localObject and creates it. Returns the server's representation of the localObject, and an error, if there is any. +func (c *localObjects) Create(ctx context.Context, localObject *v1alpha1.LocalObject, opts v1.CreateOptions) (result *v1alpha1.LocalObject, err error) { + result = &v1alpha1.LocalObject{} + err = c.client.Post(). + Namespace(c.ns). + Resource("localobjects"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localObject). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a localObject and updates it. Returns the server's representation of the localObject, and an error, if there is any. +func (c *localObjects) Update(ctx context.Context, localObject *v1alpha1.LocalObject, opts v1.UpdateOptions) (result *v1alpha1.LocalObject, err error) { + result = &v1alpha1.LocalObject{} + err = c.client.Put(). + Namespace(c.ns). + Resource("localobjects"). + Name(localObject.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localObject). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *localObjects) UpdateStatus(ctx context.Context, localObject *v1alpha1.LocalObject, opts v1.UpdateOptions) (result *v1alpha1.LocalObject, err error) { + result = &v1alpha1.LocalObject{} + err = c.client.Put(). + Namespace(c.ns). + Resource("localobjects"). + Name(localObject.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localObject). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the localObject and deletes it. Returns an error if one occurs. +func (c *localObjects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("localobjects"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *localObjects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("localobjects"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched localObject. +func (c *localObjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LocalObject, err error) { + result = &v1alpha1.LocalObject{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("localobjects"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/k8s/generated/informers/externalversions/factory.go b/k8s/generated/informers/externalversions/factory.go new file mode 100644 index 00000000..27ff65d0 --- /dev/null +++ b/k8s/generated/informers/externalversions/factory.go @@ -0,0 +1,178 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + versioned "github.com/v6d-io/v6d/k8s/generated/clientset/versioned" + internalinterfaces "github.com/v6d-io/v6d/k8s/generated/informers/externalversions/internalinterfaces" + k8s "github.com/v6d-io/v6d/k8s/generated/informers/externalversions/k8s" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + K8s() k8s.Interface +} + +func (f *sharedInformerFactory) K8s() k8s.Interface { + return k8s.New(f, f.namespace, f.tweakListOptions) +} diff --git a/k8s/generated/informers/externalversions/generic.go b/k8s/generated/informers/externalversions/generic.go new file mode 100644 index 00000000..b876fc81 --- /dev/null +++ b/k8s/generated/informers/externalversions/generic.go @@ -0,0 +1,62 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + v1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=k8s, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("globalobjects"): + return &genericInformer{resource: resource.GroupResource(), informer: f.K8s().V1alpha1().GlobalObjects().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("localobjects"): + return &genericInformer{resource: resource.GroupResource(), informer: f.K8s().V1alpha1().LocalObjects().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/k8s/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/k8s/generated/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 00000000..93002b74 --- /dev/null +++ b/k8s/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,38 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/v6d-io/v6d/k8s/generated/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/k8s/generated/informers/externalversions/k8s/interface.go b/k8s/generated/informers/externalversions/k8s/interface.go new file mode 100644 index 00000000..781326aa --- /dev/null +++ b/k8s/generated/informers/externalversions/k8s/interface.go @@ -0,0 +1,44 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package k8s + +import ( + internalinterfaces "github.com/v6d-io/v6d/k8s/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/v6d-io/v6d/k8s/generated/informers/externalversions/k8s/v1alpha1" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/k8s/generated/informers/externalversions/k8s/v1alpha1/globalobject.go b/k8s/generated/informers/externalversions/k8s/v1alpha1/globalobject.go new file mode 100644 index 00000000..76da3730 --- /dev/null +++ b/k8s/generated/informers/externalversions/k8s/v1alpha1/globalobject.go @@ -0,0 +1,88 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + k8sv1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + versioned "github.com/v6d-io/v6d/k8s/generated/clientset/versioned" + internalinterfaces "github.com/v6d-io/v6d/k8s/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/v6d-io/v6d/k8s/generated/listers/k8s/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// GlobalObjectInformer provides access to a shared informer and lister for +// GlobalObjects. +type GlobalObjectInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.GlobalObjectLister +} + +type globalObjectInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewGlobalObjectInformer constructs a new informer for GlobalObject type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewGlobalObjectInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGlobalObjectInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredGlobalObjectInformer constructs a new informer for GlobalObject type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredGlobalObjectInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.K8sV1alpha1().GlobalObjects(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.K8sV1alpha1().GlobalObjects(namespace).Watch(context.TODO(), options) + }, + }, + &k8sv1alpha1.GlobalObject{}, + resyncPeriod, + indexers, + ) +} + +func (f *globalObjectInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGlobalObjectInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *globalObjectInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&k8sv1alpha1.GlobalObject{}, f.defaultInformer) +} + +func (f *globalObjectInformer) Lister() v1alpha1.GlobalObjectLister { + return v1alpha1.NewGlobalObjectLister(f.Informer().GetIndexer()) +} diff --git a/k8s/generated/informers/externalversions/k8s/v1alpha1/interface.go b/k8s/generated/informers/externalversions/k8s/v1alpha1/interface.go new file mode 100644 index 00000000..f8a94ff5 --- /dev/null +++ b/k8s/generated/informers/externalversions/k8s/v1alpha1/interface.go @@ -0,0 +1,50 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "github.com/v6d-io/v6d/k8s/generated/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // GlobalObjects returns a GlobalObjectInformer. + GlobalObjects() GlobalObjectInformer + // LocalObjects returns a LocalObjectInformer. + LocalObjects() LocalObjectInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// GlobalObjects returns a GlobalObjectInformer. +func (v *version) GlobalObjects() GlobalObjectInformer { + return &globalObjectInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// LocalObjects returns a LocalObjectInformer. +func (v *version) LocalObjects() LocalObjectInformer { + return &localObjectInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/k8s/generated/informers/externalversions/k8s/v1alpha1/localobject.go b/k8s/generated/informers/externalversions/k8s/v1alpha1/localobject.go new file mode 100644 index 00000000..abc5c412 --- /dev/null +++ b/k8s/generated/informers/externalversions/k8s/v1alpha1/localobject.go @@ -0,0 +1,88 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + k8sv1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + versioned "github.com/v6d-io/v6d/k8s/generated/clientset/versioned" + internalinterfaces "github.com/v6d-io/v6d/k8s/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/v6d-io/v6d/k8s/generated/listers/k8s/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// LocalObjectInformer provides access to a shared informer and lister for +// LocalObjects. +type LocalObjectInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.LocalObjectLister +} + +type localObjectInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewLocalObjectInformer constructs a new informer for LocalObject type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewLocalObjectInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredLocalObjectInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredLocalObjectInformer constructs a new informer for LocalObject type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredLocalObjectInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.K8sV1alpha1().LocalObjects(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.K8sV1alpha1().LocalObjects(namespace).Watch(context.TODO(), options) + }, + }, + &k8sv1alpha1.LocalObject{}, + resyncPeriod, + indexers, + ) +} + +func (f *localObjectInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredLocalObjectInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *localObjectInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&k8sv1alpha1.LocalObject{}, f.defaultInformer) +} + +func (f *localObjectInformer) Lister() v1alpha1.LocalObjectLister { + return v1alpha1.NewLocalObjectLister(f.Informer().GetIndexer()) +} diff --git a/k8s/generated/listers/k8s/v1alpha1/expansion_generated.go b/k8s/generated/listers/k8s/v1alpha1/expansion_generated.go new file mode 100644 index 00000000..a1da7b66 --- /dev/null +++ b/k8s/generated/listers/k8s/v1alpha1/expansion_generated.go @@ -0,0 +1,33 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// GlobalObjectListerExpansion allows custom methods to be added to +// GlobalObjectLister. +type GlobalObjectListerExpansion interface{} + +// GlobalObjectNamespaceListerExpansion allows custom methods to be added to +// GlobalObjectNamespaceLister. +type GlobalObjectNamespaceListerExpansion interface{} + +// LocalObjectListerExpansion allows custom methods to be added to +// LocalObjectLister. +type LocalObjectListerExpansion interface{} + +// LocalObjectNamespaceListerExpansion allows custom methods to be added to +// LocalObjectNamespaceLister. +type LocalObjectNamespaceListerExpansion interface{} diff --git a/k8s/generated/listers/k8s/v1alpha1/globalobject.go b/k8s/generated/listers/k8s/v1alpha1/globalobject.go new file mode 100644 index 00000000..b2260640 --- /dev/null +++ b/k8s/generated/listers/k8s/v1alpha1/globalobject.go @@ -0,0 +1,97 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// GlobalObjectLister helps list GlobalObjects. +// All objects returned here must be treated as read-only. +type GlobalObjectLister interface { + // List lists all GlobalObjects in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.GlobalObject, err error) + // GlobalObjects returns an object that can list and get GlobalObjects. + GlobalObjects(namespace string) GlobalObjectNamespaceLister + GlobalObjectListerExpansion +} + +// globalObjectLister implements the GlobalObjectLister interface. +type globalObjectLister struct { + indexer cache.Indexer +} + +// NewGlobalObjectLister returns a new GlobalObjectLister. +func NewGlobalObjectLister(indexer cache.Indexer) GlobalObjectLister { + return &globalObjectLister{indexer: indexer} +} + +// List lists all GlobalObjects in the indexer. +func (s *globalObjectLister) List(selector labels.Selector) (ret []*v1alpha1.GlobalObject, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.GlobalObject)) + }) + return ret, err +} + +// GlobalObjects returns an object that can list and get GlobalObjects. +func (s *globalObjectLister) GlobalObjects(namespace string) GlobalObjectNamespaceLister { + return globalObjectNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// GlobalObjectNamespaceLister helps list and get GlobalObjects. +// All objects returned here must be treated as read-only. +type GlobalObjectNamespaceLister interface { + // List lists all GlobalObjects in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.GlobalObject, err error) + // Get retrieves the GlobalObject from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.GlobalObject, error) + GlobalObjectNamespaceListerExpansion +} + +// globalObjectNamespaceLister implements the GlobalObjectNamespaceLister +// interface. +type globalObjectNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all GlobalObjects in the indexer for a given namespace. +func (s globalObjectNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.GlobalObject, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.GlobalObject)) + }) + return ret, err +} + +// Get retrieves the GlobalObject from the indexer for a given namespace and name. +func (s globalObjectNamespaceLister) Get(name string) (*v1alpha1.GlobalObject, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("globalobject"), name) + } + return obj.(*v1alpha1.GlobalObject), nil +} diff --git a/k8s/generated/listers/k8s/v1alpha1/localobject.go b/k8s/generated/listers/k8s/v1alpha1/localobject.go new file mode 100644 index 00000000..1d7b88c2 --- /dev/null +++ b/k8s/generated/listers/k8s/v1alpha1/localobject.go @@ -0,0 +1,97 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// LocalObjectLister helps list LocalObjects. +// All objects returned here must be treated as read-only. +type LocalObjectLister interface { + // List lists all LocalObjects in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.LocalObject, err error) + // LocalObjects returns an object that can list and get LocalObjects. + LocalObjects(namespace string) LocalObjectNamespaceLister + LocalObjectListerExpansion +} + +// localObjectLister implements the LocalObjectLister interface. +type localObjectLister struct { + indexer cache.Indexer +} + +// NewLocalObjectLister returns a new LocalObjectLister. +func NewLocalObjectLister(indexer cache.Indexer) LocalObjectLister { + return &localObjectLister{indexer: indexer} +} + +// List lists all LocalObjects in the indexer. +func (s *localObjectLister) List(selector labels.Selector) (ret []*v1alpha1.LocalObject, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.LocalObject)) + }) + return ret, err +} + +// LocalObjects returns an object that can list and get LocalObjects. +func (s *localObjectLister) LocalObjects(namespace string) LocalObjectNamespaceLister { + return localObjectNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// LocalObjectNamespaceLister helps list and get LocalObjects. +// All objects returned here must be treated as read-only. +type LocalObjectNamespaceLister interface { + // List lists all LocalObjects in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.LocalObject, err error) + // Get retrieves the LocalObject from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.LocalObject, error) + LocalObjectNamespaceListerExpansion +} + +// localObjectNamespaceLister implements the LocalObjectNamespaceLister +// interface. +type localObjectNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all LocalObjects in the indexer for a given namespace. +func (s localObjectNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.LocalObject, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.LocalObject)) + }) + return ret, err +} + +// Get retrieves the LocalObject from the indexer for a given namespace and name. +func (s localObjectNamespaceLister) Get(name string) (*v1alpha1.LocalObject, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("localobject"), name) + } + return obj.(*v1alpha1.LocalObject), nil +} diff --git a/k8s/go.mod b/k8s/go.mod new file mode 100644 index 00000000..2242f1a6 --- /dev/null +++ b/k8s/go.mod @@ -0,0 +1,44 @@ +module github.com/v6d-io/v6d/k8s + +go 1.15 + +require ( + github.com/go-logr/logr v0.2.1 + github.com/go-logr/zapr v0.2.0 // indirect + github.com/onsi/ginkgo v1.12.1 + github.com/onsi/gomega v1.10.1 + k8s.io/api v0.19.11 + k8s.io/apiextensions-apiserver v0.19.11 // indirect + k8s.io/apimachinery v0.19.11 + k8s.io/client-go v0.19.11 + k8s.io/code-generator v0.19.11 + k8s.io/klog/v2 v2.2.0 + k8s.io/kube-scheduler v0.19.11 // indirect + k8s.io/kubernetes v0.19.11 + sigs.k8s.io/controller-runtime v0.6.4 +) + +replace ( + k8s.io/api => k8s.io/api v0.19.11 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.19.11 + k8s.io/apimachinery => k8s.io/apimachinery v0.19.11 + k8s.io/apiserver => k8s.io/apiserver v0.19.11 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.19.11 + k8s.io/client-go => k8s.io/client-go v0.19.11 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.19.11 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.19.11 + k8s.io/code-generator => k8s.io/code-generator v0.19.11 + k8s.io/component-base => k8s.io/component-base v0.19.11 + k8s.io/cri-api => k8s.io/cri-api v0.19.11 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.19.11 + k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.19.11 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.19.11 + k8s.io/kube-proxy => k8s.io/kube-proxy v0.19.11 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.19.11 + k8s.io/kubectl => k8s.io/kubectl v0.19.11 + k8s.io/kubelet => k8s.io/kubelet v0.19.11 + k8s.io/kubernetes => k8s.io/kubernetes v1.19.11 + k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.19.11 + k8s.io/metrics => k8s.io/metrics v0.19.11 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.19.11 +) diff --git a/k8s/go.sum b/k8s/go.sum new file mode 100644 index 00000000..f8f97759 --- /dev/null +++ b/k8s/go.sum @@ -0,0 +1,890 @@ +bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690/go.mod h1:Ulb78X89vxKYgdL24HMTiXYHlyHEvruOj1ZPlqeNEZM= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.51.0 h1:PvKAVQWCtlGUSlZkGW3QLelKaWq7KYv/MW1EboG8bfM= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go v43.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= +github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20200415212048-7901bc822317/go.mod h1:DF8FZRxMHMGv/vP2lQP6h+dYzzjpuRn24VeRiYn3qjQ= +github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab/go.mod h1:3VYc5hodBMJ5+l/7J4xAyMeuM2PNuepvHlGs8yilUCA= +github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= +github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= +github.com/Microsoft/hcsshim v0.8.10-0.20200715222032-5eafd1556990/go.mod h1:ay/0dTb7NsG8QMDfsRfLHgZo/6xAJShLe1+ePPflihk= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7/go.mod h1:LWMyo4iOLWXHGdBki7NIht1kHru/0wM179h+d3g8ATM= +github.com/aws/aws-sdk-go v1.6.10/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k= +github.com/aws/aws-sdk-go v1.28.2/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115/go.mod h1:zVt7zX3K/aDCk9Tj+VM7YymsX66ERvzCJzw8rFCX2JU= +github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver v3.5.0+incompatible h1:CGxCgetQ64DKk7rdZ++Vfnb1+ogGNnB17OJKJXD2Cfs= +github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/caddyserver/caddy v1.0.3/go.mod h1:G+ouvOY32gENkJC+jhgl62TyhvqEsFaDiZ4uw0RzP1E= +github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= +github.com/checkpoint-restore/go-criu/v4 v4.0.2/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= +github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= +github.com/cilium/ebpf v0.0.0-20200507155900-a9f01edf17e3/go.mod h1:XT+cAw5wfvsodedcijoh1l9cf7v1x9FlFB/3VmF/O8s= +github.com/cilium/ebpf v0.0.0-20200601085316-9f1617e5c574/go.mod h1:XT+cAw5wfvsodedcijoh1l9cf7v1x9FlFB/3VmF/O8s= +github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313/go.mod h1:P1wt9Z3DP8O6W3rvwCt0REIlshg1InHImaLW0t3ObY0= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0= +github.com/container-storage-interface/spec v1.2.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= +github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= +github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= +github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= +github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= +github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= +github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= +github.com/containerd/ttrpc v1.0.0/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= +github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= +github.com/containerd/typeurl v1.0.0/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= +github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/coredns/corefile-migration v1.0.10/go.mod h1:RMy/mXdeDlYwzt0vdMEJvT2hGJ2I86/eO0UdXmH9XNI= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= +github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v1.4.2-0.20200309214505-aa6a9891b09c/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw= +github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= +github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-acme/lego v2.5.0+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M= +github.com/go-bindata/go-bindata v3.1.1+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.9.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v0.2.1 h1:fV3MLmabKIZ383XifUjFSwcoGee0v9qgPp8wy5svibE= +github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= +github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= +github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= +github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= +github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= +github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= +github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= +github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= +github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= +github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= +github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= +github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-ozzo/ozzo-validation v3.5.0+incompatible/go.mod h1:gsEKFIVnabGBt6mXmxK0MoFy+cZoTJY6mu5Ll3LVLBU= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= +github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkYFkPcDKwRXegd+iM6E7matEszMG5HhwytU8= +github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/cadvisor v0.37.5/go.mod h1:BalYQhwl2UV8lpB3oFssiaW8Uj6sqfFDxw5nEs9sBgU= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= +github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/heketi/heketi v9.0.1-0.20190917153846-c2e2a4ab7ab9+incompatible/go.mod h1:bB9ly3RchcQqsQ9CpyaQwvva7RS5ytVoSoholZQON6o= +github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6/go.mod h1:xGMAM8JLi7UkZt1i4FQeQy0R2T8GLUwQhOP5M1gBhy4= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= +github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/ishidawataru/sctp v0.0.0-20190723014705-7c296d48a2b5/go.mod h1:DM4VvS+hD/kDi1U1QsX2fnZowwBhqD0Dk3bRPKF/Oc8= +github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a/go.mod h1:wK6yTYYcgjHE1Z1QtXACPDjcFJyBskHEdagmnq3vsP8= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/karrick/godirwalk v1.7.5/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/libopenstorage/openstorage v1.0.0/go.mod h1:Sp1sIObHjat1BeXhfMqLZ14wnOzEhNx2YQedreMcUyc= +github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= +github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= +github.com/lpabon/godbc v0.1.1/go.mod h1:Jo9QV0cf3U6jZABgiJ2skINAXb9j8m51r07g4KI92ZA= +github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f/go.mod h1:JpH9J1c9oX6otFSgdUHwUBUizmKlrMjxWnIAjff4m04= +github.com/lucas-clemente/quic-clients v0.1.0/go.mod h1:y5xVIEoObKqULIKivu+gD/LU90pL73bTdtQjPBvtCBk= +github.com/lucas-clemente/quic-go v0.10.2/go.mod h1:hvaRS9IHjFLMq76puFJeWNfmn+H70QZ/CXoxqw9bzao= +github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced/go.mod h1:NCcRLrOTZbzhZvixZLlERbJtDtYsmMw8Jc4vS8Z0g58= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mholt/certmagic v0.6.2-0.20190624175158-6a42ef9fe8c2/go.mod h1:g4cOPxcjV0oFq3qwpjSA30LReKD8AoIfwAY9VvG35NY= +github.com/miekg/dns v1.1.3/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.4/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mindprince/gonvml v0.0.0-20190828220739-9ebdce4bb989/go.mod h1:2eu9pRWp8mo84xCg6KswZ+USQHjwgRhNp06sozOdsTY= +github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/moby/ipvs v1.0.1/go.mod h1:2pngiyseZbIKXNv7hsKj3O9UEz30c53MT9005gt2hxQ= +github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o= +github.com/moby/term v0.0.0-20200312100748-672ec06f55cd h1:aY7OQNf2XqY/JQ6qREWamhI/81os/agb2BAGpcx5yWI= +github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mohae/deepcopy v0.0.0-20170603005431-491d3605edfb/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0= +github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mvdan/xurls v1.1.0/go.mod h1:tQlNn3BED8bE/15hnSL2HLkDeLWpNPAwtw7wkEq44oU= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= +github.com/naoina/toml v0.1.1/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= +github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v1.0.0-rc90.0.20200616040943-82d2fa4eb069/go.mod h1:3Sm6Dt7OT8z88EbdQqqcRN2oCT54jbi72tT/HqgflT8= +github.com/opencontainers/runc v1.0.0-rc91.0.20200707015106-819fcc687efb/go.mod h1:ZuXhqlr4EiRYgDrBDNfSbE4+n9JX4+V107NwAmF7sZA= +github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/selinux v1.5.1/go.mod h1:yTcKuYAh6R95iDpefGLQaPaRwJFwyzAJufJyiTt7s0g= +github.com/opencontainers/selinux v1.5.2/go.mod h1:yTcKuYAh6R95iDpefGLQaPaRwJFwyzAJufJyiTt7s0g= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/quobyte/api v0.1.2/go.mod h1:jL7lIHrmqQ7yh05OJ+eEEdHr0u/kmT1Ff9iHd+4H6VI= +github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= +github.com/robfig/cron v1.1.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= +github.com/russross/blackfriday v0.0.0-20170610170232-067529f716f4/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/storageos/go-api v0.0.0-20180912212459-343b3eff91fc/go.mod h1:ZrLn+e0ZuF3Y65PNF6dIwbJPZqfmtCXxFm9ckv0agOY= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/thecodeteam/goscaleio v0.1.0/go.mod h1:68sdkZAsK8bvEwBlbQnlLS+xU+hvLYM/iQ8KXej1AwM= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= +github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= +github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= +github.com/vishvananda/netns v0.0.0-20200520041808-52d707b772fe/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= +github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1/go.mod h1:QcJo0QPSfTONNIgpN5RA8prR7fF8nkF6cTWTcNerRO8= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= +go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/etcd v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5 h1:Gqga3zA9tdAcfqobUGjSoCob5L3f8Dt5EuOp3ihNZko= +go.etcd.io/etcd v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5/go.mod h1:skWido08r9w6Lq/w70DO5XYIKMu4QFu1+4VsqLQuJy8= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190328230028-74de082e2cca/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201112073958-5cba982894dd h1:5CtCZbICpIOFdgO940moixOPjc0178IU44m4EjOO5IY= +golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0= +gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.1-0.20200106000736-b8fc810ca6b5/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.1/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/mcuadros/go-syslog.v2 v2.2.1/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm0aKH+5zpt2U= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.2.2 h1:orlkJ3myw8CN1nVQHBFfloD+L3egixIa4FvUP6RosSA= +gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +k8s.io/api v0.19.11 h1:d02ByDs0X0dTLogq7GVJDueD5BwaPkJ7w6zJJsBfH50= +k8s.io/api v0.19.11/go.mod h1:NDC7FqmmQkLylzifqzU+5/+gccsbvoC0m4957WSBR8c= +k8s.io/apiextensions-apiserver v0.19.11 h1:+uiB+8BjjROL+TSIAUmrJ/COJv0PGEGZV6HpLashSh4= +k8s.io/apiextensions-apiserver v0.19.11/go.mod h1:zh84YMNIGUMhSLJVZz9UsXNaRduc0Thlz2N+145wEzY= +k8s.io/apimachinery v0.19.11 h1:elcwUwz0jtMGWSCXCCdDyP014NB9oYpqh0l6PkxxUIs= +k8s.io/apimachinery v0.19.11/go.mod h1:9eb44nUQSsz9QZiilFRuMj3ZbTmoWolU8S2gnXoRMjo= +k8s.io/apiserver v0.19.11 h1:N923X8RTIjArXh62snVb/zAHH6Y/VXQcFGy9OqcLiQA= +k8s.io/apiserver v0.19.11/go.mod h1:I3hAjwKANYCVNhnzowqUd3rZdfhCVibsv2COYXfb6b8= +k8s.io/cli-runtime v0.19.11/go.mod h1:pcX2jAIUu/WqDkt9/cFVBW47yzPOmK8hSjByLk9y5QE= +k8s.io/client-go v0.19.11 h1:GR2TtCyPRu7pMQfxCL2ThmuhqpCYzghmusTJS+e17+U= +k8s.io/client-go v0.19.11/go.mod h1:Mp2GI2AFRcahbA+KrNivVsnEdnm5mgE6L5tTRuMZQvs= +k8s.io/cloud-provider v0.19.11 h1:rhQGECiWb4xPBtOL00qwCXL1oc1c4e/4GwMs0QLfJqc= +k8s.io/cloud-provider v0.19.11/go.mod h1:bXq+Q54HheXD7JGDvku8rJWiUZR0IGAaLOBtzg8YP9g= +k8s.io/cluster-bootstrap v0.19.11/go.mod h1:2QW7WjP+omTr4oIFBr90Eni9sLA/ILNEAKMR82UK03Y= +k8s.io/code-generator v0.19.11 h1:02a2oLGsi4HyHcWQg0LddVE0Ff/EeeoWhS0L1GBVV3Q= +k8s.io/code-generator v0.19.11/go.mod h1:ADrDvaUQWGn4a8lX0ONtzb7uFmDRQOMSYIMk1qWIAx8= +k8s.io/component-base v0.19.11 h1:5EM4fA6SIlQyIKFp8UVtX07QMqS8nzC9Lstw9+yahps= +k8s.io/component-base v0.19.11/go.mod h1:Y5zFyHrLvM18yCbqy7YTWbVfZe5cKHhZeuLrXPZ8U04= +k8s.io/cri-api v0.19.11/go.mod h1:8s26T3G3XoMT1jYzWVsB0zPrTSiNGCt9zJjq2ci4lIw= +k8s.io/csi-translation-lib v0.19.11 h1:E5cRbCrcRTr21AQV4s6KgyKHfQSB08kElBAJ2o0eDyU= +k8s.io/csi-translation-lib v0.19.11/go.mod h1:zdNy2S9XaLfFhUl/jlX3tQ6yMiLywjdq1/60EKYlYMQ= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14 h1:t4L10Qfx/p7ASH3gXCdIUtPbbIuegCoUJf3TMSFekjw= +k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/heapster v1.2.0-beta.1/go.mod h1:h1uhptVXMwC8xtZBYsPXKVi8fpdlYkTs6k949KozGrM= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-aggregator v0.19.11/go.mod h1:sm9s8sDHMwVfLzSKgbNvY3dBJ1XHIcLHatCMbQU21vw= +k8s.io/kube-controller-manager v0.19.11/go.mod h1:I6IWjZx/fEE7gsuwFynbie+fL8LSglEzISM1wi/ecJ8= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 h1:+WnxoVtG8TMiudHBSEtrVL1egv36TkkJm+bA8AxicmQ= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/kube-proxy v0.19.11/go.mod h1:kXSCxybp69nhgEPB/kDTabC2o1EH5zKpJeppopXG81U= +k8s.io/kube-scheduler v0.19.11 h1:kzAVJhczAE87v6HvydERepFnrqMreE7LOHhM69YLDMM= +k8s.io/kube-scheduler v0.19.11/go.mod h1:95rc6hAz4//Y6tLndKaymYnGpuCBx8lI3bR7adX53TE= +k8s.io/kubectl v0.19.11/go.mod h1:bywGvQcMaw8wQAejr03qS7WDuspi7ZPXGdPCnbjLWPw= +k8s.io/kubelet v0.19.11/go.mod h1:yzV5mXLVXy+0FHzigKamgO3k4NSqwUx8XbeZZUF6e5Q= +k8s.io/kubernetes v1.19.11 h1:5EjBuGr2Lg6dDMHkhsfaE4G7axq+0JnK19jcoSWdER4= +k8s.io/kubernetes v1.19.11/go.mod h1:f09eWYx+kAUzGrdf+qSQElQ1+HgCsN/ezDXq/XWyaOM= +k8s.io/legacy-cloud-providers v0.19.11/go.mod h1:BCCil+zRLRq/YwAWJT+MsxYmeaIpo6ToUU8H4kz8a0A= +k8s.io/metrics v0.19.11/go.mod h1:lhSTWTbjUNOm3L/YBQSkitFRGSx53tBk5guXgBUAplg= +k8s.io/sample-apiserver v0.19.11/go.mod h1:G3AsxksbcYE8yV+FjOlp8JPmRYvLTORA2PdU2kPWeb8= +k8s.io/system-validators v1.1.2/go.mod h1:bPldcLgkIUK22ALflnsXk8pvkTEndYdNuaHH6gRrl0Q= +k8s.io/utils v0.0.0-20200414100711-2df71ebbae66/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= +modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= +modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= +modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= +modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15 h1:4uqm9Mv+w2MmBYD+F4qf/v6tDFUdPOk29C095RbU5mY= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/controller-runtime v0.6.4 h1:4013CKsBs5bEqo+LevzDett+LLxag/FjQWG94nVZ/9g= +sigs.k8s.io/controller-runtime v0.6.4/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY= +sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.3 h1:4oyYo8NREp49LBBhKxEqCulFjg26rawYKrnCmg+Sr6c= +sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI= diff --git a/k8s/hack/boilerplate.go.txt b/k8s/hack/boilerplate.go.txt new file mode 100644 index 00000000..84fb70eb --- /dev/null +++ b/k8s/hack/boilerplate.go.txt @@ -0,0 +1,14 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ \ No newline at end of file diff --git a/k8s/hack/tools.go b/k8s/hack/tools.go new file mode 100644 index 00000000..47455a5a --- /dev/null +++ b/k8s/hack/tools.go @@ -0,0 +1,23 @@ +// +build tools + +/* +Copyright 2019 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. +*/ + +// Copied from https://github.com/kubernetes-sigs/scheduler-plugins/blob/master/hack/tools.go + +// This package imports things required by build scripts, to force `go mod` to see them as dependencies +package tools + +import ( + _ "k8s.io/code-generator" +) diff --git a/k8s/hack/update-codegen.sh b/k8s/hack/update-codegen.sh new file mode 100755 index 00000000..62c8d9fd --- /dev/null +++ b/k8s/hack/update-codegen.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copyright 2020-2021 Alibaba Group Holding Limited. +# +# 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. + +set -o errexit +set -o nounset +set -o pipefail + +SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} + +bash "${CODEGEN_PKG}"/generate-groups.sh \ + client,lister,informer \ + github.com/v6d-io/v6d/k8s/generated \ + github.com/v6d-io/v6d/k8s/api \ + "k8s:v1alpha1" \ + --go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt -v 100 --output-base ./ + +# mv generated code to this package +rm -rf "${SCRIPT_ROOT}"/generated +mv "${SCRIPT_ROOT}"/github.com/v6d-io/v6d/k8s/generated "${SCRIPT_ROOT}"/ +rm -rf "${SCRIPT_ROOT}"/github.com diff --git a/k8s/hack/update-vendor.sh b/k8s/hack/update-vendor.sh new file mode 100755 index 00000000..dc525de3 --- /dev/null +++ b/k8s/hack/update-vendor.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Copyright 2020-2021 Alibaba Group Holding Limited. +# +# 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. + +set -o errexit +set -o nounset +set -o pipefail + +SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. + +go mod tidy +go mod vendor diff --git a/k8s/main.go b/k8s/main.go new file mode 100644 index 00000000..15b07981 --- /dev/null +++ b/k8s/main.go @@ -0,0 +1,128 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ + +package main + +import ( + "flag" + "math/rand" + "os" + "time" + + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + clientgoscheme "k8s.io/client-go/kubernetes/scheme" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" + "k8s.io/kubernetes/cmd/kube-scheduler/app" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/log/zap" + + v1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + "github.com/v6d-io/v6d/k8s/controllers" + "github.com/v6d-io/v6d/k8s/schedulers" + // +kubebuilder:scaffold:imports +) + +var ( + scheme = runtime.NewScheme() + setupLog = ctrl.Log.WithName("setup") +) + +func init() { + utilruntime.Must(clientgoscheme.AddToScheme(scheme)) + + utilruntime.Must(v1alpha1.AddToScheme(scheme)) + // +kubebuilder:scaffold:scheme +} + +func startManager(channel chan struct{}, metricsAddr string, enableLeaderElection bool) { + ctrl.SetLogger(zap.New(zap.UseDevMode(true))) + + mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ + Scheme: scheme, + MetricsBindAddress: metricsAddr, + Port: 9443, + LeaderElection: enableLeaderElection, + LeaderElectionID: "5fa514f1.v6d.io", + }) + if err != nil { + setupLog.Error(err, "unable to start manager") + os.Exit(1) + } + + if err = (&controllers.LocalObjectReconciler{ + Client: mgr.GetClient(), + Log: ctrl.Log.WithName("controllers").WithName("LocalObject"), + Scheme: mgr.GetScheme(), + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "LocalObject") + os.Exit(1) + } + if err = (&controllers.GlobalObjectReconciler{ + Client: mgr.GetClient(), + Log: ctrl.Log.WithName("controllers").WithName("GlobalObject"), + Scheme: mgr.GetScheme(), + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "GlobalObject") + os.Exit(1) + } + // +kubebuilder:scaffold:builder + + setupLog.Info("starting manager") + if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { + setupLog.Error(err, "problem running manager") + os.Exit(1) + } + close(channel) +} + +func startScheduler(channel chan struct{}) { + command := app.NewSchedulerCommand( + app.WithPlugin(schedulers.Name, schedulers.New), + ) + + args := make([]string, 4) + args[0] = "-v" + args[1] = "5" + args[2] = "--config" + args[3] = "/etc/kubernetes/scheduler.yaml" + command.SetArgs(args) + if err := command.Execute(); err != nil { + setupLog.Error(err, "problem running scheduler") + os.Exit(1) + } + close(channel) +} + +func main() { + var metricsAddr string + var enableLeaderElection bool + flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.") + flag.BoolVar(&enableLeaderElection, "enable-leader-election", false, + "Enable leader election for controller manager. "+ + "Enabling this will ensure there is only one active controller manager.") + flag.Parse() + + rand.Seed(time.Now().UnixNano()) + + scheduler := make(chan struct{}) + go startScheduler(scheduler) + + manager := make(chan struct{}) + go startManager(manager, metricsAddr, enableLeaderElection) + + <-scheduler + <-manager +} diff --git a/k8s/schedulers/scheduling.go b/k8s/schedulers/scheduling.go new file mode 100644 index 00000000..2676994a --- /dev/null +++ b/k8s/schedulers/scheduling.go @@ -0,0 +1,386 @@ +/* +Copyright 2020 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. +*/ + +package schedulers + +import ( + "context" + "fmt" + "sort" + "strconv" + "strings" + "time" + + "k8s.io/klog/v2" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + + listerv1 "k8s.io/client-go/listers/core/v1" + podutil "k8s.io/kubernetes/pkg/api/v1/pod" + framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1" + + v1alpha1 "github.com/v6d-io/v6d/k8s/api/k8s/v1alpha1" + clientset "github.com/v6d-io/v6d/k8s/generated/clientset/versioned" + clientsetv1alpha1 "github.com/v6d-io/v6d/k8s/generated/clientset/versioned/typed/k8s/v1alpha1" + + _ "github.com/v6d-io/v6d/k8s/generated/informers/externalversions/k8s/v1alpha1" + _ "github.com/v6d-io/v6d/k8s/generated/listers/k8s/v1alpha1" +) + +// SchedulerState records the status of current scheduling +type SchedulerState struct { + state map[string]map[string]string // { jobname: { pod: nodename }} + localctl clientsetv1alpha1.LocalObjectInterface + globalctl clientsetv1alpha1.GlobalObjectInterface +} + +// Append records the action of appending a new pod in job to given node. +func (ss *SchedulerState) Append(job string, pod string, nodeName string) error { + klog.V(5).Infof("assign job %v pod %v to node %v", job, pod, nodeName) + if s, ok := ss.state[job]; ok { + if _, ok := s[pod]; ok { + return fmt.Errorf("The pod has already been scheduled") + } + s[pod] = nodeName + return nil + } + ss.state[job] = make(map[string]string) + ss.state[job][pod] = nodeName + return nil +} + +// Compute the placement of a pod in job, assuming the useable nodes, and based on the given objects pool. +// +// Use a deterministic strategy. +func (ss *SchedulerState) Compute(ctx context.Context, job string, replica int64, rank int64, requires []string, nodeName string) (int64, error) { + // if requires no vineyard object, raise + if len(requires) == 0 { + return 0, fmt.Errorf("No nodes available") + } + // if no replica, raise + if replica == 0 { + return 0, fmt.Errorf("No replica information in the job spec") + } + + // accumulates all local required objects + globalObjects, err := ss.getGlobalObjectsByID(ctx, requires) + if err != nil { + return 0, err + } + klog.V(5).Infof("job %v requires objects %v", job, globalObjects) + localsigs := make([]string, 0) + for _, globalObject := range globalObjects { + for _, sig := range globalObject.Spec.Members { + localsigs = append(localsigs, sig) + } + } + localObjects, err := ss.getLocalObjectsBySignatures(ctx, localsigs) + if err != nil { + return 0, err + } + if len(localObjects) == 0 { + return 0, fmt.Errorf("No local chunks found") + } + klog.V(5).Infof("job %v requires local chunks %v", job, localObjects) + + locations := make(map[string][]string) + for _, localObject := range localObjects { + host := localObject.Spec.Hostname + if _, ok := locations[host]; !ok { + locations[host] = make([]string, 0) + } + locations[host] = append(locations[host], localObject.Spec.ObjectID) + } + + // total frags + totalfrags := int64(len(localObjects)) + // frags for per pod + nchunks := totalfrags / replica + if totalfrags%replica != 0 { + nchunks++ + } + + // find the node + nodes := make([]string, 0) + for k := range locations { + nodes = append(nodes, k) + } + sort.Strings(nodes) + + var cnt int64 = 0 + target := "" + for _, node := range nodes { + localfrags := int64(len(locations[node])) + if cnt+localfrags >= (nchunks*rank + (nchunks+1)/2) { + target = node + break + } + cnt += localfrags + } + + if target == "" { + klog.V(5).Infof("Unable to find a target: replica = %v, rank = %v, locations = %v", replica, rank, locations) + return 0, fmt.Errorf("Unable to find a pod: internal error") + } + + if target == nodeName { + return 100, nil + } else { + return 1, nil + } +} + +func (ss *SchedulerState) getGlobalObjectsByID(ctx context.Context, objectIds []string) ([]*v1alpha1.GlobalObject, error) { + objects := make([]*v1alpha1.GlobalObject, 0) + for _, globalObjectID := range objectIds { + if globalObject, err := ss.globalctl.Get(ctx, globalObjectID, metav1.GetOptions{}); err != nil { + return nil, err + } else { + objects = append(objects, globalObject) + } + } + return objects, nil +} + +func (ss *SchedulerState) getLocalObjectsBySignatures(ctx context.Context, signatures []string) ([]*v1alpha1.LocalObject, error) { + objects := make([]*v1alpha1.LocalObject, 0) + for _, sig := range signatures { + options := metav1.ListOptions{ + LabelSelector: fmt.Sprintf("k8s.v6d.io/signature=%v", sig), + } + if localObjects, err := ss.localctl.List(ctx, options); err != nil { + return nil, err + } else { + for _, localObject := range localObjects.Items { + objects = append(objects, &localObject) + } + } + } + return objects, nil +} + +// VineyardScheduling is a plugin that schedules pods that requires vineyard objects as inputs. +type VineyardScheduling struct { + handle framework.FrameworkHandle + podLister listerv1.PodLister + scheduleTimeout *time.Duration + state map[string]*SchedulerState + client *clientset.Clientset +} + +var _ framework.ScorePlugin = &VineyardScheduling{} +var _ framework.PreFilterPlugin = &VineyardScheduling{} + +// var _ framework.PermitPlugin = &VineyardScheduling{} +var _ framework.PostBindPlugin = &VineyardScheduling{} + +const ( + // Name is the name of the plugin used in Registry and configurations. + Name = "Vineyard" + // Timeout is the default timeout for the scheduler plugin. + Timeout = 60 + // VineyardJobName is the pod group name + VineyardJobName = "scheduling.k8s.v6d.io/job" + // VineyardJobRequired is the object ids that required by this job + VineyardJobRequired = "scheduling.k8s.v6d.io/required" + // VineyardJobReplica is the replication of pods in this job. + VineyardJobReplica = "scheduling.k8s.v6d.io/replica" +) + +// New initializes a vineyard scheduler +// func New(obj runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) { +func New(configuration runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) { + klog.Info("Initializing the vineyard scheduler plugin ...") + timeout := Timeout * time.Second + state := make(map[string]*SchedulerState) + client := clientset.NewForConfigOrDie(ctrl.GetConfigOrDie()) + scheduling := &VineyardScheduling{ + handle: handle, + podLister: handle.SharedInformerFactory().Core().V1().Pods().Lister(), + scheduleTimeout: &timeout, + state: state, + client: client, + } + return scheduling, nil +} + +// Name returns name of the plugin. It is used in logs, etc. +func (vs *VineyardScheduling) Name() string { + return Name +} + +// Less compares the priority of two +// func (vs *VineyardScheduling) Less(pod1, pod2 *framework.QueuedPodInfo) bool { +func (vs *VineyardScheduling) Less(pod1, pod2 *framework.PodInfo) bool { + prio1 := podutil.GetPodPriority(pod1.Pod) + prio2 := podutil.GetPodPriority(pod2.Pod) + return prio1 > prio2 +} + +// PreFilter for a pod +func (vs *VineyardScheduling) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) *framework.Status { + return framework.NewStatus(framework.Success, "") +} + +// PreFilterExtensions is None +func (vs *VineyardScheduling) PreFilterExtensions() framework.PreFilterExtensions { + return nil +} + +// Score compute the score for a pod based on the status of required vineyard objects. +// +func (vs *VineyardScheduling) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { + // nodeInfo, err := ps.handle.SnapshotSharedLister().NodeInfos().Get(nodeName) + // if err != nil { + // return 0, framework.NewStatus(framework.Error, fmt.Sprintf("Faild to get node %q: %v", nodeName, err)) + // } + + klog.V(5).Infof("scoring for pod %v on node %v", GetNamespacedName(pod), nodeName) + + job, replica, requires, err := vs.GetVineyardLabels(pod) + if err != nil { + return 0, framework.NewStatus(framework.Unschedulable, err.Error()) + } + + rank, err := vs.GetPodRank(pod) + if err != nil || rank == -1 { + rank = replica - 1 + } + + klog.V(5).Infof("scoring for pod of job %v, with %v replicas (rank %v), and requires %v", job, replica, rank, requires) + + namespace := pod.GetNamespace() + schedulerState := vs.MakeSchedulerStateForNamespace(namespace) + + score, err := schedulerState.Compute(ctx, job, replica, rank, requires, nodeName) + if err != nil { + return 0, framework.NewStatus(framework.Unschedulable, err.Error()) + } + klog.Infof("score for pod of job %v on node %v is: %v", job, nodeName, score) + return score, framework.NewStatus(framework.Success, "") +} + +// ScoreExtensions of the Score plugin. +func (vs *VineyardScheduling) ScoreExtensions() framework.ScoreExtensions { + return vs +} + +// NormalizeScore normalizes the score of all nodes for a pod. +func (vs *VineyardScheduling) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status { + // Find highest and lowest scores. + + return framework.NewStatus(framework.Success, "") +} + +// Permit only permit runs on the node that has vineyard installed. +func (vs *VineyardScheduling) Permit(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (*framework.Status, time.Duration) { + return framework.NewStatus(framework.Success, ""), 0 +} + +// PostBind do nothing +func (vs *VineyardScheduling) PostBind(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeName string) { + klog.V(5).Infof("bind pod %v on node %v", GetNamespacedName(pod), nodeName) + job, replica, requires, err := vs.GetVineyardLabels(pod) + if err != nil { + // ignore: might not be a vineyard job + return + } + klog.V(5).Infof("bind pod of job %v, with %v replicas, and requires %v", job, replica, requires) + + // ignore + // + // namespace := pod.GetNamespace() + // schedulerState := vs.MakeSchedulerStateForNamespace(namespace) + // schedulerState.Append(job, GetNamespacedName(pod), nodeName) +} + +// MakeSchedulerStateForNamespace initializes a state for the given namespace, if not exists. +func (vs *VineyardScheduling) MakeSchedulerStateForNamespace(namespace string) *SchedulerState { + if _, ok := vs.state[namespace]; !ok { + state := make(map[string]map[string]string) + localctl := vs.client.K8sV1alpha1().LocalObjects(namespace) + globalctl := vs.client.K8sV1alpha1().GlobalObjects(namespace) + vs.state[namespace] = &SchedulerState{ + state: state, + localctl: localctl, + globalctl: globalctl, + } + } + return vs.state[namespace] +} + +func (vs *VineyardScheduling) getJobName(pod *v1.Pod) (string, error) { + jobName, exist := pod.Labels[VineyardJobName] + if !exist || jobName == "" { + return "", fmt.Errorf("Failed to get vineyard job name for %v", GetNamespacedName(pod)) + } + klog.V(5).Infof("job name is: %v", jobName) + return jobName, nil +} + +func (vs *VineyardScheduling) getJobReplica(pod *v1.Pod) (int64, error) { + jobReplica, exist := pod.Labels[VineyardJobReplica] + if !exist || jobReplica == "" { + return -1, fmt.Errorf("Failed to get vineyard job name for %v", GetNamespacedName(pod)) + } + klog.V(5).Infof("job replica is: %v", jobReplica) + if val, err := strconv.Atoi(jobReplica); err != nil { + return -1, err + } else { + return int64(val), nil + } +} + +func (vs *VineyardScheduling) getJobRequired(pod *v1.Pod) ([]string, error) { + objects, exist := pod.Labels[VineyardJobRequired] + if !exist || objects == "" { + return nil, fmt.Errorf("Failed to get vineyard job name for %v", GetNamespacedName(pod)) + } + klog.V(5).Infof("job requires: %v", objects) + return strings.Split(objects, "-"), nil +} + +// GetVineyardLabels requires (job, replica, requires) information of a pod. +func (vs *VineyardScheduling) GetVineyardLabels(pod *v1.Pod) (string, int64, []string, error) { + job, err := vs.getJobName(pod) + if err != nil { + return "", 0, nil, err + } + replica, err := vs.getJobReplica(pod) + if err != nil { + return "", 0, nil, err + } + requires, err := vs.getJobRequired(pod) + if err != nil { + return "", 0, nil, err + } + return job, replica, requires, nil +} + +// GetPodRank returns the rank of this pod +func (vs *VineyardScheduling) GetPodRank(pod *v1.Pod) (int64, error) { + names := strings.Split(pod.GetName(), "-") + if rank, err := strconv.Atoi(names[len(names)-1]); err != nil { + return -1, err + } else { + return int64(rank), nil + } +} + +// GetNamespacedName returns the namespaced name of an kubernetes object. +func GetNamespacedName(object metav1.Object) string { + return fmt.Sprintf("%v/%v", object.GetNamespace(), object.GetName()) +} diff --git a/k8s/testbin/setup-envtest.sh b/k8s/testbin/setup-envtest.sh new file mode 100644 index 00000000..61f69db0 --- /dev/null +++ b/k8s/testbin/setup-envtest.sh @@ -0,0 +1,96 @@ +#!/usr/bin/env bash + +# Copyright 2020 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. + +set -o errexit +set -o pipefail + +# Turn colors in this script off by setting the NO_COLOR variable in your +# environment to any value: +# +# $ NO_COLOR=1 test.sh +NO_COLOR=${NO_COLOR:-""} +if [ -z "$NO_COLOR" ]; then + header=$'\e[1;33m' + reset=$'\e[0m' +else + header='' + reset='' +fi + +function header_text { + echo "$header$*$reset" +} + +function setup_envtest_env { + header_text "setting up env vars" + + # Setup env vars + KUBEBUILDER_ASSETS=${KUBEBUILDER_ASSETS:-""} + if [[ -z "${KUBEBUILDER_ASSETS}" ]]; then + export KUBEBUILDER_ASSETS=$1/bin + fi +} + +# fetch k8s API gen tools and make it available under envtest_root_dir/bin. +# +# Skip fetching and untaring the tools by setting the SKIP_FETCH_TOOLS variable +# in your environment to any value: +# +# $ SKIP_FETCH_TOOLS=1 ./check-everything.sh +# +# If you skip fetching tools, this script will use the tools already on your +# machine. +function fetch_envtest_tools { + SKIP_FETCH_TOOLS=${SKIP_FETCH_TOOLS:-""} + if [ -n "$SKIP_FETCH_TOOLS" ]; then + return 0 + fi + + tmp_root=/tmp + envtest_root_dir=$tmp_root/envtest + + k8s_version="${ENVTEST_K8S_VERSION:-1.16.4}" + goarch="$(go env GOARCH)" + goos="$(go env GOOS)" + + if [[ "$goos" != "linux" && "$goos" != "darwin" ]]; then + echo "OS '$goos' not supported. Aborting." >&2 + return 1 + fi + + local dest_dir="${1}" + + # use the pre-existing version in the temporary folder if it matches our k8s version + if [[ -x "${dest_dir}/bin/kube-apiserver" ]]; then + version=$("${dest_dir}"/bin/kube-apiserver --version) + if [[ $version == *"${k8s_version}"* ]]; then + header_text "Using cached envtest tools from ${dest_dir}" + return 0 + fi + fi + + header_text "fetching envtest tools@${k8s_version} (into '${dest_dir}')" + envtest_tools_archive_name="kubebuilder-tools-$k8s_version-$goos-$goarch.tar.gz" + envtest_tools_download_url="https://storage.googleapis.com/kubebuilder-tools/$envtest_tools_archive_name" + + envtest_tools_archive_path="$tmp_root/$envtest_tools_archive_name" + if [ ! -f $envtest_tools_archive_path ]; then + curl -sL ${envtest_tools_download_url} -o "$envtest_tools_archive_path" + fi + + mkdir -p "${dest_dir}" + tar -C "${dest_dir}" --strip-components=1 -zvxf "$envtest_tools_archive_path" +} diff --git a/misc/release-docker.sh b/misc/release-docker.sh new file mode 100755 index 00000000..51b2d560 --- /dev/null +++ b/misc/release-docker.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e +set -o pipefail + +base=`pwd` +version=$1 + +if [ "$version" = "" ]; then + echo "./prepare-docker.sh: requires a specific version" + exit 1 +fi + +docker pull docker.pkg.github.com/alibaba/libvineyard/vineyardd:$version +docker pull docker.pkg.github.com/alibaba/libvineyard/vineyardd:latest + +docker tag docker.pkg.github.com/alibaba/libvineyard/vineyardd:$version libvineyard/vineyardd:$version +docker tag docker.pkg.github.com/alibaba/libvineyard/vineyardd:latest libvineyard/vineyardd:latest +docker tag docker.pkg.github.com/alibaba/libvineyard/vineyardd:$version quay.io/libvineyard/vineyardd:$version +docker tag docker.pkg.github.com/alibaba/libvineyard/vineyardd:latest quay.io/libvineyard/vineyardd:latest + +docker push libvineyard/vineyardd:$version +docker push libvineyard/vineyardd:latest +docker push quay.io/libvineyard/vineyardd:$version +docker push quay.io/libvineyard/vineyardd:latest diff --git a/misc/release-wheels.sh b/misc/release-wheels.sh new file mode 100755 index 00000000..bde68d2a --- /dev/null +++ b/misc/release-wheels.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e +set -o pipefail + +base=`pwd` +version=$1 + +if [ "$version" = "" ]; then + echo "./prepare-wheels.sh: requires a specific version" + exit 1 +fi + +mkdir -p wheels/$version + +# download wheels from github artifacts +pushd wheels/$version +curl -s https://api.github.com/repos/alibaba/libvineyard/releases/tags/$version | grep "browser_download_url.*whl" | cut -d : -f 2,3 | tr -d \" | wget -qi - +popd + +twine check ./wheels/$version/*.whl +twine upload ./wheels/$version/*.whl diff --git a/modules/io/CMakeLists.txt b/modules/io/CMakeLists.txt index c4487464..48b81c5d 100644 --- a/modules/io/CMakeLists.txt +++ b/modules/io/CMakeLists.txt @@ -27,10 +27,10 @@ target_include_directories(vineyard_io PUBLIC $ ) -if(RDKAFKA_FOUND) - target_include_directories(vineyard_io PUBLIC ${RDKAFKA_INCLUDE_DIRS}) +if(Rdkafka_FOUND) + target_include_directories(vineyard_io PUBLIC ${Rdkafka_INCLUDE_DIRS}) target_compile_definitions(vineyard_io PRIVATE -DKAFKA_ENABLED) - target_link_libraries(vineyard_io PUBLIC ${RDKAFKA_LIBRARIES}) + target_link_libraries(vineyard_io PUBLIC ${Rdkafka_LIBRARIES}) endif() install_vineyard_target(vineyard_io) diff --git a/modules/migrate/CMakeLists.txt b/modules/migrate/CMakeLists.txt index 8772fc9a..b89636fd 100644 --- a/modules/migrate/CMakeLists.txt +++ b/modules/migrate/CMakeLists.txt @@ -35,3 +35,10 @@ target_link_libraries(vineyard-migrate-stream vineyard_client ${GFLAGS_LIBRARIES} ) install_vineyard_target(vineyard-migrate-stream) + +# install vineyard-migrate-to-local script. +install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/vineyard-migrate-to-local.py" + DESTINATION bin + RENAME vineyard-migrate-to-local +) + diff --git a/modules/migrate/vineyard-migrate-to-local.py b/modules/migrate/vineyard-migrate-to-local.py new file mode 100644 index 00000000..4b6ca6b4 --- /dev/null +++ b/modules/migrate/vineyard-migrate-to-local.py @@ -0,0 +1,97 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright 2020 Alibaba Group Holding Limited. +# +# 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. +# + +from collections import defaultdict +import logging +import os +import sys +import time + +import vineyard + + +logger = logging.getLogger('vineyard') + + +def migrate_to_local(replica, rank, object_id): + client = vineyard.connect(os.environ['VINEYARD_IPC_SOCKET']) + + # get instance id -> node name + instances = dict() + cluster = client.meta + for instance_id, instance in cluster.items(): + instances[instance_id] = instance['nodename'] + + meta = client.get_meta(object_id) + if not meta.isglobal: + raise ValueError('Expect a global object, but got %s' % meta.typename) + + + nodes = [] + chunks = defaultdict(list) + for _, item in meta.items(): + if isinstance(item, vineyard.ObjectMeta): + hostname = instances[item.instance_id] + nodes.append(hostname) + chunks[hostname].append(repr(item.id)) + sorted_chunks = dict() + totalfrags = 0 + for node, items in chunks.items(): + totalfrags += len(items) + sorted_chunks[node] = sorted(items) + + nchunks = totalfrags / replica + (0 if totalfrags % replica == 0 else 1) + + cnt = 0 + localfrags = [] + for node in sorted(sorted_chunks.keys()): + for chunk in sorted_chunks[node]: + if cnt >= nchunks * rank and cnt < nchunks * (rank + 1): + if len(localfrags) < nchunks: + localfrags.append(vineyard.ObjectID(chunk)) + cnt += 1 + + logger.info('chunks for local job are: %s' % localfrags) + + start = time.time() + + local_member_ids = [] + for chunk_id in localfrags: + local_id = client.migrate(chunk_id) + if local_id == chunk_id: + logger.info('chunk %r is already available' % (chunk_id,)) + else: + logger.info('finish migrate: %r -> %r' % (chunk_id, local_id)) + local_member_ids.append(repr(local_id)) + + logger.info('migration usage: %s' % (time.time() - start,)) + + with open('/tmp/vineyard/vineyard.chunks', 'w', encoding='utf-8') as fp: + fp.write('\n'.join(local_member_ids)) + + +if __name__ == '__main__': + if len(sys.argv) < 4: + print('Usage: ./vineyard-migrate-to-local ', file=sys.stderr) + + logging.basicConfig(level=logging.DEBUG) + + replica = int(sys.argv[1]) + rank = int(sys.argv[2]) + object_id = vineyard.ObjectID(sys.argv[3]) + migrate_to_local(replica, rank, object_id) diff --git a/python/vineyard/contrib/__init__.py b/python/vineyard/contrib/__init__.py new file mode 100644 index 00000000..ccd02235 --- /dev/null +++ b/python/vineyard/contrib/__init__.py @@ -0,0 +1,17 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright 2020-2021 Alibaba Group Holding Limited. +# +# 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. +# diff --git a/python/vineyard/core/resolver.py b/python/vineyard/core/resolver.py index c60e6f51..9aae06be 100644 --- a/python/vineyard/core/resolver.py +++ b/python/vineyard/core/resolver.py @@ -72,6 +72,7 @@ def get(client, object_id, resolver=None, **kw): # wrap object_id if isinstance(object_id, (int, str)): object_id = ObjectID(object_id) + # run resolver obj = client.get_object(object_id) meta = obj.meta diff --git a/src/server/server/vineyard_server.cc b/src/server/server/vineyard_server.cc index 2c17b6e1..936b9b51 100644 --- a/src/server/server/vineyard_server.cc +++ b/src/server/server/vineyard_server.cc @@ -29,6 +29,7 @@ limitations under the License. #include "server/async/ipc_server.h" #include "server/async/rpc_server.h" #include "server/services/meta_service.h" +#include "server/util/kubectl.h" #include "server/util/meta_tree.h" #include "server/util/proc.h" @@ -307,12 +308,10 @@ Status VineyardServer::CreateData( "The instance_id filed must be presented"); auto decorated_tree = tree; - Signature signature; - + Signature signature = GenerateSignature(); if (decorated_tree.find("signature") != decorated_tree.end()) { signature = decorated_tree["signature"].get(); } else { - signature = GenerateSignature(); decorated_tree["signature"] = signature; } @@ -336,11 +335,24 @@ Status VineyardServer::CreateData( Status VineyardServer::Persist(const ObjectID id, callback_t<> callback) { ENSURE_VINEYARDD_READY(); RETURN_ON_ASSERT(!IsBlob(id), "The blobs cannot be persisted"); + auto self(shared_from_this()); meta_service_ptr_->RequestToPersist( - [id](const Status& status, const json& meta, - std::vector& ops) { + [self, id](const Status& status, const json& meta, + std::vector& ops) { if (status.ok()) { - return CATCH_JSON_ERROR(meta_tree::PersistOps(meta, id, ops)); + auto status = CATCH_JSON_ERROR(meta_tree::PersistOps(meta, id, ops)); + if (self->spec_["sync_crds"].get() && status.ok() && + !ops.empty()) { + json tree; + VINEYARD_SUPPRESS( + CATCH_JSON_ERROR(meta_tree::GetData(meta, id, tree))); + if (tree.is_object() && !tree.empty()) { + auto kube = std::make_shared(self->GetMetaContext()); + kube->ApplyObject(meta["instances"], tree); + kube->Finish(); + } + } + return status; } else { LOG(ERROR) << status.ToString(); return status; diff --git a/src/server/util/kubectl.cc b/src/server/util/kubectl.cc new file mode 100644 index 00000000..63096136 --- /dev/null +++ b/src/server/util/kubectl.cc @@ -0,0 +1,154 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ + +#include "server/util/kubectl.h" + +#include +#include +#include +#include + +#include "boost/asio.hpp" +#include "boost/bind.hpp" +#include "boost/filesystem.hpp" +#include "boost/process.hpp" + +#include "common/util/boost.h" + +namespace vineyard { + +#if BOOST_VERSION >= 106600 +Kubectl::Kubectl(asio::io_context& context) : proc_(new Process(context)) { +#else +Kubectl::Kubectl(asio::io_service& context) : proc_(new Process(context)) { +#endif + proc_->Start("kubectl", {"apply", "-f", "-"}, + [](Status const&, const std::string&) { return Status::OK(); }); +} + +Kubectl::~Kubectl() { proc_->Terminate(); } + +void Kubectl::Apply(const std::string& content, callback_t<> callback) { + proc_->AsyncWrite(content, [this, callback](Status const& status) { + // TODO: improve the error diagnostic + if (!status.ok()) { + for (auto const& line : Diagnostic()) { + VLOG(10) << "kubectl: " << line; + } + } + return callback(status); + }); +} + +static std::string generate_local_object( + std::map const& instances, const json& object) { + std::string object_id = object["id"].get_ref(); + std::string signature = + SignatureToString(object["signature"].get()); + std::string type_name = object["typename"].get_ref(); + InstanceID instance_id = object["instance_id"].get(); + /* clang-format off */ + std::string crd = "\n" + "\n---" + "\n" + "\napiVersion: k8s.v6d.io/v1beta1" + "\nkind: LocalObject" + "\nmetadata:" + "\n name: " + object_id + + "\n labels:" + "\n k8s.v6d.io/signature: " + signature + + "\nspec:" + "\n id: " + object_id + + "\n signature: " + signature + + "\n typename: " + type_name + + "\n instance_id: " + std::to_string(instance_id) + + "\n hostname: " + instances.at(instance_id) + + "\n metadata: " + type_name + + "\n\n"; + /* clang-format on */ + return crd; +} + +static std::string generate_global_object( + std::map const& instances, const json& object) { + std::string object_id = object["id"].get_ref(); + std::string signature = + SignatureToString(object["signature"].get()); + std::string type_name = object["typename"].get_ref(); + InstanceID instance_id = object["instance_id"].get(); + std::vector members; + + std::string crds; + for (auto const& kv : json::iterator_wrapper(object)) { + if (kv.value().is_object() && !kv.value().empty()) { + crds += generate_local_object(instances, kv.value()); + members.emplace_back( + SignatureToString(kv.value()["signature"].get())); + } + } + + /* clang-format off */ + std::string crd = "\n" + "\n---" + "\n" + "apiVersion: k8s.v6d.io/v1beta1" + "\nkind: GlobalObject" + "\nmetadata:" + "\n name: " + object_id + + "\nspec:" + "\n id: " + object_id + + "\n signature: " + signature + + "\n typename: " + type_name + + "\n instance_id: " + std::to_string(instance_id) + + "\n metadata: " + type_name + + "\n members:"; + /* clang-format on */ + + for (auto const& sig : members) { + crd += "\n - " + sig; + } + crd += "\n"; + return crd + crds; +} + +void Kubectl::ApplyObject(const json& meta, const json& object) { + std::map instances; + for (auto const& kv : json::iterator_wrapper(meta)) { + InstanceID instance_id; + std::stringstream(kv.key().substr(1)) >> instance_id; + instances.emplace(instance_id, + kv.value()["nodename"].get_ref()); + } + + std::string crds; + if (object.value("global", false)) { + crds = generate_global_object(instances, object); + } else { + crds = generate_local_object(instances, object); + } + VLOG(10) << "Apply CRDs: " << crds; + this->Apply(crds, [](const Status& status) { return status; }); +} + +void Kubectl::Finish() { + proc_->Finish(); + for (auto const& line : Diagnostic()) { + VLOG(10) << "kubectl appy: " << line; + } + proc_->Wait(); + VLOG(10) << "kubectl exit with: " << proc_->ExitCode(); +} + +} // namespace vineyard diff --git a/src/server/util/kubectl.h b/src/server/util/kubectl.h new file mode 100644 index 00000000..15c05685 --- /dev/null +++ b/src/server/util/kubectl.h @@ -0,0 +1,60 @@ +/** Copyright 2020-2021 Alibaba Group Holding Limited. + +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. +*/ + +#ifndef SRC_SERVER_UTIL_KUBECTL_H_ +#define SRC_SERVER_UTIL_KUBECTL_H_ + +#include +#include +#include +#include + +#include "common/util/boost.h" +#include "common/util/callback.h" +#include "common/util/json.h" +#include "common/util/logging.h" +#include "common/util/status.h" +#include "common/util/uuid.h" +#include "server/util/proc.h" + +namespace vineyard { + +class Kubectl { + public: +#if BOOST_VERSION >= 106600 + explicit Kubectl(asio::io_context& context); +#else + explicit Kubectl(asio::io_service& context); +#endif + + ~Kubectl(); + + void Apply(const std::string& content, callback_t<> callback); + + void ApplyObject(const json& meta, const json& object); + + void Finish(); + + std::list const& Diagnostic() const { + return proc_->Diagnostic(); + } + + private: + std::shared_ptr proc_; +}; + +} // namespace vineyard + +#endif // SRC_SERVER_UTIL_KUBECTL_H_ diff --git a/src/server/util/spec_resolvers.cc b/src/server/util/spec_resolvers.cc index ff8e93fb..16b83c48 100644 --- a/src/server/util/spec_resolvers.cc +++ b/src/server/util/spec_resolvers.cc @@ -18,6 +18,7 @@ limitations under the License. #include "gflags/gflags.h" +#include "common/util/env.h" #include "common/util/logging.h" #include "server/util/spec_resolvers.h" @@ -36,6 +37,8 @@ DEFINE_int64(stream_threshold, 80, DEFINE_string(socket, "/var/run/vineyard.sock", "IPC socket file location"); // rpc DEFINE_int32(rpc_socket_port, 9600, "port to listen in rpc server"); +// Kubernetes +DEFINE_bool(sync_crds, false, "Synchronize CRDs when persisting objects"); namespace vineyard { @@ -136,6 +139,8 @@ json RpcSpecResolver::resolve() const { json ServerSpecResolver::resolve() const { json spec; spec["deployment"] = FLAGS_deployment; + spec["sync_crds"] = + FLAGS_sync_crds || (read_env("VINEYARD_SYNC_CRDS") == "1"); spec["metastore_spec"] = Resolver::get("etcd").resolve(); spec["bulkstore_spec"] = Resolver::get("bulkstore").resolve(); spec["ipc_spec"] = Resolver::get("ipcserver").resolve(); diff --git a/thirdparty/etcd-cpp-apiv3 b/thirdparty/etcd-cpp-apiv3 index 9d794504..b3a193c7 160000 --- a/thirdparty/etcd-cpp-apiv3 +++ b/thirdparty/etcd-cpp-apiv3 @@ -1 +1 @@ -Subproject commit 9d794504aa526b0f615bc242e30e2dcb79df8347 +Subproject commit b3a193c75ed0bb7c51228185fbef4a0499a26157 diff --git a/vineyard-config.in.cmake b/vineyard-config.in.cmake index 432507a4..6a8c6350 100644 --- a/vineyard-config.in.cmake +++ b/vineyard-config.in.cmake @@ -38,7 +38,7 @@ if(NOT Arrow_FOUND) find_dependency(Arrow) endif() -if(BUILD_VINEYARD_IO_KAFKA) +if(BUILD_VINEYARD_IO AND BUILD_VINEYARD_IO_KAFKA) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) find_dependency(Rdkafka) endif()