Merge branch 'master' of https://github.com/kubesphere/kubesphere
This commit is contained in:
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -1,2 +1,6 @@
|
||||
pkg/cmd/api/spec/api.swagger.json linguist-generated=true
|
||||
pkg/cmd/api/spec/static.go linguist-generated=true
|
||||
pkg/client/* linguist-generated=true
|
||||
config/crds/* linguist-generated=true
|
||||
config/rbac/* linguist-generated=true
|
||||
zz_generated.deepcopy.go linguist-generated=true
|
||||
16
.github/ISSUE_TEMPLATE/installation_failure.md
vendored
Normal file
16
.github/ISSUE_TEMPLATE/installation_failure.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
name: 安装问题
|
||||
about: Create a report to help us improve
|
||||
---
|
||||
|
||||
[备注]: <> (请补全下面信息,帮助我们更快地定位问题。提交问题前预览下issue,看下是否有格式错误)
|
||||
|
||||
**问题描述**
|
||||
|
||||
**安装环境的硬件配置**
|
||||
|
||||
[备注]: <> (请说明节点的运行环境,是否是物理机,云主机,VMware虚拟机)
|
||||
|
||||
**错误信息或截图**
|
||||
|
||||
**Installer版本**
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -4,6 +4,7 @@
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
*.a
|
||||
|
||||
# Test binary, build with `go test -c`
|
||||
*.test
|
||||
@@ -27,3 +28,5 @@ apiserver.local.config
|
||||
.DS_Store
|
||||
api.json
|
||||
*.coverprofile
|
||||
|
||||
kustomize/network/etcd
|
||||
5
Makefile
5
Makefile
@@ -76,6 +76,7 @@ deploy: manifests
|
||||
# generate will generate crds' deepcopy & go openapi structs
|
||||
# Futher more about go:genreate . https://blog.golang.org/generate
|
||||
generate:
|
||||
GO111MODULE=on go install -mod=vendor k8s.io/code-generator/cmd/deepcopy-gen
|
||||
go generate ./pkg/... ./cmd/...
|
||||
|
||||
# Build the docker image
|
||||
@@ -93,7 +94,7 @@ clean:
|
||||
|
||||
# find or download controller-gen
|
||||
# download controller-gen if necessary
|
||||
clientset: generate
|
||||
clientset:
|
||||
./hack/generate_client.sh
|
||||
|
||||
|
||||
@@ -105,7 +106,7 @@ internal-crds:
|
||||
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./pkg/apis/network/..." output:crd:artifacts:config=config/crd/bases
|
||||
|
||||
internal-generate-apis: internal-controller-gen
|
||||
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./pkg/apis/...
|
||||
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./pkg/apis/network/...
|
||||
|
||||
internal-controller-gen:
|
||||
ifeq (, $(shell which controller-gen))
|
||||
|
||||
11
README.md
11
README.md
@@ -11,8 +11,6 @@
|
||||
|
||||
[KubeSphere](https://kubesphere.io/) is an enterprise-grade multi-tenant container management platform that built on [Kubernetes](https://kubernetes.io). It provides an easy-to-use UI for users to manage computing resources with a few clicks, which reduces the learning curve and empowers the DevOps teams. It greatly reduces the complexity of the daily work of development, testing, operation and maintenance, aiming to alleviate the pain points of Kubernetes' storage, network, security and ease of use, etc.
|
||||
|
||||
KubeSphere can run anywhere from on-premise datacenter to any cloud to edge. In addition, it can be deployed on any Kubernetes distribution.
|
||||
|
||||
> See this [document](https://docs.kubesphere.io/advanced-v2.0/zh-CN/introduction/intro/) that describes the KubeSphere landscape and details.
|
||||
|
||||

|
||||
@@ -44,6 +42,12 @@ It also supports multiple open source storage and high-performance cloud storage
|
||||
|
||||
----
|
||||
|
||||
## Architecture
|
||||
|
||||
KubeSphere adopts the separation of front and back ends, each component is drawn in the architecture diagram below. KubeSphere can run anywhere from on-premise datacenter to any cloud to edge. In addition, it can be deployed on any Kubernetes distribution.
|
||||
|
||||

|
||||
|
||||
## Latest Release
|
||||
|
||||
KubeSphere Advanced Edition 2.0.2 was released on **July 9th, 2019**. See the [Release Notes For 2.0.2](https://docs.kubesphere.io/advanced-v2.0/zh-CN/release/release-v202/) to preview the updates.
|
||||
@@ -71,6 +75,8 @@ $ ./install.sh
|
||||
|
||||
Choose `"1) All-in-one"` to trigger the installation. Generally, you can install it directly without any configuration. For details please reference [All-in-One](https://docs.kubesphere.io/advanced-v2.0/zh-CN/installation/all-in-one/).
|
||||
|
||||
> Click [here](https://asciinema.org/~lilin) to preview the installation demo.
|
||||
|
||||
### Multi-Node
|
||||
|
||||
[Multi-Node](https://docs.kubesphere.io/advanced-v2.0/zh-CN/installation/multi-node/) is used for installing KubeSphere on multiple instances, supports for installing a highly available cluster in a mission-critical environment. Multi-node installation requires pre-configuration steps, see [Multi-Node Guide](https://docs.kubesphere.io/advanced-v2.0/zh-CN/installation/multi-node/).
|
||||
@@ -86,6 +92,7 @@ The [Quick Start Guide](https://docs.kubesphere.io/advanced-v2.0/quick-start/adm
|
||||
|
||||
- [KubeSphere Documentation (En/中) ](https://docs.kubesphere.io/)
|
||||
- [KubeSphere Documentation (PDF)](https://docs.kubesphere.io/KubeSphere-advanced-v2.0.pdf)
|
||||
- [API Documentation](https://kubesphere.io/docs/advanced-v2.0/zh-CN/api-reference/api-docs/)
|
||||
|
||||
|
||||
## To start developing KubeSphere
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
API rule violation: names_match,./devops/v1alpha1,S2iBinarySpec,MD5
|
||||
API rule violation: names_match,k8s.io/api/core/v1,AzureDiskVolumeSource,DataDiskURI
|
||||
API rule violation: names_match,k8s.io/api/core/v1,ContainerStatus,LastTerminationState
|
||||
API rule violation: names_match,k8s.io/api/core/v1,DaemonEndpoint,Port
|
||||
@@ -44,4 +45,3 @@ API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,Raw
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,IntVal
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,StrVal
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,Type
|
||||
API rule violation: names_match,kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1,S2iBinarySpec,MD5
|
||||
|
||||
@@ -4469,7 +4469,7 @@
|
||||
"secretRef": {
|
||||
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
|
||||
},
|
||||
"server_address": {
|
||||
"serverAddress": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
@@ -4514,6 +4514,31 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.ContainerInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"buildVolumes": {
|
||||
"description": "BuildVolumes specifies a list of volumes to mount to container running the build.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"builderImage": {
|
||||
"description": "BaseImage are the images this template will use.",
|
||||
"type": "string"
|
||||
},
|
||||
"runtimeArtifacts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.VolumeSpec"
|
||||
}
|
||||
},
|
||||
"runtimeImage": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.DockerConfig": {
|
||||
"description": "DockerConfig contains the configuration for a Docker connection.",
|
||||
"type": "object",
|
||||
@@ -4779,17 +4804,17 @@
|
||||
"description": "S2iBuilderTemplateSpec defines the desired state of S2iBuilderTemplate",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baseImages": {
|
||||
"description": "BaseImages are the images this template will use.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"codeFramework": {
|
||||
"description": "CodeFramework means which language this template is designed for and which framework is using if has framework. Like Java, NodeJS etc",
|
||||
"type": "string"
|
||||
},
|
||||
"containerInfo": {
|
||||
"description": "Images are the images this template will use.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.ContainerInfo"
|
||||
}
|
||||
},
|
||||
"defaultBaseImage": {
|
||||
"description": "DefaultBaseImage is the image that will be used by default",
|
||||
"type": "string"
|
||||
@@ -4961,6 +4986,10 @@
|
||||
"$ref": "#/definitions/com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.VolumeSpec"
|
||||
}
|
||||
},
|
||||
"isBinaryURL": {
|
||||
"description": "IsBinaryURL explain the type of SourceURL. If it is IsBinaryURL, it will download the file directly without using git.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"keepSymlinks": {
|
||||
"description": "KeepSymlinks indicates to copy symlinks as symlinks. Default behavior is to follow symlinks and copy files by content.",
|
||||
"type": "boolean"
|
||||
@@ -4980,6 +5009,17 @@
|
||||
"description": "LayeredBuild describes if this is build which layered scripts and sources on top of BuilderImage.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"nodeAffinityKey": {
|
||||
"description": "The key of Node Affinity.",
|
||||
"type": "string"
|
||||
},
|
||||
"nodeAffinityValues": {
|
||||
"description": "The values of Node Affinity.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"outputImageName": {
|
||||
"description": "OutputImageName is a result image name without tag, default is latest. tag will append to ImageName in the end",
|
||||
"type": "string"
|
||||
@@ -5004,6 +5044,10 @@
|
||||
"description": "RemovePreviousImage describes if previous image should be removed after successful build. This applies only to incremental builds.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"revisionId": {
|
||||
"description": "The RevisionId is a branch name or a SHA-1 hash of every important thing about the commit",
|
||||
"type": "string"
|
||||
},
|
||||
"runImage": {
|
||||
"description": "RunImage will trigger a \"docker run ...\" invocation of the produced image so the user can see if it operates as he would expect",
|
||||
"type": "boolean"
|
||||
@@ -5050,6 +5094,10 @@
|
||||
"description": "Tag is a result image tag name.",
|
||||
"type": "string"
|
||||
},
|
||||
"taintKey": {
|
||||
"description": "The name of taint.",
|
||||
"type": "string"
|
||||
},
|
||||
"usage": {
|
||||
"description": "Usage allows for properly shortcircuiting s2i logic when `s2i usage` is invoked",
|
||||
"type": "boolean"
|
||||
@@ -5143,6 +5191,14 @@
|
||||
"description": "BuilderName specify the name of s2ibuilder, required",
|
||||
"type": "string"
|
||||
},
|
||||
"newRevisionId": {
|
||||
"description": "NewRevisionId override the default NewRevisionId in its s2ibuilder.",
|
||||
"type": "string"
|
||||
},
|
||||
"newSourceURL": {
|
||||
"description": "NewSourceURL is used to download new binary artifacts",
|
||||
"type": "string"
|
||||
},
|
||||
"newTag": {
|
||||
"description": "NewTag override the default tag in its s2ibuilder, image name cannot be changed.",
|
||||
"type": "string"
|
||||
@@ -5187,7 +5243,7 @@
|
||||
"com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.UserDefineTemplate": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baseImage": {
|
||||
"builderImage": {
|
||||
"description": "BaseImage specify which version of this template to use",
|
||||
"type": "string"
|
||||
},
|
||||
@@ -5207,21 +5263,16 @@
|
||||
"com.github.kubesphere.s2ioperator.pkg.apis.devops.v1alpha1.VolumeSpec": {
|
||||
"description": "VolumeSpec represents a single volume mount point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"Source",
|
||||
"Destination",
|
||||
"Keep"
|
||||
],
|
||||
"properties": {
|
||||
"Destination": {
|
||||
"destination": {
|
||||
"description": "Destination is the path to mount the volume to - absolute or relative.",
|
||||
"type": "string"
|
||||
},
|
||||
"Keep": {
|
||||
"keep": {
|
||||
"description": "Keep indicates if the mounted data should be kept in the final image.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"Source": {
|
||||
"source": {
|
||||
"description": "Source is a reference to the volume source.",
|
||||
"type": "string"
|
||||
}
|
||||
|
||||
4
build/ks-network/Dockerfile
Normal file
4
build/ks-network/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM gcr.io/distroless/static:latest
|
||||
WORKDIR /
|
||||
COPY ks-network .
|
||||
ENTRYPOINT ["/ks-network"]
|
||||
24
cmd/ks-network/main.go
Normal file
24
cmd/ks-network/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
|
||||
"k8s.io/klog"
|
||||
"kubesphere.io/kubesphere/pkg/controller/network/runoption"
|
||||
)
|
||||
|
||||
var opt runoption.RunOption
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&opt.ProviderName, "np-provider", "calico", "specify the network policy provider, k8s or calico")
|
||||
flag.BoolVar(&opt.AllowInsecureEtcd, "allow-insecure-etcd", false, "specify allow connect to etcd using insecure http")
|
||||
//TODO add more flags
|
||||
}
|
||||
|
||||
func main() {
|
||||
klog.InitFlags(nil)
|
||||
flag.Set("logtostderr", "true")
|
||||
flag.Parse()
|
||||
klog.V(1).Info("Preparing kubernetes client")
|
||||
klog.Fatal(opt.Run())
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
apiVersion: network.kubesphere.io/v1alpha1
|
||||
kind: NamespaceNetworkPolicy
|
||||
metadata:
|
||||
labels:
|
||||
controller-tools.k8s.io: "1.0"
|
||||
name: namespacenetworkpolicy-sample
|
||||
spec:
|
||||
# Add fields here
|
||||
foo: bar
|
||||
0
config/webhook/manifests.yaml
Normal file
0
config/webhook/manifests.yaml
Normal file
31
go.mod
31
go.mod
@@ -5,6 +5,7 @@ go 1.12
|
||||
require (
|
||||
bitbucket.org/ww/goautoneg v0.0.0-20120707110453-75cd24fc2f2c // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
|
||||
github.com/Azure/go-autorest/autorest v0.5.0 // indirect
|
||||
github.com/Microsoft/go-winio v0.4.12 // indirect
|
||||
github.com/NYTimes/gziphandler v1.1.1 // indirect
|
||||
github.com/PuerkitoBio/goquery v1.5.0
|
||||
@@ -36,9 +37,14 @@ require (
|
||||
github.com/evanphx/json-patch v4.2.0+incompatible // indirect
|
||||
github.com/fatih/structs v1.1.0
|
||||
github.com/go-ldap/ldap v3.0.3+incompatible
|
||||
github.com/go-logr/logr v0.1.0 // indirect
|
||||
github.com/go-logr/logr v0.1.0
|
||||
github.com/go-logr/zapr v0.1.1 // indirect
|
||||
github.com/go-openapi/spec v0.19.2
|
||||
github.com/go-openapi/jsonpointer v0.19.0 // indirect
|
||||
github.com/go-openapi/jsonreference v0.19.0 // indirect
|
||||
github.com/go-openapi/spec v0.19.0
|
||||
github.com/go-openapi/swag v0.19.0 // indirect
|
||||
github.com/go-playground/locales v0.12.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.16.0 // indirect
|
||||
github.com/go-redis/redis v6.15.2+incompatible
|
||||
github.com/go-sql-driver/mysql v1.4.1
|
||||
github.com/gobuffalo/flect v0.1.5 // indirect
|
||||
@@ -46,12 +52,12 @@ require (
|
||||
github.com/golang/example v0.0.0-20170904185048-46695d81d1fa
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
|
||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
|
||||
github.com/golang/protobuf v1.3.1 // indirect
|
||||
github.com/google/btree v1.0.0 // indirect
|
||||
github.com/google/go-querystring v1.0.0 // indirect
|
||||
github.com/google/gofuzz v1.0.0 // indirect
|
||||
github.com/google/uuid v1.1.1
|
||||
github.com/googleapis/gnostic v0.2.0 // indirect
|
||||
github.com/gophercloud/gophercloud v0.3.0 // indirect
|
||||
github.com/gorilla/mux v1.7.1 // indirect
|
||||
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
|
||||
@@ -64,13 +70,15 @@ require (
|
||||
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
||||
github.com/jonboulle/clockwork v0.1.0 // indirect
|
||||
github.com/json-iterator/go v1.1.6
|
||||
github.com/kelseyhightower/envconfig v1.4.0 // indirect
|
||||
github.com/kiali/kiali v1.1.0
|
||||
github.com/klauspost/cpuid v1.2.1 // indirect
|
||||
github.com/knative/pkg v0.0.0-20190314204845-cd278f2d3394
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
|
||||
github.com/kubernetes-sigs/application v0.0.0-20190404151855-67ae7f915d4e
|
||||
github.com/kubesphere/s2ioperator v0.0.11
|
||||
github.com/kubesphere/s2ioperator v0.0.12
|
||||
github.com/kubesphere/sonargo v0.0.2
|
||||
github.com/leodido/go-urn v1.1.0 // indirect
|
||||
github.com/lib/pq v1.2.0 // indirect
|
||||
github.com/lucas-clemente/quic-go v0.11.1 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.11.0 // indirect
|
||||
@@ -79,7 +87,7 @@ require (
|
||||
github.com/miekg/dns v1.1.9 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.1 // indirect
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
|
||||
github.com/onsi/ginkgo v1.8.0
|
||||
github.com/onsi/gomega v1.5.0
|
||||
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
|
||||
@@ -87,11 +95,15 @@ require (
|
||||
github.com/pborman/uuid v0.0.0-20180906182336-adf5a7427709 // indirect
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
|
||||
github.com/pkg/errors v0.8.1 // indirect
|
||||
github.com/prometheus/client_golang v0.9.2 // indirect
|
||||
github.com/projectcalico/go-json v0.0.0-20161128004156-6219dc7339ba // indirect
|
||||
github.com/projectcalico/go-yaml v0.0.0-20161201183616-955bc3e451ef // indirect
|
||||
github.com/projectcalico/go-yaml-wrapper v0.0.0-20161127220527-598e54215bee // indirect
|
||||
github.com/projectcalico/libcalico-go v0.0.0-20190708183129-ac36d966132f
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
|
||||
github.com/prometheus/common v0.4.0 // indirect
|
||||
github.com/prometheus/common v0.4.0
|
||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 // indirect
|
||||
github.com/russross/blackfriday v1.5.2 // indirect
|
||||
github.com/satori/go.uuid v1.2.0 // indirect
|
||||
github.com/soheilhy/cmux v0.1.4 // indirect
|
||||
github.com/sony/sonyflake v0.0.0-20181109022403-6d5bd6181009
|
||||
github.com/speps/go-hashids v2.0.0+incompatible
|
||||
@@ -105,12 +117,15 @@ require (
|
||||
go.uber.org/atomic v1.4.0 // indirect
|
||||
go.uber.org/multierr v1.1.0 // indirect
|
||||
go.uber.org/zap v1.10.0 // indirect
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859
|
||||
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a // indirect
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
|
||||
golang.org/x/tools/gopls v0.1.3 // indirect
|
||||
google.golang.org/appengine v1.5.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7 // indirect
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
|
||||
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
|
||||
gopkg.in/go-playground/validator.v9 v9.29.1 // indirect
|
||||
gopkg.in/igm/sockjs-go.v2 v2.0.0
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/square/go-jose.v2 v2.3.1 // indirect
|
||||
|
||||
121
go.sum
121
go.sum
@@ -1,9 +1,24 @@
|
||||
bitbucket.org/ww/goautoneg v0.0.0-20120707110453-75cd24fc2f2c h1:t+Ra932MCC0eeyD/vigXqMbZTzgZjd4JOfBJWC6VSMI=
|
||||
bitbucket.org/ww/goautoneg v0.0.0-20120707110453-75cd24fc2f2c/go.mod h1:1vhO7Mn/FZMgOgDVGLy5X1mE6rq1HbkBdkF/yj8zkcg=
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
contrib.go.opencensus.io/exporter/ocagent v0.4.12 h1:jGFvw3l57ViIVEPKKEUXPcLYIXJmQxLUh6ey1eJhwyc=
|
||||
contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA=
|
||||
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.5.0 h1:Mlm9qy2fpQ9MvfyI41G2Zf5B4CsgjjNbLOWszfK6KrY=
|
||||
github.com/Azure/go-autorest/autorest v0.5.0/go.mod h1:9HLKlQjVBH6U3oDfsXOeVc56THsLPw1L03yban4xThw=
|
||||
github.com/Azure/go-autorest/autorest/adal v0.2.0 h1:7IBDu1jgh+ADHXnEYExkV9RE/ztOOlxdACkkPRthGKw=
|
||||
github.com/Azure/go-autorest/autorest/adal v0.2.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E=
|
||||
github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM=
|
||||
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
|
||||
github.com/Azure/go-autorest/autorest/mocks v0.1.0 h1:Kx+AUU2Te+A3JIyYn6Dfs+cFgx5XorQKuIXrZGoq/SI=
|
||||
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
|
||||
github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY=
|
||||
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
|
||||
github.com/Azure/go-autorest/tracing v0.1.0 h1:TRBxC5Pj/fIuh4Qob0ZpkggbfT8RC0SubHbpV3p4/Vc=
|
||||
github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88=
|
||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Microsoft/go-winio v0.4.12 h1:xAfWHN1IrQ0NJ9TBC0KBZoqLjzDTr1ML+4MywiUOryc=
|
||||
@@ -12,18 +27,25 @@ github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cq
|
||||
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
|
||||
github.com/PuerkitoBio/goquery v1.5.0 h1:uGvmFXOA73IKluu/F84Xd1tt/z07GYm8X49XKHP7EJk=
|
||||
github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg=
|
||||
github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4=
|
||||
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-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/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
|
||||
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
|
||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
|
||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o=
|
||||
github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 h1:Kn3rqvbUFqSepE2OqVu0Pn1CbDw9IuMlONapol0zuwk=
|
||||
github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M=
|
||||
github.com/asaskevich/govalidator v0.0.0-20180315120708-ccb8e960c48f h1:y2hSFdXeA1y5z5f0vfNO0Dg5qVY036qzlz3Pds0B92o=
|
||||
@@ -37,6 +59,8 @@ github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115/go.mod h1:zVt7zX3
|
||||
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ=
|
||||
github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE=
|
||||
github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ=
|
||||
@@ -70,6 +94,9 @@ github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c h1:ZfSZ3P3BedhKG
|
||||
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
|
||||
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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
|
||||
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
|
||||
github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
|
||||
github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
|
||||
github.com/elazarl/goproxy v0.0.0-20190711103511-473e67f1d7d2 h1:aZtFdDNWY/yH86JPR2WX/PN63635VsE/f/nXNPAbYxY=
|
||||
@@ -108,14 +135,29 @@ github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg=
|
||||
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
|
||||
github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE=
|
||||
github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk=
|
||||
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
|
||||
github.com/go-openapi/jsonpointer v0.19.0 h1:FTUMcX77w5rQkClIzDtTxvn6Bsa894CcrzNj2MMfeg8=
|
||||
github.com/go-openapi/jsonpointer v0.19.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
|
||||
github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0=
|
||||
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
|
||||
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
|
||||
github.com/go-openapi/jsonreference v0.19.0 h1:BqWKpV1dFd+AuiKlgtddwVIFQsuMpxfBDBHGfM2yNpk=
|
||||
github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
|
||||
github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w=
|
||||
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
|
||||
github.com/go-openapi/spec v0.19.0 h1:A4SZ6IWh3lnjH0rG0Z5lkxazMGBECtrZcbyYQi+64k4=
|
||||
github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
|
||||
github.com/go-openapi/spec v0.19.2 h1:SStNd1jRcYtfKCN7R0laGNs80WYYvn5CbBjM2sOmCrE=
|
||||
github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY=
|
||||
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
|
||||
github.com/go-openapi/swag v0.19.0 h1:Kg7Wl7LkTPlmc393QZQ/5rQadPhi7pBVEMZxyTi0Ii8=
|
||||
github.com/go-openapi/swag v0.19.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
|
||||
github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE=
|
||||
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
|
||||
github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc=
|
||||
github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
|
||||
github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rmGrCjJ8eAeUP/K/EKx4DM=
|
||||
github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
|
||||
github.com/go-redis/redis v6.15.2+incompatible h1:9SpNVG76gr6InJGxoZ6IuuxaCOQwDAhzyXg+Bs+0Sb4=
|
||||
github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
|
||||
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
|
||||
@@ -127,6 +169,8 @@ github.com/gocraft/dbr v0.0.0-20180507214907-a0fd650918f6 h1:kumyNm8Vr8cbVm/aLQY
|
||||
github.com/gocraft/dbr v0.0.0-20180507214907-a0fd650918f6/go.mod h1:K/9g3pPouf13kP5K7pdriQEJAy272R9yXuWuDIEWJTM=
|
||||
github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI=
|
||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/golang/example v0.0.0-20170904185048-46695d81d1fa h1:iqCQC2Z53KkwGgTN9szyL4q0OQHmuNjeoNnMT6lk66k=
|
||||
github.com/golang/example v0.0.0-20170904185048-46695d81d1fa/go.mod h1:tO/5UvQ/uKigUjQBPqzstj6uxd3fUIjddi19DxGJeWg=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
||||
@@ -139,6 +183,7 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
|
||||
@@ -151,6 +196,10 @@ 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/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g=
|
||||
github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
||||
github.com/gophercloud/gophercloud v0.3.0 h1:6sjpKIpVwRIIwmcEGp+WwNovNsem+c+2vm6oxshRpL8=
|
||||
github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
|
||||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/mux v1.7.1 h1:Dw4jY2nghMMRsh1ol8dv1axHkDwMQK2DHerMNJsIpJU=
|
||||
github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
|
||||
@@ -161,6 +210,7 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmo
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 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.8.5/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 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE=
|
||||
@@ -168,6 +218,7 @@ github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdv
|
||||
github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E=
|
||||
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
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 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
@@ -188,8 +239,11 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22
|
||||
github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
|
||||
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
|
||||
github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e h1:RgQk53JHp/Cjunrr1WlsXSZpqXn+uREuHvUVcK82CV8=
|
||||
github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
||||
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/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w=
|
||||
github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
||||
@@ -209,12 +263,14 @@ github.com/kubesphere/application v0.0.0-20190518133311-b9d9eb0b5cf7 h1:9dongD6m
|
||||
github.com/kubesphere/application v0.0.0-20190518133311-b9d9eb0b5cf7/go.mod h1:xCs7b2bgA24oBSuZYf+5btESJC3xPs//ZTSK1ql+W6I=
|
||||
github.com/kubesphere/kiali v0.15.1-0.20190407071308-6b5b818211c3 h1:5IASnVaVqZFzzIc/0FZuAnjWO1gVCUxJe1OFUS42/fU=
|
||||
github.com/kubesphere/kiali v0.15.1-0.20190407071308-6b5b818211c3/go.mod h1:Y1EqeixoXkKkU8I+yvOfhdh21+8+etFE6wYOVT2XFdI=
|
||||
github.com/kubesphere/s2ioperator v0.0.11 h1:jptEoR+pMb2HXqA6WhMXH3xx0qmtM5kgkoMhO/jaJLQ=
|
||||
github.com/kubesphere/s2ioperator v0.0.11/go.mod h1:dv9L+zRYDlHvnKPp0j6VHRtlGB1BU+lloltW9SAWqVU=
|
||||
github.com/kubesphere/s2ioperator v0.0.12 h1:gEDDjKw7q7gQUuy5qtBIV/adZEwk5liJUBL4CqyOOOY=
|
||||
github.com/kubesphere/s2ioperator v0.0.12/go.mod h1:dv9L+zRYDlHvnKPp0j6VHRtlGB1BU+lloltW9SAWqVU=
|
||||
github.com/kubesphere/sonargo v0.0.2 h1:hsSRE3sv3mkPcUAeSABdp7rtfcNW2zzeHXzFa01CTkU=
|
||||
github.com/kubesphere/sonargo v0.0.2/go.mod h1:ww8n9ANlDXhX5PBZ18iaRnCgEkXN0GMml3/KZXOZ11w=
|
||||
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=
|
||||
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
|
||||
github.com/leodido/go-urn v1.1.0 h1:Sm1gr51B1kKyfD2BlRcLSiEkffoG96g6TPv6eRoEiB8=
|
||||
github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw=
|
||||
github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0=
|
||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f/go.mod h1:JpH9J1c9oX6otFSgdUHwUBUizmKlrMjxWnIAjff4m04=
|
||||
@@ -223,6 +279,8 @@ github.com/lucas-clemente/quic-go v0.10.2/go.mod h1:hvaRS9IHjFLMq76puFJeWNfmn+H7
|
||||
github.com/lucas-clemente/quic-go v0.11.1 h1:zasajC848Dqq/+WqfqBCkmPw+YHNe1MBts/z7y7nXf4=
|
||||
github.com/lucas-clemente/quic-go v0.11.1/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw=
|
||||
github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced/go.mod h1:NCcRLrOTZbzhZvixZLlERbJtDtYsmMw8Jc4vS8Z0g58=
|
||||
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic=
|
||||
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4=
|
||||
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/marten-seemann/qtls v0.2.3 h1:0yWJ43C62LsZt08vuQJDK1uC1czUc3FJeCLPoNAI4vA=
|
||||
@@ -244,6 +302,8 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
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 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
|
||||
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/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
@@ -262,35 +322,49 @@ github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2i
|
||||
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
github.com/openshift/api v3.9.0+incompatible h1:fJ/KsefYuZAjmrr3+5U9yZIZbTOpVkDDLDLFresAeYs=
|
||||
github.com/openshift/api v3.9.0+incompatible/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY=
|
||||
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
|
||||
github.com/pborman/uuid v0.0.0-20180906182336-adf5a7427709 h1:zNBQb37RGLmJybyMcs983HfUfpkw9OTFD9tbBfAViHE=
|
||||
github.com/pborman/uuid v0.0.0-20180906182336-adf5a7427709/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34=
|
||||
github.com/pelletier/go-buffruneio v0.2.0 h1:U4t4R6YkofJ5xHm3dJzuRpPZ0mr5MMCoAWooScCR7aA=
|
||||
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/projectcalico/go-json v0.0.0-20161128004156-6219dc7339ba h1:aaF2byUCZhzszHsfPEr2M3qcU4ibtD/yk/il2R7T1PU=
|
||||
github.com/projectcalico/go-json v0.0.0-20161128004156-6219dc7339ba/go.mod h1:q8EdCgBdMQzgiX/uk4GXLWLk+gIHd1a7mWUAamJKDb4=
|
||||
github.com/projectcalico/go-yaml v0.0.0-20161201183616-955bc3e451ef h1:Di9BaA9apb6DEstin8RdhKmlzQG76UMbmjPzjCVkMpc=
|
||||
github.com/projectcalico/go-yaml v0.0.0-20161201183616-955bc3e451ef/go.mod h1:1Ra2BftSa7Go38Gbq1q0bfmBFSSgUv+Cdc3SY8IL/C0=
|
||||
github.com/projectcalico/go-yaml-wrapper v0.0.0-20161127220527-598e54215bee h1:yVWsNSlAuYoJ0CznHsYRPiFgsotoj07k00k5rQvGlHM=
|
||||
github.com/projectcalico/go-yaml-wrapper v0.0.0-20161127220527-598e54215bee/go.mod h1:UgC0aTQ2KMDxlX3lU/stndk7DMUBJqzN40yFiILHgxc=
|
||||
github.com/projectcalico/libcalico-go v0.0.0-20190708183129-ac36d966132f h1:ccdS7T4NhdlHx8nXe6GiS7TAJUg6Gu/qEDJf1IJvcy8=
|
||||
github.com/projectcalico/libcalico-go v0.0.0-20190708183129-ac36d966132f/go.mod h1:0b/n/rPzNXjhn4ywFcEJuQdA/5olt9UxFIATz57xkbc=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.2 h1:awm861/B8OKDd2I/6o1dy3ra4BamzKhYOiGItCeZ740=
|
||||
github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
|
||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 h1:D+CiwcpGTW6pL6bv6KI3KbyEyCKyS+1JWS2h8PNDnGA=
|
||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM=
|
||||
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY=
|
||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc=
|
||||
github.com/russross/blackfriday v0.0.0-20170610170232-067529f716f4/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
|
||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||
github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo=
|
||||
@@ -328,6 +402,9 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
|
||||
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.20.2 h1:NAfh7zF0/3/HqtMvJNZ/RFrSlCE6ZTlHmKfhL/Dm1Jk=
|
||||
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
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=
|
||||
@@ -336,20 +413,23 @@ 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-20190219172222-a4c6cb3142f2/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 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU=
|
||||
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-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-20181201002055-351d144fa1fc/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=
|
||||
@@ -359,12 +439,16 @@ golang.org/x/net v0.0.0-20190328230028-74de082e2cca/go.mod h1:t9HGtf8HONx5eT2rtn
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU=
|
||||
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 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA=
|
||||
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/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 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -374,33 +458,51 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h
|
||||
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-20181122145206-62eef0e2fa9b/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-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e h1:ZytStCyV048ZqDsWHiYDdoI2Vd4msMcrDECFxS+tL9c=
|
||||
golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f h1:25KHgbfyiSm6vwQLbM3zZIe1v9p/3ea4Rz+nnM5K/i4=
|
||||
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/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-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c h1:vamGzbGri8IKo20MQncCuljcQ5uAO6kaCeawQPVblAI=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138 h1:H3uGjxCR/6Ds0Mjgyp7LMK81+LvmbvWWEnJhzk1Pi9E=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59 h1:QjA/9ArTfVTLfEhClDCG7SGrZkZixxWpwNCDiwJfh88=
|
||||
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190710153321-831012c29e42 h1:4IOeC7p+OItq3+O5BWkcmVu2uBe3jekXau5S4QZX9DU=
|
||||
golang.org/x/tools v0.0.0-20190710153321-831012c29e42/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
|
||||
golang.org/x/tools/gopls v0.1.3 h1:CB5ECiPysqZrwxcyRjN+exyZpY0gODTZvNiqQi3lpeo=
|
||||
golang.org/x/tools/gopls v0.1.3/go.mod h1:vrCQzOKxvuiZLjCKSmbbov04oeBQQOb4VQqwYK2PWIY=
|
||||
google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8=
|
||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
||||
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 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7 h1:ZUjXAXmrAyrmmCPHgCA/vChHcpsX27MZ3yBonD/z1KE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM=
|
||||
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
|
||||
@@ -409,6 +511,10 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
|
||||
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
|
||||
gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc=
|
||||
gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
|
||||
gopkg.in/igm/sockjs-go.v2 v2.0.0 h1:NfDyi1jrF9v2VOPESefhKH1NRqpoE9tp4v6kxVR3ubs=
|
||||
gopkg.in/igm/sockjs-go.v2 v2.0.0/go.mod h1:xvdpHZ3OpjP0TzQzl+174DglrrnYZKVd6qHPIX20Z1Q=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
@@ -436,6 +542,7 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
k8s.io/api v0.0.0-20181213150558-05914d821849 h1:WZFcFPXmLR7g5CxQNmjWv0mg8qulJLxDghbzS4pQtzY=
|
||||
k8s.io/api v0.0.0-20181213150558-05914d821849/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
|
||||
|
||||
@@ -18,6 +18,7 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
GOPATH=`go env GOPATH`
|
||||
# generate-groups generates everything for a project with external types only, e.g. a project based
|
||||
# on CustomResourceDefinitions.
|
||||
|
||||
@@ -46,12 +47,9 @@ APIS_PKG="$3"
|
||||
GROUPS_WITH_VERSIONS="$4"
|
||||
shift 4
|
||||
|
||||
# (
|
||||
# # To support running this script from anywhere, we have to first cd into this directory
|
||||
# # so we can install the tools.
|
||||
# cd "$(dirname "${0}")"
|
||||
# go install ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}
|
||||
# )
|
||||
|
||||
GO111MODULE=on go install -mod=vendor k8s.io/code-generator/cmd/{client-gen,lister-gen,informer-gen}
|
||||
|
||||
|
||||
function codegen::join() { local IFS="$1"; shift; echo "$*"; }
|
||||
|
||||
@@ -68,25 +66,25 @@ done
|
||||
|
||||
if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then
|
||||
echo "Generating deepcopy funcs"
|
||||
go run "${PWD}/k8s.io/k8s.io/vendor/code-generator/cmd/deepcopy-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${APIS_PKG}" "$@"
|
||||
${GOPATH}/bin/deepcopy-gen --input-dirs $(codegen::join , "${FQ_APIS[@]}") -O zz_generated.deepcopy --bounding-dirs ${APIS_PKG} "$@"
|
||||
fi
|
||||
|
||||
if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then
|
||||
echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}"
|
||||
go run "${PWD}/vendor/k8s.io/code-generator/cmd/client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@"
|
||||
${GOPATH}/bin/client-gen --clientset-name ${CLIENTSET_NAME_VERSIONED:-versioned} --input-base "" --input $(codegen::join , "${FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset} "$@"
|
||||
fi
|
||||
|
||||
if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then
|
||||
echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers"
|
||||
go run "${PWD}/vendor/k8s.io/code-generator/cmd/lister-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@"
|
||||
${GOPATH}/bin/lister-gen --input-dirs $(codegen::join , "${FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/listers "$@"
|
||||
fi
|
||||
|
||||
if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then
|
||||
echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers"
|
||||
go run "${PWD}/vendor/k8s.io/code-generator/cmd/informer-gen" \
|
||||
--input-dirs "$(codegen::join , "${FQ_APIS[@]}")" \
|
||||
--versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \
|
||||
--listers-package "${OUTPUT_PKG}/listers" \
|
||||
--output-package "${OUTPUT_PKG}/informers" \
|
||||
${GOPATH}/bin/informer-gen \
|
||||
--input-dirs $(codegen::join , "${FQ_APIS[@]}") \
|
||||
--versioned-clientset-package ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned} \
|
||||
--listers-package ${OUTPUT_PKG}/listers \
|
||||
--output-package ${OUTPUT_PKG}/informers \
|
||||
"$@"
|
||||
fi
|
||||
|
||||
@@ -40,6 +40,6 @@ BUILD_GOARCH=${GOARCH:-amd64}
|
||||
GOBINARY=${GOBINARY:-go}
|
||||
|
||||
# forgoing -i (incremental build) because it will be deprecated by tool chain.
|
||||
time GOOS=${BUILD_GOOS} GOARCH=${BUILD_GOARCH} ${GOBINARY} build \
|
||||
time GOOS=${BUILD_GOOS} CGO_ENABLED=0 GOARCH=${BUILD_GOARCH} ${GOBINARY} build \
|
||||
-o ${OUT} \
|
||||
${BUILDPATH}
|
||||
|
||||
11
kustomize/network/OWNERS
Normal file
11
kustomize/network/OWNERS
Normal file
@@ -0,0 +1,11 @@
|
||||
approvers:
|
||||
- magicsong
|
||||
- zheng1
|
||||
|
||||
reviewers:
|
||||
- magicsong
|
||||
- zheng1
|
||||
|
||||
labels:
|
||||
- area/deploy
|
||||
- area/networking
|
||||
711
kustomize/network/crds/nsnp.yaml
Normal file
711
kustomize/network/crds/nsnp.yaml
Normal file
@@ -0,0 +1,711 @@
|
||||
apiVersion: apiextensions.k8s.io/v1beta1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
name: namespacenetworkpolicies.network.kubesphere.io
|
||||
spec:
|
||||
group: network.kubesphere.io
|
||||
names:
|
||||
categories:
|
||||
- networking
|
||||
kind: NamespaceNetworkPolicy
|
||||
plural: namespacenetworkpolicies
|
||||
shortNames:
|
||||
- nsnp
|
||||
scope: Namespaced
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: NamespaceNetworkPolicy is the Schema for the namespacenetworkpolicies
|
||||
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/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/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: NamespaceNetworkPolicySpec defines the desired state of NamespaceNetworkPolicy
|
||||
properties:
|
||||
egress:
|
||||
description: The ordered set of egress rules. Each rule contains a
|
||||
set of packet match criteria and a corresponding action to apply.
|
||||
items:
|
||||
description: "A Rule encapsulates a set of match criteria and an action.
|
||||
\ Both selector-based security Policy and security Profiles reference
|
||||
rules - separated out as a list of rules for both ingress and egress
|
||||
packet matching. \n Each positive match criteria has a negated version,
|
||||
prefixed with ”Not”. All the match criteria within a rule must be
|
||||
satisfied for a packet to match. A single rule can contain the positive
|
||||
and negative version of a match and both must be satisfied for the
|
||||
rule to match."
|
||||
properties:
|
||||
action:
|
||||
type: string
|
||||
destination:
|
||||
description: Destination contains the match criteria that apply
|
||||
to destination entity.
|
||||
properties:
|
||||
namespaceSelector:
|
||||
description: "NamespaceSelector is an optional field that
|
||||
contains a selector expression. Only traffic that originates
|
||||
from (or terminates at) endpoints within the selected namespaces
|
||||
will be matched. When both NamespaceSelector and Selector
|
||||
are defined on the same rule, then only workload endpoints
|
||||
that are matched by both selectors will be selected by the
|
||||
rule. \n For NetworkPolicy, an empty NamespaceSelector implies
|
||||
that the Selector is limited to selecting only workload
|
||||
endpoints in the same namespace as the NetworkPolicy. \n
|
||||
For GlobalNetworkPolicy, an empty NamespaceSelector implies
|
||||
the Selector applies to workload endpoints across all namespaces."
|
||||
type: string
|
||||
nets:
|
||||
description: Nets is an optional field that restricts the
|
||||
rule to only apply to traffic that originates from (or terminates
|
||||
at) IP addresses in any of the given subnets.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
notNets:
|
||||
description: NotNets is the negated version of the Nets field.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
notPorts:
|
||||
items:
|
||||
type: object
|
||||
x-kubernetes-int-or-string: true
|
||||
description: "Port represents either a range of numeric
|
||||
ports or a named port. \n - For a named port, set
|
||||
the PortName, leaving MinPort and MaxPort as 0. -
|
||||
For a port range, set MinPort and MaxPort to the (inclusive)
|
||||
port numbers. Set PortName to \"\". - For a
|
||||
single port, set MinPort = MaxPort and PortName = \"\"."
|
||||
description: NotPorts is the negated version of the Ports
|
||||
field. Since only some protocols have ports, if any ports
|
||||
are specified it requires the Protocol match in the Rule
|
||||
to be set to "TCP" or "UDP".
|
||||
type: array
|
||||
notSelector:
|
||||
description: NotSelector is the negated version of the Selector
|
||||
field. See Selector field for subtleties with negated selectors.
|
||||
type: string
|
||||
ports:
|
||||
description: "Ports is an optional field that restricts the
|
||||
rule to only apply to traffic that has a source (destination)
|
||||
port that matches one of these ranges/values. This value
|
||||
is a list of integers or strings that represent ranges of
|
||||
ports. \n Since only some protocols have ports, if any ports
|
||||
are specified it requires the Protocol match in the Rule
|
||||
to be set to \"TCP\" or \"UDP\"."
|
||||
items:
|
||||
description: "Port represents either a range of numeric
|
||||
ports or a named port. \n - For a named port, set
|
||||
the PortName, leaving MinPort and MaxPort as 0. -
|
||||
For a port range, set MinPort and MaxPort to the (inclusive)
|
||||
port numbers. Set PortName to \"\". - For a
|
||||
single port, set MinPort = MaxPort and PortName = \"\"."
|
||||
x-kubernetes-int-or-string: true
|
||||
type: object
|
||||
type: array
|
||||
selector:
|
||||
description: "Selector is an optional field that contains
|
||||
a selector expression (see Policy for sample syntax). Only
|
||||
traffic that originates from (terminates at) endpoints matching
|
||||
the selector will be matched. \n Note that: in addition
|
||||
to the negated version of the Selector (see NotSelector
|
||||
below), the selector expression syntax itself supports negation.
|
||||
\ The two types of negation are subtly different. One negates
|
||||
the set of matched endpoints, the other negates the whole
|
||||
match: \n \tSelector = \"!has(my_label)\" matches packets
|
||||
that are from other Calico-controlled \tendpoints that do
|
||||
not have the label “my_label”. \n \tNotSelector = \"has(my_label)\"
|
||||
matches packets that are not from Calico-controlled \tendpoints
|
||||
that do have the label “my_label”. \n The effect is that
|
||||
the latter will accept packets from non-Calico sources whereas
|
||||
the former is limited to packets from Calico-controlled
|
||||
endpoints."
|
||||
type: string
|
||||
serviceAccounts:
|
||||
description: ServiceAccounts is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from (or
|
||||
terminates at) a pod running as a matching service account.
|
||||
properties:
|
||||
names:
|
||||
description: Names is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from
|
||||
(or terminates at) a pod running as a service account
|
||||
whose name is in the list.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
selector:
|
||||
description: Selector is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from
|
||||
(or terminates at) a pod running as a service account
|
||||
that matches the given label selector. If both Names
|
||||
and Selector are specified then they are AND'ed.
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
http:
|
||||
description: HTTP contains match criteria that apply to HTTP requests.
|
||||
properties:
|
||||
methods:
|
||||
description: Methods is an optional field that restricts the
|
||||
rule to apply only to HTTP requests that use one of the
|
||||
listed HTTP Methods (e.g. GET, PUT, etc.) Multiple methods
|
||||
are OR'd together.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
paths:
|
||||
description: 'Paths is an optional field that restricts the
|
||||
rule to apply to HTTP requests that use one of the listed
|
||||
HTTP Paths. Multiple paths are OR''d together. e.g: - exact:
|
||||
/foo - prefix: /bar NOTE: Each entry may ONLY specify either
|
||||
a `exact` or a `prefix` match. The validator will check
|
||||
for it.'
|
||||
items:
|
||||
description: 'HTTPPath specifies an HTTP path to match.
|
||||
It may be either of the form: exact: <path>: which matches
|
||||
the path exactly or prefix: <path-prefix>: which matches
|
||||
the path prefix'
|
||||
properties:
|
||||
exact:
|
||||
type: string
|
||||
prefix:
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
icmp:
|
||||
description: ICMP is an optional field that restricts the rule
|
||||
to apply to a specific type and code of ICMP traffic. This
|
||||
should only be specified if the Protocol field is set to "ICMP"
|
||||
or "ICMPv6".
|
||||
properties:
|
||||
code:
|
||||
description: Match on a specific ICMP code. If specified,
|
||||
the Type value must also be specified. This is a technical
|
||||
limitation imposed by the kernel’s iptables firewall, which
|
||||
Calico uses to enforce the rule.
|
||||
type: integer
|
||||
type:
|
||||
description: Match on a specific ICMP type. For example a
|
||||
value of 8 refers to ICMP Echo Request (i.e. pings).
|
||||
type: integer
|
||||
type: object
|
||||
ipVersion:
|
||||
description: IPVersion is an optional field that restricts the
|
||||
rule to only match a specific IP version.
|
||||
type: integer
|
||||
notICMP:
|
||||
description: NotICMP is the negated version of the ICMP field.
|
||||
properties:
|
||||
code:
|
||||
description: Match on a specific ICMP code. If specified,
|
||||
the Type value must also be specified. This is a technical
|
||||
limitation imposed by the kernel’s iptables firewall, which
|
||||
Calico uses to enforce the rule.
|
||||
type: integer
|
||||
type:
|
||||
description: Match on a specific ICMP type. For example a
|
||||
value of 8 refers to ICMP Echo Request (i.e. pings).
|
||||
type: integer
|
||||
type: object
|
||||
notProtocol:
|
||||
description: NotProtocol is the negated version of the Protocol
|
||||
field.
|
||||
type: string
|
||||
protocol:
|
||||
description: "Protocol is an optional field that restricts the
|
||||
rule to only apply to traffic of a specific IP protocol. Required
|
||||
if any of the EntityRules contain Ports (because ports only
|
||||
apply to certain protocols). \n Must be one of these string
|
||||
values: \"TCP\", \"UDP\", \"ICMP\", \"ICMPv6\", \"SCTP\", \"UDPLite\"
|
||||
or an integer in the range 1-255."
|
||||
type: string
|
||||
source:
|
||||
description: Source contains the match criteria that apply to
|
||||
source entity.
|
||||
properties:
|
||||
namespaceSelector:
|
||||
description: "NamespaceSelector is an optional field that
|
||||
contains a selector expression. Only traffic that originates
|
||||
from (or terminates at) endpoints within the selected namespaces
|
||||
will be matched. When both NamespaceSelector and Selector
|
||||
are defined on the same rule, then only workload endpoints
|
||||
that are matched by both selectors will be selected by the
|
||||
rule. \n For NetworkPolicy, an empty NamespaceSelector implies
|
||||
that the Selector is limited to selecting only workload
|
||||
endpoints in the same namespace as the NetworkPolicy. \n
|
||||
For GlobalNetworkPolicy, an empty NamespaceSelector implies
|
||||
the Selector applies to workload endpoints across all namespaces."
|
||||
type: string
|
||||
nets:
|
||||
description: Nets is an optional field that restricts the
|
||||
rule to only apply to traffic that originates from (or terminates
|
||||
at) IP addresses in any of the given subnets.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
notNets:
|
||||
description: NotNets is the negated version of the Nets field.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
notPorts:
|
||||
description: NotPorts is the negated version of the Ports
|
||||
field. Since only some protocols have ports, if any ports
|
||||
are specified it requires the Protocol match in the Rule
|
||||
to be set to "TCP" or "UDP".
|
||||
items:
|
||||
description: "Port represents either a range of numeric
|
||||
ports or a named port. \n - For a named port, set
|
||||
the PortName, leaving MinPort and MaxPort as 0. -
|
||||
For a port range, set MinPort and MaxPort to the (inclusive)
|
||||
port numbers. Set PortName to \"\". - For a
|
||||
single port, set MinPort = MaxPort and PortName = \"\"."
|
||||
x-kubernetes-int-or-string: true
|
||||
type: object
|
||||
type: array
|
||||
notSelector:
|
||||
description: NotSelector is the negated version of the Selector
|
||||
field. See Selector field for subtleties with negated selectors.
|
||||
type: string
|
||||
ports:
|
||||
description: "Ports is an optional field that restricts the
|
||||
rule to only apply to traffic that has a source (destination)
|
||||
port that matches one of these ranges/values. This value
|
||||
is a list of integers or strings that represent ranges of
|
||||
ports. \n Since only some protocols have ports, if any ports
|
||||
are specified it requires the Protocol match in the Rule
|
||||
to be set to \"TCP\" or \"UDP\"."
|
||||
items:
|
||||
description: "Port represents either a range of numeric
|
||||
ports or a named port. \n - For a named port, set
|
||||
the PortName, leaving MinPort and MaxPort as 0. -
|
||||
For a port range, set MinPort and MaxPort to the (inclusive)
|
||||
port numbers. Set PortName to \"\". - For a
|
||||
single port, set MinPort = MaxPort and PortName = \"\"."
|
||||
x-kubernetes-int-or-string: true
|
||||
type: object
|
||||
type: array
|
||||
selector:
|
||||
description: "Selector is an optional field that contains
|
||||
a selector expression (see Policy for sample syntax). Only
|
||||
traffic that originates from (terminates at) endpoints matching
|
||||
the selector will be matched. \n Note that: in addition
|
||||
to the negated version of the Selector (see NotSelector
|
||||
below), the selector expression syntax itself supports negation.
|
||||
\ The two types of negation are subtly different. One negates
|
||||
the set of matched endpoints, the other negates the whole
|
||||
match: \n \tSelector = \"!has(my_label)\" matches packets
|
||||
that are from other Calico-controlled \tendpoints that do
|
||||
not have the label “my_label”. \n \tNotSelector = \"has(my_label)\"
|
||||
matches packets that are not from Calico-controlled \tendpoints
|
||||
that do have the label “my_label”. \n The effect is that
|
||||
the latter will accept packets from non-Calico sources whereas
|
||||
the former is limited to packets from Calico-controlled
|
||||
endpoints."
|
||||
type: string
|
||||
serviceAccounts:
|
||||
description: ServiceAccounts is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from (or
|
||||
terminates at) a pod running as a matching service account.
|
||||
properties:
|
||||
names:
|
||||
description: Names is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from
|
||||
(or terminates at) a pod running as a service account
|
||||
whose name is in the list.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
selector:
|
||||
description: Selector is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from
|
||||
(or terminates at) a pod running as a service account
|
||||
that matches the given label selector. If both Names
|
||||
and Selector are specified then they are AND'ed.
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
required:
|
||||
- action
|
||||
type: object
|
||||
type: array
|
||||
ingress:
|
||||
description: The ordered set of ingress rules. Each rule contains a
|
||||
set of packet match criteria and a corresponding action to apply.
|
||||
items:
|
||||
description: "A Rule encapsulates a set of match criteria and an action.
|
||||
\ Both selector-based security Policy and security Profiles reference
|
||||
rules - separated out as a list of rules for both ingress and egress
|
||||
packet matching. \n Each positive match criteria has a negated version,
|
||||
prefixed with ”Not”. All the match criteria within a rule must be
|
||||
satisfied for a packet to match. A single rule can contain the positive
|
||||
and negative version of a match and both must be satisfied for the
|
||||
rule to match."
|
||||
properties:
|
||||
action:
|
||||
type: string
|
||||
destination:
|
||||
description: Destination contains the match criteria that apply
|
||||
to destination entity.
|
||||
properties:
|
||||
namespaceSelector:
|
||||
description: "NamespaceSelector is an optional field that
|
||||
contains a selector expression. Only traffic that originates
|
||||
from (or terminates at) endpoints within the selected namespaces
|
||||
will be matched. When both NamespaceSelector and Selector
|
||||
are defined on the same rule, then only workload endpoints
|
||||
that are matched by both selectors will be selected by the
|
||||
rule. \n For NetworkPolicy, an empty NamespaceSelector implies
|
||||
that the Selector is limited to selecting only workload
|
||||
endpoints in the same namespace as the NetworkPolicy. \n
|
||||
For GlobalNetworkPolicy, an empty NamespaceSelector implies
|
||||
the Selector applies to workload endpoints across all namespaces."
|
||||
type: string
|
||||
nets:
|
||||
description: Nets is an optional field that restricts the
|
||||
rule to only apply to traffic that originates from (or terminates
|
||||
at) IP addresses in any of the given subnets.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
notNets:
|
||||
description: NotNets is the negated version of the Nets field.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
notPorts:
|
||||
description: NotPorts is the negated version of the Ports
|
||||
field. Since only some protocols have ports, if any ports
|
||||
are specified it requires the Protocol match in the Rule
|
||||
to be set to "TCP" or "UDP".
|
||||
items:
|
||||
description: "Port represents either a range of numeric
|
||||
ports or a named port. \n - For a named port, set
|
||||
the PortName, leaving MinPort and MaxPort as 0. -
|
||||
For a port range, set MinPort and MaxPort to the (inclusive)
|
||||
port numbers. Set PortName to \"\". - For a
|
||||
single port, set MinPort = MaxPort and PortName = \"\"."
|
||||
x-kubernetes-int-or-string: true
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
type: array
|
||||
notSelector:
|
||||
description: NotSelector is the negated version of the Selector
|
||||
field. See Selector field for subtleties with negated selectors.
|
||||
type: string
|
||||
ports:
|
||||
description: "Ports is an optional field that restricts the
|
||||
rule to only apply to traffic that has a source (destination)
|
||||
port that matches one of these ranges/values. This value
|
||||
is a list of integers or strings that represent ranges of
|
||||
ports. \n Since only some protocols have ports, if any ports
|
||||
are specified it requires the Protocol match in the Rule
|
||||
to be set to \"TCP\" or \"UDP\"."
|
||||
items:
|
||||
description: "Port represents either a range of numeric
|
||||
ports or a named port. \n - For a named port, set
|
||||
the PortName, leaving MinPort and MaxPort as 0. -
|
||||
For a port range, set MinPort and MaxPort to the (inclusive)
|
||||
port numbers. Set PortName to \"\". - For a
|
||||
single port, set MinPort = MaxPort and PortName = \"\"."
|
||||
x-kubernetes-int-or-string: true
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
type: array
|
||||
selector:
|
||||
description: "Selector is an optional field that contains
|
||||
a selector expression (see Policy for sample syntax). Only
|
||||
traffic that originates from (terminates at) endpoints matching
|
||||
the selector will be matched. \n Note that: in addition
|
||||
to the negated version of the Selector (see NotSelector
|
||||
below), the selector expression syntax itself supports negation.
|
||||
\ The two types of negation are subtly different. One negates
|
||||
the set of matched endpoints, the other negates the whole
|
||||
match: \n \tSelector = \"!has(my_label)\" matches packets
|
||||
that are from other Calico-controlled \tendpoints that do
|
||||
not have the label “my_label”. \n \tNotSelector = \"has(my_label)\"
|
||||
matches packets that are not from Calico-controlled \tendpoints
|
||||
that do have the label “my_label”. \n The effect is that
|
||||
the latter will accept packets from non-Calico sources whereas
|
||||
the former is limited to packets from Calico-controlled
|
||||
endpoints."
|
||||
type: string
|
||||
serviceAccounts:
|
||||
description: ServiceAccounts is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from (or
|
||||
terminates at) a pod running as a matching service account.
|
||||
properties:
|
||||
names:
|
||||
description: Names is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from
|
||||
(or terminates at) a pod running as a service account
|
||||
whose name is in the list.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
selector:
|
||||
description: Selector is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from
|
||||
(or terminates at) a pod running as a service account
|
||||
that matches the given label selector. If both Names
|
||||
and Selector are specified then they are AND'ed.
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
http:
|
||||
description: HTTP contains match criteria that apply to HTTP requests.
|
||||
properties:
|
||||
methods:
|
||||
description: Methods is an optional field that restricts the
|
||||
rule to apply only to HTTP requests that use one of the
|
||||
listed HTTP Methods (e.g. GET, PUT, etc.) Multiple methods
|
||||
are OR'd together.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
paths:
|
||||
description: 'Paths is an optional field that restricts the
|
||||
rule to apply to HTTP requests that use one of the listed
|
||||
HTTP Paths. Multiple paths are OR''d together. e.g: - exact:
|
||||
/foo - prefix: /bar NOTE: Each entry may ONLY specify either
|
||||
a `exact` or a `prefix` match. The validator will check
|
||||
for it.'
|
||||
items:
|
||||
description: 'HTTPPath specifies an HTTP path to match.
|
||||
It may be either of the form: exact: <path>: which matches
|
||||
the path exactly or prefix: <path-prefix>: which matches
|
||||
the path prefix'
|
||||
properties:
|
||||
exact:
|
||||
type: string
|
||||
prefix:
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
icmp:
|
||||
description: ICMP is an optional field that restricts the rule
|
||||
to apply to a specific type and code of ICMP traffic. This
|
||||
should only be specified if the Protocol field is set to "ICMP"
|
||||
or "ICMPv6".
|
||||
properties:
|
||||
code:
|
||||
description: Match on a specific ICMP code. If specified,
|
||||
the Type value must also be specified. This is a technical
|
||||
limitation imposed by the kernel’s iptables firewall, which
|
||||
Calico uses to enforce the rule.
|
||||
type: integer
|
||||
type:
|
||||
description: Match on a specific ICMP type. For example a
|
||||
value of 8 refers to ICMP Echo Request (i.e. pings).
|
||||
type: integer
|
||||
type: object
|
||||
ipVersion:
|
||||
description: IPVersion is an optional field that restricts the
|
||||
rule to only match a specific IP version.
|
||||
type: integer
|
||||
notICMP:
|
||||
description: NotICMP is the negated version of the ICMP field.
|
||||
properties:
|
||||
code:
|
||||
description: Match on a specific ICMP code. If specified,
|
||||
the Type value must also be specified. This is a technical
|
||||
limitation imposed by the kernel’s iptables firewall, which
|
||||
Calico uses to enforce the rule.
|
||||
type: integer
|
||||
type:
|
||||
description: Match on a specific ICMP type. For example a
|
||||
value of 8 refers to ICMP Echo Request (i.e. pings).
|
||||
type: integer
|
||||
type: object
|
||||
notProtocol:
|
||||
description: NotProtocol is the negated version of the Protocol
|
||||
field.
|
||||
type: string
|
||||
protocol:
|
||||
description: "Protocol is an optional field that restricts the
|
||||
rule to only apply to traffic of a specific IP protocol. Required
|
||||
if any of the EntityRules contain Ports (because ports only
|
||||
apply to certain protocols). \n Must be one of these string
|
||||
values: \"TCP\", \"UDP\", \"ICMP\", \"ICMPv6\", \"SCTP\", \"UDPLite\"
|
||||
or an integer in the range 1-255."
|
||||
type: string
|
||||
source:
|
||||
description: Source contains the match criteria that apply to
|
||||
source entity.
|
||||
properties:
|
||||
namespaceSelector:
|
||||
description: "NamespaceSelector is an optional field that
|
||||
contains a selector expression. Only traffic that originates
|
||||
from (or terminates at) endpoints within the selected namespaces
|
||||
will be matched. When both NamespaceSelector and Selector
|
||||
are defined on the same rule, then only workload endpoints
|
||||
that are matched by both selectors will be selected by the
|
||||
rule. \n For NetworkPolicy, an empty NamespaceSelector implies
|
||||
that the Selector is limited to selecting only workload
|
||||
endpoints in the same namespace as the NetworkPolicy. \n
|
||||
For GlobalNetworkPolicy, an empty NamespaceSelector implies
|
||||
the Selector applies to workload endpoints across all namespaces."
|
||||
type: string
|
||||
nets:
|
||||
description: Nets is an optional field that restricts the
|
||||
rule to only apply to traffic that originates from (or terminates
|
||||
at) IP addresses in any of the given subnets.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
notNets:
|
||||
description: NotNets is the negated version of the Nets field.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
notPorts:
|
||||
description: NotPorts is the negated version of the Ports
|
||||
field. Since only some protocols have ports, if any ports
|
||||
are specified it requires the Protocol match in the Rule
|
||||
to be set to "TCP" or "UDP".
|
||||
items:
|
||||
description: "Port represents either a range of numeric
|
||||
ports or a named port. \n - For a named port, set
|
||||
the PortName, leaving MinPort and MaxPort as 0. -
|
||||
For a port range, set MinPort and MaxPort to the (inclusive)
|
||||
port numbers. Set PortName to \"\". - For a
|
||||
single port, set MinPort = MaxPort and PortName = \"\"."
|
||||
x-kubernetes-int-or-string: true
|
||||
type: object
|
||||
type: array
|
||||
notSelector:
|
||||
description: NotSelector is the negated version of the Selector
|
||||
field. See Selector field for subtleties with negated selectors.
|
||||
type: string
|
||||
ports:
|
||||
description: "Ports is an optional field that restricts the
|
||||
rule to only apply to traffic that has a source (destination)
|
||||
port that matches one of these ranges/values. This value
|
||||
is a list of integers or strings that represent ranges of
|
||||
ports. \n Since only some protocols have ports, if any ports
|
||||
are specified it requires the Protocol match in the Rule
|
||||
to be set to \"TCP\" or \"UDP\"."
|
||||
items:
|
||||
description: "Port represents either a range of numeric
|
||||
ports or a named port. \n - For a named port, set
|
||||
the PortName, leaving MinPort and MaxPort as 0. -
|
||||
For a port range, set MinPort and MaxPort to the (inclusive)
|
||||
port numbers. Set PortName to \"\". - For a
|
||||
single port, set MinPort = MaxPort and PortName = \"\"."
|
||||
x-kubernetes-int-or-string: true
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
type: object
|
||||
type: array
|
||||
selector:
|
||||
description: "Selector is an optional field that contains
|
||||
a selector expression (see Policy for sample syntax). Only
|
||||
traffic that originates from (terminates at) endpoints matching
|
||||
the selector will be matched. \n Note that: in addition
|
||||
to the negated version of the Selector (see NotSelector
|
||||
below), the selector expression syntax itself supports negation.
|
||||
\ The two types of negation are subtly different. One negates
|
||||
the set of matched endpoints, the other negates the whole
|
||||
match: \n \tSelector = \"!has(my_label)\" matches packets
|
||||
that are from other Calico-controlled \tendpoints that do
|
||||
not have the label “my_label”. \n \tNotSelector = \"has(my_label)\"
|
||||
matches packets that are not from Calico-controlled \tendpoints
|
||||
that do have the label “my_label”. \n The effect is that
|
||||
the latter will accept packets from non-Calico sources whereas
|
||||
the former is limited to packets from Calico-controlled
|
||||
endpoints."
|
||||
type: string
|
||||
serviceAccounts:
|
||||
description: ServiceAccounts is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from (or
|
||||
terminates at) a pod running as a matching service account.
|
||||
properties:
|
||||
names:
|
||||
description: Names is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from
|
||||
(or terminates at) a pod running as a service account
|
||||
whose name is in the list.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
selector:
|
||||
description: Selector is an optional field that restricts
|
||||
the rule to only apply to traffic that originates from
|
||||
(or terminates at) a pod running as a service account
|
||||
that matches the given label selector. If both Names
|
||||
and Selector are specified then they are AND'ed.
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
required:
|
||||
- action
|
||||
type: object
|
||||
type: array
|
||||
order:
|
||||
description: Order is an optional field that specifies the order in
|
||||
which the policy is applied. Policies with higher "order" are applied
|
||||
after those with lower order. If the order is omitted, it may be
|
||||
considered to be "infinite" - i.e. the policy will be applied last. Policies
|
||||
with identical order will be applied in alphanumerical order based
|
||||
on the Policy "Name".
|
||||
type: integer
|
||||
selector:
|
||||
description: "The selector is an expression used to pick pick out the
|
||||
endpoints that the policy should be applied to. \n Selector expressions
|
||||
follow this syntax: \n \tlabel == \"string_literal\" -> comparison,
|
||||
e.g. my_label == \"foo bar\" \tlabel != \"string_literal\" -> not
|
||||
equal; also matches if label is not present \tlabel in { \"a\", \"b\",
|
||||
\"c\", ... } -> true if the value of label X is one of \"a\", \"b\",
|
||||
\"c\" \tlabel not in { \"a\", \"b\", \"c\", ... } -> true if the
|
||||
value of label X is not one of \"a\", \"b\", \"c\" \thas(label_name)
|
||||
\ -> True if that label is present \t! expr -> negation of expr \texpr
|
||||
&& expr -> Short-circuit and \texpr || expr -> Short-circuit or
|
||||
\t( expr ) -> parens for grouping \tall() or the empty selector ->
|
||||
matches all endpoints. \n Label names are allowed to contain alphanumerics,
|
||||
-, _ and /. String literals are more permissive but they do not support
|
||||
escape characters. \n Examples (with made-up labels): \n \ttype ==
|
||||
\"webserver\" && deployment == \"prod\" \ttype in {\"frontend\", \"backend\"}
|
||||
\tdeployment != \"dev\" \t! has(label_name)"
|
||||
type: string
|
||||
types:
|
||||
description: "Types indicates whether this policy applies to ingress,
|
||||
or to egress, or to both. When not explicitly specified (and so the
|
||||
value on creation is empty or nil), Calico defaults Types according
|
||||
to what Ingress and Egress are present in the policy. The default
|
||||
is: \n - [ PolicyTypeIngress ], if there are no Egress rules (including
|
||||
the case where there are also no Ingress rules) \n - [ PolicyTypeEgress
|
||||
], if there are Egress rules but no Ingress rules \n - [ PolicyTypeIngress,
|
||||
PolicyTypeEgress ], if there are both Ingress and Egress rules. \n
|
||||
When the policy is read back again, Types will always be one of these
|
||||
values, never empty or nil."
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- selector
|
||||
type: object
|
||||
type: object
|
||||
version: v1alpha1
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
@@ -6,9 +6,13 @@ metadata:
|
||||
spec:
|
||||
group: network.kubesphere.io
|
||||
names:
|
||||
categories:
|
||||
- networking
|
||||
kind: WorkspaceNetworkPolicy
|
||||
plural: workspacenetworkpolicies
|
||||
scope: "Cluster"
|
||||
shortNames:
|
||||
- wsnp
|
||||
scope: Cluster
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: WorkspaceNetworkPolicy is a set of network policies applied to
|
||||
22
kustomize/network/kustomization.yaml
Normal file
22
kustomize/network/kustomization.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
resources:
|
||||
- network.yaml
|
||||
- crds/wsnp.yaml
|
||||
- crds/nsnp.yaml
|
||||
- rbac/role.yaml
|
||||
- rbac/role_binding.yaml
|
||||
|
||||
generatorOptions:
|
||||
disableNameSuffixHash: true
|
||||
|
||||
secretGenerator:
|
||||
- name: calico-etcd-secrets
|
||||
files:
|
||||
- etcd-ca=etcd/ca
|
||||
- etcd-key=etcd/key
|
||||
- etcd-cert=etcd/crt
|
||||
type: Opaque
|
||||
|
||||
patchesStrategicMerge:
|
||||
- patch_image_name.yaml
|
||||
|
||||
namespace: network-test-90fa3885
|
||||
57
kustomize/network/network.yaml
Normal file
57
kustomize/network/network.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: network-system
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: network-manager
|
||||
namespace: network-system
|
||||
labels:
|
||||
control-plane: network-manager
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
control-plane: network-manager
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
control-plane: network-manager
|
||||
spec:
|
||||
nodeSelector:
|
||||
node-role.kubernetes.io/master: ""
|
||||
hostNetwork: true
|
||||
tolerations:
|
||||
- key: "CriticalAddonsOnly"
|
||||
operator: "Exists"
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
effect: NoSchedule
|
||||
containers:
|
||||
- command:
|
||||
- /ks-network
|
||||
args:
|
||||
- -v=4
|
||||
- np-provider=calico
|
||||
image: network:latest
|
||||
imagePullPolicy: Always
|
||||
name: manager
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 30Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 20Mi
|
||||
volumeMounts:
|
||||
- mountPath: /calicocerts
|
||||
name: etcd-certs
|
||||
readOnly: true
|
||||
terminationGracePeriodSeconds: 10
|
||||
volumes:
|
||||
- name: etcd-certs
|
||||
secret:
|
||||
secretName: calico-etcd-secrets
|
||||
defaultMode: 0400
|
||||
12
kustomize/network/patch_image_name.yaml
Normal file
12
kustomize/network/patch_image_name.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: network-manager
|
||||
namespace: network-system
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
# Change the value of image field below to your controller image URL
|
||||
- image: magicsong/ks-network:90fa3885
|
||||
name: manager
|
||||
8
kustomize/network/patch_role_binding.yaml
Normal file
8
kustomize/network/patch_role_binding.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: manager-rolebinding
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: network-test-90fa3885
|
||||
30
kustomize/network/rbac/role.yaml
Normal file
30
kustomize/network/rbac/role.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: net-manager-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- network.kubesphere.io
|
||||
resources:
|
||||
- namespacenetworkpolicies
|
||||
- workspacenetworkpolicies
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- tenant.kubesphere.io
|
||||
resources:
|
||||
- workspaces
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
12
kustomize/network/rbac/role_binding.yaml
Normal file
12
kustomize/network/rbac/role_binding.yaml
Normal file
@@ -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: net-manager-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: network-system
|
||||
@@ -28,7 +28,8 @@ import (
|
||||
//go:generate go run ../../vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go -O openapi_generated -i ../../vendor/k8s.io/api/core/v1,../../vendor/k8s.io/apimachinery/pkg/apis/meta/v1,../../vendor/k8s.io/apimachinery/pkg/api/resource,../../vendor/k8s.io/api/networking/v1,../../vendor/k8s.io/apimachinery/pkg/runtime,../../vendor/k8s.io/apimachinery/pkg/util/intstr,k8s.io/apimachinery/pkg/version,./devops/v1alpha1 -p kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1 -h ../../hack/boilerplate.go.txt --report-filename ../../api/api-rules/violation_exceptions.list
|
||||
|
||||
// Generate deepcopy for apis
|
||||
//go:generate go run ../../vendor/k8s.io/code-generator/cmd/deepcopy-gen -i kubesphere.io/kubesphere/pkg/apis/... -h ../../hack/boilerplate.go.txt -O zz_generated.deepcopy
|
||||
|
||||
//go:generate ${GOPATH}/bin/deepcopy-gen -i kubesphere.io/kubesphere/pkg/apis/... -h ../../hack/boilerplate.go.txt -O zz_generated.deepcopy
|
||||
// AddToSchemes may be used to add all resources defined in the project to a Scheme
|
||||
var AddToSchemes runtime.SchemeBuilder
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by main. DO NOT EDIT.
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
170
pkg/apis/network/v1alpha1/common.go
Normal file
170
pkg/apis/network/v1alpha1/common.go
Normal file
@@ -0,0 +1,170 @@
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"kubesphere.io/kubesphere/pkg/apis/network/v1alpha1/numorstring"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
// A Rule encapsulates a set of match criteria and an action. Both selector-based security Policy
|
||||
// and security Profiles reference rules - separated out as a list of rules for both
|
||||
// ingress and egress packet matching.
|
||||
//
|
||||
// Each positive match criteria has a negated version, prefixed with ”Not”. All the match
|
||||
// criteria within a rule must be satisfied for a packet to match. A single rule can contain
|
||||
// the positive and negative version of a match and both must be satisfied for the rule to match.
|
||||
type Rule struct {
|
||||
Action Action `json:"action" validate:"action"`
|
||||
// IPVersion is an optional field that restricts the rule to only match a specific IP
|
||||
// version.
|
||||
IPVersion *int `json:"ipVersion,omitempty" validate:"omitempty,ipVersion"`
|
||||
// Protocol is an optional field that restricts the rule to only apply to traffic of
|
||||
// a specific IP protocol. Required if any of the EntityRules contain Ports
|
||||
// (because ports only apply to certain protocols).
|
||||
//
|
||||
// Must be one of these string values: "TCP", "UDP", "ICMP", "ICMPv6", "SCTP", "UDPLite"
|
||||
// or an integer in the range 1-255.
|
||||
Protocol *corev1.Protocol `json:"protocol,omitempty" validate:"omitempty"`
|
||||
// ICMP is an optional field that restricts the rule to apply to a specific type and
|
||||
// code of ICMP traffic. This should only be specified if the Protocol field is set to
|
||||
// "ICMP" or "ICMPv6".
|
||||
ICMP *ICMPFields `json:"icmp,omitempty" validate:"omitempty"`
|
||||
// NotProtocol is the negated version of the Protocol field.
|
||||
NotProtocol *corev1.Protocol `json:"notProtocol,omitempty" validate:"omitempty"`
|
||||
// NotICMP is the negated version of the ICMP field.
|
||||
NotICMP *ICMPFields `json:"notICMP,omitempty" validate:"omitempty"`
|
||||
// Source contains the match criteria that apply to source entity.
|
||||
Source EntityRule `json:"source,omitempty" validate:"omitempty"`
|
||||
// Destination contains the match criteria that apply to destination entity.
|
||||
Destination EntityRule `json:"destination,omitempty" validate:"omitempty"`
|
||||
|
||||
// HTTP contains match criteria that apply to HTTP requests.
|
||||
HTTP *HTTPMatch `json:"http,omitempty" validate:"omitempty"`
|
||||
}
|
||||
|
||||
// HTTPPath specifies an HTTP path to match. It may be either of the form:
|
||||
// exact: <path>: which matches the path exactly or
|
||||
// prefix: <path-prefix>: which matches the path prefix
|
||||
type HTTPPath struct {
|
||||
Exact string `json:"exact,omitempty" validate:"omitempty"`
|
||||
Prefix string `json:"prefix,omitempty" validate:"omitempty"`
|
||||
}
|
||||
|
||||
// HTTPMatch is an optional field that apply only to HTTP requests
|
||||
// The Methods and Path fields are joined with AND
|
||||
type HTTPMatch struct {
|
||||
// Methods is an optional field that restricts the rule to apply only to HTTP requests that use one of the listed
|
||||
// HTTP Methods (e.g. GET, PUT, etc.)
|
||||
// Multiple methods are OR'd together.
|
||||
Methods []string `json:"methods,omitempty" validate:"omitempty"`
|
||||
// Paths is an optional field that restricts the rule to apply to HTTP requests that use one of the listed
|
||||
// HTTP Paths.
|
||||
// Multiple paths are OR'd together.
|
||||
// e.g:
|
||||
// - exact: /foo
|
||||
// - prefix: /bar
|
||||
// NOTE: Each entry may ONLY specify either a `exact` or a `prefix` match. The validator will check for it.
|
||||
Paths []HTTPPath `json:"paths,omitempty" validate:"omitempty"`
|
||||
}
|
||||
|
||||
// ICMPFields defines structure for ICMP and NotICMP sub-struct for ICMP code and type
|
||||
type ICMPFields struct {
|
||||
// Match on a specific ICMP type. For example a value of 8 refers to ICMP Echo Request
|
||||
// (i.e. pings).
|
||||
Type *int `json:"type,omitempty" validate:"omitempty,gte=0,lte=254"`
|
||||
// Match on a specific ICMP code. If specified, the Type value must also be specified.
|
||||
// This is a technical limitation imposed by the kernel’s iptables firewall, which
|
||||
// Calico uses to enforce the rule.
|
||||
Code *int `json:"code,omitempty" validate:"omitempty,gte=0,lte=255"`
|
||||
}
|
||||
|
||||
// An EntityRule is a sub-component of a Rule comprising the match criteria specific
|
||||
// to a particular entity (that is either the source or destination).
|
||||
//
|
||||
// A source EntityRule matches the source endpoint and originating traffic.
|
||||
// A destination EntityRule matches the destination endpoint and terminating traffic.
|
||||
type EntityRule struct {
|
||||
// Nets is an optional field that restricts the rule to only apply to traffic that
|
||||
// originates from (or terminates at) IP addresses in any of the given subnets.
|
||||
Nets []string `json:"nets,omitempty" validate:"omitempty,dive,net"`
|
||||
|
||||
// Selector is an optional field that contains a selector expression (see Policy for
|
||||
// sample syntax). Only traffic that originates from (terminates at) endpoints matching
|
||||
// the selector will be matched.
|
||||
//
|
||||
// Note that: in addition to the negated version of the Selector (see NotSelector below), the
|
||||
// selector expression syntax itself supports negation. The two types of negation are subtly
|
||||
// different. One negates the set of matched endpoints, the other negates the whole match:
|
||||
//
|
||||
// Selector = "!has(my_label)" matches packets that are from other Calico-controlled
|
||||
// endpoints that do not have the label “my_label”.
|
||||
//
|
||||
// NotSelector = "has(my_label)" matches packets that are not from Calico-controlled
|
||||
// endpoints that do have the label “my_label”.
|
||||
//
|
||||
// The effect is that the latter will accept packets from non-Calico sources whereas the
|
||||
// former is limited to packets from Calico-controlled endpoints.
|
||||
Selector string `json:"selector,omitempty" validate:"omitempty,selector"`
|
||||
|
||||
// NamespaceSelector is an optional field that contains a selector expression. Only traffic
|
||||
// that originates from (or terminates at) endpoints within the selected namespaces will be
|
||||
// matched. When both NamespaceSelector and Selector are defined on the same rule, then only
|
||||
// workload endpoints that are matched by both selectors will be selected by the rule.
|
||||
//
|
||||
// For NetworkPolicy, an empty NamespaceSelector implies that the Selector is limited to selecting
|
||||
// only workload endpoints in the same namespace as the NetworkPolicy.
|
||||
//
|
||||
// For GlobalNetworkPolicy, an empty NamespaceSelector implies the Selector applies to workload
|
||||
// endpoints across all namespaces.
|
||||
NamespaceSelector string `json:"namespaceSelector,omitempty" validate:"omitempty,selector"`
|
||||
|
||||
// Ports is an optional field that restricts the rule to only apply to traffic that has a
|
||||
// source (destination) port that matches one of these ranges/values. This value is a
|
||||
// list of integers or strings that represent ranges of ports.
|
||||
//
|
||||
// Since only some protocols have ports, if any ports are specified it requires the
|
||||
// Protocol match in the Rule to be set to "TCP" or "UDP".
|
||||
Ports []numorstring.Port `json:"ports,omitempty" validate:"omitempty,dive"`
|
||||
|
||||
// NotNets is the negated version of the Nets field.
|
||||
NotNets []string `json:"notNets,omitempty" validate:"omitempty,dive,net"`
|
||||
|
||||
// NotSelector is the negated version of the Selector field. See Selector field for
|
||||
// subtleties with negated selectors.
|
||||
NotSelector string `json:"notSelector,omitempty" validate:"omitempty,selector"`
|
||||
|
||||
// NotPorts is the negated version of the Ports field.
|
||||
// Since only some protocols have ports, if any ports are specified it requires the
|
||||
// Protocol match in the Rule to be set to "TCP" or "UDP".
|
||||
NotPorts []numorstring.Port `json:"notPorts,omitempty" validate:"omitempty,dive"`
|
||||
|
||||
// ServiceAccounts is an optional field that restricts the rule to only apply to traffic that originates from (or
|
||||
// terminates at) a pod running as a matching service account.
|
||||
ServiceAccounts *ServiceAccountMatch `json:"serviceAccounts,omitempty" validate:"omitempty"`
|
||||
}
|
||||
|
||||
type ServiceAccountMatch struct {
|
||||
// Names is an optional field that restricts the rule to only apply to traffic that originates from (or terminates
|
||||
// at) a pod running as a service account whose name is in the list.
|
||||
Names []string `json:"names,omitempty" validate:"omitempty"`
|
||||
|
||||
// Selector is an optional field that restricts the rule to only apply to traffic that originates from
|
||||
// (or terminates at) a pod running as a service account that matches the given label selector.
|
||||
// If both Names and Selector are specified then they are AND'ed.
|
||||
Selector string `json:"selector,omitempty" validate:"omitempty,selector"`
|
||||
}
|
||||
|
||||
type Action string
|
||||
|
||||
const (
|
||||
Allow Action = "Allow"
|
||||
Deny = "Deny"
|
||||
Log = "Log"
|
||||
Pass = "Pass"
|
||||
)
|
||||
|
||||
type PolicyType string
|
||||
|
||||
const (
|
||||
PolicyTypeIngress PolicyType = "Ingress"
|
||||
PolicyTypeEgress PolicyType = "Egress"
|
||||
)
|
||||
108
pkg/apis/network/v1alpha1/namespacenetworkpolicy_types.go
Normal file
108
pkg/apis/network/v1alpha1/namespacenetworkpolicy_types.go
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
Copyright 2019 The KubeSphere 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 v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// All types in this file is copy from calicoapi as we use calico to policy
|
||||
|
||||
// NamespaceNetworkPolicySpec defines the desired state of NamespaceNetworkPolicy
|
||||
type NamespaceNetworkPolicySpec struct {
|
||||
// Order is an optional field that specifies the order in which the policy is applied.
|
||||
// Policies with higher "order" are applied after those with lower
|
||||
// order. If the order is omitted, it may be considered to be "infinite" - i.e. the
|
||||
// policy will be applied last. Policies with identical order will be applied in
|
||||
// alphanumerical order based on the Policy "Name".
|
||||
Order *int `json:"order,omitempty"`
|
||||
// The ordered set of ingress rules. Each rule contains a set of packet match criteria and
|
||||
// a corresponding action to apply.
|
||||
Ingress []Rule `json:"ingress,omitempty" validate:"omitempty,dive"`
|
||||
// The ordered set of egress rules. Each rule contains a set of packet match criteria and
|
||||
// a corresponding action to apply.
|
||||
Egress []Rule `json:"egress,omitempty" validate:"omitempty,dive"`
|
||||
// The selector is an expression used to pick pick out the endpoints that the policy should
|
||||
// be applied to.
|
||||
//
|
||||
// Selector expressions follow this syntax:
|
||||
//
|
||||
// label == "string_literal" -> comparison, e.g. my_label == "foo bar"
|
||||
// label != "string_literal" -> not equal; also matches if label is not present
|
||||
// label in { "a", "b", "c", ... } -> true if the value of label X is one of "a", "b", "c"
|
||||
// label not in { "a", "b", "c", ... } -> true if the value of label X is not one of "a", "b", "c"
|
||||
// has(label_name) -> True if that label is present
|
||||
// ! expr -> negation of expr
|
||||
// expr && expr -> Short-circuit and
|
||||
// expr || expr -> Short-circuit or
|
||||
// ( expr ) -> parens for grouping
|
||||
// all() or the empty selector -> matches all endpoints.
|
||||
//
|
||||
// Label names are allowed to contain alphanumerics, -, _ and /. String literals are more permissive
|
||||
// but they do not support escape characters.
|
||||
//
|
||||
// Examples (with made-up labels):
|
||||
//
|
||||
// type == "webserver" && deployment == "prod"
|
||||
// type in {"frontend", "backend"}
|
||||
// deployment != "dev"
|
||||
// ! has(label_name)
|
||||
Selector string `json:"selector" validate:"selector"`
|
||||
// Types indicates whether this policy applies to ingress, or to egress, or to both. When
|
||||
// not explicitly specified (and so the value on creation is empty or nil), Calico defaults
|
||||
// Types according to what Ingress and Egress are present in the policy. The
|
||||
// default is:
|
||||
//
|
||||
// - [ PolicyTypeIngress ], if there are no Egress rules (including the case where there are
|
||||
// also no Ingress rules)
|
||||
//
|
||||
// - [ PolicyTypeEgress ], if there are Egress rules but no Ingress rules
|
||||
//
|
||||
// - [ PolicyTypeIngress, PolicyTypeEgress ], if there are both Ingress and Egress rules.
|
||||
//
|
||||
// When the policy is read back again, Types will always be one of these values, never empty
|
||||
// or nil.
|
||||
Types []PolicyType `json:"types,omitempty" validate:"omitempty,dive,policyType"`
|
||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// NamespaceNetworkPolicy is the Schema for the namespacenetworkpolicies API
|
||||
// +k8s:openapi-gen=true
|
||||
// +kubebuilder:resource:categories="networking",shortName="nsnp"
|
||||
type NamespaceNetworkPolicy struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec NamespaceNetworkPolicySpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// NamespaceNetworkPolicyList contains a list of NamespaceNetworkPolicy
|
||||
type NamespaceNetworkPolicyList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []NamespaceNetworkPolicy `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&NamespaceNetworkPolicy{}, &NamespaceNetworkPolicyList{})
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Copyright 2019 The KubeSphere 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 v1alpha1
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/onsi/gomega"
|
||||
"golang.org/x/net/context"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
)
|
||||
|
||||
func TestStorageNamespaceNetworkPolicy(t *testing.T) {
|
||||
key := types.NamespacedName{
|
||||
Name: "foo",
|
||||
Namespace: "default",
|
||||
}
|
||||
created := &NamespaceNetworkPolicy{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "foo",
|
||||
Namespace: "default",
|
||||
}}
|
||||
g := gomega.NewGomegaWithT(t)
|
||||
|
||||
// Test Create
|
||||
fetched := &NamespaceNetworkPolicy{}
|
||||
g.Expect(c.Create(context.TODO(), created)).To(gomega.Succeed())
|
||||
|
||||
g.Expect(c.Get(context.TODO(), key, fetched)).To(gomega.Succeed())
|
||||
g.Expect(fetched).To(gomega.Equal(created))
|
||||
|
||||
// Test Updating the Labels
|
||||
updated := fetched.DeepCopy()
|
||||
updated.Labels = map[string]string{"hello": "world"}
|
||||
g.Expect(c.Update(context.TODO(), updated)).To(gomega.Succeed())
|
||||
|
||||
g.Expect(c.Get(context.TODO(), key, fetched)).To(gomega.Succeed())
|
||||
g.Expect(fetched).To(gomega.Equal(updated))
|
||||
|
||||
// Test Delete
|
||||
g.Expect(c.Delete(context.TODO(), fetched)).To(gomega.Succeed())
|
||||
g.Expect(c.Get(context.TODO(), key, fetched)).ToNot(gomega.Succeed())
|
||||
}
|
||||
73
pkg/apis/network/v1alpha1/numorstring/asnumber.go
Normal file
73
pkg/apis/network/v1alpha1/numorstring/asnumber.go
Normal file
@@ -0,0 +1,73 @@
|
||||
// Copyright (c) 2016 Tigera, Inc. All rights reserved.
|
||||
|
||||
// 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 numorstring
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type ASNumber uint32
|
||||
|
||||
// ASNumberFromString creates an ASNumber struct from a string value. The
|
||||
// string value may simply be a number or may be the ASN in dotted notation.
|
||||
func ASNumberFromString(s string) (ASNumber, error) {
|
||||
if num, err := strconv.ParseUint(s, 10, 32); err == nil {
|
||||
return ASNumber(num), nil
|
||||
}
|
||||
|
||||
parts := strings.Split(s, ".")
|
||||
if len(parts) != 2 {
|
||||
msg := fmt.Sprintf("invalid AS Number format (%s)", s)
|
||||
return 0, errors.New(msg)
|
||||
}
|
||||
|
||||
if num1, err := strconv.ParseUint(parts[0], 10, 16); err != nil {
|
||||
msg := fmt.Sprintf("invalid AS Number format (%s)", s)
|
||||
return 0, errors.New(msg)
|
||||
} else if num2, err := strconv.ParseUint(parts[1], 10, 16); err != nil {
|
||||
msg := fmt.Sprintf("invalid AS Number format (%s)", s)
|
||||
return 0, errors.New(msg)
|
||||
} else {
|
||||
return ASNumber((num1 << 16) + num2), nil
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller uinterface.
|
||||
func (a *ASNumber) UnmarshalJSON(b []byte) error {
|
||||
if err := json.Unmarshal(b, (*uint32)(a)); err == nil {
|
||||
return nil
|
||||
} else {
|
||||
var s string
|
||||
if err := json.Unmarshal(b, &s); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if v, err := ASNumberFromString(s); err != nil {
|
||||
return err
|
||||
} else {
|
||||
*a = v
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// String returns the string value, or the Itoa of the uint value.
|
||||
func (a ASNumber) String() string {
|
||||
return strconv.FormatUint(uint64(a), 10)
|
||||
}
|
||||
19
pkg/apis/network/v1alpha1/numorstring/doc.go
Normal file
19
pkg/apis/network/v1alpha1/numorstring/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
// Copyright (c) 2016 Tigera, Inc. All rights reserved.
|
||||
|
||||
// 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 numorstring implements a set of type definitions that in YAML or JSON
|
||||
format may be represented by either a number or a string.
|
||||
*/
|
||||
package numorstring
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved.
|
||||
|
||||
// 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 numorstring_test
|
||||
|
||||
import (
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNumorstring(t *testing.T) {
|
||||
RegisterFailHandler(Fail)
|
||||
RunSpecs(t, "Numorstring Suite")
|
||||
}
|
||||
204
pkg/apis/network/v1alpha1/numorstring/numorstring_test.go
Normal file
204
pkg/apis/network/v1alpha1/numorstring/numorstring_test.go
Normal file
@@ -0,0 +1,204 @@
|
||||
// Copyright (c) 2016-2017 Tigera, Inc. All rights reserved.
|
||||
|
||||
// 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 numorstring_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
. "github.com/onsi/ginkgo/extensions/table"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/projectcalico/libcalico-go/lib/numorstring"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
asNumberType := reflect.TypeOf(numorstring.ASNumber(0))
|
||||
protocolType := reflect.TypeOf(numorstring.Protocol{})
|
||||
portType := reflect.TypeOf(numorstring.Port{})
|
||||
|
||||
// Perform tests of JSON unmarshaling of the various field types.
|
||||
DescribeTable("NumOrStringJSONUnmarshaling",
|
||||
func(jtext string, typ reflect.Type, expected interface{}) {
|
||||
// Create a new field type and invoke the unmarshaller interface
|
||||
// directly (this covers a couple more error cases than calling
|
||||
// through json.Unmarshal.
|
||||
new := reflect.New(typ)
|
||||
u := new.Interface().(json.Unmarshaler)
|
||||
err := u.UnmarshalJSON([]byte(jtext))
|
||||
|
||||
if expected != nil {
|
||||
Expect(err).To(BeNil(),
|
||||
"expected json unmarshal to not error")
|
||||
Expect(new.Elem().Interface()).To(Equal(expected),
|
||||
"expected value not same as json unmarshalled value")
|
||||
} else {
|
||||
Expect(err).ToNot(BeNil(),
|
||||
"expected json unmarshal to error")
|
||||
}
|
||||
},
|
||||
// ASNumber tests.
|
||||
Entry("should accept 0 AS number as int", "0", asNumberType, numorstring.ASNumber(0)),
|
||||
Entry("should accept 4294967295 AS number as int", "4294967295", asNumberType, numorstring.ASNumber(4294967295)),
|
||||
Entry("should accept 0 AS number as string", "\"0\"", asNumberType, numorstring.ASNumber(0)),
|
||||
Entry("should accept 4294967295 AS number as string", "\"4294967295\"", asNumberType, numorstring.ASNumber(4294967295)),
|
||||
Entry("should accept 1.10 AS number as string", "\"1.10\"", asNumberType, numorstring.ASNumber(65546)),
|
||||
Entry("should accept 00.00 AS number as string", "\"00.00\"", asNumberType, numorstring.ASNumber(0)),
|
||||
Entry("should accept 00.01 AS number as string", "\"00.01\"", asNumberType, numorstring.ASNumber(1)),
|
||||
Entry("should accept 65535.65535 AS number as string", "\"65535.65535\"", asNumberType, numorstring.ASNumber(4294967295)),
|
||||
Entry("should reject 1.1.1 AS number as string", "\"1.1.1\"", asNumberType, nil),
|
||||
Entry("should reject 65536.65535 AS number as string", "\"65536.65535\"", asNumberType, nil),
|
||||
Entry("should reject 65535.65536 AS number as string", "\"65535.65536\"", asNumberType, nil),
|
||||
Entry("should reject 0.-1 AS number as string", "\"0.-1\"", asNumberType, nil),
|
||||
Entry("should reject -1 AS number as int", "-1", asNumberType, nil),
|
||||
Entry("should reject 4294967296 AS number as int", "4294967296", asNumberType, nil),
|
||||
|
||||
// Port tests.
|
||||
Entry("should accept 0 port as int", "0", portType, numorstring.SinglePort(0)),
|
||||
Entry("should accept 65535 port as int", "65535", portType, numorstring.SinglePort(65535)),
|
||||
Entry("should accept 0:65535 port range as string", "\"0:65535\"", portType, portFromRange(0, 65535)),
|
||||
Entry("should accept 1:10 port range as string", "\"1:10\"", portType, portFromRange(1, 10)),
|
||||
Entry("should accept foo-bar as named port", "\"foo-bar\"", portType, numorstring.NamedPort("foo-bar")),
|
||||
Entry("should reject -1 port as int", "-1", portType, nil),
|
||||
Entry("should reject 65536 port as int", "65536", portType, nil),
|
||||
Entry("should reject 0:65536 port range as string", "\"0:65536\"", portType, nil),
|
||||
Entry("should reject -1:65535 port range as string", "\"-1:65535\"", portType, nil),
|
||||
Entry("should reject 10:1 port range as string", "\"10:1\"", portType, nil),
|
||||
Entry("should reject 1:2:3 port range as string", "\"1:2:3\"", portType, nil),
|
||||
Entry("should reject bad named port string", "\"*\"", portType, nil),
|
||||
Entry("should reject bad port string", "\"1:2", portType, nil),
|
||||
|
||||
// Protocol tests. Invalid integer values will be stored as strings.
|
||||
Entry("should accept 0 protocol as int", "0", protocolType, numorstring.ProtocolFromInt(0)),
|
||||
Entry("should accept 255 protocol as int", "255", protocolType, numorstring.ProtocolFromInt(255)),
|
||||
Entry("should accept tcp protocol as string", "\"TCP\"", protocolType, numorstring.ProtocolFromString("TCP")),
|
||||
Entry("should accept tcp protocol as string", "\"TCP\"", protocolType, numorstring.ProtocolFromString("TCP")),
|
||||
Entry("should accept 0 protocol as string", "\"0\"", protocolType, numorstring.ProtocolFromInt(0)),
|
||||
Entry("should accept 0 protocol as string", "\"255\"", protocolType, numorstring.ProtocolFromInt(255)),
|
||||
Entry("should accept 256 protocol as string", "\"256\"", protocolType, numorstring.ProtocolFromString("256")),
|
||||
Entry("should reject bad protocol string", "\"25", protocolType, nil),
|
||||
)
|
||||
|
||||
// Perform tests of JSON marshaling of the various field types.
|
||||
DescribeTable("NumOrStringJSONMarshaling",
|
||||
func(field interface{}, jtext string) {
|
||||
b, err := json.Marshal(field)
|
||||
if jtext != "" {
|
||||
Expect(err).To(BeNil(),
|
||||
"expected json marshal to not error")
|
||||
Expect(string(b)).To(Equal(jtext),
|
||||
"expected json not same as marshalled value")
|
||||
} else {
|
||||
Expect(err).ToNot(BeNil(),
|
||||
"expected json marshal to error")
|
||||
}
|
||||
},
|
||||
// ASNumber tests.
|
||||
Entry("should marshal ASN of 0", numorstring.ASNumber(0), "0"),
|
||||
Entry("should marshal ASN of 4294967295", numorstring.ASNumber(4294967295), "4294967295"),
|
||||
|
||||
// Port tests.
|
||||
Entry("should marshal port of 0", numorstring.SinglePort(0), "0"),
|
||||
Entry("should marshal port of 65535", portFromRange(65535, 65535), "65535"),
|
||||
Entry("should marshal port of 10", portFromString("10"), "10"),
|
||||
Entry("should marshal port range of 10:20", portFromRange(10, 20), "\"10:20\""),
|
||||
Entry("should marshal port range of 20:30", portFromRange(20, 30), "\"20:30\""),
|
||||
Entry("should marshal named port", numorstring.NamedPort("foobar"), `"foobar"`),
|
||||
|
||||
// Protocol tests.
|
||||
Entry("should marshal protocol of 0", numorstring.ProtocolFromInt(0), "0"),
|
||||
Entry("should marshal protocol of udp", numorstring.ProtocolFromString("UDP"), "\"UDP\""),
|
||||
)
|
||||
|
||||
// Perform tests of Stringer interface various field types.
|
||||
DescribeTable("NumOrStringStringify",
|
||||
func(field interface{}, s string) {
|
||||
a := fmt.Sprint(field)
|
||||
Expect(a).To(Equal(s),
|
||||
"expected String() value to match")
|
||||
},
|
||||
// ASNumber tests.
|
||||
Entry("should stringify ASN of 0", numorstring.ASNumber(0), "0"),
|
||||
Entry("should stringify ASN of 4294967295", numorstring.ASNumber(4294967295), "4294967295"),
|
||||
|
||||
// Port tests.
|
||||
Entry("should stringify port of 20", numorstring.SinglePort(20), "20"),
|
||||
Entry("should stringify port range of 10:20", portFromRange(10, 20), "10:20"),
|
||||
|
||||
// Protocol tests.
|
||||
Entry("should stringify protocol of 0", numorstring.ProtocolFromInt(0), "0"),
|
||||
Entry("should stringify protocol of udp", numorstring.ProtocolFromString("UDP"), "UDP"),
|
||||
)
|
||||
|
||||
// Perform tests of Protocols supporting ports.
|
||||
DescribeTable("NumOrStringProtocolsSupportingPorts",
|
||||
func(protocol numorstring.Protocol, supportsPorts bool) {
|
||||
Expect(protocol.SupportsPorts()).To(Equal(supportsPorts),
|
||||
"expected protocol port support to match")
|
||||
},
|
||||
Entry("protocol 6 supports ports", numorstring.ProtocolFromInt(6), true),
|
||||
Entry("protocol 17 supports ports", numorstring.ProtocolFromInt(17), true),
|
||||
Entry("protocol udp supports ports", numorstring.ProtocolFromString("UDP"), true),
|
||||
Entry("protocol udp supports ports", numorstring.ProtocolFromString("TCP"), true),
|
||||
Entry("protocol foo does not support ports", numorstring.ProtocolFromString("foo"), false),
|
||||
Entry("protocol 2 does not support ports", numorstring.ProtocolFromInt(2), false),
|
||||
)
|
||||
|
||||
// Perform tests of Protocols FromString method.
|
||||
DescribeTable("NumOrStringProtocols FromString is not case sensitive",
|
||||
func(input, expected string) {
|
||||
Expect(numorstring.ProtocolFromString(input).StrVal).To(Equal(expected),
|
||||
"expected parsed protocol to match")
|
||||
},
|
||||
Entry("protocol udp -> UDP", "udp", "UDP"),
|
||||
Entry("protocol tcp -> TCP", "tcp", "TCP"),
|
||||
Entry("protocol updlite -> UDPLite", "udplite", "UDPLite"),
|
||||
Entry("unknown protocol xxxXXX", "xxxXXX", "xxxXXX"),
|
||||
)
|
||||
|
||||
// Perform tests of Protocols FromStringV1 method.
|
||||
DescribeTable("NumOrStringProtocols FromStringV1 is lowercase",
|
||||
func(input, expected string) {
|
||||
Expect(numorstring.ProtocolFromStringV1(input).StrVal).To(Equal(expected),
|
||||
"expected parsed protocol to match")
|
||||
},
|
||||
Entry("protocol udp -> UDP", "UDP", "udp"),
|
||||
Entry("protocol tcp -> TCP", "TCP", "tcp"),
|
||||
Entry("protocol updlite -> UDPLite", "UDPLite", "udplite"),
|
||||
Entry("unknown protocol xxxXXX", "xxxXXX", "xxxxxx"),
|
||||
)
|
||||
|
||||
// Perform tests of Protocols ToV1 method.
|
||||
DescribeTable("NumOrStringProtocols FromStringV1 is lowercase",
|
||||
func(input, expected numorstring.Protocol) {
|
||||
Expect(input.ToV1()).To(Equal(expected),
|
||||
"expected parsed protocol to match")
|
||||
},
|
||||
// Protocol tests.
|
||||
Entry("protocol udp -> UDP", numorstring.ProtocolFromInt(2), numorstring.ProtocolFromInt(2)),
|
||||
Entry("protocol tcp -> TCP", numorstring.ProtocolFromString("TCP"), numorstring.ProtocolFromStringV1("TCP")),
|
||||
)
|
||||
}
|
||||
|
||||
func portFromRange(minPort, maxPort uint16) numorstring.Port {
|
||||
p, _ := numorstring.PortFromRange(minPort, maxPort)
|
||||
return p
|
||||
}
|
||||
|
||||
func portFromString(s string) numorstring.Port {
|
||||
p, _ := numorstring.PortFromString(s)
|
||||
return p
|
||||
}
|
||||
144
pkg/apis/network/v1alpha1/numorstring/port.go
Normal file
144
pkg/apis/network/v1alpha1/numorstring/port.go
Normal file
@@ -0,0 +1,144 @@
|
||||
// Copyright (c) 2016-2017 Tigera, Inc. All rights reserved.
|
||||
//
|
||||
// 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 numorstring
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Port represents either a range of numeric ports or a named port.
|
||||
//
|
||||
// - For a named port, set the PortName, leaving MinPort and MaxPort as 0.
|
||||
// - For a port range, set MinPort and MaxPort to the (inclusive) port numbers. Set
|
||||
// PortName to "".
|
||||
// - For a single port, set MinPort = MaxPort and PortName = "".
|
||||
type Port struct {
|
||||
MinPort uint16 `json:"minPort,omitempty"`
|
||||
MaxPort uint16 `json:"maxPort,omitempty"`
|
||||
PortName string `validate:"omitempty,portName" json:"portName,omitempty"`
|
||||
}
|
||||
|
||||
// SinglePort creates a Port struct representing a single port.
|
||||
func SinglePort(port uint16) Port {
|
||||
return Port{MinPort: port, MaxPort: port}
|
||||
}
|
||||
|
||||
func NamedPort(name string) Port {
|
||||
return Port{PortName: name}
|
||||
}
|
||||
|
||||
// PortFromRange creates a Port struct representing a range of ports.
|
||||
func PortFromRange(minPort, maxPort uint16) (Port, error) {
|
||||
port := Port{MinPort: minPort, MaxPort: maxPort}
|
||||
if minPort > maxPort {
|
||||
msg := fmt.Sprintf("minimum port number (%d) is greater than maximum port number (%d) in port range", minPort, maxPort)
|
||||
return port, errors.New(msg)
|
||||
}
|
||||
return port, nil
|
||||
}
|
||||
|
||||
var (
|
||||
allDigits = regexp.MustCompile(`^\d+$`)
|
||||
portRange = regexp.MustCompile(`^(\d+):(\d+)$`)
|
||||
nameRegex = regexp.MustCompile("^[a-zA-Z0-9_.-]{1,128}$")
|
||||
)
|
||||
|
||||
// PortFromString creates a Port struct from its string representation. A port
|
||||
// may either be single value "1234", a range of values "100:200" or a named port: "name".
|
||||
func PortFromString(s string) (Port, error) {
|
||||
if allDigits.MatchString(s) {
|
||||
// Port is all digits, it should parse as a single port.
|
||||
num, err := strconv.ParseUint(s, 10, 16)
|
||||
if err != nil {
|
||||
msg := fmt.Sprintf("invalid port format (%s)", s)
|
||||
return Port{}, errors.New(msg)
|
||||
}
|
||||
return SinglePort(uint16(num)), nil
|
||||
}
|
||||
|
||||
if groups := portRange.FindStringSubmatch(s); len(groups) > 0 {
|
||||
// Port matches <digits>:<digits>, it should parse as a range of ports.
|
||||
if pmin, err := strconv.ParseUint(groups[1], 10, 16); err != nil {
|
||||
msg := fmt.Sprintf("invalid minimum port number in range (%s)", s)
|
||||
return Port{}, errors.New(msg)
|
||||
} else if pmax, err := strconv.ParseUint(groups[2], 10, 16); err != nil {
|
||||
msg := fmt.Sprintf("invalid maximum port number in range (%s)", s)
|
||||
return Port{}, errors.New(msg)
|
||||
} else {
|
||||
return PortFromRange(uint16(pmin), uint16(pmax))
|
||||
}
|
||||
}
|
||||
|
||||
if !nameRegex.MatchString(s) {
|
||||
msg := fmt.Sprintf("invalid name for named port (%s)", s)
|
||||
return Port{}, errors.New(msg)
|
||||
}
|
||||
|
||||
return NamedPort(s), nil
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface.
|
||||
func (p *Port) UnmarshalJSON(b []byte) error {
|
||||
if b[0] == '"' {
|
||||
var s string
|
||||
if err := json.Unmarshal(b, &s); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if v, err := PortFromString(s); err != nil {
|
||||
return err
|
||||
} else {
|
||||
*p = v
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// It's not a string, it must be a single int.
|
||||
var i uint16
|
||||
if err := json.Unmarshal(b, &i); err != nil {
|
||||
return err
|
||||
}
|
||||
v := SinglePort(i)
|
||||
*p = v
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface.
|
||||
func (p Port) MarshalJSON() ([]byte, error) {
|
||||
if p.PortName != "" {
|
||||
return json.Marshal(p.PortName)
|
||||
} else if p.MinPort == p.MaxPort {
|
||||
return json.Marshal(p.MinPort)
|
||||
} else {
|
||||
return json.Marshal(p.String())
|
||||
}
|
||||
}
|
||||
|
||||
// String returns the string value. If the min and max port are the same
|
||||
// this returns a single string representation of the port number, otherwise
|
||||
// if returns a colon separated range of ports.
|
||||
func (p Port) String() string {
|
||||
if p.PortName != "" {
|
||||
return p.PortName
|
||||
} else if p.MinPort == p.MaxPort {
|
||||
return strconv.FormatUint(uint64(p.MinPort), 10)
|
||||
} else {
|
||||
return fmt.Sprintf("%d:%d", p.MinPort, p.MaxPort)
|
||||
}
|
||||
}
|
||||
134
pkg/apis/network/v1alpha1/numorstring/protocol.go
Normal file
134
pkg/apis/network/v1alpha1/numorstring/protocol.go
Normal file
@@ -0,0 +1,134 @@
|
||||
// Copyright (c) 2016 Tigera, Inc. All rights reserved.
|
||||
|
||||
// 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 numorstring
|
||||
|
||||
import "strings"
|
||||
|
||||
const (
|
||||
ProtocolUDP = "UDP"
|
||||
ProtocolTCP = "TCP"
|
||||
ProtocolICMP = "ICMP"
|
||||
ProtocolICMPv6 = "ICMPv6"
|
||||
ProtocolSCTP = "SCTP"
|
||||
ProtocolUDPLite = "UDPLite"
|
||||
|
||||
ProtocolUDPV1 = "udp"
|
||||
ProtocolTCPV1 = "tcp"
|
||||
)
|
||||
|
||||
var (
|
||||
allProtocolNames = []string{
|
||||
ProtocolUDP,
|
||||
ProtocolTCP,
|
||||
ProtocolICMP,
|
||||
ProtocolICMPv6,
|
||||
ProtocolSCTP,
|
||||
ProtocolUDPLite,
|
||||
}
|
||||
)
|
||||
|
||||
type Protocol Uint8OrString
|
||||
|
||||
// ProtocolFromInt creates a Protocol struct from an integer value.
|
||||
func ProtocolFromInt(p uint8) Protocol {
|
||||
return Protocol(
|
||||
Uint8OrString{Type: NumOrStringNum, NumVal: p},
|
||||
)
|
||||
}
|
||||
|
||||
// ProtocolV3FromProtocolV1 creates a v3 Protocol from a v1 Protocol,
|
||||
// while handling case conversion.
|
||||
func ProtocolV3FromProtocolV1(p Protocol) Protocol {
|
||||
if p.Type == NumOrStringNum {
|
||||
return p
|
||||
}
|
||||
|
||||
for _, n := range allProtocolNames {
|
||||
if strings.ToLower(n) == strings.ToLower(p.StrVal) {
|
||||
return Protocol(
|
||||
Uint8OrString{Type: NumOrStringString, StrVal: n},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return p
|
||||
}
|
||||
|
||||
// ProtocolFromString creates a Protocol struct from a string value.
|
||||
func ProtocolFromString(p string) Protocol {
|
||||
for _, n := range allProtocolNames {
|
||||
if strings.ToLower(n) == strings.ToLower(p) {
|
||||
return Protocol(
|
||||
Uint8OrString{Type: NumOrStringString, StrVal: n},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Unknown protocol - return the value unchanged. Validation should catch this.
|
||||
return Protocol(
|
||||
Uint8OrString{Type: NumOrStringString, StrVal: p},
|
||||
)
|
||||
}
|
||||
|
||||
// ProtocolFromStringV1 creates a Protocol struct from a string value (for the v1 API)
|
||||
func ProtocolFromStringV1(p string) Protocol {
|
||||
return Protocol(
|
||||
Uint8OrString{Type: NumOrStringString, StrVal: strings.ToLower(p)},
|
||||
)
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface.
|
||||
func (p *Protocol) UnmarshalJSON(b []byte) error {
|
||||
return (*Uint8OrString)(p).UnmarshalJSON(b)
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface.
|
||||
func (p Protocol) MarshalJSON() ([]byte, error) {
|
||||
return Uint8OrString(p).MarshalJSON()
|
||||
}
|
||||
|
||||
// String returns the string value, or the Itoa of the int value.
|
||||
func (p Protocol) String() string {
|
||||
return (Uint8OrString)(p).String()
|
||||
}
|
||||
|
||||
// String returns the string value, or the Itoa of the int value.
|
||||
func (p Protocol) ToV1() Protocol {
|
||||
if p.Type == NumOrStringNum {
|
||||
return p
|
||||
}
|
||||
return ProtocolFromStringV1(p.StrVal)
|
||||
}
|
||||
|
||||
// NumValue returns the NumVal if type Int, or if
|
||||
// it is a String, will attempt a conversion to int.
|
||||
func (p Protocol) NumValue() (uint8, error) {
|
||||
return (Uint8OrString)(p).NumValue()
|
||||
}
|
||||
|
||||
// SupportsProtocols returns whether this protocol supports ports. This returns true if
|
||||
// the numerical or string verion of the protocol indicates TCP (6) or UDP (17).
|
||||
func (p Protocol) SupportsPorts() bool {
|
||||
num, err := p.NumValue()
|
||||
if err == nil {
|
||||
return num == 6 || num == 17
|
||||
} else {
|
||||
switch p.StrVal {
|
||||
case ProtocolTCP, ProtocolUDP, ProtocolTCPV1, ProtocolUDPV1:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
23
pkg/apis/network/v1alpha1/numorstring/type.go
Normal file
23
pkg/apis/network/v1alpha1/numorstring/type.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright (c) 2016 Tigera, Inc. All rights reserved.
|
||||
|
||||
// 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 numorstring
|
||||
|
||||
// Type represents the stored type of Int32OrString.
|
||||
type NumOrStringType int
|
||||
|
||||
const (
|
||||
NumOrStringNum NumOrStringType = iota // The structure holds a number.
|
||||
NumOrStringString // The structure holds a string.
|
||||
)
|
||||
80
pkg/apis/network/v1alpha1/numorstring/uint8orstring.go
Normal file
80
pkg/apis/network/v1alpha1/numorstring/uint8orstring.go
Normal file
@@ -0,0 +1,80 @@
|
||||
// Copyright (c) 2016 Tigera, Inc. All rights reserved.
|
||||
|
||||
// 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 numorstring
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// UInt8OrString is a type that can hold an uint8 or a string. When used in
|
||||
// JSON or YAML marshalling and unmarshalling, it produces or consumes the
|
||||
// inner type. This allows you to have, for example, a JSON field that can
|
||||
// accept a name or number.
|
||||
type Uint8OrString struct {
|
||||
Type NumOrStringType
|
||||
NumVal uint8
|
||||
StrVal string
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaller interface.
|
||||
func (i *Uint8OrString) UnmarshalJSON(b []byte) error {
|
||||
if b[0] == '"' {
|
||||
var s string
|
||||
if err := json.Unmarshal(b, &s); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
num, err := strconv.ParseUint(s, 10, 8)
|
||||
if err == nil {
|
||||
i.Type = NumOrStringNum
|
||||
i.NumVal = uint8(num)
|
||||
} else {
|
||||
i.Type = NumOrStringString
|
||||
i.StrVal = s
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
i.Type = NumOrStringNum
|
||||
return json.Unmarshal(b, &i.NumVal)
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface.
|
||||
func (i Uint8OrString) MarshalJSON() ([]byte, error) {
|
||||
if num, err := i.NumValue(); err == nil {
|
||||
return json.Marshal(num)
|
||||
} else {
|
||||
return json.Marshal(i.StrVal)
|
||||
}
|
||||
}
|
||||
|
||||
// String returns the string value, or the Itoa of the int value.
|
||||
func (i Uint8OrString) String() string {
|
||||
if i.Type == NumOrStringString {
|
||||
return i.StrVal
|
||||
}
|
||||
return strconv.FormatUint(uint64(i.NumVal), 10)
|
||||
}
|
||||
|
||||
// NumValue returns the NumVal if type Int, or if
|
||||
// it is a String, will attempt a conversion to int.
|
||||
func (i Uint8OrString) NumValue() (uint8, error) {
|
||||
if i.Type == NumOrStringString {
|
||||
num, err := strconv.ParseUint(i.StrVal, 10, 8)
|
||||
return uint8(num), err
|
||||
}
|
||||
return i.NumVal, nil
|
||||
}
|
||||
@@ -33,7 +33,7 @@ var c client.Client
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
t := &envtest.Environment{
|
||||
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "config", "crds")},
|
||||
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "kustomize", "network", "crds")},
|
||||
}
|
||||
|
||||
err := SchemeBuilder.AddToScheme(scheme.Scheme)
|
||||
|
||||
@@ -75,6 +75,7 @@ type WorkspaceNetworkPolicyStatus struct {
|
||||
|
||||
// WorkspaceNetworkPolicy is a set of network policies applied to the scope to workspace
|
||||
// +k8s:openapi-gen=true
|
||||
// +kubebuilder:resource:categories="networking",scope="Cluster",shortName="wsnp"
|
||||
type WorkspaceNetworkPolicy struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
288
pkg/apis/network/v1alpha1/zz_generated.deepcopy.go
generated
288
pkg/apis/network/v1alpha1/zz_generated.deepcopy.go
generated
@@ -16,16 +16,287 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by main. DO NOT EDIT.
|
||||
// autogenerated by controller-gen object, do not modify manually
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/networking/v1"
|
||||
"k8s.io/api/core/v1"
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
"kubesphere.io/kubesphere/pkg/apis/network/v1alpha1/numorstring"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EntityRule) DeepCopyInto(out *EntityRule) {
|
||||
*out = *in
|
||||
if in.Nets != nil {
|
||||
in, out := &in.Nets, &out.Nets
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Ports != nil {
|
||||
in, out := &in.Ports, &out.Ports
|
||||
*out = make([]numorstring.Port, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.NotNets != nil {
|
||||
in, out := &in.NotNets, &out.NotNets
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.NotPorts != nil {
|
||||
in, out := &in.NotPorts, &out.NotPorts
|
||||
*out = make([]numorstring.Port, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.ServiceAccounts != nil {
|
||||
in, out := &in.ServiceAccounts, &out.ServiceAccounts
|
||||
*out = new(ServiceAccountMatch)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EntityRule.
|
||||
func (in *EntityRule) DeepCopy() *EntityRule {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(EntityRule)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HTTPMatch) DeepCopyInto(out *HTTPMatch) {
|
||||
*out = *in
|
||||
if in.Methods != nil {
|
||||
in, out := &in.Methods, &out.Methods
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Paths != nil {
|
||||
in, out := &in.Paths, &out.Paths
|
||||
*out = make([]HTTPPath, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPMatch.
|
||||
func (in *HTTPMatch) DeepCopy() *HTTPMatch {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HTTPMatch)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *HTTPPath) DeepCopyInto(out *HTTPPath) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPPath.
|
||||
func (in *HTTPPath) DeepCopy() *HTTPPath {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(HTTPPath)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ICMPFields) DeepCopyInto(out *ICMPFields) {
|
||||
*out = *in
|
||||
if in.Type != nil {
|
||||
in, out := &in.Type, &out.Type
|
||||
*out = new(int)
|
||||
**out = **in
|
||||
}
|
||||
if in.Code != nil {
|
||||
in, out := &in.Code, &out.Code
|
||||
*out = new(int)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ICMPFields.
|
||||
func (in *ICMPFields) DeepCopy() *ICMPFields {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ICMPFields)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NamespaceNetworkPolicy) DeepCopyInto(out *NamespaceNetworkPolicy) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceNetworkPolicy.
|
||||
func (in *NamespaceNetworkPolicy) DeepCopy() *NamespaceNetworkPolicy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NamespaceNetworkPolicy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *NamespaceNetworkPolicy) 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 *NamespaceNetworkPolicyList) DeepCopyInto(out *NamespaceNetworkPolicyList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]NamespaceNetworkPolicy, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceNetworkPolicyList.
|
||||
func (in *NamespaceNetworkPolicyList) DeepCopy() *NamespaceNetworkPolicyList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NamespaceNetworkPolicyList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *NamespaceNetworkPolicyList) 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 *NamespaceNetworkPolicySpec) DeepCopyInto(out *NamespaceNetworkPolicySpec) {
|
||||
*out = *in
|
||||
if in.Order != nil {
|
||||
in, out := &in.Order, &out.Order
|
||||
*out = new(int)
|
||||
**out = **in
|
||||
}
|
||||
if in.Ingress != nil {
|
||||
in, out := &in.Ingress, &out.Ingress
|
||||
*out = make([]Rule, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Egress != nil {
|
||||
in, out := &in.Egress, &out.Egress
|
||||
*out = make([]Rule, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Types != nil {
|
||||
in, out := &in.Types, &out.Types
|
||||
*out = make([]PolicyType, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceNetworkPolicySpec.
|
||||
func (in *NamespaceNetworkPolicySpec) DeepCopy() *NamespaceNetworkPolicySpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NamespaceNetworkPolicySpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Rule) DeepCopyInto(out *Rule) {
|
||||
*out = *in
|
||||
if in.IPVersion != nil {
|
||||
in, out := &in.IPVersion, &out.IPVersion
|
||||
*out = new(int)
|
||||
**out = **in
|
||||
}
|
||||
if in.Protocol != nil {
|
||||
in, out := &in.Protocol, &out.Protocol
|
||||
*out = new(v1.Protocol)
|
||||
**out = **in
|
||||
}
|
||||
if in.ICMP != nil {
|
||||
in, out := &in.ICMP, &out.ICMP
|
||||
*out = new(ICMPFields)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.NotProtocol != nil {
|
||||
in, out := &in.NotProtocol, &out.NotProtocol
|
||||
*out = new(v1.Protocol)
|
||||
**out = **in
|
||||
}
|
||||
if in.NotICMP != nil {
|
||||
in, out := &in.NotICMP, &out.NotICMP
|
||||
*out = new(ICMPFields)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
in.Source.DeepCopyInto(&out.Source)
|
||||
in.Destination.DeepCopyInto(&out.Destination)
|
||||
if in.HTTP != nil {
|
||||
in, out := &in.HTTP, &out.HTTP
|
||||
*out = new(HTTPMatch)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule.
|
||||
func (in *Rule) DeepCopy() *Rule {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Rule)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ServiceAccountMatch) DeepCopyInto(out *ServiceAccountMatch) {
|
||||
*out = *in
|
||||
if in.Names != nil {
|
||||
in, out := &in.Names, &out.Names
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountMatch.
|
||||
func (in *ServiceAccountMatch) DeepCopy() *ServiceAccountMatch {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ServiceAccountMatch)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkspaceNetworkPolicy) DeepCopyInto(out *WorkspaceNetworkPolicy) {
|
||||
*out = *in
|
||||
@@ -33,7 +304,6 @@ func (in *WorkspaceNetworkPolicy) DeepCopyInto(out *WorkspaceNetworkPolicy) {
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
out.Status = in.Status
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceNetworkPolicy.
|
||||
@@ -59,7 +329,7 @@ func (in *WorkspaceNetworkPolicyEgressRule) DeepCopyInto(out *WorkspaceNetworkPo
|
||||
*out = *in
|
||||
if in.Ports != nil {
|
||||
in, out := &in.Ports, &out.Ports
|
||||
*out = make([]v1.NetworkPolicyPort, len(*in))
|
||||
*out = make([]networkingv1.NetworkPolicyPort, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
@@ -71,7 +341,6 @@ func (in *WorkspaceNetworkPolicyEgressRule) DeepCopyInto(out *WorkspaceNetworkPo
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceNetworkPolicyEgressRule.
|
||||
@@ -89,7 +358,7 @@ func (in *WorkspaceNetworkPolicyIngressRule) DeepCopyInto(out *WorkspaceNetworkP
|
||||
*out = *in
|
||||
if in.Ports != nil {
|
||||
in, out := &in.Ports, &out.Ports
|
||||
*out = make([]v1.NetworkPolicyPort, len(*in))
|
||||
*out = make([]networkingv1.NetworkPolicyPort, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
@@ -101,7 +370,6 @@ func (in *WorkspaceNetworkPolicyIngressRule) DeepCopyInto(out *WorkspaceNetworkP
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceNetworkPolicyIngressRule.
|
||||
@@ -126,7 +394,6 @@ func (in *WorkspaceNetworkPolicyList) DeepCopyInto(out *WorkspaceNetworkPolicyLi
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceNetworkPolicyList.
|
||||
@@ -156,7 +423,6 @@ func (in *WorkspaceNetworkPolicyPeer) DeepCopyInto(out *WorkspaceNetworkPolicyPe
|
||||
*out = new(metav1.LabelSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceNetworkPolicyPeer.
|
||||
@@ -174,7 +440,7 @@ func (in *WorkspaceNetworkPolicySpec) DeepCopyInto(out *WorkspaceNetworkPolicySp
|
||||
*out = *in
|
||||
if in.PolicyTypes != nil {
|
||||
in, out := &in.PolicyTypes, &out.PolicyTypes
|
||||
*out = make([]v1.PolicyType, len(*in))
|
||||
*out = make([]networkingv1.PolicyType, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Ingress != nil {
|
||||
@@ -191,7 +457,6 @@ func (in *WorkspaceNetworkPolicySpec) DeepCopyInto(out *WorkspaceNetworkPolicySp
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceNetworkPolicySpec.
|
||||
@@ -207,7 +472,6 @@ func (in *WorkspaceNetworkPolicySpec) DeepCopy() *WorkspaceNetworkPolicySpec {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkspaceNetworkPolicyStatus) DeepCopyInto(out *WorkspaceNetworkPolicyStatus) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceNetworkPolicyStatus.
|
||||
|
||||
@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by main. DO NOT EDIT.
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by main. DO NOT EDIT.
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package versioned
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated clientset.
|
||||
package versioned
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated fake clientset.
|
||||
package fake
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package contains the scheme of the automatically generated clientset.
|
||||
package scheme
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package scheme
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha1
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha1
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
Copyright 2019 The KubeSphere 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.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
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"
|
||||
v1alpha1 "kubesphere.io/kubesphere/pkg/apis/network/v1alpha1"
|
||||
)
|
||||
|
||||
// FakeNamespaceNetworkPolicies implements NamespaceNetworkPolicyInterface
|
||||
type FakeNamespaceNetworkPolicies struct {
|
||||
Fake *FakeNetworkV1alpha1
|
||||
ns string
|
||||
}
|
||||
|
||||
var namespacenetworkpoliciesResource = schema.GroupVersionResource{Group: "network.kubesphere.io", Version: "v1alpha1", Resource: "namespacenetworkpolicies"}
|
||||
|
||||
var namespacenetworkpoliciesKind = schema.GroupVersionKind{Group: "network.kubesphere.io", Version: "v1alpha1", Kind: "NamespaceNetworkPolicy"}
|
||||
|
||||
// Get takes name of the namespaceNetworkPolicy, and returns the corresponding namespaceNetworkPolicy object, and an error if there is any.
|
||||
func (c *FakeNamespaceNetworkPolicies) Get(name string, options v1.GetOptions) (result *v1alpha1.NamespaceNetworkPolicy, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(namespacenetworkpoliciesResource, c.ns, name), &v1alpha1.NamespaceNetworkPolicy{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.NamespaceNetworkPolicy), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of NamespaceNetworkPolicies that match those selectors.
|
||||
func (c *FakeNamespaceNetworkPolicies) List(opts v1.ListOptions) (result *v1alpha1.NamespaceNetworkPolicyList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(namespacenetworkpoliciesResource, namespacenetworkpoliciesKind, c.ns, opts), &v1alpha1.NamespaceNetworkPolicyList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.NamespaceNetworkPolicyList{ListMeta: obj.(*v1alpha1.NamespaceNetworkPolicyList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.NamespaceNetworkPolicyList).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 namespaceNetworkPolicies.
|
||||
func (c *FakeNamespaceNetworkPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(namespacenetworkpoliciesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a namespaceNetworkPolicy and creates it. Returns the server's representation of the namespaceNetworkPolicy, and an error, if there is any.
|
||||
func (c *FakeNamespaceNetworkPolicies) Create(namespaceNetworkPolicy *v1alpha1.NamespaceNetworkPolicy) (result *v1alpha1.NamespaceNetworkPolicy, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(namespacenetworkpoliciesResource, c.ns, namespaceNetworkPolicy), &v1alpha1.NamespaceNetworkPolicy{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.NamespaceNetworkPolicy), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a namespaceNetworkPolicy and updates it. Returns the server's representation of the namespaceNetworkPolicy, and an error, if there is any.
|
||||
func (c *FakeNamespaceNetworkPolicies) Update(namespaceNetworkPolicy *v1alpha1.NamespaceNetworkPolicy) (result *v1alpha1.NamespaceNetworkPolicy, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(namespacenetworkpoliciesResource, c.ns, namespaceNetworkPolicy), &v1alpha1.NamespaceNetworkPolicy{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.NamespaceNetworkPolicy), err
|
||||
}
|
||||
|
||||
// Delete takes name of the namespaceNetworkPolicy and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeNamespaceNetworkPolicies) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(namespacenetworkpoliciesResource, c.ns, name), &v1alpha1.NamespaceNetworkPolicy{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeNamespaceNetworkPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(namespacenetworkpoliciesResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.NamespaceNetworkPolicyList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched namespaceNetworkPolicy.
|
||||
func (c *FakeNamespaceNetworkPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.NamespaceNetworkPolicy, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(namespacenetworkpoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha1.NamespaceNetworkPolicy{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.NamespaceNetworkPolicy), err
|
||||
}
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
@@ -27,6 +28,10 @@ type FakeNetworkV1alpha1 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeNetworkV1alpha1) NamespaceNetworkPolicies(namespace string) v1alpha1.NamespaceNetworkPolicyInterface {
|
||||
return &FakeNamespaceNetworkPolicies{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeNetworkV1alpha1) WorkspaceNetworkPolicies() v1alpha1.WorkspaceNetworkPolicyInterface {
|
||||
return &FakeWorkspaceNetworkPolicies{c}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
|
||||
@@ -13,8 +13,11 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
type NamespaceNetworkPolicyExpansion interface{}
|
||||
|
||||
type WorkspaceNetworkPolicyExpansion interface{}
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
/*
|
||||
Copyright 2019 The KubeSphere 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.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
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"
|
||||
v1alpha1 "kubesphere.io/kubesphere/pkg/apis/network/v1alpha1"
|
||||
scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme"
|
||||
)
|
||||
|
||||
// NamespaceNetworkPoliciesGetter has a method to return a NamespaceNetworkPolicyInterface.
|
||||
// A group's client should implement this interface.
|
||||
type NamespaceNetworkPoliciesGetter interface {
|
||||
NamespaceNetworkPolicies(namespace string) NamespaceNetworkPolicyInterface
|
||||
}
|
||||
|
||||
// NamespaceNetworkPolicyInterface has methods to work with NamespaceNetworkPolicy resources.
|
||||
type NamespaceNetworkPolicyInterface interface {
|
||||
Create(*v1alpha1.NamespaceNetworkPolicy) (*v1alpha1.NamespaceNetworkPolicy, error)
|
||||
Update(*v1alpha1.NamespaceNetworkPolicy) (*v1alpha1.NamespaceNetworkPolicy, error)
|
||||
Delete(name string, options *v1.DeleteOptions) error
|
||||
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
|
||||
Get(name string, options v1.GetOptions) (*v1alpha1.NamespaceNetworkPolicy, error)
|
||||
List(opts v1.ListOptions) (*v1alpha1.NamespaceNetworkPolicyList, error)
|
||||
Watch(opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.NamespaceNetworkPolicy, err error)
|
||||
NamespaceNetworkPolicyExpansion
|
||||
}
|
||||
|
||||
// namespaceNetworkPolicies implements NamespaceNetworkPolicyInterface
|
||||
type namespaceNetworkPolicies struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newNamespaceNetworkPolicies returns a NamespaceNetworkPolicies
|
||||
func newNamespaceNetworkPolicies(c *NetworkV1alpha1Client, namespace string) *namespaceNetworkPolicies {
|
||||
return &namespaceNetworkPolicies{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the namespaceNetworkPolicy, and returns the corresponding namespaceNetworkPolicy object, and an error if there is any.
|
||||
func (c *namespaceNetworkPolicies) Get(name string, options v1.GetOptions) (result *v1alpha1.NamespaceNetworkPolicy, err error) {
|
||||
result = &v1alpha1.NamespaceNetworkPolicy{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("namespacenetworkpolicies").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of NamespaceNetworkPolicies that match those selectors.
|
||||
func (c *namespaceNetworkPolicies) List(opts v1.ListOptions) (result *v1alpha1.NamespaceNetworkPolicyList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha1.NamespaceNetworkPolicyList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("namespacenetworkpolicies").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested namespaceNetworkPolicies.
|
||||
func (c *namespaceNetworkPolicies) Watch(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("namespacenetworkpolicies").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a namespaceNetworkPolicy and creates it. Returns the server's representation of the namespaceNetworkPolicy, and an error, if there is any.
|
||||
func (c *namespaceNetworkPolicies) Create(namespaceNetworkPolicy *v1alpha1.NamespaceNetworkPolicy) (result *v1alpha1.NamespaceNetworkPolicy, err error) {
|
||||
result = &v1alpha1.NamespaceNetworkPolicy{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("namespacenetworkpolicies").
|
||||
Body(namespaceNetworkPolicy).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a namespaceNetworkPolicy and updates it. Returns the server's representation of the namespaceNetworkPolicy, and an error, if there is any.
|
||||
func (c *namespaceNetworkPolicies) Update(namespaceNetworkPolicy *v1alpha1.NamespaceNetworkPolicy) (result *v1alpha1.NamespaceNetworkPolicy, err error) {
|
||||
result = &v1alpha1.NamespaceNetworkPolicy{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("namespacenetworkpolicies").
|
||||
Name(namespaceNetworkPolicy.Name).
|
||||
Body(namespaceNetworkPolicy).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the namespaceNetworkPolicy and deletes it. Returns an error if one occurs.
|
||||
func (c *namespaceNetworkPolicies) Delete(name string, options *v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("namespacenetworkpolicies").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *namespaceNetworkPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOptions.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("namespacenetworkpolicies").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched namespaceNetworkPolicy.
|
||||
func (c *namespaceNetworkPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.NamespaceNetworkPolicy, err error) {
|
||||
result = &v1alpha1.NamespaceNetworkPolicy{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("namespacenetworkpolicies").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
@@ -26,6 +27,7 @@ import (
|
||||
|
||||
type NetworkV1alpha1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
NamespaceNetworkPoliciesGetter
|
||||
WorkspaceNetworkPoliciesGetter
|
||||
}
|
||||
|
||||
@@ -34,6 +36,10 @@ type NetworkV1alpha1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *NetworkV1alpha1Client) NamespaceNetworkPolicies(namespace string) NamespaceNetworkPolicyInterface {
|
||||
return newNamespaceNetworkPolicies(c, namespace)
|
||||
}
|
||||
|
||||
func (c *NetworkV1alpha1Client) WorkspaceNetworkPolicies() WorkspaceNetworkPolicyInterface {
|
||||
return newWorkspaceNetworkPolicies(c)
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha2
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha1
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package devops
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package externalversions
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package externalversions
|
||||
|
||||
@@ -59,6 +60,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Devops().V1alpha1().S2iBinaries().Informer()}, nil
|
||||
|
||||
// Group=network.kubesphere.io, Version=v1alpha1
|
||||
case networkv1alpha1.SchemeGroupVersion.WithResource("namespacenetworkpolicies"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Network().V1alpha1().NamespaceNetworkPolicies().Informer()}, nil
|
||||
case networkv1alpha1.SchemeGroupVersion.WithResource("workspacenetworkpolicies"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Network().V1alpha1().WorkspaceNetworkPolicies().Informer()}, nil
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package internalinterfaces
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package network
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
@@ -23,6 +24,8 @@ import (
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// NamespaceNetworkPolicies returns a NamespaceNetworkPolicyInformer.
|
||||
NamespaceNetworkPolicies() NamespaceNetworkPolicyInformer
|
||||
// WorkspaceNetworkPolicies returns a WorkspaceNetworkPolicyInformer.
|
||||
WorkspaceNetworkPolicies() WorkspaceNetworkPolicyInformer
|
||||
}
|
||||
@@ -38,6 +41,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
|
||||
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||
}
|
||||
|
||||
// NamespaceNetworkPolicies returns a NamespaceNetworkPolicyInformer.
|
||||
func (v *version) NamespaceNetworkPolicies() NamespaceNetworkPolicyInformer {
|
||||
return &namespaceNetworkPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// WorkspaceNetworkPolicies returns a WorkspaceNetworkPolicyInformer.
|
||||
func (v *version) WorkspaceNetworkPolicies() WorkspaceNetworkPolicyInformer {
|
||||
return &workspaceNetworkPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
Copyright 2019 The KubeSphere 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.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
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"
|
||||
networkv1alpha1 "kubesphere.io/kubesphere/pkg/apis/network/v1alpha1"
|
||||
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
|
||||
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1alpha1 "kubesphere.io/kubesphere/pkg/client/listers/network/v1alpha1"
|
||||
)
|
||||
|
||||
// NamespaceNetworkPolicyInformer provides access to a shared informer and lister for
|
||||
// NamespaceNetworkPolicies.
|
||||
type NamespaceNetworkPolicyInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha1.NamespaceNetworkPolicyLister
|
||||
}
|
||||
|
||||
type namespaceNetworkPolicyInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewNamespaceNetworkPolicyInformer constructs a new informer for NamespaceNetworkPolicy 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 NewNamespaceNetworkPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredNamespaceNetworkPolicyInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredNamespaceNetworkPolicyInformer constructs a new informer for NamespaceNetworkPolicy 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 NewFilteredNamespaceNetworkPolicyInformer(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.NetworkV1alpha1().NamespaceNetworkPolicies(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NetworkV1alpha1().NamespaceNetworkPolicies(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&networkv1alpha1.NamespaceNetworkPolicy{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *namespaceNetworkPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredNamespaceNetworkPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *namespaceNetworkPolicyInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&networkv1alpha1.NamespaceNetworkPolicy{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *namespaceNetworkPolicyInformer) Lister() v1alpha1.NamespaceNetworkPolicyLister {
|
||||
return v1alpha1.NewNamespaceNetworkPolicyLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package servicemesh
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package tenant
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ 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 main. DO NOT EDIT.
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user