diff --git a/Gopkg.lock b/Gopkg.lock index 4bd0f18b7..4f26bae0d 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -126,12 +126,6 @@ ] revision = "4bd1920723d7b7c925de087aa32e2187708897f7" -[[projects]] - branch = "master" - name = "github.com/google/btree" - packages = ["."] - revision = "316fb6d3f031ae8f4d457c6c5186b9e3ded70435" - [[projects]] name = "github.com/google/gofuzz" packages = ["."] @@ -146,15 +140,6 @@ ] revision = "68f4ded48ba9414dab2ae69b3f0d69971da73aa5" -[[projects]] - branch = "master" - name = "github.com/gregjones/httpcache" - packages = [ - ".", - "diskcache" - ] - revision = "316c5e0ff04e0ce21cfae9fbbb2ab39c7fc74e71" - [[projects]] name = "github.com/hashicorp/golang-lru" packages = [ @@ -191,12 +176,6 @@ revision = "6ed27152e0428abfde127acb33b08b03a1e67cac" version = "1.0.2" -[[projects]] - branch = "master" - name = "github.com/juju/ratelimit" - packages = ["."] - revision = "5b9ff866471762aa2ab2dced63c9fb6f53921342" - [[projects]] name = "github.com/mailru/easyjson" packages = [ @@ -262,18 +241,6 @@ revision = "e790cca94e6cc75c7064b1332e63811d4aae1a53" version = "v1.1" -[[projects]] - branch = "master" - name = "github.com/petar/GoLLRB" - packages = ["llrb"] - revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" - -[[projects]] - name = "github.com/peterbourgon/diskv" - packages = ["."] - revision = "5f041e8faa004a95c88a202771f4cc3e991971e6" - version = "v2.0.1" - [[projects]] name = "github.com/pkg/errors" packages = ["."] @@ -393,6 +360,12 @@ ] revision = "2910a502d2bf9e43193af9d68ca516529614eed3" +[[projects]] + branch = "master" + name = "golang.org/x/time" + packages = ["rate"] + revision = "fbb02b2291d28baffd63558aa44b4b56f178d650" + [[projects]] branch = "master" name = "golang.org/x/tools" @@ -414,7 +387,6 @@ revision = "7f97868eec74b32b0982dd158a51a446d1da7eb5" [[projects]] - branch = "release-1.9" name = "k8s.io/api" packages = [ "admissionregistration/v1alpha1", @@ -446,7 +418,8 @@ "storage/v1alpha1", "storage/v1beta1" ] - revision = "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + revision = "73d903622b7391f3312dcbac6483fed484e185f8" + version = "kubernetes-1.10.0" [[projects]] branch = "release-1.9" @@ -455,8 +428,6 @@ "pkg/api/errors", "pkg/api/meta", "pkg/api/resource", - "pkg/apimachinery", - "pkg/apimachinery/registered", "pkg/apis/meta/internalversion", "pkg/apis/meta/v1", "pkg/apis/meta/v1/unstructured", @@ -500,13 +471,13 @@ revision = "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" [[projects]] - branch = "release-1.9" name = "k8s.io/apiserver" packages = [ "pkg/util/flag", "pkg/util/logs" ] - revision = "d0762227e2dd234c2db8efc3946c33ad2453c9e8" + revision = "5ae41ac86efd753e2ba012f097b83a914b268236" + version = "kubernetes-1.10.0" [[projects]] name = "k8s.io/client-go" @@ -636,7 +607,10 @@ "listers/storage/v1", "listers/storage/v1alpha1", "listers/storage/v1beta1", + "pkg/apis/clientauthentication", + "pkg/apis/clientauthentication/v1alpha1", "pkg/version", + "plugin/pkg/client/auth/exec", "rest", "rest/watch", "testing", @@ -659,11 +633,10 @@ "util/retry", "util/workqueue" ] - revision = "78700dec6369ba22221b72770783300f143df150" - version = "v6.0.0" + revision = "23781f4d6632d88e869066eaebb743857aa1ef9b" + version = "v7.0.0" [[projects]] - branch = "release-1.9" name = "k8s.io/code-generator" packages = [ "cmd/client-gen", @@ -674,17 +647,25 @@ "cmd/client-gen/generators/util", "cmd/client-gen/path", "cmd/client-gen/types", + "cmd/conversion-gen", + "cmd/conversion-gen/args", + "cmd/conversion-gen/generators", "cmd/deepcopy-gen", + "cmd/deepcopy-gen/args", "cmd/defaulter-gen", + "cmd/defaulter-gen/args", "cmd/informer-gen", + "cmd/informer-gen/args", "cmd/informer-gen/generators", "cmd/lister-gen", - "cmd/lister-gen/generators" + "cmd/lister-gen/args", + "cmd/lister-gen/generators", + "pkg/util" ] - revision = "91d3f6a57905178524105a085085901bb73bd3dc" + revision = "7ead8f38b01cf8653249f5af80ce7b2c8aba12e2" + version = "kubernetes-1.10.0" [[projects]] - branch = "master" name = "k8s.io/gengo" packages = [ "args", @@ -696,7 +677,7 @@ "parser", "types" ] - revision = "1ef560bbde5195c01629039ad3b337ce63e7b321" + revision = "b6c426f7730e6d66e6e476a85d1c3eb7633880e0" [[projects]] branch = "master" @@ -719,6 +700,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "d86dd12b8d707a70abdab55f5864ba1663633ed54a33f45f9a4c7ce4a8ab3040" + inputs-digest = "7a642b60a4d338452115f73c55b32f3ac1a7916cd5e9999001f03a2e0698e9be" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 01e19a95a..dfe316971 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -22,13 +22,11 @@ # Code generation dependencies required = [ "k8s.io/code-generator/cmd/client-gen", - # needed by generated clientsets, but not an explicit dep in client-gen itself - "k8s.io/apimachinery/pkg/apimachinery/registered", - + "k8s.io/code-generator/cmd/conversion-gen", "k8s.io/code-generator/cmd/deepcopy-gen", "k8s.io/code-generator/cmd/defaulter-gen", - "k8s.io/code-generator/cmd/lister-gen", "k8s.io/code-generator/cmd/informer-gen", + "k8s.io/code-generator/cmd/lister-gen", ] [[constraint]] @@ -49,23 +47,23 @@ required = [ [[constraint]] name = "k8s.io/api" - branch = "release-1.9" + version = "kubernetes-1.10.0" [[constraint]] branch = "release-1.9" name = "k8s.io/apimachinery" [[constraint]] - branch = "release-1.9" name = "k8s.io/apiserver" + version = "kubernetes-1.10.0" [[constraint]] name = "k8s.io/client-go" - version = "~6.0" + version = "kubernetes-1.10.0" [[constraint]] - branch = "release-1.9" name = "k8s.io/code-generator" + version = "kubernetes-1.10.0" [[constraint]] branch = "master" @@ -75,9 +73,12 @@ required = [ branch = "master" name = "github.com/heptiolabs/healthcheck" +# gengo needs to be manually pinned to the version listed in code-generators +# Gopkg.toml, because the k8s project does not produce Gopkg.toml files & dep +# does not parse the Godeps.json file to determine revisions to use. [[override]] - branch = "master" name = "k8s.io/gengo" + revision = "b6c426f7730e6d66e6e476a85d1c3eb7633880e0" [[constraint]] name = "github.com/robfig/cron" diff --git a/cmd/mysql-agent/app/mysql_agent.go b/cmd/mysql-agent/app/mysql_agent.go index dd6c25b31..d240a223b 100644 --- a/cmd/mysql-agent/app/mysql_agent.go +++ b/cmd/mysql-agent/app/mysql_agent.go @@ -116,9 +116,9 @@ func Run(opts *options.MySQLAgentOpts) error { backupController := backupcontroller.NewAgentController( kubeclient, - mysqlopClient.MysqlV1alpha1(), - sharedInformerFactory.Mysql().V1alpha1().MySQLBackups(), - sharedInformerFactory.Mysql().V1alpha1().MySQLClusters(), + mysqlopClient.MySQLV1alpha1(), + sharedInformerFactory.MySQL().V1alpha1().Backups(), + sharedInformerFactory.MySQL().V1alpha1().Clusters(), kubeInformerFactory.Core().V1().Pods(), opts.Hostname, ) @@ -130,10 +130,10 @@ func Run(opts *options.MySQLAgentOpts) error { restoreController := restorecontroller.NewAgentController( kubeclient, - mysqlopClient.MysqlV1alpha1(), - sharedInformerFactory.Mysql().V1alpha1().MySQLRestores(), - sharedInformerFactory.Mysql().V1alpha1().MySQLClusters(), - sharedInformerFactory.Mysql().V1alpha1().MySQLBackups(), + mysqlopClient.MySQLV1alpha1(), + sharedInformerFactory.MySQL().V1alpha1().Restores(), + sharedInformerFactory.MySQL().V1alpha1().Clusters(), + sharedInformerFactory.MySQL().V1alpha1().Backups(), kubeInformerFactory.Core().V1().Pods(), opts.Hostname, ) diff --git a/cmd/mysql-agent/app/options/options.go b/cmd/mysql-agent/app/options/options.go index 1716de0c1..f4c2341e1 100644 --- a/cmd/mysql-agent/app/options/options.go +++ b/cmd/mysql-agent/app/options/options.go @@ -43,11 +43,11 @@ type MySQLAgentOpts struct { Address string // Namespace is the namespace in which the backup controller (and is - // associated MySQLCluster) are running. + // associated Cluster) are running. Namespace string - // MySQLClusterName is the name of the MySQLCluster the backup controller + // ClusterName is the name of the Cluster the backup controller // is responsible for. - MySQLClusterName string + ClusterName string // Hostname of the pod the backup operator is running in. Hostname string @@ -66,12 +66,12 @@ func NewMySQLAgentOpts() *MySQLAgentOpts { namespace := os.Getenv("POD_NAMESPACE") clusterName := os.Getenv("MYSQL_CLUSTER_NAME") return &MySQLAgentOpts{ - HealthcheckPort: DefaultMySQLAgentHeathcheckPort, - Address: "0.0.0.0", - Namespace: namespace, - MySQLClusterName: clusterName, - Hostname: hostname, - MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour}, + HealthcheckPort: DefaultMySQLAgentHeathcheckPort, + Address: "0.0.0.0", + Namespace: namespace, + ClusterName: clusterName, + Hostname: hostname, + MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour}, } } @@ -81,7 +81,7 @@ func (s *MySQLAgentOpts) AddFlags(fs *pflag.FlagSet) *pflag.FlagSet { fs.StringVar(&s.Address, "address", s.Address, "The IP address to serve the mysql-agent's http service on (set to 0.0.0.0 for all interfaces).") fs.StringVar(&s.Namespace, "namespace", s.Namespace, "The namespace to run in. Must be the same namespace as the associated MySQL cluster.") - fs.StringVar(&s.MySQLClusterName, "mysql-cluster-name", s.MySQLClusterName, "The name of the MySQL cluster the mysql-agent is responsible for.") + fs.StringVar(&s.ClusterName, "cluster-name", s.ClusterName, "The name of the MySQL cluster the mysql-agent is responsible for.") fs.StringVar(&s.Hostname, "hostname", s.Hostname, "The hostname of the pod the mysql-agent is running in.") fs.DurationVar(&s.MinResyncPeriod.Duration, "min-resync-period", s.MinResyncPeriod.Duration, "The resync period in reflectors will be random between MinResyncPeriod and 2*MinResyncPeriod.") @@ -93,10 +93,10 @@ func (s *MySQLAgentOpts) Validate() error { if len(s.Namespace) == 0 { return fmt.Errorf("must set --namespace or $POD_NAMESPACE") } - if len(s.MySQLClusterName) == 0 { - return fmt.Errorf("must set --mysql-cluster-name or $MYSQL_CLUSTER_NAME") + if len(s.ClusterName) == 0 { + return fmt.Errorf("must set --cluster-name or $MYSQL_CLUSTER_NAME") } - if len(s.MySQLClusterName) == 0 { + if len(s.ClusterName) == 0 { return fmt.Errorf("failed to detect hostname. Set --hostname") } return nil diff --git a/cmd/mysql-operator/app/mysql_operator.go b/cmd/mysql-operator/app/mysql_operator.go index cd6825284..e53d0b1e0 100644 --- a/cmd/mysql-operator/app/mysql_operator.go +++ b/cmd/mysql-operator/app/mysql_operator.go @@ -83,7 +83,7 @@ func Run(s *options.MySQLOperatorServer) error { *s, mysqlopClient, kubeClient, - operatorInformerFactory.Mysql().V1alpha1().MySQLClusters(), + operatorInformerFactory.MySQL().V1alpha1().Clusters(), kubeInformerFactory.Apps().V1beta1().StatefulSets(), kubeInformerFactory.Core().V1().Pods(), kubeInformerFactory.Core().V1().Services(), @@ -98,9 +98,9 @@ func Run(s *options.MySQLOperatorServer) error { backupController := backupcontroller.NewOperatorController( kubeClient, - mysqlopClient.MysqlV1alpha1(), - operatorInformerFactory.Mysql().V1alpha1().MySQLBackups(), - operatorInformerFactory.Mysql().V1alpha1().MySQLClusters(), + mysqlopClient.MySQLV1alpha1(), + operatorInformerFactory.MySQL().V1alpha1().Backups(), + operatorInformerFactory.MySQL().V1alpha1().Clusters(), kubeInformerFactory.Core().V1().Pods(), ) wg.Add(1) @@ -111,10 +111,10 @@ func Run(s *options.MySQLOperatorServer) error { restoreController := restorecontroller.NewOperatorController( kubeClient, - mysqlopClient.MysqlV1alpha1(), - operatorInformerFactory.Mysql().V1alpha1().MySQLRestores(), - operatorInformerFactory.Mysql().V1alpha1().MySQLClusters(), - operatorInformerFactory.Mysql().V1alpha1().MySQLBackups(), + mysqlopClient.MySQLV1alpha1(), + operatorInformerFactory.MySQL().V1alpha1().Restores(), + operatorInformerFactory.MySQL().V1alpha1().Clusters(), + operatorInformerFactory.MySQL().V1alpha1().Backups(), kubeInformerFactory.Core().V1().Pods(), ) wg.Add(1) @@ -126,7 +126,7 @@ func Run(s *options.MySQLOperatorServer) error { backupScheduleController := backupschedule.NewController( mysqlopClient, kubeClient, - operatorInformerFactory.Mysql().V1alpha1().MySQLBackupSchedules(), + operatorInformerFactory.MySQL().V1alpha1().BackupSchedules(), 30*time.Second, s.Namespace, ) diff --git a/contrib/manifests/custom-resource-definitions.yaml b/contrib/manifests/custom-resource-definitions.yaml index 8324ae887..32f26aaf3 100644 --- a/contrib/manifests/custom-resource-definitions.yaml +++ b/contrib/manifests/custom-resource-definitions.yaml @@ -8,7 +8,7 @@ spec: version: v1alpha1 scope: Namespaced names: - kind: MySQLCluster + kind: Cluster singular: mysqlcluster plural: mysqlclusters --- @@ -21,7 +21,7 @@ spec: version: v1alpha1 scope: Namespaced names: - kind: MySQLBackup + kind: Backup singular: mysqlbackup plural: mysqlbackups --- @@ -34,7 +34,7 @@ spec: version: v1alpha1 scope: Namespaced names: - kind: MySQLRestore + kind: Restore singular: mysqlrestore plural: mysqlrestores --- @@ -47,6 +47,6 @@ spec: version: v1alpha1 scope: Namespaced names: - kind: MySQLBackupSchedule + kind: BackupSchedule singular: mysqlbackupschedule plural: mysqlbackupschedules diff --git a/docs/development.md b/docs/development.md index b66e19121..e1c37ad04 100644 --- a/docs/development.md +++ b/docs/development.md @@ -59,9 +59,9 @@ If you did not set an envrionment variable previously, prefix this command with ## Creating an InnoDB cluster -For the purpose of this document, we will create a cluster with 3 replicas with +For the purpose of this document, we will create a cluster with 3 members with the example yaml. ```bash -$ kubectl apply -n $USER -f examples/cluster/cluster-with-3-replicas.yaml +$ kubectl apply -n $USER -f examples/cluster/cluster-with-3-members.yaml ``` diff --git a/docs/tutorial.md b/docs/tutorial.md index ca87eb596..c841bfa58 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -109,7 +109,7 @@ Now let's create a new MySQL cluster. Create a cluster.yaml file with the follow ```yaml apiVersion: mysql.oracle.com/v1 -kind: MySQLCluster +kind: Cluster metadata: name: myappdb ``` @@ -126,7 +126,7 @@ You should now have a cluster in the default namespace ``` $ kubectl get mysqlclusters NAME KIND -myappdb MySQLCluster.v1alpha1.mysql.oracle.com +myappdb Cluster.v1alpha1.mysql.oracle.com ``` To find out how to create larger clusters, and configure storage see [Clusters](user/clusters.md#clusters). diff --git a/docs/user/backup.md b/docs/user/backup.md index 464d534f8..d97cfe896 100644 --- a/docs/user/backup.md +++ b/docs/user/backup.md @@ -3,7 +3,8 @@ ## Introduction The MySQL Operator allows for on-demand and scheduled backups to be created. -On-demand backups can be created by submitting a MySQLBackup custom resource. Scheduled backups can be created by submitting a MySQLBackupSchedule custom resource. +On-demand backups can be created by submitting a Backup custom resource. +Scheduled backups can be created by submitting a BackupSchedule custom resource. Whilst we plan to offer different options for backups, we currently only support the mysqldump tool, and storage in S3 compatible object storage providers. @@ -35,29 +36,29 @@ $ kubectl create secret generic s3-credentials --from-literal=accessKey=${S3_ACC ## On-demand backups -You can request a backup at any time by submitting a MySQLBackup custom resource to the -operator. The secretRef is the name of a secret that contains your Object +You can request a backup at any time by submitting a Backup custom resource to the +operator. The credentialsSecret is the name of a secret that contains your Object Storage credentials. Note: The databases field is mandatory. ```yaml -apiVersion: mysql.oracle.com/v1alpa1 -kind: MySQLBackup +apiVersion: mysql.oracle.com/v1alpha1 +kind: Backup metadata: name: mysql-backup spec: executor: - provider: mysqldump - databases: - - test - storage: - provider: s3 - secretRef: - name: s3-credentials - config: + mysqldump: + databases: + - test + storageProvider: + s3: endpoint: ocitenancy.compat.objectstorage.ociregion.oraclecloud.com region: ociregion bucket: mybucket - clusterRef: + forcePathStyle: true + credentialsSecret: + name: s3-credentials + cluster: name: mysql-cluster ``` @@ -91,10 +92,10 @@ configured as follows: ```yaml ... - config: - endpoint: mytenancy.compat.objectstorage.us-phoenix-1.oraclecloud.com - region: us-phoenix-1 - bucket: mybucket + s3: + endpoint: mytenancy.compat.objectstorage.us-phoenix-1.oraclecloud.com + region: us-phoenix-1 + bucket: mybucket ... ``` @@ -106,7 +107,7 @@ An AWS storage endpoint can also be configured. For example: ```yaml ... - config: + s3: endpoint: s3.eu-west-2.amazonaws.com region: eu-west-2 bucket: mybucket @@ -117,17 +118,17 @@ Remember to also configure the valid S3 credentials secret as outlined above. #### On-demand backups - Google GCE storage configuration -To use a GCE storage bucket, you need to ensure s3 compatability has been enabled: +To use a GCE storage bucket, you need to ensure S3 compatibility has been enabled: 1. Log into the GCE console and navigate to 'storage'. -2. Enable S3 compatability in your GCE storage config. +2. Enable S3 compatibility in your GCE storage config. 3. Generate a new S3 'secretKey' and 'accessKey'. A GCE storage endpoints can then be configured as follows: ```yaml ... - config: + s3: endpoint: storage.googleapis.com region: europe-west1 bucket: mybucket @@ -139,15 +140,15 @@ Remember to also configure the S3 credentials secret as outlined above. ## Scheduled backups You can request a backup to be performed on a given schedule by submitting a -MySQLBackupSchedule custom resource to the operator. This will create -MySQLBackup resources based on the given cron format string. The secretRef is -the name of a secret that contains your Object Storage credentials. Note: The -databases field is mandatory. For example, the following will create a backup -of the employees database every 30 minutes: +BackupSchedule custom resource to the operator. This will create Backup +resources based on the given cron format string. The credentialsSecret is the +name of a Secret that contains your Object Storage credentials. Note: The +databases field is mandatory. For example, the following will create a backup of +the employees database every 30 minutes: ```yaml apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLBackupSchedule +kind: BackupSchedule metadata: name: mysql-backup-schedule spec: @@ -157,14 +158,13 @@ spec: provider: mysqldump databases: - test - storage: - provider: s3 - secretRef: - name: s3-credentials - config: + storageProvider: + s3: endpoint: ocitenancy.compat.objectstorage.ociregion.oraclecloud.com region: ociregion bucket: mybucket - clusterRef: + credentialsSecret: + name: s3-credentials + cluster: name: mysql-cluster ``` diff --git a/docs/user/clusters.md b/docs/user/clusters.md index 3a126f3fb..eb6e37d90 100644 --- a/docs/user/clusters.md +++ b/docs/user/clusters.md @@ -2,31 +2,31 @@ MySQL cluster examples. -### Create a cluster with 3 replicas +### Create a cluster with 3 members -The following example will create a MySQL Cluster with 3 replicas, one primary and 2 secondaries: +The following example will create a MySQL Cluster with 3 members, one primary and 2 secondaries: ```yaml apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql-test-cluster spec: - replicas: 3 + members: 3 ``` -### Create a cluster with 3 replicas in multi-master mode +### Create a cluster with 3 members in multi-master mode -The following example will create a MySQL Cluster with 3 primary (read/write) replicas: +The following example will create a MySQL Cluster with 3 primary (read/write) members: ```yaml apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql-multimaster-cluster spec: multiMaster: true - replicas: 3 + members: 3 ``` ### Create a cluster with a custom "MYSQL_ROOT_PASSWORD" @@ -41,12 +41,12 @@ Create your cluster and reference it ```yaml apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: example-mysql-cluster-custom-secret spec: - replicas: 1 - secretRef: + members: 1 + rootPasswordSecret: name: mysql-root-user-secret ``` @@ -73,11 +73,11 @@ spec: storageClassName: manual --- apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: example-mysql-cluster-with-volume spec: - replicas: 1 + members: 1 volumeClaimTemplate: metadata: name: data @@ -130,12 +130,12 @@ spec: storageClassName: manual --- apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: example-mysql-cluster-with-volume spec: - replicas: 1 - secretRef: + members: 1 + rootPasswordSecret: name: mysql-root-user-secret volumeClaimTemplate: metadata: @@ -180,24 +180,24 @@ Now we can reference our config map in our cluster spec definition. For example: ```yaml apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql-cluster-with-config - replicas: 3 - configRef: + members: 3 + config: name: mycnf ``` ### Create a cluster with custom server_id values -By default, the MySQL Operator starts a cluster with `--server_id` set to `1000` and increments it by one for each new cluster member. You can change this behavior by setting the `baseServerId` field on your MySQLCluster. `baseServerId` value can be set to anything in the range from `1` to `4294967286`. `0` is also accepted, but then the default value of `1000` will be used. +By default, the MySQL Operator starts a cluster with `--server_id` set to `1000` and increments it by one for each new cluster member. You can change this behavior by setting the `baseServerId` field on your Cluster. `baseServerId` value can be set to anything in the range from `1` to `4294967286`. `0` is also accepted, but then the default value of `1000` will be used. The following example will create a MySQL Cluster with following `server_id`'s: 42,43,44 ```yaml apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql-cluster-with-custom-serverid - replicas: 3 + members: 3 baseServerId: 42 ``` diff --git a/docs/user/config.md b/docs/user/config.md index 75d539a87..62a5d7925 100644 --- a/docs/user/config.md +++ b/docs/user/config.md @@ -7,22 +7,22 @@ Some aspects of the MySQL Operator can be configured via: 1. MySQL Operator Command Line Parameters. 2. MySQL Operator ConfigMap. -When applicable, a commandline parameter will override the equivalent config +When applicable, a commandline parameter will override the equivalent config map parameter. -Most of the time it should not be neccessary to supply any specific -configuration and the operator will use sensible defaults when required +Most of the time it should not be neccessary to supply any specific +configuration and the operator will use sensible defaults when required values are not specified. ### Create a MySQLOperator deployment with volume mounted configuration. -In some cases, however, it may be desirable to configure aspects of the -controller. For example, during development you may wish to use a +In some cases, however, it may be desirable to configure aspects of the +controller. For example, during development you may wish to use a different 'mysql-server' or 'mysql-agent' image. -The following Helm chart snippet does just that by configuring a -config map and volume mounting it to the known location: +The following Helm chart snippet does just that by configuring a +config map and volume mounting it to the known location: _/etc/mysql-operator/mysql-operator-config.yaml_ ```yaml @@ -37,7 +37,7 @@ metadata: chart: {{ .Chart.Name }}-{{ .Chart.Version }} data: mysql-operator-config.yaml: | - images: + images: mysqlServer: mysql/mysql-server mysqlAgent: iad.ocir.io/oracle/mysql-agent --- @@ -51,7 +51,7 @@ metadata: chart: {{ .Chart.Name }}-{{ .Chart.Version }} app: mysql-operator spec: - replicas: 1 + members: 1 selector: matchLabels: app: mysql-operator diff --git a/docs/user/restore.md b/docs/user/restore.md index 185ffdcde..6f440040d 100644 --- a/docs/user/restore.md +++ b/docs/user/restore.md @@ -5,13 +5,13 @@ The MySQL Operator supports the notion of restoring a cluster from an existing b ## On-demand restores You can request a restore from a previous backup at any time by submitting a -MySQLRestore custom resource to the operator. The backupRef is the name of the +Restore custom resource to the operator. The backupRef is the name of the backup that you wish to restore, and the clusterRef is the name of the destination cluster of the restore operation. ```yaml apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLRestore +kind: Restore metadata: name: example-restore spec: diff --git a/docs/user/router.md b/docs/user/router.md index 573d8df46..2c52ef917 100644 --- a/docs/user/router.md +++ b/docs/user/router.md @@ -18,11 +18,11 @@ We'll use WordPress as an example of how you might setup the MySQL Router for a ```yaml apiVersion: "mysql.oracle.com/v1alpa1" -kind: MySQLCluster +kind: Cluster metadata: name: mysql-wordpress spec: - replicas: 3 + members: 3 secretRef: name: wordpress-mysql-root-password ``` diff --git a/examples/backup/backup-schedule.yaml b/examples/backup/backup-schedule.yaml index 884a82e6d..658f37d44 100644 --- a/examples/backup/backup-schedule.yaml +++ b/examples/backup/backup-schedule.yaml @@ -1,21 +1,20 @@ apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLBackupSchedule +kind: BackupSchedule metadata: name: mysql-backup-schedule spec: schedule: '30 * * * *' backupTemplate: executor: - provider: mysqldump - databases: - - test - storage: - provider: s3 - secretRef: - name: s3-credentials - config: + mysqldump: + databases: + - name: test + storageProvider: + s3: endpoint: ocitenancy.compat.objectstorage.ociregion.oraclecloud.com region: ociregion bucket: mybucket - clusterRef: + credentialsSecret: + name: s3-credentials + cluster: name: mysql diff --git a/examples/backup/backup.yaml b/examples/backup/backup.yaml index 6d6e26faa..31f37c0eb 100644 --- a/examples/backup/backup.yaml +++ b/examples/backup/backup.yaml @@ -1,19 +1,18 @@ apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLBackup +kind: Backup metadata: name: mysql-backup spec: executor: - provider: mysqldump - databases: - - test - storage: - provider: s3 - secretRef: - name: s3-credentials - config: + mysqldump: + databases: + - name: test + storageProvider: + s3: endpoint: ocitenancy.compat.objectstorage.ociregion.oraclecloud.com region: ociregion bucket: mybucket + credentialsSecret: + name: s3-credentials clusterRef: name: mysql diff --git a/examples/cluster/cluster-with-3-members.yaml b/examples/cluster/cluster-with-3-members.yaml new file mode 100644 index 000000000..f2b1866df --- /dev/null +++ b/examples/cluster/cluster-with-3-members.yaml @@ -0,0 +1,6 @@ +apiVersion: mysql.oracle.com/v1alpha1 +kind: Cluster +metadata: + name: mysql +spec: + members: 3 diff --git a/examples/cluster/cluster-with-3-replicas.yaml b/examples/cluster/cluster-with-3-replicas.yaml deleted file mode 100644 index 5c6b17437..000000000 --- a/examples/cluster/cluster-with-3-replicas.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: mysql.oracle.com/alpha1 -kind: MySQLCluster -metadata: - name: mysql -spec: - replicas: 3 diff --git a/examples/cluster/cluster-with-custom-config.yaml b/examples/cluster/cluster-with-custom-config.yaml index f71b3ab71..2a5b2d798 100644 --- a/examples/cluster/cluster-with-custom-config.yaml +++ b/examples/cluster/cluster-with-custom-config.yaml @@ -1,8 +1,8 @@ apiVersion: mysql.oracle.com/alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql spec: - replicas: 1 + members: 1 configRef: name: mycnf diff --git a/examples/cluster/cluster-with-custom-secret.yaml b/examples/cluster/cluster-with-custom-secret.yaml index 3a99370f9..c17c6308c 100644 --- a/examples/cluster/cluster-with-custom-secret.yaml +++ b/examples/cluster/cluster-with-custom-secret.yaml @@ -1,8 +1,8 @@ apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql spec: - replicas: 1 + members: 1 secretRef: name: mysql-root-user-secret diff --git a/examples/cluster/cluster-with-custom-ssl-certs.yaml b/examples/cluster/cluster-with-custom-ssl-certs.yaml index 5ebbe34de..1940b6ec6 100644 --- a/examples/cluster/cluster-with-custom-ssl-certs.yaml +++ b/examples/cluster/cluster-with-custom-ssl-certs.yaml @@ -1,8 +1,8 @@ apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql spec: - replicas: 3 + members: 3 sslSecretRef: name: mysql-ssl-secret diff --git a/examples/cluster/cluster-with-data-volume-and-backup-volume.yaml b/examples/cluster/cluster-with-data-volume-and-backup-volume.yaml index 545a0e3b7..d1cc65610 100644 --- a/examples/cluster/cluster-with-data-volume-and-backup-volume.yaml +++ b/examples/cluster/cluster-with-data-volume-and-backup-volume.yaml @@ -32,11 +32,11 @@ spec: storageClassName: manual --- apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql spec: - replicas: 1 + members: 1 secretRef: name: mysql-root-user-secret volumeClaimTemplate: diff --git a/examples/cluster/cluster-with-volume.yaml b/examples/cluster/cluster-with-volume.yaml index e34a30dac..01c52d1e6 100644 --- a/examples/cluster/cluster-with-volume.yaml +++ b/examples/cluster/cluster-with-volume.yaml @@ -16,11 +16,11 @@ spec: storageClassName: manual --- apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql spec: - replicas: 1 + members: 1 secretRef: name: mysql-root-user-secret volumeClaimTemplate: diff --git a/examples/cluster/cluster.yaml b/examples/cluster/cluster.yaml index bce0d5d99..1078634b4 100644 --- a/examples/cluster/cluster.yaml +++ b/examples/cluster/cluster.yaml @@ -1,4 +1,4 @@ apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql diff --git a/examples/cluster/multi-master-cluster.yaml b/examples/cluster/multi-master-cluster.yaml index f794ea2d8..4ef0ec08f 100644 --- a/examples/cluster/multi-master-cluster.yaml +++ b/examples/cluster/multi-master-cluster.yaml @@ -1,7 +1,7 @@ apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql spec: multiMaster: true - replicas: 3 + members: 3 diff --git a/examples/demo/wordpress-router/wordpress-database.yaml b/examples/demo/wordpress-router/wordpress-database.yaml index c9b49c222..282779c2f 100644 --- a/examples/demo/wordpress-router/wordpress-database.yaml +++ b/examples/demo/wordpress-router/wordpress-database.yaml @@ -16,11 +16,11 @@ data: password: bXktc3VwZXItc2VjcmV0LXBhc3M= --- apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql-wordpress spec: - replicas: 3 + members: 3 configRef: name: mysql-config secretRef: diff --git a/examples/demo/wordpress/wordpress-database.yaml b/examples/demo/wordpress/wordpress-database.yaml index b989887e1..924e8e8a9 100644 --- a/examples/demo/wordpress/wordpress-database.yaml +++ b/examples/demo/wordpress/wordpress-database.yaml @@ -16,11 +16,11 @@ spec: storageClassName: manual --- apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLCluster +kind: Cluster metadata: name: mysql-wordpress spec: - replicas: 1 + members: 1 secretRef: name: wordpress-mysql-root-password volumeClaimTemplate: diff --git a/examples/restore/restore.yaml b/examples/restore/restore.yaml index 924d3d3b8..7449b1fdc 100644 --- a/examples/restore/restore.yaml +++ b/examples/restore/restore.yaml @@ -1,9 +1,9 @@ apiVersion: mysql.oracle.com/v1alpha1 -kind: MySQLRestore +kind: Restore metadata: name: mysql-restore spec: - clusterRef: + cluster: name: mysql - backupRef: + backup: name: mysql-backup diff --git a/mysql-operator/templates/01-resources.yaml b/mysql-operator/templates/01-resources.yaml index 3d50bb6aa..04865bf35 100644 --- a/mysql-operator/templates/01-resources.yaml +++ b/mysql-operator/templates/01-resources.yaml @@ -12,7 +12,7 @@ spec: version: v1alpha1 scope: Namespaced names: - kind: MySQLCluster + kind: Cluster singular: mysqlcluster plural: mysqlclusters --- @@ -28,7 +28,7 @@ spec: version: v1alpha1 scope: Namespaced names: - kind: MySQLBackup + kind: Backup singular: mysqlbackup plural: mysqlbackups --- @@ -44,7 +44,7 @@ spec: version: v1alpha1 scope: Namespaced names: - kind: MySQLRestore + kind: Restore singular: mysqlrestore plural: mysqlrestores --- @@ -60,7 +60,7 @@ spec: version: v1alpha1 scope: Namespaced names: - kind: MySQLBackupSchedule + kind: BackupSchedule singular: mysqlbackupschedule plural: mysqlbackupschedules {{ end }} diff --git a/pkg/api/backup/util.go b/pkg/api/backup/util.go new file mode 100644 index 000000000..bd5a9c012 --- /dev/null +++ b/pkg/api/backup/util.go @@ -0,0 +1,82 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 backup + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" +) + +// GetBackupCondition extracts the provided condition from the given status and returns that. +// Returns nil and -1 if the condition is not present, and the index of the located condition. +func GetBackupCondition(status *v1alpha1.BackupStatus, conditionType v1alpha1.BackupConditionType) (int, *v1alpha1.BackupCondition) { + if status == nil { + return -1, nil + } + for i := range status.Conditions { + if status.Conditions[i].Type == conditionType { + return i, &status.Conditions[i] + } + } + return -1, nil +} + +// UpdateBackupCondition updates existing Backup condition or creates a new +// one. Sets LastTransitionTime to now if the status has changed. +// Returns true if Backup condition has changed or has been added. +func UpdateBackupCondition(status *v1alpha1.BackupStatus, condition *v1alpha1.BackupCondition) bool { + condition.LastTransitionTime = metav1.Now() + // Try to find this Backup condition. + conditionIndex, oldCondition := GetBackupCondition(status, condition.Type) + + if oldCondition == nil { + // We are adding new Backup condition. + status.Conditions = append(status.Conditions, *condition) + return true + } + // We are updating an existing condition, so we need to check if it has changed. + if condition.Status == oldCondition.Status { + condition.LastTransitionTime = oldCondition.LastTransitionTime + } + + isEqual := condition.Status == oldCondition.Status && + condition.Reason == oldCondition.Reason && + condition.Message == oldCondition.Message && + condition.LastTransitionTime.Equal(&oldCondition.LastTransitionTime) + + status.Conditions[conditionIndex] = *condition + // Return true if one of the fields have changed. + return !isEqual +} + +// IsBackupComplete returns true if a Backup has successfully completed +func IsBackupComplete(backup *v1alpha1.Backup) bool { + return IsBackupCompleteConditionTrue(backup.Status) +} + +// GetBackupCompleteCondition extracts the Backup complete condition from the given status and returns that. +// Returns nil if the condition is not present. +func GetBackupCompleteCondition(status v1alpha1.BackupStatus) *v1alpha1.BackupCondition { + _, condition := GetBackupCondition(&status, v1alpha1.BackupComplete) + return condition +} + +// IsBackupCompleteConditionTrue returns true if a Backup is complete; false otherwise. +func IsBackupCompleteConditionTrue(status v1alpha1.BackupStatus) bool { + condition := GetBackupCompleteCondition(status) + return condition != nil && condition.Status == corev1.ConditionTrue +} diff --git a/pkg/api/cluster/util.go b/pkg/api/cluster/util.go new file mode 100644 index 000000000..5ce87c5cf --- /dev/null +++ b/pkg/api/cluster/util.go @@ -0,0 +1,82 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 cluster + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" +) + +// GetClusterCondition extracts the provided condition from the given status and returns that. +// Returns nil and -1 if the condition is not present, and the index of the located condition. +func GetClusterCondition(status *v1alpha1.ClusterStatus, conditionType v1alpha1.ClusterConditionType) (int, *v1alpha1.ClusterCondition) { + if status == nil { + return -1, nil + } + for i := range status.Conditions { + if status.Conditions[i].Type == conditionType { + return i, &status.Conditions[i] + } + } + return -1, nil +} + +// UpdateClusterCondition updates existing Cluster condition or creates a new +// one. Sets LastTransitionTime to now if the status has changed. +// Returns true if Cluster condition has changed or has been added. +func UpdateClusterCondition(status *v1alpha1.ClusterStatus, condition *v1alpha1.ClusterCondition) bool { + condition.LastTransitionTime = metav1.Now() + // Try to find this Cluster condition. + conditionIndex, oldCondition := GetClusterCondition(status, condition.Type) + + if oldCondition == nil { + // We are adding new Cluster condition. + status.Conditions = append(status.Conditions, *condition) + return true + } + // We are updating an existing condition, so we need to check if it has changed. + if condition.Status == oldCondition.Status { + condition.LastTransitionTime = oldCondition.LastTransitionTime + } + + isEqual := condition.Status == oldCondition.Status && + condition.Reason == oldCondition.Reason && + condition.Message == oldCondition.Message && + condition.LastTransitionTime.Equal(&oldCondition.LastTransitionTime) + + status.Conditions[conditionIndex] = *condition + // Return true if one of the fields have changed. + return !isEqual +} + +// IsClusterReady returns true if a Cluster is ready; false otherwise. +func IsClusterReady(cluster *v1alpha1.Cluster) bool { + return IsClusterReadyConditionTrue(cluster.Status) +} + +// GetClusterReadyCondition extracts the Cluster ready condition from the given status and returns that. +// Returns nil if the condition is not present. +func GetClusterReadyCondition(status v1alpha1.ClusterStatus) *v1alpha1.ClusterCondition { + _, condition := GetClusterCondition(&status, v1alpha1.ClusterReady) + return condition +} + +// IsClusterReadyConditionTrue returns true if a Cluster is ready; false otherwise. +func IsClusterReadyConditionTrue(status v1alpha1.ClusterStatus) bool { + condition := GetClusterReadyCondition(status) + return condition != nil && condition.Status == corev1.ConditionTrue +} diff --git a/pkg/api/restore/util.go b/pkg/api/restore/util.go new file mode 100644 index 000000000..79b639489 --- /dev/null +++ b/pkg/api/restore/util.go @@ -0,0 +1,82 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 restore + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" +) + +// GetRestoreCondition extracts the provided condition from the given status and returns that. +// Returns nil and -1 if the condition is not present, and the index of the located condition. +func GetRestoreCondition(status *v1alpha1.RestoreStatus, conditionType v1alpha1.RestoreConditionType) (int, *v1alpha1.RestoreCondition) { + if status == nil { + return -1, nil + } + for i := range status.Conditions { + if status.Conditions[i].Type == conditionType { + return i, &status.Conditions[i] + } + } + return -1, nil +} + +// UpdateRestoreCondition updates existing Restore condition or creates a new +// one. Sets LastTransitionTime to now if the status has changed. +// Returns true if Restore condition has changed or has been added. +func UpdateRestoreCondition(status *v1alpha1.RestoreStatus, condition *v1alpha1.RestoreCondition) bool { + condition.LastTransitionTime = metav1.Now() + // Try to find this Restore condition. + conditionIndex, oldCondition := GetRestoreCondition(status, condition.Type) + + if oldCondition == nil { + // We are adding new Restore condition. + status.Conditions = append(status.Conditions, *condition) + return true + } + // We are updating an existing condition, so we need to check if it has changed. + if condition.Status == oldCondition.Status { + condition.LastTransitionTime = oldCondition.LastTransitionTime + } + + isEqual := condition.Status == oldCondition.Status && + condition.Reason == oldCondition.Reason && + condition.Message == oldCondition.Message && + condition.LastTransitionTime.Equal(&oldCondition.LastTransitionTime) + + status.Conditions[conditionIndex] = *condition + // Return true if one of the fields have changed. + return !isEqual +} + +// IsRestoreComplete returns true if a Restore has successfully completed +func IsRestoreComplete(restore *v1alpha1.Restore) bool { + return IsRestoreCompleteConditionTrue(restore.Status) +} + +// GetRestoreCompleteCondition extracts the Restore complete condition from the given status and returns that. +// Returns nil if the condition is not present. +func GetRestoreCompleteCondition(status v1alpha1.RestoreStatus) *v1alpha1.RestoreCondition { + _, condition := GetRestoreCondition(&status, v1alpha1.RestoreComplete) + return condition +} + +// IsRestoreCompleteConditionTrue returns true if a Restore is complete; false otherwise. +func IsRestoreCompleteConditionTrue(status v1alpha1.RestoreStatus) bool { + condition := GetRestoreCompleteCondition(status) + return condition != nil && condition.Status == corev1.ConditionTrue +} diff --git a/pkg/apis/mysql/v1alpha1/backup.go b/pkg/apis/mysql/v1alpha1/backup.go deleted file mode 100644 index cc1dd31da..000000000 --- a/pkg/apis/mysql/v1alpha1/backup.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/oracle/mysql-operator/pkg/constants" - "github.com/oracle/mysql-operator/pkg/version" -) - -const ( - // BackupCRDResourceSingular defines the singular custom resource name for MySQL backups. - BackupCRDResourceSingular = "mysqlbackup" - - // BackupCRDResourcePlural defines the plural custom resource name for MySQL backups. - BackupCRDResourcePlural = "mysqlbackups" -) - -// BackupSpec defines the specification for a MySQL backup. This includes what should be backed up, -// what tool should perform the backup, and, where the backup should be stored. -type BackupSpec struct { - // Executor is the configuration of the tool that will produce the backup, and a definition of - // what databases and tables to backup. - Executor *Executor `json:"executor"` - - // Storage is the configuration of where and how backups should be stored. - Storage *Storage `json:"storage"` - - // ClusterRef is a reference to the MySQLCluster to which the MySQLBackup belongs. - ClusterRef *corev1.LocalObjectReference `json:"clusterRef"` - - // AgentScheduled is the agent hostname to run the backup on - AgentScheduled string `json:"agentscheduled"` -} - -// Executor represents the configuration of the tool performing the backup. This includes the tool -// to use, and, what database and tables should be backed up. -// The storage of the backup is configured in the relevant Storage configuration. -type Executor struct { - // The name of the tool performing the backup, e.g. mysqldump. - Provider string `json:"provider"` - // The databases to backup. - Databases []string `json:"databases"` -} - -// Storage defines the configuration for storing a MySQL backup to a storage service. -// The generation of the backup is configured in the Executor configuration. -type Storage struct { - // Provider denotes the type of storage provider that will store and retrieve the backups, - // e.g. s3, oci-s3-compat, aws-s3, gce-s3, etc. - Provider string `json:"provider"` - // SecretRef is a reference to the Kubernetes secret containing the configuration for uploading - // the backup to authenticated storage. - SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` - // Config is generic string based key-value map that defines non-secret configuration values for - // uploading the backup to storage w.r.t the configured storage provider. - Config map[string]string `json:"config,omitempty"` -} - -// BackupPhase represents the current life-cycle phase of a MySQLBackup. -type BackupPhase string - -const ( - // BackupPhaseUnknown means that the backup hasn't yet been processed. - BackupPhaseUnknown BackupPhase = "" - - // BackupPhaseNew means that the Backup hasn't yet been processed. - BackupPhaseNew BackupPhase = "New" - - // BackupPhaseScheduled means that the Backup has been scheduled on an - // appropriate replica. - BackupPhaseScheduled BackupPhase = "Scheduled" - - // BackupPhaseStarted means the backup is in progress. - BackupPhaseStarted BackupPhase = "Started" - - // BackupPhaseComplete means the backup has terminated successfully. - BackupPhaseComplete BackupPhase = "Complete" - - // BackupPhaseFailed means the backup has terminated with an error. - BackupPhaseFailed BackupPhase = "Failed" -) - -// BackupOutcome describes the location of a MySQL Backup -type BackupOutcome struct { - // Location is the Object Storage network location of the MySQLBackup. - Location string `json:"location"` -} - -// BackupStatus captures the current status of a MySQL backup. -type BackupStatus struct { - // Phase is the current life-cycle phase of the MySQLBackup. - Phase BackupPhase `json:"phase"` - - // Outcome holds the results of a successful backup. - Outcome BackupOutcome `json:"outcome"` - - // TimeStarted is the time at which the backup was started. - TimeStarted metav1.Time `json:"timeStarted"` - - // TimeCompleted is the time at which the backup completed. - TimeCompleted metav1.Time `json:"timeCompleted"` -} - -// +genclient -// +genclient:noStatus - -// MySQLBackup is a MySQL Operator resource that represents a backup of a MySQL -// cluster. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type MySQLBackup struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - - Spec BackupSpec `json:"spec"` - Status BackupStatus `json:"status"` -} - -// MySQLBackupList is a list of MySQLBackups. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type MySQLBackupList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []MySQLBackup `json:"items"` -} - -// EnsureDefaults can be invoked to ensure the default values are present. -func (b MySQLBackup) EnsureDefaults() *MySQLBackup { - buildVersion := version.GetBuildVersion() - if buildVersion != "" { - if b.Labels == nil { - b.Labels = make(map[string]string) - } - _, hasKey := b.Labels[constants.MySQLOperatorVersionLabel] - if !hasKey { - SetOperatorVersionLabel(b.Labels, buildVersion) - } - } - return &b -} - -// Validate checks if the resource spec is valid. -func (b MySQLBackup) Validate() error { - return validateBackup(&b).ToAggregate() -} diff --git a/pkg/apis/mysql/v1alpha1/backup_test.go b/pkg/apis/mysql/v1alpha1/backup_test.go deleted file mode 100644 index 1093f4001..000000000 --- a/pkg/apis/mysql/v1alpha1/backup_test.go +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - "strings" - "testing" - - corev1 "k8s.io/api/core/v1" - - "github.com/oracle/mysql-operator/pkg/version" -) - -func TestEmptyBackupIsInvalid(t *testing.T) { - backup := MySQLBackup{} - err := backup.Validate() - if err == nil { - t.Error("An empty backup should be invalid") - } -} - -func TestValidateValidBackup(t *testing.T) { - backup := MySQLBackup{ - Spec: BackupSpec{ - Executor: &Executor{ - Provider: "mysqldump", - Databases: []string{"db1", "db2"}, - }, - Storage: &Storage{ - Provider: "s3", - SecretRef: &corev1.LocalObjectReference{ - Name: "backup-storage-creds", - }, - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", - }, - }, - ClusterRef: &corev1.LocalObjectReference{ - Name: "test-cluster", - }, - }, - } - backup.Labels = make(map[string]string) - SetOperatorVersionLabel(backup.Labels, "v1.0.0") - err := backup.Validate() - if err != nil { - t.Errorf("Expected no validation errors but got %s", err) - } -} - -func TestBackupEnsureDefaultVersionSet(t *testing.T) { - expected := version.GetBuildVersion() - backup := &MySQLBackup{} - backup = backup.EnsureDefaults() - - actual := GetOperatorVersionLabel(backup.Labels) - if actual != expected { - t.Errorf("Expected version '%s' but got '%s'", expected, actual) - } -} - -func TestBackupEnsureDefaultVersionNotSetIfExists(t *testing.T) { - version := "v1.0.0" - backup := &MySQLBackup{} - backup.Labels = make(map[string]string) - SetOperatorVersionLabel(backup.Labels, version) - backup = backup.EnsureDefaults() - - actual := GetOperatorVersionLabel(backup.Labels) - - if actual != version { - t.Errorf("Expected version '%s' but got '%s'", version, actual) - } -} - -func TestValidateBackupMissingCluster(t *testing.T) { - backup := MySQLBackup{ - Spec: BackupSpec{ - Executor: &Executor{ - Provider: "mysqldump", - Databases: []string{"db1", "db2"}, - }, - Storage: &Storage{ - Provider: "s3", - SecretRef: &corev1.LocalObjectReference{ - Name: "backup-storage-creds", - }, - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", - }, - }, - }, - } - - err := backup.Validate() - if !strings.Contains(err.Error(), "missing cluster") { - t.Errorf("Expected backup with missing Cluster to show 'missing cluster' error. Error is: %s", err) - } -} - -func TestValidateBackupMissingSecretRef(t *testing.T) { - backup := MySQLBackup{ - Spec: BackupSpec{ - Executor: &Executor{ - Provider: "mysqldump", - Databases: []string{"db1", "db2"}, - }, - Storage: &Storage{ - Provider: "s3", - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", - }, - }, - ClusterRef: &corev1.LocalObjectReference{ - Name: "test-cluster", - }, - }, - } - - err := backup.Validate() - if !strings.Contains(err.Error(), "storage.secretRef: Required value") { - t.Errorf("Expected backup with missing SecretRef to show 'storage.secretRef: Required value' error. Error is: %s", err) - } -} - -// Error is: storage.secretRef: Required value diff --git a/pkg/apis/mysql/v1alpha1/backupschedule.go b/pkg/apis/mysql/v1alpha1/backupschedule.go deleted file mode 100644 index b0b1df406..000000000 --- a/pkg/apis/mysql/v1alpha1/backupschedule.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - "github.com/oracle/mysql-operator/pkg/constants" - "github.com/oracle/mysql-operator/pkg/version" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// BackupScheduleSpec defines the specification for a MySQL backup schedule. -type BackupScheduleSpec struct { - // Schedule specifies the cron string used for backup scheduling. - Schedule string `json:"schedule"` - - // BackupTemplate is the specification of the backup structure - // to get scheduled. - BackupTemplate BackupSpec `json:"backupTemplate"` -} - -// BackupSchedulePhase is a string representation of the lifecycle phase -// of a backup schedule. -type BackupSchedulePhase string - -const ( - // BackupSchedulePhaseNew means the backup schedule has been created but not - // yet processed by the backup schedule controller. - BackupSchedulePhaseNew BackupSchedulePhase = "New" - - // BackupSchedulePhaseEnabled means the backup schedule has been validated and - // will now be triggering backups according to the schedule spec. - BackupSchedulePhaseEnabled BackupSchedulePhase = "Enabled" - - // BackupSchedulePhaseFailedValidation means the backup schedule has failed - // the controller's validations and therefore will not trigger backups. - BackupSchedulePhaseFailedValidation BackupSchedulePhase = "FailedValidation" -) - -// ScheduleStatus captures the current state of a MySQL backup schedule. -type ScheduleStatus struct { - // Phase is the current phase of the MySQL backup schedule. - Phase BackupSchedulePhase `json:"phase"` - - // LastBackup is the last time a MySQLBackup was run for this - // backup schedule. - LastBackup metav1.Time `json:"lastBackup"` -} - -// +genclient -// +genclient:noStatus - -// MySQLBackupSchedule is a MySQL Operator resource that represents a backup -// schedule of a MySQL cluster. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type MySQLBackupSchedule struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - - Spec BackupScheduleSpec `json:"spec"` - Status ScheduleStatus `json:"status,omitempty"` -} - -// MySQLBackupScheduleList is a list of MySQLBackupSchedules. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type MySQLBackupScheduleList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []MySQLBackupSchedule `json:"items"` -} - -// EnsureDefaults can be invoked to ensure the default values are present. -func (b MySQLBackupSchedule) EnsureDefaults() *MySQLBackupSchedule { - buildVersion := version.GetBuildVersion() - if buildVersion != "" { - if b.Labels == nil { - b.Labels = make(map[string]string) - } - _, hasKey := b.Labels[constants.MySQLOperatorVersionLabel] - if !hasKey { - SetOperatorVersionLabel(b.Labels, buildVersion) - } - } - return &b -} - -// Validate checks if the resource spec is valid. -func (b MySQLBackupSchedule) Validate() error { - return validateBackupSchedule(&b).ToAggregate() -} diff --git a/pkg/apis/mysql/v1alpha1/backupschedule_test.go b/pkg/apis/mysql/v1alpha1/backupschedule_test.go deleted file mode 100644 index 152592276..000000000 --- a/pkg/apis/mysql/v1alpha1/backupschedule_test.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - "strings" - "testing" - - corev1 "k8s.io/api/core/v1" - - "github.com/oracle/mysql-operator/pkg/version" -) - -func TestEmptyBackupScheduleIsInvalid(t *testing.T) { - bs := MySQLBackupSchedule{} - err := bs.Validate() - if err == nil { - t.Error("An empty backup schedule should be invalid") - } -} - -func TestValidateValidBackupSchedule(t *testing.T) { - bs := MySQLBackupSchedule{ - Spec: BackupScheduleSpec{ - Schedule: "* * * * * *", - BackupTemplate: BackupSpec{ - Executor: &Executor{ - Provider: "mysqldump", - Databases: []string{"db1", "db2"}, - }, - Storage: &Storage{ - Provider: "s3", - SecretRef: &corev1.LocalObjectReference{ - Name: "backup-storage-creds", - }, - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", - }, - }, - ClusterRef: &corev1.LocalObjectReference{ - Name: "test-cluster", - }, - }, - }, - } - bs.Labels = make(map[string]string) - SetOperatorVersionLabel(bs.Labels, "v1.0.0") - err := bs.Validate() - if err != nil { - t.Errorf("Expected no validation errors but got %s", err) - } -} - -func TestBackupScheduleEnsureDefaultVersionSet(t *testing.T) { - expected := version.GetBuildVersion() - bs := &MySQLBackupSchedule{} - bs = bs.EnsureDefaults() - - actual := GetOperatorVersionLabel(bs.Labels) - if actual != expected { - t.Errorf("Expected version '%s' but got '%s'", expected, actual) - } -} - -func TestBackupScheduleEnsureDefaultVersionNotSetIfExists(t *testing.T) { - version := "v1.0.0" - bs := &MySQLBackupSchedule{} - bs.Labels = make(map[string]string) - SetOperatorVersionLabel(bs.Labels, version) - bs = bs.EnsureDefaults() - - actual := GetOperatorVersionLabel(bs.Labels) - - if actual != version { - t.Errorf("Expected version '%s' but got '%s'", version, actual) - } -} - -func TestValidateBackupScheduleMissingCluster(t *testing.T) { - bs := MySQLBackupSchedule{ - Spec: BackupScheduleSpec{ - Schedule: "* * * * * *", - BackupTemplate: BackupSpec{ - Executor: &Executor{ - Provider: "mysqldump", - Databases: []string{"db1", "db2"}, - }, - Storage: &Storage{ - Provider: "s3", - SecretRef: &corev1.LocalObjectReference{ - Name: "backup-storage-creds", - }, - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", - }, - }, - AgentScheduled: "hostname-1", - }, - }, - } - - err := bs.Validate() - if !strings.Contains(err.Error(), "missing cluster") { - t.Errorf("Expected backup schedule with missing Cluster to show 'missing cluster' error. Error is: %s", err) - } -} - -func TestValidateBackupScheduleMissingSecretRef(t *testing.T) { - bs := MySQLBackupSchedule{ - Spec: BackupScheduleSpec{ - Schedule: "* * * * * *", - BackupTemplate: BackupSpec{ - Executor: &Executor{ - Provider: "mysqldump", - Databases: []string{"db1", "db2"}, - }, - Storage: &Storage{ - Provider: "s3", - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", - }, - }, - ClusterRef: &corev1.LocalObjectReference{ - Name: "test-cluster", - }, - AgentScheduled: "hostname-1", - }, - }, - } - - err := bs.Validate() - if !strings.Contains(err.Error(), "storage.secretRef: Required value") { - t.Errorf("Expected backup schedule with missing SecretRef to show 'storage.secretRef: Required value' error. Error is: %s", err) - } -} diff --git a/pkg/apis/mysql/v1alpha1/cluster.go b/pkg/apis/mysql/v1alpha1/cluster.go deleted file mode 100644 index aab1c5033..000000000 --- a/pkg/apis/mysql/v1alpha1/cluster.go +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const ( - // The default MySQL version to use if not specified explicitly by user - defaultVersion = "8.0.11" - defaultReplicas = 1 - defaultBaseServerID = 1000 - // Max safe value for BaseServerID calculated as max MySQL server_id value - max Replication Group size - maxBaseServerID uint32 = 4294967295 - 9 -) - -// ClusterCRDResourcePlural defines the custom resource name for mysqlclusters -const ClusterCRDResourcePlural = "mysqlclusters" - -const ( - // MaxInnoDBClusterMembers is the maximum number of members supported by InnoDB - // group replication. - MaxInnoDBClusterMembers = 9 - - // MySQLClusterNameMaxLen is the maximum supported length of a - // MySQLCluster name. - // See: https://bugs.mysql.com/bug.php?id=90601 - MySQLClusterNameMaxLen = 28 -) - -// TODO (owain) we need to remove this because it's not reasonable for us to maintain a list -// of all the potential MySQL versions that can be used and in reality, it shouldn't matter -// too much. The burden of this is not worth the benfit to a user -var validVersions = []string{ - defaultVersion, -} - -// MySQLClusterSpec defines the attributes a user can specify when creating a cluster -type MySQLClusterSpec struct { - // Version defines the MySQL Docker image version. - Version string `json:"version"` - - // Replicas defines the number of running MySQL instances in a cluster - Replicas int32 `json:"replicas,omitempty"` - - // BaseServerID defines the base number used to create uniq server_id for MySQL instances in a cluster. - // The baseServerId value need to be in range from 1 to 4294967286 - // If ommited in the manifest file, or set to 0, defaultBaseServerID value will be used. - BaseServerID uint32 `json:"baseServerId,omitempty"` - - // MultiMaster defines the mode of the MySQL cluster. If set to true, - // all instances will be R/W. If false (the default), only a single instance - // will be R/W and the rest will be R/O. - MultiMaster bool `json:"multiMaster,omitempty"` - - // NodeSelector is a selector which must be true for the pod to fit on a node. - // Selector which must match a node's labels for the pod to be scheduled on that node. - // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ - // +optional - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - - // If specified, affinity will define the pod's scheduling constraints - // +optional - Affinity *corev1.Affinity `json:"affinity,omitempty"` - - // VolumeClaimTemplate allows a user to specify how volumes inside a MySQL cluster - // +optional - VolumeClaimTemplate *corev1.PersistentVolumeClaim `json:"volumeClaimTemplate,omitempty"` - - // BackupVolumeClaimTemplate allows a user to specify a volume to temporarily store the - // data for a backup prior to it being shipped to object storage. - // +optional - BackupVolumeClaimTemplate *corev1.PersistentVolumeClaim `json:"backupVolumeClaimTemplate,omitempty"` - - // If defined, we use this secret for configuring the MYSQL_ROOT_PASSWORD - // If it is not set we generate a secret dynamically - // +optional - SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` - - // ConfigRef allows a user to specify a custom configuration file for MySQL. - // +optional - ConfigRef *corev1.LocalObjectReference `json:"configRef,omitempty"` - - // SSLSecretRef allows a user to specify custom CA certificate, server certificate - // and server key for group replication SSL - // +optional - SSLSecretRef *corev1.LocalObjectReference `json:"sslSecretRef,omitempty"` -} - -// MySQLClusterPhase describes the state of the cluster. -type MySQLClusterPhase string - -const ( - // MySQLClusterPending means the cluster has been accepted by the system, - // but one or more of the services or statefulsets has not been started. - // This includes time before being bound to a node, as well as time spent - // pulling images onto the host. - MySQLClusterPending MySQLClusterPhase = "Pending" - - // MySQLClusterRunning means the cluster has been created, all of it's - // required components are present, and there is at least one endpoint that - // mysql client can connect to. - MySQLClusterRunning MySQLClusterPhase = "Running" - - // MySQLClusterSucceeded means that all containers in the pod have - // voluntarily terminated with a container exit code of 0, and the system - // is not going to restart any of these containers. - MySQLClusterSucceeded MySQLClusterPhase = "Succeeded" - - // MySQLClusterFailed means that all containers in the pod have terminated, - // and at least one container has terminated in a failure (exited with a - // non-zero exit code or was stopped by the system). - MySQLClusterFailed MySQLClusterPhase = "Failed" - - // MySQLClusterUnknown means that for some reason the state of the cluster - // could not be obtained, typically due to an error in communicating with - // the host of the pod. - MySQLClusterUnknown MySQLClusterPhase = "" -) - -// MySQLClusterValidPhases denote the life-cycle states a cluster can be in. -var MySQLClusterValidPhases = []MySQLClusterPhase{ - MySQLClusterPending, - MySQLClusterRunning, - MySQLClusterSucceeded, - MySQLClusterFailed, - MySQLClusterUnknown} - -// MySQLClusterStatus defines the current status of a MySQL cluster -// propagating useful information back to the cluster admin -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type MySQLClusterStatus struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - Phase MySQLClusterPhase `json:"phase"` - Errors []string `json:"errors"` -} - -// +genclient -// +genclient:noStatus - -// MySQLCluster represents a cluster spec and associated metadata -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type MySQLCluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - Spec MySQLClusterSpec `json:"spec"` - Status MySQLClusterStatus `json:"status"` -} - -// MySQLClusterList is a placeholder type for a list of MySQL clusters -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type MySQLClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - Items []MySQLCluster `json:"items"` -} - -// Validate returns an error if a cluster is invalid -func (c *MySQLCluster) Validate() error { - return validateCluster(c).ToAggregate() -} - -// EnsureDefaults will ensure that if a user omits and fields in the -// spec that are required, we set some sensible defaults. -// For example a user can choose to omit the version -// and number of replics -func (c *MySQLCluster) EnsureDefaults() *MySQLCluster { - if c.Spec.Replicas == 0 { - c.Spec.Replicas = defaultReplicas - } - - if c.Spec.BaseServerID == 0 { - c.Spec.BaseServerID = defaultBaseServerID - } - - if c.Spec.Version == "" { - c.Spec.Version = defaultVersion - } - - return c -} - -// RequiresConfigMount will return true if a user has specified a config map -// for configuring the cluster else false -func (c *MySQLCluster) RequiresConfigMount() bool { - return c.Spec.ConfigRef != nil -} - -// RequiresSecret returns true if a secret should be generated -// for a MySQL cluster else false -func (c *MySQLCluster) RequiresSecret() bool { - return c.Spec.SecretRef == nil -} - -// RequiresCustomSSLSetup returns true is the user has provided a secret -// that contains CA cert, server cert and server key for group replication -// SSL support -func (c *MySQLCluster) RequiresCustomSSLSetup() bool { - return c.Spec.SSLSecretRef != nil -} - -// GetObjectKind is required for codegen -func (c *MySQLCluster) GetObjectKind() schema.ObjectKind { - return &c.TypeMeta -} - -// GetObjectKind is required for codegen -func (c *MySQLClusterStatus) GetObjectKind() schema.ObjectKind { - return &c.TypeMeta -} - -// GetObjectKind is required for codegen -func (c *MySQLClusterList) GetObjectKind() schema.ObjectKind { - return &c.TypeMeta -} diff --git a/pkg/apis/mysql/v1alpha1/cluster_test.go b/pkg/apis/mysql/v1alpha1/cluster_test.go index 5ce02bfb3..ed867fd66 100644 --- a/pkg/apis/mysql/v1alpha1/cluster_test.go +++ b/pkg/apis/mysql/v1alpha1/cluster_test.go @@ -38,17 +38,17 @@ func TestInvalidVersion(t *testing.T) { } } -func TestDefaultReplicas(t *testing.T) { - cluster := &MySQLCluster{} +func TestDefaultMembers(t *testing.T) { + cluster := &Cluster{} cluster.EnsureDefaults() - if cluster.Spec.Replicas != defaultReplicas { - t.Errorf("Expected default replicas to be %d but got %d", defaultReplicas, cluster.Spec.Replicas) + if cluster.Spec.Members != defaultMembers { + t.Errorf("Expected default members to be %d but got %d", defaultMembers, cluster.Spec.Members) } } func TestDefaultBaseServerID(t *testing.T) { - cluster := &MySQLCluster{} + cluster := &Cluster{} cluster.EnsureDefaults() if cluster.Spec.BaseServerID != defaultBaseServerID { @@ -57,7 +57,7 @@ func TestDefaultBaseServerID(t *testing.T) { } func TestDefaultVersion(t *testing.T) { - cluster := &MySQLCluster{} + cluster := &Cluster{} cluster.EnsureDefaults() if cluster.Spec.Version != defaultVersion { @@ -66,39 +66,39 @@ func TestDefaultVersion(t *testing.T) { } func TestRequiresConfigMount(t *testing.T) { - cluster := &MySQLCluster{} + cluster := &Cluster{} cluster.EnsureDefaults() if cluster.RequiresConfigMount() { - t.Errorf("Cluster without configRef should not require a config mount") + t.Errorf("Cluster without config should not require a config mount") } - cluster = &MySQLCluster{ - Spec: MySQLClusterSpec{ - ConfigRef: &corev1.LocalObjectReference{ + cluster = &Cluster{ + Spec: ClusterSpec{ + Config: &corev1.LocalObjectReference{ Name: "customconfig", }, }, } if !cluster.RequiresConfigMount() { - t.Errorf("Cluster with configRef should require a config mount") + t.Errorf("Cluster with config should require a config mount") } } func TestRequiresCustomSSLSetup(t *testing.T) { - cluster := &MySQLCluster{} + cluster := &Cluster{} cluster.EnsureDefaults() - assert.False(t, cluster.RequiresCustomSSLSetup(), "Cluster without SSLSecretRef should not require custom SSL setup") + assert.False(t, cluster.RequiresCustomSSLSetup(), "Cluster without SSLSecret should not require custom SSL setup") - cluster = &MySQLCluster{ - Spec: MySQLClusterSpec{ - SSLSecretRef: &corev1.LocalObjectReference{ + cluster = &Cluster{ + Spec: ClusterSpec{ + SSLSecret: &corev1.LocalObjectReference{ Name: "custom-ssl-secret", }, }, } - assert.True(t, cluster.RequiresCustomSSLSetup(), "Cluster with SSLSecretRef should require custom SSL setup") + assert.True(t, cluster.RequiresCustomSSLSetup(), "Cluster with SSLSecret should require custom SSL setup") } diff --git a/pkg/apis/mysql/v1alpha1/doc.go b/pkg/apis/mysql/v1alpha1/doc.go index d329ffd41..705d05d7b 100644 --- a/pkg/apis/mysql/v1alpha1/doc.go +++ b/pkg/apis/mysql/v1alpha1/doc.go @@ -13,7 +13,8 @@ // limitations under the License. // +k8s:deepcopy-gen=package - -// Package v1 defines the types for the MySQL Operator v1 API. // +groupName=mysql.oracle.com +// +groupGoName=MySQL + +// Package v1alpha1 defines the types for the MySQL Operator v1alpha1 API. package v1alpha1 diff --git a/pkg/apis/mysql/v1alpha1/helpers.go b/pkg/apis/mysql/v1alpha1/helpers.go new file mode 100644 index 000000000..51106eff8 --- /dev/null +++ b/pkg/apis/mysql/v1alpha1/helpers.go @@ -0,0 +1,162 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 + +import ( + "github.com/oracle/mysql-operator/pkg/constants" + "github.com/oracle/mysql-operator/pkg/version" +) + +const ( + // The default MySQL version to use if not specified explicitly by user + defaultVersion = "8.0.11" + defaultMembers = 3 + defaultBaseServerID = 1000 + // maxBaseServerID is the maximum safe value for BaseServerID calculated + // as max MySQL server_id value - max Replication Group size. + maxBaseServerID uint32 = 4294967295 - 9 +) + +const ( + // MaxInnoDBClusterMembers is the maximum number of members supported by InnoDB + // group replication. + MaxInnoDBClusterMembers = 9 + + // ClusterNameMaxLen is the maximum supported length of a + // Cluster name. + // See: https://bugs.mysql.com/bug.php?id=90601 + ClusterNameMaxLen = 28 +) + +// TODO (owain) we need to remove this because it's not reasonable for us to maintain a list +// of all the potential MySQL versions that can be used and in reality, it shouldn't matter +// too much. The burden of this is not worth the benfit to a user +var validVersions = []string{ + defaultVersion, +} + +// setOperatorVersionLabel sets the specified operator version label on the label map. +func setOperatorVersionLabel(labelMap map[string]string, label string) { + labelMap[constants.MySQLOperatorVersionLabel] = label +} + +// getOperatorVersionLabel get the specified operator version label on the label map. +func getOperatorVersionLabel(labelMap map[string]string) string { + return labelMap[constants.MySQLOperatorVersionLabel] +} + +// EnsureDefaults will ensure that if a user omits and fields in the +// spec that are required, we set some sensible defaults. +// For example a user can choose to omit the version +// and number of members. +func (c *Cluster) EnsureDefaults() *Cluster { + if c.Spec.Members == 0 { + c.Spec.Members = defaultMembers + } + + if c.Spec.BaseServerID == 0 { + c.Spec.BaseServerID = defaultBaseServerID + } + + if c.Spec.Version == "" { + c.Spec.Version = defaultVersion + } + + return c +} + +// Validate returns an error if a cluster is invalid +func (c *Cluster) Validate() error { + return validateCluster(c).ToAggregate() +} + +// RequiresConfigMount will return true if a user has specified a config map +// for configuring the cluster else false +func (c *Cluster) RequiresConfigMount() bool { + return c.Spec.Config != nil +} + +// RequiresSecret returns true if a secret should be generated +// for a MySQL cluster else false +func (c *Cluster) RequiresSecret() bool { + return c.Spec.RootPasswordSecret == nil +} + +// RequiresCustomSSLSetup returns true is the user has provided a secret +// that contains CA cert, server cert and server key for group replication +// SSL support +func (c *Cluster) RequiresCustomSSLSetup() bool { + return c.Spec.SSLSecret != nil +} + +// EnsureDefaults can be invoked to ensure the default values are present. +func (b Backup) EnsureDefaults() *Backup { + buildVersion := version.GetBuildVersion() + if buildVersion != "" { + if b.Labels == nil { + b.Labels = make(map[string]string) + } + _, hasKey := b.Labels[constants.MySQLOperatorVersionLabel] + if !hasKey { + setOperatorVersionLabel(b.Labels, buildVersion) + } + } + return &b +} + +// Validate checks if the resource spec is valid. +func (b Backup) Validate() error { + return validateBackup(&b).ToAggregate() +} + +// EnsureDefaults can be invoked to ensure the default values are present. +func (b BackupSchedule) EnsureDefaults() *BackupSchedule { + buildVersion := version.GetBuildVersion() + if buildVersion != "" { + if b.Labels == nil { + b.Labels = make(map[string]string) + } + _, hasKey := b.Labels[constants.MySQLOperatorVersionLabel] + if !hasKey { + setOperatorVersionLabel(b.Labels, buildVersion) + } + } + return &b +} + +// Validate checks if the resource spec is valid. +func (b BackupSchedule) Validate() error { + return validateBackupSchedule(&b).ToAggregate() +} + +// EnsureDefaults can be invoked to ensure the default values are present. +func (r Restore) EnsureDefaults() *Restore { + buildVersion := version.GetBuildVersion() + if buildVersion != "" { + if r.Labels == nil { + r.Labels = make(map[string]string) + } + _, hasKey := r.Labels[constants.MySQLOperatorVersionLabel] + if !hasKey { + setOperatorVersionLabel(r.Labels, buildVersion) + } + } + return &r +} + +// Validate checks if the resource spec is valid. +func (r Restore) Validate() error { + return validateRestore(&r).ToAggregate() +} diff --git a/pkg/apis/mysql/v1alpha1/metadata.go b/pkg/apis/mysql/v1alpha1/metadata.go deleted file mode 100644 index b2ce591f8..000000000 --- a/pkg/apis/mysql/v1alpha1/metadata.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import "github.com/oracle/mysql-operator/pkg/constants" - -// SetOperatorVersionLabel sets the specified operator version label on the label map. -func SetOperatorVersionLabel(labelMap map[string]string, label string) { - labelMap[constants.MySQLOperatorVersionLabel] = label -} - -// GetOperatorVersionLabel get the specified operator version label on the label map. -func GetOperatorVersionLabel(labelMap map[string]string) string { - return labelMap[constants.MySQLOperatorVersionLabel] -} diff --git a/pkg/apis/mysql/v1alpha1/register.go b/pkg/apis/mysql/v1alpha1/register.go index 1bb3c9909..1b408ec1e 100644 --- a/pkg/apis/mysql/v1alpha1/register.go +++ b/pkg/apis/mysql/v1alpha1/register.go @@ -38,14 +38,14 @@ const GroupName = "mysql.oracle.com" var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} const ( - // MySQLClusterCRDResourceKind is the Kind of a MySQLCluster. - MySQLClusterCRDResourceKind = "MySQLCluster" - // MySQLBackupCRDResourceKind is the Kind of a MySQLBackup. - MySQLBackupCRDResourceKind = "MySQLBackup" - // MySQLRestoreCRDResourceKind is the Kind of a MySQLRestore. - MySQLRestoreCRDResourceKind = "MySQLRestore" - // MySQLBackupScheduleCRDResourceKind is the Kind of a MySQLBackupSchedule. - MySQLBackupScheduleCRDResourceKind = "MySQLBackupSchedule" + // ClusterCRDResourceKind is the Kind of a Cluster. + ClusterCRDResourceKind = "Cluster" + // BackupCRDResourceKind is the Kind of a Backup. + BackupCRDResourceKind = "Backup" + // RestoreCRDResourceKind is the Kind of a Restore. + RestoreCRDResourceKind = "Restore" + // BackupScheduleCRDResourceKind is the Kind of a BackupSchedule. + BackupScheduleCRDResourceKind = "BackupSchedule" ) // Resource gets a MySQL Operator GroupResource for a specified resource. @@ -57,14 +57,14 @@ func Resource(resource string) schema.GroupResource { // scheme. func addKnownTypes(s *runtime.Scheme) error { s.AddKnownTypes(SchemeGroupVersion, - &MySQLCluster{}, - &MySQLClusterList{}, - &MySQLBackup{}, - &MySQLBackupList{}, - &MySQLRestore{}, - &MySQLRestoreList{}, - &MySQLBackupSchedule{}, - &MySQLBackupScheduleList{}) + &Cluster{}, + &ClusterList{}, + &Backup{}, + &BackupList{}, + &Restore{}, + &RestoreList{}, + &BackupSchedule{}, + &BackupScheduleList{}) metav1.AddToGroupVersion(s, SchemeGroupVersion) return nil } diff --git a/pkg/apis/mysql/v1alpha1/restore.go b/pkg/apis/mysql/v1alpha1/restore.go deleted file mode 100644 index f0c851499..000000000 --- a/pkg/apis/mysql/v1alpha1/restore.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - "github.com/oracle/mysql-operator/pkg/constants" - "github.com/oracle/mysql-operator/pkg/version" - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // RestoreCRDResourceSingular defines the singular custom resource name for - // MySQLRestores. - RestoreCRDResourceSingular = "mysqlrestore" - - // RestoreCRDResourcePlural defines the plural custom resource name for - // MySQLRestores. - RestoreCRDResourcePlural = "mysqlrestores" -) - -// RestoreSpec defines the specification for a restore of a MySQL backup. -type RestoreSpec struct { - // ClusterRef is a refeference to the MySQLCluster to which the MySQLRestore - // belongs. - ClusterRef *v1.LocalObjectReference `json:"clusterRef"` - - // BackupRef is a reference to the MySQLBackup object to be restored. - BackupRef *v1.LocalObjectReference `json:"backupRef"` - - // AgentScheduled is the agent hostname to run the backup on - AgentScheduled string `json:"agentscheduled"` -} - -// RestorePhase represents the current life-cycle phase of a MySQLRestore. -type RestorePhase string - -const ( - // RestorePhaseUnknown means that the restore hasn't yet been processed. - RestorePhaseUnknown RestorePhase = "" - - // RestorePhaseNew means that the restore hasn't yet been processed. - RestorePhaseNew RestorePhase = "New" - - // RestorePhaseScheduled means that the restore has been scheduled on an - // appropriate replica. - RestorePhaseScheduled RestorePhase = "Scheduled" - - // RestorePhaseStarted means the restore is in progress. - RestorePhaseStarted RestorePhase = "Started" - - // RestorePhaseComplete means the restore has terminated successfully. - RestorePhaseComplete RestorePhase = "Complete" - - // RestorePhaseFailed means the Restore has terminated with an error. - RestorePhaseFailed RestorePhase = "Failed" -) - -// RestoreStatus captures the current status of a MySQL restore. -type RestoreStatus struct { - // Phase is the current life-cycle phase of the MySQLRestore. - Phase RestorePhase `json:"phase"` - - // TimeStarted is the time at which the restore was started. - TimeStarted metav1.Time `json:"timeStarted"` - - // TimeCompleted is the time at which the restore completed. - TimeCompleted metav1.Time `json:"timeCompleted"` -} - -// +genclient -// +genclient:noStatus - -// MySQLRestore is a MySQL Operator resource that represents the restoration of -// backup of a MySQL cluster. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type MySQLRestore struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - - Spec RestoreSpec `json:"spec"` - Status RestoreStatus `json:"status"` -} - -// MySQLRestoreList is a list of MySQLRestores. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type MySQLRestoreList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []MySQLRestore `json:"items"` -} - -// EnsureDefaults can be invoked to ensure the default values are present. -func (r MySQLRestore) EnsureDefaults() *MySQLRestore { - buildVersion := version.GetBuildVersion() - if buildVersion != "" { - if r.Labels == nil { - r.Labels = make(map[string]string) - } - _, hasKey := r.Labels[constants.MySQLOperatorVersionLabel] - if !hasKey { - SetOperatorVersionLabel(r.Labels, buildVersion) - } - } - return &r -} - -// Validate checks if the resource spec is valid. -func (r MySQLRestore) Validate() error { - return validateRestore(&r).ToAggregate() -} diff --git a/pkg/apis/mysql/v1alpha1/restore_test.go b/pkg/apis/mysql/v1alpha1/restore_test.go deleted file mode 100644 index f0badfd15..000000000 --- a/pkg/apis/mysql/v1alpha1/restore_test.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - "testing" - - corev1 "k8s.io/api/core/v1" - - "github.com/oracle/mysql-operator/pkg/version" -) - -func TestRestoreEnsureDefaults(t *testing.T) { - // test a version is set if one does not exist. - bv1 := version.GetBuildVersion() - r := MySQLRestore{ - Spec: RestoreSpec{ - ClusterRef: &corev1.LocalObjectReference{ - Name: "foo", - }, - BackupRef: &corev1.LocalObjectReference{ - Name: "foo", - }, - }, - } - dr := *r.EnsureDefaults() - if GetOperatorVersionLabel(dr.Labels) != bv1 { - t.Errorf("Expected restore version label: '%s'", bv1) - } - // test a version is not set if one already exists. - bv2 := "test-existing-build-version" - r2 := MySQLRestore{} - r2.Labels = make(map[string]string) - SetOperatorVersionLabel(r2.Labels, bv2) - dr2 := *r2.EnsureDefaults() - if GetOperatorVersionLabel(dr2.Labels) != bv2 { - t.Errorf("Expected restore version label: '%s'", bv2) - } -} - -func TestRestoreValidate(t *testing.T) { - // Test a malformed restore returns errors. - r := MySQLRestore{ - Spec: RestoreSpec{ - ClusterRef: &corev1.LocalObjectReference{ - Name: "foo", - }, - BackupRef: &corev1.LocalObjectReference{ - Name: "foo", - }, - }, - } - rErr := r.Validate() - if rErr == nil { - t.Error("Restore should have had a validation error.") - } - // Test a valid restore returns no errors. - r.Labels = make(map[string]string) - SetOperatorVersionLabel(r.Labels, "some-build-version") - rErr = r.Validate() - if rErr != nil { - t.Errorf("Restore should have had no validation errors: %v", rErr) - } -} diff --git a/pkg/apis/mysql/v1alpha1/types.go b/pkg/apis/mysql/v1alpha1/types.go new file mode 100644 index 000000000..4adf9aca0 --- /dev/null +++ b/pkg/apis/mysql/v1alpha1/types.go @@ -0,0 +1,367 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ClusterSpec defines the attributes a user can specify when creating a cluster +type ClusterSpec struct { + // Version defines the MySQL Docker image version. + Version string `json:"version"` + // Members defines the number of MySQL instances in a cluster + Members int32 `json:"members,omitempty"` + // BaseServerID defines the base number used to create uniq server_id for MySQL instances in a cluster. + // The baseServerId value need to be in range from 1 to 4294967286 + // If ommited in the manifest file, or set to 0, defaultBaseServerID value will be used. + BaseServerID uint32 `json:"baseServerId,omitempty"` + // MultiMaster defines the mode of the MySQL cluster. If set to true, + // all instances will be R/W. If false (the default), only a single instance + // will be R/W and the rest will be R/O. + MultiMaster bool `json:"multiMaster,omitempty"` + // NodeSelector is a selector which must be true for the pod to fit on a node. + // Selector which must match a node's labels for the pod to be scheduled on that node. + // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + // +optional + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + // If specified, affinity will define the pod's scheduling constraints + // +optional + Affinity *corev1.Affinity `json:"affinity,omitempty"` + // VolumeClaimTemplate allows a user to specify how volumes inside a MySQL cluster + // +optional + VolumeClaimTemplate *corev1.PersistentVolumeClaim `json:"volumeClaimTemplate,omitempty"` + // BackupVolumeClaimTemplate allows a user to specify a volume to temporarily store the + // data for a backup prior to it being shipped to object storage. + // +optional + BackupVolumeClaimTemplate *corev1.PersistentVolumeClaim `json:"backupVolumeClaimTemplate,omitempty"` + // If defined, we use this secret for configuring the MYSQL_ROOT_PASSWORD + // If it is not set we generate a secret dynamically + // +optional + RootPasswordSecret *corev1.LocalObjectReference `json:"rootPasswordSecret,omitempty"` + // Config allows a user to specify a custom configuration file for MySQL. + // +optional + Config *corev1.LocalObjectReference `json:"config,omitempty"` + // SSLSecret allows a user to specify custom CA certificate, server certificate + // and server key for group replication SSL. + // +optional + SSLSecret *corev1.LocalObjectReference `json:"sslSecret,omitempty"` +} + +// ClusterConditionType represents a valid condition of a Cluster. +type ClusterConditionType string + +const ( + // ClusterReady means the Cluster is able to service requests. + ClusterReady ClusterConditionType = "Ready" +) + +// ClusterCondition describes the observed state of a Cluster at a certain point. +type ClusterCondition struct { + Type ClusterConditionType + Status corev1.ConditionStatus + // +optional + LastTransitionTime metav1.Time + // +optional + Reason string + // +optional + Message string +} + +// ClusterStatus defines the current status of a MySQL cluster +// propagating useful information back to the cluster admin +type ClusterStatus struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + + // +optional + Conditions []ClusterCondition +} + +// +genclient +// +genclient:noStatus +// +resourceName=mysqlclusters +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Cluster represents a cluster spec and associated metadata +type Cluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + + Spec ClusterSpec `json:"spec"` + Status ClusterStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterList is a placeholder type for a list of MySQL clusters +type ClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []Cluster `json:"items"` +} + +// Database represents a database to backup. +type Database struct { + Name string `json:"name"` +} + +// MySQLDumpBackupExecutor executes backups using mysqldump. +type MySQLDumpBackupExecutor struct { + Databases []Database `json:"databases"` +} + +// BackupExecutor represents the configuration of the tool performing the backup. This includes the tool +// to use, and, what database and tables should be backed up. +// The storage of the backup is configured in the relevant Storage configuration. +type BackupExecutor struct { + MySQLDump *MySQLDumpBackupExecutor `json:"mysqldump"` +} + +// S3StorageProvider represents an S3 compatible bucket for storing Backups. +type S3StorageProvider struct { + // Region in which the S3 compatible bucket is located. + Region string `json:"region"` + // Endpoint (hostname only or fully qualified URI) of S3 compatible + // storage service. + Endpoint string `json:"endpoint"` + // Bucket in which to store the Backup. + Bucket string `json:"bucket"` + // ForcePathStyle when set to true forces the request to use path-style + // addressing, i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, + // the S3 client will use virtual hosted bucket addressing when possible + // (`http://BUCKET.s3.amazonaws.com/KEY`). + ForcePathStyle bool `json:"forcePathStyle"` + // CredentialsSecret is a reference to the Secret containing the + // credentials authenticating with the S3 compatible storage service. + CredentialsSecret *corev1.LocalObjectReference `json:"credentialsSecret"` +} + +// StorageProvider defines the configuration for storing a Backup in a storage +// service. +type StorageProvider struct { + S3 *S3StorageProvider `json:"s3"` +} + +// BackupSpec defines the specification for a MySQL backup. This includes what should be backed up, +// what tool should perform the backup, and, where the backup should be stored. +type BackupSpec struct { + // Executor is the configuration of the tool that will produce the backup, and a definition of + // what databases and tables to backup. + Executor BackupExecutor `json:"executor"` + // StorageProvider configures where and how backups should be stored. + StorageProvider StorageProvider `json:"storageProvider"` + // Cluster is the Cluster to backup. + Cluster *corev1.LocalObjectReference `json:"cluster"` + // ScheduledMember is the Pod name of the Cluster member on which the + // Backup will be executed. + ScheduledMember string `json:"scheduledMember"` +} + +// BackupConditionType represents a valid condition of a Backup. +type BackupConditionType string + +const ( + // BackupScheduled means the Backup has been assigned to a Cluster + // member for execution. + BackupScheduled BackupConditionType = "Scheduled" + // BackupRunning means the Backup is currently being executed by a + // Cluster member's mysql-agent side-car. + BackupRunning BackupConditionType = "Running" + // BackupComplete means the Backup has successfully executed and the + // resulting artifact has been stored in object storage. + BackupComplete BackupConditionType = "Complete" + // BackupFailed means the Backup has failed. + BackupFailed BackupConditionType = "Failed" +) + +// BackupCondition describes the observed state of a Backup at a certain point. +type BackupCondition struct { + Type BackupConditionType + Status corev1.ConditionStatus + // +optional + LastTransitionTime metav1.Time + // +optional + Reason string + // +optional + Message string +} + +// BackupOutcome describes the location of a Backup +type BackupOutcome struct { + // Location is the Object Storage network location of the Backup. + Location string `json:"location"` +} + +// BackupStatus captures the current status of a Backup. +type BackupStatus struct { + // Outcome holds the results of a successful backup. + // +optional + Outcome BackupOutcome `json:"outcome"` + // TimeStarted is the time at which the backup was started. + // +optional + TimeStarted metav1.Time `json:"timeStarted"` + // TimeCompleted is the time at which the backup completed. + // +optional + TimeCompleted metav1.Time `json:"timeCompleted"` + // +optional + Conditions []BackupCondition +} + +// +genclient +// +genclient:noStatus +// +resourceName=mysqlbackups +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Backup is a backup of a Cluster. +type Backup struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + + Spec BackupSpec `json:"spec"` + Status BackupStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// BackupList is a list of Backups. +type BackupList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []Backup `json:"items"` +} + +// BackupScheduleSpec defines the specification for a MySQL backup schedule. +type BackupScheduleSpec struct { + // Schedule specifies the cron string used for backup scheduling. + Schedule string `json:"schedule"` + + // BackupTemplate is the specification of the backup structure + // to get scheduled. + BackupTemplate BackupSpec `json:"backupTemplate"` +} + +// ScheduleStatus captures the current state of a MySQL backup schedule. +type ScheduleStatus struct { + // LastBackup is the last time a Backup was run for this + // backup schedule. + // +optional + LastBackup metav1.Time `json:"lastBackup"` +} + +// +genclient +// +genclient:noStatus +// +resourceName=mysqlbackupschedules +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// BackupSchedule is a backup schedule for a Cluster. +type BackupSchedule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + + Spec BackupScheduleSpec `json:"spec"` + Status ScheduleStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// BackupScheduleList is a list of BackupSchedules. +type BackupScheduleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []BackupSchedule `json:"items"` +} + +// RestoreConditionType represents a valid condition of a Restore. +type RestoreConditionType string + +const ( + // RestoreScheduled means the Restore has been assigned to a Cluster + // member for execution. + RestoreScheduled RestoreConditionType = "Scheduled" + // RestoreRunning means the Restore is currently being executed by a + // Cluster member's mysql-agent side-car. + RestoreRunning RestoreConditionType = "Running" + // RestoreComplete means the Restore has successfully executed and the + // resulting artifact has been stored in object storage. + RestoreComplete RestoreConditionType = "Complete" + // RestoreFailed means the Restore has failed. + RestoreFailed RestoreConditionType = "Failed" +) + +// RestoreCondition describes the observed state of a Restore at a certain point. +type RestoreCondition struct { + Type RestoreConditionType + Status corev1.ConditionStatus + // +optional + LastTransitionTime metav1.Time + // +optional + Reason string + // +optional + Message string +} + +// RestoreSpec defines the specification for a restore of a MySQL backup. +type RestoreSpec struct { + // Cluster is a refeference to the Cluster to which the Restore + // belongs. + Cluster *corev1.LocalObjectReference `json:"cluster"` + // Backup is a reference to the Backup object to be restored. + Backup *corev1.LocalObjectReference `json:"backup"` + // ScheduledMember is the Pod name of the Cluster member on which the + // Restore will be executed. + ScheduledMember string `json:"scheduledMember"` +} + +// RestoreStatus captures the current status of a MySQL restore. +type RestoreStatus struct { + // TimeStarted is the time at which the restore was started. + // +optional + TimeStarted metav1.Time `json:"timeStarted"` + // TimeCompleted is the time at which the restore completed. + // +optional + TimeCompleted metav1.Time `json:"timeCompleted"` + // +optional + Conditions []RestoreCondition +} + +// +genclient +// +genclient:noStatus +// +resourceName=mysqlrestores +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Restore is a MySQL Operator resource that represents the restoration of +// backup of a MySQL cluster. +type Restore struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + + Spec RestoreSpec `json:"spec"` + Status RestoreStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// RestoreList is a list of Restores. +type RestoreList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []Restore `json:"items"` +} diff --git a/pkg/apis/mysql/v1alpha1/validate_backup.go b/pkg/apis/mysql/v1alpha1/validate_backup.go deleted file mode 100644 index ca1147a2a..000000000 --- a/pkg/apis/mysql/v1alpha1/validate_backup.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/util/validation/field" - - "github.com/oracle/mysql-operator/pkg/constants" -) - -func validateBackup(backup *MySQLBackup) field.ErrorList { - allErrs := field.ErrorList{} - allErrs = append(allErrs, validateBackupLabels(backup.Labels, field.NewPath("labels"))...) - allErrs = append(allErrs, validateBackupSpec(backup.Spec, field.NewPath("spec"))...) - - return allErrs -} - -func validateBackupLabels(labels map[string]string, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - if labels[constants.MySQLOperatorVersionLabel] == "" { - errorStr := fmt.Sprintf("no '%s' present.", constants.MySQLOperatorVersionLabel) - allErrs = append(allErrs, field.Invalid(fldPath, labels, errorStr)) - } - return allErrs -} - -func validateBackupSpec(spec BackupSpec, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if spec.Executor == nil { - allErrs = append(allErrs, field.Required(fldPath.Child("executor"), "missing executor")) - } else { - allErrs = append(allErrs, validateExecutor(spec.Executor, field.NewPath("executor"))...) - } - - if spec.Storage == nil { - allErrs = append(allErrs, field.Required(fldPath.Child("storage"), "missing storage")) - } else { - allErrs = append(allErrs, validateStorage(spec.Storage, field.NewPath("storage"))...) - } - - if spec.ClusterRef == nil { - allErrs = append(allErrs, field.Required(fldPath.Child("clusterRef"), "missing cluster")) - } - - return allErrs -} diff --git a/pkg/apis/mysql/v1alpha1/validate_backup_executor.go b/pkg/apis/mysql/v1alpha1/validate_backup_executor.go deleted file mode 100644 index a80af3a45..000000000 --- a/pkg/apis/mysql/v1alpha1/validate_backup_executor.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/util/validation/field" -) - -// ExecutorProviders denotes the list of valid backup executor providers. -var ExecutorProviders = []string{"mysqldump"} - -func isValidExecutorProvider(provider string) bool { - for _, ex := range ExecutorProviders { - if provider == ex { - return true - } - } - - return false -} - -func validateExecutor(executor *Executor, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if executor.Provider == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("provider"), "")) - } else if !isValidExecutorProvider(executor.Provider) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("provider"), executor, fmt.Sprintf("invalid provider name '%s'", executor.Provider))) - } - - if executor.Databases == nil || len(executor.Databases) == 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("databases"), executor, "missing databases")) - } - - return allErrs -} diff --git a/pkg/apis/mysql/v1alpha1/validate_backup_storage.go b/pkg/apis/mysql/v1alpha1/validate_backup_storage.go deleted file mode 100644 index 44438d88b..000000000 --- a/pkg/apis/mysql/v1alpha1/validate_backup_storage.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - "fmt" - "strings" - - "k8s.io/apimachinery/pkg/util/validation/field" -) - -const ( - // ProviderS3 denotes S3 compatability backed storage provider. - ProviderS3 = "s3" -) - -func validateStorage(storage *Storage, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if storage.Provider == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("provider"), "")) - } - - if storage.Config == nil { - allErrs = append(allErrs, field.Required(fldPath.Child("config"), "")) - } else { - switch strings.ToLower(storage.Provider) { - case ProviderS3: - allErrs = append(allErrs, validateS3StorageConfig(storage.Config, field.NewPath("config"))...) - default: - allErrs = append(allErrs, field.Invalid(fldPath.Child("provider"), storage, fmt.Sprintf("invalid storage name '%s'. Permitted names: s3.", storage.Provider))) - } - } - - if storage.SecretRef == nil { - allErrs = append(allErrs, field.Required(fldPath.Child("secretRef"), "")) - } else if storage.SecretRef.Name == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("secretRef").Child("name"), "")) - } - - return allErrs -} - -func validateS3StorageConfig(config map[string]string, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if config["endpoint"] == "" { - allErrs = append(allErrs, field.Required(fldPath.Key("endpoint"), "missing S3 storage config 'endpoint' value")) - } - - if config["region"] == "" { - allErrs = append(allErrs, field.Required(fldPath.Key("region"), "missing S3 storage config 'region' value")) - } - - if config["bucket"] == "" { - allErrs = append(allErrs, field.Required(fldPath.Key("bucket"), "missing S3 storage config 'bucket' value")) - } - - return allErrs -} diff --git a/pkg/apis/mysql/v1alpha1/validate_backupschedule.go b/pkg/apis/mysql/v1alpha1/validate_backupschedule.go deleted file mode 100644 index 594f83f5e..000000000 --- a/pkg/apis/mysql/v1alpha1/validate_backupschedule.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/util/validation/field" -) - -func validateBackupSchedule(bs *MySQLBackupSchedule) field.ErrorList { - allErrs := field.ErrorList{} - allErrs = append(allErrs, validateBackupScheduleSpec(bs.Spec, field.NewPath("spec"))...) - return allErrs -} - -func validateBackupScheduleSpec(spec BackupScheduleSpec, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if &spec.BackupTemplate == nil { - allErrs = append(allErrs, field.Required(fldPath.Child("backupTemplate"), "missing backup template")) - } else { - allErrs = append(allErrs, validateBackupSpec(spec.BackupTemplate, field.NewPath("backupTemplate"))...) - } - - return allErrs -} diff --git a/pkg/apis/mysql/v1alpha1/validate_cluster.go b/pkg/apis/mysql/v1alpha1/validate_cluster.go deleted file mode 100644 index 511d6ef00..000000000 --- a/pkg/apis/mysql/v1alpha1/validate_cluster.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - "fmt" - "strconv" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/validation/field" -) - -func validateCluster(c *MySQLCluster) field.ErrorList { - allErrs := field.ErrorList{} - allErrs = append(allErrs, validateClusterMetadata(c.ObjectMeta, field.NewPath("metadata"))...) - allErrs = append(allErrs, validateClusterSpec(c.Spec, field.NewPath("spec"))...) - allErrs = append(allErrs, validateClusterStatus(c.Status, field.NewPath("status"))...) - return allErrs -} - -func validateClusterMetadata(m metav1.ObjectMeta, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - allErrs = append(allErrs, validateName(m.Name, fldPath.Child("name"))...) - - return allErrs -} - -func validateName(name string, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if len(name) > MySQLClusterNameMaxLen { - msg := fmt.Sprintf("longer than maximum supported length %d (see: https://bugs.mysql.com/bug.php?id=90601)", MaxInnoDBClusterMembers) - allErrs = append(allErrs, field.Invalid(fldPath, name, msg)) - } - - return allErrs -} - -func validateClusterSpec(s MySQLClusterSpec, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - allErrs = append(allErrs, validateVersion(s.Version, fldPath.Child("version"))...) - allErrs = append(allErrs, validateReplicas(s.Replicas, fldPath.Child("replicas"))...) - allErrs = append(allErrs, validateBaseServerID(s.BaseServerID, fldPath.Child("baseServerId"))...) - - return allErrs -} - -func validateClusterStatus(s MySQLClusterStatus, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - allErrs = append(allErrs, validatePhase(s.Phase, fldPath.Child("phase"))...) - return allErrs -} - -func validateVersion(version string, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - for _, validVersion := range validVersions { - if version == validVersion { - return allErrs - } - } - return append(allErrs, field.Invalid(fldPath, version, "invalid version specified")) -} - -func validateBaseServerID(baseServerID uint32, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - if baseServerID <= maxBaseServerID { - return allErrs - } - return append(allErrs, field.Invalid(fldPath, strconv.FormatUint(uint64(baseServerID), 10), "invalid baseServerId specified")) -} - -func validatePhase(phase MySQLClusterPhase, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - for _, validPhase := range MySQLClusterValidPhases { - if phase == validPhase { - return allErrs - } - } - return append(allErrs, field.Invalid(fldPath, phase, "invalid phase specified")) -} - -func validateReplicas(replicas int32, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - if replicas < 1 || replicas > MaxInnoDBClusterMembers { - allErrs = append(allErrs, field.Invalid(fldPath, replicas, "InnoDB clustering supports between 1-9 members")) - } - return allErrs -} diff --git a/pkg/apis/mysql/v1alpha1/validate_restore.go b/pkg/apis/mysql/v1alpha1/validate_restore.go deleted file mode 100644 index f72c029ea..000000000 --- a/pkg/apis/mysql/v1alpha1/validate_restore.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/util/validation/field" - - "github.com/oracle/mysql-operator/pkg/constants" -) - -func validateRestore(restore *MySQLRestore) field.ErrorList { - allErrs := field.ErrorList{} - - allErrs = append(allErrs, validateRestoreSpec(restore.Spec, field.NewPath("spec"))...) - - // FIXME(apryde): The version label is a piece of internal bookkeeping, - // however, we're validating with a user-facing error here. Should test - // we're applying the label in unit tests and remove this validation. - value, ok := restore.Labels[constants.MySQLOperatorVersionLabel] - if !ok { - errorStr := fmt.Sprintf("no '%s' present.", constants.MySQLOperatorVersionLabel) - allErrs = append(allErrs, field.Invalid(field.NewPath("labels"), restore.Labels, errorStr)) - } - if value == "" { - errorStr := fmt.Sprintf("empty '%s' present.", constants.MySQLOperatorVersionLabel) - allErrs = append(allErrs, field.Invalid(field.NewPath("labels"), restore.Labels, errorStr)) - } - - return allErrs -} - -func validateRestoreSpec(s RestoreSpec, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if s.ClusterRef == nil || s.ClusterRef.Name == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("clusterRef").Child("name"), "a cluster to restore into is required")) - } - - if s.BackupRef == nil || s.BackupRef.Name == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("backupRef").Child("name"), "a backup to restore is required")) - } - - return allErrs -} diff --git a/pkg/apis/mysql/v1alpha1/validation.go b/pkg/apis/mysql/v1alpha1/validation.go new file mode 100644 index 000000000..8bb45e922 --- /dev/null +++ b/pkg/apis/mysql/v1alpha1/validation.go @@ -0,0 +1,257 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 + +import ( + "fmt" + "strconv" + + "github.com/oracle/mysql-operator/pkg/constants" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +func validateCluster(c *Cluster) field.ErrorList { + allErrs := field.ErrorList{} + allErrs = append(allErrs, validateClusterMetadata(c.ObjectMeta, field.NewPath("metadata"))...) + allErrs = append(allErrs, validateClusterSpec(c.Spec, field.NewPath("spec"))...) + allErrs = append(allErrs, validateClusterStatus(c.Status, field.NewPath("status"))...) + return allErrs +} + +func validateClusterMetadata(m metav1.ObjectMeta, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + allErrs = append(allErrs, validateName(m.Name, fldPath.Child("name"))...) + + return allErrs +} + +func validateName(name string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if len(name) > ClusterNameMaxLen { + msg := fmt.Sprintf("longer than maximum supported length %d (see: https://bugs.mysql.com/bug.php?id=90601)", ClusterNameMaxLen) + allErrs = append(allErrs, field.Invalid(fldPath, name, msg)) + } + + return allErrs +} + +func validateClusterSpec(s ClusterSpec, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + allErrs = append(allErrs, validateVersion(s.Version, fldPath.Child("version"))...) + allErrs = append(allErrs, validateMembers(s.Members, fldPath.Child("members"))...) + allErrs = append(allErrs, validateBaseServerID(s.BaseServerID, fldPath.Child("baseServerId"))...) + + return allErrs +} + +func validateClusterStatus(s ClusterStatus, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + return allErrs +} + +func validateVersion(version string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + for _, validVersion := range validVersions { + if version == validVersion { + return allErrs + } + } + return append(allErrs, field.Invalid(fldPath, version, "invalid version specified")) +} + +func validateBaseServerID(baseServerID uint32, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if baseServerID <= maxBaseServerID { + return allErrs + } + return append(allErrs, field.Invalid(fldPath, strconv.FormatUint(uint64(baseServerID), 10), "invalid baseServerId specified")) +} + +func validateMembers(members int32, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if members < 1 || members > MaxInnoDBClusterMembers { + allErrs = append(allErrs, field.Invalid(fldPath, members, "InnoDB clustering supports between 1-9 members")) + } + return allErrs +} + +func validateS3StorageProvider(s3 *S3StorageProvider, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if s3.Region == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("region"), "")) + } + if s3.Endpoint == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("endpoint"), "")) + } + if s3.Bucket == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("bucket"), "")) + } + + if s3.CredentialsSecret == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("credentialsSecret"), "")) + } else if s3.CredentialsSecret.Name == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("credentialsSecret").Child("name"), "")) + } + + return allErrs +} + +func validateStorageProvider(storage StorageProvider, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if storage.S3 == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("s3"), "S3 (compatible) is currently the only supported storage provider")) + } else { + allErrs = append(allErrs, validateS3StorageProvider(storage.S3, fldPath.Child("s3"))...) + } + + return allErrs +} + +// ExecutorProviders denotes the list of valid backup executor providers. +var ExecutorProviders = []string{"mysqldump"} + +func isValidExecutorProvider(provider string) bool { + for _, ex := range ExecutorProviders { + if provider == ex { + return true + } + } + + return false +} + +func validateDatabase(database Database, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if database.Name == "" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), database.Name, "")) + } + + return allErrs +} + +func validateMySQLDumpExecutor(executor *MySQLDumpBackupExecutor, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if executor.Databases == nil || len(executor.Databases) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("databases"), executor, "")) + } + + for i, database := range executor.Databases { + allErrs = append(allErrs, validateDatabase(database, fldPath.Index(i))...) + } + + return allErrs +} + +func validateExecutor(executor BackupExecutor, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if executor.MySQLDump == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("mysqldump"), "mysqldump is currently the only supported backup mechanism")) + } else { + allErrs = append(allErrs, validateMySQLDumpExecutor(executor.MySQLDump, fldPath.Child("mysqldump"))...) + } + + return allErrs +} + +func validateBackup(backup *Backup) field.ErrorList { + allErrs := field.ErrorList{} + allErrs = append(allErrs, validateBackupLabels(backup.Labels, field.NewPath("labels"))...) + allErrs = append(allErrs, validateBackupSpec(backup.Spec, field.NewPath("spec"))...) + + return allErrs +} + +func validateBackupLabels(labels map[string]string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if labels[constants.MySQLOperatorVersionLabel] == "" { + errorStr := fmt.Sprintf("no '%s' present.", constants.MySQLOperatorVersionLabel) + allErrs = append(allErrs, field.Invalid(fldPath, labels, errorStr)) + } + return allErrs +} + +func validateBackupSpec(spec BackupSpec, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + allErrs = append(allErrs, validateExecutor(spec.Executor, field.NewPath("executor"))...) + allErrs = append(allErrs, validateStorageProvider(spec.StorageProvider, field.NewPath("storageProvider"))...) + + if spec.Cluster == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("cluster"), "missing cluster")) + } + + return allErrs +} + +func validateBackupSchedule(bs *BackupSchedule) field.ErrorList { + allErrs := field.ErrorList{} + allErrs = append(allErrs, validateBackupScheduleSpec(bs.Spec, field.NewPath("spec"))...) + return allErrs +} + +func validateBackupScheduleSpec(spec BackupScheduleSpec, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if &spec.BackupTemplate == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("backupTemplate"), "missing backup template")) + } else { + allErrs = append(allErrs, validateBackupSpec(spec.BackupTemplate, field.NewPath("backupTemplate"))...) + } + + return allErrs +} + +func validateRestore(restore *Restore) field.ErrorList { + allErrs := field.ErrorList{} + + allErrs = append(allErrs, validateRestoreSpec(restore.Spec, field.NewPath("spec"))...) + + // FIXME(apryde): The version label is a piece of internal bookkeeping, + // however, we're validating with a user-facing error here. Should test + // we're applying the label in unit tests and remove this validation. + value, ok := restore.Labels[constants.MySQLOperatorVersionLabel] + if !ok { + errorStr := fmt.Sprintf("no '%s' present.", constants.MySQLOperatorVersionLabel) + allErrs = append(allErrs, field.Invalid(field.NewPath("labels"), restore.Labels, errorStr)) + } + if value == "" { + errorStr := fmt.Sprintf("empty '%s' present.", constants.MySQLOperatorVersionLabel) + allErrs = append(allErrs, field.Invalid(field.NewPath("labels"), restore.Labels, errorStr)) + } + + return allErrs +} + +func validateRestoreSpec(s RestoreSpec, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if s.Cluster == nil || s.Cluster.Name == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("cluster").Child("name"), "a cluster to restore into is required")) + } + + if s.Backup == nil || s.Backup.Name == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("backup").Child("name"), "a backup to restore is required")) + } + + return allErrs +} diff --git a/pkg/apis/mysql/v1alpha1/validation_test.go b/pkg/apis/mysql/v1alpha1/validation_test.go new file mode 100644 index 000000000..b82fdf5aa --- /dev/null +++ b/pkg/apis/mysql/v1alpha1/validation_test.go @@ -0,0 +1,324 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 + +import ( + "strings" + "testing" + + corev1 "k8s.io/api/core/v1" + + "github.com/oracle/mysql-operator/pkg/version" +) + +func TestEmptyBackupIsInvalid(t *testing.T) { + backup := Backup{} + err := backup.Validate() + if err == nil { + t.Error("An empty backup should be invalid") + } +} + +func TestValidateValidBackup(t *testing.T) { + backup := Backup{ + Spec: BackupSpec{ + Executor: BackupExecutor{ + MySQLDump: &MySQLDumpBackupExecutor{ + Databases: []Database{{Name: "db1"}, {Name: "db2"}}, + }, + }, + StorageProvider: StorageProvider{ + S3: &S3StorageProvider{ + Endpoint: "endpoint", + Region: "region", + Bucket: "bucket", + CredentialsSecret: &corev1.LocalObjectReference{ + Name: "backup-storage-creds", + }, + }, + }, + Cluster: &corev1.LocalObjectReference{ + Name: "test-cluster", + }, + }, + } + backup.Labels = make(map[string]string) + setOperatorVersionLabel(backup.Labels, "v1.0.0") + err := backup.Validate() + if err != nil { + t.Errorf("Expected no validation errors but got %s", err) + } +} + +func TestBackupEnsureDefaultVersionSet(t *testing.T) { + expected := version.GetBuildVersion() + backup := &Backup{} + backup = backup.EnsureDefaults() + + actual := getOperatorVersionLabel(backup.Labels) + if actual != expected { + t.Errorf("Expected version '%s' but got '%s'", expected, actual) + } +} + +func TestBackupEnsureDefaultVersionNotSetIfExists(t *testing.T) { + version := "v1.0.0" + backup := &Backup{} + backup.Labels = make(map[string]string) + setOperatorVersionLabel(backup.Labels, version) + backup = backup.EnsureDefaults() + + actual := getOperatorVersionLabel(backup.Labels) + + if actual != version { + t.Errorf("Expected version '%s' but got '%s'", version, actual) + } +} + +func TestValidateBackupMissingCluster(t *testing.T) { + backup := Backup{ + Spec: BackupSpec{ + Executor: BackupExecutor{ + MySQLDump: &MySQLDumpBackupExecutor{ + Databases: []Database{{Name: "db1"}, {Name: "db2"}}, + }, + }, + StorageProvider: StorageProvider{ + S3: &S3StorageProvider{ + Endpoint: "endpoint", + Region: "region", + Bucket: "bucket", + CredentialsSecret: &corev1.LocalObjectReference{ + Name: "backup-storage-creds", + }, + }, + }, + }, + } + + err := backup.Validate() + if !strings.Contains(err.Error(), "missing cluster") { + t.Errorf("Expected backup with missing Cluster to show 'missing cluster' error. Error is: %s", err) + } +} + +func TestValidateBackupMissingSecretRef(t *testing.T) { + backup := Backup{ + Spec: BackupSpec{ + Executor: BackupExecutor{ + MySQLDump: &MySQLDumpBackupExecutor{ + Databases: []Database{{Name: "db1"}, {Name: "db2"}}, + }, + }, + StorageProvider: StorageProvider{ + S3: &S3StorageProvider{ + Endpoint: "endpoint", + Region: "region", + Bucket: "bucket", + }, + }, + Cluster: &corev1.LocalObjectReference{ + Name: "test-cluster", + }, + }, + } + + err := backup.Validate() + if !strings.Contains(err.Error(), "storageProvider.s3.credentialsSecret: Required value") { + t.Errorf("Expected backup with missing Secret to show 'storageProvider.s3.credentialsSecret: Required value' error. Error is: %s", err) + } +} + +func TestEmptyBackupScheduleIsInvalid(t *testing.T) { + bs := BackupSchedule{} + err := bs.Validate() + if err == nil { + t.Error("An empty backup schedule should be invalid") + } +} + +func TestValidateValidBackupSchedule(t *testing.T) { + bs := BackupSchedule{ + Spec: BackupScheduleSpec{ + Schedule: "* * * * * *", + BackupTemplate: BackupSpec{ + Executor: BackupExecutor{ + MySQLDump: &MySQLDumpBackupExecutor{ + Databases: []Database{{Name: "db1"}, {Name: "db2"}}, + }, + }, + StorageProvider: StorageProvider{ + S3: &S3StorageProvider{ + Endpoint: "endpoint", + Region: "region", + Bucket: "bucket", + CredentialsSecret: &corev1.LocalObjectReference{ + Name: "backup-storage-creds", + }, + }, + }, + Cluster: &corev1.LocalObjectReference{ + Name: "test-cluster", + }, + }, + }, + } + bs.Labels = make(map[string]string) + setOperatorVersionLabel(bs.Labels, "v1.0.0") + err := bs.Validate() + if err != nil { + t.Errorf("Expected no validation errors but got %s", err) + } +} + +func TestBackupScheduleEnsureDefaultVersionSet(t *testing.T) { + expected := version.GetBuildVersion() + bs := &BackupSchedule{} + bs = bs.EnsureDefaults() + + actual := getOperatorVersionLabel(bs.Labels) + if actual != expected { + t.Errorf("Expected version '%s' but got '%s'", expected, actual) + } +} + +func TestBackupScheduleEnsureDefaultVersionNotSetIfExists(t *testing.T) { + version := "v1.0.0" + bs := &BackupSchedule{} + bs.Labels = make(map[string]string) + setOperatorVersionLabel(bs.Labels, version) + bs = bs.EnsureDefaults() + + actual := getOperatorVersionLabel(bs.Labels) + + if actual != version { + t.Errorf("Expected version '%s' but got '%s'", version, actual) + } +} + +func TestValidateBackupScheduleMissingCluster(t *testing.T) { + bs := BackupSchedule{ + Spec: BackupScheduleSpec{ + Schedule: "* * * * * *", + BackupTemplate: BackupSpec{ + Executor: BackupExecutor{ + MySQLDump: &MySQLDumpBackupExecutor{ + Databases: []Database{{Name: "db1"}, {Name: "db2"}}, + }, + }, + StorageProvider: StorageProvider{ + S3: &S3StorageProvider{ + Endpoint: "endpoint", + Region: "region", + Bucket: "bucket", + CredentialsSecret: &corev1.LocalObjectReference{ + Name: "backup-storage-creds", + }, + }, + }, + ScheduledMember: "hostname-1", + }, + }, + } + + err := bs.Validate() + if !strings.Contains(err.Error(), "missing cluster") { + t.Errorf("Expected backup schedule with missing Cluster to show 'missing cluster' error. Error is: %s", err) + } +} + +func TestValidateBackupScheduleMissingSecretRef(t *testing.T) { + bs := BackupSchedule{ + Spec: BackupScheduleSpec{ + Schedule: "* * * * * *", + BackupTemplate: BackupSpec{ + Executor: BackupExecutor{ + MySQLDump: &MySQLDumpBackupExecutor{ + Databases: []Database{{Name: "db1"}, {Name: "db2"}}, + }, + }, + StorageProvider: StorageProvider{ + S3: &S3StorageProvider{ + Endpoint: "endpoint", + Region: "region", + Bucket: "bucket", + }, + }, + Cluster: &corev1.LocalObjectReference{ + Name: "test-cluster", + }, + ScheduledMember: "hostname-1", + }, + }, + } + + err := bs.Validate() + if !strings.Contains(err.Error(), "storageProvider.s3.credentialsSecret: Required value") { + t.Errorf("Expected backup schedule with missing authSecret to show 'storageProvider.s3.credentialsSecret: Required value' error. Error is: %s", err) + } +} + +func TestRestoreEnsureDefaults(t *testing.T) { + // test a version is set if one does not exist. + bv1 := version.GetBuildVersion() + r := Restore{ + Spec: RestoreSpec{ + Cluster: &corev1.LocalObjectReference{ + Name: "foo", + }, + Backup: &corev1.LocalObjectReference{ + Name: "foo", + }, + }, + } + dr := *r.EnsureDefaults() + if getOperatorVersionLabel(dr.Labels) != bv1 { + t.Errorf("Expected restore version label: '%s'", bv1) + } + // test a version is not set if one already exists. + bv2 := "test-existing-build-version" + r2 := Restore{} + r2.Labels = make(map[string]string) + setOperatorVersionLabel(r2.Labels, bv2) + dr2 := *r2.EnsureDefaults() + if getOperatorVersionLabel(dr2.Labels) != bv2 { + t.Errorf("Expected restore version label: '%s'", bv2) + } +} + +func TestRestoreValidate(t *testing.T) { + // Test a malformed restore returns errors. + r := Restore{ + Spec: RestoreSpec{ + Cluster: &corev1.LocalObjectReference{ + Name: "foo", + }, + Backup: &corev1.LocalObjectReference{ + Name: "foo", + }, + }, + } + rErr := r.Validate() + if rErr == nil { + t.Error("Restore should have had a validation error.") + } + // Test a valid restore returns no errors. + r.Labels = make(map[string]string) + setOperatorVersionLabel(r.Labels, "some-build-version") + rErr = r.Validate() + if rErr != nil { + t.Errorf("Restore should have had no validation errors: %v", rErr) + } +} diff --git a/pkg/apis/mysql/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/mysql/v1alpha1/zz_generated.deepcopy.go index 6f3ac7a3f..e603bc497 100644 --- a/pkg/apis/mysql/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/mysql/v1alpha1/zz_generated.deepcopy.go @@ -24,123 +24,128 @@ import ( ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackupOutcome) DeepCopyInto(out *BackupOutcome) { +func (in *Backup) DeepCopyInto(out *Backup) { *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupOutcome. -func (in *BackupOutcome) DeepCopy() *BackupOutcome { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backup. +func (in *Backup) DeepCopy() *Backup { if in == nil { return nil } - out := new(BackupOutcome) + out := new(Backup) in.DeepCopyInto(out) return out } +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Backup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackupScheduleSpec) DeepCopyInto(out *BackupScheduleSpec) { +func (in *BackupCondition) DeepCopyInto(out *BackupCondition) { *out = *in - in.BackupTemplate.DeepCopyInto(&out.BackupTemplate) + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupScheduleSpec. -func (in *BackupScheduleSpec) DeepCopy() *BackupScheduleSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupCondition. +func (in *BackupCondition) DeepCopy() *BackupCondition { if in == nil { return nil } - out := new(BackupScheduleSpec) + out := new(BackupCondition) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackupSpec) DeepCopyInto(out *BackupSpec) { +func (in *BackupExecutor) DeepCopyInto(out *BackupExecutor) { *out = *in - if in.Executor != nil { - in, out := &in.Executor, &out.Executor + if in.MySQLDump != nil { + in, out := &in.MySQLDump, &out.MySQLDump if *in == nil { *out = nil } else { - *out = new(Executor) + *out = new(MySQLDumpBackupExecutor) (*in).DeepCopyInto(*out) } } - if in.Storage != nil { - in, out := &in.Storage, &out.Storage - if *in == nil { - *out = nil - } else { - *out = new(Storage) - (*in).DeepCopyInto(*out) - } - } - if in.ClusterRef != nil { - in, out := &in.ClusterRef, &out.ClusterRef - if *in == nil { - *out = nil - } else { - *out = new(v1.LocalObjectReference) - **out = **in - } - } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSpec. -func (in *BackupSpec) DeepCopy() *BackupSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupExecutor. +func (in *BackupExecutor) DeepCopy() *BackupExecutor { if in == nil { return nil } - out := new(BackupSpec) + out := new(BackupExecutor) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackupStatus) DeepCopyInto(out *BackupStatus) { +func (in *BackupList) DeepCopyInto(out *BackupList) { *out = *in - out.Outcome = in.Outcome - in.TimeStarted.DeepCopyInto(&out.TimeStarted) - in.TimeCompleted.DeepCopyInto(&out.TimeCompleted) + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Backup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupStatus. -func (in *BackupStatus) DeepCopy() *BackupStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupList. +func (in *BackupList) DeepCopy() *BackupList { if in == nil { return nil } - out := new(BackupStatus) + out := new(BackupList) in.DeepCopyInto(out) return out } +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Executor) DeepCopyInto(out *Executor) { +func (in *BackupOutcome) DeepCopyInto(out *BackupOutcome) { *out = *in - if in.Databases != nil { - in, out := &in.Databases, &out.Databases - *out = make([]string, len(*in)) - copy(*out, *in) - } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Executor. -func (in *Executor) DeepCopy() *Executor { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupOutcome. +func (in *BackupOutcome) DeepCopy() *BackupOutcome { if in == nil { return nil } - out := new(Executor) + out := new(BackupOutcome) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MySQLBackup) DeepCopyInto(out *MySQLBackup) { +func (in *BackupSchedule) DeepCopyInto(out *BackupSchedule) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -149,18 +154,18 @@ func (in *MySQLBackup) DeepCopyInto(out *MySQLBackup) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLBackup. -func (in *MySQLBackup) DeepCopy() *MySQLBackup { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSchedule. +func (in *BackupSchedule) DeepCopy() *BackupSchedule { if in == nil { return nil } - out := new(MySQLBackup) + out := new(BackupSchedule) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MySQLBackup) DeepCopyObject() runtime.Object { +func (in *BackupSchedule) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } else { @@ -169,13 +174,13 @@ func (in *MySQLBackup) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MySQLBackupList) DeepCopyInto(out *MySQLBackupList) { +func (in *BackupScheduleList) DeepCopyInto(out *BackupScheduleList) { *out = *in out.TypeMeta = in.TypeMeta out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]MySQLBackup, len(*in)) + *out = make([]BackupSchedule, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -183,18 +188,18 @@ func (in *MySQLBackupList) DeepCopyInto(out *MySQLBackupList) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLBackupList. -func (in *MySQLBackupList) DeepCopy() *MySQLBackupList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupScheduleList. +func (in *BackupScheduleList) DeepCopy() *BackupScheduleList { if in == nil { return nil } - out := new(MySQLBackupList) + out := new(BackupScheduleList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MySQLBackupList) DeepCopyObject() runtime.Object { +func (in *BackupScheduleList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } else { @@ -203,42 +208,58 @@ func (in *MySQLBackupList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MySQLBackupSchedule) DeepCopyInto(out *MySQLBackupSchedule) { +func (in *BackupScheduleSpec) DeepCopyInto(out *BackupScheduleSpec) { *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) + in.BackupTemplate.DeepCopyInto(&out.BackupTemplate) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLBackupSchedule. -func (in *MySQLBackupSchedule) DeepCopy() *MySQLBackupSchedule { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupScheduleSpec. +func (in *BackupScheduleSpec) DeepCopy() *BackupScheduleSpec { if in == nil { return nil } - out := new(MySQLBackupSchedule) + out := new(BackupScheduleSpec) in.DeepCopyInto(out) return out } -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MySQLBackupSchedule) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupSpec) DeepCopyInto(out *BackupSpec) { + *out = *in + in.Executor.DeepCopyInto(&out.Executor) + in.StorageProvider.DeepCopyInto(&out.StorageProvider) + if in.Cluster != nil { + in, out := &in.Cluster, &out.Cluster + if *in == nil { + *out = nil + } else { + *out = new(v1.LocalObjectReference) + **out = **in + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSpec. +func (in *BackupSpec) DeepCopy() *BackupSpec { + if in == nil { return nil } + out := new(BackupSpec) + in.DeepCopyInto(out) + return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MySQLBackupScheduleList) DeepCopyInto(out *MySQLBackupScheduleList) { +func (in *BackupStatus) DeepCopyInto(out *BackupStatus) { *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MySQLBackupSchedule, len(*in)) + out.Outcome = in.Outcome + in.TimeStarted.DeepCopyInto(&out.TimeStarted) + in.TimeCompleted.DeepCopyInto(&out.TimeCompleted) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]BackupCondition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -246,27 +267,18 @@ func (in *MySQLBackupScheduleList) DeepCopyInto(out *MySQLBackupScheduleList) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLBackupScheduleList. -func (in *MySQLBackupScheduleList) DeepCopy() *MySQLBackupScheduleList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupStatus. +func (in *BackupStatus) DeepCopy() *BackupStatus { if in == nil { return nil } - out := new(MySQLBackupScheduleList) + out := new(BackupStatus) in.DeepCopyInto(out) return out } -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MySQLBackupScheduleList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MySQLCluster) DeepCopyInto(out *MySQLCluster) { +func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -275,18 +287,18 @@ func (in *MySQLCluster) DeepCopyInto(out *MySQLCluster) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLCluster. -func (in *MySQLCluster) DeepCopy() *MySQLCluster { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. +func (in *Cluster) DeepCopy() *Cluster { if in == nil { return nil } - out := new(MySQLCluster) + out := new(Cluster) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MySQLCluster) DeepCopyObject() runtime.Object { +func (in *Cluster) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } else { @@ -295,13 +307,30 @@ func (in *MySQLCluster) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MySQLClusterList) DeepCopyInto(out *MySQLClusterList) { +func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCondition. +func (in *ClusterCondition) DeepCopy() *ClusterCondition { + if in == nil { + return nil + } + out := new(ClusterCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterList) DeepCopyInto(out *ClusterList) { *out = *in out.TypeMeta = in.TypeMeta out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]MySQLCluster, len(*in)) + *out = make([]Cluster, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -309,18 +338,18 @@ func (in *MySQLClusterList) DeepCopyInto(out *MySQLClusterList) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLClusterList. -func (in *MySQLClusterList) DeepCopy() *MySQLClusterList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. +func (in *ClusterList) DeepCopy() *ClusterList { if in == nil { return nil } - out := new(MySQLClusterList) + out := new(ClusterList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MySQLClusterList) DeepCopyObject() runtime.Object { +func (in *ClusterList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } else { @@ -329,7 +358,7 @@ func (in *MySQLClusterList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MySQLClusterSpec) DeepCopyInto(out *MySQLClusterSpec) { +func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { *out = *in if in.NodeSelector != nil { in, out := &in.NodeSelector, &out.NodeSelector @@ -365,8 +394,8 @@ func (in *MySQLClusterSpec) DeepCopyInto(out *MySQLClusterSpec) { (*in).DeepCopyInto(*out) } } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef + if in.RootPasswordSecret != nil { + in, out := &in.RootPasswordSecret, &out.RootPasswordSecret if *in == nil { *out = nil } else { @@ -374,8 +403,8 @@ func (in *MySQLClusterSpec) DeepCopyInto(out *MySQLClusterSpec) { **out = **in } } - if in.ConfigRef != nil { - in, out := &in.ConfigRef, &out.ConfigRef + if in.Config != nil { + in, out := &in.Config, &out.Config if *in == nil { *out = nil } else { @@ -383,8 +412,8 @@ func (in *MySQLClusterSpec) DeepCopyInto(out *MySQLClusterSpec) { **out = **in } } - if in.SSLSecretRef != nil { - in, out := &in.SSLSecretRef, &out.SSLSecretRef + if in.SSLSecret != nil { + in, out := &in.SSLSecret, &out.SSLSecret if *in == nil { *out = nil } else { @@ -395,50 +424,80 @@ func (in *MySQLClusterSpec) DeepCopyInto(out *MySQLClusterSpec) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLClusterSpec. -func (in *MySQLClusterSpec) DeepCopy() *MySQLClusterSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. +func (in *ClusterSpec) DeepCopy() *ClusterSpec { if in == nil { return nil } - out := new(MySQLClusterSpec) + out := new(ClusterSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MySQLClusterStatus) DeepCopyInto(out *MySQLClusterStatus) { +func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Errors != nil { - in, out := &in.Errors, &out.Errors - *out = make([]string, len(*in)) - copy(*out, *in) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]ClusterCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLClusterStatus. -func (in *MySQLClusterStatus) DeepCopy() *MySQLClusterStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. +func (in *ClusterStatus) DeepCopy() *ClusterStatus { if in == nil { return nil } - out := new(MySQLClusterStatus) + out := new(ClusterStatus) in.DeepCopyInto(out) return out } -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MySQLClusterStatus) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Database) DeepCopyInto(out *Database) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Database. +func (in *Database) DeepCopy() *Database { + if in == nil { return nil } + out := new(Database) + in.DeepCopyInto(out) + return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MySQLRestore) DeepCopyInto(out *MySQLRestore) { +func (in *MySQLDumpBackupExecutor) DeepCopyInto(out *MySQLDumpBackupExecutor) { + *out = *in + if in.Databases != nil { + in, out := &in.Databases, &out.Databases + *out = make([]Database, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLDumpBackupExecutor. +func (in *MySQLDumpBackupExecutor) DeepCopy() *MySQLDumpBackupExecutor { + if in == nil { + return nil + } + out := new(MySQLDumpBackupExecutor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Restore) DeepCopyInto(out *Restore) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -447,18 +506,18 @@ func (in *MySQLRestore) DeepCopyInto(out *MySQLRestore) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLRestore. -func (in *MySQLRestore) DeepCopy() *MySQLRestore { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Restore. +func (in *Restore) DeepCopy() *Restore { if in == nil { return nil } - out := new(MySQLRestore) + out := new(Restore) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MySQLRestore) DeepCopyObject() runtime.Object { +func (in *Restore) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } else { @@ -467,13 +526,30 @@ func (in *MySQLRestore) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MySQLRestoreList) DeepCopyInto(out *MySQLRestoreList) { +func (in *RestoreCondition) DeepCopyInto(out *RestoreCondition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreCondition. +func (in *RestoreCondition) DeepCopy() *RestoreCondition { + if in == nil { + return nil + } + out := new(RestoreCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestoreList) DeepCopyInto(out *RestoreList) { *out = *in out.TypeMeta = in.TypeMeta out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]MySQLRestore, len(*in)) + *out = make([]Restore, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -481,18 +557,18 @@ func (in *MySQLRestoreList) DeepCopyInto(out *MySQLRestoreList) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLRestoreList. -func (in *MySQLRestoreList) DeepCopy() *MySQLRestoreList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreList. +func (in *RestoreList) DeepCopy() *RestoreList { if in == nil { return nil } - out := new(MySQLRestoreList) + out := new(RestoreList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MySQLRestoreList) DeepCopyObject() runtime.Object { +func (in *RestoreList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } else { @@ -503,8 +579,8 @@ func (in *MySQLRestoreList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RestoreSpec) DeepCopyInto(out *RestoreSpec) { *out = *in - if in.ClusterRef != nil { - in, out := &in.ClusterRef, &out.ClusterRef + if in.Cluster != nil { + in, out := &in.Cluster, &out.Cluster if *in == nil { *out = nil } else { @@ -512,8 +588,8 @@ func (in *RestoreSpec) DeepCopyInto(out *RestoreSpec) { **out = **in } } - if in.BackupRef != nil { - in, out := &in.BackupRef, &out.BackupRef + if in.Backup != nil { + in, out := &in.Backup, &out.Backup if *in == nil { *out = nil } else { @@ -539,6 +615,13 @@ func (in *RestoreStatus) DeepCopyInto(out *RestoreStatus) { *out = *in in.TimeStarted.DeepCopyInto(&out.TimeStarted) in.TimeCompleted.DeepCopyInto(&out.TimeCompleted) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]RestoreCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -552,6 +635,31 @@ func (in *RestoreStatus) DeepCopy() *RestoreStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *S3StorageProvider) DeepCopyInto(out *S3StorageProvider) { + *out = *in + if in.CredentialsSecret != nil { + in, out := &in.CredentialsSecret, &out.CredentialsSecret + if *in == nil { + *out = nil + } else { + *out = new(v1.LocalObjectReference) + **out = **in + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3StorageProvider. +func (in *S3StorageProvider) DeepCopy() *S3StorageProvider { + if in == nil { + return nil + } + out := new(S3StorageProvider) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ScheduleStatus) DeepCopyInto(out *ScheduleStatus) { *out = *in @@ -570,33 +678,26 @@ func (in *ScheduleStatus) DeepCopy() *ScheduleStatus { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Storage) DeepCopyInto(out *Storage) { +func (in *StorageProvider) DeepCopyInto(out *StorageProvider) { *out = *in - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef + if in.S3 != nil { + in, out := &in.S3, &out.S3 if *in == nil { *out = nil } else { - *out = new(v1.LocalObjectReference) - **out = **in - } - } - if in.Config != nil { - in, out := &in.Config, &out.Config - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val + *out = new(S3StorageProvider) + (*in).DeepCopyInto(*out) } } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Storage. -func (in *Storage) DeepCopy() *Storage { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageProvider. +func (in *StorageProvider) DeepCopy() *StorageProvider { if in == nil { return nil } - out := new(Storage) + out := new(StorageProvider) in.DeepCopyInto(out) return out } diff --git a/pkg/backup/backup.go b/pkg/backup/backup.go index 63e02f23f..53f745511 100644 --- a/pkg/backup/backup.go +++ b/pkg/backup/backup.go @@ -42,13 +42,13 @@ type runner struct { // NewConfiguredRunner creates a runner configured with the Backup/Restore target executor and // storage configurations. -func NewConfiguredRunner(execConfig *v1alpha1.Executor, execCreds map[string]string, storeConfig *v1alpha1.Storage, storeCreds map[string]string) (Runner, error) { +func NewConfiguredRunner(execConfig v1alpha1.BackupExecutor, execCreds map[string]string, provider v1alpha1.StorageProvider, storeCreds map[string]string) (Runner, error) { exec, err := executor.New(execConfig, execCreds) if err != nil { return nil, err } - store, err := storage.NewStorageProvider(storeConfig, storeCreds) + store, err := storage.NewStorageProvider(provider, storeCreds) if err != nil { return nil, err } diff --git a/pkg/backup/executor/executor.go b/pkg/backup/executor/executor.go index 3c8d72e93..a90312537 100644 --- a/pkg/backup/executor/executor.go +++ b/pkg/backup/executor/executor.go @@ -15,10 +15,8 @@ package executor import ( - "fmt" "io" "os" - "strings" "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" "github.com/oracle/mysql-operator/pkg/backup/executor/mysqldump" @@ -43,13 +41,8 @@ type Interface interface { } // New builds a new backup executor. -func New(executor *v1alpha1.Executor, creds map[string]string) (Interface, error) { - switch strings.ToLower(executor.Provider) { - case MySQLDumpProvider: - return mysqldump.NewExecutor(executor, creds) - default: - return nil, fmt.Errorf("unknown backup executor provider %q", executor.Provider) - } +func New(executor v1alpha1.BackupExecutor, creds map[string]string) (Interface, error) { + return mysqldump.NewExecutor(executor.MySQLDump, creds) } // DefaultCreds return the default MySQL credentials for the local instance. diff --git a/pkg/backup/executor/mysqldump/config.go b/pkg/backup/executor/mysqldump/config.go index 9229fea3d..db043d452 100644 --- a/pkg/backup/executor/mysqldump/config.go +++ b/pkg/backup/executor/mysqldump/config.go @@ -25,11 +25,11 @@ import ( type Config struct { username string password string - databases []string + databases []v1alpha1.Database } // NewConfig creates an mysqldump configuration based on the input parameters. -func NewConfig(executor *v1alpha1.Executor, creds map[string]string) *Config { +func NewConfig(executor *v1alpha1.MySQLDumpBackupExecutor, creds map[string]string) *Config { return &Config{ databases: executor.Databases, username: creds["username"], diff --git a/pkg/backup/executor/mysqldump/provider.go b/pkg/backup/executor/mysqldump/provider.go index f96529178..c9d35df54 100644 --- a/pkg/backup/executor/mysqldump/provider.go +++ b/pkg/backup/executor/mysqldump/provider.go @@ -43,7 +43,7 @@ type Executor struct { // NewExecutor creates a provider capable of creating and restoring backups with the mysqldump // tool. -func NewExecutor(executor *v1alpha1.Executor, creds map[string]string) (*Executor, error) { +func NewExecutor(executor *v1alpha1.MySQLDumpBackupExecutor, creds map[string]string) (*Executor, error) { cfg := NewConfig(executor, creds) err := cfg.Validate() if err != nil { @@ -69,7 +69,13 @@ func (ex *Executor) Backup(backupDir string, clusterName string) (io.ReadCloser, "--set-gtid-purged=OFF", "--databases", } - cmd := exec.Command(mysqldumpPath, append(args, ex.config.databases...)...) + + dbNames := make([]string, len(ex.config.databases)) + for i, database := range ex.config.databases { + dbNames[i] = database.Name + } + + cmd := exec.Command(mysqldumpPath, append(args, dbNames...)...) var mu sync.Mutex mu.Lock() @@ -130,10 +136,6 @@ func (ex *Executor) Restore(content io.ReadCloser) error { cmd.SetStdin(zr) glog.V(4).Infof("running cmd: '%v'", cmd) - output, err := cmd.CombinedOutput() - if err != nil { - glog.V(4).Infof("err: '%v', output: '%s'", err, string(output)) - return err - } - return nil + _, err = cmd.CombinedOutput() + return err } diff --git a/pkg/backup/storage/s3/client.go b/pkg/backup/storage/s3/client.go deleted file mode 100644 index 2b31c3739..000000000 --- a/pkg/backup/storage/s3/client.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 s3 - -// baremetal "github.com/oracle/bmcs-go-sdk" - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/s3/s3manager" - "github.com/pkg/errors" -) - -// Client is an S3 client and configured Uploader. -type Client struct { - s3 *s3.S3 - s3Uploader *s3manager.Uploader -} - -// NewClient constructs a new S3 backup upload provider client that can upload/download -// backups to any S3 compliant API e.g. OCI, AWS, GCE. -func NewClient(config *Config) (*Client, error) { - s3Config := aws.NewConfig(). - WithCredentials(credentials.NewStaticCredentials(config.accessKey, config.secretKey, "")). - WithEndpoint(config.endpoint). - WithRegion(config.region). - WithS3ForcePathStyle(true) - - sess, err := getSession(s3Config) - if err != nil { - return nil, err - } - s3 := s3.New(sess) - s3Uploader := s3manager.NewUploader(sess) - - return &Client{s3: s3, s3Uploader: s3Uploader}, nil -} - -func getSession(config *aws.Config) (*session.Session, error) { - sess, err := session.NewSession(config) - if err != nil { - return nil, errors.WithStack(err) - } - - if _, err := sess.Config.Credentials.Get(); err != nil { - return nil, errors.WithStack(err) - } - - return sess, nil -} diff --git a/pkg/backup/storage/s3/client_test.go b/pkg/backup/storage/s3/client_test.go deleted file mode 100644 index cbabc0c40..000000000 --- a/pkg/backup/storage/s3/client_test.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 s3 - -import ( - "testing" - - "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" -) - -func TestClientWithInvalidData(t *testing.T) { - storage := &v1alpha1.Storage{ - Provider: "s3", - Config: map[string]string{ - "region": "region", - "bucket": "bucket", - }, - } - - creds := map[string]string{} - - config := NewConfig(storage, creds) - - client, err := NewClient(config) - if err == nil { - t.Error("Expected NewClient to be return an error on invalid config") - } - if client != nil { - t.Error("Expected NewClient to be return an nil client on invalid config") - } - -} diff --git a/pkg/backup/storage/s3/config.go b/pkg/backup/storage/s3/config.go deleted file mode 100644 index 14825e2d5..000000000 --- a/pkg/backup/storage/s3/config.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 s3 - -import ( - "k8s.io/apimachinery/pkg/util/validation/field" - - "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" -) - -// Config holds the credentials required to authenticate with an S3 compliant API. -type Config struct { - endpoint string - region string - bucket string - accessKey string - secretKey string -} - -// NewConfig creates an S3 configuration based on the input parameters. -func NewConfig(storage *v1alpha1.Storage, creds map[string]string) *Config { - return &Config{ - endpoint: storage.Config["endpoint"], - region: storage.Config["region"], - bucket: storage.Config["bucket"], - accessKey: creds["accessKey"], - secretKey: creds["secretKey"], - } -} - -// Validate checks the required S3 configuration parameters are set. -func (c *Config) Validate() error { - allErrs := field.ErrorList{} - fldPath := field.NewPath("data") - - if c.endpoint == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("endpoint"), "")) - } - if c.region == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("region"), "")) - } - if c.bucket == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("bucket"), "")) - } - if c.accessKey == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("accessKey"), "")) - } - if c.secretKey == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("secretKey"), "")) - } - - return allErrs.ToAggregate() -} diff --git a/pkg/backup/storage/s3/config_test.go b/pkg/backup/storage/s3/config_test.go deleted file mode 100644 index 4f9557dd3..000000000 --- a/pkg/backup/storage/s3/config_test.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 s3 - -import ( - "testing" - - "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" -) - -func TestConfigFromSecretDataWithValidData(t *testing.T) { - storage := &v1alpha1.Storage{ - Provider: "s3", - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", - }, - } - - creds := map[string]string{ - "accessKey": "accessKey", - "secretKey": "secretKey", - } - - config := NewConfig(storage, creds) - - err := config.Validate() - if err != nil { - t.Errorf("Expected config to be valid but got error: %+v", err) - } -} - -func TestConfigFromSecretDataWithInValidData(t *testing.T) { - storage := &v1alpha1.Storage{ - Provider: "s3", - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", - }, - } - - creds := map[string]string{} - - config := NewConfig(storage, creds) - - err := config.Validate() - if err == nil { - t.Error("Expected config to be invalid but was valid") - } -} diff --git a/pkg/backup/storage/s3/provider.go b/pkg/backup/storage/s3/provider.go index 16d903917..c0a484107 100644 --- a/pkg/backup/storage/s3/provider.go +++ b/pkg/backup/storage/s3/provider.go @@ -17,55 +17,103 @@ package s3 import ( "io" + "github.com/aws/aws-sdk-go/aws" + s3credentials "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3/s3manager" "github.com/golang/glog" "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/util/validation/field" + "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" ) // Provider is storage implementation of provider.Interface. type Provider struct { - client *Client - config *Config + v1alpha1.S3StorageProvider + + s3 *s3.S3 + s3Uploader *s3manager.Uploader } -// NewStorage creates a provider capable of storing and retreiving objects against the specified -// 's3' storage configuration and credentials. -func NewStorage(config *v1alpha1.Storage, creds map[string]string) (*Provider, error) { - cfg := NewConfig(config, creds) - if err := cfg.Validate(); err != nil { - return nil, err +// NewProvider creates a new S3 (compatible) storage provider. +func NewProvider(provider *v1alpha1.S3StorageProvider, credentials map[string]string) (*Provider, error) { + accessKey, secretKey, err := getCredentials(credentials) + if err != nil { + return nil, errors.WithStack(err) } - c, err := NewClient(cfg) + sess, err := session.NewSession( + aws.NewConfig(). + WithCredentials(s3credentials.NewStaticCredentials(accessKey, secretKey, "")). + WithEndpoint(provider.Endpoint). + WithRegion(provider.Region). + WithS3ForcePathStyle(provider.ForcePathStyle), + ) if err != nil { - return nil, err + return nil, errors.WithStack(err) } - return &Provider{client: c, config: cfg}, nil + + if _, err := sess.Config.Credentials.Get(); err != nil { + return nil, errors.WithStack(err) + } + + return &Provider{ + S3StorageProvider: *provider, + s3: s3.New(sess), + s3Uploader: s3manager.NewUploader(sess), + }, nil } -// Store will upload the content of the data stream to S3. +// Store the given data at the given key. func (p *Provider) Store(key string, body io.ReadCloser) error { - glog.V(4).Infof("storing backup (provider='s3', endpoint='%s', bucket='%s', key='%s')", p.config.endpoint, p.config.bucket, key) + glog.V(2).Infof("Storing backup (provider=\"S3\", endpoint=%q, bucket=%q, key=%q)", p.Endpoint, p.Bucket, key) + defer body.Close() - rq := &s3manager.UploadInput{ - Bucket: &p.config.bucket, + + _, err := p.s3Uploader.Upload(&s3manager.UploadInput{ + Bucket: &p.Bucket, Key: &key, Body: body, - } - _, err := p.client.s3Uploader.Upload(rq) - return errors.Wrapf(err, "error storing backup (provider='s3', endpoint='%s', bucket='%s', key='%s')", p.config.endpoint, p.config.bucket, key) + }) + return errors.Wrapf(err, "error storing backup (provider=\"S3\", endpoint=%q, bucket=%q, key=%q)", p.Endpoint, p.Bucket, key) } -// Retrieve will provide a data stream on the specified object from S3. +// Retrieve the given key from S3 storage service. func (p *Provider) Retrieve(key string) (io.ReadCloser, error) { - glog.V(4).Infof("retrieving backup (provider='s3', endpoint='%s', bucket='%s', key='%s')", p.config.endpoint, p.config.bucket, key) - req := &s3.GetObjectInput{Bucket: &p.config.bucket, Key: &key} - obj, err := p.client.s3.GetObject(req) + glog.V(2).Infof("Retrieving backup (provider=\"s3\", endpoint=%q, bucket=%q, key=%q)", p.Endpoint, p.Bucket, key) + + obj, err := p.s3.GetObject(&s3.GetObjectInput{Bucket: &p.Bucket, Key: &key}) if err != nil { - return nil, errors.Wrapf(err, "error retrieving backup (provider='s3', endpoint='%s', bucket='%s', key='%s')", p.config.endpoint, p.config.bucket, key) + return nil, errors.Wrapf(err, "error retrieving backup (provider='S3', endpoint='%s', bucket='%s', key='%s')", p.Endpoint, p.Bucket, key) } + return obj.Body, nil } + +// getCredentials gets an accesskey and secretKey from the provided map. +func getCredentials(credentials map[string]string) (string, string, error) { + allErrs := field.ErrorList{} + fldPath := field.NewPath("data") + + if credentials == nil { + return "", "", errors.New("no credentials provided") + } + + accessKey, ok := credentials["accessKey"] + if !ok { + allErrs = append(allErrs, field.Required(fldPath.Child("accessKey"), "")) + } + secretKey, ok := credentials["secretKey"] + if !ok { + allErrs = append(allErrs, field.Required(fldPath.Child("secretKey"), "")) + } + + if len(allErrs) > 0 { + return "", "", allErrs.ToAggregate() + } + + return accessKey, secretKey, nil +} diff --git a/pkg/backup/storage/storage.go b/pkg/backup/storage/storage.go index 5bbfff9a4..951f8fcc3 100644 --- a/pkg/backup/storage/storage.go +++ b/pkg/backup/storage/storage.go @@ -15,19 +15,12 @@ package storage import ( - "fmt" "io" - "strings" "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" "github.com/oracle/mysql-operator/pkg/backup/storage/s3" ) -const ( - // ProviderS3 denotes S3 compatability backed storage provider. - ProviderS3 = "s3" -) - // Interface abstracts the underlying storage provider. type Interface interface { // Store creates a new object in the underlying provider's datastore if it does not exist, @@ -39,11 +32,6 @@ type Interface interface { // NewStorageProvider accepts a secret map and uses its contents to determine the // desired object storage provider implementation. -func NewStorageProvider(config *v1alpha1.Storage, creds map[string]string) (Interface, error) { - switch strings.ToLower(config.Provider) { - case ProviderS3: - return s3.NewStorage(config, creds) - default: - return nil, fmt.Errorf("unknown backup storage provider %q", config.Provider) - } +func NewStorageProvider(config v1alpha1.StorageProvider, credentials map[string]string) (Interface, error) { + return s3.NewProvider(config.S3, credentials) } diff --git a/pkg/cluster/innodb/innodb.go b/pkg/cluster/innodb/innodb.go index 3d7228124..ea900104d 100644 --- a/pkg/cluster/innodb/innodb.go +++ b/pkg/cluster/innodb/innodb.go @@ -21,7 +21,7 @@ import ( // DefaultClusterName is the default name assigned to InnoDB clusters created by // the MySQL operator. -const DefaultClusterName = "MySQLCluster" +const DefaultClusterName = "Cluster" // MySQLDBPort is port on which MySQL listens for client connections. const MySQLDBPort = 3306 diff --git a/pkg/cluster/instance.go b/pkg/cluster/instance.go index 8951b746f..f3c23b446 100644 --- a/pkg/cluster/instance.go +++ b/pkg/cluster/instance.go @@ -31,7 +31,7 @@ import ( type Instance struct { // Namespace is the Kubernetes Namespace in which the instance is running. Namespace string - // ClusterName is the name of the MySQLCluster to which the instance + // ClusterName is the name of the Cluster to which the instance // belongs. ClusterName string // ParentName is the name of the StatefulSet to which the instance belongs. diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index f9c2dfbbe..fb8b68afa 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -14,18 +14,18 @@ package constants -// MySQLClusterLabel is applied to all components of a MySQL cluster -const MySQLClusterLabel = "v1alpha1.mysql.oracle.com/cluster" +// ClusterLabel is applied to all components of a MySQL cluster +const ClusterLabel = "v1alpha1.mysql.oracle.com/cluster" // MySQLOperatorVersionLabel denotes the version of the MySQLOperator and // MySQLOperatorAgent running in the cluster. const MySQLOperatorVersionLabel = "v1alpha1.mysql.oracle.com/version" -// LabelMySQLClusterRole specifies the role of a Pod within a MySQLCluster. -const LabelMySQLClusterRole = "v1alpha1.mysql.oracle.com/role" +// LabelClusterRole specifies the role of a Pod within a Cluster. +const LabelClusterRole = "v1alpha1.mysql.oracle.com/role" -// MySQLClusterRolePrimary denotes a primary InnoDB cluster member. -const MySQLClusterRolePrimary = "primary" +// ClusterRolePrimary denotes a primary InnoDB cluster member. +const ClusterRolePrimary = "primary" -// MySQLClusterRoleSecondary denotes a secondary InnoDB cluster member. -const MySQLClusterRoleSecondary = "secondary" +// ClusterRoleSecondary denotes a secondary InnoDB cluster member. +const ClusterRoleSecondary = "secondary" diff --git a/pkg/controllers/backup/agent_controller.go b/pkg/controllers/backup/agent_controller.go index 876d8e5b6..0328877e5 100644 --- a/pkg/controllers/backup/agent_controller.go +++ b/pkg/controllers/backup/agent_controller.go @@ -37,8 +37,9 @@ import ( record "k8s.io/client-go/tools/record" workqueue "k8s.io/client-go/util/workqueue" + backuputil "github.com/oracle/mysql-operator/pkg/api/backup" "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - backuputil "github.com/oracle/mysql-operator/pkg/backup" + backuphandler "github.com/oracle/mysql-operator/pkg/backup" executor "github.com/oracle/mysql-operator/pkg/backup/executor" controllerutils "github.com/oracle/mysql-operator/pkg/controllers/util" clientset "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned/typed/mysql/v1alpha1" @@ -50,14 +51,14 @@ import ( const agentControllerAgentName = "agent-backup-controller" -// AgentController handles the excution of MySQLBackups on a specific +// AgentController handles the excution of Backups on a specific // mysql-agent. It is run in each mysql-agent. type AgentController struct { // podName is the name of the pod the controller is running in. podName string kubeClient kubernetes.Interface - client clientset.MySQLBackupsGetter + client clientset.BackupsGetter syncHandler func(key string) error // podLister is able to list/get Pods from a shared informer's store. @@ -66,17 +67,17 @@ type AgentController struct { // least once. podListerSynced cache.InformerSynced - // clusterLister is able to list/get MySQLClusters from a shared informer's + // clusterLister is able to list/get Clusters from a shared informer's // store. - clusterLister listersv1alpha1.MySQLClusterLister - // clusterListerSynced returns true if the MySQLCluster shared informer has + clusterLister listersv1alpha1.ClusterLister + // clusterListerSynced returns true if the Cluster shared informer has // synced at least once. clusterListerSynced cache.InformerSynced - // backupLister is able to list/get MySQLBackups from a shared informer's + // backupLister is able to list/get Backups from a shared informer's // store. - backupLister listersv1alpha1.MySQLBackupLister - // backupListerSynced returns true if the MySQLBackup shared informer has + backupLister listersv1alpha1.BackupLister + // backupListerSynced returns true if the Backup shared informer has // synced at least once. backupListerSynced cache.InformerSynced @@ -84,14 +85,17 @@ type AgentController struct { // recorder is an event recorder for recording Event resources to the // Kubernetes API. recorder record.EventRecorder + + // conditionUpdater updates the conditions of Backups. + conditionUpdater ConditionUpdater } // NewAgentController constructs a new AgentController. func NewAgentController( kubeClient kubernetes.Interface, - client clientset.MySQLBackupsGetter, - backupInformer informersv1alpha1.MySQLBackupInformer, - clusterInformer informersv1alpha1.MySQLClusterInformer, + client clientset.BackupsGetter, + backupInformer informersv1alpha1.BackupInformer, + clusterInformer informersv1alpha1.ClusterInformer, podInformer corev1informers.PodInformer, podName string, ) *AgentController { @@ -114,6 +118,7 @@ func NewAgentController( podListerSynced: podInformer.Informer().HasSynced, queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "backup"), recorder: recorder, + conditionUpdater: &conditionUpdater{client: client}, } c.syncHandler = c.processBackup @@ -121,19 +126,19 @@ func NewAgentController( backupInformer.Informer().AddEventHandler( cache.ResourceEventHandlerFuncs{ UpdateFunc: func(oldObj, newObj interface{}) { - new := newObj.(*v1alpha1.MySQLBackup) - if new.Status.Phase == v1alpha1.BackupPhaseScheduled && new.Spec.AgentScheduled == c.podName { + new := newObj.(*v1alpha1.Backup) + _, cond := backuputil.GetBackupCondition(&new.Status, v1alpha1.BackupScheduled) + if cond != nil && cond.Status == corev1.ConditionTrue && new.Spec.ScheduledMember == c.podName { key, err := cache.MetaNamespaceKeyFunc(new) if err != nil { glog.Errorf("Error creating queue key, item not added to queue: %v", err) return } c.queue.Add(key) - glog.V(2).Infof("MySQLBackup %q queued", kubeutil.NamespaceAndName(new)) + glog.V(2).Infof("Backup %q queued", kubeutil.NamespaceAndName(new)) return } - glog.V(2).Infof("MySQLBackup %q is not Scheduled, skipping (phase=%q)", - kubeutil.NamespaceAndName(new), new.Status.Phase) + glog.V(2).Infof("Backup %q is not Scheduled, skipping.", kubeutil.NamespaceAndName(new)) }, }, @@ -228,9 +233,9 @@ func (controller *AgentController) processBackup(key string) error { } // Get resource from store. - backup, err := controller.backupLister.MySQLBackups(ns).Get(name) + backup, err := controller.backupLister.Backups(ns).Get(name) if err != nil { - return errors.Wrap(err, "error getting MySQLBackup") + return errors.Wrap(err, "error getting Backup") } // Don't modify items in the cache. @@ -247,43 +252,45 @@ func (controller *AgentController) processBackup(key string) error { validationErrs := field.ErrorList{} fldPath := field.NewPath("spec") - // Check the referenced MySQLCluster exists. - _, err := controller.clusterLister.MySQLClusters(ns).Get(backup.Spec.ClusterRef.Name) + // Check the referenced Cluster exists. + _, err := controller.clusterLister.Clusters(ns).Get(backup.Spec.Cluster.Name) if err != nil { if !apierrors.IsNotFound(err) { return err } validationErrs = append(validationErrs, - field.NotFound(fldPath.Child("clusterRef").Child("name"), backup.Spec.ClusterRef.Name)) + field.NotFound(fldPath.Child("cluster").Child("name"), backup.Spec.Cluster.Name)) } - creds, err = controller.kubeClient.CoreV1().Secrets(ns).Get(backup.Spec.Storage.SecretRef.Name, metav1.GetOptions{}) + // TODO(apryde) when we have more storage providers this will need to be abstracted away. + creds, err = controller.kubeClient.CoreV1().Secrets(ns).Get(backup.Spec.StorageProvider.S3.CredentialsSecret.Name, metav1.GetOptions{}) if err != nil { if !apierrors.IsNotFound(err) { return errors.Wrap(err, "getting backup credentials secret") } validationErrs = append(validationErrs, - field.NotFound(fldPath.Child("storage").Child("secretRef").Child("name"), backup.Spec.Storage.SecretRef.Name)) + field.NotFound(fldPath.Child("storageProvider", "s3", "credentialsSecret", "name"), backup.Spec.StorageProvider.S3.CredentialsSecret.Name)) } if len(validationErrs) > 0 { validationErr = validationErrs.ToAggregate() } } - // If the MySQLBackup is not valid emit an event to that effect and mark + // If the Backup is not valid emit an event to that effect and mark // it as failed. // TODO(apryde): Maybe we should add an UpdateFunc to the backupInformer // and support users fixing validation errors via updates (rather than // recreation). if validationErr != nil { - backup.Status.Phase = v1alpha1.BackupPhaseFailed - backup, err = controller.client.MySQLBackups(ns).Update(backup) - if err != nil { - return errors.Wrapf(err, "failed to update (phase=%q)", v1alpha1.BackupPhaseFailed) - } controller.recorder.Eventf(backup, corev1.EventTypeWarning, "FailedValidation", validationErr.Error()) - - return nil // We don't return an error as we don't want to re-queue. + // NOTE: We only return an error here if we fail to set the condition + // (rather than on validation failure) as we don't want to retry. + return controller.conditionUpdater.Update(backup, &v1alpha1.BackupCondition{ + Type: v1alpha1.BackupFailed, + Status: corev1.ConditionFalse, + Reason: "FailedValidation", + Message: validationErr.Error(), + }) } err = controller.performBackup(backup, creds) @@ -294,60 +301,62 @@ func (controller *AgentController) processBackup(key string) error { return nil } -func (controller *AgentController) performBackup(backup *v1alpha1.MySQLBackup, creds *corev1.Secret) error { +func (controller *AgentController) performBackup(backup *v1alpha1.Backup, creds *corev1.Secret) error { // Update backup phase to started. started := time.Now() - backup.Status.Phase = v1alpha1.BackupPhaseStarted - backup.Status.TimeStarted = metav1.Time{Time: started} - backup, err := controller.client.MySQLBackups(backup.Namespace).Update(backup) - if err != nil { - return errors.Wrapf(err, "failed to mark MySQLBackup %q as started", kubeutil.NamespaceAndName(backup)) + if err := controller.conditionUpdater.Update(backup, &v1alpha1.BackupCondition{ + Type: v1alpha1.BackupRunning, + Status: corev1.ConditionTrue, + }); err != nil { + return err } - // TODO: Should backuputil.NewConfiguredRunner accept a map[string][]byte + // TODO: Should backuphandler.NewConfiguredRunner accept a map[string][]byte // instead? credsMap := make(map[string]string, len(creds.Data)) for k, v := range creds.Data { credsMap[k] = string(v) } - runner, err := backuputil.NewConfiguredRunner(backup.Spec.Executor, executor.DefaultCreds(), backup.Spec.Storage, credsMap) + runner, err := backuphandler.NewConfiguredRunner(backup.Spec.Executor, executor.DefaultCreds(), backup.Spec.StorageProvider, credsMap) if err != nil { - backup.Status.Phase = v1alpha1.BackupPhaseFailed - backup, updateErr := controller.client.MySQLBackups(backup.Namespace).Update(backup) - if updateErr != nil { - return errors.Wrapf(err, "failed to mark MySQLBackup %q as failed", kubeutil.NamespaceAndName(backup)) - } - - controller.recorder.Event(backup, corev1.EventTypeWarning, "FailedValidation", err.Error()) - return nil // We return nil as the error cannot be retried. + controller.recorder.Event(backup, corev1.EventTypeWarning, "ExecutionFailed", err.Error()) + return controller.conditionUpdater.Update(backup, &v1alpha1.BackupCondition{ + Type: v1alpha1.BackupFailed, + Status: corev1.ConditionFalse, + Reason: "ExecutionFailed", + Message: err.Error(), + }) } - key, err := runner.Backup(fmt.Sprintf("%s-%s", backup.Spec.ClusterRef.Name, backup.Name)) + key, err := runner.Backup(fmt.Sprintf("%s-%s", backup.Spec.Cluster.Name, backup.Name)) if err != nil { - backup.Status.Phase = v1alpha1.BackupPhaseFailed - backup, updateErr := controller.client.MySQLBackups(backup.Namespace).Update(backup) - if updateErr != nil { - return errors.Wrapf(err, "failed to mark MySQLBackup %q as failed", kubeutil.NamespaceAndName(backup)) - } - - controller.recorder.Event(backup, corev1.EventTypeWarning, "BackupFailed", err.Error()) - return nil // We return nil as the error cannot be retried. + controller.recorder.Event(backup, corev1.EventTypeWarning, "ExecutionFailed", err.Error()) + return controller.conditionUpdater.Update(backup, &v1alpha1.BackupCondition{ + Type: v1alpha1.BackupFailed, + Status: corev1.ConditionFalse, + Reason: "ExecutionFailed", + Message: err.Error(), + }) } finished := time.Now() - backup.Status.Phase = v1alpha1.BackupPhaseComplete + backup.Status.TimeStarted = metav1.Time{Time: started} backup.Status.TimeCompleted = metav1.Time{Time: finished} backup.Status.Outcome = v1alpha1.BackupOutcome{Location: key} - backup, err = controller.client.MySQLBackups(backup.Namespace).Update(backup) + backuputil.UpdateBackupCondition(&backup.Status, &v1alpha1.BackupCondition{ + Type: v1alpha1.BackupComplete, + Status: corev1.ConditionTrue, + }) + backup, err = controller.client.Backups(backup.Namespace).Update(backup) if err != nil { - return errors.Wrapf(err, "failed to mark MySQLBackup %q as complete", kubeutil.NamespaceAndName(backup)) + return errors.Wrapf(err, "failed to mark Backup %q as complete", kubeutil.NamespaceAndName(backup)) } metrics.IncEventCounter(clusterBackupCount) - glog.Infof("MySQLBackup %q succeeded in %v", backup.Name, finished.Sub(started)) - controller.recorder.Event(backup, corev1.EventTypeNormal, "Success", "Backup complete") + glog.Infof("Backup %q succeeded in %v", backup.Name, finished.Sub(started)) + controller.recorder.Event(backup, corev1.EventTypeNormal, "Complete", "Backup complete") return nil } diff --git a/pkg/controllers/backup/condition_updater.go b/pkg/controllers/backup/condition_updater.go new file mode 100644 index 000000000..a60ad059c --- /dev/null +++ b/pkg/controllers/backup/condition_updater.go @@ -0,0 +1,27 @@ +package backup + +import ( + "github.com/golang/glog" + + backuputil "github.com/oracle/mysql-operator/pkg/api/backup" + "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + clientset "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned/typed/mysql/v1alpha1" +) + +// ConditionUpdater enables updating Backup conditions. +type ConditionUpdater interface { + Update(backup *v1alpha1.Backup, condition *v1alpha1.BackupCondition) error +} + +type conditionUpdater struct { + client clientset.BackupsGetter +} + +func (p *conditionUpdater) Update(backup *v1alpha1.Backup, condition *v1alpha1.BackupCondition) error { + glog.V(2).Infof("Updating Backup condition for %s/%s to (%s==%s)", backup.Namespace, backup.Name, condition.Type, condition.Status) + if backuputil.UpdateBackupCondition(&backup.Status, condition) { + _, err := p.client.Backups(backup.Namespace).Update(backup) + return err + } + return nil +} diff --git a/pkg/controllers/backup/operator_controller.go b/pkg/controllers/backup/operator_controller.go index d9b7f6a33..0094ad50d 100644 --- a/pkg/controllers/backup/operator_controller.go +++ b/pkg/controllers/backup/operator_controller.go @@ -35,6 +35,7 @@ import ( record "k8s.io/client-go/tools/record" workqueue "k8s.io/client-go/util/workqueue" + backuputil "github.com/oracle/mysql-operator/pkg/api/backup" v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" clusterlabeler "github.com/oracle/mysql-operator/pkg/controllers/cluster/labeler" controllerutils "github.com/oracle/mysql-operator/pkg/controllers/util" @@ -47,16 +48,16 @@ import ( const controllerAgentName = "operator-backup-controller" // OperatorController handles validation, labeling, and scheduling of -// MySQLBackups to be executed on a specific (primary) mysql-agent. It is run +// Backups to be executed on a specific (primary) mysql-agent. It is run // in the operator. type OperatorController struct { - client clientset.MySQLBackupsGetter + client clientset.BackupsGetter syncHandler func(key string) error - // backupLister is able to list/get MySQLBackups from a shared informer's + // backupLister is able to list/get Backups from a shared informer's // store. - backupLister listersv1alpha1.MySQLBackupLister - // backupListerSynced returns true if the MySQLBackup shared informer has + backupLister listersv1alpha1.BackupLister + // backupListerSynced returns true if the Backup shared informer has // synced at least once. backupListerSynced cache.InformerSynced @@ -66,10 +67,10 @@ type OperatorController struct { // least once. podListerSynced cache.InformerSynced - // clusterLister is able to list/get MySQLClusters from a shared informer's + // clusterLister is able to list/get Clusters from a shared informer's // store. - clusterLister listersv1alpha1.MySQLClusterLister - // clusterListerSynced returns true if the MySQLCluster shared informer has + clusterLister listersv1alpha1.ClusterLister + // clusterListerSynced returns true if the Cluster shared informer has // synced at least once. clusterListerSynced cache.InformerSynced @@ -77,14 +78,17 @@ type OperatorController struct { // recorder is an event recorder for recording Event resources to the // Kubernetes API. recorder record.EventRecorder + + // conditionUpdater updates the conditions of Backups. + conditionUpdater ConditionUpdater } // NewOperatorController constructs a new OperatorController. func NewOperatorController( kubeClient kubernetes.Interface, - client clientset.MySQLBackupsGetter, - backupInformer informersv1alpha1.MySQLBackupInformer, - clusterInformer informersv1alpha1.MySQLClusterInformer, + client clientset.BackupsGetter, + backupInformer informersv1alpha1.BackupInformer, + clusterInformer informersv1alpha1.ClusterInformer, podInformer corev1informers.PodInformer, ) *OperatorController { // Create event broadcaster. @@ -104,6 +108,7 @@ func NewOperatorController( podListerSynced: podInformer.Informer().HasSynced, queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "backup"), recorder: recorder, + conditionUpdater: &conditionUpdater{client: client}, } c.syncHandler = c.processBackup @@ -111,14 +116,12 @@ func NewOperatorController( backupInformer.Informer().AddEventHandler( cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { - backup := obj.(*v1alpha1.MySQLBackup) - - switch backup.Status.Phase { - case v1alpha1.BackupPhaseUnknown, v1alpha1.BackupPhaseNew: - // Only process new backups. - default: - glog.V(2).Infof("MySQLBackup %q is not new, skipping (phase=%q)", - kubeutil.NamespaceAndName(backup), backup.Status.Phase) + backup := obj.(*v1alpha1.Backup) + + _, cond := backuputil.GetBackupCondition(&backup.Status, v1alpha1.BackupScheduled) + if cond != nil && cond.Status == corev1.ConditionTrue { + glog.V(4).Infof("Backup %q is already scheduled on Cluster member %q", + kubeutil.NamespaceAndName(backup), backup.Spec.ScheduledMember) return } @@ -221,9 +224,9 @@ func (controller *OperatorController) processBackup(key string) error { } // Get resource from store. - backup, err := controller.backupLister.MySQLBackups(ns).Get(name) + backup, err := controller.backupLister.Backups(ns).Get(name) if err != nil { - return errors.Wrap(err, "error getting MySQLBackup") + return errors.Wrap(err, "error getting Backup") } // Don't modify items in the cache. @@ -236,14 +239,14 @@ func (controller *OperatorController) processBackup(key string) error { validationErrs := field.ErrorList{} fldPath := field.NewPath("spec") - // Check the referenced MySQLCluster exists. - _, err := controller.clusterLister.MySQLClusters(ns).Get(backup.Spec.ClusterRef.Name) + // Check the referenced Cluster exists. + _, err := controller.clusterLister.Clusters(ns).Get(backup.Spec.Cluster.Name) if err != nil { if !apierrors.IsNotFound(err) { return err } validationErrs = append(validationErrs, - field.NotFound(fldPath.Child("clusterRef").Child("name"), backup.Spec.ClusterRef.Name)) + field.NotFound(fldPath.Child("cluster").Child("name"), backup.Spec.Cluster.Name)) } if len(validationErrs) > 0 { @@ -251,21 +254,18 @@ func (controller *OperatorController) processBackup(key string) error { } } - // If the MySQLBackup is not valid emit an event to that effect and mark - // it as failed. - // TODO(apryde): Maybe we should add an UpdateFunc to the backupInformer - // and support users fixing validation errors via updates (rather than - // recreation). + // TODO(apryde): Maybe we should add an UpdateFunc to the backupInformer and support users fixing + // validation errors via updates (rather than recreation). if validationErr != nil { - backup.Status.Phase = v1alpha1.BackupPhaseFailed - backup, err = controller.client.MySQLBackups(ns).Update(backup) - if err != nil { - return errors.Wrapf(err, "failed to update (phase=%q)", v1alpha1.BackupPhaseFailed) - } - - controller.recorder.Event(backup, corev1.EventTypeWarning, "FailedValidation", validationErr.Error()) - - return nil // We don't return an error as we don't want to re-queue. + controller.recorder.Eventf(backup, corev1.EventTypeWarning, "FailedValidation", validationErr.Error()) + // NOTE: We only return an error here if we fail to set the condition + // (rather than on validation failure) as we don't want to retry. + return controller.conditionUpdater.Update(backup, &v1alpha1.BackupCondition{ + Type: v1alpha1.BackupFailed, + Status: corev1.ConditionFalse, + Reason: "FailedValidation", + Message: validationErr.Error(), + }) } // If possible schedule backup on a secondary member otherwise a primary. @@ -275,20 +275,20 @@ func (controller *OperatorController) processBackup(key string) error { } // Update resource. - backup, err = controller.client.MySQLBackups(ns).Update(backup) + backup, err = controller.client.Backups(ns).Update(backup) if err != nil { return errors.Wrap(err, "failed to update") } - controller.recorder.Eventf(backup, corev1.EventTypeNormal, "SuccessScheduled", "Scheduled on Pod %q", backup.Spec.AgentScheduled) + controller.recorder.Eventf(backup, corev1.EventTypeNormal, "SuccessScheduled", "Scheduled on Pod %q", backup.Spec.ScheduledMember) return nil } -// scheduleBackup schedules a MySQLBackup on a specific member of a MySQLCluster. -func (controller *OperatorController) scheduleBackup(backup *v1alpha1.MySQLBackup) (*v1alpha1.MySQLBackup, error) { +// scheduleBackup schedules a Backup on a specific member of a Cluster. +func (controller *OperatorController) scheduleBackup(backup *v1alpha1.Backup) (*v1alpha1.Backup, error) { var ( - name = backup.Spec.ClusterRef.Name + name = backup.Spec.Cluster.Name ns = backup.Namespace ) @@ -298,8 +298,11 @@ func (controller *OperatorController) scheduleBackup(backup *v1alpha1.MySQLBacku return backup, errors.Wrap(err, "error listing Pods to choose secondary") } if len(secondaries) > 0 { - backup.Status.Phase = v1alpha1.BackupPhaseScheduled - backup.Spec.AgentScheduled = secondaries[0].Name + backuputil.UpdateBackupCondition(&backup.Status, &v1alpha1.BackupCondition{ + Type: v1alpha1.BackupScheduled, + Status: corev1.ConditionTrue, + }) + backup.Spec.ScheduledMember = secondaries[0].Name return backup, nil } @@ -309,8 +312,11 @@ func (controller *OperatorController) scheduleBackup(backup *v1alpha1.MySQLBacku return backup, errors.Wrap(err, "error listing Pods to choose primary") } if len(primaries) > 0 { - backup.Status.Phase = v1alpha1.BackupPhaseScheduled - backup.Spec.AgentScheduled = primaries[0].Name + backuputil.UpdateBackupCondition(&backup.Status, &v1alpha1.BackupCondition{ + Type: v1alpha1.BackupScheduled, + Status: corev1.ConditionTrue, + }) + backup.Spec.ScheduledMember = primaries[0].Name return backup, nil } diff --git a/pkg/controllers/backup/schedule/controller.go b/pkg/controllers/backup/schedule/controller.go index 728b74e5a..062fc9815 100644 --- a/pkg/controllers/backup/schedule/controller.go +++ b/pkg/controllers/backup/schedule/controller.go @@ -25,6 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/clock" + field "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" scheme "k8s.io/client-go/kubernetes/scheme" @@ -48,15 +49,15 @@ const controllerName = "backupschedule-controller" const ( // CronScheduleValidationError is used as part of the Event 'reason' when a - // MySQLBackupSchedule fails validation due to an invalid Cron schedule string. + // BackupSchedule fails validation due to an invalid Cron schedule string. CronScheduleValidationError = "CronScheduleValidationError" ) -// Controller watches the Kubernetes API for changes to MySQLBackupSchedule +// Controller watches the Kubernetes API for changes to BackupSchedule // resources. type Controller struct { opClient mysqlop.Interface - backupScheduleLister oplisters.MySQLBackupScheduleLister + backupScheduleLister oplisters.BackupScheduleLister backupScheduleListerSynced cache.InformerSynced syncHandler func(scheduleName string) error queue workqueue.RateLimitingInterface @@ -70,7 +71,7 @@ type Controller struct { func NewController( opClient mysqlop.Interface, kubeClient kubernetes.Interface, - backupScheduleInformer opinformers.MySQLBackupScheduleInformer, + backupScheduleInformer opinformers.BackupScheduleInformer, syncPeriod time.Duration, namespace string, ) *Controller { @@ -96,16 +97,7 @@ func NewController( backupScheduleInformer.Informer().AddEventHandler( cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { - bs := obj.(*v1alpha1.MySQLBackupSchedule) - - switch bs.Status.Phase { - case "", v1alpha1.BackupSchedulePhaseNew, v1alpha1.BackupSchedulePhaseEnabled: - // add to work queue - default: - glog.V(4).Info("Backup schedule is not new, skipping") - return - } - + bs := obj.(*v1alpha1.BackupSchedule) key, err := cache.MetaNamespaceKeyFunc(bs) if err != nil { glog.Errorf("Error creating queue key, item not added to queue: %v", err) @@ -161,17 +153,13 @@ func (controller *Controller) Run(ctx context.Context, numWorkers int) error { } func (controller *Controller) enqueueAllEnabledSchedules() { - backupSchedules, err := controller.backupScheduleLister.MySQLBackupSchedules(controller.namespace).List(labels.NewSelector()) + backupSchedules, err := controller.backupScheduleLister.BackupSchedules(controller.namespace).List(labels.NewSelector()) if err != nil { - glog.Errorf("Error listing MySQLBackupSchedules: %v", err) + glog.Errorf("Error listing BackupSchedules: %v", err) return } for _, bs := range backupSchedules { - if bs.Status.Phase != v1alpha1.BackupSchedulePhaseEnabled { - continue - } - key, err := cache.MetaNamespaceKeyFunc(bs) if err != nil { glog.Errorf("Error creating queue key, item not added to queue: %v", err) @@ -221,21 +209,14 @@ func (controller *Controller) processSchedule(key string) error { } glog.V(6).Info("Getting backup schedule") - bs, err := controller.backupScheduleLister.MySQLBackupSchedules(ns).Get(name) + bs, err := controller.backupScheduleLister.BackupSchedules(ns).Get(name) if err != nil { // backup schedule no longer exists if apierrors.IsNotFound(err) { glog.Errorf("Backup schedule not found, err: %v", err) return nil } - return errors.Wrap(err, "error getting MySQLBackupSchedule") - } - - switch bs.Status.Phase { - case "", v1alpha1.BackupSchedulePhaseNew, v1alpha1.BackupSchedulePhaseEnabled: - // valid phase for processing - default: - return nil + return errors.Wrap(err, "error getting BackupSchedule") } glog.V(6).Info("Cloning backup schedule") @@ -248,37 +229,11 @@ func (controller *Controller) processSchedule(key string) error { return err } - // validation - even if the item is Enabled, we can't trust it - // so re-validate - currentPhase := bs.Status.Phase - cronSchedule, errs := parseCronSchedule(bs) if len(errs) > 0 { - bs.Status.Phase = v1alpha1.BackupSchedulePhaseFailedValidation - for _, err := range errs { - controller.recorder.Event(bs, corev1.EventTypeWarning, CronScheduleValidationError, err) - } - } else { - bs.Status.Phase = v1alpha1.BackupSchedulePhaseEnabled - } - - // update status if it's changed - if currentPhase != bs.Status.Phase { - var updatedBackupSchedule *v1alpha1.MySQLBackupSchedule - err := retry.RetryOnConflict(retry.DefaultRetry, func() error { - updatedBackupSchedule, err = controller.opClient.MysqlV1alpha1().MySQLBackupSchedules(ns).Update(bs) - if err != nil { - return errors.Wrapf(err, "error updating backup schedule phase to %q", bs.Status.Phase) - } - return nil - }) - if err != nil { - return err - } - bs = updatedBackupSchedule - } - - if bs.Status.Phase != v1alpha1.BackupSchedulePhaseEnabled { + // NOTE(apryde): Now without phase this keeps recording validation error events every sync loop. + // It's only every 30s though and means that users can update their backup schedules. + controller.recorder.Event(bs, corev1.EventTypeWarning, CronScheduleValidationError, errs.ToAggregate().Error()) return nil } @@ -286,14 +241,16 @@ func (controller *Controller) processSchedule(key string) error { return controller.submitBackupIfDue(bs, cronSchedule) } -func parseCronSchedule(item *v1alpha1.MySQLBackupSchedule) (cron.Schedule, []string) { - var validationErrors []string +func parseCronSchedule(item *v1alpha1.BackupSchedule) (cron.Schedule, field.ErrorList) { var schedule cron.Schedule + errs := field.ErrorList{} + fldPath := field.NewPath("spec", "schedule") + // cron.Parse panics if schedule is empty - if len(item.Spec.Schedule) == 0 { - validationErrors = append(validationErrors, "Schedule must be a non-empty valid Cron expression") - return nil, validationErrors + if item.Spec.Schedule == "" { + errs = append(errs, field.Required(fldPath, "must be a non-empty valid Cron expression")) + return nil, errs } // adding a recover() around cron.Parse because it panics on empty string and is possible @@ -302,26 +259,26 @@ func parseCronSchedule(item *v1alpha1.MySQLBackupSchedule) (cron.Schedule, []str defer func() { if r := recover(); r != nil { glog.Errorf("Panic parsing schedule: %v, r: %v", item.Spec.Schedule, r) - validationErrors = append(validationErrors, fmt.Sprintf("invalid schedule: %v", r)) + errs = append(errs, field.Invalid(fldPath, item.Spec.Schedule, "must be a valid Cron expression")) } }() if res, err := cron.ParseStandard(item.Spec.Schedule); err != nil { glog.Errorf("Error parsing schedule: %v, err: %v", item.Spec.Schedule, err) - validationErrors = append(validationErrors, fmt.Sprintf("invalid schedule: %v", err)) + errs = append(errs, field.Invalid(fldPath, item.Spec.Schedule, "must be a valid Cron expression")) } else { schedule = res } }() - if len(validationErrors) > 0 { - return nil, validationErrors + if len(errs) > 0 { + return nil, errs } return schedule, nil } -func (controller *Controller) submitBackupIfDue(item *v1alpha1.MySQLBackupSchedule, cronSchedule cron.Schedule) error { +func (controller *Controller) submitBackupIfDue(item *v1alpha1.BackupSchedule, cronSchedule cron.Schedule) error { var ( now = controller.clock.Now() isDue, nextRunTime = getNextRunTime(item, cronSchedule, now) @@ -336,8 +293,8 @@ func (controller *Controller) submitBackupIfDue(item *v1alpha1.MySQLBackupSchedu // trigger a Backup if it's time. glog.Infof("Backup schedule %s[%s] is due, submitting Backup", item.Name, item.Spec.Schedule) backup := getBackup(item, now) - if _, err := controller.opClient.MysqlV1alpha1().MySQLBackups(backup.Namespace).Create(backup); err != nil { - return errors.Wrap(err, "error creating MySQLBackup") + if _, err := controller.opClient.MySQLV1alpha1().Backups(backup.Namespace).Create(backup); err != nil { + return errors.Wrap(err, "error creating Backup") } bs := item.DeepCopy() @@ -345,7 +302,7 @@ func (controller *Controller) submitBackupIfDue(item *v1alpha1.MySQLBackupSchedu bs.Status.LastBackup = metav1.NewTime(now) err := retry.RetryOnConflict(retry.DefaultRetry, func() error { - if _, err := controller.opClient.MysqlV1alpha1().MySQLBackupSchedules(bs.Namespace).Update(bs); err != nil { + if _, err := controller.opClient.MySQLV1alpha1().BackupSchedules(bs.Namespace).Update(bs); err != nil { return errors.Wrapf(err, "error updating backup schedule's LastBackup time to %v", bs.Status.LastBackup) } return nil @@ -359,7 +316,7 @@ func (controller *Controller) submitBackupIfDue(item *v1alpha1.MySQLBackupSchedu // getNextRunTime gets the latest run time (if the backup schedule hasn't run // yet, this will be the zero value which will trigger an immediate backup). -func getNextRunTime(bs *v1alpha1.MySQLBackupSchedule, cronSchedule cron.Schedule, asOf time.Time) (bool, time.Time) { +func getNextRunTime(bs *v1alpha1.BackupSchedule, cronSchedule cron.Schedule, asOf time.Time) (bool, time.Time) { lastBackupTime := bs.Status.LastBackup.Time nextRunTime := cronSchedule.Next(lastBackupTime) @@ -367,8 +324,8 @@ func getNextRunTime(bs *v1alpha1.MySQLBackupSchedule, cronSchedule cron.Schedule return asOf.After(nextRunTime), nextRunTime } -func getBackup(item *v1alpha1.MySQLBackupSchedule, timestamp time.Time) *v1alpha1.MySQLBackup { - backup := &v1alpha1.MySQLBackup{ +func getBackup(item *v1alpha1.BackupSchedule, timestamp time.Time) *v1alpha1.Backup { + backup := &v1alpha1.Backup{ Spec: item.Spec.BackupTemplate, ObjectMeta: metav1.ObjectMeta{ Namespace: item.Namespace, diff --git a/pkg/controllers/backup/schedule/controller_test.go b/pkg/controllers/backup/schedule/controller_test.go index ed5a6f959..6f1811d07 100644 --- a/pkg/controllers/backup/schedule/controller_test.go +++ b/pkg/controllers/backup/schedule/controller_test.go @@ -48,12 +48,11 @@ func TestProcessSchedule(t *testing.T) { tests := []struct { name string scheduleKey string - schedule *v1alpha1.MySQLBackupSchedule + schedule *v1alpha1.BackupSchedule fakeClockTime string expectedErr bool - expectedSchedulePhaseUpdate *v1alpha1.MySQLBackupSchedule - expectedScheduleLastBackupUpdate *v1alpha1.MySQLBackupSchedule - expectedBackupCreate *v1alpha1.MySQLBackup + expectedScheduleLastBackupUpdate *v1alpha1.BackupSchedule + expectedBackupCreate *v1alpha1.Backup expectedEvents []string }{ { @@ -69,73 +68,41 @@ func TestProcessSchedule(t *testing.T) { expectedEvents: []string{}, }, { - name: "schedule with phase FailedValidation does not get processed", - schedule: NewTestMySQLBackupSchedule("ns", "name").WithPhase(v1alpha1.BackupSchedulePhaseFailedValidation).MySQLBackupSchedule, + name: "schedule with gets validated and failed if invalid", + schedule: NewTestBackupSchedule("ns", "name").BackupSchedule, expectedErr: false, - expectedEvents: []string{}, - }, - { - name: "schedule with phase New gets validated and failed if invalid", - schedule: NewTestMySQLBackupSchedule("ns", "name").WithPhase(v1alpha1.BackupSchedulePhaseNew).MySQLBackupSchedule, - expectedErr: false, - expectedSchedulePhaseUpdate: NewTestMySQLBackupSchedule("ns", "name"). - WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). - WithPhase(v1alpha1.BackupSchedulePhaseFailedValidation). - MySQLBackupSchedule, - expectedEvents: []string{"Warning CronScheduleValidationError Schedule must be a non-empty valid Cron expression"}, - }, - { - name: "schedule with phase gets validated and failed if invalid", - schedule: NewTestMySQLBackupSchedule("ns", "name").MySQLBackupSchedule, - expectedErr: false, - expectedSchedulePhaseUpdate: NewTestMySQLBackupSchedule("ns", "name"). - WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). - WithPhase(v1alpha1.BackupSchedulePhaseFailedValidation). - MySQLBackupSchedule, - expectedEvents: []string{"Warning CronScheduleValidationError Schedule must be a non-empty valid Cron expression"}, - }, - { - name: "schedule with phase Enabled gets re-validated and failed if invalid", - schedule: NewTestMySQLBackupSchedule("ns", "name").WithPhase(v1alpha1.BackupSchedulePhaseEnabled).MySQLBackupSchedule, - expectedErr: false, - expectedSchedulePhaseUpdate: NewTestMySQLBackupSchedule("ns", "name"). - WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). - WithPhase(v1alpha1.BackupSchedulePhaseFailedValidation). - MySQLBackupSchedule, - expectedEvents: []string{"Warning CronScheduleValidationError Schedule must be a non-empty valid Cron expression"}, + expectedEvents: []string{"Warning CronScheduleValidationError spec.schedule: Required value: must be a non-empty valid Cron expression"}, }, { - name: "schedule with phase New gets validated and triggers a backup", - schedule: NewTestMySQLBackupSchedule("ns", "name").WithPhase(v1alpha1.BackupSchedulePhaseNew).WithCronSchedule("@every 5m").MySQLBackupSchedule, - fakeClockTime: "2017-01-01 12:00:00", - expectedErr: false, - expectedSchedulePhaseUpdate: NewTestMySQLBackupSchedule("ns", "name").WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). - WithPhase(v1alpha1.BackupSchedulePhaseEnabled).WithCronSchedule("@every 5m").MySQLBackupSchedule, - expectedBackupCreate: NewTestMySQLBackup().WithNamespace("ns").WithName("name-20170101120000").WithLabel("backup-schedule", "name").MySQLBackup, - expectedScheduleLastBackupUpdate: NewTestMySQLBackupSchedule("ns", "name").WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). - WithPhase(v1alpha1.BackupSchedulePhaseEnabled).WithCronSchedule("@every 5m").WithLastBackupTime("2017-01-01 12:00:00").MySQLBackupSchedule, + name: "valid schedule gets validated and triggers a backup", + schedule: NewTestBackupSchedule("ns", "name").WithCronSchedule("@every 5m").BackupSchedule, + fakeClockTime: "2017-01-01 12:00:00", + expectedErr: false, + expectedBackupCreate: NewTestBackup().WithNamespace("ns").WithName("name-20170101120000").WithLabel("backup-schedule", "name").Backup, + expectedScheduleLastBackupUpdate: NewTestBackupSchedule("ns", "name").WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). + WithCronSchedule("@every 5m").WithLastBackupTime("2017-01-01 12:00:00").BackupSchedule, expectedEvents: []string{}, }, { - name: "schedule with phase Enabled gets re-validated and triggers a backup if valid", - schedule: NewTestMySQLBackupSchedule("ns", "name").WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). - WithPhase(v1alpha1.BackupSchedulePhaseEnabled).WithCronSchedule("@every 5m").MySQLBackupSchedule, + name: "schedule with gets re-validated and triggers a backup if valid", + schedule: NewTestBackupSchedule("ns", "name").WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). + WithCronSchedule("@every 5m").BackupSchedule, fakeClockTime: "2017-01-01 12:00:00", expectedErr: false, - expectedBackupCreate: NewTestMySQLBackup().WithNamespace("ns").WithName("name-20170101120000").WithLabel("backup-schedule", "name").MySQLBackup, - expectedScheduleLastBackupUpdate: NewTestMySQLBackupSchedule("ns", "name").WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). - WithPhase(v1alpha1.BackupSchedulePhaseEnabled).WithCronSchedule("@every 5m").WithLastBackupTime("2017-01-01 12:00:00").MySQLBackupSchedule, + expectedBackupCreate: NewTestBackup().WithNamespace("ns").WithName("name-20170101120000").WithLabel("backup-schedule", "name").Backup, + expectedScheduleLastBackupUpdate: NewTestBackupSchedule("ns", "name").WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). + WithCronSchedule("@every 5m").WithLastBackupTime("2017-01-01 12:00:00").BackupSchedule, expectedEvents: []string{}, }, { name: "schedule that's already run gets LastBackup updated", - schedule: NewTestMySQLBackupSchedule("ns", "name").WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). - WithPhase(v1alpha1.BackupSchedulePhaseEnabled).WithCronSchedule("@every 5m").WithLastBackupTime("2000-01-01 00:00:00").MySQLBackupSchedule, + schedule: NewTestBackupSchedule("ns", "name").WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). + WithCronSchedule("@every 5m").WithLastBackupTime("2000-01-01 00:00:00").BackupSchedule, fakeClockTime: "2017-01-01 12:00:00", expectedErr: false, - expectedBackupCreate: NewTestMySQLBackup().WithNamespace("ns").WithName("name-20170101120000").WithLabel("backup-schedule", "name").MySQLBackup, - expectedScheduleLastBackupUpdate: NewTestMySQLBackupSchedule("ns", "name").WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). - WithPhase(v1alpha1.BackupSchedulePhaseEnabled).WithCronSchedule("@every 5m").WithLastBackupTime("2017-01-01 12:00:00").MySQLBackupSchedule, + expectedBackupCreate: NewTestBackup().WithNamespace("ns").WithName("name-20170101120000").WithLabel("backup-schedule", "name").Backup, + expectedScheduleLastBackupUpdate: NewTestBackupSchedule("ns", "name").WithLabel(constants.MySQLOperatorVersionLabel, mysqlOperatorVersion). + WithCronSchedule("@every 5m").WithLastBackupTime("2017-01-01 12:00:00").BackupSchedule, expectedEvents: []string{}, }, } @@ -151,7 +118,7 @@ func TestProcessSchedule(t *testing.T) { c := NewController( mysqlopclient, kubeclient, - mysqlopInformerFactory.Mysql().V1alpha1().MySQLBackupSchedules(), + mysqlopInformerFactory.MySQL().V1alpha1().BackupSchedules(), time.Duration(0), metav1.NamespaceDefault, ) @@ -170,7 +137,7 @@ func TestProcessSchedule(t *testing.T) { c.clock = clock.NewFakeClock(testTime) if test.schedule != nil { - mysqlopInformerFactory.Mysql().V1alpha1().MySQLBackupSchedules().Informer().GetStore().Add(test.schedule) + mysqlopInformerFactory.MySQL().V1alpha1().BackupSchedules().Informer().GetStore().Add(test.schedule) // this is necessary so the Update() call returns the appropriate object mysqlopclient.PrependReactor("update", "mysqlbackupschedules", func(action core.Action) (bool, runtime.Object, error) { @@ -192,14 +159,6 @@ func TestProcessSchedule(t *testing.T) { expectedActions := make([]core.Action, 0) - if upd := test.expectedSchedulePhaseUpdate; upd != nil { - action := core.NewUpdateAction( - v1alpha1.SchemeGroupVersion.WithResource("mysqlbackupschedules"), - upd.Namespace, - upd) - expectedActions = append(expectedActions, action) - } - if created := test.expectedBackupCreate; created != nil { action := core.NewCreateAction( v1alpha1.SchemeGroupVersion.WithResource("mysqlbackups"), @@ -232,41 +191,41 @@ func TestProcessSchedule(t *testing.T) { func TestGetNextRunTime(t *testing.T) { tests := []struct { name string - schedule *v1alpha1.MySQLBackupSchedule + schedule *v1alpha1.BackupSchedule lastRanOffset string expectedDue bool expectedNextRunTimeOffset string }{ { name: "first run", - schedule: &v1alpha1.MySQLBackupSchedule{Spec: v1alpha1.BackupScheduleSpec{Schedule: "@every 5m"}}, + schedule: &v1alpha1.BackupSchedule{Spec: v1alpha1.BackupScheduleSpec{Schedule: "@every 5m"}}, expectedDue: true, expectedNextRunTimeOffset: "5m", }, { name: "just ran", - schedule: &v1alpha1.MySQLBackupSchedule{Spec: v1alpha1.BackupScheduleSpec{Schedule: "@every 5m"}}, + schedule: &v1alpha1.BackupSchedule{Spec: v1alpha1.BackupScheduleSpec{Schedule: "@every 5m"}}, lastRanOffset: "0s", expectedDue: false, expectedNextRunTimeOffset: "5m", }, { name: "almost but not quite time to run", - schedule: &v1alpha1.MySQLBackupSchedule{Spec: v1alpha1.BackupScheduleSpec{Schedule: "@every 5m"}}, + schedule: &v1alpha1.BackupSchedule{Spec: v1alpha1.BackupScheduleSpec{Schedule: "@every 5m"}}, lastRanOffset: "4m59s", expectedDue: false, expectedNextRunTimeOffset: "5m", }, { name: "time to run again", - schedule: &v1alpha1.MySQLBackupSchedule{Spec: v1alpha1.BackupScheduleSpec{Schedule: "@every 5m"}}, + schedule: &v1alpha1.BackupSchedule{Spec: v1alpha1.BackupScheduleSpec{Schedule: "@every 5m"}}, lastRanOffset: "5m", expectedDue: true, expectedNextRunTimeOffset: "5m", }, { name: "several runs missed", - schedule: &v1alpha1.MySQLBackupSchedule{Spec: v1alpha1.BackupScheduleSpec{Schedule: "@every 5m"}}, + schedule: &v1alpha1.BackupSchedule{Spec: v1alpha1.BackupScheduleSpec{Schedule: "@every 5m"}}, lastRanOffset: "5h", expectedDue: true, expectedNextRunTimeOffset: "5m", @@ -308,7 +267,7 @@ func TestParseCronSchedule(t *testing.T) { // Start with a Schedule with: // - schedule: once a day at 9am // - last backup: 2017-08-10 12:27:00 (just happened) - s := &v1alpha1.MySQLBackupSchedule{ + s := &v1alpha1.BackupSchedule{ Spec: v1alpha1.BackupScheduleSpec{ Schedule: "0 9 * * *", }, @@ -350,13 +309,13 @@ func TestParseCronSchedule(t *testing.T) { func TestGetBackup(t *testing.T) { tests := []struct { name string - schedule *v1alpha1.MySQLBackupSchedule + schedule *v1alpha1.BackupSchedule testClockTime string - expectedBackup *v1alpha1.MySQLBackup + expectedBackup *v1alpha1.Backup }{ { name: "ensure name is formatted correctly (AM time)", - schedule: &v1alpha1.MySQLBackupSchedule{ + schedule: &v1alpha1.BackupSchedule{ ObjectMeta: metav1.ObjectMeta{ Namespace: "foo", Name: "bar", @@ -366,7 +325,7 @@ func TestGetBackup(t *testing.T) { }, }, testClockTime: "2017-07-25 09:15:00", - expectedBackup: &v1alpha1.MySQLBackup{ + expectedBackup: &v1alpha1.Backup{ ObjectMeta: metav1.ObjectMeta{ Namespace: "foo", Name: "bar-20170725091500", @@ -376,7 +335,7 @@ func TestGetBackup(t *testing.T) { }, { name: "ensure name is formatted correctly (PM time)", - schedule: &v1alpha1.MySQLBackupSchedule{ + schedule: &v1alpha1.BackupSchedule{ ObjectMeta: metav1.ObjectMeta{ Namespace: "foo", Name: "bar", @@ -386,7 +345,7 @@ func TestGetBackup(t *testing.T) { }, }, testClockTime: "2017-07-25 14:15:00", - expectedBackup: &v1alpha1.MySQLBackup{ + expectedBackup: &v1alpha1.Backup{ ObjectMeta: metav1.ObjectMeta{ Namespace: "foo", Name: "bar-20170725141500", @@ -396,61 +355,61 @@ func TestGetBackup(t *testing.T) { }, { name: "ensure schedule backup template is copied", - schedule: &v1alpha1.MySQLBackupSchedule{ + schedule: &v1alpha1.BackupSchedule{ ObjectMeta: metav1.ObjectMeta{ Namespace: "foo", Name: "bar", }, Spec: v1alpha1.BackupScheduleSpec{ BackupTemplate: v1alpha1.BackupSpec{ - Executor: &v1alpha1.Executor{ - Provider: "mysqldump", - Databases: []string{"db1", "db2"}, - }, - Storage: &v1alpha1.Storage{ - Provider: "s3", - SecretRef: &corev1.LocalObjectReference{ - Name: "backup-storage-creds", + Executor: v1alpha1.BackupExecutor{ + MySQLDump: &v1alpha1.MySQLDumpBackupExecutor{ + Databases: []v1alpha1.Database{{Name: "db1"}, {Name: "db2"}}, }, - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", + }, + StorageProvider: v1alpha1.StorageProvider{ + S3: &v1alpha1.S3StorageProvider{ + Endpoint: "endpoint", + Region: "region", + Bucket: "bucket", + CredentialsSecret: &corev1.LocalObjectReference{ + Name: "backup-storage-creds", + }, }, }, - ClusterRef: &corev1.LocalObjectReference{ + Cluster: &corev1.LocalObjectReference{ Name: "test-cluster", }, - AgentScheduled: "hostname-1", + ScheduledMember: "hostname-1", }, }, }, testClockTime: "2017-07-25 09:15:00", - expectedBackup: &v1alpha1.MySQLBackup{ + expectedBackup: &v1alpha1.Backup{ ObjectMeta: metav1.ObjectMeta{ Namespace: "foo", Name: "bar-20170725091500", }, Spec: v1alpha1.BackupSpec{ - Executor: &v1alpha1.Executor{ - Provider: "mysqldump", - Databases: []string{"db1", "db2"}, - }, - Storage: &v1alpha1.Storage{ - Provider: "s3", - SecretRef: &corev1.LocalObjectReference{ - Name: "backup-storage-creds", + Executor: v1alpha1.BackupExecutor{ + MySQLDump: &v1alpha1.MySQLDumpBackupExecutor{ + Databases: []v1alpha1.Database{{Name: "db1"}, {Name: "db2"}}, }, - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", + }, + StorageProvider: v1alpha1.StorageProvider{ + S3: &v1alpha1.S3StorageProvider{ + Endpoint: "endpoint", + Region: "region", + Bucket: "bucket", + CredentialsSecret: &corev1.LocalObjectReference{ + Name: "backup-storage-creds", + }, }, }, - ClusterRef: &corev1.LocalObjectReference{ + Cluster: &corev1.LocalObjectReference{ Name: "test-cluster", }, - AgentScheduled: "hostname-1", + ScheduledMember: "hostname-1", }, }, }, diff --git a/pkg/controllers/cluster/cluster_control.go b/pkg/controllers/cluster/cluster_control.go index 1f218f886..f943b037c 100644 --- a/pkg/controllers/cluster/cluster_control.go +++ b/pkg/controllers/cluster/cluster_control.go @@ -28,57 +28,57 @@ import ( ) type clusterUpdaterInterface interface { - UpdateClusterStatus(cluster *v1alpha1.MySQLCluster, status *v1alpha1.MySQLClusterStatus) error - UpdateClusterLabels(cluster *v1alpha1.MySQLCluster, lbls labels.Set) error + UpdateClusterStatus(cluster *v1alpha1.Cluster, status *v1alpha1.ClusterStatus) error + UpdateClusterLabels(cluster *v1alpha1.Cluster, lbls labels.Set) error } type clusterUpdater struct { client clientset.Interface - lister listersv1alpha1.MySQLClusterLister + lister listersv1alpha1.ClusterLister } -func newClusterUpdater(client clientset.Interface, lister listersv1alpha1.MySQLClusterLister) clusterUpdaterInterface { +func newClusterUpdater(client clientset.Interface, lister listersv1alpha1.ClusterLister) clusterUpdaterInterface { return &clusterUpdater{client: client, lister: lister} } -func (csu *clusterUpdater) UpdateClusterStatus(cluster *v1alpha1.MySQLCluster, status *v1alpha1.MySQLClusterStatus) error { +func (csu *clusterUpdater) UpdateClusterStatus(cluster *v1alpha1.Cluster, status *v1alpha1.ClusterStatus) error { return retry.RetryOnConflict(retry.DefaultRetry, func() error { cluster.Status = *status - _, updateErr := csu.client.MysqlV1alpha1().MySQLClusters(cluster.Namespace).Update(cluster) + _, updateErr := csu.client.MySQLV1alpha1().Clusters(cluster.Namespace).Update(cluster) if updateErr == nil { return nil } - updated, err := csu.lister.MySQLClusters(cluster.Namespace).Get(cluster.Name) + updated, err := csu.lister.Clusters(cluster.Namespace).Get(cluster.Name) if err != nil { - glog.Errorf("Error getting updated MySQLCluster %s/%s: %v", cluster.Namespace, cluster.Name, err) + glog.Errorf("Error getting updated Cluster %s/%s: %v", cluster.Namespace, cluster.Name, err) return err } - // Copy the MySQLCluster so we don't mutate the cache. + // Copy the Cluster so we don't mutate the cache. cluster = updated.DeepCopy() return updateErr }) } -func (csu *clusterUpdater) UpdateClusterLabels(cluster *v1alpha1.MySQLCluster, lbls labels.Set) error { +func (csu *clusterUpdater) UpdateClusterLabels(cluster *v1alpha1.Cluster, lbls labels.Set) error { return retry.RetryOnConflict(retry.DefaultRetry, func() error { cluster.Labels = labels.Merge(labels.Set(cluster.Labels), lbls) - _, updateErr := csu.client.MysqlV1alpha1().MySQLClusters(cluster.Namespace).Update(cluster) + _, updateErr := csu.client.MySQLV1alpha1().Clusters(cluster.Namespace).Update(cluster) if updateErr == nil { return nil } key := fmt.Sprintf("%s/%s", cluster.GetNamespace(), cluster.GetName()) - glog.V(4).Infof("Conflict updating MySQLCluster labels. Getting updated MySQLCluster %s from cache...", key) + glog.V(4).Infof("Conflict updating Cluster labels. Getting updated Cluster %s from cache...", key) - updated, err := csu.lister.MySQLClusters(cluster.GetNamespace()).Get(cluster.GetName()) + updated, err := csu.lister.Clusters(cluster.GetNamespace()).Get(cluster.GetName()) if err != nil { - glog.Errorf("Error getting updated MySQLCluster %s: %v", key, err) + glog.Errorf("Error getting updated Cluster %s: %v", key, err) return err } - // Copy the MySQLCluster so we don't mutate the cache. + // Copy the Cluster so we don't mutate the cache. cluster = updated.DeepCopy() return updateErr }) diff --git a/pkg/controllers/cluster/config_control.go b/pkg/controllers/cluster/config_control.go index c22c39fdd..02aa406e7 100644 --- a/pkg/controllers/cluster/config_control.go +++ b/pkg/controllers/cluster/config_control.go @@ -20,7 +20,7 @@ import ( ) // ConfigMapControlInterface defines the interface that the -// MySQLClusterController uses to create Configmaps. It is implemented as an +// ClusterController uses to create Configmaps. It is implemented as an // interface to enable testing. type ConfigMapControlInterface interface { CreateConfigMap(c *v1.ConfigMap) error diff --git a/pkg/controllers/cluster/controller.go b/pkg/controllers/cluster/controller.go index d0c3bb0aa..1e2427fc3 100644 --- a/pkg/controllers/cluster/controller.go +++ b/pkg/controllers/cluster/controller.go @@ -41,6 +41,7 @@ import ( "github.com/golang/glog" "github.com/pkg/errors" + clusterutil "github.com/oracle/mysql-operator/pkg/api/cluster" v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" constants "github.com/oracle/mysql-operator/pkg/constants" controllerutils "github.com/oracle/mysql-operator/pkg/controllers/util" @@ -64,16 +65,16 @@ const ( // synced. SuccessSynced = "Synced" // ErrResourceExists is used as part of the Event 'reason' when a - // MySQLCluster fails to sync due to a resource of the same name already + // Cluster fails to sync due to a resource of the same name already // existing. ErrResourceExists = "ErrResourceExists" // MessageResourceExists is the message used for Events when a resource // fails to sync due to a resource already existing. - MessageResourceExists = "%s %s/%s already exists and is not managed by MySQLCluster" + MessageResourceExists = "%s %s/%s already exists and is not managed by Cluster" // MessageResourceSynced is the message used for an Event fired when a - // MySQLCluster is synced successfully - MessageResourceSynced = "MySQLCluster synced successfully" + // Cluster is synced successfully + MessageResourceSynced = "Cluster synced successfully" ) // The MySQLController watches the Kubernetes API for changes to MySQL resources @@ -87,13 +88,13 @@ type MySQLController struct { shutdown bool queue workqueue.RateLimitingInterface - // clusterLister is able to list/get MySQLClusters from a shared informer's + // clusterLister is able to list/get Clusters from a shared informer's // store. - clusterLister listersv1alpha1.MySQLClusterLister - // clusterListerSynced returns true if the MySQLCluster shared informer has + clusterLister listersv1alpha1.ClusterLister + // clusterListerSynced returns true if the Cluster shared informer has // synced at least once. clusterListerSynced cache.InformerSynced - // clusterUpdater implements control logic for updating MySQLCluster + // clusterUpdater implements control logic for updating Cluster // statuses. Implemented as an interface to enable testing. clusterUpdater clusterUpdaterInterface @@ -104,7 +105,7 @@ type MySQLController struct { // has synced at least once. statefulSetListerSynced cache.InformerSynced // statefulSetControl enables control of StatefulSets associated with - // MySQLClusters. + // Clusters. statefulSetControl StatefulSetControlInterface // podLister is able to list/get Pods from a shared @@ -114,7 +115,7 @@ type MySQLController struct { // has synced at least once. podListerSynced cache.InformerSynced // podControl enables control of Pods associated with - // MySQLClusters. + // Clusters. podControl PodControlInterface // serviceLister is able to list/get Services from a shared informer's @@ -124,10 +125,10 @@ type MySQLController struct { // has synced at least once. serviceListerSynced cache.InformerSynced - // serviceControl enables control of Services associated with MySQLClusters. + // serviceControl enables control of Services associated with Clusters. serviceControl ServiceControlInterface - // secretControl enables control of Services associated with MySQLClusters. + // secretControl enables control of Services associated with Clusters. secretControl SecretControlInterface // recorder is an event recorder for recording Event resources to the @@ -140,7 +141,7 @@ func NewController( opConfig options.MySQLOperatorServer, opClient clientset.Interface, kubeClient kubernetes.Interface, - clusterInformer informersv1alpha1.MySQLClusterInformer, + clusterInformer informersv1alpha1.ClusterInformer, statefulSetInformer appsinformers.StatefulSetInformer, podInformer coreinformers.PodInformer, serviceInformer coreinformers.ServiceInformer, @@ -190,7 +191,7 @@ func NewController( m.enqueueCluster(new) }, DeleteFunc: func(obj interface{}) { - cluster, ok := obj.(*v1alpha1.MySQLCluster) + cluster, ok := obj.(*v1alpha1.Cluster) if ok { m.onClusterDeleted(cluster.Name) } @@ -208,7 +209,7 @@ func NewController( // If cluster is ready ... if newStatefulSet.Status.ReadyReplicas == newStatefulSet.Status.Replicas { - clusterName, ok := newStatefulSet.Labels[constants.MySQLClusterLabel] + clusterName, ok := newStatefulSet.Labels[constants.ClusterLabel] if ok { m.onClusterReady(clusterName) } @@ -229,10 +230,10 @@ func (m *MySQLController) Run(ctx context.Context, threadiness int) { defer utilruntime.HandleCrash() defer m.queue.ShutDown() - glog.Info("Starting MySQLCluster controller") + glog.Info("Starting Cluster controller") // Wait for the caches to be synced before starting workers - glog.Info("Waiting for MySQLCluster controller informer caches to sync") + glog.Info("Waiting for Cluster controller informer caches to sync") if !controllerutils.WaitForCacheSync("mysql cluster", ctx.Done(), m.clusterListerSynced, m.statefulSetListerSynced, @@ -241,14 +242,14 @@ func (m *MySQLController) Run(ctx context.Context, threadiness int) { return } - glog.Info("Starting MySQLCluster controller workers") + glog.Info("Starting Cluster controller workers") // Launch two workers to process Foo resources for i := 0; i < threadiness; i++ { go wait.Until(m.runWorker, time.Second, ctx.Done()) } - glog.Info("Started MySQLCluster controller workers") - defer glog.Info("Shutting down MySQLCluster controller workers") + glog.Info("Started Cluster controller workers") + defer glog.Info("Shutting down Cluster controller workers") <-ctx.Done() } @@ -293,7 +294,7 @@ func (m *MySQLController) processNextWorkItem() bool { } // syncHandler compares the actual state with the desired, and attempts to -// converge the two. It then updates the Status block of the MySQLCluster +// converge the two. It then updates the Status block of the Cluster // resource with the current status of the resource. func (m *MySQLController) syncHandler(key string) error { // Convert the namespace/name string into a distinct namespace and name. @@ -305,10 +306,10 @@ func (m *MySQLController) syncHandler(key string) error { nsName := types.NamespacedName{Namespace: namespace, Name: name} - // Get the MySQLCluster resource with this namespace/name. - cluster, err := m.clusterLister.MySQLClusters(namespace).Get(name) + // Get the Cluster resource with this namespace/name. + cluster, err := m.clusterLister.Clusters(namespace).Get(name) if err != nil { - // The MySQLCluster resource may no longer exist, in which case we stop processing. + // The Cluster resource may no longer exist, in which case we stop processing. if apierrors.IsNotFound(err) { utilruntime.HandleError(fmt.Errorf("mysqlcluster '%s' in work queue no longer exists", key)) return nil @@ -318,7 +319,7 @@ func (m *MySQLController) syncHandler(key string) error { cluster.EnsureDefaults() if err = cluster.Validate(); err != nil { - return errors.Wrap(err, "validating MySQLCluster") + return errors.Wrap(err, "validating Cluster") } operatorVersion := buildversion.GetBuildVersion() @@ -329,7 +330,7 @@ func (m *MySQLController) syncHandler(key string) error { if cluster.Labels == nil { cluster.Labels = make(map[string]string) } - cluster.Labels[constants.MySQLClusterLabel] = cluster.Name + cluster.Labels[constants.ClusterLabel] = cluster.Name cluster.Labels[constants.MySQLOperatorVersionLabel] = buildversion.GetBuildVersion() return m.clusterUpdater.UpdateClusterLabels(cluster.DeepCopy(), labels.Set(cluster.Labels)) } @@ -357,7 +358,7 @@ func (m *MySQLController) syncHandler(key string) error { return err } - // If the Service is not controlled by this MySQLCluster resource, we should + // If the Service is not controlled by this Cluster resource, we should // log a warning to the event recorder and return. if !metav1.IsControlledBy(svc, cluster) { msg := fmt.Sprintf(MessageResourceExists, "Service", svc.Namespace, svc.Name) @@ -380,7 +381,7 @@ func (m *MySQLController) syncHandler(key string) error { return err } - // If the StatefulSet is not controlled by this MySQLCluster resource, we + // If the StatefulSet is not controlled by this Cluster resource, we // should log a warning to the event recorder and return. if !metav1.IsControlledBy(ss, cluster) { msg := fmt.Sprintf(MessageResourceExists, "StatefulSet", ss.Namespace, ss.Name) @@ -394,12 +395,12 @@ func (m *MySQLController) syncHandler(key string) error { return err } - // If this number of the replicas on the MySQLCluster does not equal the + // If this number of the members on the Cluster does not equal the // current desired replicas on the StatefulSet, we should update the // StatefulSet resource. - if cluster.Spec.Replicas != *ss.Spec.Replicas { - glog.V(4).Infof("Updating %q: clusterReplicas=%d statefulSetReplicas=%d", - nsName, cluster.Spec.Replicas, ss.Spec.Replicas) + if cluster.Spec.Members != *ss.Spec.Replicas { + glog.V(4).Infof("Updating %q: clusterMembers=%d statefulSetReplicas=%d", + nsName, cluster.Spec.Members, ss.Spec.Replicas) old := ss.DeepCopy() ss = statefulsets.NewForCluster(cluster, m.opConfig.Images, svc.Name) if err := m.statefulSetControl.Patch(old, ss); err != nil { @@ -409,7 +410,7 @@ func (m *MySQLController) syncHandler(key string) error { } } - // Finally, we update the status block of the MySQLCluster resource to + // Finally, we update the status block of the Cluster resource to // reflect the current state of the world. err = m.updateClusterStatus(cluster, ss) if err != nil { @@ -421,8 +422,8 @@ func (m *MySQLController) syncHandler(key string) error { } // ensureMySQLOperatorVersion updates the MySQLOperator resource types that require it to make it consistent with the specifed operator version. -func (m *MySQLController) ensureMySQLOperatorVersion(c *v1alpha1.MySQLCluster, ss *apps.StatefulSet, operatorVersion string) error { - // Ensure the Pods belonging to the MySQLCluster are updated to the correct 'mysql-agent' image for the current MySQLOperator version. +func (m *MySQLController) ensureMySQLOperatorVersion(c *v1alpha1.Cluster, ss *apps.StatefulSet, operatorVersion string) error { + // Ensure the Pods belonging to the Cluster are updated to the correct 'mysql-agent' image for the current MySQLOperator version. container := statefulsets.MySQLAgentName pods, err := m.podLister.List(SelectorForCluster(c)) for _, pod := range pods { @@ -446,46 +447,44 @@ func (m *MySQLController) ensureMySQLOperatorVersion(c *v1alpha1.MySQLCluster, s } } - // Ensure the MySQLCluster is updated with the correct MySQLOperator version. + // Ensure the Cluster is updated with the correct MySQLOperator version. if !SelectorForClusterOperatorVersion(operatorVersion).Matches(labels.Set(c.Labels)) { glog.Infof("Upgrading cluster statefulset '%s/%s' to latest operator version: %s", c.Namespace, c.Name, operatorVersion) copy := c.DeepCopy() copy.Labels[constants.MySQLOperatorVersionLabel] = operatorVersion err := m.clusterUpdater.UpdateClusterLabels(copy, labels.Set(copy.Labels)) if err != nil { - return errors.Wrap(err, "upgrade operator version: MySQLClusterUpdate failed") + return errors.Wrap(err, "upgrade operator version: ClusterUpdate failed") } } return nil } -// updateClusterStatusForSS updates MySQLCluster statuses based on changes to their associated StatefulSets. -func (m *MySQLController) updateClusterStatus(cluster *v1alpha1.MySQLCluster, ss *apps.StatefulSet) error { +// updateClusterStatusForSS updates Cluster statuses based on changes to their associated StatefulSets. +func (m *MySQLController) updateClusterStatus(cluster *v1alpha1.Cluster, ss *apps.StatefulSet) error { glog.V(4).Infof("%s/%s: ss.Spec.Replicas=%d, ss.Status.ReadyReplicas=%d, ss.Status.Replicas=%d", cluster.Namespace, cluster.Name, *ss.Spec.Replicas, ss.Status.ReadyReplicas, ss.Status.Replicas) - phase := cluster.Status.Phase - - if (ss.Status.ReadyReplicas < ss.Status.Replicas) || (*ss.Spec.Replicas != ss.Status.Replicas) { - phase = v1alpha1.MySQLClusterPending - } else if ss.Status.ReadyReplicas == ss.Status.Replicas { - phase = v1alpha1.MySQLClusterRunning + status := cluster.Status.DeepCopy() + _, condition := clusterutil.GetClusterCondition(&cluster.Status, v1alpha1.ClusterReady) + if condition == nil { + condition = &v1alpha1.ClusterCondition{Type: v1alpha1.ClusterReady} } - - if phase != cluster.Status.Phase { - status := cluster.Status.DeepCopy() - status.Phase = phase - if err := m.clusterUpdater.UpdateClusterStatus(cluster.DeepCopy(), status); err != nil { - return fmt.Errorf("failed to update cluster status: %v", err) - } + if ss.Status.ReadyReplicas == ss.Status.Replicas { + condition.Status = corev1.ConditionTrue + } else { + condition.Status = corev1.ConditionFalse } + if updated := clusterutil.UpdateClusterCondition(status, condition); updated { + return m.clusterUpdater.UpdateClusterStatus(cluster.DeepCopy(), status) + } return nil } -// enqueueCluster takes a MySQLCluster resource and converts it into a +// enqueueCluster takes a Cluster resource and converts it into a // namespace/name string which is then put onto the work queue. This method -// should *not* be passed resources of any type other than MySQLCluster. +// should *not* be passed resources of any type other than Cluster. func (m *MySQLController) enqueueCluster(obj interface{}) { key, err := cache.MetaNamespaceKeyFunc(obj) if err != nil { @@ -518,15 +517,15 @@ func (m *MySQLController) handleObject(obj interface{}) { glog.V(4).Infof("Processing object: %s", object.GetName()) if ownerRef := metav1.GetControllerOf(object); ownerRef != nil { - // If this object is not owned by a MySQLCluster, we should not do + // If this object is not owned by a Cluster, we should not do // anything more with it. - if ownerRef.Kind != v1alpha1.MySQLClusterCRDResourceKind { + if ownerRef.Kind != v1alpha1.ClusterCRDResourceKind { return } - cluster, err := m.clusterLister.MySQLClusters(object.GetNamespace()).Get(ownerRef.Name) + cluster, err := m.clusterLister.Clusters(object.GetNamespace()).Get(ownerRef.Name) if err != nil { - glog.V(4).Infof("ignoring orphaned object '%s' of MySQLCluster '%s'", object.GetSelfLink(), ownerRef.Name) + glog.V(4).Infof("ignoring orphaned object '%s' of Cluster '%s'", object.GetSelfLink(), ownerRef.Name) return } diff --git a/pkg/controllers/cluster/controller_test.go b/pkg/controllers/cluster/controller_test.go index 5a4ae7e3c..5581c76ae 100644 --- a/pkg/controllers/cluster/controller_test.go +++ b/pkg/controllers/cluster/controller_test.go @@ -50,7 +50,11 @@ func mockOperatorConfig() options.MySQLOperatorServer { func TestMessageResourceExistsFormatString(t *testing.T) { ss := statefulsets.NewForCluster( - &v1alpha1.MySQLCluster{ + &v1alpha1.Cluster{ + TypeMeta: metav1.TypeMeta{ + Kind: "Cluster", + APIVersion: "mysql.oracle.com/v1alpha1", + }, ObjectMeta: metav1.ObjectMeta{ Name: "test-cluster", Namespace: "default", @@ -59,7 +63,7 @@ func TestMessageResourceExistsFormatString(t *testing.T) { mockOperatorConfig().Images, "test-cluster", ) - expected := "StatefulSet default/test-cluster already exists and is not managed by MySQLCluster" + expected := "StatefulSet default/test-cluster already exists and is not managed by Cluster" msg := fmt.Sprintf(MessageResourceExists, "StatefulSet", ss.Namespace, ss.Name) if msg != expected { t.Errorf("Got %q, expected %q", msg, expected) @@ -67,7 +71,7 @@ func TestMessageResourceExistsFormatString(t *testing.T) { } func TestSyncBadNameSpaceKeyError(t *testing.T) { - cluster := mockMySQLCluster(buildversion.GetBuildVersion(), "test-cluster", "test-namespace", int32(3)) + cluster := mockCluster(buildversion.GetBuildVersion(), "test-cluster", "test-namespace", int32(3)) fakeController, _ := newFakeMySQLController(cluster) key := "a/bad/namespace/key" @@ -79,7 +83,7 @@ func TestSyncBadNameSpaceKeyError(t *testing.T) { // TODO: mysqlcluster 'test-namespace/test-cluster' in work queue no longer exists func TestSyncClusterNoLongerExistsError(t *testing.T) { - cluster := mockMySQLCluster(buildversion.GetBuildVersion(), "test-cluster", "test-namespace", int32(3)) + cluster := mockCluster(buildversion.GetBuildVersion(), "test-cluster", "test-namespace", int32(3)) fakeController, fakeInformers := newFakeMySQLController(cluster) fakeInformers.clusterInformer.Informer().GetStore().Delete(cluster) key, _ := cache.MetaNamespaceKeyFunc(cluster) @@ -90,8 +94,7 @@ func TestSyncClusterNoLongerExistsError(t *testing.T) { } func TestSyncClusterValidateError(t *testing.T) { - cluster := mockMySQLCluster(buildversion.GetBuildVersion(), "test-cluster", "test-namespace", int32(3)) - cluster.Status.Phase = "Bad_Phase" + cluster := mockCluster(buildversion.GetBuildVersion(), "test-cluster-with-a-name-greater-than-twenty-eight-chars-long", "test-namespace", int32(3)) fakeController, fakeInformers := newFakeMySQLController(cluster) fakeInformers.clusterInformer.Informer().GetStore().Add(cluster) key, _ := cache.MetaNamespaceKeyFunc(cluster) @@ -99,7 +102,7 @@ func TestSyncClusterValidateError(t *testing.T) { if err == nil { t.Errorf("SyncHandler should return an error when the cluster resource is invalid.") } - if err.Error() != `validating MySQLCluster: status.phase: Invalid value: "Bad_Phase": invalid phase specified` { + if err.Error() != "validating Cluster: metadata.name: Invalid value: \"test-cluster-with-a-name-greater-than-twenty-eight-chars-long\": longer than maximum supported length 28 (see: https://bugs.mysql.com/bug.php?id=90601)" { t.Errorf("SyncHandler should return the correct error when the cluster resource is invalid: %q", err) } } @@ -108,8 +111,8 @@ func TestSyncEnsureClusterLabels(t *testing.T) { version := buildversion.GetBuildVersion() name := "test-cluster" namespace := "test-namespace" - replicas := int32(3) - cluster := mockMySQLCluster(version, name, namespace, replicas) + members := int32(3) + cluster := mockCluster(version, name, namespace, members) cluster.Labels = nil fakeController, fakeInformers := newFakeMySQLController(cluster) @@ -117,24 +120,24 @@ func TestSyncEnsureClusterLabels(t *testing.T) { key, _ := cache.MetaNamespaceKeyFunc(cluster) err := fakeController.syncHandler(key) if err != nil { - t.Fatalf("Unexpected MySQLCluster syncHandler error: %+v", err) + t.Fatalf("Unexpected Cluster syncHandler error: %+v", err) } assertOperatorClusterInvariants(t, fakeController, namespace, name, version) } func assertOperatorClusterInvariants(t *testing.T, controller *MySQLController, namespace string, name string, version string) { - cluster, err := controller.opClient.MysqlV1alpha1().MySQLClusters(namespace).Get(name, metav1.GetOptions{}) + cluster, err := controller.opClient.MySQLV1alpha1().Clusters(namespace).Get(name, metav1.GetOptions{}) if err != nil { - t.Fatalf("Get client MySQLCluster err: %+v", err) + t.Fatalf("Get client Cluster err: %+v", err) } - clName := cluster.Labels[constants.MySQLClusterLabel] + clName := cluster.Labels[constants.ClusterLabel] if clName != name { - t.Errorf("Expected MySQLCluster to have name label '%s', got '%s'.", version, clName) + t.Errorf("Expected Cluster to have name label '%s', got '%s'.", version, clName) } clVersion := cluster.Labels[constants.MySQLOperatorVersionLabel] if clVersion != version { - t.Errorf("Expected MySQLCluster to have version label '%s', got '%s'.", version, clVersion) + t.Errorf("Expected Cluster to have version label '%s', got '%s'.", version, clVersion) } } @@ -142,37 +145,37 @@ func TestSyncEnsureSecret(t *testing.T) { version := buildversion.GetBuildVersion() name := "test-cluster" namespace := "test-namespace" - replicas := int32(3) - cluster := mockMySQLCluster(version, name, namespace, replicas) + members := int32(3) + cluster := mockCluster(version, name, namespace, members) fakeController, fakeInformers := newFakeMySQLController(cluster) fakeInformers.clusterInformer.Informer().GetStore().Add(cluster) key, _ := cache.MetaNamespaceKeyFunc(cluster) err := fakeController.syncHandler(key) if err != nil { - t.Fatalf("Unexpected MySQLCluster syncHandler error: %+v", err) + t.Fatalf("Unexpected Cluster syncHandler error: %+v", err) } assertOperatorSecretInvariants(t, fakeController, cluster) } -func assertOperatorSecretInvariants(t *testing.T, controller *MySQLController, cluster *v1alpha1.MySQLCluster) { +func assertOperatorSecretInvariants(t *testing.T, controller *MySQLController, cluster *v1alpha1.Cluster) { secretName := secrets.GetRootPasswordSecretName(cluster) secret, err := controller.kubeClient.CoreV1().Secrets(cluster.Namespace).Get(secretName, metav1.GetOptions{}) if err != nil { - t.Fatalf("Get client MySQLCluster secret error: %+v", err) + t.Fatalf("Get client Cluster secret error: %+v", err) } if secret == nil { - t.Fatalf("Expected MySQLCluster to have an associated secret.") + t.Fatalf("Expected Cluster to have an associated secret.") } if secret.Namespace != cluster.Namespace { - t.Errorf("Expected MySQLCluster secret to have namespace '%s', got '%s'.", secret.Namespace, cluster.Namespace) + t.Errorf("Expected Cluster secret to have namespace '%s', got '%s'.", secret.Namespace, cluster.Namespace) } if secret.Name != secretName { - t.Errorf("Expected MySQLCluster secret to have name '%s', got '%s'.", secret.Name, secretName) + t.Errorf("Expected Cluster secret to have name '%s', got '%s'.", secret.Name, secretName) } if secret.Data["password"] == nil { - t.Fatalf("Expected MySQLCluster secret to have an associated password.") + t.Fatalf("Expected Cluster secret to have an associated password.") } } @@ -180,40 +183,40 @@ func TestSyncEnsureService(t *testing.T) { version := buildversion.GetBuildVersion() name := "test-cluster" namespace := "test-namespace" - replicas := int32(3) - cluster := mockMySQLCluster(version, name, namespace, replicas) + members := int32(3) + cluster := mockCluster(version, name, namespace, members) fakeController, fakeInformers := newFakeMySQLController(cluster) fakeInformers.clusterInformer.Informer().GetStore().Add(cluster) key, _ := cache.MetaNamespaceKeyFunc(cluster) err := fakeController.syncHandler(key) if err != nil { - t.Fatalf("Unexpected MySQLCluster syncHandler error: %+v", err) + t.Fatalf("Unexpected Cluster syncHandler error: %+v", err) } assertOperatorServiceInvariants(t, fakeController, cluster) } -func assertOperatorServiceInvariants(t *testing.T, controller *MySQLController, cluster *v1alpha1.MySQLCluster) { +func assertOperatorServiceInvariants(t *testing.T, controller *MySQLController, cluster *v1alpha1.Cluster) { kubeClient := controller.kubeClient service, err := kubeClient.CoreV1().Services(cluster.Namespace).Get(cluster.Name, metav1.GetOptions{}) if err != nil { - t.Fatalf("Get client MySQLCluster service error: %+v", err) + t.Fatalf("Get client Cluster service error: %+v", err) } if service == nil { - t.Fatalf("Expected MySQLCluster to have an associated service.") + t.Fatalf("Expected Cluster to have an associated service.") } if service.Namespace != cluster.Namespace { - t.Errorf("Expected MySQLCluster service to have namespace '%s', got '%s'.", service.Namespace, cluster.Namespace) + t.Errorf("Expected Cluster service to have namespace '%s', got '%s'.", service.Namespace, cluster.Namespace) } if service.Name != cluster.Name { - t.Errorf("Expected MySQLCluster service to have name '%s', got '%s'.", service.Name, cluster.Name) + t.Errorf("Expected Cluster service to have name '%s', got '%s'.", service.Name, cluster.Name) } if service.OwnerReferences == nil { - t.Fatalf("Expected MySQLCluster service to have an associated owner reference to the parent MySQLCluster.") + t.Fatalf("Expected Cluster service to have an associated owner reference to the parent Cluster.") } else { if !hasOwnerReference(service.OwnerReferences, cluster) { - t.Errorf("Expected MySQLCluster service to have an associated owner reference to the parent MySQLCluster.") + t.Errorf("Expected Cluster service to have an associated owner reference to the parent Cluster.") } } } @@ -222,53 +225,53 @@ func TestSyncEnsureStatefulSet(t *testing.T) { version := buildversion.GetBuildVersion() name := "test-cluster" namespace := "test-namespace" - replicas := int32(3) - cluster := mockMySQLCluster(version, name, namespace, replicas) + members := int32(3) + cluster := mockCluster(version, name, namespace, members) fakeController, fakeInformers := newFakeMySQLController(cluster) fakeInformers.clusterInformer.Informer().GetStore().Add(cluster) key, _ := cache.MetaNamespaceKeyFunc(cluster) err := fakeController.syncHandler(key) if err != nil { - t.Fatalf("Unexpected MySQLCluster syncHandler error: %+v", err) + t.Fatalf("Unexpected Cluster syncHandler error: %+v", err) } assertOperatorStatefulSetInvariants(t, fakeController, cluster) } -func assertOperatorStatefulSetInvariants(t *testing.T, controller *MySQLController, cluster *v1alpha1.MySQLCluster) { +func assertOperatorStatefulSetInvariants(t *testing.T, controller *MySQLController, cluster *v1alpha1.Cluster) { kubeClient := controller.kubeClient statefulset, err := kubeClient.AppsV1beta1().StatefulSets(cluster.Namespace).Get(cluster.Name, metav1.GetOptions{}) if err != nil { - t.Fatalf("Get client MySQLCluster statefulset error: %+v", err) + t.Fatalf("Get client Cluster statefulset error: %+v", err) } if statefulset == nil { - t.Fatalf("Expected MySQLCluster to have an associated statefulset.") + t.Fatalf("Expected Cluster to have an associated statefulset.") } if statefulset.Namespace != cluster.Namespace { - t.Errorf("Expected MySQLCluster statefulset to have namespace '%s', got '%s'.", statefulset.Namespace, cluster.Namespace) + t.Errorf("Expected Cluster statefulset to have namespace '%s', got '%s'.", statefulset.Namespace, cluster.Namespace) } if statefulset.Name != cluster.Name { - t.Errorf("Expected MySQLCluster statefulset to have name '%s', got '%s'.", statefulset.Name, cluster.Name) + t.Errorf("Expected Cluster statefulset to have name '%s', got '%s'.", statefulset.Name, cluster.Name) } if statefulset.OwnerReferences == nil { - t.Fatalf("Expected MySQLCluster statefulset to have an associated owner reference to the parent MySQLCluster.") + t.Fatalf("Expected Cluster statefulset to have an associated owner reference to the parent Cluster.") } else { if !hasOwnerReference(statefulset.OwnerReferences, cluster) { - t.Errorf("Expected MySQLCluster statefulset to have an associated owner reference to the parent MySQLCluster.") + t.Errorf("Expected Cluster statefulset to have an associated owner reference to the parent Cluster.") } } - if *statefulset.Spec.Replicas != cluster.Spec.Replicas { - t.Errorf("Expected MySQLCluster statefulset to have Replicas '%d', got '%d'.", cluster.Spec.Replicas, *statefulset.Spec.Replicas) + if *statefulset.Spec.Replicas != cluster.Spec.Members { + t.Errorf("Expected Cluster statefulset to have Replicas '%d', got '%d'.", cluster.Spec.Members, *statefulset.Spec.Replicas) } if statefulset.Spec.Template.Spec.Containers == nil || len(statefulset.Spec.Template.Spec.Containers) != 2 { - t.Fatalf("Expected MySQLCluster to have an associated statefulset with two pod templates.") + t.Fatalf("Expected Cluster to have an associated statefulset with two pod templates.") } if !hasContainer(statefulset.Spec.Template.Spec.Containers, "mysql") { - t.Errorf("Expected MySQLCluster statefulset to have template container 'mysql'.") + t.Errorf("Expected Cluster statefulset to have template container 'mysql'.") } if !hasContainer(statefulset.Spec.Template.Spec.Containers, "mysql-agent") { - t.Errorf("Expected MySQLCluster statefulset to have template container 'mysql-agent'.") + t.Errorf("Expected Cluster statefulset to have template container 'mysql-agent'.") } } @@ -277,8 +280,8 @@ func TestEnsureMySQLOperatorVersionWhenNotRequired(t *testing.T) { originalOperatorVersion := "test-12345" name := "test-ensure-operator-version" namespace := "test-namespace" - replicas := int32(3) - cluster := mockMySQLCluster(originalOperatorVersion, name, namespace, replicas) + members := int32(3) + cluster := mockCluster(originalOperatorVersion, name, namespace, members) statefulSet := mockClusterStatefulSet(cluster) pods := mockClusterPods(statefulSet) @@ -306,8 +309,8 @@ func TestEnsureMySQLOperatorVersionWhenRequired(t *testing.T) { updatedOperatorVersion := "test-67890" name := "test-ensure-operator-version" namespace := "test-namespace" - replicas := int32(3) - cluster := mockMySQLCluster(originalOperatorVersion, name, namespace, replicas) + members := int32(3) + cluster := mockCluster(originalOperatorVersion, name, namespace, members) statefulSet := mockClusterStatefulSet(cluster) pods := mockClusterPods(statefulSet) @@ -333,14 +336,14 @@ func TestEnsureMySQLOperatorVersionWhenRequired(t *testing.T) { func assertOperatorVersionInvariants(t *testing.T, controller *MySQLController, namespace string, name string, version string) { expectedImageVersion := mockOperatorConfig().Images.MySQLAgentImage + ":" + version - // Check MySQLCluster has the correct operator version - updatedCluster, err := controller.opClient.MysqlV1alpha1().MySQLClusters(namespace).Get(name, metav1.GetOptions{}) + // Check Cluster has the correct operator version + updatedCluster, err := controller.opClient.MySQLV1alpha1().Clusters(namespace).Get(name, metav1.GetOptions{}) if err != nil { - t.Fatalf("Get client MySQLCluster err: %+v", err) + t.Fatalf("Get client Cluster err: %+v", err) } if !SelectorForClusterOperatorVersion(version).Matches(labels.Set(updatedCluster.Labels)) { clVersion := updatedCluster.Labels[constants.MySQLOperatorVersionLabel] - t.Errorf("Expected MySQLCluster to have version label '%s', got '%s'.", version, clVersion) + t.Errorf("Expected Cluster to have version label '%s', got '%s'.", version, clVersion) } // Check StatefulSets has the correct operator version. @@ -390,8 +393,8 @@ func TestMySQLControllerSyncClusterFromScratch(t *testing.T) { version := buildversion.GetBuildVersion() name := "from-scratch" namespace := "test-namespace" - replicas := int32(3) - cluster := mockMySQLCluster(version, name, namespace, replicas) + members := int32(3) + cluster := mockCluster(version, name, namespace, members) // create mock mysqloperator controller and prepoulate infromer fakeController, fakeInformers := newFakeMySQLController(cluster) @@ -405,13 +408,13 @@ func TestMySQLControllerSyncClusterFromScratch(t *testing.T) { assertOperatorServiceInvariants(t, fakeController, cluster) assertOperatorStatefulSetInvariants(t, fakeController, cluster) assertOperatorVersionInvariants(t, fakeController, namespace, name, version) - cluster, err := fakeController.opClient.MysqlV1alpha1().MySQLClusters(namespace).Get(name, metav1.GetOptions{}) + cluster, err := fakeController.opClient.MySQLV1alpha1().Clusters(namespace).Get(name, metav1.GetOptions{}) if err != nil { - t.Fatalf("Get client MySQLCluster err: %+v", err) + t.Fatalf("Get client Cluster err: %+v", err) } } -func hasOwnerReference(ownerReferences []metav1.OwnerReference, cluster *v1alpha1.MySQLCluster) bool { +func hasOwnerReference(ownerReferences []metav1.OwnerReference, cluster *v1alpha1.Cluster) bool { for _, or := range ownerReferences { if or.APIVersion == cluster.APIVersion && or.Kind == cluster.Kind && or.Name == cluster.Name { return true @@ -429,33 +432,33 @@ func hasContainer(containers []v1.Container, name string) bool { return false } -func mockMySQLCluster(operatorVersion string, name string, namespace string, replicas int32) *v1alpha1.MySQLCluster { - cluster := &v1alpha1.MySQLCluster{ +func mockCluster(operatorVersion string, name string, namespace string, members int32) *v1alpha1.Cluster { + cluster := &v1alpha1.Cluster{ TypeMeta: metav1.TypeMeta{ - Kind: "MySQLCluster", + Kind: "Cluster", APIVersion: "mysql.oracle.com/v1alpha1", }, ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: namespace, - Labels: map[string]string{constants.MySQLClusterLabel: name, constants.MySQLOperatorVersionLabel: operatorVersion}, + Labels: map[string]string{constants.ClusterLabel: name, constants.MySQLOperatorVersionLabel: operatorVersion}, }, - Spec: v1alpha1.MySQLClusterSpec{ - Replicas: replicas, + Spec: v1alpha1.ClusterSpec{ + Members: members, }, } cluster.EnsureDefaults() return cluster } -func mockClusterStatefulSet(cluster *v1alpha1.MySQLCluster) *apps.StatefulSet { +func mockClusterStatefulSet(cluster *v1alpha1.Cluster) *apps.StatefulSet { return statefulsets.NewForCluster(cluster, mockOperatorConfig().Images, cluster.Name) } func mockClusterPods(ss *apps.StatefulSet) []*v1.Pod { pods := []*v1.Pod{} - replicas := int(*ss.Spec.Replicas) - for i := 0; i < replicas; i++ { + members := int(*ss.Spec.Replicas) + for i := 0; i < members; i++ { pod := mockClusterPod(ss, i) pods = append(pods, pod) } @@ -475,7 +478,7 @@ func mockClusterPod(ss *apps.StatefulSet, ordinal int) *v1.Pod { ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%s-%d", ss.Name, ordinal), Namespace: ss.Namespace, - Labels: map[string]string{constants.MySQLClusterLabel: clusterName, constants.MySQLOperatorVersionLabel: operatorVersion}, + Labels: map[string]string{constants.ClusterLabel: clusterName, constants.MySQLOperatorVersionLabel: operatorVersion}, }, Spec: v1.PodSpec{ Containers: []v1.Container{ @@ -486,14 +489,14 @@ func mockClusterPod(ss *apps.StatefulSet, ordinal int) *v1.Pod { return pod } -// mock MySQLCluster controller ********** +// mock Cluster controller ********** func alwaysReady() bool { return true } // fakeMySQLControllerInformers contain references to the set of underlying informers associated // with a newFakeMySQLController. type fakeMySQLControllerInformers struct { - clusterInformer informersv1alpha1.MySQLClusterInformer + clusterInformer informersv1alpha1.ClusterInformer statefulSetInformer appsinformers.StatefulSetInformer podInformer coreinformers.PodInformer serviceInformer coreinformers.ServiceInformer @@ -501,15 +504,22 @@ type fakeMySQLControllerInformers struct { // newFakeMySQLController creates a new fake MySQLController with a fake mysqlop and kube clients and informers // for unit testing. -func newFakeMySQLController(cluster *v1alpha1.MySQLCluster, kuberesources ...runtime.Object) (*MySQLController, *fakeMySQLControllerInformers) { - mysqlopClient := mysqlfake.NewSimpleClientset(cluster) +func newFakeMySQLController(cluster *v1alpha1.Cluster, kuberesources ...runtime.Object) (*MySQLController, *fakeMySQLControllerInformers) { + mysqlopClient := mysqlfake.NewSimpleClientset() + // NOTE: Must call Create rather than pass objects to NewSimpleClientset() as the + // fake client's UnsafeGuessKindToResource maps the kind to clusters rather than + // mysqlclusters. + _, err := mysqlopClient.MySQLV1alpha1().Clusters(cluster.Namespace).Create(cluster) + if err != nil { + panic(err) + } kubeClient := fake.NewSimpleClientset(kuberesources...) kubeInformerFactory := informers.NewSharedInformerFactory(kubeClient, util.NoResyncPeriodFunc()) mysqlopInformerFactory := informerfactory.NewSharedInformerFactory(mysqlopClient, util.NoResyncPeriodFunc()) fakeInformers := &fakeMySQLControllerInformers{ - clusterInformer: mysqlopInformerFactory.Mysql().V1alpha1().MySQLClusters(), + clusterInformer: mysqlopInformerFactory.MySQL().V1alpha1().Clusters(), statefulSetInformer: kubeInformerFactory.Apps().V1beta1().StatefulSets(), podInformer: kubeInformerFactory.Core().V1().Pods(), serviceInformer: kubeInformerFactory.Core().V1().Services(), diff --git a/pkg/controllers/cluster/labeler/cluster_labeler.go b/pkg/controllers/cluster/labeler/cluster_labeler.go index 716cc260e..377927145 100644 --- a/pkg/controllers/cluster/labeler/cluster_labeler.go +++ b/pkg/controllers/cluster/labeler/cluster_labeler.go @@ -42,7 +42,7 @@ import ( const controllerAgentName = "innodb-cluster-labeler" // ClusterLabelerController adds annotations about the InnoDB cluster state -// to the MySQLCluster's Pods. This controller should only be run iff the the +// to the Cluster's Pods. This controller should only be run iff the the // local MySQL instance believes that it is the primary of the MySQL cluster. type ClusterLabelerController struct { // localInstance represents the local MySQL instance. @@ -88,14 +88,14 @@ func NewClusterLabelerController( func (clc *ClusterLabelerController) updateClusterRoleLabel(pod *corev1.Pod, val string) error { new := pod.DeepCopy() if val == "" { - delete(new.Labels, constants.LabelMySQLClusterRole) + delete(new.Labels, constants.LabelClusterRole) } else { - new.Labels[constants.LabelMySQLClusterRole] = val + new.Labels[constants.LabelClusterRole] = val } return clc.podControl.PatchPod(pod, new) } -// syncHandler labels the Pods in a MySQLCluster as being either a primary or +// syncHandler labels the Pods in a Cluster as being either a primary or // secondary based on the given innodb.ClusterStatus. func (clc *ClusterLabelerController) syncHandler(key string) error { obj, exists, err := clc.store.GetByKey(key) @@ -129,11 +129,11 @@ func (clc *ClusterLabelerController) syncHandler(key string) error { var role string if !inCluster(status, pod.Name, clc.localInstance.Port) { glog.Infof("Removing %q label from previously labeled primary %s/%s", - constants.LabelMySQLClusterRole, pod.Namespace, pod.Name) + constants.LabelClusterRole, pod.Namespace, pod.Name) role = "" } else { glog.Infof("Labeling previously labeled primary %s/%s as secondary", pod.Namespace, pod.Name) - role = constants.MySQLClusterRoleSecondary + role = constants.ClusterRoleSecondary } if err := clc.updateClusterRoleLabel(pod, role); err != nil { @@ -150,7 +150,7 @@ func (clc *ClusterLabelerController) syncHandler(key string) error { } glog.Infof("Labeling %s/%s as primary", primary.Namespace, primary.Name) - if err := clc.updateClusterRoleLabel(primary, constants.MySQLClusterRolePrimary); err != nil { + if err := clc.updateClusterRoleLabel(primary, constants.ClusterRolePrimary); err != nil { return errors.Wrapf(err, "labeling %s/%s as primary", primary.Namespace, primary.Name) } } @@ -166,16 +166,16 @@ func (clc *ClusterLabelerController) syncHandler(key string) error { if !inCluster(status, pod.Name, clc.localInstance.Port) { if HasRoleSelector(clusterName).Matches(labels.Set(pod.Labels)) { glog.Infof("Removing %q label from %s/%s as it's no longer in an ONLINE state", - constants.LabelMySQLClusterRole, pod.Namespace, pod.Name) + constants.LabelClusterRole, pod.Namespace, pod.Name) if err := clc.updateClusterRoleLabel(pod, ""); err != nil { - return errors.Wrapf(err, "removing %q label from %s/%s", constants.LabelMySQLClusterRole, pod.Namespace, pod.Name) + return errors.Wrapf(err, "removing %q label from %s/%s", constants.LabelClusterRole, pod.Namespace, pod.Name) } } continue } if pod.Name != clc.localInstance.PodName() && !SecondarySelector(clusterName).Matches(labels.Set(pod.Labels)) { glog.Infof("Labeling %s/%s as secondary", pod.Namespace, pod.Name) - if err := clc.updateClusterRoleLabel(pod, constants.MySQLClusterRoleSecondary); err != nil { + if err := clc.updateClusterRoleLabel(pod, constants.ClusterRoleSecondary); err != nil { return errors.Wrapf(err, "labeling %s/%s as secondary", pod.Namespace, pod.Name) } } diff --git a/pkg/controllers/cluster/labeler/cluster_labeler_test.go b/pkg/controllers/cluster/labeler/cluster_labeler_test.go index e981e5945..ce6811026 100644 --- a/pkg/controllers/cluster/labeler/cluster_labeler_test.go +++ b/pkg/controllers/cluster/labeler/cluster_labeler_test.go @@ -70,7 +70,7 @@ func TestClusterLabelerLabelsPrimaryAndSecondaries(t *testing.T) { Name: "test-cluster-0", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", + constants.ClusterLabel: "test-cluster", }, }, }, @@ -83,7 +83,7 @@ func TestClusterLabelerLabelsPrimaryAndSecondaries(t *testing.T) { Name: "test-cluster-1", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", + constants.ClusterLabel: "test-cluster", }, }, }, @@ -96,13 +96,13 @@ func TestClusterLabelerLabelsPrimaryAndSecondaries(t *testing.T) { Name: "test-cluster-2", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", + constants.ClusterLabel: "test-cluster", }, }, }, } status := innodb.ClusterStatus{ - ClusterName: "MySQLCluster", + ClusterName: "Cluster", DefaultReplicaSet: innodb.ReplicaSet{ Name: "default", Primary: "test-cluster-0.test-cluster:3306", @@ -146,8 +146,8 @@ func TestClusterLabelerLabelsPrimaryAndSecondaries(t *testing.T) { if err != nil { t.Fatal(err) } - role, ok := pod.Labels[constants.LabelMySQLClusterRole] - if !ok || role != constants.MySQLClusterRolePrimary { + role, ok := pod.Labels[constants.LabelClusterRole] + if !ok || role != constants.ClusterRolePrimary { t.Errorf("test-cluster-0 not labeled as primary labels=%+v", pod.Labels) } @@ -156,8 +156,8 @@ func TestClusterLabelerLabelsPrimaryAndSecondaries(t *testing.T) { if err != nil { t.Fatal(err) } - role, ok = pod.Labels[constants.LabelMySQLClusterRole] - if !ok || role != constants.MySQLClusterRoleSecondary { + role, ok = pod.Labels[constants.LabelClusterRole] + if !ok || role != constants.ClusterRoleSecondary { t.Errorf("test-cluster-1 not labeled as secondary labels=%+v", pod.Labels) } @@ -166,8 +166,8 @@ func TestClusterLabelerLabelsPrimaryAndSecondaries(t *testing.T) { if err != nil { t.Fatal(err) } - role, ok = pod.Labels[constants.LabelMySQLClusterRole] - if !ok || role != constants.MySQLClusterRoleSecondary { + role, ok = pod.Labels[constants.LabelClusterRole] + if !ok || role != constants.ClusterRoleSecondary { t.Errorf("test-cluster-1 not labeled as secondary labels=%+v", pod.Labels) } } @@ -183,8 +183,8 @@ func TestClusterLabelerRelabelsOldPrimary(t *testing.T) { Name: "test-cluster-0", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", - constants.LabelMySQLClusterRole: constants.MySQLClusterRolePrimary, + constants.ClusterLabel: "test-cluster", + constants.LabelClusterRole: constants.ClusterRolePrimary, }, }, }, @@ -197,8 +197,8 @@ func TestClusterLabelerRelabelsOldPrimary(t *testing.T) { Name: "test-cluster-1", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", - constants.LabelMySQLClusterRole: constants.MySQLClusterRoleSecondary, + constants.ClusterLabel: "test-cluster", + constants.LabelClusterRole: constants.ClusterRoleSecondary, }, }, }, @@ -211,14 +211,14 @@ func TestClusterLabelerRelabelsOldPrimary(t *testing.T) { Name: "test-cluster-2", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", - constants.LabelMySQLClusterRole: constants.MySQLClusterRoleSecondary, + constants.ClusterLabel: "test-cluster", + constants.LabelClusterRole: constants.ClusterRoleSecondary, }, }, }, } status := innodb.ClusterStatus{ - ClusterName: "MySQLCluster", + ClusterName: "Cluster", DefaultReplicaSet: innodb.ReplicaSet{ Name: "default", Primary: "test-cluster-1.test-cluster:3306", @@ -262,8 +262,8 @@ func TestClusterLabelerRelabelsOldPrimary(t *testing.T) { if err != nil { t.Fatal(err) } - role, ok := pod.Labels[constants.LabelMySQLClusterRole] - if !ok || role != constants.MySQLClusterRoleSecondary { + role, ok := pod.Labels[constants.LabelClusterRole] + if !ok || role != constants.ClusterRoleSecondary { t.Errorf("test-cluster-0 not labeled as secondary labels=%+v", pod.Labels) } @@ -272,8 +272,8 @@ func TestClusterLabelerRelabelsOldPrimary(t *testing.T) { if err != nil { t.Fatal(err) } - role, ok = pod.Labels[constants.LabelMySQLClusterRole] - if !ok || role != constants.MySQLClusterRolePrimary { + role, ok = pod.Labels[constants.LabelClusterRole] + if !ok || role != constants.ClusterRolePrimary { t.Errorf("test-cluster-1 not labeled as primary labels=%+v", pod.Labels) } } @@ -289,8 +289,8 @@ func TestClusterLabelerDoesntRelabelCorrectlyLabeledPods(t *testing.T) { Name: "test-cluster-0", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", - constants.LabelMySQLClusterRole: constants.MySQLClusterRolePrimary, + constants.ClusterLabel: "test-cluster", + constants.LabelClusterRole: constants.ClusterRolePrimary, }, }, }, @@ -303,8 +303,8 @@ func TestClusterLabelerDoesntRelabelCorrectlyLabeledPods(t *testing.T) { Name: "test-cluster-1", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", - constants.LabelMySQLClusterRole: constants.MySQLClusterRoleSecondary, + constants.ClusterLabel: "test-cluster", + constants.LabelClusterRole: constants.ClusterRoleSecondary, }, }, }, @@ -317,14 +317,14 @@ func TestClusterLabelerDoesntRelabelCorrectlyLabeledPods(t *testing.T) { Name: "test-cluster-2", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", - constants.LabelMySQLClusterRole: constants.MySQLClusterRoleSecondary, + constants.ClusterLabel: "test-cluster", + constants.LabelClusterRole: constants.ClusterRoleSecondary, }, }, }, } status := innodb.ClusterStatus{ - ClusterName: "MySQLCluster", + ClusterName: "Cluster", DefaultReplicaSet: innodb.ReplicaSet{ Name: "default", Primary: "test-cluster-0.test-cluster:3306", @@ -375,8 +375,8 @@ func TestClusterLabelerRemovesLabelFromInstanceInMissingState(t *testing.T) { Name: "test-cluster-0", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", - constants.LabelMySQLClusterRole: constants.MySQLClusterRolePrimary, + constants.ClusterLabel: "test-cluster", + constants.LabelClusterRole: constants.ClusterRolePrimary, }, }, }, @@ -389,8 +389,8 @@ func TestClusterLabelerRemovesLabelFromInstanceInMissingState(t *testing.T) { Name: "test-cluster-1", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", - constants.LabelMySQLClusterRole: constants.MySQLClusterRoleSecondary, + constants.ClusterLabel: "test-cluster", + constants.LabelClusterRole: constants.ClusterRoleSecondary, }, }, }, @@ -403,14 +403,14 @@ func TestClusterLabelerRemovesLabelFromInstanceInMissingState(t *testing.T) { Name: "test-cluster-2", Namespace: metav1.NamespaceDefault, Labels: map[string]string{ - constants.MySQLClusterLabel: "test-cluster", - constants.LabelMySQLClusterRole: constants.MySQLClusterRoleSecondary, + constants.ClusterLabel: "test-cluster", + constants.LabelClusterRole: constants.ClusterRoleSecondary, }, }, }, } status := innodb.ClusterStatus{ - ClusterName: "MySQLCluster", + ClusterName: "Cluster", DefaultReplicaSet: innodb.ReplicaSet{ Name: "default", Primary: "test-cluster-0.test-cluster:3306", @@ -454,7 +454,7 @@ func TestClusterLabelerRemovesLabelFromInstanceInMissingState(t *testing.T) { if err != nil { t.Fatal(err) } - role, _ := pod.Labels[constants.LabelMySQLClusterRole] + role, _ := pod.Labels[constants.LabelClusterRole] if role != "" { t.Errorf("label not removed from test-cluster-2 labels=%+v", pod.Labels) } diff --git a/pkg/controllers/cluster/labeler/selectors.go b/pkg/controllers/cluster/labeler/selectors.go index c797b7bad..649a6e748 100644 --- a/pkg/controllers/cluster/labeler/selectors.go +++ b/pkg/controllers/cluster/labeler/selectors.go @@ -22,35 +22,35 @@ import ( ) // PrimarySelector returns a label selector that selects only primaries of a -// MySQLCluster's Pods. +// Cluster's Pods. func PrimarySelector(name string) labels.Selector { return labels.SelectorFromSet(labels.Set{ - constants.MySQLClusterLabel: name, - constants.LabelMySQLClusterRole: constants.MySQLClusterRolePrimary, + constants.ClusterLabel: name, + constants.LabelClusterRole: constants.ClusterRolePrimary, }) } // SecondarySelector returns a label selector that selects only secondaries of a -// MySQLCluster's Pods. +// Cluster's Pods. func SecondarySelector(name string) labels.Selector { return labels.SelectorFromSet(labels.Set{ - constants.MySQLClusterLabel: name, - constants.LabelMySQLClusterRole: constants.MySQLClusterRoleSecondary, + constants.ClusterLabel: name, + constants.LabelClusterRole: constants.ClusterRoleSecondary, }) } // NonPrimarySelector returns a label selector that selects all Pods excluding -// primaries of a MySQLCluster. +// primaries of a Cluster. func NonPrimarySelector(name string) labels.Selector { - s := labels.SelectorFromSet(labels.Set{constants.MySQLClusterLabel: name}) - requirement, _ := labels.NewRequirement(constants.LabelMySQLClusterRole, selection.NotIn, []string{constants.MySQLClusterRolePrimary}) + s := labels.SelectorFromSet(labels.Set{constants.ClusterLabel: name}) + requirement, _ := labels.NewRequirement(constants.LabelClusterRole, selection.NotIn, []string{constants.ClusterRolePrimary}) return s.Add(*requirement) } // HasRoleSelector returns a label selector that selects all Pods for a -// MySQLCluster that have been labeled as having a role. +// Cluster that have been labeled as having a role. func HasRoleSelector(name string) labels.Selector { - s := labels.SelectorFromSet(labels.Set{constants.MySQLClusterLabel: name}) - requirement, _ := labels.NewRequirement(constants.LabelMySQLClusterRole, selection.Exists, []string{}) + s := labels.SelectorFromSet(labels.Set{constants.ClusterLabel: name}) + requirement, _ := labels.NewRequirement(constants.LabelClusterRole, selection.Exists, []string{}) return s.Add(*requirement) } diff --git a/pkg/controllers/cluster/labeler/selectors_test.go b/pkg/controllers/cluster/labeler/selectors_test.go index 45f3f4447..61192aba5 100644 --- a/pkg/controllers/cluster/labeler/selectors_test.go +++ b/pkg/controllers/cluster/labeler/selectors_test.go @@ -33,28 +33,28 @@ func TestPrimarySelector(t *testing.T) { { name: "primary", labels: map[string]string{ - constants.MySQLClusterLabel: "primary", - constants.LabelMySQLClusterRole: constants.MySQLClusterRolePrimary, + constants.ClusterLabel: "primary", + constants.LabelClusterRole: constants.ClusterRolePrimary, }, matches: 1, }, { name: "secondary", labels: map[string]string{ - constants.MySQLClusterLabel: "secondary", - constants.LabelMySQLClusterRole: constants.MySQLClusterRoleSecondary, + constants.ClusterLabel: "secondary", + constants.LabelClusterRole: constants.ClusterRoleSecondary, }, matches: 0, }, { name: "blank", labels: map[string]string{ - constants.MySQLClusterLabel: "blank", - constants.LabelMySQLClusterRole: "", + constants.ClusterLabel: "blank", + constants.LabelClusterRole: "", }, matches: 0, }, { name: "missing", labels: map[string]string{ - constants.MySQLClusterLabel: "missing", + constants.ClusterLabel: "missing", }, matches: 0, }, @@ -85,28 +85,28 @@ func TestSecondarySelector(t *testing.T) { { name: "secondary", labels: map[string]string{ - constants.MySQLClusterLabel: "secondary", - constants.LabelMySQLClusterRole: constants.MySQLClusterRoleSecondary, + constants.ClusterLabel: "secondary", + constants.LabelClusterRole: constants.ClusterRoleSecondary, }, matches: 1, }, { name: "primary", labels: map[string]string{ - constants.MySQLClusterLabel: "primary", - constants.LabelMySQLClusterRole: constants.MySQLClusterRolePrimary, + constants.ClusterLabel: "primary", + constants.LabelClusterRole: constants.ClusterRolePrimary, }, matches: 0, }, { name: "blank", labels: map[string]string{ - constants.MySQLClusterLabel: "blank", - constants.LabelMySQLClusterRole: "", + constants.ClusterLabel: "blank", + constants.LabelClusterRole: "", }, matches: 0, }, { name: "missing", labels: map[string]string{ - constants.MySQLClusterLabel: "missing", + constants.ClusterLabel: "missing", }, matches: 0, }, @@ -137,28 +137,28 @@ func TestNonPrimarySelector(t *testing.T) { { name: "secondary", labels: map[string]string{ - constants.MySQLClusterLabel: "secondary", - constants.LabelMySQLClusterRole: constants.MySQLClusterRoleSecondary, + constants.ClusterLabel: "secondary", + constants.LabelClusterRole: constants.ClusterRoleSecondary, }, matches: 1, }, { name: "primary", labels: map[string]string{ - constants.MySQLClusterLabel: "primary", - constants.LabelMySQLClusterRole: constants.MySQLClusterRolePrimary, + constants.ClusterLabel: "primary", + constants.LabelClusterRole: constants.ClusterRolePrimary, }, matches: 0, }, { name: "blank", labels: map[string]string{ - constants.MySQLClusterLabel: "blank", - constants.LabelMySQLClusterRole: "", + constants.ClusterLabel: "blank", + constants.LabelClusterRole: "", }, matches: 1, }, { name: "missing", labels: map[string]string{ - constants.MySQLClusterLabel: "missing", + constants.ClusterLabel: "missing", }, matches: 1, }, @@ -189,28 +189,28 @@ func TestHasRoleSelector(t *testing.T) { { name: "secondary", labels: map[string]string{ - constants.MySQLClusterLabel: "secondary", - constants.LabelMySQLClusterRole: constants.MySQLClusterRoleSecondary, + constants.ClusterLabel: "secondary", + constants.LabelClusterRole: constants.ClusterRoleSecondary, }, matches: 1, }, { name: "primary", labels: map[string]string{ - constants.MySQLClusterLabel: "primary", - constants.LabelMySQLClusterRole: constants.MySQLClusterRolePrimary, + constants.ClusterLabel: "primary", + constants.LabelClusterRole: constants.ClusterRolePrimary, }, matches: 1, }, { name: "blank", labels: map[string]string{ - constants.MySQLClusterLabel: "blank", - constants.LabelMySQLClusterRole: "", + constants.ClusterLabel: "blank", + constants.LabelClusterRole: "", }, matches: 1, }, { name: "missing", labels: map[string]string{ - constants.MySQLClusterLabel: "missing", + constants.ClusterLabel: "missing", }, matches: 0, }, diff --git a/pkg/controllers/cluster/pod_control.go b/pkg/controllers/cluster/pod_control.go index 9ca0faf88..f36ff9963 100644 --- a/pkg/controllers/cluster/pod_control.go +++ b/pkg/controllers/cluster/pod_control.go @@ -27,7 +27,7 @@ import ( ) // PodControlInterface defines the interface that the -// MySQLClusterController uses to create, update, and delete mysql pods. It +// ClusterController uses to create, update, and delete mysql pods. It // is implemented as an interface to enable testing. type PodControlInterface interface { PatchPod(old *v1.Pod, new *v1.Pod) error diff --git a/pkg/controllers/cluster/secret_control.go b/pkg/controllers/cluster/secret_control.go index b9fd7cab0..2973179d4 100644 --- a/pkg/controllers/cluster/secret_control.go +++ b/pkg/controllers/cluster/secret_control.go @@ -23,11 +23,11 @@ import ( "github.com/oracle/mysql-operator/pkg/resources/secrets" ) -// SecretControlInterface defines the interface that the MySQLClusterController +// SecretControlInterface defines the interface that the ClusterController // uses to get and create Secrets. It is implemented as an interface to enable // testing. type SecretControlInterface interface { - GetForCluster(cluster *v1alpha1.MySQLCluster) (*v1.Secret, error) + GetForCluster(cluster *v1alpha1.Cluster) (*v1.Secret, error) CreateSecret(s *v1.Secret) error } @@ -41,7 +41,7 @@ func NewRealSecretControl(client kubernetes.Interface) SecretControlInterface { return &realSecretControl{client: client} } -func (rsc *realSecretControl) GetForCluster(cluster *v1alpha1.MySQLCluster) (*v1.Secret, error) { +func (rsc *realSecretControl) GetForCluster(cluster *v1alpha1.Cluster) (*v1.Secret, error) { return rsc.client.CoreV1(). Secrets(cluster.Namespace). Get(secrets.GetRootPasswordSecretName(cluster), metav1.GetOptions{}) diff --git a/pkg/controllers/cluster/service_control.go b/pkg/controllers/cluster/service_control.go index 6e9f517be..9673cc168 100644 --- a/pkg/controllers/cluster/service_control.go +++ b/pkg/controllers/cluster/service_control.go @@ -20,7 +20,7 @@ import ( corelistersv1 "k8s.io/client-go/listers/core/v1" ) -// ServiceControlInterface defines the interface that the MySQLClusterController +// ServiceControlInterface defines the interface that the ClusterController // uses to create Services. It is implemented as an interface to enable testing. type ServiceControlInterface interface { CreateService(s *corev1.Service) error diff --git a/pkg/controllers/cluster/statefulset_control.go b/pkg/controllers/cluster/statefulset_control.go index ccc5c5a97..27dac15a7 100644 --- a/pkg/controllers/cluster/statefulset_control.go +++ b/pkg/controllers/cluster/statefulset_control.go @@ -27,7 +27,7 @@ import ( ) // StatefulSetControlInterface defines the interface that the -// MySQLClusterController uses to create and update StatefulSets. It +// ClusterController uses to create and update StatefulSets. It // is implemented as an interface to enable testing. type StatefulSetControlInterface interface { CreateStatefulSet(ss *apps.StatefulSet) error diff --git a/pkg/controllers/cluster/utils.go b/pkg/controllers/cluster/utils.go index 3d85d6470..dd48edb93 100644 --- a/pkg/controllers/cluster/utils.go +++ b/pkg/controllers/cluster/utils.go @@ -27,8 +27,8 @@ import ( // SelectorForCluster creates a labels.Selector to match a given clusters // associated resources. -func SelectorForCluster(c *v1alpha1.MySQLCluster) labels.Selector { - return labels.SelectorFromSet(labels.Set{constants.MySQLClusterLabel: c.Name}) +func SelectorForCluster(c *v1alpha1.Cluster) labels.Selector { + return labels.SelectorFromSet(labels.Set{constants.ClusterLabel: c.Name}) } // SelectorForClusterOperatorVersion creates a labels.Selector to match a given clusters diff --git a/pkg/controllers/restore/agent_controller.go b/pkg/controllers/restore/agent_controller.go index 0c685dd4b..bd94b3c69 100644 --- a/pkg/controllers/restore/agent_controller.go +++ b/pkg/controllers/restore/agent_controller.go @@ -36,6 +36,7 @@ import ( record "k8s.io/client-go/tools/record" workqueue "k8s.io/client-go/util/workqueue" + restoreutil "github.com/oracle/mysql-operator/pkg/api/restore" v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" backuputil "github.com/oracle/mysql-operator/pkg/backup" executor "github.com/oracle/mysql-operator/pkg/backup/executor" @@ -49,7 +50,7 @@ import ( const agentControllerAgentName = "agent-restore-controller" -// AgentController handles the excution of MySQLRestores on a specific (primary) +// AgentController handles the excution of Restores on a specific (primary) // mysql-agent. It is run in each mysql-agent. // TODO: Probably should only be run iff the local mysql instance is a primary. type AgentController struct { @@ -57,13 +58,13 @@ type AgentController struct { podName string kubeClient kubernetes.Interface - client clientset.MySQLRestoresGetter + client clientset.RestoresGetter syncHandler func(key string) error - // restoreLister is able to list/get MySQLRestores from a shared informer's + // restoreLister is able to list/get Restores from a shared informer's // store. - restoreLister listersv1alpha1.MySQLRestoreLister - // restoreListerSynced returns true if the MySQLRestore shared informer has + restoreLister listersv1alpha1.RestoreLister + // restoreListerSynced returns true if the Restore shared informer has // synced at least once. restoreListerSynced cache.InformerSynced @@ -73,17 +74,17 @@ type AgentController struct { // least once. podListerSynced cache.InformerSynced - // clusterLister is able to list/get MySQLClusters from a shared informer's + // clusterLister is able to list/get Clusters from a shared informer's // store. - clusterLister listersv1alpha1.MySQLClusterLister - // clusterListerSynced returns true if the MySQLCluster shared informer has + clusterLister listersv1alpha1.ClusterLister + // clusterListerSynced returns true if the Cluster shared informer has // synced at least once. clusterListerSynced cache.InformerSynced - // backupLister is able to list/get MySQLBackups from a shared informer's + // backupLister is able to list/get Backups from a shared informer's // store. - backupLister listersv1alpha1.MySQLBackupLister - // backupListerSynced returns true if the MySQLBackup shared informer has + backupLister listersv1alpha1.BackupLister + // backupListerSynced returns true if the Backup shared informer has // synced at least once. backupListerSynced cache.InformerSynced @@ -91,15 +92,18 @@ type AgentController struct { // recorder is an event recorder for recording Event resources to the // Kubernetes API. recorder record.EventRecorder + + // conditionUpdater updates the conditions of Backups. + conditionUpdater ConditionUpdater } // NewAgentController constructs a new AgentController. func NewAgentController( kubeClient kubernetes.Interface, - client clientset.MySQLRestoresGetter, - restoreInformer informersv1alpha1.MySQLRestoreInformer, - clusterInformer informersv1alpha1.MySQLClusterInformer, - backupInformer informersv1alpha1.MySQLBackupInformer, + client clientset.RestoresGetter, + restoreInformer informersv1alpha1.RestoreInformer, + clusterInformer informersv1alpha1.ClusterInformer, + backupInformer informersv1alpha1.BackupInformer, podInformer corev1informers.PodInformer, podName string, ) *AgentController { @@ -124,6 +128,7 @@ func NewAgentController( podListerSynced: podInformer.Informer().HasSynced, queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "restore"), recorder: recorder, + conditionUpdater: &conditionUpdater{client: client}, } c.syncHandler = c.processRestore @@ -131,8 +136,9 @@ func NewAgentController( restoreInformer.Informer().AddEventHandler( cache.ResourceEventHandlerFuncs{ UpdateFunc: func(oldObj, newObj interface{}) { - new := newObj.(*v1alpha1.MySQLRestore) - if new.Status.Phase == v1alpha1.RestorePhaseScheduled && new.Spec.AgentScheduled == c.podName { + new := newObj.(*v1alpha1.Restore) + _, cond := restoreutil.GetRestoreCondition(&new.Status, v1alpha1.RestoreScheduled) + if cond != nil && cond.Status == corev1.ConditionTrue && new.Spec.ScheduledMember == c.podName { key, err := cache.MetaNamespaceKeyFunc(new) if err != nil { glog.Errorf("Error creating queue key, item not added to queue: %v", err) @@ -141,8 +147,7 @@ func NewAgentController( c.queue.Add(key) return } - glog.V(2).Infof("MySQLRestore %q is not Scheduled, skipping (phase=%q)", - kubeutil.NamespaceAndName(new), new.Status.Phase) + glog.V(4).Infof("Restore %q is not Scheduled on this agent") }, }, @@ -238,9 +243,9 @@ func (controller *AgentController) processRestore(key string) error { } // Get resource from store. - restore, err := controller.restoreLister.MySQLRestores(ns).Get(name) + restore, err := controller.restoreLister.Restores(ns).Get(name) if err != nil { - return errors.Wrap(err, "error getting MySQLRestore") + return errors.Wrap(err, "error getting Restore") } // Don't modify items in the cache. @@ -249,7 +254,7 @@ func (controller *AgentController) processRestore(key string) error { restore = restore.EnsureDefaults() var ( - backup *v1alpha1.MySQLBackup + backup *v1alpha1.Backup creds *corev1.Secret ) @@ -260,53 +265,54 @@ func (controller *AgentController) processRestore(key string) error { validationErrs := field.ErrorList{} fldPath := field.NewPath("spec") - // Check the referenced MySQLCluster exists. - _, err := controller.clusterLister.MySQLClusters(ns).Get(restore.Spec.ClusterRef.Name) + // Check the referenced Cluster exists. + _, err := controller.clusterLister.Clusters(ns).Get(restore.Spec.Cluster.Name) if err != nil { if !apierrors.IsNotFound(err) { return err } validationErrs = append(validationErrs, - field.NotFound(fldPath.Child("clusterRef").Child("name"), restore.Spec.ClusterRef.Name)) + field.NotFound(fldPath.Child("cluster").Child("name"), restore.Spec.Cluster.Name)) } - // Check the referenced MySQLBackup exists. - backup, err = controller.backupLister.MySQLBackups(ns).Get(restore.Spec.BackupRef.Name) + // Check the referenced Backup exists. + backup, err = controller.backupLister.Backups(ns).Get(restore.Spec.Backup.Name) if err != nil { if !apierrors.IsNotFound(err) { return err } validationErrs = append(validationErrs, - field.NotFound(fldPath.Child("backupRef").Child("name"), restore.Spec.BackupRef.Name)) + field.NotFound(fldPath.Child("backup").Child("name"), restore.Spec.Backup.Name)) } - creds, err = controller.kubeClient.CoreV1().Secrets(ns).Get(backup.Spec.Storage.SecretRef.Name, metav1.GetOptions{}) + creds, err = controller.kubeClient.CoreV1().Secrets(ns).Get(backup.Spec.StorageProvider.S3.CredentialsSecret.Name, metav1.GetOptions{}) if err != nil { if !apierrors.IsNotFound(err) { return errors.Wrap(err, "getting backup credentials secret") } validationErrs = append(validationErrs, - field.NotFound(fldPath.Child("backupRef").Child("name"), backup.Spec.Storage.SecretRef.Name)) + field.NotFound(fldPath.Child("backup").Child("name"), backup.Spec.StorageProvider.S3.CredentialsSecret.Name)) } if len(validationErrs) > 0 { validationErr = validationErrs.ToAggregate() } } - // If the MySQLRestore is not valid emit an event to that effect and mark + // If the Restore is not valid emit an event to that effect and mark // it as failed. // TODO(apryde): Maybe we should add an UpdateFunc to the restoreInformer // and support users fixing validation errors via updates (rather than // recreation). if validationErr != nil { - restore.Status.Phase = v1alpha1.RestorePhaseFailed - restore, err = controller.client.MySQLRestores(ns).Update(restore) - if err != nil { - return errors.Wrapf(err, "failed to update (phase=%q)", v1alpha1.RestorePhaseFailed) - } controller.recorder.Eventf(restore, corev1.EventTypeWarning, "FailedValidation", validationErr.Error()) - - return nil // We don't return an error as we don't want to re-queue. + // NOTE: We only return an error here if we fail to set the condition + // (rather than on validation failure) as we don't want to retry. + return controller.conditionUpdater.Update(restore, &v1alpha1.RestoreCondition{ + Type: v1alpha1.RestoreFailed, + Status: corev1.ConditionFalse, + Reason: "FailedValidation", + Message: validationErr.Error(), + }) } err = controller.performRestore(restore, backup, creds) @@ -317,14 +323,13 @@ func (controller *AgentController) processRestore(key string) error { return nil } -func (controller *AgentController) performRestore(restore *v1alpha1.MySQLRestore, backup *v1alpha1.MySQLBackup, creds *corev1.Secret) error { - // Update restore phase to started. +func (controller *AgentController) performRestore(restore *v1alpha1.Restore, backup *v1alpha1.Backup, creds *corev1.Secret) error { started := time.Now() - restore.Status.Phase = v1alpha1.RestorePhaseStarted - restore.Status.TimeStarted = metav1.Time{Time: started} - restore, err := controller.client.MySQLRestores(restore.Namespace).Update(restore) - if err != nil { - return errors.Wrapf(err, "failed to mark MySQLRestore %q as started", kubeutil.NamespaceAndName(restore)) + if err := controller.conditionUpdater.Update(restore, &v1alpha1.RestoreCondition{ + Type: v1alpha1.RestoreRunning, + Status: corev1.ConditionTrue, + }); err != nil { + return err } // TODO: Should backuputil.NewConfiguredRunner accept a map[string][]byte @@ -334,42 +339,44 @@ func (controller *AgentController) performRestore(restore *v1alpha1.MySQLRestore credsMap[k] = string(v) } - runner, err := backuputil.NewConfiguredRunner(backup.Spec.Executor, executor.DefaultCreds(), backup.Spec.Storage, credsMap) + runner, err := backuputil.NewConfiguredRunner(backup.Spec.Executor, executor.DefaultCreds(), backup.Spec.StorageProvider, credsMap) if err != nil { - restore.Status.Phase = v1alpha1.RestorePhaseFailed - restore, updateErr := controller.client.MySQLRestores(restore.Namespace).Update(restore) - if updateErr != nil { - return errors.Wrapf(err, "failed to mark MySQLRestore %q as failed", kubeutil.NamespaceAndName(restore)) - } - - controller.recorder.Event(restore, corev1.EventTypeWarning, "FailedValidation", err.Error()) - return nil // We return nil as the error cannot be retried. + controller.recorder.Event(restore, corev1.EventTypeWarning, "ExecutionFailed", err.Error()) + return controller.conditionUpdater.Update(restore, &v1alpha1.RestoreCondition{ + Type: v1alpha1.RestoreFailed, + Status: corev1.ConditionFalse, + Reason: "ExecutionFailed", + Message: err.Error(), + }) } err = runner.Restore(backup.Status.Outcome.Location) if err != nil { - restore.Status.Phase = v1alpha1.RestorePhaseFailed - restore, updateErr := controller.client.MySQLRestores(restore.Namespace).Update(restore) - if updateErr != nil { - return errors.Wrapf(err, "failed to mark MySQLRestore %q as failed", kubeutil.NamespaceAndName(restore)) - } - - controller.recorder.Event(restore, corev1.EventTypeWarning, "RestoreFailed", err.Error()) - return nil // We return nil as the error cannot be retried. + controller.recorder.Event(restore, corev1.EventTypeWarning, "ExecutionFailed", err.Error()) + return controller.conditionUpdater.Update(restore, &v1alpha1.RestoreCondition{ + Type: v1alpha1.RestoreFailed, + Status: corev1.ConditionFalse, + Reason: "ExecutionFailed", + Message: err.Error(), + }) } finished := time.Now() - restore.Status.Phase = v1alpha1.RestorePhaseComplete + restoreutil.UpdateRestoreCondition(&restore.Status, &v1alpha1.RestoreCondition{ + Type: v1alpha1.RestoreComplete, + Status: corev1.ConditionTrue, + }) + restore.Status.TimeStarted = metav1.Time{Time: started} restore.Status.TimeCompleted = metav1.Time{Time: finished} - restore, err = controller.client.MySQLRestores(restore.Namespace).Update(restore) + restore, err = controller.client.Restores(restore.Namespace).Update(restore) if err != nil { - return errors.Wrapf(err, "failed to mark MySQLRestore %q as complete", kubeutil.NamespaceAndName(restore)) + return errors.Wrapf(err, "failed to mark Restore %q as complete", kubeutil.NamespaceAndName(restore)) } metrics.IncEventCounter(clusterRestoreCount) - glog.Infof("MySQLRestore %q succeeded in %v", restore.Name, finished.Sub(started)) - controller.recorder.Event(restore, corev1.EventTypeNormal, "Success", "Restore complete") + glog.Infof("Restore %q succeeded in %v", restore.Name, finished.Sub(started)) + controller.recorder.Event(restore, corev1.EventTypeNormal, "Complete", "Restore complete") return nil } diff --git a/pkg/controllers/restore/condition_updater.go b/pkg/controllers/restore/condition_updater.go new file mode 100644 index 000000000..145bb54f6 --- /dev/null +++ b/pkg/controllers/restore/condition_updater.go @@ -0,0 +1,27 @@ +package restore + +import ( + "github.com/golang/glog" + + restoreutil "github.com/oracle/mysql-operator/pkg/api/restore" + "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + clientset "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned/typed/mysql/v1alpha1" +) + +// ConditionUpdater enables updating Restore conditions. +type ConditionUpdater interface { + Update(restore *v1alpha1.Restore, condition *v1alpha1.RestoreCondition) error +} + +type conditionUpdater struct { + client clientset.RestoresGetter +} + +func (p *conditionUpdater) Update(restore *v1alpha1.Restore, condition *v1alpha1.RestoreCondition) error { + glog.V(2).Infof("Updating Restore condition for %s/%s to (%s==%s)", restore.Namespace, restore.Name, condition.Type, condition.Status) + if restoreutil.UpdateRestoreCondition(&restore.Status, condition) { + _, err := p.client.Restores(restore.Namespace).Update(restore) + return err + } + return nil +} diff --git a/pkg/controllers/restore/operator_controller.go b/pkg/controllers/restore/operator_controller.go index ce3ca71dc..423daf032 100644 --- a/pkg/controllers/restore/operator_controller.go +++ b/pkg/controllers/restore/operator_controller.go @@ -35,6 +35,7 @@ import ( record "k8s.io/client-go/tools/record" workqueue "k8s.io/client-go/util/workqueue" + restoreutil "github.com/oracle/mysql-operator/pkg/api/restore" v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" clusterlabeler "github.com/oracle/mysql-operator/pkg/controllers/cluster/labeler" controllerutils "github.com/oracle/mysql-operator/pkg/controllers/util" @@ -47,16 +48,16 @@ import ( const controllerAgentName = "operator-restore-controller" // OperatorController handles validation, labeling, and scheduling of -// MySQLRestores to be executed on a specific (primary) mysql-agent. It is run +// Restores to be executed on a specific (primary) mysql-agent. It is run // in the operator. type OperatorController struct { - client clientset.MySQLRestoresGetter + client clientset.RestoresGetter syncHandler func(key string) error - // restoreLister is able to list/get MySQLRestores from a shared informer's + // restoreLister is able to list/get Restores from a shared informer's // store. - restoreLister listersv1alpha1.MySQLRestoreLister - // restoreListerSynced returns true if the MySQLRestore shared informer has + restoreLister listersv1alpha1.RestoreLister + // restoreListerSynced returns true if the Restore shared informer has // synced at least once. restoreListerSynced cache.InformerSynced @@ -66,17 +67,17 @@ type OperatorController struct { // least once. podListerSynced cache.InformerSynced - // clusterLister is able to list/get MySQLClusters from a shared informer's + // clusterLister is able to list/get Clusters from a shared informer's // store. - clusterLister listersv1alpha1.MySQLClusterLister - // clusterListerSynced returns true if the MySQLCluster shared informer has + clusterLister listersv1alpha1.ClusterLister + // clusterListerSynced returns true if the Cluster shared informer has // synced at least once. clusterListerSynced cache.InformerSynced - // backupLister is able to list/get MySQLBackups from a shared informer's + // backupLister is able to list/get Backups from a shared informer's // store. - backupLister listersv1alpha1.MySQLBackupLister - // backupListerSynced returns true if the MySQLBackup shared informer has + backupLister listersv1alpha1.BackupLister + // backupListerSynced returns true if the Backup shared informer has // synced at least once. backupListerSynced cache.InformerSynced @@ -84,15 +85,18 @@ type OperatorController struct { // recorder is an event recorder for recording Event resources to the // Kubernetes API. recorder record.EventRecorder + + // conditionUpdater updates the conditions of Backups. + conditionUpdater ConditionUpdater } // NewOperatorController constructs a new OperatorController. func NewOperatorController( kubeClient kubernetes.Interface, - client clientset.MySQLRestoresGetter, - restoreInformer informersv1alpha1.MySQLRestoreInformer, - clusterInformer informersv1alpha1.MySQLClusterInformer, - backupInformer informersv1alpha1.MySQLBackupInformer, + client clientset.RestoresGetter, + restoreInformer informersv1alpha1.RestoreInformer, + clusterInformer informersv1alpha1.ClusterInformer, + backupInformer informersv1alpha1.BackupInformer, podInformer corev1informers.PodInformer, ) *OperatorController { // Create event broadcaster. @@ -114,6 +118,7 @@ func NewOperatorController( podListerSynced: podInformer.Informer().HasSynced, queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "restore"), recorder: recorder, + conditionUpdater: &conditionUpdater{client: client}, } c.syncHandler = c.processRestore @@ -121,14 +126,12 @@ func NewOperatorController( restoreInformer.Informer().AddEventHandler( cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { - restore := obj.(*v1alpha1.MySQLRestore) - - switch restore.Status.Phase { - case v1alpha1.RestorePhaseUnknown, v1alpha1.RestorePhaseNew: - // Only process new restores. - default: - glog.V(2).Infof("MySQLRestore %q is not new, skipping (phase=%q)", - kubeutil.NamespaceAndName(restore), restore.Status.Phase) + restore := obj.(*v1alpha1.Restore) + + _, cond := restoreutil.GetRestoreCondition(&restore.Status, v1alpha1.RestoreScheduled) + if cond != nil && cond.Status == corev1.ConditionTrue { + glog.V(4).Infof("Restore %q is already scheduled on Cluster member %q", + kubeutil.NamespaceAndName(restore), restore.Spec.ScheduledMember) return } @@ -232,9 +235,9 @@ func (controller *OperatorController) processRestore(key string) error { } // Get resource from store. - restore, err := controller.restoreLister.MySQLRestores(ns).Get(name) + restore, err := controller.restoreLister.Restores(ns).Get(name) if err != nil { - return errors.Wrap(err, "error getting MySQLRestore") + return errors.Wrap(err, "error getting Restore") } // Don't modify items in the cache. @@ -249,44 +252,45 @@ func (controller *OperatorController) processRestore(key string) error { validationErrs := field.ErrorList{} fldPath := field.NewPath("spec") - // Check the referenced MySQLCluster exists. - _, err := controller.clusterLister.MySQLClusters(ns).Get(restore.Spec.ClusterRef.Name) + // Check the referenced Cluster exists. + _, err := controller.clusterLister.Clusters(ns).Get(restore.Spec.Cluster.Name) if err != nil { if !apierrors.IsNotFound(err) { return err } validationErrs = append(validationErrs, - field.NotFound(fldPath.Child("clusterRef").Child("name"), restore.Spec.ClusterRef.Name)) + field.NotFound(fldPath.Child("cluster").Child("name"), restore.Spec.Cluster.Name)) } - // Check the referenced MySQLBackup exists. - _, err = controller.backupLister.MySQLBackups(ns).Get(restore.Spec.BackupRef.Name) + // Check the referenced Backup exists. + _, err = controller.backupLister.Backups(ns).Get(restore.Spec.Backup.Name) if err != nil { if !apierrors.IsNotFound(err) { return err } validationErrs = append(validationErrs, - field.NotFound(fldPath.Child("backupRef").Child("name"), restore.Spec.BackupRef.Name)) + field.NotFound(fldPath.Child("backup").Child("name"), restore.Spec.Backup.Name)) } if len(validationErrs) > 0 { validationErr = validationErrs.ToAggregate() } } - // If the MySQLRestore is not valid emit an event to that effect and mark + // If the Restore is not valid emit an event to that effect and mark // it as failed. // TODO(apryde): Maybe we should add an UpdateFunc to the restoreInformer // and support users fixing validation errors via updates (rather than // recreation). if validationErr != nil { - restore.Status.Phase = v1alpha1.RestorePhaseFailed - restore, err = controller.client.MySQLRestores(ns).Update(restore) - if err != nil { - return errors.Wrapf(err, "failed to update (phase=%q)", v1alpha1.RestorePhaseFailed) - } controller.recorder.Eventf(restore, corev1.EventTypeWarning, "FailedValidation", validationErr.Error()) - - return nil // We don't return an error as we don't want to re-queue. + // NOTE: We only return an error here if we fail to set the condition + // (rather than on validation failure) as we don't want to retry. + return controller.conditionUpdater.Update(restore, &v1alpha1.RestoreCondition{ + Type: v1alpha1.RestoreFailed, + Status: corev1.ConditionFalse, + Reason: "FailedValidation", + Message: validationErr.Error(), + }) } // Schedule restore on a primary. @@ -296,20 +300,20 @@ func (controller *OperatorController) processRestore(key string) error { } // Update resource. - restore, err = controller.client.MySQLRestores(ns).Update(restore) + restore, err = controller.client.Restores(ns).Update(restore) if err != nil { return errors.Wrap(err, "failed to update") } - controller.recorder.Eventf(restore, corev1.EventTypeNormal, "SuccessScheduled", "Scheduled on Pod %q", restore.Spec.AgentScheduled) + controller.recorder.Eventf(restore, corev1.EventTypeNormal, "SuccessScheduled", "Scheduled on Pod %q", restore.Spec.ScheduledMember) return nil } -// scheduleRestore schedules a MySQLRestore on a specific member of a MySQLCluster. -func (controller *OperatorController) scheduleRestore(restore *v1alpha1.MySQLRestore) (*v1alpha1.MySQLRestore, error) { +// scheduleRestore schedules a Restore on a specific member of a Cluster. +func (controller *OperatorController) scheduleRestore(restore *v1alpha1.Restore) (*v1alpha1.Restore, error) { var ( - name = restore.Spec.ClusterRef.Name + name = restore.Spec.Cluster.Name ns = restore.Namespace ) @@ -318,8 +322,11 @@ func (controller *OperatorController) scheduleRestore(restore *v1alpha1.MySQLRes return restore, errors.Wrap(err, "error listing Pods") } if len(primaries) > 0 { - restore.Status.Phase = v1alpha1.RestorePhaseScheduled - restore.Spec.AgentScheduled = primaries[0].Name + restoreutil.UpdateRestoreCondition(&restore.Status, &v1alpha1.RestoreCondition{ + Type: v1alpha1.RestoreScheduled, + Status: corev1.ConditionTrue, + }) + restore.Spec.ScheduledMember = primaries[0].Name return restore, nil } diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index c922b5fba..133252085 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -24,27 +24,27 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - MysqlV1alpha1() mysqlv1alpha1.MysqlV1alpha1Interface + MySQLV1alpha1() mysqlv1alpha1.MySQLV1alpha1Interface // Deprecated: please explicitly pick a version if possible. - Mysql() mysqlv1alpha1.MysqlV1alpha1Interface + MySQL() mysqlv1alpha1.MySQLV1alpha1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - mysqlV1alpha1 *mysqlv1alpha1.MysqlV1alpha1Client + mySQLV1alpha1 *mysqlv1alpha1.MySQLV1alpha1Client } -// MysqlV1alpha1 retrieves the MysqlV1alpha1Client -func (c *Clientset) MysqlV1alpha1() mysqlv1alpha1.MysqlV1alpha1Interface { - return c.mysqlV1alpha1 +// MySQLV1alpha1 retrieves the MySQLV1alpha1Client +func (c *Clientset) MySQLV1alpha1() mysqlv1alpha1.MySQLV1alpha1Interface { + return c.mySQLV1alpha1 } -// Deprecated: Mysql retrieves the default version of MysqlClient. +// Deprecated: MySQL retrieves the default version of MySQLClient. // Please explicitly pick a version. -func (c *Clientset) Mysql() mysqlv1alpha1.MysqlV1alpha1Interface { - return c.mysqlV1alpha1 +func (c *Clientset) MySQL() mysqlv1alpha1.MySQLV1alpha1Interface { + return c.mySQLV1alpha1 } // Discovery retrieves the DiscoveryClient @@ -63,7 +63,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.mysqlV1alpha1, err = mysqlv1alpha1.NewForConfig(&configShallowCopy) + cs.mySQLV1alpha1, err = mysqlv1alpha1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -80,7 +80,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset - cs.mysqlV1alpha1 = mysqlv1alpha1.NewForConfigOrDie(c) + cs.mySQLV1alpha1 = mysqlv1alpha1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -89,7 +89,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.mysqlV1alpha1 = mysqlv1alpha1.New(c) + cs.mySQLV1alpha1 = mysqlv1alpha1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 4316c17e3..cd65ccbe5 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -39,7 +39,15 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { fakePtr := testing.Fake{} fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) - fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil)) + fakePtr.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} } @@ -58,12 +66,12 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { var _ clientset.Interface = &Clientset{} -// MysqlV1alpha1 retrieves the MysqlV1alpha1Client -func (c *Clientset) MysqlV1alpha1() mysqlv1alpha1.MysqlV1alpha1Interface { - return &fakemysqlv1alpha1.FakeMysqlV1alpha1{Fake: &c.Fake} +// MySQLV1alpha1 retrieves the MySQLV1alpha1Client +func (c *Clientset) MySQLV1alpha1() mysqlv1alpha1.MySQLV1alpha1Interface { + return &fakemysqlv1alpha1.FakeMySQLV1alpha1{Fake: &c.Fake} } -// Mysql retrieves the MysqlV1alpha1Client -func (c *Clientset) Mysql() mysqlv1alpha1.MysqlV1alpha1Interface { - return &fakemysqlv1alpha1.FakeMysqlV1alpha1{Fake: &c.Fake} +// MySQL retrieves the MySQLV1alpha1Client +func (c *Clientset) MySQL() mysqlv1alpha1.MySQLV1alpha1Interface { + return &fakemysqlv1alpha1.FakeMySQLV1alpha1{Fake: &c.Fake} } diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index 477d73430..9beefd8a5 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -36,7 +36,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -47,5 +47,4 @@ func init() { // correctly. func AddToScheme(scheme *runtime.Scheme) { mysqlv1alpha1.AddToScheme(scheme) - } diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go index 70aafd81a..4d8c3b62d 100644 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -36,7 +36,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -47,5 +47,4 @@ func init() { // correctly. func AddToScheme(scheme *runtime.Scheme) { mysqlv1alpha1.AddToScheme(scheme) - } diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlbackup.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/backup.go similarity index 50% rename from pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlbackup.go rename to pkg/generated/clientset/versioned/typed/mysql/v1alpha1/backup.go index 1b1171e71..d396302cf 100644 --- a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlbackup.go +++ b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/backup.go @@ -23,42 +23,42 @@ import ( rest "k8s.io/client-go/rest" ) -// MySQLBackupsGetter has a method to return a MySQLBackupInterface. +// BackupsGetter has a method to return a BackupInterface. // A group's client should implement this interface. -type MySQLBackupsGetter interface { - MySQLBackups(namespace string) MySQLBackupInterface +type BackupsGetter interface { + Backups(namespace string) BackupInterface } -// MySQLBackupInterface has methods to work with MySQLBackup resources. -type MySQLBackupInterface interface { - Create(*v1alpha1.MySQLBackup) (*v1alpha1.MySQLBackup, error) - Update(*v1alpha1.MySQLBackup) (*v1alpha1.MySQLBackup, error) +// BackupInterface has methods to work with Backup resources. +type BackupInterface interface { + Create(*v1alpha1.Backup) (*v1alpha1.Backup, error) + Update(*v1alpha1.Backup) (*v1alpha1.Backup, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.MySQLBackup, error) - List(opts v1.ListOptions) (*v1alpha1.MySQLBackupList, error) + Get(name string, options v1.GetOptions) (*v1alpha1.Backup, error) + List(opts v1.ListOptions) (*v1alpha1.BackupList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLBackup, err error) - MySQLBackupExpansion + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Backup, err error) + BackupExpansion } -// mySQLBackups implements MySQLBackupInterface -type mySQLBackups struct { +// backups implements BackupInterface +type backups struct { client rest.Interface ns string } -// newMySQLBackups returns a MySQLBackups -func newMySQLBackups(c *MysqlV1alpha1Client, namespace string) *mySQLBackups { - return &mySQLBackups{ +// newBackups returns a Backups +func newBackups(c *MySQLV1alpha1Client, namespace string) *backups { + return &backups{ client: c.RESTClient(), ns: namespace, } } -// Get takes name of the mySQLBackup, and returns the corresponding mySQLBackup object, and an error if there is any. -func (c *mySQLBackups) Get(name string, options v1.GetOptions) (result *v1alpha1.MySQLBackup, err error) { - result = &v1alpha1.MySQLBackup{} +// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any. +func (c *backups) Get(name string, options v1.GetOptions) (result *v1alpha1.Backup, err error) { + result = &v1alpha1.Backup{} err = c.client.Get(). Namespace(c.ns). Resource("mysqlbackups"). @@ -69,9 +69,9 @@ func (c *mySQLBackups) Get(name string, options v1.GetOptions) (result *v1alpha1 return } -// List takes label and field selectors, and returns the list of MySQLBackups that match those selectors. -func (c *mySQLBackups) List(opts v1.ListOptions) (result *v1alpha1.MySQLBackupList, err error) { - result = &v1alpha1.MySQLBackupList{} +// List takes label and field selectors, and returns the list of Backups that match those selectors. +func (c *backups) List(opts v1.ListOptions) (result *v1alpha1.BackupList, err error) { + result = &v1alpha1.BackupList{} err = c.client.Get(). Namespace(c.ns). Resource("mysqlbackups"). @@ -81,8 +81,8 @@ func (c *mySQLBackups) List(opts v1.ListOptions) (result *v1alpha1.MySQLBackupLi return } -// Watch returns a watch.Interface that watches the requested mySQLBackups. -func (c *mySQLBackups) Watch(opts v1.ListOptions) (watch.Interface, error) { +// Watch returns a watch.Interface that watches the requested backups. +func (c *backups) Watch(opts v1.ListOptions) (watch.Interface, error) { opts.Watch = true return c.client.Get(). Namespace(c.ns). @@ -91,33 +91,33 @@ func (c *mySQLBackups) Watch(opts v1.ListOptions) (watch.Interface, error) { Watch() } -// Create takes the representation of a mySQLBackup and creates it. Returns the server's representation of the mySQLBackup, and an error, if there is any. -func (c *mySQLBackups) Create(mySQLBackup *v1alpha1.MySQLBackup) (result *v1alpha1.MySQLBackup, err error) { - result = &v1alpha1.MySQLBackup{} +// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any. +func (c *backups) Create(backup *v1alpha1.Backup) (result *v1alpha1.Backup, err error) { + result = &v1alpha1.Backup{} err = c.client.Post(). Namespace(c.ns). Resource("mysqlbackups"). - Body(mySQLBackup). + Body(backup). Do(). Into(result) return } -// Update takes the representation of a mySQLBackup and updates it. Returns the server's representation of the mySQLBackup, and an error, if there is any. -func (c *mySQLBackups) Update(mySQLBackup *v1alpha1.MySQLBackup) (result *v1alpha1.MySQLBackup, err error) { - result = &v1alpha1.MySQLBackup{} +// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any. +func (c *backups) Update(backup *v1alpha1.Backup) (result *v1alpha1.Backup, err error) { + result = &v1alpha1.Backup{} err = c.client.Put(). Namespace(c.ns). Resource("mysqlbackups"). - Name(mySQLBackup.Name). - Body(mySQLBackup). + Name(backup.Name). + Body(backup). Do(). Into(result) return } -// Delete takes name of the mySQLBackup and deletes it. Returns an error if one occurs. -func (c *mySQLBackups) Delete(name string, options *v1.DeleteOptions) error { +// Delete takes name of the backup and deletes it. Returns an error if one occurs. +func (c *backups) Delete(name string, options *v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("mysqlbackups"). @@ -128,7 +128,7 @@ func (c *mySQLBackups) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *mySQLBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *backups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("mysqlbackups"). @@ -138,9 +138,9 @@ func (c *mySQLBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v Error() } -// Patch applies the patch and returns the patched mySQLBackup. -func (c *mySQLBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLBackup, err error) { - result = &v1alpha1.MySQLBackup{} +// Patch applies the patch and returns the patched backup. +func (c *backups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Backup, err error) { + result = &v1alpha1.Backup{} err = c.client.Patch(pt). Namespace(c.ns). Resource("mysqlbackups"). diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/backupschedule.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/backupschedule.go new file mode 100644 index 000000000..f4b1403f7 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/backupschedule.go @@ -0,0 +1,153 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 + +import ( + v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + scheme "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// BackupSchedulesGetter has a method to return a BackupScheduleInterface. +// A group's client should implement this interface. +type BackupSchedulesGetter interface { + BackupSchedules(namespace string) BackupScheduleInterface +} + +// BackupScheduleInterface has methods to work with BackupSchedule resources. +type BackupScheduleInterface interface { + Create(*v1alpha1.BackupSchedule) (*v1alpha1.BackupSchedule, error) + Update(*v1alpha1.BackupSchedule) (*v1alpha1.BackupSchedule, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.BackupSchedule, error) + List(opts v1.ListOptions) (*v1alpha1.BackupScheduleList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BackupSchedule, err error) + BackupScheduleExpansion +} + +// backupSchedules implements BackupScheduleInterface +type backupSchedules struct { + client rest.Interface + ns string +} + +// newBackupSchedules returns a BackupSchedules +func newBackupSchedules(c *MySQLV1alpha1Client, namespace string) *backupSchedules { + return &backupSchedules{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the backupSchedule, and returns the corresponding backupSchedule object, and an error if there is any. +func (c *backupSchedules) Get(name string, options v1.GetOptions) (result *v1alpha1.BackupSchedule, err error) { + result = &v1alpha1.BackupSchedule{} + err = c.client.Get(). + Namespace(c.ns). + Resource("mysqlbackupschedules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of BackupSchedules that match those selectors. +func (c *backupSchedules) List(opts v1.ListOptions) (result *v1alpha1.BackupScheduleList, err error) { + result = &v1alpha1.BackupScheduleList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("mysqlbackupschedules"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested backupSchedules. +func (c *backupSchedules) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("mysqlbackupschedules"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a backupSchedule and creates it. Returns the server's representation of the backupSchedule, and an error, if there is any. +func (c *backupSchedules) Create(backupSchedule *v1alpha1.BackupSchedule) (result *v1alpha1.BackupSchedule, err error) { + result = &v1alpha1.BackupSchedule{} + err = c.client.Post(). + Namespace(c.ns). + Resource("mysqlbackupschedules"). + Body(backupSchedule). + Do(). + Into(result) + return +} + +// Update takes the representation of a backupSchedule and updates it. Returns the server's representation of the backupSchedule, and an error, if there is any. +func (c *backupSchedules) Update(backupSchedule *v1alpha1.BackupSchedule) (result *v1alpha1.BackupSchedule, err error) { + result = &v1alpha1.BackupSchedule{} + err = c.client.Put(). + Namespace(c.ns). + Resource("mysqlbackupschedules"). + Name(backupSchedule.Name). + Body(backupSchedule). + Do(). + Into(result) + return +} + +// Delete takes name of the backupSchedule and deletes it. Returns an error if one occurs. +func (c *backupSchedules) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("mysqlbackupschedules"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *backupSchedules) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("mysqlbackupschedules"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched backupSchedule. +func (c *backupSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BackupSchedule, err error) { + result = &v1alpha1.BackupSchedule{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("mysqlbackupschedules"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/cluster.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/cluster.go new file mode 100644 index 000000000..4e07b611d --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/cluster.go @@ -0,0 +1,153 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 + +import ( + v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + scheme "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ClustersGetter has a method to return a ClusterInterface. +// A group's client should implement this interface. +type ClustersGetter interface { + Clusters(namespace string) ClusterInterface +} + +// ClusterInterface has methods to work with Cluster resources. +type ClusterInterface interface { + Create(*v1alpha1.Cluster) (*v1alpha1.Cluster, error) + Update(*v1alpha1.Cluster) (*v1alpha1.Cluster, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.Cluster, error) + List(opts v1.ListOptions) (*v1alpha1.ClusterList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) + ClusterExpansion +} + +// clusters implements ClusterInterface +type clusters struct { + client rest.Interface + ns string +} + +// newClusters returns a Clusters +func newClusters(c *MySQLV1alpha1Client, namespace string) *clusters { + return &clusters{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. +func (c *clusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) { + result = &v1alpha1.Cluster{} + err = c.client.Get(). + Namespace(c.ns). + Resource("mysqlclusters"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Clusters that match those selectors. +func (c *clusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) { + result = &v1alpha1.ClusterList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("mysqlclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusters. +func (c *clusters) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("mysqlclusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. +func (c *clusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { + result = &v1alpha1.Cluster{} + err = c.client.Post(). + Namespace(c.ns). + Resource("mysqlclusters"). + Body(cluster). + Do(). + Into(result) + return +} + +// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. +func (c *clusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { + result = &v1alpha1.Cluster{} + err = c.client.Put(). + Namespace(c.ns). + Resource("mysqlclusters"). + Name(cluster.Name). + Body(cluster). + Do(). + Into(result) + return +} + +// Delete takes name of the cluster and deletes it. Returns an error if one occurs. +func (c *clusters) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("mysqlclusters"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("mysqlclusters"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched cluster. +func (c *clusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) { + result = &v1alpha1.Cluster{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("mysqlclusters"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_backup.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_backup.go new file mode 100644 index 000000000..3ffe6f36b --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_backup.go @@ -0,0 +1,124 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 fake + +import ( + v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBackups implements BackupInterface +type FakeBackups struct { + Fake *FakeMySQLV1alpha1 + ns string +} + +var backupsResource = schema.GroupVersionResource{Group: "mysql.oracle.com", Version: "v1alpha1", Resource: "mysqlbackups"} + +var backupsKind = schema.GroupVersionKind{Group: "mysql.oracle.com", Version: "v1alpha1", Kind: "Backup"} + +// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any. +func (c *FakeBackups) Get(name string, options v1.GetOptions) (result *v1alpha1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(backupsResource, c.ns, name), &v1alpha1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Backup), err +} + +// List takes label and field selectors, and returns the list of Backups that match those selectors. +func (c *FakeBackups) List(opts v1.ListOptions) (result *v1alpha1.BackupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(backupsResource, backupsKind, c.ns, opts), &v1alpha1.BackupList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.BackupList{} + for _, item := range obj.(*v1alpha1.BackupList).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 backups. +func (c *FakeBackups) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(backupsResource, c.ns, opts)) + +} + +// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any. +func (c *FakeBackups) Create(backup *v1alpha1.Backup) (result *v1alpha1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(backupsResource, c.ns, backup), &v1alpha1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Backup), err +} + +// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any. +func (c *FakeBackups) Update(backup *v1alpha1.Backup) (result *v1alpha1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(backupsResource, c.ns, backup), &v1alpha1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Backup), err +} + +// Delete takes name of the backup and deletes it. Returns an error if one occurs. +func (c *FakeBackups) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(backupsResource, c.ns, name), &v1alpha1.Backup{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(backupsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.BackupList{}) + return err +} + +// Patch applies the patch and returns the patched backup. +func (c *FakeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backupsResource, c.ns, name, data, subresources...), &v1alpha1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Backup), err +} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_backupschedule.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_backupschedule.go new file mode 100644 index 000000000..2e2ae8b4f --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_backupschedule.go @@ -0,0 +1,124 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 fake + +import ( + v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBackupSchedules implements BackupScheduleInterface +type FakeBackupSchedules struct { + Fake *FakeMySQLV1alpha1 + ns string +} + +var backupschedulesResource = schema.GroupVersionResource{Group: "mysql.oracle.com", Version: "v1alpha1", Resource: "mysqlbackupschedules"} + +var backupschedulesKind = schema.GroupVersionKind{Group: "mysql.oracle.com", Version: "v1alpha1", Kind: "BackupSchedule"} + +// Get takes name of the backupSchedule, and returns the corresponding backupSchedule object, and an error if there is any. +func (c *FakeBackupSchedules) Get(name string, options v1.GetOptions) (result *v1alpha1.BackupSchedule, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(backupschedulesResource, c.ns, name), &v1alpha1.BackupSchedule{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BackupSchedule), err +} + +// List takes label and field selectors, and returns the list of BackupSchedules that match those selectors. +func (c *FakeBackupSchedules) List(opts v1.ListOptions) (result *v1alpha1.BackupScheduleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(backupschedulesResource, backupschedulesKind, c.ns, opts), &v1alpha1.BackupScheduleList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.BackupScheduleList{} + for _, item := range obj.(*v1alpha1.BackupScheduleList).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 backupSchedules. +func (c *FakeBackupSchedules) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(backupschedulesResource, c.ns, opts)) + +} + +// Create takes the representation of a backupSchedule and creates it. Returns the server's representation of the backupSchedule, and an error, if there is any. +func (c *FakeBackupSchedules) Create(backupSchedule *v1alpha1.BackupSchedule) (result *v1alpha1.BackupSchedule, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(backupschedulesResource, c.ns, backupSchedule), &v1alpha1.BackupSchedule{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BackupSchedule), err +} + +// Update takes the representation of a backupSchedule and updates it. Returns the server's representation of the backupSchedule, and an error, if there is any. +func (c *FakeBackupSchedules) Update(backupSchedule *v1alpha1.BackupSchedule) (result *v1alpha1.BackupSchedule, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(backupschedulesResource, c.ns, backupSchedule), &v1alpha1.BackupSchedule{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BackupSchedule), err +} + +// Delete takes name of the backupSchedule and deletes it. Returns an error if one occurs. +func (c *FakeBackupSchedules) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(backupschedulesResource, c.ns, name), &v1alpha1.BackupSchedule{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackupSchedules) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(backupschedulesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.BackupScheduleList{}) + return err +} + +// Patch applies the patch and returns the patched backupSchedule. +func (c *FakeBackupSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BackupSchedule, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backupschedulesResource, c.ns, name, data, subresources...), &v1alpha1.BackupSchedule{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BackupSchedule), err +} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_cluster.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_cluster.go new file mode 100644 index 000000000..a382c2a0c --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_cluster.go @@ -0,0 +1,124 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 fake + +import ( + v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusters implements ClusterInterface +type FakeClusters struct { + Fake *FakeMySQLV1alpha1 + ns string +} + +var clustersResource = schema.GroupVersionResource{Group: "mysql.oracle.com", Version: "v1alpha1", Resource: "mysqlclusters"} + +var clustersKind = schema.GroupVersionKind{Group: "mysql.oracle.com", Version: "v1alpha1", Kind: "Cluster"} + +// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. +func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1alpha1.Cluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Cluster), err +} + +// List takes label and field selectors, and returns the list of Clusters that match those selectors. +func (c *FakeClusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1alpha1.ClusterList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.ClusterList{} + for _, item := range obj.(*v1alpha1.ClusterList).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 clusters. +func (c *FakeClusters) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clustersResource, c.ns, opts)) + +} + +// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. +func (c *FakeClusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Cluster), err +} + +// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. +func (c *FakeClusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Cluster), err +} + +// Delete takes name of the cluster and deletes it. Returns an error if one occurs. +func (c *FakeClusters) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(clustersResource, c.ns, name), &v1alpha1.Cluster{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clustersResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.ClusterList{}) + return err +} + +// Patch applies the patch and returns the patched cluster. +func (c *FakeClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, data, subresources...), &v1alpha1.Cluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Cluster), err +} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysql_client.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysql_client.go index 5c9cdbd0d..6afc5824a 100644 --- a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysql_client.go +++ b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysql_client.go @@ -20,29 +20,29 @@ import ( testing "k8s.io/client-go/testing" ) -type FakeMysqlV1alpha1 struct { +type FakeMySQLV1alpha1 struct { *testing.Fake } -func (c *FakeMysqlV1alpha1) MySQLBackups(namespace string) v1alpha1.MySQLBackupInterface { - return &FakeMySQLBackups{c, namespace} +func (c *FakeMySQLV1alpha1) Backups(namespace string) v1alpha1.BackupInterface { + return &FakeBackups{c, namespace} } -func (c *FakeMysqlV1alpha1) MySQLBackupSchedules(namespace string) v1alpha1.MySQLBackupScheduleInterface { - return &FakeMySQLBackupSchedules{c, namespace} +func (c *FakeMySQLV1alpha1) BackupSchedules(namespace string) v1alpha1.BackupScheduleInterface { + return &FakeBackupSchedules{c, namespace} } -func (c *FakeMysqlV1alpha1) MySQLClusters(namespace string) v1alpha1.MySQLClusterInterface { - return &FakeMySQLClusters{c, namespace} +func (c *FakeMySQLV1alpha1) Clusters(namespace string) v1alpha1.ClusterInterface { + return &FakeClusters{c, namespace} } -func (c *FakeMysqlV1alpha1) MySQLRestores(namespace string) v1alpha1.MySQLRestoreInterface { - return &FakeMySQLRestores{c, namespace} +func (c *FakeMySQLV1alpha1) Restores(namespace string) v1alpha1.RestoreInterface { + return &FakeRestores{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeMysqlV1alpha1) RESTClient() rest.Interface { +func (c *FakeMySQLV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlbackup.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlbackup.go deleted file mode 100644 index 781868bbb..000000000 --- a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlbackup.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 fake - -import ( - v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeMySQLBackups implements MySQLBackupInterface -type FakeMySQLBackups struct { - Fake *FakeMysqlV1alpha1 - ns string -} - -var mysqlbackupsResource = schema.GroupVersionResource{Group: "mysql.oracle.com", Version: "v1alpha1", Resource: "mysqlbackups"} - -var mysqlbackupsKind = schema.GroupVersionKind{Group: "mysql.oracle.com", Version: "v1alpha1", Kind: "MySQLBackup"} - -// Get takes name of the mySQLBackup, and returns the corresponding mySQLBackup object, and an error if there is any. -func (c *FakeMySQLBackups) Get(name string, options v1.GetOptions) (result *v1alpha1.MySQLBackup, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(mysqlbackupsResource, c.ns, name), &v1alpha1.MySQLBackup{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLBackup), err -} - -// List takes label and field selectors, and returns the list of MySQLBackups that match those selectors. -func (c *FakeMySQLBackups) List(opts v1.ListOptions) (result *v1alpha1.MySQLBackupList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(mysqlbackupsResource, mysqlbackupsKind, c.ns, opts), &v1alpha1.MySQLBackupList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.MySQLBackupList{} - for _, item := range obj.(*v1alpha1.MySQLBackupList).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 mySQLBackups. -func (c *FakeMySQLBackups) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(mysqlbackupsResource, c.ns, opts)) - -} - -// Create takes the representation of a mySQLBackup and creates it. Returns the server's representation of the mySQLBackup, and an error, if there is any. -func (c *FakeMySQLBackups) Create(mySQLBackup *v1alpha1.MySQLBackup) (result *v1alpha1.MySQLBackup, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(mysqlbackupsResource, c.ns, mySQLBackup), &v1alpha1.MySQLBackup{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLBackup), err -} - -// Update takes the representation of a mySQLBackup and updates it. Returns the server's representation of the mySQLBackup, and an error, if there is any. -func (c *FakeMySQLBackups) Update(mySQLBackup *v1alpha1.MySQLBackup) (result *v1alpha1.MySQLBackup, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(mysqlbackupsResource, c.ns, mySQLBackup), &v1alpha1.MySQLBackup{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLBackup), err -} - -// Delete takes name of the mySQLBackup and deletes it. Returns an error if one occurs. -func (c *FakeMySQLBackups) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(mysqlbackupsResource, c.ns, name), &v1alpha1.MySQLBackup{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeMySQLBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(mysqlbackupsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.MySQLBackupList{}) - return err -} - -// Patch applies the patch and returns the patched mySQLBackup. -func (c *FakeMySQLBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLBackup, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(mysqlbackupsResource, c.ns, name, data, subresources...), &v1alpha1.MySQLBackup{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLBackup), err -} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlbackupschedule.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlbackupschedule.go deleted file mode 100644 index 30e7a3a1c..000000000 --- a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlbackupschedule.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 fake - -import ( - v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeMySQLBackupSchedules implements MySQLBackupScheduleInterface -type FakeMySQLBackupSchedules struct { - Fake *FakeMysqlV1alpha1 - ns string -} - -var mysqlbackupschedulesResource = schema.GroupVersionResource{Group: "mysql.oracle.com", Version: "v1alpha1", Resource: "mysqlbackupschedules"} - -var mysqlbackupschedulesKind = schema.GroupVersionKind{Group: "mysql.oracle.com", Version: "v1alpha1", Kind: "MySQLBackupSchedule"} - -// Get takes name of the mySQLBackupSchedule, and returns the corresponding mySQLBackupSchedule object, and an error if there is any. -func (c *FakeMySQLBackupSchedules) Get(name string, options v1.GetOptions) (result *v1alpha1.MySQLBackupSchedule, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(mysqlbackupschedulesResource, c.ns, name), &v1alpha1.MySQLBackupSchedule{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLBackupSchedule), err -} - -// List takes label and field selectors, and returns the list of MySQLBackupSchedules that match those selectors. -func (c *FakeMySQLBackupSchedules) List(opts v1.ListOptions) (result *v1alpha1.MySQLBackupScheduleList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(mysqlbackupschedulesResource, mysqlbackupschedulesKind, c.ns, opts), &v1alpha1.MySQLBackupScheduleList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.MySQLBackupScheduleList{} - for _, item := range obj.(*v1alpha1.MySQLBackupScheduleList).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 mySQLBackupSchedules. -func (c *FakeMySQLBackupSchedules) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(mysqlbackupschedulesResource, c.ns, opts)) - -} - -// Create takes the representation of a mySQLBackupSchedule and creates it. Returns the server's representation of the mySQLBackupSchedule, and an error, if there is any. -func (c *FakeMySQLBackupSchedules) Create(mySQLBackupSchedule *v1alpha1.MySQLBackupSchedule) (result *v1alpha1.MySQLBackupSchedule, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(mysqlbackupschedulesResource, c.ns, mySQLBackupSchedule), &v1alpha1.MySQLBackupSchedule{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLBackupSchedule), err -} - -// Update takes the representation of a mySQLBackupSchedule and updates it. Returns the server's representation of the mySQLBackupSchedule, and an error, if there is any. -func (c *FakeMySQLBackupSchedules) Update(mySQLBackupSchedule *v1alpha1.MySQLBackupSchedule) (result *v1alpha1.MySQLBackupSchedule, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(mysqlbackupschedulesResource, c.ns, mySQLBackupSchedule), &v1alpha1.MySQLBackupSchedule{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLBackupSchedule), err -} - -// Delete takes name of the mySQLBackupSchedule and deletes it. Returns an error if one occurs. -func (c *FakeMySQLBackupSchedules) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(mysqlbackupschedulesResource, c.ns, name), &v1alpha1.MySQLBackupSchedule{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeMySQLBackupSchedules) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(mysqlbackupschedulesResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.MySQLBackupScheduleList{}) - return err -} - -// Patch applies the patch and returns the patched mySQLBackupSchedule. -func (c *FakeMySQLBackupSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLBackupSchedule, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(mysqlbackupschedulesResource, c.ns, name, data, subresources...), &v1alpha1.MySQLBackupSchedule{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLBackupSchedule), err -} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlcluster.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlcluster.go deleted file mode 100644 index fa89ec319..000000000 --- a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlcluster.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 fake - -import ( - v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeMySQLClusters implements MySQLClusterInterface -type FakeMySQLClusters struct { - Fake *FakeMysqlV1alpha1 - ns string -} - -var mysqlclustersResource = schema.GroupVersionResource{Group: "mysql.oracle.com", Version: "v1alpha1", Resource: "mysqlclusters"} - -var mysqlclustersKind = schema.GroupVersionKind{Group: "mysql.oracle.com", Version: "v1alpha1", Kind: "MySQLCluster"} - -// Get takes name of the mySQLCluster, and returns the corresponding mySQLCluster object, and an error if there is any. -func (c *FakeMySQLClusters) Get(name string, options v1.GetOptions) (result *v1alpha1.MySQLCluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(mysqlclustersResource, c.ns, name), &v1alpha1.MySQLCluster{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLCluster), err -} - -// List takes label and field selectors, and returns the list of MySQLClusters that match those selectors. -func (c *FakeMySQLClusters) List(opts v1.ListOptions) (result *v1alpha1.MySQLClusterList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(mysqlclustersResource, mysqlclustersKind, c.ns, opts), &v1alpha1.MySQLClusterList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.MySQLClusterList{} - for _, item := range obj.(*v1alpha1.MySQLClusterList).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 mySQLClusters. -func (c *FakeMySQLClusters) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(mysqlclustersResource, c.ns, opts)) - -} - -// Create takes the representation of a mySQLCluster and creates it. Returns the server's representation of the mySQLCluster, and an error, if there is any. -func (c *FakeMySQLClusters) Create(mySQLCluster *v1alpha1.MySQLCluster) (result *v1alpha1.MySQLCluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(mysqlclustersResource, c.ns, mySQLCluster), &v1alpha1.MySQLCluster{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLCluster), err -} - -// Update takes the representation of a mySQLCluster and updates it. Returns the server's representation of the mySQLCluster, and an error, if there is any. -func (c *FakeMySQLClusters) Update(mySQLCluster *v1alpha1.MySQLCluster) (result *v1alpha1.MySQLCluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(mysqlclustersResource, c.ns, mySQLCluster), &v1alpha1.MySQLCluster{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLCluster), err -} - -// Delete takes name of the mySQLCluster and deletes it. Returns an error if one occurs. -func (c *FakeMySQLClusters) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(mysqlclustersResource, c.ns, name), &v1alpha1.MySQLCluster{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeMySQLClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(mysqlclustersResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.MySQLClusterList{}) - return err -} - -// Patch applies the patch and returns the patched mySQLCluster. -func (c *FakeMySQLClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLCluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(mysqlclustersResource, c.ns, name, data, subresources...), &v1alpha1.MySQLCluster{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLCluster), err -} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlrestore.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlrestore.go deleted file mode 100644 index 33a438201..000000000 --- a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_mysqlrestore.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 fake - -import ( - v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeMySQLRestores implements MySQLRestoreInterface -type FakeMySQLRestores struct { - Fake *FakeMysqlV1alpha1 - ns string -} - -var mysqlrestoresResource = schema.GroupVersionResource{Group: "mysql.oracle.com", Version: "v1alpha1", Resource: "mysqlrestores"} - -var mysqlrestoresKind = schema.GroupVersionKind{Group: "mysql.oracle.com", Version: "v1alpha1", Kind: "MySQLRestore"} - -// Get takes name of the mySQLRestore, and returns the corresponding mySQLRestore object, and an error if there is any. -func (c *FakeMySQLRestores) Get(name string, options v1.GetOptions) (result *v1alpha1.MySQLRestore, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(mysqlrestoresResource, c.ns, name), &v1alpha1.MySQLRestore{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLRestore), err -} - -// List takes label and field selectors, and returns the list of MySQLRestores that match those selectors. -func (c *FakeMySQLRestores) List(opts v1.ListOptions) (result *v1alpha1.MySQLRestoreList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(mysqlrestoresResource, mysqlrestoresKind, c.ns, opts), &v1alpha1.MySQLRestoreList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.MySQLRestoreList{} - for _, item := range obj.(*v1alpha1.MySQLRestoreList).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 mySQLRestores. -func (c *FakeMySQLRestores) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(mysqlrestoresResource, c.ns, opts)) - -} - -// Create takes the representation of a mySQLRestore and creates it. Returns the server's representation of the mySQLRestore, and an error, if there is any. -func (c *FakeMySQLRestores) Create(mySQLRestore *v1alpha1.MySQLRestore) (result *v1alpha1.MySQLRestore, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(mysqlrestoresResource, c.ns, mySQLRestore), &v1alpha1.MySQLRestore{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLRestore), err -} - -// Update takes the representation of a mySQLRestore and updates it. Returns the server's representation of the mySQLRestore, and an error, if there is any. -func (c *FakeMySQLRestores) Update(mySQLRestore *v1alpha1.MySQLRestore) (result *v1alpha1.MySQLRestore, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(mysqlrestoresResource, c.ns, mySQLRestore), &v1alpha1.MySQLRestore{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLRestore), err -} - -// Delete takes name of the mySQLRestore and deletes it. Returns an error if one occurs. -func (c *FakeMySQLRestores) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(mysqlrestoresResource, c.ns, name), &v1alpha1.MySQLRestore{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeMySQLRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(mysqlrestoresResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.MySQLRestoreList{}) - return err -} - -// Patch applies the patch and returns the patched mySQLRestore. -func (c *FakeMySQLRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLRestore, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(mysqlrestoresResource, c.ns, name, data, subresources...), &v1alpha1.MySQLRestore{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MySQLRestore), err -} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_restore.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_restore.go new file mode 100644 index 000000000..664abb0de --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/fake/fake_restore.go @@ -0,0 +1,124 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 fake + +import ( + v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeRestores implements RestoreInterface +type FakeRestores struct { + Fake *FakeMySQLV1alpha1 + ns string +} + +var restoresResource = schema.GroupVersionResource{Group: "mysql.oracle.com", Version: "v1alpha1", Resource: "mysqlrestores"} + +var restoresKind = schema.GroupVersionKind{Group: "mysql.oracle.com", Version: "v1alpha1", Kind: "Restore"} + +// Get takes name of the restore, and returns the corresponding restore object, and an error if there is any. +func (c *FakeRestores) Get(name string, options v1.GetOptions) (result *v1alpha1.Restore, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(restoresResource, c.ns, name), &v1alpha1.Restore{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Restore), err +} + +// List takes label and field selectors, and returns the list of Restores that match those selectors. +func (c *FakeRestores) List(opts v1.ListOptions) (result *v1alpha1.RestoreList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(restoresResource, restoresKind, c.ns, opts), &v1alpha1.RestoreList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.RestoreList{} + for _, item := range obj.(*v1alpha1.RestoreList).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 restores. +func (c *FakeRestores) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(restoresResource, c.ns, opts)) + +} + +// Create takes the representation of a restore and creates it. Returns the server's representation of the restore, and an error, if there is any. +func (c *FakeRestores) Create(restore *v1alpha1.Restore) (result *v1alpha1.Restore, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(restoresResource, c.ns, restore), &v1alpha1.Restore{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Restore), err +} + +// Update takes the representation of a restore and updates it. Returns the server's representation of the restore, and an error, if there is any. +func (c *FakeRestores) Update(restore *v1alpha1.Restore) (result *v1alpha1.Restore, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(restoresResource, c.ns, restore), &v1alpha1.Restore{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Restore), err +} + +// Delete takes name of the restore and deletes it. Returns an error if one occurs. +func (c *FakeRestores) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(restoresResource, c.ns, name), &v1alpha1.Restore{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(restoresResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.RestoreList{}) + return err +} + +// Patch applies the patch and returns the patched restore. +func (c *FakeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Restore, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(restoresResource, c.ns, name, data, subresources...), &v1alpha1.Restore{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Restore), err +} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/generated_expansion.go index be57ccf23..874c05976 100644 --- a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/generated_expansion.go @@ -14,10 +14,10 @@ package v1alpha1 -type MySQLBackupExpansion interface{} +type BackupExpansion interface{} -type MySQLBackupScheduleExpansion interface{} +type BackupScheduleExpansion interface{} -type MySQLClusterExpansion interface{} +type ClusterExpansion interface{} -type MySQLRestoreExpansion interface{} +type RestoreExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysql_client.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysql_client.go index 0c61b24a3..615903b2e 100644 --- a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysql_client.go +++ b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysql_client.go @@ -21,37 +21,37 @@ import ( rest "k8s.io/client-go/rest" ) -type MysqlV1alpha1Interface interface { +type MySQLV1alpha1Interface interface { RESTClient() rest.Interface - MySQLBackupsGetter - MySQLBackupSchedulesGetter - MySQLClustersGetter - MySQLRestoresGetter + BackupsGetter + BackupSchedulesGetter + ClustersGetter + RestoresGetter } -// MysqlV1alpha1Client is used to interact with features provided by the mysql.oracle.com group. -type MysqlV1alpha1Client struct { +// MySQLV1alpha1Client is used to interact with features provided by the mysql.oracle.com group. +type MySQLV1alpha1Client struct { restClient rest.Interface } -func (c *MysqlV1alpha1Client) MySQLBackups(namespace string) MySQLBackupInterface { - return newMySQLBackups(c, namespace) +func (c *MySQLV1alpha1Client) Backups(namespace string) BackupInterface { + return newBackups(c, namespace) } -func (c *MysqlV1alpha1Client) MySQLBackupSchedules(namespace string) MySQLBackupScheduleInterface { - return newMySQLBackupSchedules(c, namespace) +func (c *MySQLV1alpha1Client) BackupSchedules(namespace string) BackupScheduleInterface { + return newBackupSchedules(c, namespace) } -func (c *MysqlV1alpha1Client) MySQLClusters(namespace string) MySQLClusterInterface { - return newMySQLClusters(c, namespace) +func (c *MySQLV1alpha1Client) Clusters(namespace string) ClusterInterface { + return newClusters(c, namespace) } -func (c *MysqlV1alpha1Client) MySQLRestores(namespace string) MySQLRestoreInterface { - return newMySQLRestores(c, namespace) +func (c *MySQLV1alpha1Client) Restores(namespace string) RestoreInterface { + return newRestores(c, namespace) } -// NewForConfig creates a new MysqlV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*MysqlV1alpha1Client, error) { +// NewForConfig creates a new MySQLV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*MySQLV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -60,12 +60,12 @@ func NewForConfig(c *rest.Config) (*MysqlV1alpha1Client, error) { if err != nil { return nil, err } - return &MysqlV1alpha1Client{client}, nil + return &MySQLV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new MysqlV1alpha1Client for the given config and +// NewForConfigOrDie creates a new MySQLV1alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *MysqlV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *MySQLV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -73,9 +73,9 @@ func NewForConfigOrDie(c *rest.Config) *MysqlV1alpha1Client { return client } -// New creates a new MysqlV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *MysqlV1alpha1Client { - return &MysqlV1alpha1Client{c} +// New creates a new MySQLV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *MySQLV1alpha1Client { + return &MySQLV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { @@ -93,7 +93,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *MysqlV1alpha1Client) RESTClient() rest.Interface { +func (c *MySQLV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlbackupschedule.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlbackupschedule.go deleted file mode 100644 index 0427586de..000000000 --- a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlbackupschedule.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - scheme "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// MySQLBackupSchedulesGetter has a method to return a MySQLBackupScheduleInterface. -// A group's client should implement this interface. -type MySQLBackupSchedulesGetter interface { - MySQLBackupSchedules(namespace string) MySQLBackupScheduleInterface -} - -// MySQLBackupScheduleInterface has methods to work with MySQLBackupSchedule resources. -type MySQLBackupScheduleInterface interface { - Create(*v1alpha1.MySQLBackupSchedule) (*v1alpha1.MySQLBackupSchedule, error) - Update(*v1alpha1.MySQLBackupSchedule) (*v1alpha1.MySQLBackupSchedule, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.MySQLBackupSchedule, error) - List(opts v1.ListOptions) (*v1alpha1.MySQLBackupScheduleList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLBackupSchedule, err error) - MySQLBackupScheduleExpansion -} - -// mySQLBackupSchedules implements MySQLBackupScheduleInterface -type mySQLBackupSchedules struct { - client rest.Interface - ns string -} - -// newMySQLBackupSchedules returns a MySQLBackupSchedules -func newMySQLBackupSchedules(c *MysqlV1alpha1Client, namespace string) *mySQLBackupSchedules { - return &mySQLBackupSchedules{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the mySQLBackupSchedule, and returns the corresponding mySQLBackupSchedule object, and an error if there is any. -func (c *mySQLBackupSchedules) Get(name string, options v1.GetOptions) (result *v1alpha1.MySQLBackupSchedule, err error) { - result = &v1alpha1.MySQLBackupSchedule{} - err = c.client.Get(). - Namespace(c.ns). - Resource("mysqlbackupschedules"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of MySQLBackupSchedules that match those selectors. -func (c *mySQLBackupSchedules) List(opts v1.ListOptions) (result *v1alpha1.MySQLBackupScheduleList, err error) { - result = &v1alpha1.MySQLBackupScheduleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("mysqlbackupschedules"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested mySQLBackupSchedules. -func (c *mySQLBackupSchedules) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("mysqlbackupschedules"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a mySQLBackupSchedule and creates it. Returns the server's representation of the mySQLBackupSchedule, and an error, if there is any. -func (c *mySQLBackupSchedules) Create(mySQLBackupSchedule *v1alpha1.MySQLBackupSchedule) (result *v1alpha1.MySQLBackupSchedule, err error) { - result = &v1alpha1.MySQLBackupSchedule{} - err = c.client.Post(). - Namespace(c.ns). - Resource("mysqlbackupschedules"). - Body(mySQLBackupSchedule). - Do(). - Into(result) - return -} - -// Update takes the representation of a mySQLBackupSchedule and updates it. Returns the server's representation of the mySQLBackupSchedule, and an error, if there is any. -func (c *mySQLBackupSchedules) Update(mySQLBackupSchedule *v1alpha1.MySQLBackupSchedule) (result *v1alpha1.MySQLBackupSchedule, err error) { - result = &v1alpha1.MySQLBackupSchedule{} - err = c.client.Put(). - Namespace(c.ns). - Resource("mysqlbackupschedules"). - Name(mySQLBackupSchedule.Name). - Body(mySQLBackupSchedule). - Do(). - Into(result) - return -} - -// Delete takes name of the mySQLBackupSchedule and deletes it. Returns an error if one occurs. -func (c *mySQLBackupSchedules) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("mysqlbackupschedules"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *mySQLBackupSchedules) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("mysqlbackupschedules"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched mySQLBackupSchedule. -func (c *mySQLBackupSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLBackupSchedule, err error) { - result = &v1alpha1.MySQLBackupSchedule{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("mysqlbackupschedules"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlcluster.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlcluster.go deleted file mode 100644 index 443540c43..000000000 --- a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlcluster.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - scheme "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// MySQLClustersGetter has a method to return a MySQLClusterInterface. -// A group's client should implement this interface. -type MySQLClustersGetter interface { - MySQLClusters(namespace string) MySQLClusterInterface -} - -// MySQLClusterInterface has methods to work with MySQLCluster resources. -type MySQLClusterInterface interface { - Create(*v1alpha1.MySQLCluster) (*v1alpha1.MySQLCluster, error) - Update(*v1alpha1.MySQLCluster) (*v1alpha1.MySQLCluster, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.MySQLCluster, error) - List(opts v1.ListOptions) (*v1alpha1.MySQLClusterList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLCluster, err error) - MySQLClusterExpansion -} - -// mySQLClusters implements MySQLClusterInterface -type mySQLClusters struct { - client rest.Interface - ns string -} - -// newMySQLClusters returns a MySQLClusters -func newMySQLClusters(c *MysqlV1alpha1Client, namespace string) *mySQLClusters { - return &mySQLClusters{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the mySQLCluster, and returns the corresponding mySQLCluster object, and an error if there is any. -func (c *mySQLClusters) Get(name string, options v1.GetOptions) (result *v1alpha1.MySQLCluster, err error) { - result = &v1alpha1.MySQLCluster{} - err = c.client.Get(). - Namespace(c.ns). - Resource("mysqlclusters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of MySQLClusters that match those selectors. -func (c *mySQLClusters) List(opts v1.ListOptions) (result *v1alpha1.MySQLClusterList, err error) { - result = &v1alpha1.MySQLClusterList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("mysqlclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested mySQLClusters. -func (c *mySQLClusters) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("mysqlclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a mySQLCluster and creates it. Returns the server's representation of the mySQLCluster, and an error, if there is any. -func (c *mySQLClusters) Create(mySQLCluster *v1alpha1.MySQLCluster) (result *v1alpha1.MySQLCluster, err error) { - result = &v1alpha1.MySQLCluster{} - err = c.client.Post(). - Namespace(c.ns). - Resource("mysqlclusters"). - Body(mySQLCluster). - Do(). - Into(result) - return -} - -// Update takes the representation of a mySQLCluster and updates it. Returns the server's representation of the mySQLCluster, and an error, if there is any. -func (c *mySQLClusters) Update(mySQLCluster *v1alpha1.MySQLCluster) (result *v1alpha1.MySQLCluster, err error) { - result = &v1alpha1.MySQLCluster{} - err = c.client.Put(). - Namespace(c.ns). - Resource("mysqlclusters"). - Name(mySQLCluster.Name). - Body(mySQLCluster). - Do(). - Into(result) - return -} - -// Delete takes name of the mySQLCluster and deletes it. Returns an error if one occurs. -func (c *mySQLClusters) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("mysqlclusters"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *mySQLClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("mysqlclusters"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched mySQLCluster. -func (c *mySQLClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLCluster, err error) { - result = &v1alpha1.MySQLCluster{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("mysqlclusters"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlrestore.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlrestore.go deleted file mode 100644 index 8b71eaaba..000000000 --- a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/mysqlrestore.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 - -import ( - v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - scheme "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// MySQLRestoresGetter has a method to return a MySQLRestoreInterface. -// A group's client should implement this interface. -type MySQLRestoresGetter interface { - MySQLRestores(namespace string) MySQLRestoreInterface -} - -// MySQLRestoreInterface has methods to work with MySQLRestore resources. -type MySQLRestoreInterface interface { - Create(*v1alpha1.MySQLRestore) (*v1alpha1.MySQLRestore, error) - Update(*v1alpha1.MySQLRestore) (*v1alpha1.MySQLRestore, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.MySQLRestore, error) - List(opts v1.ListOptions) (*v1alpha1.MySQLRestoreList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLRestore, err error) - MySQLRestoreExpansion -} - -// mySQLRestores implements MySQLRestoreInterface -type mySQLRestores struct { - client rest.Interface - ns string -} - -// newMySQLRestores returns a MySQLRestores -func newMySQLRestores(c *MysqlV1alpha1Client, namespace string) *mySQLRestores { - return &mySQLRestores{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the mySQLRestore, and returns the corresponding mySQLRestore object, and an error if there is any. -func (c *mySQLRestores) Get(name string, options v1.GetOptions) (result *v1alpha1.MySQLRestore, err error) { - result = &v1alpha1.MySQLRestore{} - err = c.client.Get(). - Namespace(c.ns). - Resource("mysqlrestores"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of MySQLRestores that match those selectors. -func (c *mySQLRestores) List(opts v1.ListOptions) (result *v1alpha1.MySQLRestoreList, err error) { - result = &v1alpha1.MySQLRestoreList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("mysqlrestores"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested mySQLRestores. -func (c *mySQLRestores) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("mysqlrestores"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a mySQLRestore and creates it. Returns the server's representation of the mySQLRestore, and an error, if there is any. -func (c *mySQLRestores) Create(mySQLRestore *v1alpha1.MySQLRestore) (result *v1alpha1.MySQLRestore, err error) { - result = &v1alpha1.MySQLRestore{} - err = c.client.Post(). - Namespace(c.ns). - Resource("mysqlrestores"). - Body(mySQLRestore). - Do(). - Into(result) - return -} - -// Update takes the representation of a mySQLRestore and updates it. Returns the server's representation of the mySQLRestore, and an error, if there is any. -func (c *mySQLRestores) Update(mySQLRestore *v1alpha1.MySQLRestore) (result *v1alpha1.MySQLRestore, err error) { - result = &v1alpha1.MySQLRestore{} - err = c.client.Put(). - Namespace(c.ns). - Resource("mysqlrestores"). - Name(mySQLRestore.Name). - Body(mySQLRestore). - Do(). - Into(result) - return -} - -// Delete takes name of the mySQLRestore and deletes it. Returns an error if one occurs. -func (c *mySQLRestores) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("mysqlrestores"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *mySQLRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("mysqlrestores"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched mySQLRestore. -func (c *mySQLRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MySQLRestore, err error) { - result = &v1alpha1.MySQLRestore{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("mysqlrestores"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/restore.go b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/restore.go new file mode 100644 index 000000000..827cb4ff7 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/mysql/v1alpha1/restore.go @@ -0,0 +1,153 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 + +import ( + v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + scheme "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// RestoresGetter has a method to return a RestoreInterface. +// A group's client should implement this interface. +type RestoresGetter interface { + Restores(namespace string) RestoreInterface +} + +// RestoreInterface has methods to work with Restore resources. +type RestoreInterface interface { + Create(*v1alpha1.Restore) (*v1alpha1.Restore, error) + Update(*v1alpha1.Restore) (*v1alpha1.Restore, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.Restore, error) + List(opts v1.ListOptions) (*v1alpha1.RestoreList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Restore, err error) + RestoreExpansion +} + +// restores implements RestoreInterface +type restores struct { + client rest.Interface + ns string +} + +// newRestores returns a Restores +func newRestores(c *MySQLV1alpha1Client, namespace string) *restores { + return &restores{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the restore, and returns the corresponding restore object, and an error if there is any. +func (c *restores) Get(name string, options v1.GetOptions) (result *v1alpha1.Restore, err error) { + result = &v1alpha1.Restore{} + err = c.client.Get(). + Namespace(c.ns). + Resource("mysqlrestores"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Restores that match those selectors. +func (c *restores) List(opts v1.ListOptions) (result *v1alpha1.RestoreList, err error) { + result = &v1alpha1.RestoreList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("mysqlrestores"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested restores. +func (c *restores) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("mysqlrestores"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a restore and creates it. Returns the server's representation of the restore, and an error, if there is any. +func (c *restores) Create(restore *v1alpha1.Restore) (result *v1alpha1.Restore, err error) { + result = &v1alpha1.Restore{} + err = c.client.Post(). + Namespace(c.ns). + Resource("mysqlrestores"). + Body(restore). + Do(). + Into(result) + return +} + +// Update takes the representation of a restore and updates it. Returns the server's representation of the restore, and an error, if there is any. +func (c *restores) Update(restore *v1alpha1.Restore) (result *v1alpha1.Restore, err error) { + result = &v1alpha1.Restore{} + err = c.client.Put(). + Namespace(c.ns). + Resource("mysqlrestores"). + Name(restore.Name). + Body(restore). + Do(). + Into(result) + return +} + +// Delete takes name of the restore and deletes it. Returns an error if one occurs. +func (c *restores) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("mysqlrestores"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *restores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("mysqlrestores"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched restore. +func (c *restores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Restore, err error) { + result = &v1alpha1.Restore{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("mysqlrestores"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go index 7f92a5337..c4903da85 100644 --- a/pkg/generated/informers/externalversions/factory.go +++ b/pkg/generated/informers/externalversions/factory.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// This file was automatically generated by informer-gen - package externalversions import ( @@ -121,9 +119,9 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - Mysql() mysql.Interface + MySQL() mysql.Interface } -func (f *sharedInformerFactory) Mysql() mysql.Interface { +func (f *sharedInformerFactory) MySQL() mysql.Interface { return mysql.New(f, f.namespace, f.tweakListOptions) } diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index 0b856984a..0fe4b8d5f 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// This file was automatically generated by informer-gen - package externalversions import ( @@ -51,14 +49,14 @@ func (f *genericInformer) Lister() cache.GenericLister { func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { // Group=mysql.oracle.com, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("mysqlbackups"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Mysql().V1alpha1().MySQLBackups().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("mysqlbackupschedules"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Mysql().V1alpha1().MySQLBackupSchedules().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("mysqlclusters"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Mysql().V1alpha1().MySQLClusters().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("mysqlrestores"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Mysql().V1alpha1().MySQLRestores().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("backups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.MySQL().V1alpha1().Backups().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("backupschedules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.MySQL().V1alpha1().BackupSchedules().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("clusters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.MySQL().V1alpha1().Clusters().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("restores"): + return &genericInformer{resource: resource.GroupResource(), informer: f.MySQL().V1alpha1().Restores().Informer()}, nil } diff --git a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go index aa63a4d7d..e3b2bc34f 100644 --- a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// This file was automatically generated by informer-gen - package internalinterfaces import ( diff --git a/pkg/generated/informers/externalversions/mysql/interface.go b/pkg/generated/informers/externalversions/mysql/interface.go index f60a95429..7fa729f64 100644 --- a/pkg/generated/informers/externalversions/mysql/interface.go +++ b/pkg/generated/informers/externalversions/mysql/interface.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// This file was automatically generated by informer-gen - package mysql import ( diff --git a/pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlbackupschedule.go b/pkg/generated/informers/externalversions/mysql/v1alpha1/backup.go similarity index 54% rename from pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlbackupschedule.go rename to pkg/generated/informers/externalversions/mysql/v1alpha1/backup.go index 811e3280f..87035b822 100644 --- a/pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlbackupschedule.go +++ b/pkg/generated/informers/externalversions/mysql/v1alpha1/backup.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// This file was automatically generated by informer-gen - package v1alpha1 import ( @@ -29,59 +27,59 @@ import ( cache "k8s.io/client-go/tools/cache" ) -// MySQLBackupScheduleInformer provides access to a shared informer and lister for -// MySQLBackupSchedules. -type MySQLBackupScheduleInformer interface { +// BackupInformer provides access to a shared informer and lister for +// Backups. +type BackupInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.MySQLBackupScheduleLister + Lister() v1alpha1.BackupLister } -type mySQLBackupScheduleInformer struct { +type backupInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewMySQLBackupScheduleInformer constructs a new informer for MySQLBackupSchedule type. +// NewBackupInformer constructs a new informer for Backup 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 NewMySQLBackupScheduleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredMySQLBackupScheduleInformer(client, namespace, resyncPeriod, indexers, nil) +func NewBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBackupInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredMySQLBackupScheduleInformer constructs a new informer for MySQLBackupSchedule type. +// NewFilteredBackupInformer constructs a new informer for Backup 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 NewFilteredMySQLBackupScheduleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredBackupInformer(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.MysqlV1alpha1().MySQLBackupSchedules(namespace).List(options) + return client.MySQLV1alpha1().Backups(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.MysqlV1alpha1().MySQLBackupSchedules(namespace).Watch(options) + return client.MySQLV1alpha1().Backups(namespace).Watch(options) }, }, - &mysql_v1alpha1.MySQLBackupSchedule{}, + &mysql_v1alpha1.Backup{}, resyncPeriod, indexers, ) } -func (f *mySQLBackupScheduleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredMySQLBackupScheduleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *backupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBackupInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *mySQLBackupScheduleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&mysql_v1alpha1.MySQLBackupSchedule{}, f.defaultInformer) +func (f *backupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&mysql_v1alpha1.Backup{}, f.defaultInformer) } -func (f *mySQLBackupScheduleInformer) Lister() v1alpha1.MySQLBackupScheduleLister { - return v1alpha1.NewMySQLBackupScheduleLister(f.Informer().GetIndexer()) +func (f *backupInformer) Lister() v1alpha1.BackupLister { + return v1alpha1.NewBackupLister(f.Informer().GetIndexer()) } diff --git a/pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlrestore.go b/pkg/generated/informers/externalversions/mysql/v1alpha1/backupschedule.go similarity index 57% rename from pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlrestore.go rename to pkg/generated/informers/externalversions/mysql/v1alpha1/backupschedule.go index feffef388..d29ea596f 100644 --- a/pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlrestore.go +++ b/pkg/generated/informers/externalversions/mysql/v1alpha1/backupschedule.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// This file was automatically generated by informer-gen - package v1alpha1 import ( @@ -29,59 +27,59 @@ import ( cache "k8s.io/client-go/tools/cache" ) -// MySQLRestoreInformer provides access to a shared informer and lister for -// MySQLRestores. -type MySQLRestoreInformer interface { +// BackupScheduleInformer provides access to a shared informer and lister for +// BackupSchedules. +type BackupScheduleInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.MySQLRestoreLister + Lister() v1alpha1.BackupScheduleLister } -type mySQLRestoreInformer struct { +type backupScheduleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewMySQLRestoreInformer constructs a new informer for MySQLRestore type. +// NewBackupScheduleInformer constructs a new informer for BackupSchedule 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 NewMySQLRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredMySQLRestoreInformer(client, namespace, resyncPeriod, indexers, nil) +func NewBackupScheduleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBackupScheduleInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredMySQLRestoreInformer constructs a new informer for MySQLRestore type. +// NewFilteredBackupScheduleInformer constructs a new informer for BackupSchedule 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 NewFilteredMySQLRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredBackupScheduleInformer(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.MysqlV1alpha1().MySQLRestores(namespace).List(options) + return client.MySQLV1alpha1().BackupSchedules(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.MysqlV1alpha1().MySQLRestores(namespace).Watch(options) + return client.MySQLV1alpha1().BackupSchedules(namespace).Watch(options) }, }, - &mysql_v1alpha1.MySQLRestore{}, + &mysql_v1alpha1.BackupSchedule{}, resyncPeriod, indexers, ) } -func (f *mySQLRestoreInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredMySQLRestoreInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *backupScheduleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBackupScheduleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *mySQLRestoreInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&mysql_v1alpha1.MySQLRestore{}, f.defaultInformer) +func (f *backupScheduleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&mysql_v1alpha1.BackupSchedule{}, f.defaultInformer) } -func (f *mySQLRestoreInformer) Lister() v1alpha1.MySQLRestoreLister { - return v1alpha1.NewMySQLRestoreLister(f.Informer().GetIndexer()) +func (f *backupScheduleInformer) Lister() v1alpha1.BackupScheduleLister { + return v1alpha1.NewBackupScheduleLister(f.Informer().GetIndexer()) } diff --git a/pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlcluster.go b/pkg/generated/informers/externalversions/mysql/v1alpha1/cluster.go similarity index 58% rename from pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlcluster.go rename to pkg/generated/informers/externalversions/mysql/v1alpha1/cluster.go index eb0856f98..1b1612833 100644 --- a/pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlcluster.go +++ b/pkg/generated/informers/externalversions/mysql/v1alpha1/cluster.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// This file was automatically generated by informer-gen - package v1alpha1 import ( @@ -29,59 +27,59 @@ import ( cache "k8s.io/client-go/tools/cache" ) -// MySQLClusterInformer provides access to a shared informer and lister for -// MySQLClusters. -type MySQLClusterInformer interface { +// ClusterInformer provides access to a shared informer and lister for +// Clusters. +type ClusterInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.MySQLClusterLister + Lister() v1alpha1.ClusterLister } -type mySQLClusterInformer struct { +type clusterInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewMySQLClusterInformer constructs a new informer for MySQLCluster type. +// NewClusterInformer constructs a new informer for Cluster 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 NewMySQLClusterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredMySQLClusterInformer(client, namespace, resyncPeriod, indexers, nil) +func NewClusterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredMySQLClusterInformer constructs a new informer for MySQLCluster type. +// NewFilteredClusterInformer constructs a new informer for Cluster 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 NewFilteredMySQLClusterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredClusterInformer(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.MysqlV1alpha1().MySQLClusters(namespace).List(options) + return client.MySQLV1alpha1().Clusters(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.MysqlV1alpha1().MySQLClusters(namespace).Watch(options) + return client.MySQLV1alpha1().Clusters(namespace).Watch(options) }, }, - &mysql_v1alpha1.MySQLCluster{}, + &mysql_v1alpha1.Cluster{}, resyncPeriod, indexers, ) } -func (f *mySQLClusterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredMySQLClusterInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *clusterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *mySQLClusterInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&mysql_v1alpha1.MySQLCluster{}, f.defaultInformer) +func (f *clusterInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&mysql_v1alpha1.Cluster{}, f.defaultInformer) } -func (f *mySQLClusterInformer) Lister() v1alpha1.MySQLClusterLister { - return v1alpha1.NewMySQLClusterLister(f.Informer().GetIndexer()) +func (f *clusterInformer) Lister() v1alpha1.ClusterLister { + return v1alpha1.NewClusterLister(f.Informer().GetIndexer()) } diff --git a/pkg/generated/informers/externalversions/mysql/v1alpha1/interface.go b/pkg/generated/informers/externalversions/mysql/v1alpha1/interface.go index 840533264..7d1cb163a 100644 --- a/pkg/generated/informers/externalversions/mysql/v1alpha1/interface.go +++ b/pkg/generated/informers/externalversions/mysql/v1alpha1/interface.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// This file was automatically generated by informer-gen - package v1alpha1 import ( @@ -22,14 +20,14 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // MySQLBackups returns a MySQLBackupInformer. - MySQLBackups() MySQLBackupInformer - // MySQLBackupSchedules returns a MySQLBackupScheduleInformer. - MySQLBackupSchedules() MySQLBackupScheduleInformer - // MySQLClusters returns a MySQLClusterInformer. - MySQLClusters() MySQLClusterInformer - // MySQLRestores returns a MySQLRestoreInformer. - MySQLRestores() MySQLRestoreInformer + // Backups returns a BackupInformer. + Backups() BackupInformer + // BackupSchedules returns a BackupScheduleInformer. + BackupSchedules() BackupScheduleInformer + // Clusters returns a ClusterInformer. + Clusters() ClusterInformer + // Restores returns a RestoreInformer. + Restores() RestoreInformer } type version struct { @@ -43,22 +41,22 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// MySQLBackups returns a MySQLBackupInformer. -func (v *version) MySQLBackups() MySQLBackupInformer { - return &mySQLBackupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +// Backups returns a BackupInformer. +func (v *version) Backups() BackupInformer { + return &backupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// MySQLBackupSchedules returns a MySQLBackupScheduleInformer. -func (v *version) MySQLBackupSchedules() MySQLBackupScheduleInformer { - return &mySQLBackupScheduleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +// BackupSchedules returns a BackupScheduleInformer. +func (v *version) BackupSchedules() BackupScheduleInformer { + return &backupScheduleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// MySQLClusters returns a MySQLClusterInformer. -func (v *version) MySQLClusters() MySQLClusterInformer { - return &mySQLClusterInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +// Clusters returns a ClusterInformer. +func (v *version) Clusters() ClusterInformer { + return &clusterInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// MySQLRestores returns a MySQLRestoreInformer. -func (v *version) MySQLRestores() MySQLRestoreInformer { - return &mySQLRestoreInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +// Restores returns a RestoreInformer. +func (v *version) Restores() RestoreInformer { + return &restoreInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlbackup.go b/pkg/generated/informers/externalversions/mysql/v1alpha1/restore.go similarity index 56% rename from pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlbackup.go rename to pkg/generated/informers/externalversions/mysql/v1alpha1/restore.go index 130f757b9..a92736be7 100644 --- a/pkg/generated/informers/externalversions/mysql/v1alpha1/mysqlbackup.go +++ b/pkg/generated/informers/externalversions/mysql/v1alpha1/restore.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// This file was automatically generated by informer-gen - package v1alpha1 import ( @@ -29,59 +27,59 @@ import ( cache "k8s.io/client-go/tools/cache" ) -// MySQLBackupInformer provides access to a shared informer and lister for -// MySQLBackups. -type MySQLBackupInformer interface { +// RestoreInformer provides access to a shared informer and lister for +// Restores. +type RestoreInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.MySQLBackupLister + Lister() v1alpha1.RestoreLister } -type mySQLBackupInformer struct { +type restoreInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewMySQLBackupInformer constructs a new informer for MySQLBackup type. +// NewRestoreInformer constructs a new informer for Restore 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 NewMySQLBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredMySQLBackupInformer(client, namespace, resyncPeriod, indexers, nil) +func NewRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredRestoreInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredMySQLBackupInformer constructs a new informer for MySQLBackup type. +// NewFilteredRestoreInformer constructs a new informer for Restore 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 NewFilteredMySQLBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredRestoreInformer(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.MysqlV1alpha1().MySQLBackups(namespace).List(options) + return client.MySQLV1alpha1().Restores(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.MysqlV1alpha1().MySQLBackups(namespace).Watch(options) + return client.MySQLV1alpha1().Restores(namespace).Watch(options) }, }, - &mysql_v1alpha1.MySQLBackup{}, + &mysql_v1alpha1.Restore{}, resyncPeriod, indexers, ) } -func (f *mySQLBackupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredMySQLBackupInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *restoreInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredRestoreInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *mySQLBackupInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&mysql_v1alpha1.MySQLBackup{}, f.defaultInformer) +func (f *restoreInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&mysql_v1alpha1.Restore{}, f.defaultInformer) } -func (f *mySQLBackupInformer) Lister() v1alpha1.MySQLBackupLister { - return v1alpha1.NewMySQLBackupLister(f.Informer().GetIndexer()) +func (f *restoreInformer) Lister() v1alpha1.RestoreLister { + return v1alpha1.NewRestoreLister(f.Informer().GetIndexer()) } diff --git a/pkg/generated/listers/mysql/v1alpha1/backup.go b/pkg/generated/listers/mysql/v1alpha1/backup.go new file mode 100644 index 000000000..ad8c8e991 --- /dev/null +++ b/pkg/generated/listers/mysql/v1alpha1/backup.go @@ -0,0 +1,90 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 + +import ( + v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// BackupLister helps list Backups. +type BackupLister interface { + // List lists all Backups in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.Backup, err error) + // Backups returns an object that can list and get Backups. + Backups(namespace string) BackupNamespaceLister + BackupListerExpansion +} + +// backupLister implements the BackupLister interface. +type backupLister struct { + indexer cache.Indexer +} + +// NewBackupLister returns a new BackupLister. +func NewBackupLister(indexer cache.Indexer) BackupLister { + return &backupLister{indexer: indexer} +} + +// List lists all Backups in the indexer. +func (s *backupLister) List(selector labels.Selector) (ret []*v1alpha1.Backup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.Backup)) + }) + return ret, err +} + +// Backups returns an object that can list and get Backups. +func (s *backupLister) Backups(namespace string) BackupNamespaceLister { + return backupNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// BackupNamespaceLister helps list and get Backups. +type BackupNamespaceLister interface { + // List lists all Backups in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.Backup, err error) + // Get retrieves the Backup from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.Backup, error) + BackupNamespaceListerExpansion +} + +// backupNamespaceLister implements the BackupNamespaceLister +// interface. +type backupNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Backups in the indexer for a given namespace. +func (s backupNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Backup, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.Backup)) + }) + return ret, err +} + +// Get retrieves the Backup from the indexer for a given namespace and name. +func (s backupNamespaceLister) Get(name string) (*v1alpha1.Backup, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("backup"), name) + } + return obj.(*v1alpha1.Backup), nil +} diff --git a/pkg/generated/listers/mysql/v1alpha1/backupschedule.go b/pkg/generated/listers/mysql/v1alpha1/backupschedule.go new file mode 100644 index 000000000..1feb48009 --- /dev/null +++ b/pkg/generated/listers/mysql/v1alpha1/backupschedule.go @@ -0,0 +1,90 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 + +import ( + v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// BackupScheduleLister helps list BackupSchedules. +type BackupScheduleLister interface { + // List lists all BackupSchedules in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.BackupSchedule, err error) + // BackupSchedules returns an object that can list and get BackupSchedules. + BackupSchedules(namespace string) BackupScheduleNamespaceLister + BackupScheduleListerExpansion +} + +// backupScheduleLister implements the BackupScheduleLister interface. +type backupScheduleLister struct { + indexer cache.Indexer +} + +// NewBackupScheduleLister returns a new BackupScheduleLister. +func NewBackupScheduleLister(indexer cache.Indexer) BackupScheduleLister { + return &backupScheduleLister{indexer: indexer} +} + +// List lists all BackupSchedules in the indexer. +func (s *backupScheduleLister) List(selector labels.Selector) (ret []*v1alpha1.BackupSchedule, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.BackupSchedule)) + }) + return ret, err +} + +// BackupSchedules returns an object that can list and get BackupSchedules. +func (s *backupScheduleLister) BackupSchedules(namespace string) BackupScheduleNamespaceLister { + return backupScheduleNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// BackupScheduleNamespaceLister helps list and get BackupSchedules. +type BackupScheduleNamespaceLister interface { + // List lists all BackupSchedules in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.BackupSchedule, err error) + // Get retrieves the BackupSchedule from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.BackupSchedule, error) + BackupScheduleNamespaceListerExpansion +} + +// backupScheduleNamespaceLister implements the BackupScheduleNamespaceLister +// interface. +type backupScheduleNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all BackupSchedules in the indexer for a given namespace. +func (s backupScheduleNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.BackupSchedule, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.BackupSchedule)) + }) + return ret, err +} + +// Get retrieves the BackupSchedule from the indexer for a given namespace and name. +func (s backupScheduleNamespaceLister) Get(name string) (*v1alpha1.BackupSchedule, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("backupschedule"), name) + } + return obj.(*v1alpha1.BackupSchedule), nil +} diff --git a/pkg/generated/listers/mysql/v1alpha1/cluster.go b/pkg/generated/listers/mysql/v1alpha1/cluster.go new file mode 100644 index 000000000..8235023cd --- /dev/null +++ b/pkg/generated/listers/mysql/v1alpha1/cluster.go @@ -0,0 +1,90 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 + +import ( + v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ClusterLister helps list Clusters. +type ClusterLister interface { + // List lists all Clusters in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) + // Clusters returns an object that can list and get Clusters. + Clusters(namespace string) ClusterNamespaceLister + ClusterListerExpansion +} + +// clusterLister implements the ClusterLister interface. +type clusterLister struct { + indexer cache.Indexer +} + +// NewClusterLister returns a new ClusterLister. +func NewClusterLister(indexer cache.Indexer) ClusterLister { + return &clusterLister{indexer: indexer} +} + +// List lists all Clusters in the indexer. +func (s *clusterLister) List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.Cluster)) + }) + return ret, err +} + +// Clusters returns an object that can list and get Clusters. +func (s *clusterLister) Clusters(namespace string) ClusterNamespaceLister { + return clusterNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ClusterNamespaceLister helps list and get Clusters. +type ClusterNamespaceLister interface { + // List lists all Clusters in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) + // Get retrieves the Cluster from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.Cluster, error) + ClusterNamespaceListerExpansion +} + +// clusterNamespaceLister implements the ClusterNamespaceLister +// interface. +type clusterNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Clusters in the indexer for a given namespace. +func (s clusterNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.Cluster)) + }) + return ret, err +} + +// Get retrieves the Cluster from the indexer for a given namespace and name. +func (s clusterNamespaceLister) Get(name string) (*v1alpha1.Cluster, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("cluster"), name) + } + return obj.(*v1alpha1.Cluster), nil +} diff --git a/pkg/generated/listers/mysql/v1alpha1/expansion_generated.go b/pkg/generated/listers/mysql/v1alpha1/expansion_generated.go index 05a5bff7b..6c91d6f30 100644 --- a/pkg/generated/listers/mysql/v1alpha1/expansion_generated.go +++ b/pkg/generated/listers/mysql/v1alpha1/expansion_generated.go @@ -12,38 +12,36 @@ // See the License for the specific language governing permissions and // limitations under the License. -// This file was automatically generated by lister-gen - package v1alpha1 -// MySQLBackupListerExpansion allows custom methods to be added to -// MySQLBackupLister. -type MySQLBackupListerExpansion interface{} +// BackupListerExpansion allows custom methods to be added to +// BackupLister. +type BackupListerExpansion interface{} -// MySQLBackupNamespaceListerExpansion allows custom methods to be added to -// MySQLBackupNamespaceLister. -type MySQLBackupNamespaceListerExpansion interface{} +// BackupNamespaceListerExpansion allows custom methods to be added to +// BackupNamespaceLister. +type BackupNamespaceListerExpansion interface{} -// MySQLBackupScheduleListerExpansion allows custom methods to be added to -// MySQLBackupScheduleLister. -type MySQLBackupScheduleListerExpansion interface{} +// BackupScheduleListerExpansion allows custom methods to be added to +// BackupScheduleLister. +type BackupScheduleListerExpansion interface{} -// MySQLBackupScheduleNamespaceListerExpansion allows custom methods to be added to -// MySQLBackupScheduleNamespaceLister. -type MySQLBackupScheduleNamespaceListerExpansion interface{} +// BackupScheduleNamespaceListerExpansion allows custom methods to be added to +// BackupScheduleNamespaceLister. +type BackupScheduleNamespaceListerExpansion interface{} -// MySQLClusterListerExpansion allows custom methods to be added to -// MySQLClusterLister. -type MySQLClusterListerExpansion interface{} +// ClusterListerExpansion allows custom methods to be added to +// ClusterLister. +type ClusterListerExpansion interface{} -// MySQLClusterNamespaceListerExpansion allows custom methods to be added to -// MySQLClusterNamespaceLister. -type MySQLClusterNamespaceListerExpansion interface{} +// ClusterNamespaceListerExpansion allows custom methods to be added to +// ClusterNamespaceLister. +type ClusterNamespaceListerExpansion interface{} -// MySQLRestoreListerExpansion allows custom methods to be added to -// MySQLRestoreLister. -type MySQLRestoreListerExpansion interface{} +// RestoreListerExpansion allows custom methods to be added to +// RestoreLister. +type RestoreListerExpansion interface{} -// MySQLRestoreNamespaceListerExpansion allows custom methods to be added to -// MySQLRestoreNamespaceLister. -type MySQLRestoreNamespaceListerExpansion interface{} +// RestoreNamespaceListerExpansion allows custom methods to be added to +// RestoreNamespaceLister. +type RestoreNamespaceListerExpansion interface{} diff --git a/pkg/generated/listers/mysql/v1alpha1/mysqlbackup.go b/pkg/generated/listers/mysql/v1alpha1/mysqlbackup.go deleted file mode 100644 index 60010cc35..000000000 --- a/pkg/generated/listers/mysql/v1alpha1/mysqlbackup.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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. - -// This file was automatically generated by lister-gen - -package v1alpha1 - -import ( - v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// MySQLBackupLister helps list MySQLBackups. -type MySQLBackupLister interface { - // List lists all MySQLBackups in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.MySQLBackup, err error) - // MySQLBackups returns an object that can list and get MySQLBackups. - MySQLBackups(namespace string) MySQLBackupNamespaceLister - MySQLBackupListerExpansion -} - -// mySQLBackupLister implements the MySQLBackupLister interface. -type mySQLBackupLister struct { - indexer cache.Indexer -} - -// NewMySQLBackupLister returns a new MySQLBackupLister. -func NewMySQLBackupLister(indexer cache.Indexer) MySQLBackupLister { - return &mySQLBackupLister{indexer: indexer} -} - -// List lists all MySQLBackups in the indexer. -func (s *mySQLBackupLister) List(selector labels.Selector) (ret []*v1alpha1.MySQLBackup, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MySQLBackup)) - }) - return ret, err -} - -// MySQLBackups returns an object that can list and get MySQLBackups. -func (s *mySQLBackupLister) MySQLBackups(namespace string) MySQLBackupNamespaceLister { - return mySQLBackupNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// MySQLBackupNamespaceLister helps list and get MySQLBackups. -type MySQLBackupNamespaceLister interface { - // List lists all MySQLBackups in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.MySQLBackup, err error) - // Get retrieves the MySQLBackup from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.MySQLBackup, error) - MySQLBackupNamespaceListerExpansion -} - -// mySQLBackupNamespaceLister implements the MySQLBackupNamespaceLister -// interface. -type mySQLBackupNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all MySQLBackups in the indexer for a given namespace. -func (s mySQLBackupNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.MySQLBackup, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MySQLBackup)) - }) - return ret, err -} - -// Get retrieves the MySQLBackup from the indexer for a given namespace and name. -func (s mySQLBackupNamespaceLister) Get(name string) (*v1alpha1.MySQLBackup, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("mysqlbackup"), name) - } - return obj.(*v1alpha1.MySQLBackup), nil -} diff --git a/pkg/generated/listers/mysql/v1alpha1/mysqlbackupschedule.go b/pkg/generated/listers/mysql/v1alpha1/mysqlbackupschedule.go deleted file mode 100644 index bb900da62..000000000 --- a/pkg/generated/listers/mysql/v1alpha1/mysqlbackupschedule.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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. - -// This file was automatically generated by lister-gen - -package v1alpha1 - -import ( - v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// MySQLBackupScheduleLister helps list MySQLBackupSchedules. -type MySQLBackupScheduleLister interface { - // List lists all MySQLBackupSchedules in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.MySQLBackupSchedule, err error) - // MySQLBackupSchedules returns an object that can list and get MySQLBackupSchedules. - MySQLBackupSchedules(namespace string) MySQLBackupScheduleNamespaceLister - MySQLBackupScheduleListerExpansion -} - -// mySQLBackupScheduleLister implements the MySQLBackupScheduleLister interface. -type mySQLBackupScheduleLister struct { - indexer cache.Indexer -} - -// NewMySQLBackupScheduleLister returns a new MySQLBackupScheduleLister. -func NewMySQLBackupScheduleLister(indexer cache.Indexer) MySQLBackupScheduleLister { - return &mySQLBackupScheduleLister{indexer: indexer} -} - -// List lists all MySQLBackupSchedules in the indexer. -func (s *mySQLBackupScheduleLister) List(selector labels.Selector) (ret []*v1alpha1.MySQLBackupSchedule, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MySQLBackupSchedule)) - }) - return ret, err -} - -// MySQLBackupSchedules returns an object that can list and get MySQLBackupSchedules. -func (s *mySQLBackupScheduleLister) MySQLBackupSchedules(namespace string) MySQLBackupScheduleNamespaceLister { - return mySQLBackupScheduleNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// MySQLBackupScheduleNamespaceLister helps list and get MySQLBackupSchedules. -type MySQLBackupScheduleNamespaceLister interface { - // List lists all MySQLBackupSchedules in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.MySQLBackupSchedule, err error) - // Get retrieves the MySQLBackupSchedule from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.MySQLBackupSchedule, error) - MySQLBackupScheduleNamespaceListerExpansion -} - -// mySQLBackupScheduleNamespaceLister implements the MySQLBackupScheduleNamespaceLister -// interface. -type mySQLBackupScheduleNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all MySQLBackupSchedules in the indexer for a given namespace. -func (s mySQLBackupScheduleNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.MySQLBackupSchedule, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MySQLBackupSchedule)) - }) - return ret, err -} - -// Get retrieves the MySQLBackupSchedule from the indexer for a given namespace and name. -func (s mySQLBackupScheduleNamespaceLister) Get(name string) (*v1alpha1.MySQLBackupSchedule, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("mysqlbackupschedule"), name) - } - return obj.(*v1alpha1.MySQLBackupSchedule), nil -} diff --git a/pkg/generated/listers/mysql/v1alpha1/mysqlcluster.go b/pkg/generated/listers/mysql/v1alpha1/mysqlcluster.go deleted file mode 100644 index 9e3ba72a0..000000000 --- a/pkg/generated/listers/mysql/v1alpha1/mysqlcluster.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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. - -// This file was automatically generated by lister-gen - -package v1alpha1 - -import ( - v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// MySQLClusterLister helps list MySQLClusters. -type MySQLClusterLister interface { - // List lists all MySQLClusters in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.MySQLCluster, err error) - // MySQLClusters returns an object that can list and get MySQLClusters. - MySQLClusters(namespace string) MySQLClusterNamespaceLister - MySQLClusterListerExpansion -} - -// mySQLClusterLister implements the MySQLClusterLister interface. -type mySQLClusterLister struct { - indexer cache.Indexer -} - -// NewMySQLClusterLister returns a new MySQLClusterLister. -func NewMySQLClusterLister(indexer cache.Indexer) MySQLClusterLister { - return &mySQLClusterLister{indexer: indexer} -} - -// List lists all MySQLClusters in the indexer. -func (s *mySQLClusterLister) List(selector labels.Selector) (ret []*v1alpha1.MySQLCluster, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MySQLCluster)) - }) - return ret, err -} - -// MySQLClusters returns an object that can list and get MySQLClusters. -func (s *mySQLClusterLister) MySQLClusters(namespace string) MySQLClusterNamespaceLister { - return mySQLClusterNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// MySQLClusterNamespaceLister helps list and get MySQLClusters. -type MySQLClusterNamespaceLister interface { - // List lists all MySQLClusters in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.MySQLCluster, err error) - // Get retrieves the MySQLCluster from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.MySQLCluster, error) - MySQLClusterNamespaceListerExpansion -} - -// mySQLClusterNamespaceLister implements the MySQLClusterNamespaceLister -// interface. -type mySQLClusterNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all MySQLClusters in the indexer for a given namespace. -func (s mySQLClusterNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.MySQLCluster, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MySQLCluster)) - }) - return ret, err -} - -// Get retrieves the MySQLCluster from the indexer for a given namespace and name. -func (s mySQLClusterNamespaceLister) Get(name string) (*v1alpha1.MySQLCluster, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("mysqlcluster"), name) - } - return obj.(*v1alpha1.MySQLCluster), nil -} diff --git a/pkg/generated/listers/mysql/v1alpha1/mysqlrestore.go b/pkg/generated/listers/mysql/v1alpha1/mysqlrestore.go deleted file mode 100644 index 44bf5400a..000000000 --- a/pkg/generated/listers/mysql/v1alpha1/mysqlrestore.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2018 Oracle and/or its affiliates. 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. - -// This file was automatically generated by lister-gen - -package v1alpha1 - -import ( - v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// MySQLRestoreLister helps list MySQLRestores. -type MySQLRestoreLister interface { - // List lists all MySQLRestores in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.MySQLRestore, err error) - // MySQLRestores returns an object that can list and get MySQLRestores. - MySQLRestores(namespace string) MySQLRestoreNamespaceLister - MySQLRestoreListerExpansion -} - -// mySQLRestoreLister implements the MySQLRestoreLister interface. -type mySQLRestoreLister struct { - indexer cache.Indexer -} - -// NewMySQLRestoreLister returns a new MySQLRestoreLister. -func NewMySQLRestoreLister(indexer cache.Indexer) MySQLRestoreLister { - return &mySQLRestoreLister{indexer: indexer} -} - -// List lists all MySQLRestores in the indexer. -func (s *mySQLRestoreLister) List(selector labels.Selector) (ret []*v1alpha1.MySQLRestore, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MySQLRestore)) - }) - return ret, err -} - -// MySQLRestores returns an object that can list and get MySQLRestores. -func (s *mySQLRestoreLister) MySQLRestores(namespace string) MySQLRestoreNamespaceLister { - return mySQLRestoreNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// MySQLRestoreNamespaceLister helps list and get MySQLRestores. -type MySQLRestoreNamespaceLister interface { - // List lists all MySQLRestores in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.MySQLRestore, err error) - // Get retrieves the MySQLRestore from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.MySQLRestore, error) - MySQLRestoreNamespaceListerExpansion -} - -// mySQLRestoreNamespaceLister implements the MySQLRestoreNamespaceLister -// interface. -type mySQLRestoreNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all MySQLRestores in the indexer for a given namespace. -func (s mySQLRestoreNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.MySQLRestore, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MySQLRestore)) - }) - return ret, err -} - -// Get retrieves the MySQLRestore from the indexer for a given namespace and name. -func (s mySQLRestoreNamespaceLister) Get(name string) (*v1alpha1.MySQLRestore, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("mysqlrestore"), name) - } - return obj.(*v1alpha1.MySQLRestore), nil -} diff --git a/pkg/generated/listers/mysql/v1alpha1/restore.go b/pkg/generated/listers/mysql/v1alpha1/restore.go new file mode 100644 index 000000000..ab5ca5143 --- /dev/null +++ b/pkg/generated/listers/mysql/v1alpha1/restore.go @@ -0,0 +1,90 @@ +// Copyright 2018 Oracle and/or its affiliates. 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 v1alpha1 + +import ( + v1alpha1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// RestoreLister helps list Restores. +type RestoreLister interface { + // List lists all Restores in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.Restore, err error) + // Restores returns an object that can list and get Restores. + Restores(namespace string) RestoreNamespaceLister + RestoreListerExpansion +} + +// restoreLister implements the RestoreLister interface. +type restoreLister struct { + indexer cache.Indexer +} + +// NewRestoreLister returns a new RestoreLister. +func NewRestoreLister(indexer cache.Indexer) RestoreLister { + return &restoreLister{indexer: indexer} +} + +// List lists all Restores in the indexer. +func (s *restoreLister) List(selector labels.Selector) (ret []*v1alpha1.Restore, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.Restore)) + }) + return ret, err +} + +// Restores returns an object that can list and get Restores. +func (s *restoreLister) Restores(namespace string) RestoreNamespaceLister { + return restoreNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// RestoreNamespaceLister helps list and get Restores. +type RestoreNamespaceLister interface { + // List lists all Restores in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.Restore, err error) + // Get retrieves the Restore from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.Restore, error) + RestoreNamespaceListerExpansion +} + +// restoreNamespaceLister implements the RestoreNamespaceLister +// interface. +type restoreNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Restores in the indexer for a given namespace. +func (s restoreNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Restore, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.Restore)) + }) + return ret, err +} + +// Get retrieves the Restore from the indexer for a given namespace and name. +func (s restoreNamespaceLister) Get(name string) (*v1alpha1.Restore, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("restore"), name) + } + return obj.(*v1alpha1.Restore), nil +} diff --git a/pkg/resources/secrets/secret.go b/pkg/resources/secrets/secret.go index ed0e1ae50..16b0434c6 100644 --- a/pkg/resources/secrets/secret.go +++ b/pkg/resources/secrets/secret.go @@ -27,17 +27,17 @@ import ( // NewMysqlRootPassword returns a Kubernetes secret containing a // generated MySQL root password. -func NewMysqlRootPassword(cluster *v1alpha1.MySQLCluster) *corev1.Secret { +func NewMysqlRootPassword(cluster *v1alpha1.Cluster) *corev1.Secret { CreateSecret := RandomAlphanumericString(16) secret := &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{constants.MySQLClusterLabel: cluster.Name}, + Labels: map[string]string{constants.ClusterLabel: cluster.Name}, Name: GetRootPasswordSecretName(cluster), OwnerReferences: []metav1.OwnerReference{ *metav1.NewControllerRef(cluster, schema.GroupVersionKind{ Group: v1alpha1.SchemeGroupVersion.Group, Version: v1alpha1.SchemeGroupVersion.Version, - Kind: v1alpha1.MySQLClusterCRDResourceKind, + Kind: v1alpha1.ClusterCRDResourceKind, }), }, Namespace: cluster.Namespace, @@ -49,6 +49,6 @@ func NewMysqlRootPassword(cluster *v1alpha1.MySQLCluster) *corev1.Secret { // GetRootPasswordSecretName returns the root password secret name for the // given mysql cluster. -func GetRootPasswordSecretName(cluster *v1alpha1.MySQLCluster) string { +func GetRootPasswordSecretName(cluster *v1alpha1.Cluster) string { return fmt.Sprintf("%s-root-password", cluster.Name) } diff --git a/pkg/resources/secrets/secret_test.go b/pkg/resources/secrets/secret_test.go index 9999f22b0..8b2d6744e 100644 --- a/pkg/resources/secrets/secret_test.go +++ b/pkg/resources/secrets/secret_test.go @@ -23,9 +23,9 @@ import ( ) func TestGetRootPasswordSecretName(t *testing.T) { - cluster := &v1alpha1.MySQLCluster{ + cluster := &v1alpha1.Cluster{ ObjectMeta: metav1.ObjectMeta{Name: "example-cluster"}, - Spec: v1alpha1.MySQLClusterSpec{}, + Spec: v1alpha1.ClusterSpec{}, } actual := GetRootPasswordSecretName(cluster) diff --git a/pkg/resources/services/service.go b/pkg/resources/services/service.go index 193ff120b..9aa177a3b 100644 --- a/pkg/resources/services/service.go +++ b/pkg/resources/services/service.go @@ -24,18 +24,18 @@ import ( ) // NewForCluster will return a new headless Kubernetes service for a MySQL cluster -func NewForCluster(cluster *v1alpha1.MySQLCluster) *corev1.Service { +func NewForCluster(cluster *v1alpha1.Cluster) *corev1.Service { mysqlPort := corev1.ServicePort{Port: 3306} svc := &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{constants.MySQLClusterLabel: cluster.Name}, + Labels: map[string]string{constants.ClusterLabel: cluster.Name}, Name: cluster.Name, Namespace: cluster.Namespace, OwnerReferences: []metav1.OwnerReference{ *metav1.NewControllerRef(cluster, schema.GroupVersionKind{ Group: v1alpha1.SchemeGroupVersion.Group, Version: v1alpha1.SchemeGroupVersion.Version, - Kind: v1alpha1.MySQLClusterCRDResourceKind, + Kind: v1alpha1.ClusterCRDResourceKind, }), }, Annotations: map[string]string{ @@ -45,7 +45,7 @@ func NewForCluster(cluster *v1alpha1.MySQLCluster) *corev1.Service { Spec: corev1.ServiceSpec{ Ports: []corev1.ServicePort{mysqlPort}, Selector: map[string]string{ - constants.MySQLClusterLabel: cluster.Name, + constants.ClusterLabel: cluster.Name, }, ClusterIP: corev1.ClusterIPNone, }, diff --git a/pkg/resources/statefulsets/statefulset.go b/pkg/resources/statefulsets/statefulset.go index 495028ded..33d77cc82 100644 --- a/pkg/resources/statefulsets/statefulset.go +++ b/pkg/resources/statefulsets/statefulset.go @@ -49,7 +49,7 @@ const ( replicationGroupPort = 13306 ) -func volumeMounts(cluster *v1alpha1.MySQLCluster) []v1.VolumeMount { +func volumeMounts(cluster *v1alpha1.Cluster) []v1.VolumeMount { var mounts []v1.VolumeMount name := mySQLVolumeName @@ -93,7 +93,7 @@ func volumeMounts(cluster *v1alpha1.MySQLCluster) []v1.VolumeMount { return mounts } -func clusterNameEnvVar(cluster *v1alpha1.MySQLCluster) v1.EnvVar { +func clusterNameEnvVar(cluster *v1alpha1.Cluster) v1.EnvVar { return v1.EnvVar{Name: "MYSQL_CLUSTER_NAME", Value: cluster.Name} } @@ -125,12 +125,12 @@ func multiMasterEnvVar(enabled bool) v1.EnvVar { // Returns the MySQL_ROOT_PASSWORD environment variable // If a user specifies a secret in the spec we use that // else we create a secret with a random password -func mysqlRootPassword(cluster *v1alpha1.MySQLCluster) v1.EnvVar { +func mysqlRootPassword(cluster *v1alpha1.Cluster) v1.EnvVar { var secretName string if cluster.RequiresSecret() { secretName = secrets.GetRootPasswordSecretName(cluster) } else { - secretName = cluster.Spec.SecretRef.Name + secretName = cluster.Spec.RootPasswordSecret.Name } return v1.EnvVar{ @@ -153,9 +153,9 @@ func serviceNameEnvVar(serviceName string) v1.EnvVar { } } -func getReplicationGroupSeeds(name string, replicas int) string { +func getReplicationGroupSeeds(name string, members int) string { seeds := []string{} - for i := 0; i < replicas; i++ { + for i := 0; i < members; i++ { seeds = append(seeds, fmt.Sprintf("%[1]s-%[2]d.%[1]s:%[3]d", name, i, replicationGroupPort)) } return strings.Join(seeds, ",") @@ -164,8 +164,8 @@ func getReplicationGroupSeeds(name string, replicas int) string { // Builds the MySQL operator container for a cluster. // The 'mysqlImage' parameter is the image name of the mysql server to use with // no version information.. e.g. 'mysql/mysql-server' -func mysqlServerContainer(cluster *v1alpha1.MySQLCluster, mysqlServerImage string, rootPassword v1.EnvVar, serviceName string, replicas int, baseServerID uint32) v1.Container { - replicationGroupSeeds := getReplicationGroupSeeds(cluster.Namespace, replicas) +func mysqlServerContainer(cluster *v1alpha1.Cluster, mysqlServerImage string, rootPassword v1.EnvVar, serviceName string, members int, baseServerID uint32) v1.Container { + replicationGroupSeeds := getReplicationGroupSeeds(cluster.Namespace, members) args := []string{ "--server_id=$(expr $base + $index)", @@ -232,13 +232,13 @@ func mysqlServerContainer(cluster *v1alpha1.MySQLCluster, mysqlServerImage strin } } -func mysqlAgentContainer(cluster *v1alpha1.MySQLCluster, mysqlAgentImage string, rootPassword v1.EnvVar, serviceName string, replicas int) v1.Container { +func mysqlAgentContainer(cluster *v1alpha1.Cluster, mysqlAgentImage string, rootPassword v1.EnvVar, serviceName string, members int) v1.Container { agentVersion := version.GetBuildVersion() if version := os.Getenv("MYSQL_AGENT_VERSION"); version != "" { agentVersion = version } - replicationGroupSeeds := getReplicationGroupSeeds(cluster.Name, replicas) + replicationGroupSeeds := getReplicationGroupSeeds(cluster.Name, members) return v1.Container{ Name: MySQLAgentName, @@ -280,10 +280,10 @@ func mysqlAgentContainer(cluster *v1alpha1.MySQLCluster, mysqlAgentImage string, } } -// NewForCluster creates a new StatefulSet for the given MySQLCluster. -func NewForCluster(cluster *v1alpha1.MySQLCluster, images operatoropts.Images, serviceName string) *apps.StatefulSet { +// NewForCluster creates a new StatefulSet for the given Cluster. +func NewForCluster(cluster *v1alpha1.Cluster, images operatoropts.Images, serviceName string) *apps.StatefulSet { rootPassword := mysqlRootPassword(cluster) - replicas := int(cluster.Spec.Replicas) + members := int(cluster.Spec.Members) baseServerID := cluster.Spec.BaseServerID // If a PV isn't specified just use a EmptyDir volume @@ -305,7 +305,7 @@ func NewForCluster(cluster *v1alpha1.MySQLCluster, images operatoropts.Images, s VolumeSource: v1.VolumeSource{ ConfigMap: &v1.ConfigMapVolumeSource{ LocalObjectReference: v1.LocalObjectReference{ - Name: cluster.Spec.ConfigRef.Name, + Name: cluster.Spec.Config.Name, }, }, }, @@ -321,7 +321,7 @@ func NewForCluster(cluster *v1alpha1.MySQLCluster, images operatoropts.Images, s v1.VolumeProjection{ Secret: &v1.SecretProjection{ LocalObjectReference: v1.LocalObjectReference{ - Name: cluster.Spec.SSLSecretRef.Name, + Name: cluster.Spec.SSLSecret.Name, }, Items: []v1.KeyToPath{ v1.KeyToPath{ @@ -346,14 +346,14 @@ func NewForCluster(cluster *v1alpha1.MySQLCluster, images operatoropts.Images, s } containers := []v1.Container{ - mysqlServerContainer(cluster, images.MySQLServerImage, rootPassword, serviceName, replicas, baseServerID), - mysqlAgentContainer(cluster, images.MySQLAgentImage, rootPassword, serviceName, replicas)} + mysqlServerContainer(cluster, images.MySQLServerImage, rootPassword, serviceName, members, baseServerID), + mysqlAgentContainer(cluster, images.MySQLAgentImage, rootPassword, serviceName, members)} podLabels := map[string]string{ - constants.MySQLClusterLabel: cluster.Name, + constants.ClusterLabel: cluster.Name, } if cluster.Spec.MultiMaster { - podLabels[constants.LabelMySQLClusterRole] = constants.MySQLClusterRolePrimary + podLabels[constants.LabelClusterRole] = constants.ClusterRolePrimary } ss := &apps.StatefulSet{ @@ -364,16 +364,16 @@ func NewForCluster(cluster *v1alpha1.MySQLCluster, images operatoropts.Images, s *metav1.NewControllerRef(cluster, schema.GroupVersionKind{ Group: v1alpha1.SchemeGroupVersion.Group, Version: v1alpha1.SchemeGroupVersion.Version, - Kind: v1alpha1.MySQLClusterCRDResourceKind, + Kind: v1alpha1.ClusterCRDResourceKind, }), }, Labels: map[string]string{ - constants.MySQLClusterLabel: cluster.Name, + constants.ClusterLabel: cluster.Name, constants.MySQLOperatorVersionLabel: version.GetBuildVersion(), }, }, Spec: apps.StatefulSetSpec{ - Replicas: &cluster.Spec.Replicas, + Replicas: &cluster.Spec.Members, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: podLabels, diff --git a/pkg/resources/statefulsets/statefulset_test.go b/pkg/resources/statefulsets/statefulset_test.go index 629df9040..c16b46b58 100644 --- a/pkg/resources/statefulsets/statefulset_test.go +++ b/pkg/resources/statefulsets/statefulset_test.go @@ -33,9 +33,9 @@ func mockOperatorConfig() options.MySQLOperatorServer { } func TestMySQLRootPasswordNoSecretRef(t *testing.T) { - cluster := &v1alpha1.MySQLCluster{ + cluster := &v1alpha1.Cluster{ ObjectMeta: metav1.ObjectMeta{Name: "cluster"}, - Spec: v1alpha1.MySQLClusterSpec{}, + Spec: v1alpha1.ClusterSpec{}, } actual := mysqlRootPassword(cluster).ValueFrom.SecretKeyRef.Name @@ -46,9 +46,9 @@ func TestMySQLRootPasswordNoSecretRef(t *testing.T) { } func TestMySQLRootPasswordWithSecretRef(t *testing.T) { - cluster := &v1alpha1.MySQLCluster{ - Spec: v1alpha1.MySQLClusterSpec{ - SecretRef: &corev1.LocalObjectReference{Name: "secret"}, + cluster := &v1alpha1.Cluster{ + Spec: v1alpha1.ClusterSpec{ + RootPasswordSecret: &corev1.LocalObjectReference{Name: "secret"}, }, } @@ -60,9 +60,9 @@ func TestMySQLRootPasswordWithSecretRef(t *testing.T) { } func TestClusterWithoutPVCHasBackupContainerAndVolumes(t *testing.T) { - cluster := &v1alpha1.MySQLCluster{ - Spec: v1alpha1.MySQLClusterSpec{ - SecretRef: &corev1.LocalObjectReference{Name: "secret"}, + cluster := &v1alpha1.Cluster{ + Spec: v1alpha1.ClusterSpec{ + RootPasswordSecret: &corev1.LocalObjectReference{Name: "secret"}, }, } @@ -79,9 +79,9 @@ func TestClusterWithoutPVCHasBackupContainerAndVolumes(t *testing.T) { } func TestClusterWithPVCHasBackupContainerAndVolumes(t *testing.T) { - cluster := &v1alpha1.MySQLCluster{ - Spec: v1alpha1.MySQLClusterSpec{ - SecretRef: &corev1.LocalObjectReference{Name: "secret"}, + cluster := &v1alpha1.Cluster{ + Spec: v1alpha1.ClusterSpec{ + RootPasswordSecret: &corev1.LocalObjectReference{Name: "secret"}, VolumeClaimTemplate: &corev1.PersistentVolumeClaim{}, BackupVolumeClaimTemplate: &corev1.PersistentVolumeClaim{}, }, @@ -101,8 +101,8 @@ func TestClusterWithPVCHasBackupContainerAndVolumes(t *testing.T) { func TestClusterHasNodeSelector(t *testing.T) { nvmeSelector := map[string]string{"disk": "nvme"} - cluster := &v1alpha1.MySQLCluster{ - Spec: v1alpha1.MySQLClusterSpec{ + cluster := &v1alpha1.Cluster{ + Spec: v1alpha1.ClusterSpec{ NodeSelector: nvmeSelector, }, } @@ -115,9 +115,9 @@ func TestClusterHasNodeSelector(t *testing.T) { } func TestClusterCustomConfig(t *testing.T) { - cluster := &v1alpha1.MySQLCluster{ - Spec: v1alpha1.MySQLClusterSpec{ - ConfigRef: &corev1.LocalObjectReference{ + cluster := &v1alpha1.Cluster{ + Spec: v1alpha1.ClusterSpec{ + Config: &corev1.LocalObjectReference{ Name: "mycnf", }, }, @@ -142,9 +142,9 @@ func TestClusterCustomConfig(t *testing.T) { } func TestClusterCustomSSLSetup(t *testing.T) { - cluster := &v1alpha1.MySQLCluster{ - Spec: v1alpha1.MySQLClusterSpec{ - SSLSecretRef: &corev1.LocalObjectReference{ + cluster := &v1alpha1.Cluster{ + Spec: v1alpha1.ClusterSpec{ + SSLSecret: &corev1.LocalObjectReference{ Name: "my-ssl", }, }, diff --git a/pkg/util/mysqlsh/mysqlsh_test.go b/pkg/util/mysqlsh/mysqlsh_test.go index a99bb50bf..236e9d3c7 100644 --- a/pkg/util/mysqlsh/mysqlsh_test.go +++ b/pkg/util/mysqlsh/mysqlsh_test.go @@ -29,7 +29,7 @@ import ( const clusterStatusOutput = ` mysqlx: [Warning] Using a password on the command line interface can be insecure. { - "clusterName": "MySQLCluster", + "clusterName": "Cluster", "defaultReplicaSet": { "name": "default", "primary": "mysql-test-cluster-0.service.namespace.svc.cluster.local:3306", @@ -103,7 +103,7 @@ func TestGetClusterStatus(t *testing.T) { "--no-wizard", "--uri", "root:foo@localhost.service.namespace.svc.cluster.local:3306", "--py", - "-e", "print dba.get_cluster('MySQLCluster').status()", + "-e", "print dba.get_cluster('Cluster').status()", } if !reflect.DeepEqual(fcmd.RunLog[0], expectedCall) { t.Errorf("Expected call %+v, got %+v", expectedCall, fcmd.RunLog[0]) @@ -113,8 +113,8 @@ func TestGetClusterStatus(t *testing.T) { t.Fatalf("Expected err = nil, got: %v", err) } - if status.ClusterName != "MySQLCluster" { - t.Errorf("Expected status.ClusterName = \"MySQLCluster\", got %q", status.ClusterName) + if status.ClusterName != "Cluster" { + t.Errorf("Expected status.ClusterName = \"Cluster\", got %q", status.ClusterName) } n := len(status.DefaultReplicaSet.Topology) @@ -154,7 +154,7 @@ mysqlx: [Warning] Using a password on the command line interface can be insecure "--no-wizard", "--uri", "root:foo@localhost.service.namespace.svc.cluster.local:3306", "--py", - "-e", fmt.Sprintf("print dba.get_cluster('MySQLCluster').check_instance_state('%s')", instanceURI), + "-e", fmt.Sprintf("print dba.get_cluster('Cluster').check_instance_state('%s')", instanceURI), } if !reflect.DeepEqual(fcmd.RunLog[0], expectedCall) { t.Errorf("Expected call %+v, got %+v", expectedCall, fcmd.RunLog[0]) @@ -198,7 +198,7 @@ func TestRemoveInstanceFromCluster(t *testing.T) { "--no-wizard", "--uri", "root:foo@localhost:3306", "--py", - "-e", `dba.get_cluster('MySQLCluster').remove_instance('root:foo@mysql-cluster-1:3306', {'force': True})`, + "-e", `dba.get_cluster('Cluster').remove_instance('root:foo@mysql-cluster-1:3306', {'force': True})`, } if !reflect.DeepEqual(fcmd.RunLog[0], expectedCall) { t.Errorf("Expected call %+v, got %+v", expectedCall, fcmd.RunLog[0]) @@ -219,10 +219,10 @@ func TestNewErrorFromStderr(t *testing.T) { name: "create_cluster", output: `Traceback (most recent call last): File "", line 1, in -mysqlsh.DBError: MySQL Error (1062): Dba.create_cluster: Duplicate entry 'MySQLCluster' for key 'cluster_name'`, +mysqlsh.DBError: MySQL Error (1062): Dba.create_cluster: Duplicate entry 'Cluster' for key 'cluster_name'`, expected: &Error{ Type: "mysqlsh.DBError", - Message: "MySQL Error (1062): Dba.create_cluster: Duplicate entry 'MySQLCluster' for key 'cluster_name'", + Message: "MySQL Error (1062): Dba.create_cluster: Duplicate entry 'Cluster' for key 'cluster_name'", }, }, { name: "get_cluster", diff --git a/pkg/util/test/test_backup.go b/pkg/util/test/test_backup.go index 7ce616d62..16f7d94f6 100644 --- a/pkg/util/test/test_backup.go +++ b/pkg/util/test/test_backup.go @@ -21,49 +21,49 @@ import ( "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" ) -type TestMySQLBackup struct { - *v1alpha1.MySQLBackup +type TestBackup struct { + *v1alpha1.Backup } -func NewTestMySQLBackup() *TestMySQLBackup { - return &TestMySQLBackup{ - MySQLBackup: &v1alpha1.MySQLBackup{ +func NewTestBackup() *TestBackup { + return &TestBackup{ + Backup: &v1alpha1.Backup{ ObjectMeta: metav1.ObjectMeta{ Namespace: metav1.NamespaceDefault, }, Spec: v1alpha1.BackupSpec{ - Executor: &v1alpha1.Executor{ - Provider: "mysqldump", - Databases: []string{"test"}, - }, - Storage: &v1alpha1.Storage{ - Provider: "s3", - SecretRef: &corev1.LocalObjectReference{ - Name: "name", + Executor: v1alpha1.BackupExecutor{ + MySQLDump: &v1alpha1.MySQLDumpBackupExecutor{ + Databases: []v1alpha1.Database{{Name: "test"}}, }, - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", + }, + StorageProvider: v1alpha1.StorageProvider{ + S3: &v1alpha1.S3StorageProvider{ + Endpoint: "endpoint", + Region: "region", + Bucket: "bucket", + CredentialsSecret: &corev1.LocalObjectReference{ + Name: "name", + }, }, }, - ClusterRef: &corev1.LocalObjectReference{}, + Cluster: &corev1.LocalObjectReference{}, }, }, } } -func (b *TestMySQLBackup) WithNamespace(namespace string) *TestMySQLBackup { +func (b *TestBackup) WithNamespace(namespace string) *TestBackup { b.Namespace = namespace return b } -func (b *TestMySQLBackup) WithName(name string) *TestMySQLBackup { +func (b *TestBackup) WithName(name string) *TestBackup { b.Name = name return b } -func (b *TestMySQLBackup) WithLabel(key, value string) *TestMySQLBackup { +func (b *TestBackup) WithLabel(key, value string) *TestBackup { if b.Labels == nil { b.Labels = make(map[string]string) } diff --git a/pkg/util/test/test_backupschedule.go b/pkg/util/test/test_backupschedule.go index 5cba6774a..c2e8cc61a 100644 --- a/pkg/util/test/test_backupschedule.go +++ b/pkg/util/test/test_backupschedule.go @@ -20,62 +20,57 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - api "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" ) -type TestMySQLBackupSchedule struct { - *api.MySQLBackupSchedule +type TestBackupSchedule struct { + *v1alpha1.BackupSchedule } -func NewTestMySQLBackupSchedule(namespace, name string) *TestMySQLBackupSchedule { - return &TestMySQLBackupSchedule{ - MySQLBackupSchedule: &api.MySQLBackupSchedule{ +func NewTestBackupSchedule(namespace, name string) *TestBackupSchedule { + return &TestBackupSchedule{ + BackupSchedule: &v1alpha1.BackupSchedule{ ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, Name: name, Labels: make(map[string]string), }, - Spec: api.BackupScheduleSpec{ - BackupTemplate: api.BackupSpec{ - Executor: &api.Executor{ - Provider: "mysqldump", - Databases: []string{"test"}, - }, - Storage: &api.Storage{ - Provider: "s3", - SecretRef: &corev1.LocalObjectReference{ - Name: "name", + Spec: v1alpha1.BackupScheduleSpec{ + BackupTemplate: v1alpha1.BackupSpec{ + Executor: v1alpha1.BackupExecutor{ + MySQLDump: &v1alpha1.MySQLDumpBackupExecutor{ + Databases: []v1alpha1.Database{{Name: "test"}}, }, - Config: map[string]string{ - "endpoint": "endpoint", - "region": "region", - "bucket": "bucket", + }, + StorageProvider: v1alpha1.StorageProvider{ + S3: &v1alpha1.S3StorageProvider{ + Endpoint: "endpoint", + Region: "region", + Bucket: "bucket", + CredentialsSecret: &corev1.LocalObjectReference{ + Name: "name", + }, }, }, - ClusterRef: &corev1.LocalObjectReference{}, + Cluster: &corev1.LocalObjectReference{}, }, }, }, } } -func (s *TestMySQLBackupSchedule) WithPhase(phase api.BackupSchedulePhase) *TestMySQLBackupSchedule { - s.Status.Phase = phase - return s -} - -func (s *TestMySQLBackupSchedule) WithCronSchedule(cronExpression string) *TestMySQLBackupSchedule { +func (s *TestBackupSchedule) WithCronSchedule(cronExpression string) *TestBackupSchedule { s.Spec.Schedule = cronExpression return s } -func (s *TestMySQLBackupSchedule) WithLastBackupTime(timeString string) *TestMySQLBackupSchedule { +func (s *TestBackupSchedule) WithLastBackupTime(timeString string) *TestBackupSchedule { t, _ := time.Parse("2006-01-02 15:04:05", timeString) s.Status.LastBackup = metav1.Time{Time: t} return s } -func (s *TestMySQLBackupSchedule) WithLabel(key, value string) *TestMySQLBackupSchedule { +func (s *TestBackupSchedule) WithLabel(key, value string) *TestBackupSchedule { s.Labels[key] = value return s } diff --git a/test/e2e/backup_restore.go b/test/e2e/backup_restore.go index de911a7f5..450180ab7 100644 --- a/test/e2e/backup_restore.go +++ b/test/e2e/backup_restore.go @@ -44,13 +44,13 @@ var _ = Describe("Backup/Restore", func() { clusterName := "backup-restore" ns := f.Namespace.Name - clusterJig := framework.NewMySQLClusterTestJig(mcs, cs, clusterName) - backupJig := framework.NewMySQLBackupTestJig(mcs, cs, clusterName) - restoreJig := framework.NewMySQLRestoreTestJig(mcs, cs, clusterName) + clusterJig := framework.NewClusterTestJig(mcs, cs, clusterName) + backupJig := framework.NewBackupTestJig(mcs, cs, clusterName) + restoreJig := framework.NewRestoreTestJig(mcs, cs, clusterName) By("Creating a cluster to backup") - cluster := clusterJig.CreateAndAwaitMySQLClusterOrFail(ns, 3, nil, framework.DefaultTimeout) + cluster := clusterJig.CreateAndAwaitClusterOrFail(ns, 3, nil, framework.DefaultTimeout) By("Creating testdb in the cluster to be backed up") @@ -71,17 +71,17 @@ var _ = Describe("Backup/Restore", func() { By("Backing up testdb") - dbs := []string{framework.TestDBName} - backup := backupJig.CreateAndAwaitMySQLDumpBackupOrFail(ns, clusterName, dbs, func(b *v1alpha1.MySQLBackup) { - b.Spec.Storage = &v1alpha1.Storage{ - Provider: "s3", - SecretRef: &corev1.LocalObjectReference{ - Name: secret.Name, - }, - Config: map[string]string{ - "endpoint": "bristoldev.compat.objectstorage.us-phoenix-1.oraclecloud.com", - "region": "us-phoenix-1", - "bucket": "trjl-test", + dbs := []v1alpha1.Database{{Name: framework.TestDBName}} + backup := backupJig.CreateAndAwaitMySQLDumpBackupOrFail(ns, clusterName, dbs, func(b *v1alpha1.Backup) { + b.Spec.StorageProvider = v1alpha1.StorageProvider{ + S3: &v1alpha1.S3StorageProvider{ + Endpoint: "bristoldev.compat.objectstorage.us-phoenix-1.oraclecloud.com", + Region: "us-phoenix-1", + Bucket: "trjl-test", + ForcePathStyle: true, + CredentialsSecret: &corev1.LocalObjectReference{ + Name: secret.Name, + }, }, } }, framework.DefaultTimeout) @@ -101,7 +101,7 @@ var _ = Describe("Backup/Restore", func() { By("Restoring the backup") - restore := restoreJig.CreateAndAwaitMySQLRestoreOrFail(ns, clusterName, backup.Name, nil, framework.DefaultTimeout) + restore := restoreJig.CreateAndAwaitRestoreOrFail(ns, clusterName, backup.Name, nil, framework.DefaultTimeout) Expect(restore.Status.TimeCompleted).ToNot(BeZero()) By("Checking testdb is present and contains the correct uuid") diff --git a/test/e2e/cluster_creation.go b/test/e2e/cluster_creation.go index 0e1b1d0ab..0bb4fc4a0 100644 --- a/test/e2e/cluster_creation.go +++ b/test/e2e/cluster_creation.go @@ -24,16 +24,16 @@ import ( "github.com/oracle/mysql-operator/test/e2e/framework" ) -var _ = Describe("MySQLCluster creation", func() { +var _ = Describe("Cluster creation", func() { f := framework.NewDefaultFramework("cluster-creation") It("should be possible to create a basic 3 member cluster with a 28 character name", func() { clusterName := "basic-twenty-eight-char-name" Expect(clusterName).To(HaveLen(28)) - jig := framework.NewMySQLClusterTestJig(f.MySQLClientSet, f.ClientSet, clusterName) + jig := framework.NewClusterTestJig(f.MySQLClientSet, f.ClientSet, clusterName) - cluster := jig.CreateAndAwaitMySQLClusterOrFail(f.Namespace.Name, 3, nil, framework.DefaultTimeout) + cluster := jig.CreateAndAwaitClusterOrFail(f.Namespace.Name, 3, nil, framework.DefaultTimeout) expected, err := framework.WriteSQLTest(cluster, cluster.Name+"-0") Expect(err).NotTo(HaveOccurred()) @@ -45,16 +45,16 @@ var _ = Describe("MySQLCluster creation", func() { It("should be possible to create a multi-master cluster", func() { clusterName := "multi-master" - replicas := int32(3) + members := int32(3) - jig := framework.NewMySQLClusterTestJig(f.MySQLClientSet, f.ClientSet, clusterName) + jig := framework.NewClusterTestJig(f.MySQLClientSet, f.ClientSet, clusterName) - cluster := jig.CreateAndAwaitMySQLClusterOrFail(f.Namespace.Name, replicas, func(cluster *v1alpha1.MySQLCluster) { + cluster := jig.CreateAndAwaitClusterOrFail(f.Namespace.Name, members, func(cluster *v1alpha1.Cluster) { cluster.Spec.MultiMaster = true }, framework.DefaultTimeout) By("Checking we can write to and read from to all members") - for i := int32(0); i < replicas; i++ { + for i := int32(0); i < members; i++ { member := fmt.Sprintf("%s-%d", cluster.Name, i) By(fmt.Sprintf("Checking that we can write to and read from %q", member)) diff --git a/test/e2e/container_crash.go b/test/e2e/container_crash.go index bd7b66b99..ca122d1d3 100644 --- a/test/e2e/container_crash.go +++ b/test/e2e/container_crash.go @@ -37,13 +37,13 @@ var _ = Describe("Container crash", func() { mcs = f.MySQLClientSet }) - It("should be the case that single-primary MySQLClusters recover from mysql-server containers crashing", func() { + It("should be the case that single-primary Clusters recover from mysql-server containers crashing", func() { clusterName := "mysql-server-crash" ns := f.Namespace.Name - jig := framework.NewMySQLClusterTestJig(mcs, cs, clusterName) + jig := framework.NewClusterTestJig(mcs, cs, clusterName) - cluster := jig.CreateAndAwaitMySQLClusterOrFail(ns, 3, nil, framework.DefaultTimeout) + cluster := jig.CreateAndAwaitClusterOrFail(ns, 3, nil, framework.DefaultTimeout) primary := framework.GetReadyPrimaryPodName(cs, ns, cluster.Name) @@ -82,13 +82,13 @@ var _ = Describe("Container crash", func() { Expect(actual).To(Equal(expected)) }) - It("should be the case that multi-primary MySQLClusters recover from mysql-server containers crashing", func() { + It("should be the case that multi-primary Clusters recover from mysql-server containers crashing", func() { clusterName := "mysql-server-crash" ns := f.Namespace.Name - jig := framework.NewMySQLClusterTestJig(mcs, cs, clusterName) + jig := framework.NewClusterTestJig(mcs, cs, clusterName) - cluster := jig.CreateAndAwaitMySQLClusterOrFail(ns, 3, func(cluster *v1alpha1.MySQLCluster) { + cluster := jig.CreateAndAwaitClusterOrFail(ns, 3, func(cluster *v1alpha1.Cluster) { cluster.Spec.MultiMaster = true }, framework.DefaultTimeout) @@ -117,13 +117,13 @@ var _ = Describe("Container crash", func() { Expect(actual).To(Equal(expected)) }) - It("should be the case that single-primary MySQLClusters recover from mysql-agent containers crashing", func() { + It("should be the case that single-primary Clusters recover from mysql-agent containers crashing", func() { clusterName := "mysql-agent-crash" ns := f.Namespace.Name - jig := framework.NewMySQLClusterTestJig(mcs, cs, clusterName) + jig := framework.NewClusterTestJig(mcs, cs, clusterName) - cluster := jig.CreateAndAwaitMySQLClusterOrFail(ns, 3, nil, framework.DefaultTimeout) + cluster := jig.CreateAndAwaitClusterOrFail(ns, 3, nil, framework.DefaultTimeout) primary := framework.GetReadyPrimaryPodName(cs, ns, cluster.Name) @@ -162,13 +162,13 @@ var _ = Describe("Container crash", func() { Expect(actual).To(Equal(expected)) }) - It("should be the case that multi-primary MySQLClusters recover from mysql-agent containers crashing", func() { + It("should be the case that multi-primary Clusters recover from mysql-agent containers crashing", func() { clusterName := "mysql-agent-crash" ns := f.Namespace.Name - jig := framework.NewMySQLClusterTestJig(mcs, cs, clusterName) + jig := framework.NewClusterTestJig(mcs, cs, clusterName) - cluster := jig.CreateAndAwaitMySQLClusterOrFail(ns, 3, func(cluster *v1alpha1.MySQLCluster) { + cluster := jig.CreateAndAwaitClusterOrFail(ns, 3, func(cluster *v1alpha1.Cluster) { cluster.Spec.MultiMaster = true }, framework.DefaultTimeout) diff --git a/test/e2e/framework/backup.go b/test/e2e/framework/backup.go index f82fcf3a8..478d4e877 100644 --- a/test/e2e/framework/backup.go +++ b/test/e2e/framework/backup.go @@ -27,12 +27,13 @@ import ( . "github.com/onsi/ginkgo" + backuputil "github.com/oracle/mysql-operator/pkg/api/backup" "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" mysqlclientset "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned" ) -// MySQLBackupTestJig is a jig to help MySQLBackup testing. -type MySQLBackupTestJig struct { +// BackupTestJig is a jig to help Backup testing. +type BackupTestJig struct { ID string Name string Labels map[string]string @@ -41,10 +42,10 @@ type MySQLBackupTestJig struct { KubeClient clientset.Interface } -// NewMySQLBackupTestJig allocates and inits a new MySQLBackupTestJig. -func NewMySQLBackupTestJig(mysqlClient mysqlclientset.Interface, kubeClient clientset.Interface, name string) *MySQLBackupTestJig { +// NewBackupTestJig allocates and inits a new BackupTestJig. +func NewBackupTestJig(mysqlClient mysqlclientset.Interface, kubeClient clientset.Interface, name string) *BackupTestJig { id := string(uuid.NewUUID()) - return &MySQLBackupTestJig{ + return &BackupTestJig{ ID: id, Name: name, Labels: map[string]string{ @@ -57,13 +58,13 @@ func NewMySQLBackupTestJig(mysqlClient mysqlclientset.Interface, kubeClient clie } } -// newMySQLBackupTemplate returns the default v1alpha1.MySQLBackup template for -// this jig, but does not actually create the MySQLBackup. The default -// MySQLBackup has the same name as the jig. -func (j *MySQLBackupTestJig) newMySQLBackupTemplate(namespace, clusterName string) *v1alpha1.MySQLBackup { - return &v1alpha1.MySQLBackup{ +// newBackupTemplate returns the default v1alpha1.Backup template for +// this jig, but does not actually create the Backup. The default +// Backup has the same name as the jig. +func (j *BackupTestJig) newBackupTemplate(namespace, clusterName string) *v1alpha1.Backup { + return &v1alpha1.Backup{ TypeMeta: metav1.TypeMeta{ - Kind: v1alpha1.MySQLBackupCRDResourceKind, + Kind: v1alpha1.BackupCRDResourceKind, APIVersion: v1alpha1.SchemeGroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{ @@ -72,48 +73,49 @@ func (j *MySQLBackupTestJig) newMySQLBackupTemplate(namespace, clusterName strin Labels: j.Labels, }, Spec: v1alpha1.BackupSpec{ - ClusterRef: &corev1.LocalObjectReference{ + Cluster: &corev1.LocalObjectReference{ Name: clusterName, }, }, } } -// CreateMySQLBackupOrFail creates a new MySQLBackup based on the jig's -// defaults. Callers can provide a function to tweak the MySQLBackup object +// CreateBackupOrFail creates a new Backup based on the jig's +// defaults. Callers can provide a function to tweak the Backup object // before it is created. -func (j *MySQLBackupTestJig) CreateMySQLBackupOrFail(namespace, clusterName string, tweak func(backup *v1alpha1.MySQLBackup)) *v1alpha1.MySQLBackup { - backup := j.newMySQLBackupTemplate(namespace, clusterName) +func (j *BackupTestJig) CreateBackupOrFail(namespace, clusterName string, tweak func(backup *v1alpha1.Backup)) *v1alpha1.Backup { + backup := j.newBackupTemplate(namespace, clusterName) if tweak != nil { tweak(backup) } name := types.NamespacedName{Namespace: namespace, Name: j.Name} - By(fmt.Sprintf("Creating a MySQLBackup %q", name)) + By(fmt.Sprintf("Creating a Backup %q", name)) - result, err := j.MySQLClient.MysqlV1alpha1().MySQLBackups(namespace).Create(backup) + result, err := j.MySQLClient.MySQLV1alpha1().Backups(namespace).Create(backup) if err != nil { - Failf("Failed to create MySQLBackup %q: %v", name, err) + Failf("Failed to create Backup %q: %v", name, err) } return result } -// CreateAndAwaitMySQLBackupOrFail creates a new MySQLBackup based on the +// CreateAndAwaitBackupOrFail creates a new Backup based on the // jig's defaults, waits for it to become ready. Callers can provide a function -// to tweak the MySQLBackup object before it is created. -func (j *MySQLBackupTestJig) CreateAndAwaitMySQLBackupOrFail(namespace, clusterName string, tweak func(backup *v1alpha1.MySQLBackup), timeout time.Duration) *v1alpha1.MySQLBackup { - backup := j.CreateMySQLBackupOrFail(namespace, clusterName, tweak) +// to tweak the Backup object before it is created. +func (j *BackupTestJig) CreateAndAwaitBackupOrFail(namespace, clusterName string, tweak func(backup *v1alpha1.Backup), timeout time.Duration) *v1alpha1.Backup { + backup := j.CreateBackupOrFail(namespace, clusterName, tweak) return j.WaitForbackupReadyOrFail(namespace, backup.Name, timeout) } -// CreateAndAwaitMySQLDumpBackupOrFail creates a new MySQLBackup based on the +// CreateAndAwaitMySQLDumpBackupOrFail creates a new Backup based on the // jig's defaults, waits for it to become ready. Callers can provide a function -// to tweak the MySQLBackup object before it is created. -func (j *MySQLBackupTestJig) CreateAndAwaitMySQLDumpBackupOrFail(namespace, clusterName string, databases []string, tweak func(backup *v1alpha1.MySQLBackup), timeout time.Duration) *v1alpha1.MySQLBackup { - backup := j.CreateMySQLBackupOrFail(namespace, clusterName, func(backup *v1alpha1.MySQLBackup) { - backup.Spec.Executor = &v1alpha1.Executor{ - Provider: "mysqldump", - Databases: databases, +// to tweak the Backup object before it is created. +func (j *BackupTestJig) CreateAndAwaitMySQLDumpBackupOrFail(namespace, clusterName string, databases []v1alpha1.Database, tweak func(backup *v1alpha1.Backup), timeout time.Duration) *v1alpha1.Backup { + backup := j.CreateBackupOrFail(namespace, clusterName, func(backup *v1alpha1.Backup) { + backup.Spec.Executor = v1alpha1.BackupExecutor{ + MySQLDump: &v1alpha1.MySQLDumpBackupExecutor{ + Databases: databases, + }, } tweak(backup) }) @@ -123,7 +125,7 @@ func (j *MySQLBackupTestJig) CreateAndAwaitMySQLDumpBackupOrFail(namespace, clus // CreateS3AuthSecret creates a secret containing the S3 (compat.) credentials // for storing backups. -func (j *MySQLBackupTestJig) CreateS3AuthSecret(namespace, name string) (*corev1.Secret, error) { +func (j *BackupTestJig) CreateS3AuthSecret(namespace, name string) (*corev1.Secret, error) { return j.KubeClient.CoreV1().Secrets(namespace).Create(&corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -136,10 +138,10 @@ func (j *MySQLBackupTestJig) CreateS3AuthSecret(namespace, name string) (*corev1 }) } -func (j *MySQLBackupTestJig) waitForConditionOrFail(namespace, name string, timeout time.Duration, message string, conditionFn func(*v1alpha1.MySQLBackup) bool) *v1alpha1.MySQLBackup { - var backup *v1alpha1.MySQLBackup +func (j *BackupTestJig) waitForConditionOrFail(namespace, name string, timeout time.Duration, message string, conditionFn func(*v1alpha1.Backup) bool) *v1alpha1.Backup { + var backup *v1alpha1.Backup pollFunc := func() (bool, error) { - b, err := j.MySQLClient.MysqlV1alpha1().MySQLBackups(namespace).Get(name, metav1.GetOptions{}) + b, err := j.MySQLClient.MySQLV1alpha1().Backups(namespace).Get(name, metav1.GetOptions{}) if err != nil { return false, err } @@ -150,22 +152,22 @@ func (j *MySQLBackupTestJig) waitForConditionOrFail(namespace, name string, time return false, nil } if err := wait.PollImmediate(Poll, timeout, pollFunc); err != nil { - Failf("Timed out waiting for MySQLBackup %q to %s", name, message) + Failf("Timed out waiting for Backup %q to %s", name, message) } return backup } // WaitForbackupReadyOrFail waits up to a given timeout for a backup to be in // the running phase. -func (j *MySQLBackupTestJig) WaitForbackupReadyOrFail(namespace, name string, timeout time.Duration) *v1alpha1.MySQLBackup { - Logf("Waiting up to %v for MySQLBackup \"%s/%s\" to be complete executing", timeout, namespace, name) - backup := j.waitForConditionOrFail(namespace, name, timeout, "to complete executing", func(backup *v1alpha1.MySQLBackup) bool { - phase := backup.Status.Phase - if phase == v1alpha1.BackupPhaseComplete { +func (j *BackupTestJig) WaitForbackupReadyOrFail(namespace, name string, timeout time.Duration) *v1alpha1.Backup { + Logf("Waiting up to %v for Backup \"%s/%s\" to be complete executing", timeout, namespace, name) + backup := j.waitForConditionOrFail(namespace, name, timeout, "to complete executing", func(backup *v1alpha1.Backup) bool { + _, cond := backuputil.GetBackupCondition(&backup.Status, v1alpha1.BackupComplete) + if cond != nil && cond.Status == corev1.ConditionTrue { return true } - - if phase == v1alpha1.BackupPhaseFailed { + _, cond = backuputil.GetBackupCondition(&backup.Status, v1alpha1.BackupFailed) + if cond != nil && cond.Status == corev1.ConditionTrue { ns := backup.Namespace events, err := j.KubeClient.CoreV1().Events(ns).List(metav1.ListOptions{}) if err != nil { @@ -177,7 +179,7 @@ func (j *MySQLBackupTestJig) WaitForbackupReadyOrFail(namespace, name string, ti } Logf(e.String()) } - Failf("MySQLBackup entered state %q", v1alpha1.BackupPhaseFailed) + Failf("Backup condition failed (%s==%s)", cond.Type, cond.Status) } return false }) diff --git a/test/e2e/framework/cluster.go b/test/e2e/framework/cluster.go index ffab2e876..6a49f7ad0 100644 --- a/test/e2e/framework/cluster.go +++ b/test/e2e/framework/cluster.go @@ -30,7 +30,8 @@ import ( . "github.com/onsi/ginkgo" "github.com/pkg/errors" - v1 "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" + clusterutil "github.com/oracle/mysql-operator/pkg/api/cluster" + "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" "github.com/oracle/mysql-operator/pkg/controllers/cluster/labeler" mysqlclientset "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned" "github.com/oracle/mysql-operator/pkg/resources/secrets" @@ -39,8 +40,8 @@ import ( // TestDBName is the name of database to use when executing test SQL queries. const TestDBName = "testdb" -// MySQLClusterTestJig is a jig to help MySQLCluster testing. -type MySQLClusterTestJig struct { +// ClusterTestJig is a jig to help Cluster testing. +type ClusterTestJig struct { ID string Name string Labels map[string]string @@ -49,10 +50,10 @@ type MySQLClusterTestJig struct { KubeClient clientset.Interface } -// NewMySQLClusterTestJig allocates and inits a new MySQLClusterTestJig. -func NewMySQLClusterTestJig(mysqlClient mysqlclientset.Interface, kubeClient clientset.Interface, name string) *MySQLClusterTestJig { +// NewClusterTestJig allocates and inits a new ClusterTestJig. +func NewClusterTestJig(mysqlClient mysqlclientset.Interface, kubeClient clientset.Interface, name string) *ClusterTestJig { id := string(uuid.NewUUID()) - return &MySQLClusterTestJig{ + return &ClusterTestJig{ ID: id, Name: name, Labels: map[string]string{ @@ -65,56 +66,56 @@ func NewMySQLClusterTestJig(mysqlClient mysqlclientset.Interface, kubeClient cli } } -// newMySQLClusterTemplate returns the default v1.MySQLCluster template for this jig, but -// does not actually create the MySQLCluster. The default MySQLCluster has the same name -// as the jig and has the given number of replicas. -func (j *MySQLClusterTestJig) newMySQLClusterTemplate(namespace string, replicas int32) *v1.MySQLCluster { - return &v1.MySQLCluster{ +// newClusterTemplate returns the default v1.Cluster template for this jig, but +// does not actually create the Cluster. The default Cluster has the same name +// as the jig and has the given number of members. +func (j *ClusterTestJig) newClusterTemplate(namespace string, members int32) *v1alpha1.Cluster { + return &v1alpha1.Cluster{ ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, Name: j.Name, Labels: j.Labels, }, - Spec: v1.MySQLClusterSpec{ - Replicas: replicas, + Spec: v1alpha1.ClusterSpec{ + Members: members, }, } } -// CreateMySQLClusterOrFail creates a new MySQLCluster based on the jig's -// defaults. Callers can provide a function to tweak the MySQLCluster object +// CreateClusterOrFail creates a new Cluster based on the jig's +// defaults. Callers can provide a function to tweak the Cluster object // before it is created. -func (j *MySQLClusterTestJig) CreateMySQLClusterOrFail(namespace string, replicas int32, tweak func(cluster *v1.MySQLCluster)) *v1.MySQLCluster { - cluster := j.newMySQLClusterTemplate(namespace, replicas) +func (j *ClusterTestJig) CreateClusterOrFail(namespace string, members int32, tweak func(cluster *v1alpha1.Cluster)) *v1alpha1.Cluster { + cluster := j.newClusterTemplate(namespace, members) if tweak != nil { tweak(cluster) } name := types.NamespacedName{Namespace: namespace, Name: j.Name} - By(fmt.Sprintf("Creating a MySQLCluster %q with .spec.replicas=%d", name, replicas)) + By(fmt.Sprintf("Creating a Cluster %q with .spec.members=%d", name, members)) - result, err := j.MySQLClient.MysqlV1alpha1().MySQLClusters(namespace).Create(cluster) + result, err := j.MySQLClient.MySQLV1alpha1().Clusters(namespace).Create(cluster) if err != nil { - Failf("Failed to create MySQLCluster %q: %v", name, err) + Failf("Failed to create Cluster %q: %v", name, err) } return result } -// CreateAndAwaitMySQLClusterOrFail creates a new MySQLCluster based on the +// CreateAndAwaitClusterOrFail creates a new Cluster based on the // jig's defaults, waits for it to become ready, and then sanity checks it and // its dependant resources. Callers can provide a function to tweak the -// MySQLCluster object before it is created. -func (j *MySQLClusterTestJig) CreateAndAwaitMySQLClusterOrFail(namespace string, replicas int32, tweak func(cluster *v1.MySQLCluster), timeout time.Duration) *v1.MySQLCluster { - cluster := j.CreateMySQLClusterOrFail(namespace, replicas, tweak) +// Cluster object before it is created. +func (j *ClusterTestJig) CreateAndAwaitClusterOrFail(namespace string, members int32, tweak func(cluster *v1alpha1.Cluster), timeout time.Duration) *v1alpha1.Cluster { + cluster := j.CreateClusterOrFail(namespace, members, tweak) cluster = j.WaitForClusterReadyOrFail(namespace, cluster.Name, timeout) - j.SanityCheckMySQLCluster(cluster) + j.SanityCheckCluster(cluster) return cluster } -func (j *MySQLClusterTestJig) waitForConditionOrFail(namespace, name string, timeout time.Duration, message string, conditionFn func(*v1.MySQLCluster) bool) *v1.MySQLCluster { - var cluster *v1.MySQLCluster +func (j *ClusterTestJig) waitForConditionOrFail(namespace, name string, timeout time.Duration, message string, conditionFn func(*v1alpha1.Cluster) bool) *v1alpha1.Cluster { + var cluster *v1alpha1.Cluster pollFunc := func() (bool, error) { - c, err := j.MySQLClient.MysqlV1alpha1().MySQLClusters(namespace).Get(name, metav1.GetOptions{}) + c, err := j.MySQLClient.MySQLV1alpha1().Clusters(namespace).Get(name, metav1.GetOptions{}) if err != nil { return false, err } @@ -125,41 +126,38 @@ func (j *MySQLClusterTestJig) waitForConditionOrFail(namespace, name string, tim return false, nil } if err := wait.PollImmediate(Poll, timeout, pollFunc); err != nil { - Failf("Timed out waiting for MySQLCluster %q to %s", name, message) + Failf("Timed out waiting for Cluster %q to %s", name, message) } return cluster } // WaitForClusterReadyOrFail waits up to a given timeout for a cluster to be in // the running phase. -func (j *MySQLClusterTestJig) WaitForClusterReadyOrFail(namespace, name string, timeout time.Duration) *v1.MySQLCluster { - Logf("Waiting up to %v for MySQLCluster \"%s/%s\" to be ready", timeout, namespace, name) - cluster := j.waitForConditionOrFail(namespace, name, timeout, "have all nodes ready", func(cluster *v1.MySQLCluster) bool { - if cluster.Status.Phase == v1.MySQLClusterRunning { - return true - } - return false +func (j *ClusterTestJig) WaitForClusterReadyOrFail(namespace, name string, timeout time.Duration) *v1alpha1.Cluster { + Logf("Waiting up to %v for Cluster \"%s/%s\" to be ready", timeout, namespace, name) + cluster := j.waitForConditionOrFail(namespace, name, timeout, "have all nodes ready", func(cluster *v1alpha1.Cluster) bool { + return clusterutil.IsClusterReady(cluster) }) return cluster } -// SanityCheckMySQLCluster checks basic properties of a given MySQLCluster match +// SanityCheckCluster checks basic properties of a given Cluster match // our expectations. -func (j *MySQLClusterTestJig) SanityCheckMySQLCluster(cluster *v1.MySQLCluster) { +func (j *ClusterTestJig) SanityCheckCluster(cluster *v1alpha1.Cluster) { name := types.NamespacedName{Namespace: cluster.Namespace, Name: cluster.Name} ss, err := j.KubeClient.AppsV1beta1().StatefulSets(cluster.Namespace).Get(cluster.Name, metav1.GetOptions{}) if err != nil { - Failf("Failed to get StatefulSet %[1]q for MySQLCluster %[1]q: %[2]v", name, err) + Failf("Failed to get StatefulSet %[1]q for Cluster %[1]q: %[2]v", name, err) } - if ss.Status.ReadyReplicas != cluster.Spec.Replicas { - Failf("StatefulSet %q has %d ready replica(s), want %d", name, ss.Status.ReadyReplicas, cluster.Spec.Replicas) + if ss.Status.ReadyReplicas != cluster.Spec.Members { + Failf("StatefulSet %q has %d ready replica(s), want %d", name, ss.Status.ReadyReplicas, cluster.Spec.Members) } // Do we have a service? _, err = j.KubeClient.CoreV1().Services(cluster.Namespace).Get(cluster.Name, metav1.GetOptions{}) if err != nil { - Failf("Failed to get Servce %[1]q for MySQLCluster %[1]q: %v", name, err) + Failf("Failed to get Servce %[1]q for Cluster %[1]q: %v", name, err) } // Do we have a root password secret? @@ -170,9 +168,9 @@ func (j *MySQLClusterTestJig) SanityCheckMySQLCluster(cluster *v1.MySQLCluster) } } -// ExecuteSQLOrDie executes the given SQL statement(s) on a specified MySQLCluster -// member via kubectl exec. -func ExecuteSQL(cluster *v1.MySQLCluster, member, sql string) (string, error) { +// ExecuteSQL executes the given SQL statement(s) on a specified Cluster member +// via kubectl exec. +func ExecuteSQL(cluster *v1alpha1.Cluster, member, sql string) (string, error) { cmd := fmt.Sprintf("mysql -h %s.%s -u root -p$MYSQL_ROOT_PASSWORD -e '%s'", member, cluster.Name, sql) return RunKubectl(fmt.Sprintf("--namespace=%v", cluster.Namespace), "exec", member, "-c", "mysql", @@ -185,7 +183,7 @@ func lastLine(out string) string { } // ReadSQLTest SELECTs v from testdb.foo where k=foo. -func ReadSQLTest(cluster *v1.MySQLCluster, member string) (string, error) { +func ReadSQLTest(cluster *v1alpha1.Cluster, member string) (string, error) { By("SELECT v FROM foo WHERE k=\"foo\"") output, err := ExecuteSQL(cluster, member, strings.Join([]string{ fmt.Sprintf("use %s;", TestDBName), @@ -200,7 +198,7 @@ func ReadSQLTest(cluster *v1.MySQLCluster, member string) (string, error) { // WriteSQLTest creates a test table, inserts a row, and writes a uuid into it. // It returns the generated UUID. -func WriteSQLTest(cluster *v1.MySQLCluster, member string) (string, error) { +func WriteSQLTest(cluster *v1alpha1.Cluster, member string) (string, error) { By("Creating a database and table, writing to that table, and writing a uuid") id := uuid.NewUUID() if _, err := ExecuteSQL(cluster, member, strings.Join([]string{ diff --git a/test/e2e/framework/restore.go b/test/e2e/framework/restore.go index b272d7ac2..c7f0c0b5f 100644 --- a/test/e2e/framework/restore.go +++ b/test/e2e/framework/restore.go @@ -27,12 +27,13 @@ import ( . "github.com/onsi/ginkgo" + restoreutil "github.com/oracle/mysql-operator/pkg/api/restore" "github.com/oracle/mysql-operator/pkg/apis/mysql/v1alpha1" mysqlclientset "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned" ) -// MySQLRestoreTestJig is a jig to help MySQLRestore testing. -type MySQLRestoreTestJig struct { +// RestoreTestJig is a jig to help Restore testing. +type RestoreTestJig struct { ID string Name string Labels map[string]string @@ -41,10 +42,10 @@ type MySQLRestoreTestJig struct { KubeClient clientset.Interface } -// NewMySQLRestoreTestJig allocates and inits a new MySQLRestoreTestJig. -func NewMySQLRestoreTestJig(mysqlClient mysqlclientset.Interface, kubeClient clientset.Interface, name string) *MySQLRestoreTestJig { +// NewRestoreTestJig allocates and inits a new RestoreTestJig. +func NewRestoreTestJig(mysqlClient mysqlclientset.Interface, kubeClient clientset.Interface, name string) *RestoreTestJig { id := string(uuid.NewUUID()) - return &MySQLRestoreTestJig{ + return &RestoreTestJig{ ID: id, Name: name, Labels: map[string]string{ @@ -57,58 +58,58 @@ func NewMySQLRestoreTestJig(mysqlClient mysqlclientset.Interface, kubeClient cli } } -// newMySQLRestoreTemplate returns the default v1alpha1.MySQLRestore template for this jig, but -// does not actually create the MySQLRestore. The default MySQLRestore has the +// newRestoreTemplate returns the default v1alpha1.Restore template for this jig, but +// does not actually create the Restore. The default Restore has the // same name as the jig. -func (j *MySQLRestoreTestJig) newMySQLRestoreTemplate(namespace, clusterName, backupName string) *v1alpha1.MySQLRestore { - return &v1alpha1.MySQLRestore{ +func (j *RestoreTestJig) newRestoreTemplate(namespace, clusterName, backupName string) *v1alpha1.Restore { + return &v1alpha1.Restore{ ObjectMeta: metav1.ObjectMeta{ GenerateName: j.Name, Namespace: namespace, Labels: j.Labels, }, Spec: v1alpha1.RestoreSpec{ - ClusterRef: &corev1.LocalObjectReference{ + Cluster: &corev1.LocalObjectReference{ Name: clusterName, }, - BackupRef: &corev1.LocalObjectReference{ + Backup: &corev1.LocalObjectReference{ Name: backupName, }, }, } } -// CreateMySQLRestoreOrFail creates a new MySQLRestore based on the jig's -// defaults. Callers can provide a function to tweak the MySQLRestore object +// CreateRestoreOrFail creates a new Restore based on the jig's +// defaults. Callers can provide a function to tweak the Restore object // before it is created. -func (j *MySQLRestoreTestJig) CreateMySQLRestoreOrFail(namespace, clusterName, backupName string, tweak func(restore *v1alpha1.MySQLRestore)) *v1alpha1.MySQLRestore { - restore := j.newMySQLRestoreTemplate(namespace, clusterName, backupName) +func (j *RestoreTestJig) CreateRestoreOrFail(namespace, clusterName, backupName string, tweak func(restore *v1alpha1.Restore)) *v1alpha1.Restore { + restore := j.newRestoreTemplate(namespace, clusterName, backupName) if tweak != nil { tweak(restore) } name := types.NamespacedName{Namespace: namespace, Name: j.Name} - By(fmt.Sprintf("Creating a MySQLRestore %q", name)) + By(fmt.Sprintf("Creating a Restore %q", name)) - result, err := j.MySQLClient.MysqlV1alpha1().MySQLRestores(namespace).Create(restore) + result, err := j.MySQLClient.MySQLV1alpha1().Restores(namespace).Create(restore) if err != nil { - Failf("Failed to create MySQLRestore %q: %v", name, err) + Failf("Failed to create Restore %q: %v", name, err) } return result } -// CreateAndAwaitMySQLRestoreOrFail creates a new MySQLRestore based on the +// CreateAndAwaitRestoreOrFail creates a new Restore based on the // jig's defaults, waits for it to become ready. Callers can provide a function -// to tweak the MySQLRestore object before it is created. -func (j *MySQLRestoreTestJig) CreateAndAwaitMySQLRestoreOrFail(namespace, clusterName, backupName string, tweak func(restore *v1alpha1.MySQLRestore), timeout time.Duration) *v1alpha1.MySQLRestore { - restore := j.CreateMySQLRestoreOrFail(namespace, clusterName, backupName, tweak) +// to tweak the Restore object before it is created. +func (j *RestoreTestJig) CreateAndAwaitRestoreOrFail(namespace, clusterName, backupName string, tweak func(restore *v1alpha1.Restore), timeout time.Duration) *v1alpha1.Restore { + restore := j.CreateRestoreOrFail(namespace, clusterName, backupName, tweak) restore = j.WaitForRestoreCompleteOrFail(namespace, restore.Name, timeout) return restore } // CreateS3AuthSecret creates a secret containing the S3 (compat.) credentials // for storing backups. -func (j *MySQLRestoreTestJig) CreateS3AuthSecret(namespace, name string) (*corev1.Secret, error) { +func (j *RestoreTestJig) CreateS3AuthSecret(namespace, name string) (*corev1.Secret, error) { return j.KubeClient.CoreV1().Secrets(namespace).Create(&corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -121,10 +122,10 @@ func (j *MySQLRestoreTestJig) CreateS3AuthSecret(namespace, name string) (*corev }) } -func (j *MySQLRestoreTestJig) waitForConditionOrFail(namespace, name string, timeout time.Duration, message string, conditionFn func(*v1alpha1.MySQLRestore) bool) *v1alpha1.MySQLRestore { - var restore *v1alpha1.MySQLRestore +func (j *RestoreTestJig) waitForConditionOrFail(namespace, name string, timeout time.Duration, message string, conditionFn func(*v1alpha1.Restore) bool) *v1alpha1.Restore { + var restore *v1alpha1.Restore pollFunc := func() (bool, error) { - r, err := j.MySQLClient.MysqlV1alpha1().MySQLRestores(namespace).Get(name, metav1.GetOptions{}) + r, err := j.MySQLClient.MySQLV1alpha1().Restores(namespace).Get(name, metav1.GetOptions{}) if err != nil { return false, err } @@ -135,22 +136,22 @@ func (j *MySQLRestoreTestJig) waitForConditionOrFail(namespace, name string, tim return false, nil } if err := wait.PollImmediate(Poll, timeout, pollFunc); err != nil { - Failf("Timed out waiting for MySQLRestore %q to %s", name, message) + Failf("Timed out waiting for Restore %q to %s", name, message) } return restore } -// WaitForRestoreCompleteOrFail waits up to a given timeout for a MySQLRestore +// WaitForRestoreCompleteOrFail waits up to a given timeout for a Restore // to enter the complete phase. -func (j *MySQLRestoreTestJig) WaitForRestoreCompleteOrFail(namespace, name string, timeout time.Duration) *v1alpha1.MySQLRestore { - Logf("Waiting up to %v for MySQLRestore \"%s/%s\" to be complete executing", timeout, namespace, name) - restore := j.waitForConditionOrFail(namespace, name, timeout, "to complete executing", func(restore *v1alpha1.MySQLRestore) bool { - phase := restore.Status.Phase - if phase == v1alpha1.RestorePhaseComplete { +func (j *RestoreTestJig) WaitForRestoreCompleteOrFail(namespace, name string, timeout time.Duration) *v1alpha1.Restore { + Logf("Waiting up to %v for Restore \"%s/%s\" to be complete executing", timeout, namespace, name) + restore := j.waitForConditionOrFail(namespace, name, timeout, "to complete executing", func(restore *v1alpha1.Restore) bool { + _, cond := restoreutil.GetRestoreCondition(&restore.Status, v1alpha1.RestoreComplete) + if cond != nil && cond.Status == corev1.ConditionTrue { return true } - - if phase == v1alpha1.RestorePhaseFailed { + _, cond = restoreutil.GetRestoreCondition(&restore.Status, v1alpha1.RestoreFailed) + if cond != nil && cond.Status == corev1.ConditionTrue { ns := restore.Namespace events, err := j.KubeClient.CoreV1().Events(ns).List(metav1.ListOptions{}) if err != nil { @@ -162,7 +163,7 @@ func (j *MySQLRestoreTestJig) WaitForRestoreCompleteOrFail(namespace, name strin } Logf(e.String()) } - Failf("MySQLRestore entered state %q", v1alpha1.RestorePhaseFailed) + Failf("Restore condition failed (%s==%s)", cond.Type, cond.Status) } return false }) diff --git a/test/e2e/pod_crash.go b/test/e2e/pod_crash.go index 9f8d0ece1..e673795fa 100644 --- a/test/e2e/pod_crash.go +++ b/test/e2e/pod_crash.go @@ -38,14 +38,14 @@ var _ = Describe("Pod crash", func() { mcs = f.MySQLClientSet }) - It("should be the case that single-primary MySQLClusters recover from Pods crashing", func() { + It("should be the case that single-primary Clusters recover from Pods crashing", func() { clusterName := "pod-crash" ns := f.Namespace.Name grace := int64(0) // kill don't gracefully terminate - jig := framework.NewMySQLClusterTestJig(mcs, cs, clusterName) + jig := framework.NewClusterTestJig(mcs, cs, clusterName) - cluster := jig.CreateAndAwaitMySQLClusterOrFail(ns, 3, nil, framework.DefaultTimeout) + cluster := jig.CreateAndAwaitClusterOrFail(ns, 3, nil, framework.DefaultTimeout) primary := framework.GetReadyPrimaryPodName(cs, ns, cluster.Name) @@ -79,14 +79,14 @@ var _ = Describe("Pod crash", func() { Expect(actual).To(Equal(expected)) }) - It("should be the case that multi-primary MySQLClusters recover from Pods crashing", func() { + It("should be the case that multi-primary Clusters recover from Pods crashing", func() { clusterName := "pod-crash" ns := f.Namespace.Name grace := int64(0) // kill don't gracefully terminate - jig := framework.NewMySQLClusterTestJig(mcs, cs, clusterName) + jig := framework.NewClusterTestJig(mcs, cs, clusterName) - cluster := jig.CreateAndAwaitMySQLClusterOrFail(ns, 3, func(cluster *v1alpha1.MySQLCluster) { + cluster := jig.CreateAndAwaitClusterOrFail(ns, 3, func(cluster *v1alpha1.Cluster) { cluster.Spec.MultiMaster = true }, framework.DefaultTimeout) diff --git a/test/examples/examples_test.go b/test/examples/examples_test.go index cd6f8a947..37004cc31 100644 --- a/test/examples/examples_test.go +++ b/test/examples/examples_test.go @@ -20,27 +20,27 @@ func TestRemoveInstanceFromCluster(t *testing.T) { kind := getKind(t, file) t.Logf("validating file: %s of kind: %v", file, kind) switch kind { - case "MySQLCluster": - validateMySQLCluster(t, file) - case "MySQLBackup": - validateMySQLBackup(t, file) - case "MySQLRestore": - validateMySQLRestore(t, file) - case "MySQLBackupSchedule": - validateMySQLBackupSchedule(t, file) + case "Cluster": + validateCluster(t, file) + case "Backup": + validateBackup(t, file) + case "Restore": + validateRestore(t, file) + case "BackupSchedule": + validateBackupSchedule(t, file) default: t.Logf("ignoring file: %s of kind: %v", file, kind) } } } -func validateMySQLCluster(t *testing.T, file string) { +func validateCluster(t *testing.T, file string) { bytes, err := ioutil.ReadFile(file) if err != nil { t.Errorf("Failed to read file: %s, err: %v", file, err) return } - var r v1alpha1.MySQLCluster + var r v1alpha1.Cluster err = yaml.Unmarshal(bytes, &r) if err != nil { t.Errorf("Failed to parse file: %s, err: %v", file, err) @@ -54,20 +54,20 @@ func validateMySQLCluster(t *testing.T, file string) { } } -func validateMySQLBackup(t *testing.T, file string) { +func validateBackup(t *testing.T, file string) { bytes, err := ioutil.ReadFile(file) if err != nil { t.Errorf("Failed to read file: %s, err: %v", file, err) return } - var r v1alpha1.MySQLBackup + var r v1alpha1.Backup err = yaml.Unmarshal(bytes, &r) if err != nil { t.Errorf("Failed to parse file: %s, err: %v", file, err) return } - r.Spec.ClusterRef = &corev1.LocalObjectReference{} - r.Spec.Storage.SecretRef = &corev1.LocalObjectReference{Name: "test"} + r.Spec.Cluster = &corev1.LocalObjectReference{} + r.Spec.StorageProvider.S3.CredentialsSecret = &corev1.LocalObjectReference{Name: "test"} resource := r.EnsureDefaults() err = resource.Validate() if err != nil { @@ -76,13 +76,13 @@ func validateMySQLBackup(t *testing.T, file string) { } } -func validateMySQLRestore(t *testing.T, file string) { +func validateRestore(t *testing.T, file string) { bytes, err := ioutil.ReadFile(file) if err != nil { t.Errorf("Failed to read file: %s, err: %v", file, err) return } - var r v1alpha1.MySQLRestore + var r v1alpha1.Restore err = yaml.Unmarshal(bytes, &r) if err != nil { t.Errorf("Failed to parse file: %s, err: %v", file, err) @@ -96,13 +96,13 @@ func validateMySQLRestore(t *testing.T, file string) { } } -func validateMySQLBackupSchedule(t *testing.T, file string) { +func validateBackupSchedule(t *testing.T, file string) { bytes, err := ioutil.ReadFile(file) if err != nil { t.Errorf("Failed to read file: %s, err: %v", file, err) return } - var r v1alpha1.MySQLBackupSchedule + var r v1alpha1.BackupSchedule err = yaml.Unmarshal(bytes, &r) if err != nil { t.Errorf("Failed to parse file: %s, err: %v", file, err) diff --git a/vendor/github.com/google/btree/.travis.yml b/vendor/github.com/google/btree/.travis.yml deleted file mode 100644 index 4f2ee4d97..000000000 --- a/vendor/github.com/google/btree/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: go diff --git a/vendor/github.com/google/btree/LICENSE b/vendor/github.com/google/btree/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/google/btree/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/google/btree/README.md b/vendor/github.com/google/btree/README.md deleted file mode 100644 index 6062a4dac..000000000 --- a/vendor/github.com/google/btree/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# BTree implementation for Go - -![Travis CI Build Status](https://api.travis-ci.org/google/btree.svg?branch=master) - -This package provides an in-memory B-Tree implementation for Go, useful as -an ordered, mutable data structure. - -The API is based off of the wonderful -http://godoc.org/github.com/petar/GoLLRB/llrb, and is meant to allow btree to -act as a drop-in replacement for gollrb trees. - -See http://godoc.org/github.com/google/btree for documentation. diff --git a/vendor/github.com/google/btree/btree.go b/vendor/github.com/google/btree/btree.go deleted file mode 100644 index eb74b1d39..000000000 --- a/vendor/github.com/google/btree/btree.go +++ /dev/null @@ -1,821 +0,0 @@ -// Copyright 2014 Google Inc. -// -// 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 btree implements in-memory B-Trees of arbitrary degree. -// -// btree implements an in-memory B-Tree for use as an ordered data structure. -// It is not meant for persistent storage solutions. -// -// It has a flatter structure than an equivalent red-black or other binary tree, -// which in some cases yields better memory usage and/or performance. -// See some discussion on the matter here: -// http://google-opensource.blogspot.com/2013/01/c-containers-that-save-memory-and-time.html -// Note, though, that this project is in no way related to the C++ B-Tree -// implementation written about there. -// -// Within this tree, each node contains a slice of items and a (possibly nil) -// slice of children. For basic numeric values or raw structs, this can cause -// efficiency differences when compared to equivalent C++ template code that -// stores values in arrays within the node: -// * Due to the overhead of storing values as interfaces (each -// value needs to be stored as the value itself, then 2 words for the -// interface pointing to that value and its type), resulting in higher -// memory use. -// * Since interfaces can point to values anywhere in memory, values are -// most likely not stored in contiguous blocks, resulting in a higher -// number of cache misses. -// These issues don't tend to matter, though, when working with strings or other -// heap-allocated structures, since C++-equivalent structures also must store -// pointers and also distribute their values across the heap. -// -// This implementation is designed to be a drop-in replacement to gollrb.LLRB -// trees, (http://github.com/petar/gollrb), an excellent and probably the most -// widely used ordered tree implementation in the Go ecosystem currently. -// Its functions, therefore, exactly mirror those of -// llrb.LLRB where possible. Unlike gollrb, though, we currently don't -// support storing multiple equivalent values. -package btree - -import ( - "fmt" - "io" - "sort" - "strings" - "sync" -) - -// Item represents a single object in the tree. -type Item interface { - // Less tests whether the current item is less than the given argument. - // - // This must provide a strict weak ordering. - // If !a.Less(b) && !b.Less(a), we treat this to mean a == b (i.e. we can only - // hold one of either a or b in the tree). - Less(than Item) bool -} - -const ( - DefaultFreeListSize = 32 -) - -var ( - nilItems = make(items, 16) - nilChildren = make(children, 16) -) - -// FreeList represents a free list of btree nodes. By default each -// BTree has its own FreeList, but multiple BTrees can share the same -// FreeList. -// Two Btrees using the same freelist are safe for concurrent write access. -type FreeList struct { - mu sync.Mutex - freelist []*node -} - -// NewFreeList creates a new free list. -// size is the maximum size of the returned free list. -func NewFreeList(size int) *FreeList { - return &FreeList{freelist: make([]*node, 0, size)} -} - -func (f *FreeList) newNode() (n *node) { - f.mu.Lock() - index := len(f.freelist) - 1 - if index < 0 { - f.mu.Unlock() - return new(node) - } - n = f.freelist[index] - f.freelist[index] = nil - f.freelist = f.freelist[:index] - f.mu.Unlock() - return -} - -func (f *FreeList) freeNode(n *node) { - f.mu.Lock() - if len(f.freelist) < cap(f.freelist) { - f.freelist = append(f.freelist, n) - } - f.mu.Unlock() -} - -// ItemIterator allows callers of Ascend* to iterate in-order over portions of -// the tree. When this function returns false, iteration will stop and the -// associated Ascend* function will immediately return. -type ItemIterator func(i Item) bool - -// New creates a new B-Tree with the given degree. -// -// New(2), for example, will create a 2-3-4 tree (each node contains 1-3 items -// and 2-4 children). -func New(degree int) *BTree { - return NewWithFreeList(degree, NewFreeList(DefaultFreeListSize)) -} - -// NewWithFreeList creates a new B-Tree that uses the given node free list. -func NewWithFreeList(degree int, f *FreeList) *BTree { - if degree <= 1 { - panic("bad degree") - } - return &BTree{ - degree: degree, - cow: ©OnWriteContext{freelist: f}, - } -} - -// items stores items in a node. -type items []Item - -// insertAt inserts a value into the given index, pushing all subsequent values -// forward. -func (s *items) insertAt(index int, item Item) { - *s = append(*s, nil) - if index < len(*s) { - copy((*s)[index+1:], (*s)[index:]) - } - (*s)[index] = item -} - -// removeAt removes a value at a given index, pulling all subsequent values -// back. -func (s *items) removeAt(index int) Item { - item := (*s)[index] - copy((*s)[index:], (*s)[index+1:]) - (*s)[len(*s)-1] = nil - *s = (*s)[:len(*s)-1] - return item -} - -// pop removes and returns the last element in the list. -func (s *items) pop() (out Item) { - index := len(*s) - 1 - out = (*s)[index] - (*s)[index] = nil - *s = (*s)[:index] - return -} - -// truncate truncates this instance at index so that it contains only the -// first index items. index must be less than or equal to length. -func (s *items) truncate(index int) { - var toClear items - *s, toClear = (*s)[:index], (*s)[index:] - for len(toClear) > 0 { - toClear = toClear[copy(toClear, nilItems):] - } -} - -// find returns the index where the given item should be inserted into this -// list. 'found' is true if the item already exists in the list at the given -// index. -func (s items) find(item Item) (index int, found bool) { - i := sort.Search(len(s), func(i int) bool { - return item.Less(s[i]) - }) - if i > 0 && !s[i-1].Less(item) { - return i - 1, true - } - return i, false -} - -// children stores child nodes in a node. -type children []*node - -// insertAt inserts a value into the given index, pushing all subsequent values -// forward. -func (s *children) insertAt(index int, n *node) { - *s = append(*s, nil) - if index < len(*s) { - copy((*s)[index+1:], (*s)[index:]) - } - (*s)[index] = n -} - -// removeAt removes a value at a given index, pulling all subsequent values -// back. -func (s *children) removeAt(index int) *node { - n := (*s)[index] - copy((*s)[index:], (*s)[index+1:]) - (*s)[len(*s)-1] = nil - *s = (*s)[:len(*s)-1] - return n -} - -// pop removes and returns the last element in the list. -func (s *children) pop() (out *node) { - index := len(*s) - 1 - out = (*s)[index] - (*s)[index] = nil - *s = (*s)[:index] - return -} - -// truncate truncates this instance at index so that it contains only the -// first index children. index must be less than or equal to length. -func (s *children) truncate(index int) { - var toClear children - *s, toClear = (*s)[:index], (*s)[index:] - for len(toClear) > 0 { - toClear = toClear[copy(toClear, nilChildren):] - } -} - -// node is an internal node in a tree. -// -// It must at all times maintain the invariant that either -// * len(children) == 0, len(items) unconstrained -// * len(children) == len(items) + 1 -type node struct { - items items - children children - cow *copyOnWriteContext -} - -func (n *node) mutableFor(cow *copyOnWriteContext) *node { - if n.cow == cow { - return n - } - out := cow.newNode() - if cap(out.items) >= len(n.items) { - out.items = out.items[:len(n.items)] - } else { - out.items = make(items, len(n.items), cap(n.items)) - } - copy(out.items, n.items) - // Copy children - if cap(out.children) >= len(n.children) { - out.children = out.children[:len(n.children)] - } else { - out.children = make(children, len(n.children), cap(n.children)) - } - copy(out.children, n.children) - return out -} - -func (n *node) mutableChild(i int) *node { - c := n.children[i].mutableFor(n.cow) - n.children[i] = c - return c -} - -// split splits the given node at the given index. The current node shrinks, -// and this function returns the item that existed at that index and a new node -// containing all items/children after it. -func (n *node) split(i int) (Item, *node) { - item := n.items[i] - next := n.cow.newNode() - next.items = append(next.items, n.items[i+1:]...) - n.items.truncate(i) - if len(n.children) > 0 { - next.children = append(next.children, n.children[i+1:]...) - n.children.truncate(i + 1) - } - return item, next -} - -// maybeSplitChild checks if a child should be split, and if so splits it. -// Returns whether or not a split occurred. -func (n *node) maybeSplitChild(i, maxItems int) bool { - if len(n.children[i].items) < maxItems { - return false - } - first := n.mutableChild(i) - item, second := first.split(maxItems / 2) - n.items.insertAt(i, item) - n.children.insertAt(i+1, second) - return true -} - -// insert inserts an item into the subtree rooted at this node, making sure -// no nodes in the subtree exceed maxItems items. Should an equivalent item be -// be found/replaced by insert, it will be returned. -func (n *node) insert(item Item, maxItems int) Item { - i, found := n.items.find(item) - if found { - out := n.items[i] - n.items[i] = item - return out - } - if len(n.children) == 0 { - n.items.insertAt(i, item) - return nil - } - if n.maybeSplitChild(i, maxItems) { - inTree := n.items[i] - switch { - case item.Less(inTree): - // no change, we want first split node - case inTree.Less(item): - i++ // we want second split node - default: - out := n.items[i] - n.items[i] = item - return out - } - } - return n.mutableChild(i).insert(item, maxItems) -} - -// get finds the given key in the subtree and returns it. -func (n *node) get(key Item) Item { - i, found := n.items.find(key) - if found { - return n.items[i] - } else if len(n.children) > 0 { - return n.children[i].get(key) - } - return nil -} - -// min returns the first item in the subtree. -func min(n *node) Item { - if n == nil { - return nil - } - for len(n.children) > 0 { - n = n.children[0] - } - if len(n.items) == 0 { - return nil - } - return n.items[0] -} - -// max returns the last item in the subtree. -func max(n *node) Item { - if n == nil { - return nil - } - for len(n.children) > 0 { - n = n.children[len(n.children)-1] - } - if len(n.items) == 0 { - return nil - } - return n.items[len(n.items)-1] -} - -// toRemove details what item to remove in a node.remove call. -type toRemove int - -const ( - removeItem toRemove = iota // removes the given item - removeMin // removes smallest item in the subtree - removeMax // removes largest item in the subtree -) - -// remove removes an item from the subtree rooted at this node. -func (n *node) remove(item Item, minItems int, typ toRemove) Item { - var i int - var found bool - switch typ { - case removeMax: - if len(n.children) == 0 { - return n.items.pop() - } - i = len(n.items) - case removeMin: - if len(n.children) == 0 { - return n.items.removeAt(0) - } - i = 0 - case removeItem: - i, found = n.items.find(item) - if len(n.children) == 0 { - if found { - return n.items.removeAt(i) - } - return nil - } - default: - panic("invalid type") - } - // If we get to here, we have children. - if len(n.children[i].items) <= minItems { - return n.growChildAndRemove(i, item, minItems, typ) - } - child := n.mutableChild(i) - // Either we had enough items to begin with, or we've done some - // merging/stealing, because we've got enough now and we're ready to return - // stuff. - if found { - // The item exists at index 'i', and the child we've selected can give us a - // predecessor, since if we've gotten here it's got > minItems items in it. - out := n.items[i] - // We use our special-case 'remove' call with typ=maxItem to pull the - // predecessor of item i (the rightmost leaf of our immediate left child) - // and set it into where we pulled the item from. - n.items[i] = child.remove(nil, minItems, removeMax) - return out - } - // Final recursive call. Once we're here, we know that the item isn't in this - // node and that the child is big enough to remove from. - return child.remove(item, minItems, typ) -} - -// growChildAndRemove grows child 'i' to make sure it's possible to remove an -// item from it while keeping it at minItems, then calls remove to actually -// remove it. -// -// Most documentation says we have to do two sets of special casing: -// 1) item is in this node -// 2) item is in child -// In both cases, we need to handle the two subcases: -// A) node has enough values that it can spare one -// B) node doesn't have enough values -// For the latter, we have to check: -// a) left sibling has node to spare -// b) right sibling has node to spare -// c) we must merge -// To simplify our code here, we handle cases #1 and #2 the same: -// If a node doesn't have enough items, we make sure it does (using a,b,c). -// We then simply redo our remove call, and the second time (regardless of -// whether we're in case 1 or 2), we'll have enough items and can guarantee -// that we hit case A. -func (n *node) growChildAndRemove(i int, item Item, minItems int, typ toRemove) Item { - if i > 0 && len(n.children[i-1].items) > minItems { - // Steal from left child - child := n.mutableChild(i) - stealFrom := n.mutableChild(i - 1) - stolenItem := stealFrom.items.pop() - child.items.insertAt(0, n.items[i-1]) - n.items[i-1] = stolenItem - if len(stealFrom.children) > 0 { - child.children.insertAt(0, stealFrom.children.pop()) - } - } else if i < len(n.items) && len(n.children[i+1].items) > minItems { - // steal from right child - child := n.mutableChild(i) - stealFrom := n.mutableChild(i + 1) - stolenItem := stealFrom.items.removeAt(0) - child.items = append(child.items, n.items[i]) - n.items[i] = stolenItem - if len(stealFrom.children) > 0 { - child.children = append(child.children, stealFrom.children.removeAt(0)) - } - } else { - if i >= len(n.items) { - i-- - } - child := n.mutableChild(i) - // merge with right child - mergeItem := n.items.removeAt(i) - mergeChild := n.children.removeAt(i + 1) - child.items = append(child.items, mergeItem) - child.items = append(child.items, mergeChild.items...) - child.children = append(child.children, mergeChild.children...) - n.cow.freeNode(mergeChild) - } - return n.remove(item, minItems, typ) -} - -type direction int - -const ( - descend = direction(-1) - ascend = direction(+1) -) - -// iterate provides a simple method for iterating over elements in the tree. -// -// When ascending, the 'start' should be less than 'stop' and when descending, -// the 'start' should be greater than 'stop'. Setting 'includeStart' to true -// will force the iterator to include the first item when it equals 'start', -// thus creating a "greaterOrEqual" or "lessThanEqual" rather than just a -// "greaterThan" or "lessThan" queries. -func (n *node) iterate(dir direction, start, stop Item, includeStart bool, hit bool, iter ItemIterator) (bool, bool) { - var ok bool - switch dir { - case ascend: - for i := 0; i < len(n.items); i++ { - if start != nil && n.items[i].Less(start) { - continue - } - if len(n.children) > 0 { - if hit, ok = n.children[i].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - if !includeStart && !hit && start != nil && !start.Less(n.items[i]) { - hit = true - continue - } - hit = true - if stop != nil && !n.items[i].Less(stop) { - return hit, false - } - if !iter(n.items[i]) { - return hit, false - } - } - if len(n.children) > 0 { - if hit, ok = n.children[len(n.children)-1].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - case descend: - for i := len(n.items) - 1; i >= 0; i-- { - if start != nil && !n.items[i].Less(start) { - if !includeStart || hit || start.Less(n.items[i]) { - continue - } - } - if len(n.children) > 0 { - if hit, ok = n.children[i+1].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - if stop != nil && !stop.Less(n.items[i]) { - return hit, false // continue - } - hit = true - if !iter(n.items[i]) { - return hit, false - } - } - if len(n.children) > 0 { - if hit, ok = n.children[0].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - } - return hit, true -} - -// Used for testing/debugging purposes. -func (n *node) print(w io.Writer, level int) { - fmt.Fprintf(w, "%sNODE:%v\n", strings.Repeat(" ", level), n.items) - for _, c := range n.children { - c.print(w, level+1) - } -} - -// BTree is an implementation of a B-Tree. -// -// BTree stores Item instances in an ordered structure, allowing easy insertion, -// removal, and iteration. -// -// Write operations are not safe for concurrent mutation by multiple -// goroutines, but Read operations are. -type BTree struct { - degree int - length int - root *node - cow *copyOnWriteContext -} - -// copyOnWriteContext pointers determine node ownership... a tree with a write -// context equivalent to a node's write context is allowed to modify that node. -// A tree whose write context does not match a node's is not allowed to modify -// it, and must create a new, writable copy (IE: it's a Clone). -// -// When doing any write operation, we maintain the invariant that the current -// node's context is equal to the context of the tree that requested the write. -// We do this by, before we descend into any node, creating a copy with the -// correct context if the contexts don't match. -// -// Since the node we're currently visiting on any write has the requesting -// tree's context, that node is modifiable in place. Children of that node may -// not share context, but before we descend into them, we'll make a mutable -// copy. -type copyOnWriteContext struct { - freelist *FreeList -} - -// Clone clones the btree, lazily. Clone should not be called concurrently, -// but the original tree (t) and the new tree (t2) can be used concurrently -// once the Clone call completes. -// -// The internal tree structure of b is marked read-only and shared between t and -// t2. Writes to both t and t2 use copy-on-write logic, creating new nodes -// whenever one of b's original nodes would have been modified. Read operations -// should have no performance degredation. Write operations for both t and t2 -// will initially experience minor slow-downs caused by additional allocs and -// copies due to the aforementioned copy-on-write logic, but should converge to -// the original performance characteristics of the original tree. -func (t *BTree) Clone() (t2 *BTree) { - // Create two entirely new copy-on-write contexts. - // This operation effectively creates three trees: - // the original, shared nodes (old b.cow) - // the new b.cow nodes - // the new out.cow nodes - cow1, cow2 := *t.cow, *t.cow - out := *t - t.cow = &cow1 - out.cow = &cow2 - return &out -} - -// maxItems returns the max number of items to allow per node. -func (t *BTree) maxItems() int { - return t.degree*2 - 1 -} - -// minItems returns the min number of items to allow per node (ignored for the -// root node). -func (t *BTree) minItems() int { - return t.degree - 1 -} - -func (c *copyOnWriteContext) newNode() (n *node) { - n = c.freelist.newNode() - n.cow = c - return -} - -func (c *copyOnWriteContext) freeNode(n *node) { - if n.cow == c { - // clear to allow GC - n.items.truncate(0) - n.children.truncate(0) - n.cow = nil - c.freelist.freeNode(n) - } -} - -// ReplaceOrInsert adds the given item to the tree. If an item in the tree -// already equals the given one, it is removed from the tree and returned. -// Otherwise, nil is returned. -// -// nil cannot be added to the tree (will panic). -func (t *BTree) ReplaceOrInsert(item Item) Item { - if item == nil { - panic("nil item being added to BTree") - } - if t.root == nil { - t.root = t.cow.newNode() - t.root.items = append(t.root.items, item) - t.length++ - return nil - } else { - t.root = t.root.mutableFor(t.cow) - if len(t.root.items) >= t.maxItems() { - item2, second := t.root.split(t.maxItems() / 2) - oldroot := t.root - t.root = t.cow.newNode() - t.root.items = append(t.root.items, item2) - t.root.children = append(t.root.children, oldroot, second) - } - } - out := t.root.insert(item, t.maxItems()) - if out == nil { - t.length++ - } - return out -} - -// Delete removes an item equal to the passed in item from the tree, returning -// it. If no such item exists, returns nil. -func (t *BTree) Delete(item Item) Item { - return t.deleteItem(item, removeItem) -} - -// DeleteMin removes the smallest item in the tree and returns it. -// If no such item exists, returns nil. -func (t *BTree) DeleteMin() Item { - return t.deleteItem(nil, removeMin) -} - -// DeleteMax removes the largest item in the tree and returns it. -// If no such item exists, returns nil. -func (t *BTree) DeleteMax() Item { - return t.deleteItem(nil, removeMax) -} - -func (t *BTree) deleteItem(item Item, typ toRemove) Item { - if t.root == nil || len(t.root.items) == 0 { - return nil - } - t.root = t.root.mutableFor(t.cow) - out := t.root.remove(item, t.minItems(), typ) - if len(t.root.items) == 0 && len(t.root.children) > 0 { - oldroot := t.root - t.root = t.root.children[0] - t.cow.freeNode(oldroot) - } - if out != nil { - t.length-- - } - return out -} - -// AscendRange calls the iterator for every value in the tree within the range -// [greaterOrEqual, lessThan), until iterator returns false. -func (t *BTree) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, greaterOrEqual, lessThan, true, false, iterator) -} - -// AscendLessThan calls the iterator for every value in the tree within the range -// [first, pivot), until iterator returns false. -func (t *BTree) AscendLessThan(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, nil, pivot, false, false, iterator) -} - -// AscendGreaterOrEqual calls the iterator for every value in the tree within -// the range [pivot, last], until iterator returns false. -func (t *BTree) AscendGreaterOrEqual(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, pivot, nil, true, false, iterator) -} - -// Ascend calls the iterator for every value in the tree within the range -// [first, last], until iterator returns false. -func (t *BTree) Ascend(iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, nil, nil, false, false, iterator) -} - -// DescendRange calls the iterator for every value in the tree within the range -// [lessOrEqual, greaterThan), until iterator returns false. -func (t *BTree) DescendRange(lessOrEqual, greaterThan Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, lessOrEqual, greaterThan, true, false, iterator) -} - -// DescendLessOrEqual calls the iterator for every value in the tree within the range -// [pivot, first], until iterator returns false. -func (t *BTree) DescendLessOrEqual(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, pivot, nil, true, false, iterator) -} - -// DescendGreaterThan calls the iterator for every value in the tree within -// the range (pivot, last], until iterator returns false. -func (t *BTree) DescendGreaterThan(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, nil, pivot, false, false, iterator) -} - -// Descend calls the iterator for every value in the tree within the range -// [last, first], until iterator returns false. -func (t *BTree) Descend(iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, nil, nil, false, false, iterator) -} - -// Get looks for the key item in the tree, returning it. It returns nil if -// unable to find that item. -func (t *BTree) Get(key Item) Item { - if t.root == nil { - return nil - } - return t.root.get(key) -} - -// Min returns the smallest item in the tree, or nil if the tree is empty. -func (t *BTree) Min() Item { - return min(t.root) -} - -// Max returns the largest item in the tree, or nil if the tree is empty. -func (t *BTree) Max() Item { - return max(t.root) -} - -// Has returns true if the given key is in the tree. -func (t *BTree) Has(key Item) bool { - return t.Get(key) != nil -} - -// Len returns the number of items currently in the tree. -func (t *BTree) Len() int { - return t.length -} - -// Int implements the Item interface for integers. -type Int int - -// Less returns true if int(a) < int(b). -func (a Int) Less(b Item) bool { - return a < b.(Int) -} diff --git a/vendor/github.com/google/btree/btree_mem.go b/vendor/github.com/google/btree/btree_mem.go deleted file mode 100644 index cb95b7fa1..000000000 --- a/vendor/github.com/google/btree/btree_mem.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2014 Google Inc. -// -// 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. - -// +build ignore - -// This binary compares memory usage between btree and gollrb. -package main - -import ( - "flag" - "fmt" - "math/rand" - "runtime" - "time" - - "github.com/google/btree" - "github.com/petar/GoLLRB/llrb" -) - -var ( - size = flag.Int("size", 1000000, "size of the tree to build") - degree = flag.Int("degree", 8, "degree of btree") - gollrb = flag.Bool("llrb", false, "use llrb instead of btree") -) - -func main() { - flag.Parse() - vals := rand.Perm(*size) - var t, v interface{} - v = vals - var stats runtime.MemStats - for i := 0; i < 10; i++ { - runtime.GC() - } - fmt.Println("-------- BEFORE ----------") - runtime.ReadMemStats(&stats) - fmt.Printf("%+v\n", stats) - start := time.Now() - if *gollrb { - tr := llrb.New() - for _, v := range vals { - tr.ReplaceOrInsert(llrb.Int(v)) - } - t = tr // keep it around - } else { - tr := btree.New(*degree) - for _, v := range vals { - tr.ReplaceOrInsert(btree.Int(v)) - } - t = tr // keep it around - } - fmt.Printf("%v inserts in %v\n", *size, time.Since(start)) - fmt.Println("-------- AFTER ----------") - runtime.ReadMemStats(&stats) - fmt.Printf("%+v\n", stats) - for i := 0; i < 10; i++ { - runtime.GC() - } - fmt.Println("-------- AFTER GC ----------") - runtime.ReadMemStats(&stats) - fmt.Printf("%+v\n", stats) - if t == v { - fmt.Println("to make sure vals and tree aren't GC'd") - } -} diff --git a/vendor/github.com/google/btree/btree_test.go b/vendor/github.com/google/btree/btree_test.go deleted file mode 100644 index 5da9d8b69..000000000 --- a/vendor/github.com/google/btree/btree_test.go +++ /dev/null @@ -1,689 +0,0 @@ -// Copyright 2014 Google Inc. -// -// 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 btree - -import ( - "flag" - "fmt" - "math/rand" - "reflect" - "sort" - "sync" - "testing" - "time" -) - -func init() { - seed := time.Now().Unix() - fmt.Println(seed) - rand.Seed(seed) -} - -// perm returns a random permutation of n Int items in the range [0, n). -func perm(n int) (out []Item) { - for _, v := range rand.Perm(n) { - out = append(out, Int(v)) - } - return -} - -// rang returns an ordered list of Int items in the range [0, n). -func rang(n int) (out []Item) { - for i := 0; i < n; i++ { - out = append(out, Int(i)) - } - return -} - -// all extracts all items from a tree in order as a slice. -func all(t *BTree) (out []Item) { - t.Ascend(func(a Item) bool { - out = append(out, a) - return true - }) - return -} - -// rangerev returns a reversed ordered list of Int items in the range [0, n). -func rangrev(n int) (out []Item) { - for i := n - 1; i >= 0; i-- { - out = append(out, Int(i)) - } - return -} - -// allrev extracts all items from a tree in reverse order as a slice. -func allrev(t *BTree) (out []Item) { - t.Descend(func(a Item) bool { - out = append(out, a) - return true - }) - return -} - -var btreeDegree = flag.Int("degree", 32, "B-Tree degree") - -func TestBTree(t *testing.T) { - tr := New(*btreeDegree) - const treeSize = 10000 - for i := 0; i < 10; i++ { - if min := tr.Min(); min != nil { - t.Fatalf("empty min, got %+v", min) - } - if max := tr.Max(); max != nil { - t.Fatalf("empty max, got %+v", max) - } - for _, item := range perm(treeSize) { - if x := tr.ReplaceOrInsert(item); x != nil { - t.Fatal("insert found item", item) - } - } - for _, item := range perm(treeSize) { - if x := tr.ReplaceOrInsert(item); x == nil { - t.Fatal("insert didn't find item", item) - } - } - if min, want := tr.Min(), Item(Int(0)); min != want { - t.Fatalf("min: want %+v, got %+v", want, min) - } - if max, want := tr.Max(), Item(Int(treeSize-1)); max != want { - t.Fatalf("max: want %+v, got %+v", want, max) - } - got := all(tr) - want := rang(treeSize) - if !reflect.DeepEqual(got, want) { - t.Fatalf("mismatch:\n got: %v\nwant: %v", got, want) - } - - gotrev := allrev(tr) - wantrev := rangrev(treeSize) - if !reflect.DeepEqual(gotrev, wantrev) { - t.Fatalf("mismatch:\n got: %v\nwant: %v", got, want) - } - - for _, item := range perm(treeSize) { - if x := tr.Delete(item); x == nil { - t.Fatalf("didn't find %v", item) - } - } - if got = all(tr); len(got) > 0 { - t.Fatalf("some left!: %v", got) - } - } -} - -func ExampleBTree() { - tr := New(*btreeDegree) - for i := Int(0); i < 10; i++ { - tr.ReplaceOrInsert(i) - } - fmt.Println("len: ", tr.Len()) - fmt.Println("get3: ", tr.Get(Int(3))) - fmt.Println("get100: ", tr.Get(Int(100))) - fmt.Println("del4: ", tr.Delete(Int(4))) - fmt.Println("del100: ", tr.Delete(Int(100))) - fmt.Println("replace5: ", tr.ReplaceOrInsert(Int(5))) - fmt.Println("replace100:", tr.ReplaceOrInsert(Int(100))) - fmt.Println("min: ", tr.Min()) - fmt.Println("delmin: ", tr.DeleteMin()) - fmt.Println("max: ", tr.Max()) - fmt.Println("delmax: ", tr.DeleteMax()) - fmt.Println("len: ", tr.Len()) - // Output: - // len: 10 - // get3: 3 - // get100: - // del4: 4 - // del100: - // replace5: 5 - // replace100: - // min: 0 - // delmin: 0 - // max: 100 - // delmax: 100 - // len: 8 -} - -func TestDeleteMin(t *testing.T) { - tr := New(3) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - for v := tr.DeleteMin(); v != nil; v = tr.DeleteMin() { - got = append(got, v) - } - if want := rang(100); !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } -} - -func TestDeleteMax(t *testing.T) { - tr := New(3) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - for v := tr.DeleteMax(); v != nil; v = tr.DeleteMax() { - got = append(got, v) - } - // Reverse our list. - for i := 0; i < len(got)/2; i++ { - got[i], got[len(got)-i-1] = got[len(got)-i-1], got[i] - } - if want := rang(100); !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } -} - -func TestAscendRange(t *testing.T) { - tr := New(2) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.AscendRange(Int(40), Int(60), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rang(100)[40:60]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.AscendRange(Int(40), Int(60), func(a Item) bool { - if a.(Int) > 50 { - return false - } - got = append(got, a) - return true - }) - if want := rang(100)[40:51]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } -} - -func TestDescendRange(t *testing.T) { - tr := New(2) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.DescendRange(Int(60), Int(40), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rangrev(100)[39:59]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendrange:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.DescendRange(Int(60), Int(40), func(a Item) bool { - if a.(Int) < 50 { - return false - } - got = append(got, a) - return true - }) - if want := rangrev(100)[39:50]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendrange:\n got: %v\nwant: %v", got, want) - } -} -func TestAscendLessThan(t *testing.T) { - tr := New(*btreeDegree) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.AscendLessThan(Int(60), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rang(100)[:60]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.AscendLessThan(Int(60), func(a Item) bool { - if a.(Int) > 50 { - return false - } - got = append(got, a) - return true - }) - if want := rang(100)[:51]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } -} - -func TestDescendLessOrEqual(t *testing.T) { - tr := New(*btreeDegree) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.DescendLessOrEqual(Int(40), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rangrev(100)[59:]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendlessorequal:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.DescendLessOrEqual(Int(60), func(a Item) bool { - if a.(Int) < 50 { - return false - } - got = append(got, a) - return true - }) - if want := rangrev(100)[39:50]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendlessorequal:\n got: %v\nwant: %v", got, want) - } -} -func TestAscendGreaterOrEqual(t *testing.T) { - tr := New(*btreeDegree) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.AscendGreaterOrEqual(Int(40), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rang(100)[40:]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.AscendGreaterOrEqual(Int(40), func(a Item) bool { - if a.(Int) > 50 { - return false - } - got = append(got, a) - return true - }) - if want := rang(100)[40:51]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } -} - -func TestDescendGreaterThan(t *testing.T) { - tr := New(*btreeDegree) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.DescendGreaterThan(Int(40), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rangrev(100)[:59]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendgreaterthan:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.DescendGreaterThan(Int(40), func(a Item) bool { - if a.(Int) < 50 { - return false - } - got = append(got, a) - return true - }) - if want := rangrev(100)[:50]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendgreaterthan:\n got: %v\nwant: %v", got, want) - } -} - -const benchmarkTreeSize = 10000 - -func BenchmarkInsert(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - b.StartTimer() - i := 0 - for i < b.N { - tr := New(*btreeDegree) - for _, item := range insertP { - tr.ReplaceOrInsert(item) - i++ - if i >= b.N { - return - } - } - } -} - -func BenchmarkDeleteInsert(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, item := range insertP { - tr.ReplaceOrInsert(item) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - tr.Delete(insertP[i%benchmarkTreeSize]) - tr.ReplaceOrInsert(insertP[i%benchmarkTreeSize]) - } -} - -func BenchmarkDeleteInsertCloneOnce(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, item := range insertP { - tr.ReplaceOrInsert(item) - } - tr = tr.Clone() - b.StartTimer() - for i := 0; i < b.N; i++ { - tr.Delete(insertP[i%benchmarkTreeSize]) - tr.ReplaceOrInsert(insertP[i%benchmarkTreeSize]) - } -} - -func BenchmarkDeleteInsertCloneEachTime(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, item := range insertP { - tr.ReplaceOrInsert(item) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - tr = tr.Clone() - tr.Delete(insertP[i%benchmarkTreeSize]) - tr.ReplaceOrInsert(insertP[i%benchmarkTreeSize]) - } -} - -func BenchmarkDelete(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - removeP := perm(benchmarkTreeSize) - b.StartTimer() - i := 0 - for i < b.N { - b.StopTimer() - tr := New(*btreeDegree) - for _, v := range insertP { - tr.ReplaceOrInsert(v) - } - b.StartTimer() - for _, item := range removeP { - tr.Delete(item) - i++ - if i >= b.N { - return - } - } - if tr.Len() > 0 { - panic(tr.Len()) - } - } -} - -func BenchmarkGet(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - removeP := perm(benchmarkTreeSize) - b.StartTimer() - i := 0 - for i < b.N { - b.StopTimer() - tr := New(*btreeDegree) - for _, v := range insertP { - tr.ReplaceOrInsert(v) - } - b.StartTimer() - for _, item := range removeP { - tr.Get(item) - i++ - if i >= b.N { - return - } - } - } -} - -func BenchmarkGetCloneEachTime(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - removeP := perm(benchmarkTreeSize) - b.StartTimer() - i := 0 - for i < b.N { - b.StopTimer() - tr := New(*btreeDegree) - for _, v := range insertP { - tr.ReplaceOrInsert(v) - } - b.StartTimer() - for _, item := range removeP { - tr = tr.Clone() - tr.Get(item) - i++ - if i >= b.N { - return - } - } - } -} - -type byInts []Item - -func (a byInts) Len() int { - return len(a) -} - -func (a byInts) Less(i, j int) bool { - return a[i].(Int) < a[j].(Int) -} - -func (a byInts) Swap(i, j int) { - a[i], a[j] = a[j], a[i] -} - -func BenchmarkAscend(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := 0 - tr.Ascend(func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j++ - return true - }) - } -} - -func BenchmarkDescend(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := len(arr) - 1 - tr.Descend(func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j-- - return true - }) - } -} -func BenchmarkAscendRange(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := 100 - tr.AscendRange(Int(100), arr[len(arr)-100], func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j++ - return true - }) - if j != len(arr)-100 { - b.Fatalf("expected: %v, got %v", len(arr)-100, j) - } - } -} - -func BenchmarkDescendRange(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := len(arr) - 100 - tr.DescendRange(arr[len(arr)-100], Int(100), func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j-- - return true - }) - if j != 100 { - b.Fatalf("expected: %v, got %v", len(arr)-100, j) - } - } -} -func BenchmarkAscendGreaterOrEqual(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := 100 - k := 0 - tr.AscendGreaterOrEqual(Int(100), func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j++ - k++ - return true - }) - if j != len(arr) { - b.Fatalf("expected: %v, got %v", len(arr), j) - } - if k != len(arr)-100 { - b.Fatalf("expected: %v, got %v", len(arr)-100, k) - } - } -} -func BenchmarkDescendLessOrEqual(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := len(arr) - 100 - k := len(arr) - tr.DescendLessOrEqual(arr[len(arr)-100], func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j-- - k-- - return true - }) - if j != -1 { - b.Fatalf("expected: %v, got %v", -1, j) - } - if k != 99 { - b.Fatalf("expected: %v, got %v", 99, k) - } - } -} - -const cloneTestSize = 10000 - -func cloneTest(t *testing.T, b *BTree, start int, p []Item, wg *sync.WaitGroup, trees *[]*BTree) { - t.Logf("Starting new clone at %v", start) - *trees = append(*trees, b) - for i := start; i < cloneTestSize; i++ { - b.ReplaceOrInsert(p[i]) - if i%(cloneTestSize/5) == 0 { - wg.Add(1) - go cloneTest(t, b.Clone(), i+1, p, wg, trees) - } - } - wg.Done() -} - -func TestCloneConcurrentOperations(t *testing.T) { - b := New(*btreeDegree) - trees := []*BTree{} - p := perm(cloneTestSize) - var wg sync.WaitGroup - wg.Add(1) - go cloneTest(t, b, 0, p, &wg, &trees) - wg.Wait() - want := rang(cloneTestSize) - t.Logf("Starting equality checks on %d trees", len(trees)) - for i, tree := range trees { - if !reflect.DeepEqual(want, all(tree)) { - t.Errorf("tree %v mismatch", i) - } - } - t.Log("Removing half from first half") - toRemove := rang(cloneTestSize)[cloneTestSize/2:] - for i := 0; i < len(trees)/2; i++ { - tree := trees[i] - wg.Add(1) - go func() { - for _, item := range toRemove { - tree.Delete(item) - } - wg.Done() - }() - } - wg.Wait() - t.Log("Checking all values again") - for i, tree := range trees { - var wantpart []Item - if i < len(trees)/2 { - wantpart = want[:cloneTestSize/2] - } else { - wantpart = want - } - if got := all(tree); !reflect.DeepEqual(wantpart, got) { - t.Errorf("tree %v mismatch, want %v got %v", i, len(want), len(got)) - } - } -} diff --git a/vendor/github.com/gregjones/httpcache/.travis.yml b/vendor/github.com/gregjones/httpcache/.travis.yml deleted file mode 100644 index 2bca4c599..000000000 --- a/vendor/github.com/gregjones/httpcache/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -sudo: false -language: go -go: - - 1.6.x - - 1.7.x - - 1.8.x - - master -matrix: - allow_failures: - - go: master - fast_finish: true -install: - - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). -script: - - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d .) - - go tool vet . - - go test -v -race ./... diff --git a/vendor/github.com/gregjones/httpcache/LICENSE.txt b/vendor/github.com/gregjones/httpcache/LICENSE.txt deleted file mode 100644 index 81316beb0..000000000 --- a/vendor/github.com/gregjones/httpcache/LICENSE.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright © 2012 Greg Jones (greg.jones@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/gregjones/httpcache/README.md b/vendor/github.com/gregjones/httpcache/README.md deleted file mode 100644 index 61bd830e5..000000000 --- a/vendor/github.com/gregjones/httpcache/README.md +++ /dev/null @@ -1,24 +0,0 @@ -httpcache -========= - -[![Build Status](https://travis-ci.org/gregjones/httpcache.svg?branch=master)](https://travis-ci.org/gregjones/httpcache) [![GoDoc](https://godoc.org/github.com/gregjones/httpcache?status.svg)](https://godoc.org/github.com/gregjones/httpcache) - -Package httpcache provides a http.RoundTripper implementation that works as a mostly RFC-compliant cache for http responses. - -It is only suitable for use as a 'private' cache (i.e. for a web-browser or an API-client and not for a shared proxy). - -Cache Backends --------------- - -- The built-in 'memory' cache stores responses in an in-memory map. -- [`github.com/gregjones/httpcache/diskcache`](https://github.com/gregjones/httpcache/tree/master/diskcache) provides a filesystem-backed cache using the [diskv](https://github.com/peterbourgon/diskv) library. -- [`github.com/gregjones/httpcache/memcache`](https://github.com/gregjones/httpcache/tree/master/memcache) provides memcache implementations, for both App Engine and 'normal' memcache servers. -- [`sourcegraph.com/sourcegraph/s3cache`](https://sourcegraph.com/github.com/sourcegraph/s3cache) uses Amazon S3 for storage. -- [`github.com/gregjones/httpcache/leveldbcache`](https://github.com/gregjones/httpcache/tree/master/leveldbcache) provides a filesystem-backed cache using [leveldb](https://github.com/syndtr/goleveldb/leveldb). -- [`github.com/die-net/lrucache`](https://github.com/die-net/lrucache) provides an in-memory cache that will evict least-recently used entries. -- [`github.com/die-net/lrucache/twotier`](https://github.com/die-net/lrucache/tree/master/twotier) allows caches to be combined, for example to use lrucache above with a persistent disk-cache. - -License -------- - -- [MIT License](LICENSE.txt) diff --git a/vendor/github.com/gregjones/httpcache/diskcache/diskcache.go b/vendor/github.com/gregjones/httpcache/diskcache/diskcache.go deleted file mode 100644 index 42e3129d8..000000000 --- a/vendor/github.com/gregjones/httpcache/diskcache/diskcache.go +++ /dev/null @@ -1,61 +0,0 @@ -// Package diskcache provides an implementation of httpcache.Cache that uses the diskv package -// to supplement an in-memory map with persistent storage -// -package diskcache - -import ( - "bytes" - "crypto/md5" - "encoding/hex" - "github.com/peterbourgon/diskv" - "io" -) - -// Cache is an implementation of httpcache.Cache that supplements the in-memory map with persistent storage -type Cache struct { - d *diskv.Diskv -} - -// Get returns the response corresponding to key if present -func (c *Cache) Get(key string) (resp []byte, ok bool) { - key = keyToFilename(key) - resp, err := c.d.Read(key) - if err != nil { - return []byte{}, false - } - return resp, true -} - -// Set saves a response to the cache as key -func (c *Cache) Set(key string, resp []byte) { - key = keyToFilename(key) - c.d.WriteStream(key, bytes.NewReader(resp), true) -} - -// Delete removes the response with key from the cache -func (c *Cache) Delete(key string) { - key = keyToFilename(key) - c.d.Erase(key) -} - -func keyToFilename(key string) string { - h := md5.New() - io.WriteString(h, key) - return hex.EncodeToString(h.Sum(nil)) -} - -// New returns a new Cache that will store files in basePath -func New(basePath string) *Cache { - return &Cache{ - d: diskv.New(diskv.Options{ - BasePath: basePath, - CacheSizeMax: 100 * 1024 * 1024, // 100MB - }), - } -} - -// NewWithDiskv returns a new Cache using the provided Diskv as underlying -// storage. -func NewWithDiskv(d *diskv.Diskv) *Cache { - return &Cache{d} -} diff --git a/vendor/github.com/gregjones/httpcache/diskcache/diskcache_test.go b/vendor/github.com/gregjones/httpcache/diskcache/diskcache_test.go deleted file mode 100644 index 35c76cbd1..000000000 --- a/vendor/github.com/gregjones/httpcache/diskcache/diskcache_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package diskcache - -import ( - "bytes" - "io/ioutil" - "os" - "testing" -) - -func TestDiskCache(t *testing.T) { - tempDir, err := ioutil.TempDir("", "httpcache") - if err != nil { - t.Fatalf("TempDir: %v", err) - } - defer os.RemoveAll(tempDir) - - cache := New(tempDir) - - key := "testKey" - _, ok := cache.Get(key) - if ok { - t.Fatal("retrieved key before adding it") - } - - val := []byte("some bytes") - cache.Set(key, val) - - retVal, ok := cache.Get(key) - if !ok { - t.Fatal("could not retrieve an element we just added") - } - if !bytes.Equal(retVal, val) { - t.Fatal("retrieved a different value than what we put in") - } - - cache.Delete(key) - - _, ok = cache.Get(key) - if ok { - t.Fatal("deleted key still present") - } -} diff --git a/vendor/github.com/gregjones/httpcache/httpcache.go b/vendor/github.com/gregjones/httpcache/httpcache.go deleted file mode 100644 index b26e167f0..000000000 --- a/vendor/github.com/gregjones/httpcache/httpcache.go +++ /dev/null @@ -1,557 +0,0 @@ -// Package httpcache provides a http.RoundTripper implementation that works as a -// mostly RFC-compliant cache for http responses. -// -// It is only suitable for use as a 'private' cache (i.e. for a web-browser or an API-client -// and not for a shared proxy). -// -package httpcache - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/http/httputil" - "strings" - "sync" - "time" -) - -const ( - stale = iota - fresh - transparent - // XFromCache is the header added to responses that are returned from the cache - XFromCache = "X-From-Cache" -) - -// A Cache interface is used by the Transport to store and retrieve responses. -type Cache interface { - // Get returns the []byte representation of a cached response and a bool - // set to true if the value isn't empty - Get(key string) (responseBytes []byte, ok bool) - // Set stores the []byte representation of a response against a key - Set(key string, responseBytes []byte) - // Delete removes the value associated with the key - Delete(key string) -} - -// cacheKey returns the cache key for req. -func cacheKey(req *http.Request) string { - if req.Method == http.MethodGet { - return req.URL.String() - } else { - return req.Method + " " + req.URL.String() - } -} - -// CachedResponse returns the cached http.Response for req if present, and nil -// otherwise. -func CachedResponse(c Cache, req *http.Request) (resp *http.Response, err error) { - cachedVal, ok := c.Get(cacheKey(req)) - if !ok { - return - } - - b := bytes.NewBuffer(cachedVal) - return http.ReadResponse(bufio.NewReader(b), req) -} - -// MemoryCache is an implemtation of Cache that stores responses in an in-memory map. -type MemoryCache struct { - mu sync.RWMutex - items map[string][]byte -} - -// Get returns the []byte representation of the response and true if present, false if not -func (c *MemoryCache) Get(key string) (resp []byte, ok bool) { - c.mu.RLock() - resp, ok = c.items[key] - c.mu.RUnlock() - return resp, ok -} - -// Set saves response resp to the cache with key -func (c *MemoryCache) Set(key string, resp []byte) { - c.mu.Lock() - c.items[key] = resp - c.mu.Unlock() -} - -// Delete removes key from the cache -func (c *MemoryCache) Delete(key string) { - c.mu.Lock() - delete(c.items, key) - c.mu.Unlock() -} - -// NewMemoryCache returns a new Cache that will store items in an in-memory map -func NewMemoryCache() *MemoryCache { - c := &MemoryCache{items: map[string][]byte{}} - return c -} - -// Transport is an implementation of http.RoundTripper that will return values from a cache -// where possible (avoiding a network request) and will additionally add validators (etag/if-modified-since) -// to repeated requests allowing servers to return 304 / Not Modified -type Transport struct { - // The RoundTripper interface actually used to make requests - // If nil, http.DefaultTransport is used - Transport http.RoundTripper - Cache Cache - // If true, responses returned from the cache will be given an extra header, X-From-Cache - MarkCachedResponses bool -} - -// NewTransport returns a new Transport with the -// provided Cache implementation and MarkCachedResponses set to true -func NewTransport(c Cache) *Transport { - return &Transport{Cache: c, MarkCachedResponses: true} -} - -// Client returns an *http.Client that caches responses. -func (t *Transport) Client() *http.Client { - return &http.Client{Transport: t} -} - -// varyMatches will return false unless all of the cached values for the headers listed in Vary -// match the new request -func varyMatches(cachedResp *http.Response, req *http.Request) bool { - for _, header := range headerAllCommaSepValues(cachedResp.Header, "vary") { - header = http.CanonicalHeaderKey(header) - if header != "" && req.Header.Get(header) != cachedResp.Header.Get("X-Varied-"+header) { - return false - } - } - return true -} - -// RoundTrip takes a Request and returns a Response -// -// If there is a fresh Response already in cache, then it will be returned without connecting to -// the server. -// -// If there is a stale Response, then any validators it contains will be set on the new request -// to give the server a chance to respond with NotModified. If this happens, then the cached Response -// will be returned. -func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error) { - cacheKey := cacheKey(req) - cacheable := (req.Method == "GET" || req.Method == "HEAD") && req.Header.Get("range") == "" - var cachedResp *http.Response - if cacheable { - cachedResp, err = CachedResponse(t.Cache, req) - } else { - // Need to invalidate an existing value - t.Cache.Delete(cacheKey) - } - - transport := t.Transport - if transport == nil { - transport = http.DefaultTransport - } - - if cacheable && cachedResp != nil && err == nil { - if t.MarkCachedResponses { - cachedResp.Header.Set(XFromCache, "1") - } - - if varyMatches(cachedResp, req) { - // Can only use cached value if the new request doesn't Vary significantly - freshness := getFreshness(cachedResp.Header, req.Header) - if freshness == fresh { - return cachedResp, nil - } - - if freshness == stale { - var req2 *http.Request - // Add validators if caller hasn't already done so - etag := cachedResp.Header.Get("etag") - if etag != "" && req.Header.Get("etag") == "" { - req2 = cloneRequest(req) - req2.Header.Set("if-none-match", etag) - } - lastModified := cachedResp.Header.Get("last-modified") - if lastModified != "" && req.Header.Get("last-modified") == "" { - if req2 == nil { - req2 = cloneRequest(req) - } - req2.Header.Set("if-modified-since", lastModified) - } - if req2 != nil { - req = req2 - } - } - } - - resp, err = transport.RoundTrip(req) - if err == nil && req.Method == "GET" && resp.StatusCode == http.StatusNotModified { - // Replace the 304 response with the one from cache, but update with some new headers - endToEndHeaders := getEndToEndHeaders(resp.Header) - for _, header := range endToEndHeaders { - cachedResp.Header[header] = resp.Header[header] - } - cachedResp.Status = fmt.Sprintf("%d %s", http.StatusOK, http.StatusText(http.StatusOK)) - cachedResp.StatusCode = http.StatusOK - - resp = cachedResp - } else if (err != nil || (cachedResp != nil && resp.StatusCode >= 500)) && - req.Method == "GET" && canStaleOnError(cachedResp.Header, req.Header) { - // In case of transport failure and stale-if-error activated, returns cached content - // when available - cachedResp.Status = fmt.Sprintf("%d %s", http.StatusOK, http.StatusText(http.StatusOK)) - cachedResp.StatusCode = http.StatusOK - return cachedResp, nil - } else { - if err != nil || resp.StatusCode != http.StatusOK { - t.Cache.Delete(cacheKey) - } - if err != nil { - return nil, err - } - } - } else { - reqCacheControl := parseCacheControl(req.Header) - if _, ok := reqCacheControl["only-if-cached"]; ok { - resp = newGatewayTimeoutResponse(req) - } else { - resp, err = transport.RoundTrip(req) - if err != nil { - return nil, err - } - } - } - - if cacheable && canStore(parseCacheControl(req.Header), parseCacheControl(resp.Header)) { - for _, varyKey := range headerAllCommaSepValues(resp.Header, "vary") { - varyKey = http.CanonicalHeaderKey(varyKey) - fakeHeader := "X-Varied-" + varyKey - reqValue := req.Header.Get(varyKey) - if reqValue != "" { - resp.Header.Set(fakeHeader, reqValue) - } - } - switch req.Method { - case "GET": - // Delay caching until EOF is reached. - resp.Body = &cachingReadCloser{ - R: resp.Body, - OnEOF: func(r io.Reader) { - resp := *resp - resp.Body = ioutil.NopCloser(r) - respBytes, err := httputil.DumpResponse(&resp, true) - if err == nil { - t.Cache.Set(cacheKey, respBytes) - } - }, - } - default: - respBytes, err := httputil.DumpResponse(resp, true) - if err == nil { - t.Cache.Set(cacheKey, respBytes) - } - } - } else { - t.Cache.Delete(cacheKey) - } - return resp, nil -} - -// ErrNoDateHeader indicates that the HTTP headers contained no Date header. -var ErrNoDateHeader = errors.New("no Date header") - -// Date parses and returns the value of the Date header. -func Date(respHeaders http.Header) (date time.Time, err error) { - dateHeader := respHeaders.Get("date") - if dateHeader == "" { - err = ErrNoDateHeader - return - } - - return time.Parse(time.RFC1123, dateHeader) -} - -type realClock struct{} - -func (c *realClock) since(d time.Time) time.Duration { - return time.Since(d) -} - -type timer interface { - since(d time.Time) time.Duration -} - -var clock timer = &realClock{} - -// getFreshness will return one of fresh/stale/transparent based on the cache-control -// values of the request and the response -// -// fresh indicates the response can be returned -// stale indicates that the response needs validating before it is returned -// transparent indicates the response should not be used to fulfil the request -// -// Because this is only a private cache, 'public' and 'private' in cache-control aren't -// signficant. Similarly, smax-age isn't used. -func getFreshness(respHeaders, reqHeaders http.Header) (freshness int) { - respCacheControl := parseCacheControl(respHeaders) - reqCacheControl := parseCacheControl(reqHeaders) - if _, ok := reqCacheControl["no-cache"]; ok { - return transparent - } - if _, ok := respCacheControl["no-cache"]; ok { - return stale - } - if _, ok := reqCacheControl["only-if-cached"]; ok { - return fresh - } - - date, err := Date(respHeaders) - if err != nil { - return stale - } - currentAge := clock.since(date) - - var lifetime time.Duration - var zeroDuration time.Duration - - // If a response includes both an Expires header and a max-age directive, - // the max-age directive overrides the Expires header, even if the Expires header is more restrictive. - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err = time.ParseDuration(maxAge + "s") - if err != nil { - lifetime = zeroDuration - } - } else { - expiresHeader := respHeaders.Get("Expires") - if expiresHeader != "" { - expires, err := time.Parse(time.RFC1123, expiresHeader) - if err != nil { - lifetime = zeroDuration - } else { - lifetime = expires.Sub(date) - } - } - } - - if maxAge, ok := reqCacheControl["max-age"]; ok { - // the client is willing to accept a response whose age is no greater than the specified time in seconds - lifetime, err = time.ParseDuration(maxAge + "s") - if err != nil { - lifetime = zeroDuration - } - } - if minfresh, ok := reqCacheControl["min-fresh"]; ok { - // the client wants a response that will still be fresh for at least the specified number of seconds. - minfreshDuration, err := time.ParseDuration(minfresh + "s") - if err == nil { - currentAge = time.Duration(currentAge + minfreshDuration) - } - } - - if maxstale, ok := reqCacheControl["max-stale"]; ok { - // Indicates that the client is willing to accept a response that has exceeded its expiration time. - // If max-stale is assigned a value, then the client is willing to accept a response that has exceeded - // its expiration time by no more than the specified number of seconds. - // If no value is assigned to max-stale, then the client is willing to accept a stale response of any age. - // - // Responses served only because of a max-stale value are supposed to have a Warning header added to them, - // but that seems like a hassle, and is it actually useful? If so, then there needs to be a different - // return-value available here. - if maxstale == "" { - return fresh - } - maxstaleDuration, err := time.ParseDuration(maxstale + "s") - if err == nil { - currentAge = time.Duration(currentAge - maxstaleDuration) - } - } - - if lifetime > currentAge { - return fresh - } - - return stale -} - -// Returns true if either the request or the response includes the stale-if-error -// cache control extension: https://tools.ietf.org/html/rfc5861 -func canStaleOnError(respHeaders, reqHeaders http.Header) bool { - respCacheControl := parseCacheControl(respHeaders) - reqCacheControl := parseCacheControl(reqHeaders) - - var err error - lifetime := time.Duration(-1) - - if staleMaxAge, ok := respCacheControl["stale-if-error"]; ok { - if staleMaxAge != "" { - lifetime, err = time.ParseDuration(staleMaxAge + "s") - if err != nil { - return false - } - } else { - return true - } - } - if staleMaxAge, ok := reqCacheControl["stale-if-error"]; ok { - if staleMaxAge != "" { - lifetime, err = time.ParseDuration(staleMaxAge + "s") - if err != nil { - return false - } - } else { - return true - } - } - - if lifetime >= 0 { - date, err := Date(respHeaders) - if err != nil { - return false - } - currentAge := clock.since(date) - if lifetime > currentAge { - return true - } - } - - return false -} - -func getEndToEndHeaders(respHeaders http.Header) []string { - // These headers are always hop-by-hop - hopByHopHeaders := map[string]struct{}{ - "Connection": struct{}{}, - "Keep-Alive": struct{}{}, - "Proxy-Authenticate": struct{}{}, - "Proxy-Authorization": struct{}{}, - "Te": struct{}{}, - "Trailers": struct{}{}, - "Transfer-Encoding": struct{}{}, - "Upgrade": struct{}{}, - } - - for _, extra := range strings.Split(respHeaders.Get("connection"), ",") { - // any header listed in connection, if present, is also considered hop-by-hop - if strings.Trim(extra, " ") != "" { - hopByHopHeaders[http.CanonicalHeaderKey(extra)] = struct{}{} - } - } - endToEndHeaders := []string{} - for respHeader, _ := range respHeaders { - if _, ok := hopByHopHeaders[respHeader]; !ok { - endToEndHeaders = append(endToEndHeaders, respHeader) - } - } - return endToEndHeaders -} - -func canStore(reqCacheControl, respCacheControl cacheControl) (canStore bool) { - if _, ok := respCacheControl["no-store"]; ok { - return false - } - if _, ok := reqCacheControl["no-store"]; ok { - return false - } - return true -} - -func newGatewayTimeoutResponse(req *http.Request) *http.Response { - var braw bytes.Buffer - braw.WriteString("HTTP/1.1 504 Gateway Timeout\r\n\r\n") - resp, err := http.ReadResponse(bufio.NewReader(&braw), req) - if err != nil { - panic(err) - } - return resp -} - -// cloneRequest returns a clone of the provided *http.Request. -// The clone is a shallow copy of the struct and its Header map. -// (This function copyright goauth2 authors: https://code.google.com/p/goauth2) -func cloneRequest(r *http.Request) *http.Request { - // shallow copy of the struct - r2 := new(http.Request) - *r2 = *r - // deep copy of the Header - r2.Header = make(http.Header) - for k, s := range r.Header { - r2.Header[k] = s - } - return r2 -} - -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// headerAllCommaSepValues returns all comma-separated values (each -// with whitespace trimmed) for header name in headers. According to -// Section 4.2 of the HTTP/1.1 spec -// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2), -// values from multiple occurrences of a header should be concatenated, if -// the header's value is a comma-separated list. -func headerAllCommaSepValues(headers http.Header, name string) []string { - var vals []string - for _, val := range headers[http.CanonicalHeaderKey(name)] { - fields := strings.Split(val, ",") - for i, f := range fields { - fields[i] = strings.TrimSpace(f) - } - vals = append(vals, fields...) - } - return vals -} - -// cachingReadCloser is a wrapper around ReadCloser R that calls OnEOF -// handler with a full copy of the content read from R when EOF is -// reached. -type cachingReadCloser struct { - // Underlying ReadCloser. - R io.ReadCloser - // OnEOF is called with a copy of the content of R when EOF is reached. - OnEOF func(io.Reader) - - buf bytes.Buffer // buf stores a copy of the content of R. -} - -// Read reads the next len(p) bytes from R or until R is drained. The -// return value n is the number of bytes read. If R has no data to -// return, err is io.EOF and OnEOF is called with a full copy of what -// has been read so far. -func (r *cachingReadCloser) Read(p []byte) (n int, err error) { - n, err = r.R.Read(p) - r.buf.Write(p[:n]) - if err == io.EOF { - r.OnEOF(bytes.NewReader(r.buf.Bytes())) - } - return n, err -} - -func (r *cachingReadCloser) Close() error { - return r.R.Close() -} - -// NewMemoryCacheTransport returns a new Transport using the in-memory cache implementation -func NewMemoryCacheTransport() *Transport { - c := NewMemoryCache() - t := NewTransport(c) - return t -} diff --git a/vendor/github.com/gregjones/httpcache/httpcache_test.go b/vendor/github.com/gregjones/httpcache/httpcache_test.go deleted file mode 100644 index f22ed837f..000000000 --- a/vendor/github.com/gregjones/httpcache/httpcache_test.go +++ /dev/null @@ -1,1384 +0,0 @@ -package httpcache - -import ( - "bytes" - "errors" - "flag" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "os" - "strconv" - "testing" - "time" -) - -var s struct { - server *httptest.Server - client http.Client - transport *Transport - done chan struct{} // Closed to unlock infinite handlers. -} - -type fakeClock struct { - elapsed time.Duration -} - -func (c *fakeClock) since(t time.Time) time.Duration { - return c.elapsed -} - -func TestMain(m *testing.M) { - flag.Parse() - setup() - code := m.Run() - teardown() - os.Exit(code) -} - -func setup() { - tp := NewMemoryCacheTransport() - client := http.Client{Transport: tp} - s.transport = tp - s.client = client - s.done = make(chan struct{}) - - mux := http.NewServeMux() - s.server = httptest.NewServer(mux) - - mux.HandleFunc("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - })) - - mux.HandleFunc("/method", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - w.Write([]byte(r.Method)) - })) - - mux.HandleFunc("/range", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - lm := "Fri, 14 Dec 2010 01:01:50 GMT" - if r.Header.Get("if-modified-since") == lm { - w.WriteHeader(http.StatusNotModified) - return - } - w.Header().Set("last-modified", lm) - if r.Header.Get("range") == "bytes=4-9" { - w.WriteHeader(http.StatusPartialContent) - w.Write([]byte(" text ")) - return - } - w.Write([]byte("Some text content")) - })) - - mux.HandleFunc("/nostore", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "no-store") - })) - - mux.HandleFunc("/etag", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - etag := "124567" - if r.Header.Get("if-none-match") == etag { - w.WriteHeader(http.StatusNotModified) - return - } - w.Header().Set("etag", etag) - })) - - mux.HandleFunc("/lastmodified", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - lm := "Fri, 14 Dec 2010 01:01:50 GMT" - if r.Header.Get("if-modified-since") == lm { - w.WriteHeader(http.StatusNotModified) - return - } - w.Header().Set("last-modified", lm) - })) - - mux.HandleFunc("/varyaccept", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - w.Header().Set("Content-Type", "text/plain") - w.Header().Set("Vary", "Accept") - w.Write([]byte("Some text content")) - })) - - mux.HandleFunc("/doublevary", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - w.Header().Set("Content-Type", "text/plain") - w.Header().Set("Vary", "Accept, Accept-Language") - w.Write([]byte("Some text content")) - })) - mux.HandleFunc("/2varyheaders", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - w.Header().Set("Content-Type", "text/plain") - w.Header().Add("Vary", "Accept") - w.Header().Add("Vary", "Accept-Language") - w.Write([]byte("Some text content")) - })) - mux.HandleFunc("/varyunused", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - w.Header().Set("Content-Type", "text/plain") - w.Header().Set("Vary", "X-Madeup-Header") - w.Write([]byte("Some text content")) - })) - - updateFieldsCounter := 0 - mux.HandleFunc("/updatefields", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("X-Counter", strconv.Itoa(updateFieldsCounter)) - w.Header().Set("Etag", `"e"`) - updateFieldsCounter++ - if r.Header.Get("if-none-match") != "" { - w.WriteHeader(http.StatusNotModified) - return - } - w.Write([]byte("Some text content")) - })) - - // Take 3 seconds to return 200 OK (for testing client timeouts). - mux.HandleFunc("/3seconds", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - time.Sleep(3 * time.Second) - })) - - mux.HandleFunc("/infinite", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - for { - select { - case <-s.done: - return - default: - w.Write([]byte{0}) - } - } - })) -} - -func teardown() { - close(s.done) - s.server.Close() -} - -func resetTest() { - s.transport.Cache = NewMemoryCache() - clock = &realClock{} -} - -// TestCacheableMethod ensures that uncacheable method does not get stored -// in cache and get incorrectly used for a following cacheable method request. -func TestCacheableMethod(t *testing.T) { - resetTest() - { - req, err := http.NewRequest("POST", s.server.URL+"/method", nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), "POST"; got != want { - t.Errorf("got %q, want %q", got, want) - } - if resp.StatusCode != http.StatusOK { - t.Errorf("response status code isn't 200 OK: %v", resp.StatusCode) - } - } - { - req, err := http.NewRequest("GET", s.server.URL+"/method", nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), "GET"; got != want { - t.Errorf("got wrong body %q, want %q", got, want) - } - if resp.StatusCode != http.StatusOK { - t.Errorf("response status code isn't 200 OK: %v", resp.StatusCode) - } - if resp.Header.Get(XFromCache) != "" { - t.Errorf("XFromCache header isn't blank") - } - } -} - -func TestDontServeHeadResponseToGetRequest(t *testing.T) { - resetTest() - url := s.server.URL + "/" - req, err := http.NewRequest(http.MethodHead, url, nil) - if err != nil { - t.Fatal(err) - } - _, err = s.client.Do(req) - if err != nil { - t.Fatal(err) - } - req, err = http.NewRequest(http.MethodGet, url, nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - if resp.Header.Get(XFromCache) != "" { - t.Errorf("Cache should not match") - } -} - -func TestDontStorePartialRangeInCache(t *testing.T) { - resetTest() - { - req, err := http.NewRequest("GET", s.server.URL+"/range", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("range", "bytes=4-9") - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), " text "; got != want { - t.Errorf("got %q, want %q", got, want) - } - if resp.StatusCode != http.StatusPartialContent { - t.Errorf("response status code isn't 206 Partial Content: %v", resp.StatusCode) - } - } - { - req, err := http.NewRequest("GET", s.server.URL+"/range", nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), "Some text content"; got != want { - t.Errorf("got %q, want %q", got, want) - } - if resp.StatusCode != http.StatusOK { - t.Errorf("response status code isn't 200 OK: %v", resp.StatusCode) - } - if resp.Header.Get(XFromCache) != "" { - t.Error("XFromCache header isn't blank") - } - } - { - req, err := http.NewRequest("GET", s.server.URL+"/range", nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), "Some text content"; got != want { - t.Errorf("got %q, want %q", got, want) - } - if resp.StatusCode != http.StatusOK { - t.Errorf("response status code isn't 200 OK: %v", resp.StatusCode) - } - if resp.Header.Get(XFromCache) != "1" { - t.Errorf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } - { - req, err := http.NewRequest("GET", s.server.URL+"/range", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("range", "bytes=4-9") - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), " text "; got != want { - t.Errorf("got %q, want %q", got, want) - } - if resp.StatusCode != http.StatusPartialContent { - t.Errorf("response status code isn't 206 Partial Content: %v", resp.StatusCode) - } - } -} - -func TestCacheOnlyIfBodyRead(t *testing.T) { - resetTest() - { - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - // We do not read the body - resp.Body.Close() - } - { - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatalf("XFromCache header isn't blank") - } - } -} - -func TestOnlyReadBodyOnDemand(t *testing.T) { - resetTest() - - req, err := http.NewRequest("GET", s.server.URL+"/infinite", nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) // This shouldn't hang forever. - if err != nil { - t.Fatal(err) - } - buf := make([]byte, 10) // Only partially read the body. - _, err = resp.Body.Read(buf) - if err != nil { - t.Fatal(err) - } - resp.Body.Close() -} - -func TestGetOnlyIfCachedHit(t *testing.T) { - resetTest() - { - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - req.Header.Add("cache-control", "only-if-cached") - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - if resp.StatusCode != http.StatusOK { - t.Fatalf("response status code isn't 200 OK: %v", resp.StatusCode) - } - } -} - -func TestGetOnlyIfCachedMiss(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - req.Header.Add("cache-control", "only-if-cached") - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - if resp.StatusCode != http.StatusGatewayTimeout { - t.Fatalf("response status code isn't 504 GatewayTimeout: %v", resp.StatusCode) - } -} - -func TestGetNoStoreRequest(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - req.Header.Add("Cache-Control", "no-store") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } -} - -func TestGetNoStoreResponse(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/nostore", nil) - if err != nil { - t.Fatal(err) - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } -} - -func TestGetWithEtag(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/etag", nil) - if err != nil { - t.Fatal(err) - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - // additional assertions to verify that 304 response is converted properly - if resp.StatusCode != http.StatusOK { - t.Fatalf("response status code isn't 200 OK: %v", resp.StatusCode) - } - if _, ok := resp.Header["Connection"]; ok { - t.Fatalf("Connection header isn't absent") - } - } -} - -func TestGetWithLastModified(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/lastmodified", nil) - if err != nil { - t.Fatal(err) - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } -} - -func TestGetWithVary(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/varyaccept", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("Accept", "text/plain") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get("Vary") != "Accept" { - t.Fatalf(`Vary header isn't "Accept": %v`, resp.Header.Get("Vary")) - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } - req.Header.Set("Accept", "text/html") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - req.Header.Set("Accept", "") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } -} - -func TestGetWithDoubleVary(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/doublevary", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("Accept", "text/plain") - req.Header.Set("Accept-Language", "da, en-gb;q=0.8, en;q=0.7") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get("Vary") == "" { - t.Fatalf(`Vary header is blank`) - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } - req.Header.Set("Accept-Language", "") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - req.Header.Set("Accept-Language", "da") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } -} - -func TestGetWith2VaryHeaders(t *testing.T) { - resetTest() - // Tests that multiple Vary headers' comma-separated lists are - // merged. See https://github.com/gregjones/httpcache/issues/27. - const ( - accept = "text/plain" - acceptLanguage = "da, en-gb;q=0.8, en;q=0.7" - ) - req, err := http.NewRequest("GET", s.server.URL+"/2varyheaders", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("Accept", accept) - req.Header.Set("Accept-Language", acceptLanguage) - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get("Vary") == "" { - t.Fatalf(`Vary header is blank`) - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } - req.Header.Set("Accept-Language", "") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - req.Header.Set("Accept-Language", "da") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - req.Header.Set("Accept-Language", acceptLanguage) - req.Header.Set("Accept", "") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - req.Header.Set("Accept", "image/png") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } -} - -func TestGetVaryUnused(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/varyunused", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("Accept", "text/plain") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get("Vary") == "" { - t.Fatalf(`Vary header is blank`) - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } -} - -func TestUpdateFields(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/updatefields", nil) - if err != nil { - t.Fatal(err) - } - var counter, counter2 string - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - counter = resp.Header.Get("x-counter") - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - counter2 = resp.Header.Get("x-counter") - } - if counter == counter2 { - t.Fatalf(`both "x-counter" values are equal: %v %v`, counter, counter2) - } -} - -func TestParseCacheControl(t *testing.T) { - resetTest() - h := http.Header{} - for range parseCacheControl(h) { - t.Fatal("cacheControl should be empty") - } - - h.Set("cache-control", "no-cache") - { - cc := parseCacheControl(h) - if _, ok := cc["foo"]; ok { - t.Error(`Value "foo" shouldn't exist`) - } - noCache, ok := cc["no-cache"] - if !ok { - t.Fatalf(`"no-cache" value isn't set`) - } - if noCache != "" { - t.Fatalf(`"no-cache" value isn't blank: %v`, noCache) - } - } - h.Set("cache-control", "no-cache, max-age=3600") - { - cc := parseCacheControl(h) - noCache, ok := cc["no-cache"] - if !ok { - t.Fatalf(`"no-cache" value isn't set`) - } - if noCache != "" { - t.Fatalf(`"no-cache" value isn't blank: %v`, noCache) - } - if cc["max-age"] != "3600" { - t.Fatalf(`"max-age" value isn't "3600": %v`, cc["max-age"]) - } - } -} - -func TestNoCacheRequestExpiration(t *testing.T) { - resetTest() - respHeaders := http.Header{} - respHeaders.Set("Cache-Control", "max-age=7200") - - reqHeaders := http.Header{} - reqHeaders.Set("Cache-Control", "no-cache") - if getFreshness(respHeaders, reqHeaders) != transparent { - t.Fatal("freshness isn't transparent") - } -} - -func TestNoCacheResponseExpiration(t *testing.T) { - resetTest() - respHeaders := http.Header{} - respHeaders.Set("Cache-Control", "no-cache") - respHeaders.Set("Expires", "Wed, 19 Apr 3000 11:43:00 GMT") - - reqHeaders := http.Header{} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestReqMustRevalidate(t *testing.T) { - resetTest() - // not paying attention to request setting max-stale means never returning stale - // responses, so always acting as if must-revalidate is set - respHeaders := http.Header{} - - reqHeaders := http.Header{} - reqHeaders.Set("Cache-Control", "must-revalidate") - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestRespMustRevalidate(t *testing.T) { - resetTest() - respHeaders := http.Header{} - respHeaders.Set("Cache-Control", "must-revalidate") - - reqHeaders := http.Header{} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestFreshExpiration(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("expires", now.Add(time.Duration(2)*time.Second).Format(time.RFC1123)) - - reqHeaders := http.Header{} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - clock = &fakeClock{elapsed: 3 * time.Second} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestMaxAge(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("cache-control", "max-age=2") - - reqHeaders := http.Header{} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - clock = &fakeClock{elapsed: 3 * time.Second} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestMaxAgeZero(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("cache-control", "max-age=0") - - reqHeaders := http.Header{} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestBothMaxAge(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("cache-control", "max-age=2") - - reqHeaders := http.Header{} - reqHeaders.Set("cache-control", "max-age=0") - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestMinFreshWithExpires(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("expires", now.Add(time.Duration(2)*time.Second).Format(time.RFC1123)) - - reqHeaders := http.Header{} - reqHeaders.Set("cache-control", "min-fresh=1") - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - reqHeaders = http.Header{} - reqHeaders.Set("cache-control", "min-fresh=2") - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestEmptyMaxStale(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("cache-control", "max-age=20") - - reqHeaders := http.Header{} - reqHeaders.Set("cache-control", "max-stale") - clock = &fakeClock{elapsed: 10 * time.Second} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - clock = &fakeClock{elapsed: 60 * time.Second} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } -} - -func TestMaxStaleValue(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("cache-control", "max-age=10") - - reqHeaders := http.Header{} - reqHeaders.Set("cache-control", "max-stale=20") - clock = &fakeClock{elapsed: 5 * time.Second} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - clock = &fakeClock{elapsed: 15 * time.Second} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - clock = &fakeClock{elapsed: 30 * time.Second} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func containsHeader(headers []string, header string) bool { - for _, v := range headers { - if http.CanonicalHeaderKey(v) == http.CanonicalHeaderKey(header) { - return true - } - } - return false -} - -func TestGetEndToEndHeaders(t *testing.T) { - resetTest() - var ( - headers http.Header - end2end []string - ) - - headers = http.Header{} - headers.Set("content-type", "text/html") - headers.Set("te", "deflate") - - end2end = getEndToEndHeaders(headers) - if !containsHeader(end2end, "content-type") { - t.Fatal(`doesn't contain "content-type" header`) - } - if containsHeader(end2end, "te") { - t.Fatal(`doesn't contain "te" header`) - } - - headers = http.Header{} - headers.Set("connection", "content-type") - headers.Set("content-type", "text/csv") - headers.Set("te", "deflate") - end2end = getEndToEndHeaders(headers) - if containsHeader(end2end, "connection") { - t.Fatal(`doesn't contain "connection" header`) - } - if containsHeader(end2end, "content-type") { - t.Fatal(`doesn't contain "content-type" header`) - } - if containsHeader(end2end, "te") { - t.Fatal(`doesn't contain "te" header`) - } - - headers = http.Header{} - end2end = getEndToEndHeaders(headers) - if len(end2end) != 0 { - t.Fatal(`non-zero end2end headers`) - } - - headers = http.Header{} - headers.Set("connection", "content-type") - end2end = getEndToEndHeaders(headers) - if len(end2end) != 0 { - t.Fatal(`non-zero end2end headers`) - } -} - -type transportMock struct { - response *http.Response - err error -} - -func (t transportMock) RoundTrip(req *http.Request) (resp *http.Response, err error) { - return t.response, t.err -} - -func TestStaleIfErrorRequest(t *testing.T) { - resetTest() - now := time.Now() - tmock := transportMock{ - response: &http.Response{ - Status: http.StatusText(http.StatusOK), - StatusCode: http.StatusOK, - Header: http.Header{ - "Date": []string{now.Format(time.RFC1123)}, - "Cache-Control": []string{"no-cache"}, - }, - Body: ioutil.NopCloser(bytes.NewBuffer([]byte("some data"))), - }, - err: nil, - } - tp := NewMemoryCacheTransport() - tp.Transport = &tmock - - // First time, response is cached on success - r, _ := http.NewRequest("GET", "http://somewhere.com/", nil) - r.Header.Set("Cache-Control", "stale-if-error") - resp, err := tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - // On failure, response is returned from the cache - tmock.response = nil - tmock.err = errors.New("some error") - resp, err = tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } -} - -func TestStaleIfErrorRequestLifetime(t *testing.T) { - resetTest() - now := time.Now() - tmock := transportMock{ - response: &http.Response{ - Status: http.StatusText(http.StatusOK), - StatusCode: http.StatusOK, - Header: http.Header{ - "Date": []string{now.Format(time.RFC1123)}, - "Cache-Control": []string{"no-cache"}, - }, - Body: ioutil.NopCloser(bytes.NewBuffer([]byte("some data"))), - }, - err: nil, - } - tp := NewMemoryCacheTransport() - tp.Transport = &tmock - - // First time, response is cached on success - r, _ := http.NewRequest("GET", "http://somewhere.com/", nil) - r.Header.Set("Cache-Control", "stale-if-error=100") - resp, err := tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - // On failure, response is returned from the cache - tmock.response = nil - tmock.err = errors.New("some error") - resp, err = tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - - // Same for http errors - tmock.response = &http.Response{StatusCode: http.StatusInternalServerError} - tmock.err = nil - resp, err = tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - - // If failure last more than max stale, error is returned - clock = &fakeClock{elapsed: 200 * time.Second} - _, err = tp.RoundTrip(r) - if err != tmock.err { - t.Fatalf("got err %v, want %v", err, tmock.err) - } -} - -func TestStaleIfErrorResponse(t *testing.T) { - resetTest() - now := time.Now() - tmock := transportMock{ - response: &http.Response{ - Status: http.StatusText(http.StatusOK), - StatusCode: http.StatusOK, - Header: http.Header{ - "Date": []string{now.Format(time.RFC1123)}, - "Cache-Control": []string{"no-cache, stale-if-error"}, - }, - Body: ioutil.NopCloser(bytes.NewBuffer([]byte("some data"))), - }, - err: nil, - } - tp := NewMemoryCacheTransport() - tp.Transport = &tmock - - // First time, response is cached on success - r, _ := http.NewRequest("GET", "http://somewhere.com/", nil) - resp, err := tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - // On failure, response is returned from the cache - tmock.response = nil - tmock.err = errors.New("some error") - resp, err = tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } -} - -func TestStaleIfErrorResponseLifetime(t *testing.T) { - resetTest() - now := time.Now() - tmock := transportMock{ - response: &http.Response{ - Status: http.StatusText(http.StatusOK), - StatusCode: http.StatusOK, - Header: http.Header{ - "Date": []string{now.Format(time.RFC1123)}, - "Cache-Control": []string{"no-cache, stale-if-error=100"}, - }, - Body: ioutil.NopCloser(bytes.NewBuffer([]byte("some data"))), - }, - err: nil, - } - tp := NewMemoryCacheTransport() - tp.Transport = &tmock - - // First time, response is cached on success - r, _ := http.NewRequest("GET", "http://somewhere.com/", nil) - resp, err := tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - // On failure, response is returned from the cache - tmock.response = nil - tmock.err = errors.New("some error") - resp, err = tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - - // If failure last more than max stale, error is returned - clock = &fakeClock{elapsed: 200 * time.Second} - _, err = tp.RoundTrip(r) - if err != tmock.err { - t.Fatalf("got err %v, want %v", err, tmock.err) - } -} - -// Test that http.Client.Timeout is respected when cache transport is used. -// That is so as long as request cancellation is propagated correctly. -// In the past, that required CancelRequest to be implemented correctly, -// but modern http.Client uses Request.Cancel (or request context) instead, -// so we don't have to do anything. -func TestClientTimeout(t *testing.T) { - if testing.Short() { - t.Skip("skipping timeout test in short mode") // Because it takes at least 3 seconds to run. - } - resetTest() - client := &http.Client{ - Transport: NewMemoryCacheTransport(), - Timeout: time.Second, - } - started := time.Now() - resp, err := client.Get(s.server.URL + "/3seconds") - taken := time.Since(started) - if err == nil { - t.Error("got nil error, want timeout error") - } - if resp != nil { - t.Error("got non-nil resp, want nil resp") - } - if taken >= 2*time.Second { - t.Error("client.Do took 2+ seconds, want < 2 seconds") - } -} diff --git a/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache.go b/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache.go deleted file mode 100644 index 9bcb7e277..000000000 --- a/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache.go +++ /dev/null @@ -1,51 +0,0 @@ -// Package leveldbcache provides an implementation of httpcache.Cache that -// uses github.com/syndtr/goleveldb/leveldb -package leveldbcache - -import ( - "github.com/syndtr/goleveldb/leveldb" -) - -// Cache is an implementation of httpcache.Cache with leveldb storage -type Cache struct { - db *leveldb.DB -} - -// Get returns the response corresponding to key if present -func (c *Cache) Get(key string) (resp []byte, ok bool) { - var err error - resp, err = c.db.Get([]byte(key), nil) - if err != nil { - return []byte{}, false - } - return resp, true -} - -// Set saves a response to the cache as key -func (c *Cache) Set(key string, resp []byte) { - c.db.Put([]byte(key), resp, nil) -} - -// Delete removes the response with key from the cache -func (c *Cache) Delete(key string) { - c.db.Delete([]byte(key), nil) -} - -// New returns a new Cache that will store leveldb in path -func New(path string) (*Cache, error) { - cache := &Cache{} - - var err error - cache.db, err = leveldb.OpenFile(path, nil) - - if err != nil { - return nil, err - } - return cache, nil -} - -// NewWithDB returns a new Cache using the provided leveldb as underlying -// storage. -func NewWithDB(db *leveldb.DB) *Cache { - return &Cache{db} -} diff --git a/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache_test.go b/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache_test.go deleted file mode 100644 index b885c0169..000000000 --- a/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package leveldbcache - -import ( - "bytes" - "io/ioutil" - "os" - "path/filepath" - "testing" -) - -func TestDiskCache(t *testing.T) { - tempDir, err := ioutil.TempDir("", "httpcache") - if err != nil { - t.Fatalf("TempDir: %v", err) - } - defer os.RemoveAll(tempDir) - - cache, err := New(filepath.Join(tempDir, "db")) - if err != nil { - t.Fatalf("New leveldb,: %v", err) - } - - key := "testKey" - _, ok := cache.Get(key) - if ok { - t.Fatal("retrieved key before adding it") - } - - val := []byte("some bytes") - cache.Set(key, val) - - retVal, ok := cache.Get(key) - if !ok { - t.Fatal("could not retrieve an element we just added") - } - if !bytes.Equal(retVal, val) { - t.Fatal("retrieved a different value than what we put in") - } - - cache.Delete(key) - - _, ok = cache.Get(key) - if ok { - t.Fatal("deleted key still present") - } -} diff --git a/vendor/github.com/gregjones/httpcache/memcache/appengine.go b/vendor/github.com/gregjones/httpcache/memcache/appengine.go deleted file mode 100644 index e68d9bc09..000000000 --- a/vendor/github.com/gregjones/httpcache/memcache/appengine.go +++ /dev/null @@ -1,61 +0,0 @@ -// +build appengine - -// Package memcache provides an implementation of httpcache.Cache that uses App -// Engine's memcache package to store cached responses. -// -// When not built for Google App Engine, this package will provide an -// implementation that connects to a specified memcached server. See the -// memcache.go file in this package for details. -package memcache - -import ( - "appengine" - "appengine/memcache" -) - -// Cache is an implementation of httpcache.Cache that caches responses in App -// Engine's memcache. -type Cache struct { - appengine.Context -} - -// cacheKey modifies an httpcache key for use in memcache. Specifically, it -// prefixes keys to avoid collision with other data stored in memcache. -func cacheKey(key string) string { - return "httpcache:" + key -} - -// Get returns the response corresponding to key if present. -func (c *Cache) Get(key string) (resp []byte, ok bool) { - item, err := memcache.Get(c.Context, cacheKey(key)) - if err != nil { - if err != memcache.ErrCacheMiss { - c.Context.Errorf("error getting cached response: %v", err) - } - return nil, false - } - return item.Value, true -} - -// Set saves a response to the cache as key. -func (c *Cache) Set(key string, resp []byte) { - item := &memcache.Item{ - Key: cacheKey(key), - Value: resp, - } - if err := memcache.Set(c.Context, item); err != nil { - c.Context.Errorf("error caching response: %v", err) - } -} - -// Delete removes the response with key from the cache. -func (c *Cache) Delete(key string) { - if err := memcache.Delete(c.Context, cacheKey(key)); err != nil { - c.Context.Errorf("error deleting cached response: %v", err) - } -} - -// New returns a new Cache for the given context. -func New(ctx appengine.Context) *Cache { - return &Cache{ctx} -} diff --git a/vendor/github.com/gregjones/httpcache/memcache/appengine_test.go b/vendor/github.com/gregjones/httpcache/memcache/appengine_test.go deleted file mode 100644 index 818b2776e..000000000 --- a/vendor/github.com/gregjones/httpcache/memcache/appengine_test.go +++ /dev/null @@ -1,44 +0,0 @@ -// +build appengine - -package memcache - -import ( - "bytes" - "testing" - - "appengine/aetest" -) - -func TestAppEngine(t *testing.T) { - ctx, err := aetest.NewContext(nil) - if err != nil { - t.Fatal(err) - } - defer ctx.Close() - - cache := New(ctx) - - key := "testKey" - _, ok := cache.Get(key) - if ok { - t.Fatal("retrieved key before adding it") - } - - val := []byte("some bytes") - cache.Set(key, val) - - retVal, ok := cache.Get(key) - if !ok { - t.Fatal("could not retrieve an element we just added") - } - if !bytes.Equal(retVal, val) { - t.Fatal("retrieved a different value than what we put in") - } - - cache.Delete(key) - - _, ok = cache.Get(key) - if ok { - t.Fatal("deleted key still present") - } -} diff --git a/vendor/github.com/gregjones/httpcache/memcache/memcache.go b/vendor/github.com/gregjones/httpcache/memcache/memcache.go deleted file mode 100644 index 462f0e541..000000000 --- a/vendor/github.com/gregjones/httpcache/memcache/memcache.go +++ /dev/null @@ -1,60 +0,0 @@ -// +build !appengine - -// Package memcache provides an implementation of httpcache.Cache that uses -// gomemcache to store cached responses. -// -// When built for Google App Engine, this package will provide an -// implementation that uses App Engine's memcache service. See the -// appengine.go file in this package for details. -package memcache - -import ( - "github.com/bradfitz/gomemcache/memcache" -) - -// Cache is an implementation of httpcache.Cache that caches responses in a -// memcache server. -type Cache struct { - *memcache.Client -} - -// cacheKey modifies an httpcache key for use in memcache. Specifically, it -// prefixes keys to avoid collision with other data stored in memcache. -func cacheKey(key string) string { - return "httpcache:" + key -} - -// Get returns the response corresponding to key if present. -func (c *Cache) Get(key string) (resp []byte, ok bool) { - item, err := c.Client.Get(cacheKey(key)) - if err != nil { - return nil, false - } - return item.Value, true -} - -// Set saves a response to the cache as key. -func (c *Cache) Set(key string, resp []byte) { - item := &memcache.Item{ - Key: cacheKey(key), - Value: resp, - } - c.Client.Set(item) -} - -// Delete removes the response with key from the cache. -func (c *Cache) Delete(key string) { - c.Client.Delete(cacheKey(key)) -} - -// New returns a new Cache using the provided memcache server(s) with equal -// weight. If a server is listed multiple times, it gets a proportional amount -// of weight. -func New(server ...string) *Cache { - return NewWithClient(memcache.New(server...)) -} - -// NewWithClient returns a new Cache with the given memcache client. -func NewWithClient(client *memcache.Client) *Cache { - return &Cache{client} -} diff --git a/vendor/github.com/gregjones/httpcache/memcache/memcache_test.go b/vendor/github.com/gregjones/httpcache/memcache/memcache_test.go deleted file mode 100644 index 4dcc547c6..000000000 --- a/vendor/github.com/gregjones/httpcache/memcache/memcache_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// +build !appengine - -package memcache - -import ( - "bytes" - "net" - "testing" -) - -const testServer = "localhost:11211" - -func TestMemCache(t *testing.T) { - conn, err := net.Dial("tcp", testServer) - if err != nil { - // TODO: rather than skip the test, fall back to a faked memcached server - t.Skipf("skipping test; no server running at %s", testServer) - } - conn.Write([]byte("flush_all\r\n")) // flush memcache - conn.Close() - - cache := New(testServer) - - key := "testKey" - _, ok := cache.Get(key) - if ok { - t.Fatal("retrieved key before adding it") - } - - val := []byte("some bytes") - cache.Set(key, val) - - retVal, ok := cache.Get(key) - if !ok { - t.Fatal("could not retrieve an element we just added") - } - if !bytes.Equal(retVal, val) { - t.Fatal("retrieved a different value than what we put in") - } - - cache.Delete(key) - - _, ok = cache.Get(key) - if ok { - t.Fatal("deleted key still present") - } -} diff --git a/vendor/github.com/gregjones/httpcache/redis/redis.go b/vendor/github.com/gregjones/httpcache/redis/redis.go deleted file mode 100644 index 3143d4438..000000000 --- a/vendor/github.com/gregjones/httpcache/redis/redis.go +++ /dev/null @@ -1,43 +0,0 @@ -// Package redis provides a redis interface for http caching. -package redis - -import ( - "github.com/garyburd/redigo/redis" - "github.com/gregjones/httpcache" -) - -// cache is an implementation of httpcache.Cache that caches responses in a -// redis server. -type cache struct { - redis.Conn -} - -// cacheKey modifies an httpcache key for use in redis. Specifically, it -// prefixes keys to avoid collision with other data stored in redis. -func cacheKey(key string) string { - return "rediscache:" + key -} - -// Get returns the response corresponding to key if present. -func (c cache) Get(key string) (resp []byte, ok bool) { - item, err := redis.Bytes(c.Do("GET", cacheKey(key))) - if err != nil { - return nil, false - } - return item, true -} - -// Set saves a response to the cache as key. -func (c cache) Set(key string, resp []byte) { - c.Do("SET", cacheKey(key), resp) -} - -// Delete removes the response with key from the cache. -func (c cache) Delete(key string) { - c.Do("DEL", cacheKey(key)) -} - -// NewWithClient returns a new Cache with the given redis connection. -func NewWithClient(client redis.Conn) httpcache.Cache { - return cache{client} -} diff --git a/vendor/github.com/gregjones/httpcache/redis/redis_test.go b/vendor/github.com/gregjones/httpcache/redis/redis_test.go deleted file mode 100644 index 72f6f619a..000000000 --- a/vendor/github.com/gregjones/httpcache/redis/redis_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package redis - -import ( - "bytes" - "testing" - - "github.com/garyburd/redigo/redis" -) - -func TestRedisCache(t *testing.T) { - conn, err := redis.Dial("tcp", "localhost:6379") - if err != nil { - // TODO: rather than skip the test, fall back to a faked redis server - t.Skipf("skipping test; no server running at localhost:6379") - } - conn.Do("FLUSHALL") - - cache := NewWithClient(conn) - - key := "testKey" - _, ok := cache.Get(key) - if ok { - t.Fatal("retrieved key before adding it") - } - - val := []byte("some bytes") - cache.Set(key, val) - - retVal, ok := cache.Get(key) - if !ok { - t.Fatal("could not retrieve an element we just added") - } - if !bytes.Equal(retVal, val) { - t.Fatal("retrieved a different value than what we put in") - } - - cache.Delete(key) - - _, ok = cache.Get(key) - if ok { - t.Fatal("deleted key still present") - } -} diff --git a/vendor/github.com/juju/ratelimit/LICENSE b/vendor/github.com/juju/ratelimit/LICENSE deleted file mode 100644 index ade9307b3..000000000 --- a/vendor/github.com/juju/ratelimit/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -All files in this repository are licensed as follows. If you contribute -to this repository, it is assumed that you license your contribution -under the same license unless you state otherwise. - -All files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file. - -This software is licensed under the LGPLv3, included below. - -As a special exception to the GNU Lesser General Public License version 3 -("LGPL3"), the copyright holders of this Library give you permission to -convey to a third party a Combined Work that links statically or dynamically -to this Library without providing any Minimal Corresponding Source or -Minimal Application Code as set out in 4d or providing the installation -information set out in section 4e, provided that you comply with the other -provisions of LGPL3 and provided that you meet, for the Application the -terms and conditions of the license(s) which apply to the Application. - -Except as stated in this special exception, the provisions of LGPL3 will -continue to comply in full to this Library. If you modify this Library, you -may apply this exception to your version of this Library, but you are not -obliged to do so. If you do not wish to do so, delete this exception -statement from your version. This exception does not (and cannot) modify any -license terms which apply to the Application, with which you must still -comply. - - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/vendor/github.com/juju/ratelimit/README.md b/vendor/github.com/juju/ratelimit/README.md deleted file mode 100644 index a0fdfe2b1..000000000 --- a/vendor/github.com/juju/ratelimit/README.md +++ /dev/null @@ -1,117 +0,0 @@ -# ratelimit --- - import "github.com/juju/ratelimit" - -The ratelimit package provides an efficient token bucket implementation. See -http://en.wikipedia.org/wiki/Token_bucket. - -## Usage - -#### func Reader - -```go -func Reader(r io.Reader, bucket *Bucket) io.Reader -``` -Reader returns a reader that is rate limited by the given token bucket. Each -token in the bucket represents one byte. - -#### func Writer - -```go -func Writer(w io.Writer, bucket *Bucket) io.Writer -``` -Writer returns a writer that is rate limited by the given token bucket. Each -token in the bucket represents one byte. - -#### type Bucket - -```go -type Bucket struct { -} -``` - -Bucket represents a token bucket that fills at a predetermined rate. Methods on -Bucket may be called concurrently. - -#### func NewBucket - -```go -func NewBucket(fillInterval time.Duration, capacity int64) *Bucket -``` -NewBucket returns a new token bucket that fills at the rate of one token every -fillInterval, up to the given maximum capacity. Both arguments must be positive. -The bucket is initially full. - -#### func NewBucketWithQuantum - -```go -func NewBucketWithQuantum(fillInterval time.Duration, capacity, quantum int64) *Bucket -``` -NewBucketWithQuantum is similar to NewBucket, but allows the specification of -the quantum size - quantum tokens are added every fillInterval. - -#### func NewBucketWithRate - -```go -func NewBucketWithRate(rate float64, capacity int64) *Bucket -``` -NewBucketWithRate returns a token bucket that fills the bucket at the rate of -rate tokens per second up to the given maximum capacity. Because of limited -clock resolution, at high rates, the actual rate may be up to 1% different from -the specified rate. - -#### func (*Bucket) Rate - -```go -func (tb *Bucket) Rate() float64 -``` -Rate returns the fill rate of the bucket, in tokens per second. - -#### func (*Bucket) Take - -```go -func (tb *Bucket) Take(count int64) time.Duration -``` -Take takes count tokens from the bucket without blocking. It returns the time -that the caller should wait until the tokens are actually available. - -Note that if the request is irrevocable - there is no way to return tokens to -the bucket once this method commits us to taking them. - -#### func (*Bucket) TakeAvailable - -```go -func (tb *Bucket) TakeAvailable(count int64) int64 -``` -TakeAvailable takes up to count immediately available tokens from the bucket. It -returns the number of tokens removed, or zero if there are no available tokens. -It does not block. - -#### func (*Bucket) TakeMaxDuration - -```go -func (tb *Bucket) TakeMaxDuration(count int64, maxWait time.Duration) (time.Duration, bool) -``` -TakeMaxDuration is like Take, except that it will only take tokens from the -bucket if the wait time for the tokens is no greater than maxWait. - -If it would take longer than maxWait for the tokens to become available, it does -nothing and reports false, otherwise it returns the time that the caller should -wait until the tokens are actually available, and reports true. - -#### func (*Bucket) Wait - -```go -func (tb *Bucket) Wait(count int64) -``` -Wait takes count tokens from the bucket, waiting until they are available. - -#### func (*Bucket) WaitMaxDuration - -```go -func (tb *Bucket) WaitMaxDuration(count int64, maxWait time.Duration) bool -``` -WaitMaxDuration is like Wait except that it will only take tokens from the -bucket if it needs to wait for no greater than maxWait. It reports whether any -tokens have been removed from the bucket If no tokens have been removed, it -returns immediately. diff --git a/vendor/github.com/juju/ratelimit/ratelimit.go b/vendor/github.com/juju/ratelimit/ratelimit.go deleted file mode 100644 index 1c3f25b2e..000000000 --- a/vendor/github.com/juju/ratelimit/ratelimit.go +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3 with static-linking exception. -// See LICENCE file for details. - -// Package ratelimit provides an efficient token bucket implementation -// that can be used to limit the rate of arbitrary things. -// See http://en.wikipedia.org/wiki/Token_bucket. -package ratelimit - -import ( - "math" - "strconv" - "sync" - "time" -) - -// Bucket represents a token bucket that fills at a predetermined rate. -// Methods on Bucket may be called concurrently. -type Bucket struct { - startTime time.Time - capacity int64 - quantum int64 - fillInterval time.Duration - clock Clock - - // The mutex guards the fields following it. - mu sync.Mutex - - // avail holds the number of available tokens - // in the bucket, as of availTick ticks from startTime. - // It will be negative when there are consumers - // waiting for tokens. - avail int64 - availTick int64 -} - -// Clock is used to inject testable fakes. -type Clock interface { - Now() time.Time - Sleep(d time.Duration) -} - -// realClock implements Clock in terms of standard time functions. -type realClock struct{} - -// Now is identical to time.Now. -func (realClock) Now() time.Time { - return time.Now() -} - -// Sleep is identical to time.Sleep. -func (realClock) Sleep(d time.Duration) { - time.Sleep(d) -} - -// NewBucket returns a new token bucket that fills at the -// rate of one token every fillInterval, up to the given -// maximum capacity. Both arguments must be -// positive. The bucket is initially full. -func NewBucket(fillInterval time.Duration, capacity int64) *Bucket { - return NewBucketWithClock(fillInterval, capacity, realClock{}) -} - -// NewBucketWithClock is identical to NewBucket but injects a testable clock -// interface. -func NewBucketWithClock(fillInterval time.Duration, capacity int64, clock Clock) *Bucket { - return NewBucketWithQuantumAndClock(fillInterval, capacity, 1, clock) -} - -// rateMargin specifes the allowed variance of actual -// rate from specified rate. 1% seems reasonable. -const rateMargin = 0.01 - -// NewBucketWithRate returns a token bucket that fills the bucket -// at the rate of rate tokens per second up to the given -// maximum capacity. Because of limited clock resolution, -// at high rates, the actual rate may be up to 1% different from the -// specified rate. -func NewBucketWithRate(rate float64, capacity int64) *Bucket { - return NewBucketWithRateAndClock(rate, capacity, realClock{}) -} - -// NewBucketWithRateAndClock is identical to NewBucketWithRate but injects a -// testable clock interface. -func NewBucketWithRateAndClock(rate float64, capacity int64, clock Clock) *Bucket { - for quantum := int64(1); quantum < 1<<50; quantum = nextQuantum(quantum) { - fillInterval := time.Duration(1e9 * float64(quantum) / rate) - if fillInterval <= 0 { - continue - } - tb := NewBucketWithQuantumAndClock(fillInterval, capacity, quantum, clock) - if diff := math.Abs(tb.Rate() - rate); diff/rate <= rateMargin { - return tb - } - } - panic("cannot find suitable quantum for " + strconv.FormatFloat(rate, 'g', -1, 64)) -} - -// nextQuantum returns the next quantum to try after q. -// We grow the quantum exponentially, but slowly, so we -// get a good fit in the lower numbers. -func nextQuantum(q int64) int64 { - q1 := q * 11 / 10 - if q1 == q { - q1++ - } - return q1 -} - -// NewBucketWithQuantum is similar to NewBucket, but allows -// the specification of the quantum size - quantum tokens -// are added every fillInterval. -func NewBucketWithQuantum(fillInterval time.Duration, capacity, quantum int64) *Bucket { - return NewBucketWithQuantumAndClock(fillInterval, capacity, quantum, realClock{}) -} - -// NewBucketWithQuantumAndClock is identical to NewBucketWithQuantum but injects -// a testable clock interface. -func NewBucketWithQuantumAndClock(fillInterval time.Duration, capacity, quantum int64, clock Clock) *Bucket { - if fillInterval <= 0 { - panic("token bucket fill interval is not > 0") - } - if capacity <= 0 { - panic("token bucket capacity is not > 0") - } - if quantum <= 0 { - panic("token bucket quantum is not > 0") - } - return &Bucket{ - clock: clock, - startTime: clock.Now(), - capacity: capacity, - quantum: quantum, - avail: capacity, - fillInterval: fillInterval, - } -} - -// Wait takes count tokens from the bucket, waiting until they are -// available. -func (tb *Bucket) Wait(count int64) { - if d := tb.Take(count); d > 0 { - tb.clock.Sleep(d) - } -} - -// WaitMaxDuration is like Wait except that it will -// only take tokens from the bucket if it needs to wait -// for no greater than maxWait. It reports whether -// any tokens have been removed from the bucket -// If no tokens have been removed, it returns immediately. -func (tb *Bucket) WaitMaxDuration(count int64, maxWait time.Duration) bool { - d, ok := tb.TakeMaxDuration(count, maxWait) - if d > 0 { - tb.clock.Sleep(d) - } - return ok -} - -const infinityDuration time.Duration = 0x7fffffffffffffff - -// Take takes count tokens from the bucket without blocking. It returns -// the time that the caller should wait until the tokens are actually -// available. -// -// Note that if the request is irrevocable - there is no way to return -// tokens to the bucket once this method commits us to taking them. -func (tb *Bucket) Take(count int64) time.Duration { - d, _ := tb.take(tb.clock.Now(), count, infinityDuration) - return d -} - -// TakeMaxDuration is like Take, except that -// it will only take tokens from the bucket if the wait -// time for the tokens is no greater than maxWait. -// -// If it would take longer than maxWait for the tokens -// to become available, it does nothing and reports false, -// otherwise it returns the time that the caller should -// wait until the tokens are actually available, and reports -// true. -func (tb *Bucket) TakeMaxDuration(count int64, maxWait time.Duration) (time.Duration, bool) { - return tb.take(tb.clock.Now(), count, maxWait) -} - -// TakeAvailable takes up to count immediately available tokens from the -// bucket. It returns the number of tokens removed, or zero if there are -// no available tokens. It does not block. -func (tb *Bucket) TakeAvailable(count int64) int64 { - return tb.takeAvailable(tb.clock.Now(), count) -} - -// takeAvailable is the internal version of TakeAvailable - it takes the -// current time as an argument to enable easy testing. -func (tb *Bucket) takeAvailable(now time.Time, count int64) int64 { - if count <= 0 { - return 0 - } - tb.mu.Lock() - defer tb.mu.Unlock() - - tb.adjust(now) - if tb.avail <= 0 { - return 0 - } - if count > tb.avail { - count = tb.avail - } - tb.avail -= count - return count -} - -// Available returns the number of available tokens. It will be negative -// when there are consumers waiting for tokens. Note that if this -// returns greater than zero, it does not guarantee that calls that take -// tokens from the buffer will succeed, as the number of available -// tokens could have changed in the meantime. This method is intended -// primarily for metrics reporting and debugging. -func (tb *Bucket) Available() int64 { - return tb.available(tb.clock.Now()) -} - -// available is the internal version of available - it takes the current time as -// an argument to enable easy testing. -func (tb *Bucket) available(now time.Time) int64 { - tb.mu.Lock() - defer tb.mu.Unlock() - tb.adjust(now) - return tb.avail -} - -// Capacity returns the capacity that the bucket was created with. -func (tb *Bucket) Capacity() int64 { - return tb.capacity -} - -// Rate returns the fill rate of the bucket, in tokens per second. -func (tb *Bucket) Rate() float64 { - return 1e9 * float64(tb.quantum) / float64(tb.fillInterval) -} - -// take is the internal version of Take - it takes the current time as -// an argument to enable easy testing. -func (tb *Bucket) take(now time.Time, count int64, maxWait time.Duration) (time.Duration, bool) { - if count <= 0 { - return 0, true - } - tb.mu.Lock() - defer tb.mu.Unlock() - - currentTick := tb.adjust(now) - avail := tb.avail - count - if avail >= 0 { - tb.avail = avail - return 0, true - } - // Round up the missing tokens to the nearest multiple - // of quantum - the tokens won't be available until - // that tick. - endTick := currentTick + (-avail+tb.quantum-1)/tb.quantum - endTime := tb.startTime.Add(time.Duration(endTick) * tb.fillInterval) - waitTime := endTime.Sub(now) - if waitTime > maxWait { - return 0, false - } - tb.avail = avail - return waitTime, true -} - -// adjust adjusts the current bucket capacity based on the current time. -// It returns the current tick. -func (tb *Bucket) adjust(now time.Time) (currentTick int64) { - currentTick = int64(now.Sub(tb.startTime) / tb.fillInterval) - - if tb.avail >= tb.capacity { - return - } - tb.avail += (currentTick - tb.availTick) * tb.quantum - if tb.avail > tb.capacity { - tb.avail = tb.capacity - } - tb.availTick = currentTick - return -} diff --git a/vendor/github.com/juju/ratelimit/ratelimit_test.go b/vendor/github.com/juju/ratelimit/ratelimit_test.go deleted file mode 100644 index 62d88ded0..000000000 --- a/vendor/github.com/juju/ratelimit/ratelimit_test.go +++ /dev/null @@ -1,389 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3 with static-linking exception. -// See LICENCE file for details. - -package ratelimit - -import ( - "math" - "testing" - "time" - - gc "gopkg.in/check.v1" -) - -func TestPackage(t *testing.T) { - gc.TestingT(t) -} - -type rateLimitSuite struct{} - -var _ = gc.Suite(rateLimitSuite{}) - -type takeReq struct { - time time.Duration - count int64 - expectWait time.Duration -} - -var takeTests = []struct { - about string - fillInterval time.Duration - capacity int64 - reqs []takeReq -}{{ - about: "serial requests", - fillInterval: 250 * time.Millisecond, - capacity: 10, - reqs: []takeReq{{ - time: 0, - count: 0, - expectWait: 0, - }, { - time: 0, - count: 10, - expectWait: 0, - }, { - time: 0, - count: 1, - expectWait: 250 * time.Millisecond, - }, { - time: 250 * time.Millisecond, - count: 1, - expectWait: 250 * time.Millisecond, - }}, -}, { - about: "concurrent requests", - fillInterval: 250 * time.Millisecond, - capacity: 10, - reqs: []takeReq{{ - time: 0, - count: 10, - expectWait: 0, - }, { - time: 0, - count: 2, - expectWait: 500 * time.Millisecond, - }, { - time: 0, - count: 2, - expectWait: 1000 * time.Millisecond, - }, { - time: 0, - count: 1, - expectWait: 1250 * time.Millisecond, - }}, -}, { - about: "more than capacity", - fillInterval: 1 * time.Millisecond, - capacity: 10, - reqs: []takeReq{{ - time: 0, - count: 10, - expectWait: 0, - }, { - time: 20 * time.Millisecond, - count: 15, - expectWait: 5 * time.Millisecond, - }}, -}, { - about: "sub-quantum time", - fillInterval: 10 * time.Millisecond, - capacity: 10, - reqs: []takeReq{{ - time: 0, - count: 10, - expectWait: 0, - }, { - time: 7 * time.Millisecond, - count: 1, - expectWait: 3 * time.Millisecond, - }, { - time: 8 * time.Millisecond, - count: 1, - expectWait: 12 * time.Millisecond, - }}, -}, { - about: "within capacity", - fillInterval: 10 * time.Millisecond, - capacity: 5, - reqs: []takeReq{{ - time: 0, - count: 5, - expectWait: 0, - }, { - time: 60 * time.Millisecond, - count: 5, - expectWait: 0, - }, { - time: 60 * time.Millisecond, - count: 1, - expectWait: 10 * time.Millisecond, - }, { - time: 80 * time.Millisecond, - count: 2, - expectWait: 10 * time.Millisecond, - }}, -}} - -var availTests = []struct { - about string - capacity int64 - fillInterval time.Duration - take int64 - sleep time.Duration - - expectCountAfterTake int64 - expectCountAfterSleep int64 -}{{ - about: "should fill tokens after interval", - capacity: 5, - fillInterval: time.Second, - take: 5, - sleep: time.Second, - expectCountAfterTake: 0, - expectCountAfterSleep: 1, -}, { - about: "should fill tokens plus existing count", - capacity: 2, - fillInterval: time.Second, - take: 1, - sleep: time.Second, - expectCountAfterTake: 1, - expectCountAfterSleep: 2, -}, { - about: "shouldn't fill before interval", - capacity: 2, - fillInterval: 2 * time.Second, - take: 1, - sleep: time.Second, - expectCountAfterTake: 1, - expectCountAfterSleep: 1, -}, { - about: "should fill only once after 1*interval before 2*interval", - capacity: 2, - fillInterval: 2 * time.Second, - take: 1, - sleep: 3 * time.Second, - expectCountAfterTake: 1, - expectCountAfterSleep: 2, -}} - -func (rateLimitSuite) TestTake(c *gc.C) { - for i, test := range takeTests { - tb := NewBucket(test.fillInterval, test.capacity) - for j, req := range test.reqs { - d, ok := tb.take(tb.startTime.Add(req.time), req.count, infinityDuration) - c.Assert(ok, gc.Equals, true) - if d != req.expectWait { - c.Fatalf("test %d.%d, %s, got %v want %v", i, j, test.about, d, req.expectWait) - } - } - } -} - -func (rateLimitSuite) TestTakeMaxDuration(c *gc.C) { - for i, test := range takeTests { - tb := NewBucket(test.fillInterval, test.capacity) - for j, req := range test.reqs { - if req.expectWait > 0 { - d, ok := tb.take(tb.startTime.Add(req.time), req.count, req.expectWait-1) - c.Assert(ok, gc.Equals, false) - c.Assert(d, gc.Equals, time.Duration(0)) - } - d, ok := tb.take(tb.startTime.Add(req.time), req.count, req.expectWait) - c.Assert(ok, gc.Equals, true) - if d != req.expectWait { - c.Fatalf("test %d.%d, %s, got %v want %v", i, j, test.about, d, req.expectWait) - } - } - } -} - -type takeAvailableReq struct { - time time.Duration - count int64 - expect int64 -} - -var takeAvailableTests = []struct { - about string - fillInterval time.Duration - capacity int64 - reqs []takeAvailableReq -}{{ - about: "serial requests", - fillInterval: 250 * time.Millisecond, - capacity: 10, - reqs: []takeAvailableReq{{ - time: 0, - count: 0, - expect: 0, - }, { - time: 0, - count: 10, - expect: 10, - }, { - time: 0, - count: 1, - expect: 0, - }, { - time: 250 * time.Millisecond, - count: 1, - expect: 1, - }}, -}, { - about: "concurrent requests", - fillInterval: 250 * time.Millisecond, - capacity: 10, - reqs: []takeAvailableReq{{ - time: 0, - count: 5, - expect: 5, - }, { - time: 0, - count: 2, - expect: 2, - }, { - time: 0, - count: 5, - expect: 3, - }, { - time: 0, - count: 1, - expect: 0, - }}, -}, { - about: "more than capacity", - fillInterval: 1 * time.Millisecond, - capacity: 10, - reqs: []takeAvailableReq{{ - time: 0, - count: 10, - expect: 10, - }, { - time: 20 * time.Millisecond, - count: 15, - expect: 10, - }}, -}, { - about: "within capacity", - fillInterval: 10 * time.Millisecond, - capacity: 5, - reqs: []takeAvailableReq{{ - time: 0, - count: 5, - expect: 5, - }, { - time: 60 * time.Millisecond, - count: 5, - expect: 5, - }, { - time: 70 * time.Millisecond, - count: 1, - expect: 1, - }}, -}} - -func (rateLimitSuite) TestTakeAvailable(c *gc.C) { - for i, test := range takeAvailableTests { - tb := NewBucket(test.fillInterval, test.capacity) - for j, req := range test.reqs { - d := tb.takeAvailable(tb.startTime.Add(req.time), req.count) - if d != req.expect { - c.Fatalf("test %d.%d, %s, got %v want %v", i, j, test.about, d, req.expect) - } - } - } -} - -func (rateLimitSuite) TestPanics(c *gc.C) { - c.Assert(func() { NewBucket(0, 1) }, gc.PanicMatches, "token bucket fill interval is not > 0") - c.Assert(func() { NewBucket(-2, 1) }, gc.PanicMatches, "token bucket fill interval is not > 0") - c.Assert(func() { NewBucket(1, 0) }, gc.PanicMatches, "token bucket capacity is not > 0") - c.Assert(func() { NewBucket(1, -2) }, gc.PanicMatches, "token bucket capacity is not > 0") -} - -func isCloseTo(x, y, tolerance float64) bool { - return math.Abs(x-y)/y < tolerance -} - -func (rateLimitSuite) TestRate(c *gc.C) { - tb := NewBucket(1, 1) - if !isCloseTo(tb.Rate(), 1e9, 0.00001) { - c.Fatalf("got %v want 1e9", tb.Rate()) - } - tb = NewBucket(2*time.Second, 1) - if !isCloseTo(tb.Rate(), 0.5, 0.00001) { - c.Fatalf("got %v want 0.5", tb.Rate()) - } - tb = NewBucketWithQuantum(100*time.Millisecond, 1, 5) - if !isCloseTo(tb.Rate(), 50, 0.00001) { - c.Fatalf("got %v want 50", tb.Rate()) - } -} - -func checkRate(c *gc.C, rate float64) { - tb := NewBucketWithRate(rate, 1<<62) - if !isCloseTo(tb.Rate(), rate, rateMargin) { - c.Fatalf("got %g want %v", tb.Rate(), rate) - } - d, ok := tb.take(tb.startTime, 1<<62, infinityDuration) - c.Assert(ok, gc.Equals, true) - c.Assert(d, gc.Equals, time.Duration(0)) - - // Check that the actual rate is as expected by - // asking for a not-quite multiple of the bucket's - // quantum and checking that the wait time - // correct. - d, ok = tb.take(tb.startTime, tb.quantum*2-tb.quantum/2, infinityDuration) - c.Assert(ok, gc.Equals, true) - expectTime := 1e9 * float64(tb.quantum) * 2 / rate - if !isCloseTo(float64(d), expectTime, rateMargin) { - c.Fatalf("rate %g: got %g want %v", rate, float64(d), expectTime) - } -} - -func (rateLimitSuite) TestNewWithRate(c *gc.C) { - for rate := float64(1); rate < 1e6; rate += 7 { - checkRate(c, rate) - } - for _, rate := range []float64{ - 1024 * 1024 * 1024, - 1e-5, - 0.9e-5, - 0.5, - 0.9, - 0.9e8, - 3e12, - 4e18, - } { - checkRate(c, rate) - checkRate(c, rate/3) - checkRate(c, rate*1.3) - } -} - -func TestAvailable(t *testing.T) { - for i, tt := range availTests { - tb := NewBucket(tt.fillInterval, tt.capacity) - if c := tb.takeAvailable(tb.startTime, tt.take); c != tt.take { - t.Fatalf("#%d: %s, take = %d, want = %d", i, tt.about, c, tt.take) - } - if c := tb.available(tb.startTime); c != tt.expectCountAfterTake { - t.Fatalf("#%d: %s, after take, available = %d, want = %d", i, tt.about, c, tt.expectCountAfterTake) - } - if c := tb.available(tb.startTime.Add(tt.sleep)); c != tt.expectCountAfterSleep { - t.Fatalf("#%d: %s, after some time it should fill in new tokens, available = %d, want = %d", - i, tt.about, c, tt.expectCountAfterSleep) - } - } - -} - -func BenchmarkWait(b *testing.B) { - tb := NewBucket(1, 16*1024) - for i := b.N - 1; i >= 0; i-- { - tb.Wait(1) - } -} diff --git a/vendor/github.com/juju/ratelimit/reader.go b/vendor/github.com/juju/ratelimit/reader.go deleted file mode 100644 index 6403bf78d..000000000 --- a/vendor/github.com/juju/ratelimit/reader.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3 with static-linking exception. -// See LICENCE file for details. - -package ratelimit - -import "io" - -type reader struct { - r io.Reader - bucket *Bucket -} - -// Reader returns a reader that is rate limited by -// the given token bucket. Each token in the bucket -// represents one byte. -func Reader(r io.Reader, bucket *Bucket) io.Reader { - return &reader{ - r: r, - bucket: bucket, - } -} - -func (r *reader) Read(buf []byte) (int, error) { - n, err := r.r.Read(buf) - if n <= 0 { - return n, err - } - r.bucket.Wait(int64(n)) - return n, err -} - -type writer struct { - w io.Writer - bucket *Bucket -} - -// Writer returns a reader that is rate limited by -// the given token bucket. Each token in the bucket -// represents one byte. -func Writer(w io.Writer, bucket *Bucket) io.Writer { - return &writer{ - w: w, - bucket: bucket, - } -} - -func (w *writer) Write(buf []byte) (int, error) { - w.bucket.Wait(int64(len(buf))) - return w.w.Write(buf) -} diff --git a/vendor/github.com/petar/GoLLRB/.gitignore b/vendor/github.com/petar/GoLLRB/.gitignore deleted file mode 100644 index e333b2dbf..000000000 --- a/vendor/github.com/petar/GoLLRB/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -syntax:glob -*.[568ao] -*.ao -*.so -*.pyc -*.swp -*.swo -._* -.nfs.* -[568a].out -*~ -*.orig -*.pb.go -core -_obj -_test -src/pkg/Make.deps -_testmain.go - -syntax:regexp -^pkg/ -^src/cmd/(.*)/6?\1$ -^.*/core.[0-9]*$ diff --git a/vendor/github.com/petar/GoLLRB/AUTHORS b/vendor/github.com/petar/GoLLRB/AUTHORS deleted file mode 100644 index 78d1de495..000000000 --- a/vendor/github.com/petar/GoLLRB/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -Petar Maymounkov -Vadim Vygonets -Ian Smith -Martin Bruse diff --git a/vendor/github.com/petar/GoLLRB/LICENSE b/vendor/github.com/petar/GoLLRB/LICENSE deleted file mode 100644 index b75312c78..000000000 --- a/vendor/github.com/petar/GoLLRB/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2010, Petar Maymounkov -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -(*) Redistributions of source code must retain the above copyright notice, this list -of conditions and the following disclaimer. - -(*) Redistributions in binary form must reproduce the above copyright notice, this -list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -(*) Neither the name of Petar Maymounkov nor the names of its contributors may be -used to endorse or promote products derived from this software without specific -prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/petar/GoLLRB/README.md b/vendor/github.com/petar/GoLLRB/README.md deleted file mode 100644 index 742ca0bd5..000000000 --- a/vendor/github.com/petar/GoLLRB/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# GoLLRB - -GoLLRB is a Left-Leaning Red-Black (LLRB) implementation of 2-3 balanced binary -search trees in Go Language. - -## Overview - -As of this writing and to the best of the author's knowledge, -Go still does not have a balanced binary search tree (BBST) data structure. -These data structures are quite useful in a variety of cases. A BBST maintains -elements in sorted order under dynamic updates (inserts and deletes) and can -support various order-specific queries. Furthermore, in practice one often -implements other common data structures like Priority Queues, using BBST's. - -2-3 trees (a type of BBST's), as well as the runtime-similar 2-3-4 trees, are -the de facto standard BBST algoritms found in implementations of Python, Java, -and other libraries. The LLRB method of implementing 2-3 trees is a recent -improvement over the traditional implementation. The LLRB approach was -discovered relatively recently (in 2008) by Robert Sedgewick of Princeton -University. - -GoLLRB is a Go implementation of LLRB 2-3 trees. - -## Maturity - -GoLLRB has been used in some pretty heavy-weight machine learning tasks over many gigabytes of data. -I consider it to be in stable, perhaps even production, shape. There are no known bugs. - -## Installation - -With a healthy Go Language installed, simply run `go get github.com/petar/GoLLRB/llrb` - -## Example - - package main - - import ( - "fmt" - "github.com/petar/GoLLRB/llrb" - ) - - func lessInt(a, b interface{}) bool { return a.(int) < b.(int) } - - func main() { - tree := llrb.New(lessInt) - tree.ReplaceOrInsert(1) - tree.ReplaceOrInsert(2) - tree.ReplaceOrInsert(3) - tree.ReplaceOrInsert(4) - tree.DeleteMin() - tree.Delete(4) - c := tree.IterAscend() - for { - u := <-c - if u == nil { - break - } - fmt.Printf("%d\n", int(u.(int))) - } - } - -## About - -GoLLRB was written by [Petar Maymounkov](http://pdos.csail.mit.edu/~petar/). - -Follow me on [Twitter @maymounkov](http://www.twitter.com/maymounkov)! diff --git a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-LLRB.pdf b/vendor/github.com/petar/GoLLRB/doc/Sedgewick-LLRB.pdf deleted file mode 100644 index a399b06ae..000000000 Binary files a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-LLRB.pdf and /dev/null differ diff --git a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-RedBlackBST.java b/vendor/github.com/petar/GoLLRB/doc/Sedgewick-RedBlackBST.java deleted file mode 100644 index 55ac177f8..000000000 --- a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-RedBlackBST.java +++ /dev/null @@ -1,475 +0,0 @@ -public class RedBlackBST, Value> -{ - private static final int BST = 0; - private static final int TD234 = 1; - private static final int BU23 = 2; - private static final boolean RED = true; - private static final boolean BLACK = false; - - private Node root; // root of the BST - private int k; // ordinal for drawing - private final int species; // species kind of tree for insert - private int heightBLACK; // black height of tree - - RedBlackBST(int species) - { this.species = species; } - - private class Node - { - Key key; // key - Value value; // associated data - Node left, right; // left and right subtrees - boolean color; // color of parent link - private int N; // number of nodes in tree rooted here - private int height; // height of tree rooted here - private double xc, yc; // for drawing - - Node(Key key, Value value) - { - this.key = key; - this.value = value; - this.color = RED; - this.N = 1; - this.height = 1; - } - } - - public int size() - { return size(root); } - - private int size(Node x) - { - if (x == null) return 0; - else return x.N; - } - - public int rootRank() - { - if (root == null) return 0; - else return size(root.left); - } - - public int height() - { return height(root); } - - public int heightB() - { return heightBLACK; } - - private int height(Node x) - { - if (x == null) return 0; - else return x.height; - } - - public boolean contains(Key key) - { return (get(key) != null); } - - public Value get(Key key) - { return get(root, key); } - - private Value get(Node x, Key key) - { - if (x == null) return null; - if (eq (key, x.key)) return x.value; - if (less(key, x.key)) return get(x.left, key); - else return get(x.right, key); - } - - public Key min() - { - if (root == null) return null; - else return min(root); - } - - private Key min(Node x) - { - if (x.left == null) return x.key; - else return min(x.left); - } - - public Key max() - { - if (root == null) return null; - else return max(root); - } - - private Key max(Node x) - { - if (x.right == null) return x.key; - else return max(x.right); - } - - public void put(Key key, Value value) - { - root = insert(root, key, value); - if (isRed(root)) heightBLACK++; - root.color = BLACK; - } - - private Node insert(Node h, Key key, Value value) - { - if (h == null) - return new Node(key, value); - - if (species == TD234) - if (isRed(h.left) && isRed(h.right)) - colorFlip(h); - - if (eq(key, h.key)) - h.value = value; - else if (less(key, h.key)) - h.left = insert(h.left, key, value); - else - h.right = insert(h.right, key, value); - - if (species == BST) return setN(h); - - if (isRed(h.right)) - h = rotateLeft(h); - - if (isRed(h.left) && isRed(h.left.left)) - h = rotateRight(h); - - if (species == BU23) - if (isRed(h.left) && isRed(h.right)) - colorFlip(h); - - return setN(h); - } - - public void deleteMin() - { - root = deleteMin(root); - root.color = BLACK; - } - - private Node deleteMin(Node h) - { - if (h.left == null) - return null; - - if (!isRed(h.left) && !isRed(h.left.left)) - h = moveRedLeft(h); - - h.left = deleteMin(h.left); - - return fixUp(h); - } - - public void deleteMax() - { - root = deleteMax(root); - root.color = BLACK; - } - - private Node deleteMax(Node h) - { - // if (h.right == null) - // { - // if (h.left != null) - // h.left.color = BLACK; - // return h.left; - // } - - if (isRed(h.left)) - h = rotateRight(h); - - if (h.right == null) - return null; - - if (!isRed(h.right) && !isRed(h.right.left)) - h = moveRedRight(h); - - h.right = deleteMax(h.right); - - return fixUp(h); - } - - public void delete(Key key) - { - root = delete(root, key); - root.color = BLACK; - } - - private Node delete(Node h, Key key) - { - if (less(key, h.key)) - { - if (!isRed(h.left) && !isRed(h.left.left)) - h = moveRedLeft(h); - h.left = delete(h.left, key); - } - else - { - if (isRed(h.left)) - h = rotateRight(h); - if (eq(key, h.key) && (h.right == null)) - return null; - if (!isRed(h.right) && !isRed(h.right.left)) - h = moveRedRight(h); - if (eq(key, h.key)) - { - h.value = get(h.right, min(h.right)); - h.key = min(h.right); - h.right = deleteMin(h.right); - } - else h.right = delete(h.right, key); - } - - return fixUp(h); - } - -// Helper methods - - private boolean less(Key a, Key b) { return a.compareTo(b) < 0; } - private boolean eq (Key a, Key b) { return a.compareTo(b) == 0; } - - private boolean isRed(Node x) - { - if (x == null) return false; - return (x.color == RED); - } - - private void colorFlip(Node h) - { - h.color = !h.color; - h.left.color = !h.left.color; - h.right.color = !h.right.color; - } - - private Node rotateLeft(Node h) - { // Make a right-leaning 3-node lean to the left. - Node x = h.right; - h.right = x.left; - x.left = setN(h); - x.color = x.left.color; - x.left.color = RED; - return setN(x); - } - - private Node rotateRight(Node h) - { // Make a left-leaning 3-node lean to the right. - Node x = h.left; - h.left = x.right; - x.right = setN(h); - x.color = x.right.color; - x.right.color = RED; - return setN(x); - } - - private Node moveRedLeft(Node h) - { // Assuming that h is red and both h.left and h.left.left - // are black, make h.left or one of its children red. - colorFlip(h); - if (isRed(h.right.left)) - { - h.right = rotateRight(h.right); - h = rotateLeft(h); - colorFlip(h); - } - return h; - } - - private Node moveRedRight(Node h) - { // Assuming that h is red and both h.right and h.right.left - // are black, make h.right or one of its children red. - colorFlip(h); - if (isRed(h.left.left)) - { - h = rotateRight(h); - colorFlip(h); - } - return h; - } - - private Node fixUp(Node h) - { - if (isRed(h.right)) - h = rotateLeft(h); - - if (isRed(h.left) && isRed(h.left.left)) - h = rotateRight(h); - - if (isRed(h.left) && isRed(h.right)) - colorFlip(h); - - return setN(h); - } - - private Node setN(Node h) - { - h.N = size(h.left) + size(h.right) + 1; - if (height(h.left) > height(h.right)) h.height = height(h.left) + 1; - else h.height = height(h.right) + 1; - return h; - } - - public String toString() - { - if (root == null) return ""; - else return heightB() + " " + toString(root); - } - - public String toString(Node x) - { - String s = "("; - if (x.left == null) s += "("; else s += toString(x.left); - if (isRed(x)) s += "*"; - if (x.right == null) s += ")"; else s += toString(x.right); - return s + ")"; - } - -// Methods for tree drawing - - public void draw(double y, double lineWidth, double nodeSize) - { - k = 0; - setcoords(root, y); - StdDraw.setPenColor(StdDraw.BLACK); - StdDraw.setPenRadius(lineWidth); - drawlines(root); - StdDraw.setPenColor(StdDraw.WHITE); - drawnodes(root, nodeSize); - } - - public void setcoords(Node x, double d) - { - if (x == null) return; - setcoords(x.left, d-.04); - x.xc = (0.5 + k++)/size(); x.yc = d - .04; - setcoords(x.right, d-.04); - } - - public void drawlines(Node x) - { - if (x == null) return; - drawlines(x.left); - if (x.left != null) - { - if (x.left.color == RED) StdDraw.setPenColor(StdDraw.RED); - else StdDraw.setPenColor(StdDraw.BLACK); - StdDraw.line(x.xc, x.yc, x.left.xc, x.left.yc); - } - if (x.right != null) - { - if (x.right.color == RED) StdDraw.setPenColor(StdDraw.RED); - else StdDraw.setPenColor(StdDraw.BLACK); - StdDraw.line(x.xc, x.yc, x.right.xc, x.right.yc); - } - drawlines(x.right); - } - - public void drawnodes(Node x, double nodeSize) - { - if (x == null) return; - drawnodes(x.left, nodeSize); - StdDraw.filledCircle(x.xc, x.yc, nodeSize); - drawnodes(x.right, nodeSize); - } - - public void mark(Key key) - { - StdDraw.setPenColor(StdDraw.BLACK); - marknodes(key, root); - } - - public void marknodes(Key key, Node x) - { - if (x == null) return; - marknodes(key, x.left); - if (eq(key, x.key)) - StdDraw.filledCircle(x.xc, x.yc, .004); - marknodes(key, x.right); - } - - public int ipl() - { return ipl(root); } - - public int ipl(Node x) - { - if (x == null) return 0; - return size(x) - 1 + ipl(x.left) + ipl(x.right); - } - - public int sizeRed() - { return sizeRed(root); } - - public int sizeRed(Node x) - { - if (x == null) return 0; - if (isRed(x)) return 1 + sizeRed(x.left) + sizeRed(x.right); - else return sizeRed(x.left) + sizeRed(x.right); - } - -// Integrity checks - - public boolean check() - { // Is this tree a red-black tree? - return isBST() && is234() && isBalanced(); - } - - private boolean isBST() - { // Is this tree a BST? - return isBST(root, min(), max()); - } - - private boolean isBST(Node x, Key min, Key max) - { // Are all the values in the BST rooted at x between min and max, - // and does the same property hold for both subtrees? - if (x == null) return true; - if (less(x.key, min) || less(max, x.key)) return false; - return isBST(x.left, min, x.key) && isBST(x.right, x.key, max); - } - - private boolean is234() { return is234(root); } - private boolean is234(Node x) - { // Does the tree have no red right links, and at most two (left) - // red links in a row on any path? - if (x == null) return true; - if (isRed(x.right)) return false; - if (isRed(x)) - if (isRed(x.left)) - if (isRed(x.left.left)) return false; - return is234(x.left) && is234(x.right); - } - - private boolean isBalanced() - { // Do all paths from root to leaf have same number of black edges? - int black = 0; // number of black links on path from root to min - Node x = root; - while (x != null) - { - if (!isRed(x)) black++; - x = x.left; - } - return isBalanced(root, black); - } - - private boolean isBalanced(Node x, int black) - { // Does every path from the root to a leaf have the given number - // of black links? - if (x == null && black == 0) return true; - else if (x == null && black != 0) return false; - if (!isRed(x)) black--; - return isBalanced(x.left, black) && isBalanced(x.right, black); - } - - - public static void main(String[] args) - { - StdDraw.setPenRadius(.0025); - int species = Integer.parseInt(args[0]); - RedBlackBST st; - st = new RedBlackBST(species); - int[] a = { 3, 1, 4, 2, 5, 9, 6, 8, 7 }; - for (int i = 0; i < a.length; i++) - st.put(a[i], i); - StdOut.println(st); - StdDraw.clear(StdDraw.LIGHT_GRAY); - st.draw(.95, .0025, .008); - StdOut.println(st.min() + " " + st.max() + " " + st.check()); - StdOut.println(st.ipl()); - StdOut.println(st.heightB()); - } - -} diff --git a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-Talk-Penn2008.pdf b/vendor/github.com/petar/GoLLRB/doc/Sedgewick-Talk-Penn2008.pdf deleted file mode 100644 index 07861abed..000000000 Binary files a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-Talk-Penn2008.pdf and /dev/null differ diff --git a/vendor/github.com/petar/GoLLRB/example/ex1.go b/vendor/github.com/petar/GoLLRB/example/ex1.go deleted file mode 100644 index 6ebe4a686..000000000 --- a/vendor/github.com/petar/GoLLRB/example/ex1.go +++ /dev/null @@ -1,26 +0,0 @@ -package main - -import ( - "fmt" - "github.com/petar/GoLLRB/llrb" -) - -func lessInt(a, b interface{}) bool { return a.(int) < b.(int) } - -func main() { - tree := llrb.New(lessInt) - tree.ReplaceOrInsert(1) - tree.ReplaceOrInsert(2) - tree.ReplaceOrInsert(3) - tree.ReplaceOrInsert(4) - tree.DeleteMin() - tree.Delete(4) - c := tree.IterAscend() - for { - u := <-c - if u == nil { - break - } - fmt.Printf("%d\n", int(u.(int))) - } -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/avgvar.go b/vendor/github.com/petar/GoLLRB/llrb/avgvar.go deleted file mode 100644 index 2d7e2a326..000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/avgvar.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2010 Petar Maymounkov. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package llrb - -import "math" - -// avgVar maintains the average and variance of a stream of numbers -// in a space-efficient manner. -type avgVar struct { - count int64 - sum, sumsq float64 -} - -func (av *avgVar) Init() { - av.count = 0 - av.sum = 0.0 - av.sumsq = 0.0 -} - -func (av *avgVar) Add(sample float64) { - av.count++ - av.sum += sample - av.sumsq += sample * sample -} - -func (av *avgVar) GetCount() int64 { return av.count } - -func (av *avgVar) GetAvg() float64 { return av.sum / float64(av.count) } - -func (av *avgVar) GetTotal() float64 { return av.sum } - -func (av *avgVar) GetVar() float64 { - a := av.GetAvg() - return av.sumsq/float64(av.count) - a*a -} - -func (av *avgVar) GetStdDev() float64 { return math.Sqrt(av.GetVar()) } diff --git a/vendor/github.com/petar/GoLLRB/llrb/iterator.go b/vendor/github.com/petar/GoLLRB/llrb/iterator.go deleted file mode 100644 index ee7b27f44..000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/iterator.go +++ /dev/null @@ -1,93 +0,0 @@ -package llrb - -type ItemIterator func(i Item) bool - -//func (t *Tree) Ascend(iterator ItemIterator) { -// t.AscendGreaterOrEqual(Inf(-1), iterator) -//} - -func (t *LLRB) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) { - t.ascendRange(t.root, greaterOrEqual, lessThan, iterator) -} - -func (t *LLRB) ascendRange(h *Node, inf, sup Item, iterator ItemIterator) bool { - if h == nil { - return true - } - if !less(h.Item, sup) { - return t.ascendRange(h.Left, inf, sup, iterator) - } - if less(h.Item, inf) { - return t.ascendRange(h.Right, inf, sup, iterator) - } - - if !t.ascendRange(h.Left, inf, sup, iterator) { - return false - } - if !iterator(h.Item) { - return false - } - return t.ascendRange(h.Right, inf, sup, iterator) -} - -// AscendGreaterOrEqual will call iterator once for each element greater or equal to -// pivot in ascending order. It will stop whenever the iterator returns false. -func (t *LLRB) AscendGreaterOrEqual(pivot Item, iterator ItemIterator) { - t.ascendGreaterOrEqual(t.root, pivot, iterator) -} - -func (t *LLRB) ascendGreaterOrEqual(h *Node, pivot Item, iterator ItemIterator) bool { - if h == nil { - return true - } - if !less(h.Item, pivot) { - if !t.ascendGreaterOrEqual(h.Left, pivot, iterator) { - return false - } - if !iterator(h.Item) { - return false - } - } - return t.ascendGreaterOrEqual(h.Right, pivot, iterator) -} - -func (t *LLRB) AscendLessThan(pivot Item, iterator ItemIterator) { - t.ascendLessThan(t.root, pivot, iterator) -} - -func (t *LLRB) ascendLessThan(h *Node, pivot Item, iterator ItemIterator) bool { - if h == nil { - return true - } - if !t.ascendLessThan(h.Left, pivot, iterator) { - return false - } - if !iterator(h.Item) { - return false - } - if less(h.Item, pivot) { - return t.ascendLessThan(h.Left, pivot, iterator) - } - return true -} - -// DescendLessOrEqual will call iterator once for each element less than the -// pivot in descending order. It will stop whenever the iterator returns false. -func (t *LLRB) DescendLessOrEqual(pivot Item, iterator ItemIterator) { - t.descendLessOrEqual(t.root, pivot, iterator) -} - -func (t *LLRB) descendLessOrEqual(h *Node, pivot Item, iterator ItemIterator) bool { - if h == nil { - return true - } - if less(h.Item, pivot) || !less(pivot, h.Item) { - if !t.descendLessOrEqual(h.Right, pivot, iterator) { - return false - } - if !iterator(h.Item) { - return false - } - } - return t.descendLessOrEqual(h.Left, pivot, iterator) -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/iterator_test.go b/vendor/github.com/petar/GoLLRB/llrb/iterator_test.go deleted file mode 100644 index db5e12c92..000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/iterator_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package llrb - -import ( - "reflect" - "testing" -) - -func TestAscendGreaterOrEqual(t *testing.T) { - tree := New() - tree.InsertNoReplace(Int(4)) - tree.InsertNoReplace(Int(6)) - tree.InsertNoReplace(Int(1)) - tree.InsertNoReplace(Int(3)) - var ary []Item - tree.AscendGreaterOrEqual(Int(-1), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected := []Item{Int(1), Int(3), Int(4), Int(6)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } - ary = nil - tree.AscendGreaterOrEqual(Int(3), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected = []Item{Int(3), Int(4), Int(6)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } - ary = nil - tree.AscendGreaterOrEqual(Int(2), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected = []Item{Int(3), Int(4), Int(6)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } -} - -func TestDescendLessOrEqual(t *testing.T) { - tree := New() - tree.InsertNoReplace(Int(4)) - tree.InsertNoReplace(Int(6)) - tree.InsertNoReplace(Int(1)) - tree.InsertNoReplace(Int(3)) - var ary []Item - tree.DescendLessOrEqual(Int(10), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected := []Item{Int(6), Int(4), Int(3), Int(1)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } - ary = nil - tree.DescendLessOrEqual(Int(4), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected = []Item{Int(4), Int(3), Int(1)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } - ary = nil - tree.DescendLessOrEqual(Int(5), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected = []Item{Int(4), Int(3), Int(1)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/llrb-stats.go b/vendor/github.com/petar/GoLLRB/llrb/llrb-stats.go deleted file mode 100644 index 47126a3be..000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/llrb-stats.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2010 Petar Maymounkov. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package llrb - -// GetHeight() returns an item in the tree with key @key, and it's height in the tree -func (t *LLRB) GetHeight(key Item) (result Item, depth int) { - return t.getHeight(t.root, key) -} - -func (t *LLRB) getHeight(h *Node, item Item) (Item, int) { - if h == nil { - return nil, 0 - } - if less(item, h.Item) { - result, depth := t.getHeight(h.Left, item) - return result, depth + 1 - } - if less(h.Item, item) { - result, depth := t.getHeight(h.Right, item) - return result, depth + 1 - } - return h.Item, 0 -} - -// HeightStats() returns the average and standard deviation of the height -// of elements in the tree -func (t *LLRB) HeightStats() (avg, stddev float64) { - av := &avgVar{} - heightStats(t.root, 0, av) - return av.GetAvg(), av.GetStdDev() -} - -func heightStats(h *Node, d int, av *avgVar) { - if h == nil { - return - } - av.Add(float64(d)) - if h.Left != nil { - heightStats(h.Left, d+1, av) - } - if h.Right != nil { - heightStats(h.Right, d+1, av) - } -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/llrb.go b/vendor/github.com/petar/GoLLRB/llrb/llrb.go deleted file mode 100644 index 81373fbfd..000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/llrb.go +++ /dev/null @@ -1,456 +0,0 @@ -// Copyright 2010 Petar Maymounkov. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// A Left-Leaning Red-Black (LLRB) implementation of 2-3 balanced binary search trees, -// based on the following work: -// -// http://www.cs.princeton.edu/~rs/talks/LLRB/08Penn.pdf -// http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf -// http://www.cs.princeton.edu/~rs/talks/LLRB/Java/RedBlackBST.java -// -// 2-3 trees (and the run-time equivalent 2-3-4 trees) are the de facto standard BST -// algoritms found in implementations of Python, Java, and other libraries. The LLRB -// implementation of 2-3 trees is a recent improvement on the traditional implementation, -// observed and documented by Robert Sedgewick. -// -package llrb - -// Tree is a Left-Leaning Red-Black (LLRB) implementation of 2-3 trees -type LLRB struct { - count int - root *Node -} - -type Node struct { - Item - Left, Right *Node // Pointers to left and right child nodes - Black bool // If set, the color of the link (incoming from the parent) is black - // In the LLRB, new nodes are always red, hence the zero-value for node -} - -type Item interface { - Less(than Item) bool -} - -// -func less(x, y Item) bool { - if x == pinf { - return false - } - if x == ninf { - return true - } - return x.Less(y) -} - -// Inf returns an Item that is "bigger than" any other item, if sign is positive. -// Otherwise it returns an Item that is "smaller than" any other item. -func Inf(sign int) Item { - if sign == 0 { - panic("sign") - } - if sign > 0 { - return pinf - } - return ninf -} - -var ( - ninf = nInf{} - pinf = pInf{} -) - -type nInf struct{} - -func (nInf) Less(Item) bool { - return true -} - -type pInf struct{} - -func (pInf) Less(Item) bool { - return false -} - -// New() allocates a new tree -func New() *LLRB { - return &LLRB{} -} - -// SetRoot sets the root node of the tree. -// It is intended to be used by functions that deserialize the tree. -func (t *LLRB) SetRoot(r *Node) { - t.root = r -} - -// Root returns the root node of the tree. -// It is intended to be used by functions that serialize the tree. -func (t *LLRB) Root() *Node { - return t.root -} - -// Len returns the number of nodes in the tree. -func (t *LLRB) Len() int { return t.count } - -// Has returns true if the tree contains an element whose order is the same as that of key. -func (t *LLRB) Has(key Item) bool { - return t.Get(key) != nil -} - -// Get retrieves an element from the tree whose order is the same as that of key. -func (t *LLRB) Get(key Item) Item { - h := t.root - for h != nil { - switch { - case less(key, h.Item): - h = h.Left - case less(h.Item, key): - h = h.Right - default: - return h.Item - } - } - return nil -} - -// Min returns the minimum element in the tree. -func (t *LLRB) Min() Item { - h := t.root - if h == nil { - return nil - } - for h.Left != nil { - h = h.Left - } - return h.Item -} - -// Max returns the maximum element in the tree. -func (t *LLRB) Max() Item { - h := t.root - if h == nil { - return nil - } - for h.Right != nil { - h = h.Right - } - return h.Item -} - -func (t *LLRB) ReplaceOrInsertBulk(items ...Item) { - for _, i := range items { - t.ReplaceOrInsert(i) - } -} - -func (t *LLRB) InsertNoReplaceBulk(items ...Item) { - for _, i := range items { - t.InsertNoReplace(i) - } -} - -// ReplaceOrInsert inserts item into the tree. If an existing -// element has the same order, it is removed from the tree and returned. -func (t *LLRB) ReplaceOrInsert(item Item) Item { - if item == nil { - panic("inserting nil item") - } - var replaced Item - t.root, replaced = t.replaceOrInsert(t.root, item) - t.root.Black = true - if replaced == nil { - t.count++ - } - return replaced -} - -func (t *LLRB) replaceOrInsert(h *Node, item Item) (*Node, Item) { - if h == nil { - return newNode(item), nil - } - - h = walkDownRot23(h) - - var replaced Item - if less(item, h.Item) { // BUG - h.Left, replaced = t.replaceOrInsert(h.Left, item) - } else if less(h.Item, item) { - h.Right, replaced = t.replaceOrInsert(h.Right, item) - } else { - replaced, h.Item = h.Item, item - } - - h = walkUpRot23(h) - - return h, replaced -} - -// InsertNoReplace inserts item into the tree. If an existing -// element has the same order, both elements remain in the tree. -func (t *LLRB) InsertNoReplace(item Item) { - if item == nil { - panic("inserting nil item") - } - t.root = t.insertNoReplace(t.root, item) - t.root.Black = true - t.count++ -} - -func (t *LLRB) insertNoReplace(h *Node, item Item) *Node { - if h == nil { - return newNode(item) - } - - h = walkDownRot23(h) - - if less(item, h.Item) { - h.Left = t.insertNoReplace(h.Left, item) - } else { - h.Right = t.insertNoReplace(h.Right, item) - } - - return walkUpRot23(h) -} - -// Rotation driver routines for 2-3 algorithm - -func walkDownRot23(h *Node) *Node { return h } - -func walkUpRot23(h *Node) *Node { - if isRed(h.Right) && !isRed(h.Left) { - h = rotateLeft(h) - } - - if isRed(h.Left) && isRed(h.Left.Left) { - h = rotateRight(h) - } - - if isRed(h.Left) && isRed(h.Right) { - flip(h) - } - - return h -} - -// Rotation driver routines for 2-3-4 algorithm - -func walkDownRot234(h *Node) *Node { - if isRed(h.Left) && isRed(h.Right) { - flip(h) - } - - return h -} - -func walkUpRot234(h *Node) *Node { - if isRed(h.Right) && !isRed(h.Left) { - h = rotateLeft(h) - } - - if isRed(h.Left) && isRed(h.Left.Left) { - h = rotateRight(h) - } - - return h -} - -// DeleteMin deletes the minimum element in the tree and returns the -// deleted item or nil otherwise. -func (t *LLRB) DeleteMin() Item { - var deleted Item - t.root, deleted = deleteMin(t.root) - if t.root != nil { - t.root.Black = true - } - if deleted != nil { - t.count-- - } - return deleted -} - -// deleteMin code for LLRB 2-3 trees -func deleteMin(h *Node) (*Node, Item) { - if h == nil { - return nil, nil - } - if h.Left == nil { - return nil, h.Item - } - - if !isRed(h.Left) && !isRed(h.Left.Left) { - h = moveRedLeft(h) - } - - var deleted Item - h.Left, deleted = deleteMin(h.Left) - - return fixUp(h), deleted -} - -// DeleteMax deletes the maximum element in the tree and returns -// the deleted item or nil otherwise -func (t *LLRB) DeleteMax() Item { - var deleted Item - t.root, deleted = deleteMax(t.root) - if t.root != nil { - t.root.Black = true - } - if deleted != nil { - t.count-- - } - return deleted -} - -func deleteMax(h *Node) (*Node, Item) { - if h == nil { - return nil, nil - } - if isRed(h.Left) { - h = rotateRight(h) - } - if h.Right == nil { - return nil, h.Item - } - if !isRed(h.Right) && !isRed(h.Right.Left) { - h = moveRedRight(h) - } - var deleted Item - h.Right, deleted = deleteMax(h.Right) - - return fixUp(h), deleted -} - -// Delete deletes an item from the tree whose key equals key. -// The deleted item is return, otherwise nil is returned. -func (t *LLRB) Delete(key Item) Item { - var deleted Item - t.root, deleted = t.delete(t.root, key) - if t.root != nil { - t.root.Black = true - } - if deleted != nil { - t.count-- - } - return deleted -} - -func (t *LLRB) delete(h *Node, item Item) (*Node, Item) { - var deleted Item - if h == nil { - return nil, nil - } - if less(item, h.Item) { - if h.Left == nil { // item not present. Nothing to delete - return h, nil - } - if !isRed(h.Left) && !isRed(h.Left.Left) { - h = moveRedLeft(h) - } - h.Left, deleted = t.delete(h.Left, item) - } else { - if isRed(h.Left) { - h = rotateRight(h) - } - // If @item equals @h.Item and no right children at @h - if !less(h.Item, item) && h.Right == nil { - return nil, h.Item - } - // PETAR: Added 'h.Right != nil' below - if h.Right != nil && !isRed(h.Right) && !isRed(h.Right.Left) { - h = moveRedRight(h) - } - // If @item equals @h.Item, and (from above) 'h.Right != nil' - if !less(h.Item, item) { - var subDeleted Item - h.Right, subDeleted = deleteMin(h.Right) - if subDeleted == nil { - panic("logic") - } - deleted, h.Item = h.Item, subDeleted - } else { // Else, @item is bigger than @h.Item - h.Right, deleted = t.delete(h.Right, item) - } - } - - return fixUp(h), deleted -} - -// Internal node manipulation routines - -func newNode(item Item) *Node { return &Node{Item: item} } - -func isRed(h *Node) bool { - if h == nil { - return false - } - return !h.Black -} - -func rotateLeft(h *Node) *Node { - x := h.Right - if x.Black { - panic("rotating a black link") - } - h.Right = x.Left - x.Left = h - x.Black = h.Black - h.Black = false - return x -} - -func rotateRight(h *Node) *Node { - x := h.Left - if x.Black { - panic("rotating a black link") - } - h.Left = x.Right - x.Right = h - x.Black = h.Black - h.Black = false - return x -} - -// REQUIRE: Left and Right children must be present -func flip(h *Node) { - h.Black = !h.Black - h.Left.Black = !h.Left.Black - h.Right.Black = !h.Right.Black -} - -// REQUIRE: Left and Right children must be present -func moveRedLeft(h *Node) *Node { - flip(h) - if isRed(h.Right.Left) { - h.Right = rotateRight(h.Right) - h = rotateLeft(h) - flip(h) - } - return h -} - -// REQUIRE: Left and Right children must be present -func moveRedRight(h *Node) *Node { - flip(h) - if isRed(h.Left.Left) { - h = rotateRight(h) - flip(h) - } - return h -} - -func fixUp(h *Node) *Node { - if isRed(h.Right) { - h = rotateLeft(h) - } - - if isRed(h.Left) && isRed(h.Left.Left) { - h = rotateRight(h) - } - - if isRed(h.Left) && isRed(h.Right) { - flip(h) - } - - return h -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/llrb_test.go b/vendor/github.com/petar/GoLLRB/llrb/llrb_test.go deleted file mode 100644 index b7bc97800..000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/llrb_test.go +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright 2010 Petar Maymounkov. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package llrb - -import ( - "math" - "math/rand" - "testing" -) - -func TestCases(t *testing.T) { - tree := New() - tree.ReplaceOrInsert(Int(1)) - tree.ReplaceOrInsert(Int(1)) - if tree.Len() != 1 { - t.Errorf("expecting len 1") - } - if !tree.Has(Int(1)) { - t.Errorf("expecting to find key=1") - } - - tree.Delete(Int(1)) - if tree.Len() != 0 { - t.Errorf("expecting len 0") - } - if tree.Has(Int(1)) { - t.Errorf("not expecting to find key=1") - } - - tree.Delete(Int(1)) - if tree.Len() != 0 { - t.Errorf("expecting len 0") - } - if tree.Has(Int(1)) { - t.Errorf("not expecting to find key=1") - } -} - -func TestReverseInsertOrder(t *testing.T) { - tree := New() - n := 100 - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(n - i)) - } - i := 0 - tree.AscendGreaterOrEqual(Int(0), func(item Item) bool { - i++ - if item.(Int) != Int(i) { - t.Errorf("bad order: got %d, expect %d", item.(Int), i) - } - return true - }) -} - -func TestRange(t *testing.T) { - tree := New() - order := []String{ - "ab", "aba", "abc", "a", "aa", "aaa", "b", "a-", "a!", - } - for _, i := range order { - tree.ReplaceOrInsert(i) - } - k := 0 - tree.AscendRange(String("ab"), String("ac"), func(item Item) bool { - if k > 3 { - t.Fatalf("returned more items than expected") - } - i1 := order[k] - i2 := item.(String) - if i1 != i2 { - t.Errorf("expecting %s, got %s", i1, i2) - } - k++ - return true - }) -} - -func TestRandomInsertOrder(t *testing.T) { - tree := New() - n := 1000 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - j := 0 - tree.AscendGreaterOrEqual(Int(0), func(item Item) bool { - if item.(Int) != Int(j) { - t.Fatalf("bad order") - } - j++ - return true - }) -} - -func TestRandomReplace(t *testing.T) { - tree := New() - n := 100 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - perm = rand.Perm(n) - for i := 0; i < n; i++ { - if replaced := tree.ReplaceOrInsert(Int(perm[i])); replaced == nil || replaced.(Int) != Int(perm[i]) { - t.Errorf("error replacing") - } - } -} - -func TestRandomInsertSequentialDelete(t *testing.T) { - tree := New() - n := 1000 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - for i := 0; i < n; i++ { - tree.Delete(Int(i)) - } -} - -func TestRandomInsertDeleteNonExistent(t *testing.T) { - tree := New() - n := 100 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - if tree.Delete(Int(200)) != nil { - t.Errorf("deleted non-existent item") - } - if tree.Delete(Int(-2)) != nil { - t.Errorf("deleted non-existent item") - } - for i := 0; i < n; i++ { - if u := tree.Delete(Int(i)); u == nil || u.(Int) != Int(i) { - t.Errorf("delete failed") - } - } - if tree.Delete(Int(200)) != nil { - t.Errorf("deleted non-existent item") - } - if tree.Delete(Int(-2)) != nil { - t.Errorf("deleted non-existent item") - } -} - -func TestRandomInsertPartialDeleteOrder(t *testing.T) { - tree := New() - n := 100 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - for i := 1; i < n-1; i++ { - tree.Delete(Int(i)) - } - j := 0 - tree.AscendGreaterOrEqual(Int(0), func(item Item) bool { - switch j { - case 0: - if item.(Int) != Int(0) { - t.Errorf("expecting 0") - } - case 1: - if item.(Int) != Int(n-1) { - t.Errorf("expecting %d", n-1) - } - } - j++ - return true - }) -} - -func TestRandomInsertStats(t *testing.T) { - tree := New() - n := 100000 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - avg, _ := tree.HeightStats() - expAvg := math.Log2(float64(n)) - 1.5 - if math.Abs(avg-expAvg) >= 2.0 { - t.Errorf("too much deviation from expected average height") - } -} - -func BenchmarkInsert(b *testing.B) { - tree := New() - for i := 0; i < b.N; i++ { - tree.ReplaceOrInsert(Int(b.N - i)) - } -} - -func BenchmarkDelete(b *testing.B) { - b.StopTimer() - tree := New() - for i := 0; i < b.N; i++ { - tree.ReplaceOrInsert(Int(b.N - i)) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - tree.Delete(Int(i)) - } -} - -func BenchmarkDeleteMin(b *testing.B) { - b.StopTimer() - tree := New() - for i := 0; i < b.N; i++ { - tree.ReplaceOrInsert(Int(b.N - i)) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - tree.DeleteMin() - } -} - -func TestInsertNoReplace(t *testing.T) { - tree := New() - n := 1000 - for q := 0; q < 2; q++ { - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.InsertNoReplace(Int(perm[i])) - } - } - j := 0 - tree.AscendGreaterOrEqual(Int(0), func(item Item) bool { - if item.(Int) != Int(j/2) { - t.Fatalf("bad order") - } - j++ - return true - }) -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/util.go b/vendor/github.com/petar/GoLLRB/llrb/util.go deleted file mode 100644 index 63dbdb2df..000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/util.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2010 Petar Maymounkov. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package llrb - -type Int int - -func (x Int) Less(than Item) bool { - return x < than.(Int) -} - -type String string - -func (x String) Less(than Item) bool { - return x < than.(String) -} diff --git a/vendor/github.com/peterbourgon/diskv/LICENSE b/vendor/github.com/peterbourgon/diskv/LICENSE deleted file mode 100644 index 41ce7f16e..000000000 --- a/vendor/github.com/peterbourgon/diskv/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2012 Peter Bourgon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/peterbourgon/diskv/README.md b/vendor/github.com/peterbourgon/diskv/README.md deleted file mode 100644 index 3474739ed..000000000 --- a/vendor/github.com/peterbourgon/diskv/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# What is diskv? - -Diskv (disk-vee) is a simple, persistent key-value store written in the Go -language. It starts with an incredibly simple API for storing arbitrary data on -a filesystem by key, and builds several layers of performance-enhancing -abstraction on top. The end result is a conceptually simple, but highly -performant, disk-backed storage system. - -[![Build Status][1]][2] - -[1]: https://drone.io/github.com/peterbourgon/diskv/status.png -[2]: https://drone.io/github.com/peterbourgon/diskv/latest - - -# Installing - -Install [Go 1][3], either [from source][4] or [with a prepackaged binary][5]. -Then, - -```bash -$ go get github.com/peterbourgon/diskv -``` - -[3]: http://golang.org -[4]: http://golang.org/doc/install/source -[5]: http://golang.org/doc/install - - -# Usage - -```go -package main - -import ( - "fmt" - "github.com/peterbourgon/diskv" -) - -func main() { - // Simplest transform function: put all the data files into the base dir. - flatTransform := func(s string) []string { return []string{} } - - // Initialize a new diskv store, rooted at "my-data-dir", with a 1MB cache. - d := diskv.New(diskv.Options{ - BasePath: "my-data-dir", - Transform: flatTransform, - CacheSizeMax: 1024 * 1024, - }) - - // Write three bytes to the key "alpha". - key := "alpha" - d.Write(key, []byte{'1', '2', '3'}) - - // Read the value back out of the store. - value, _ := d.Read(key) - fmt.Printf("%v\n", value) - - // Erase the key+value from the store (and the disk). - d.Erase(key) -} -``` - -More complex examples can be found in the "examples" subdirectory. - - -# Theory - -## Basic idea - -At its core, diskv is a map of a key (`string`) to arbitrary data (`[]byte`). -The data is written to a single file on disk, with the same name as the key. -The key determines where that file will be stored, via a user-provided -`TransformFunc`, which takes a key and returns a slice (`[]string`) -corresponding to a path list where the key file will be stored. The simplest -TransformFunc, - -```go -func SimpleTransform (key string) []string { - return []string{} -} -``` - -will place all keys in the same, base directory. The design is inspired by -[Redis diskstore][6]; a TransformFunc which emulates the default diskstore -behavior is available in the content-addressable-storage example. - -[6]: http://groups.google.com/group/redis-db/browse_thread/thread/d444bc786689bde9?pli=1 - -**Note** that your TransformFunc should ensure that one valid key doesn't -transform to a subset of another valid key. That is, it shouldn't be possible -to construct valid keys that resolve to directory names. As a concrete example, -if your TransformFunc splits on every 3 characters, then - -```go -d.Write("abcabc", val) // OK: written to /abc/abc/abcabc -d.Write("abc", val) // Error: attempted write to /abc/abc, but it's a directory -``` - -This will be addressed in an upcoming version of diskv. - -Probably the most important design principle behind diskv is that your data is -always flatly available on the disk. diskv will never do anything that would -prevent you from accessing, copying, backing up, or otherwise interacting with -your data via common UNIX commandline tools. - -## Adding a cache - -An in-memory caching layer is provided by combining the BasicStore -functionality with a simple map structure, and keeping it up-to-date as -appropriate. Since the map structure in Go is not threadsafe, it's combined -with a RWMutex to provide safe concurrent access. - -## Adding order - -diskv is a key-value store and therefore inherently unordered. An ordering -system can be injected into the store by passing something which satisfies the -diskv.Index interface. (A default implementation, using Google's -[btree][7] package, is provided.) Basically, diskv keeps an ordered (by a -user-provided Less function) index of the keys, which can be queried. - -[7]: https://github.com/google/btree - -## Adding compression - -Something which implements the diskv.Compression interface may be passed -during store creation, so that all Writes and Reads are filtered through -a compression/decompression pipeline. Several default implementations, -using stdlib compression algorithms, are provided. Note that data is cached -compressed; the cost of decompression is borne with each Read. - -## Streaming - -diskv also now provides ReadStream and WriteStream methods, to allow very large -data to be handled efficiently. - - -# Future plans - - * Needs plenty of robust testing: huge datasets, etc... - * More thorough benchmarking - * Your suggestions for use-cases I haven't thought of diff --git a/vendor/github.com/peterbourgon/diskv/basic_test.go b/vendor/github.com/peterbourgon/diskv/basic_test.go deleted file mode 100644 index 0ef0b17fe..000000000 --- a/vendor/github.com/peterbourgon/diskv/basic_test.go +++ /dev/null @@ -1,336 +0,0 @@ -package diskv - -import ( - "bytes" - "errors" - "testing" - "time" -) - -func cmpBytes(a, b []byte) bool { - if len(a) != len(b) { - return false - } - for i := 0; i < len(a); i++ { - if a[i] != b[i] { - return false - } - } - return true -} - -func (d *Diskv) isCached(key string) bool { - d.mu.RLock() - defer d.mu.RUnlock() - _, ok := d.cache[key] - return ok -} - -func TestWriteReadErase(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - }) - defer d.EraseAll() - k, v := "a", []byte{'b'} - if err := d.Write(k, v); err != nil { - t.Fatalf("write: %s", err) - } - if readVal, err := d.Read(k); err != nil { - t.Fatalf("read: %s", err) - } else if bytes.Compare(v, readVal) != 0 { - t.Fatalf("read: expected %s, got %s", v, readVal) - } - if err := d.Erase(k); err != nil { - t.Fatalf("erase: %s", err) - } -} - -func TestWRECache(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - }) - defer d.EraseAll() - k, v := "xxx", []byte{' ', ' ', ' '} - if d.isCached(k) { - t.Fatalf("key cached before Write and Read") - } - if err := d.Write(k, v); err != nil { - t.Fatalf("write: %s", err) - } - if d.isCached(k) { - t.Fatalf("key cached before Read") - } - if readVal, err := d.Read(k); err != nil { - t.Fatalf("read: %s", err) - } else if bytes.Compare(v, readVal) != 0 { - t.Fatalf("read: expected %s, got %s", v, readVal) - } - for i := 0; i < 10 && !d.isCached(k); i++ { - time.Sleep(10 * time.Millisecond) - } - if !d.isCached(k) { - t.Fatalf("key not cached after Read") - } - if err := d.Erase(k); err != nil { - t.Fatalf("erase: %s", err) - } - if d.isCached(k) { - t.Fatalf("key cached after Erase") - } -} - -func TestStrings(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - }) - defer d.EraseAll() - - keys := map[string]bool{"a": false, "b": false, "c": false, "d": false} - v := []byte{'1'} - for k := range keys { - if err := d.Write(k, v); err != nil { - t.Fatalf("write: %s: %s", k, err) - } - } - - for k := range d.Keys(nil) { - if _, present := keys[k]; present { - t.Logf("got: %s", k) - keys[k] = true - } else { - t.Fatalf("strings() returns unknown key: %s", k) - } - } - - for k, found := range keys { - if !found { - t.Errorf("never got %s", k) - } - } -} - -func TestZeroByteCache(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 0, - }) - defer d.EraseAll() - - k, v := "a", []byte{'1', '2', '3'} - if err := d.Write(k, v); err != nil { - t.Fatalf("Write: %s", err) - } - - if d.isCached(k) { - t.Fatalf("key cached, expected not-cached") - } - - if _, err := d.Read(k); err != nil { - t.Fatalf("Read: %s", err) - } - - if d.isCached(k) { - t.Fatalf("key cached, expected not-cached") - } -} - -func TestOneByteCache(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1, - }) - defer d.EraseAll() - - k1, k2, v1, v2 := "a", "b", []byte{'1'}, []byte{'1', '2'} - if err := d.Write(k1, v1); err != nil { - t.Fatal(err) - } - - if v, err := d.Read(k1); err != nil { - t.Fatal(err) - } else if !cmpBytes(v, v1) { - t.Fatalf("Read: expected %s, got %s", string(v1), string(v)) - } - - for i := 0; i < 10 && !d.isCached(k1); i++ { - time.Sleep(10 * time.Millisecond) - } - if !d.isCached(k1) { - t.Fatalf("expected 1-byte value to be cached, but it wasn't") - } - - if err := d.Write(k2, v2); err != nil { - t.Fatal(err) - } - if _, err := d.Read(k2); err != nil { - t.Fatalf("--> %s", err) - } - - for i := 0; i < 10 && (!d.isCached(k1) || d.isCached(k2)); i++ { - time.Sleep(10 * time.Millisecond) // just wait for lazy-cache - } - if !d.isCached(k1) { - t.Fatalf("1-byte value was uncached for no reason") - } - - if d.isCached(k2) { - t.Fatalf("2-byte value was cached, but cache max size is 1") - } -} - -func TestStaleCache(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1, - }) - defer d.EraseAll() - - k, first, second := "a", "first", "second" - if err := d.Write(k, []byte(first)); err != nil { - t.Fatal(err) - } - - v, err := d.Read(k) - if err != nil { - t.Fatal(err) - } - if string(v) != first { - t.Errorf("expected '%s', got '%s'", first, v) - } - - if err := d.Write(k, []byte(second)); err != nil { - t.Fatal(err) - } - - v, err = d.Read(k) - if err != nil { - t.Fatal(err) - } - - if string(v) != second { - t.Errorf("expected '%s', got '%s'", second, v) - } -} - -func TestHas(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - }) - defer d.EraseAll() - - for k, v := range map[string]string{ - "a": "1", - "foo": "2", - "012345": "3", - } { - d.Write(k, []byte(v)) - } - - d.Read("foo") // cache one of them - if !d.isCached("foo") { - t.Errorf("'foo' didn't get cached") - } - - for _, tuple := range []struct { - key string - expected bool - }{ - {"a", true}, - {"b", false}, - {"foo", true}, - {"bar", false}, - {"01234", false}, - {"012345", true}, - {"0123456", false}, - } { - if expected, got := tuple.expected, d.Has(tuple.key); expected != got { - t.Errorf("Has(%s): expected %v, got %v", tuple.key, expected, got) - } - } -} - -type BrokenReader struct{} - -func (BrokenReader) Read(p []byte) (n int, err error) { - return 0, errors.New("failed to read") -} - -func TestRemovesIncompleteFiles(t *testing.T) { - opts := Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - } - d := New(opts) - defer d.EraseAll() - - key, stream, sync := "key", BrokenReader{}, false - - if err := d.WriteStream(key, stream, sync); err == nil { - t.Fatalf("Expected i/o copy error, none received.") - } - - if _, err := d.Read(key); err == nil { - t.Fatal("Could read the key, but it shouldn't exist") - } -} - -func TestTempDir(t *testing.T) { - opts := Options{ - BasePath: "test-data", - TempDir: "test-data-temp", - CacheSizeMax: 1024, - } - d := New(opts) - defer d.EraseAll() - - k, v := "a", []byte{'b'} - if err := d.Write(k, v); err != nil { - t.Fatalf("write: %s", err) - } - if readVal, err := d.Read(k); err != nil { - t.Fatalf("read: %s", err) - } else if bytes.Compare(v, readVal) != 0 { - t.Fatalf("read: expected %s, got %s", v, readVal) - } - if err := d.Erase(k); err != nil { - t.Fatalf("erase: %s", err) - } -} - -type CrashingReader struct{} - -func (CrashingReader) Read(p []byte) (n int, err error) { - panic("System has crashed while reading the stream") -} - -func TestAtomicWrite(t *testing.T) { - opts := Options{ - BasePath: "test-data", - // Test would fail if TempDir is not set here. - TempDir: "test-data-temp", - CacheSizeMax: 1024, - } - d := New(opts) - defer d.EraseAll() - - key := "key" - func() { - defer func() { - recover() // Ignore panicking error - }() - - stream := CrashingReader{} - d.WriteStream(key, stream, false) - }() - - if d.Has(key) { - t.Fatal("Has key, but it shouldn't exist") - } - if _, ok := <-d.Keys(nil); ok { - t.Fatal("Store isn't empty") - } -} diff --git a/vendor/github.com/peterbourgon/diskv/compression.go b/vendor/github.com/peterbourgon/diskv/compression.go deleted file mode 100644 index 5192b0273..000000000 --- a/vendor/github.com/peterbourgon/diskv/compression.go +++ /dev/null @@ -1,64 +0,0 @@ -package diskv - -import ( - "compress/flate" - "compress/gzip" - "compress/zlib" - "io" -) - -// Compression is an interface that Diskv uses to implement compression of -// data. Writer takes a destination io.Writer and returns a WriteCloser that -// compresses all data written through it. Reader takes a source io.Reader and -// returns a ReadCloser that decompresses all data read through it. You may -// define these methods on your own type, or use one of the NewCompression -// helpers. -type Compression interface { - Writer(dst io.Writer) (io.WriteCloser, error) - Reader(src io.Reader) (io.ReadCloser, error) -} - -// NewGzipCompression returns a Gzip-based Compression. -func NewGzipCompression() Compression { - return NewGzipCompressionLevel(flate.DefaultCompression) -} - -// NewGzipCompressionLevel returns a Gzip-based Compression with the given level. -func NewGzipCompressionLevel(level int) Compression { - return &genericCompression{ - wf: func(w io.Writer) (io.WriteCloser, error) { return gzip.NewWriterLevel(w, level) }, - rf: func(r io.Reader) (io.ReadCloser, error) { return gzip.NewReader(r) }, - } -} - -// NewZlibCompression returns a Zlib-based Compression. -func NewZlibCompression() Compression { - return NewZlibCompressionLevel(flate.DefaultCompression) -} - -// NewZlibCompressionLevel returns a Zlib-based Compression with the given level. -func NewZlibCompressionLevel(level int) Compression { - return NewZlibCompressionLevelDict(level, nil) -} - -// NewZlibCompressionLevelDict returns a Zlib-based Compression with the given -// level, based on the given dictionary. -func NewZlibCompressionLevelDict(level int, dict []byte) Compression { - return &genericCompression{ - func(w io.Writer) (io.WriteCloser, error) { return zlib.NewWriterLevelDict(w, level, dict) }, - func(r io.Reader) (io.ReadCloser, error) { return zlib.NewReaderDict(r, dict) }, - } -} - -type genericCompression struct { - wf func(w io.Writer) (io.WriteCloser, error) - rf func(r io.Reader) (io.ReadCloser, error) -} - -func (g *genericCompression) Writer(dst io.Writer) (io.WriteCloser, error) { - return g.wf(dst) -} - -func (g *genericCompression) Reader(src io.Reader) (io.ReadCloser, error) { - return g.rf(src) -} diff --git a/vendor/github.com/peterbourgon/diskv/compression_test.go b/vendor/github.com/peterbourgon/diskv/compression_test.go deleted file mode 100644 index 2d6142037..000000000 --- a/vendor/github.com/peterbourgon/diskv/compression_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package diskv - -import ( - "compress/flate" - "fmt" - "math/rand" - "os" - "testing" - "time" -) - -func init() { - rand.Seed(time.Now().UnixNano()) -} - -func testCompressionWith(t *testing.T, c Compression, name string) { - d := New(Options{ - BasePath: "compression-test", - CacheSizeMax: 0, - Compression: c, - }) - defer d.EraseAll() - - sz := 4096 - val := make([]byte, sz) - for i := 0; i < sz; i++ { - val[i] = byte('a' + rand.Intn(26)) // {a-z}; should compress some - } - - key := "a" - if err := d.Write(key, val); err != nil { - t.Fatalf("write failed: %s", err) - } - - targetFile := fmt.Sprintf("%s%c%s", d.BasePath, os.PathSeparator, key) - fi, err := os.Stat(targetFile) - if err != nil { - t.Fatalf("%s: %s", targetFile, err) - } - - if fi.Size() >= int64(sz) { - t.Fatalf("%s: size=%d, expected smaller", targetFile, fi.Size()) - } - t.Logf("%s compressed %d to %d", name, sz, fi.Size()) - - readVal, err := d.Read(key) - if len(readVal) != sz { - t.Fatalf("read: expected size=%d, got size=%d", sz, len(readVal)) - } - - for i := 0; i < sz; i++ { - if readVal[i] != val[i] { - t.Fatalf("i=%d: expected %v, got %v", i, val[i], readVal[i]) - } - } -} - -func TestGzipDefault(t *testing.T) { - testCompressionWith(t, NewGzipCompression(), "gzip") -} - -func TestGzipBestCompression(t *testing.T) { - testCompressionWith(t, NewGzipCompressionLevel(flate.BestCompression), "gzip-max") -} - -func TestGzipBestSpeed(t *testing.T) { - testCompressionWith(t, NewGzipCompressionLevel(flate.BestSpeed), "gzip-min") -} - -func TestZlib(t *testing.T) { - testCompressionWith(t, NewZlibCompression(), "zlib") -} diff --git a/vendor/github.com/peterbourgon/diskv/diskv.go b/vendor/github.com/peterbourgon/diskv/diskv.go deleted file mode 100644 index 524dc0a6e..000000000 --- a/vendor/github.com/peterbourgon/diskv/diskv.go +++ /dev/null @@ -1,624 +0,0 @@ -// Diskv (disk-vee) is a simple, persistent, key-value store. -// It stores all data flatly on the filesystem. - -package diskv - -import ( - "bytes" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "sync" - "syscall" -) - -const ( - defaultBasePath = "diskv" - defaultFilePerm os.FileMode = 0666 - defaultPathPerm os.FileMode = 0777 -) - -var ( - defaultTransform = func(s string) []string { return []string{} } - errCanceled = errors.New("canceled") - errEmptyKey = errors.New("empty key") - errBadKey = errors.New("bad key") - errImportDirectory = errors.New("can't import a directory") -) - -// TransformFunction transforms a key into a slice of strings, with each -// element in the slice representing a directory in the file path where the -// key's entry will eventually be stored. -// -// For example, if TransformFunc transforms "abcdef" to ["ab", "cde", "f"], -// the final location of the data file will be /ab/cde/f/abcdef -type TransformFunction func(s string) []string - -// Options define a set of properties that dictate Diskv behavior. -// All values are optional. -type Options struct { - BasePath string - Transform TransformFunction - CacheSizeMax uint64 // bytes - PathPerm os.FileMode - FilePerm os.FileMode - // If TempDir is set, it will enable filesystem atomic writes by - // writing temporary files to that location before being moved - // to BasePath. - // Note that TempDir MUST be on the same device/partition as - // BasePath. - TempDir string - - Index Index - IndexLess LessFunction - - Compression Compression -} - -// Diskv implements the Diskv interface. You shouldn't construct Diskv -// structures directly; instead, use the New constructor. -type Diskv struct { - Options - mu sync.RWMutex - cache map[string][]byte - cacheSize uint64 -} - -// New returns an initialized Diskv structure, ready to use. -// If the path identified by baseDir already contains data, -// it will be accessible, but not yet cached. -func New(o Options) *Diskv { - if o.BasePath == "" { - o.BasePath = defaultBasePath - } - if o.Transform == nil { - o.Transform = defaultTransform - } - if o.PathPerm == 0 { - o.PathPerm = defaultPathPerm - } - if o.FilePerm == 0 { - o.FilePerm = defaultFilePerm - } - - d := &Diskv{ - Options: o, - cache: map[string][]byte{}, - cacheSize: 0, - } - - if d.Index != nil && d.IndexLess != nil { - d.Index.Initialize(d.IndexLess, d.Keys(nil)) - } - - return d -} - -// Write synchronously writes the key-value pair to disk, making it immediately -// available for reads. Write relies on the filesystem to perform an eventual -// sync to physical media. If you need stronger guarantees, see WriteStream. -func (d *Diskv) Write(key string, val []byte) error { - return d.WriteStream(key, bytes.NewBuffer(val), false) -} - -// WriteStream writes the data represented by the io.Reader to the disk, under -// the provided key. If sync is true, WriteStream performs an explicit sync on -// the file as soon as it's written. -// -// bytes.Buffer provides io.Reader semantics for basic data types. -func (d *Diskv) WriteStream(key string, r io.Reader, sync bool) error { - if len(key) <= 0 { - return errEmptyKey - } - - d.mu.Lock() - defer d.mu.Unlock() - - return d.writeStreamWithLock(key, r, sync) -} - -// createKeyFileWithLock either creates the key file directly, or -// creates a temporary file in TempDir if it is set. -func (d *Diskv) createKeyFileWithLock(key string) (*os.File, error) { - if d.TempDir != "" { - if err := os.MkdirAll(d.TempDir, d.PathPerm); err != nil { - return nil, fmt.Errorf("temp mkdir: %s", err) - } - f, err := ioutil.TempFile(d.TempDir, "") - if err != nil { - return nil, fmt.Errorf("temp file: %s", err) - } - - if err := f.Chmod(d.FilePerm); err != nil { - f.Close() // error deliberately ignored - os.Remove(f.Name()) // error deliberately ignored - return nil, fmt.Errorf("chmod: %s", err) - } - return f, nil - } - - mode := os.O_WRONLY | os.O_CREATE | os.O_TRUNC // overwrite if exists - f, err := os.OpenFile(d.completeFilename(key), mode, d.FilePerm) - if err != nil { - return nil, fmt.Errorf("open file: %s", err) - } - return f, nil -} - -// writeStream does no input validation checking. -func (d *Diskv) writeStreamWithLock(key string, r io.Reader, sync bool) error { - if err := d.ensurePathWithLock(key); err != nil { - return fmt.Errorf("ensure path: %s", err) - } - - f, err := d.createKeyFileWithLock(key) - if err != nil { - return fmt.Errorf("create key file: %s", err) - } - - wc := io.WriteCloser(&nopWriteCloser{f}) - if d.Compression != nil { - wc, err = d.Compression.Writer(f) - if err != nil { - f.Close() // error deliberately ignored - os.Remove(f.Name()) // error deliberately ignored - return fmt.Errorf("compression writer: %s", err) - } - } - - if _, err := io.Copy(wc, r); err != nil { - f.Close() // error deliberately ignored - os.Remove(f.Name()) // error deliberately ignored - return fmt.Errorf("i/o copy: %s", err) - } - - if err := wc.Close(); err != nil { - f.Close() // error deliberately ignored - os.Remove(f.Name()) // error deliberately ignored - return fmt.Errorf("compression close: %s", err) - } - - if sync { - if err := f.Sync(); err != nil { - f.Close() // error deliberately ignored - os.Remove(f.Name()) // error deliberately ignored - return fmt.Errorf("file sync: %s", err) - } - } - - if err := f.Close(); err != nil { - return fmt.Errorf("file close: %s", err) - } - - if f.Name() != d.completeFilename(key) { - if err := os.Rename(f.Name(), d.completeFilename(key)); err != nil { - os.Remove(f.Name()) // error deliberately ignored - return fmt.Errorf("rename: %s", err) - } - } - - if d.Index != nil { - d.Index.Insert(key) - } - - d.bustCacheWithLock(key) // cache only on read - - return nil -} - -// Import imports the source file into diskv under the destination key. If the -// destination key already exists, it's overwritten. If move is true, the -// source file is removed after a successful import. -func (d *Diskv) Import(srcFilename, dstKey string, move bool) (err error) { - if dstKey == "" { - return errEmptyKey - } - - if fi, err := os.Stat(srcFilename); err != nil { - return err - } else if fi.IsDir() { - return errImportDirectory - } - - d.mu.Lock() - defer d.mu.Unlock() - - if err := d.ensurePathWithLock(dstKey); err != nil { - return fmt.Errorf("ensure path: %s", err) - } - - if move { - if err := syscall.Rename(srcFilename, d.completeFilename(dstKey)); err == nil { - d.bustCacheWithLock(dstKey) - return nil - } else if err != syscall.EXDEV { - // If it failed due to being on a different device, fall back to copying - return err - } - } - - f, err := os.Open(srcFilename) - if err != nil { - return err - } - defer f.Close() - err = d.writeStreamWithLock(dstKey, f, false) - if err == nil && move { - err = os.Remove(srcFilename) - } - return err -} - -// Read reads the key and returns the value. -// If the key is available in the cache, Read won't touch the disk. -// If the key is not in the cache, Read will have the side-effect of -// lazily caching the value. -func (d *Diskv) Read(key string) ([]byte, error) { - rc, err := d.ReadStream(key, false) - if err != nil { - return []byte{}, err - } - defer rc.Close() - return ioutil.ReadAll(rc) -} - -// ReadStream reads the key and returns the value (data) as an io.ReadCloser. -// If the value is cached from a previous read, and direct is false, -// ReadStream will use the cached value. Otherwise, it will return a handle to -// the file on disk, and cache the data on read. -// -// If direct is true, ReadStream will lazily delete any cached value for the -// key, and return a direct handle to the file on disk. -// -// If compression is enabled, ReadStream taps into the io.Reader stream prior -// to decompression, and caches the compressed data. -func (d *Diskv) ReadStream(key string, direct bool) (io.ReadCloser, error) { - d.mu.RLock() - defer d.mu.RUnlock() - - if val, ok := d.cache[key]; ok { - if !direct { - buf := bytes.NewBuffer(val) - if d.Compression != nil { - return d.Compression.Reader(buf) - } - return ioutil.NopCloser(buf), nil - } - - go func() { - d.mu.Lock() - defer d.mu.Unlock() - d.uncacheWithLock(key, uint64(len(val))) - }() - } - - return d.readWithRLock(key) -} - -// read ignores the cache, and returns an io.ReadCloser representing the -// decompressed data for the given key, streamed from the disk. Clients should -// acquire a read lock on the Diskv and check the cache themselves before -// calling read. -func (d *Diskv) readWithRLock(key string) (io.ReadCloser, error) { - filename := d.completeFilename(key) - - fi, err := os.Stat(filename) - if err != nil { - return nil, err - } - if fi.IsDir() { - return nil, os.ErrNotExist - } - - f, err := os.Open(filename) - if err != nil { - return nil, err - } - - var r io.Reader - if d.CacheSizeMax > 0 { - r = newSiphon(f, d, key) - } else { - r = &closingReader{f} - } - - var rc = io.ReadCloser(ioutil.NopCloser(r)) - if d.Compression != nil { - rc, err = d.Compression.Reader(r) - if err != nil { - return nil, err - } - } - - return rc, nil -} - -// closingReader provides a Reader that automatically closes the -// embedded ReadCloser when it reaches EOF -type closingReader struct { - rc io.ReadCloser -} - -func (cr closingReader) Read(p []byte) (int, error) { - n, err := cr.rc.Read(p) - if err == io.EOF { - if closeErr := cr.rc.Close(); closeErr != nil { - return n, closeErr // close must succeed for Read to succeed - } - } - return n, err -} - -// siphon is like a TeeReader: it copies all data read through it to an -// internal buffer, and moves that buffer to the cache at EOF. -type siphon struct { - f *os.File - d *Diskv - key string - buf *bytes.Buffer -} - -// newSiphon constructs a siphoning reader that represents the passed file. -// When a successful series of reads ends in an EOF, the siphon will write -// the buffered data to Diskv's cache under the given key. -func newSiphon(f *os.File, d *Diskv, key string) io.Reader { - return &siphon{ - f: f, - d: d, - key: key, - buf: &bytes.Buffer{}, - } -} - -// Read implements the io.Reader interface for siphon. -func (s *siphon) Read(p []byte) (int, error) { - n, err := s.f.Read(p) - - if err == nil { - return s.buf.Write(p[0:n]) // Write must succeed for Read to succeed - } - - if err == io.EOF { - s.d.cacheWithoutLock(s.key, s.buf.Bytes()) // cache may fail - if closeErr := s.f.Close(); closeErr != nil { - return n, closeErr // close must succeed for Read to succeed - } - return n, err - } - - return n, err -} - -// Erase synchronously erases the given key from the disk and the cache. -func (d *Diskv) Erase(key string) error { - d.mu.Lock() - defer d.mu.Unlock() - - d.bustCacheWithLock(key) - - // erase from index - if d.Index != nil { - d.Index.Delete(key) - } - - // erase from disk - filename := d.completeFilename(key) - if s, err := os.Stat(filename); err == nil { - if s.IsDir() { - return errBadKey - } - if err = os.Remove(filename); err != nil { - return err - } - } else { - // Return err as-is so caller can do os.IsNotExist(err). - return err - } - - // clean up and return - d.pruneDirsWithLock(key) - return nil -} - -// EraseAll will delete all of the data from the store, both in the cache and on -// the disk. Note that EraseAll doesn't distinguish diskv-related data from non- -// diskv-related data. Care should be taken to always specify a diskv base -// directory that is exclusively for diskv data. -func (d *Diskv) EraseAll() error { - d.mu.Lock() - defer d.mu.Unlock() - d.cache = make(map[string][]byte) - d.cacheSize = 0 - if d.TempDir != "" { - os.RemoveAll(d.TempDir) // errors ignored - } - return os.RemoveAll(d.BasePath) -} - -// Has returns true if the given key exists. -func (d *Diskv) Has(key string) bool { - d.mu.Lock() - defer d.mu.Unlock() - - if _, ok := d.cache[key]; ok { - return true - } - - filename := d.completeFilename(key) - s, err := os.Stat(filename) - if err != nil { - return false - } - if s.IsDir() { - return false - } - - return true -} - -// Keys returns a channel that will yield every key accessible by the store, -// in undefined order. If a cancel channel is provided, closing it will -// terminate and close the keys channel. -func (d *Diskv) Keys(cancel <-chan struct{}) <-chan string { - return d.KeysPrefix("", cancel) -} - -// KeysPrefix returns a channel that will yield every key accessible by the -// store with the given prefix, in undefined order. If a cancel channel is -// provided, closing it will terminate and close the keys channel. If the -// provided prefix is the empty string, all keys will be yielded. -func (d *Diskv) KeysPrefix(prefix string, cancel <-chan struct{}) <-chan string { - var prepath string - if prefix == "" { - prepath = d.BasePath - } else { - prepath = d.pathFor(prefix) - } - c := make(chan string) - go func() { - filepath.Walk(prepath, walker(c, prefix, cancel)) - close(c) - }() - return c -} - -// walker returns a function which satisfies the filepath.WalkFunc interface. -// It sends every non-directory file entry down the channel c. -func walker(c chan<- string, prefix string, cancel <-chan struct{}) filepath.WalkFunc { - return func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - - if info.IsDir() || !strings.HasPrefix(info.Name(), prefix) { - return nil // "pass" - } - - select { - case c <- info.Name(): - case <-cancel: - return errCanceled - } - - return nil - } -} - -// pathFor returns the absolute path for location on the filesystem where the -// data for the given key will be stored. -func (d *Diskv) pathFor(key string) string { - return filepath.Join(d.BasePath, filepath.Join(d.Transform(key)...)) -} - -// ensurePathWithLock is a helper function that generates all necessary -// directories on the filesystem for the given key. -func (d *Diskv) ensurePathWithLock(key string) error { - return os.MkdirAll(d.pathFor(key), d.PathPerm) -} - -// completeFilename returns the absolute path to the file for the given key. -func (d *Diskv) completeFilename(key string) string { - return filepath.Join(d.pathFor(key), key) -} - -// cacheWithLock attempts to cache the given key-value pair in the store's -// cache. It can fail if the value is larger than the cache's maximum size. -func (d *Diskv) cacheWithLock(key string, val []byte) error { - valueSize := uint64(len(val)) - if err := d.ensureCacheSpaceWithLock(valueSize); err != nil { - return fmt.Errorf("%s; not caching", err) - } - - // be very strict about memory guarantees - if (d.cacheSize + valueSize) > d.CacheSizeMax { - panic(fmt.Sprintf("failed to make room for value (%d/%d)", valueSize, d.CacheSizeMax)) - } - - d.cache[key] = val - d.cacheSize += valueSize - return nil -} - -// cacheWithoutLock acquires the store's (write) mutex and calls cacheWithLock. -func (d *Diskv) cacheWithoutLock(key string, val []byte) error { - d.mu.Lock() - defer d.mu.Unlock() - return d.cacheWithLock(key, val) -} - -func (d *Diskv) bustCacheWithLock(key string) { - if val, ok := d.cache[key]; ok { - d.uncacheWithLock(key, uint64(len(val))) - } -} - -func (d *Diskv) uncacheWithLock(key string, sz uint64) { - d.cacheSize -= sz - delete(d.cache, key) -} - -// pruneDirsWithLock deletes empty directories in the path walk leading to the -// key k. Typically this function is called after an Erase is made. -func (d *Diskv) pruneDirsWithLock(key string) error { - pathlist := d.Transform(key) - for i := range pathlist { - dir := filepath.Join(d.BasePath, filepath.Join(pathlist[:len(pathlist)-i]...)) - - // thanks to Steven Blenkinsop for this snippet - switch fi, err := os.Stat(dir); true { - case err != nil: - return err - case !fi.IsDir(): - panic(fmt.Sprintf("corrupt dirstate at %s", dir)) - } - - nlinks, err := filepath.Glob(filepath.Join(dir, "*")) - if err != nil { - return err - } else if len(nlinks) > 0 { - return nil // has subdirs -- do not prune - } - if err = os.Remove(dir); err != nil { - return err - } - } - - return nil -} - -// ensureCacheSpaceWithLock deletes entries from the cache in arbitrary order -// until the cache has at least valueSize bytes available. -func (d *Diskv) ensureCacheSpaceWithLock(valueSize uint64) error { - if valueSize > d.CacheSizeMax { - return fmt.Errorf("value size (%d bytes) too large for cache (%d bytes)", valueSize, d.CacheSizeMax) - } - - safe := func() bool { return (d.cacheSize + valueSize) <= d.CacheSizeMax } - - for key, val := range d.cache { - if safe() { - break - } - - d.uncacheWithLock(key, uint64(len(val))) - } - - if !safe() { - panic(fmt.Sprintf("%d bytes still won't fit in the cache! (max %d bytes)", valueSize, d.CacheSizeMax)) - } - - return nil -} - -// nopWriteCloser wraps an io.Writer and provides a no-op Close method to -// satisfy the io.WriteCloser interface. -type nopWriteCloser struct { - io.Writer -} - -func (wc *nopWriteCloser) Write(p []byte) (int, error) { return wc.Writer.Write(p) } -func (wc *nopWriteCloser) Close() error { return nil } diff --git a/vendor/github.com/peterbourgon/diskv/examples/content-addressable-store/cas.go b/vendor/github.com/peterbourgon/diskv/examples/content-addressable-store/cas.go deleted file mode 100644 index a3abaaf77..000000000 --- a/vendor/github.com/peterbourgon/diskv/examples/content-addressable-store/cas.go +++ /dev/null @@ -1,63 +0,0 @@ -package main - -import ( - "crypto/md5" - "fmt" - "io" - - "github.com/peterbourgon/diskv" -) - -const transformBlockSize = 2 // grouping of chars per directory depth - -func blockTransform(s string) []string { - var ( - sliceSize = len(s) / transformBlockSize - pathSlice = make([]string, sliceSize) - ) - for i := 0; i < sliceSize; i++ { - from, to := i*transformBlockSize, (i*transformBlockSize)+transformBlockSize - pathSlice[i] = s[from:to] - } - return pathSlice -} - -func main() { - d := diskv.New(diskv.Options{ - BasePath: "data", - Transform: blockTransform, - CacheSizeMax: 1024 * 1024, // 1MB - }) - - for _, valueStr := range []string{ - "I am the very model of a modern Major-General", - "I've information vegetable, animal, and mineral", - "I know the kings of England, and I quote the fights historical", - "From Marathon to Waterloo, in order categorical", - "I'm very well acquainted, too, with matters mathematical", - "I understand equations, both the simple and quadratical", - "About binomial theorem I'm teeming with a lot o' news", - "With many cheerful facts about the square of the hypotenuse", - } { - d.Write(md5sum(valueStr), []byte(valueStr)) - } - - var keyCount int - for key := range d.Keys(nil) { - val, err := d.Read(key) - if err != nil { - panic(fmt.Sprintf("key %s had no value", key)) - } - fmt.Printf("%s: %s\n", key, val) - keyCount++ - } - fmt.Printf("%d total keys\n", keyCount) - - // d.EraseAll() // leave it commented out to see how data is kept on disk -} - -func md5sum(s string) string { - h := md5.New() - io.WriteString(h, s) - return fmt.Sprintf("%x", h.Sum(nil)) -} diff --git a/vendor/github.com/peterbourgon/diskv/examples/super-simple-store/super-simple-store.go b/vendor/github.com/peterbourgon/diskv/examples/super-simple-store/super-simple-store.go deleted file mode 100644 index b5da11d64..000000000 --- a/vendor/github.com/peterbourgon/diskv/examples/super-simple-store/super-simple-store.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/peterbourgon/diskv" -) - -func main() { - d := diskv.New(diskv.Options{ - BasePath: "my-diskv-data-directory", - Transform: func(s string) []string { return []string{} }, - CacheSizeMax: 1024 * 1024, // 1MB - }) - - key := "alpha" - if err := d.Write(key, []byte{'1', '2', '3'}); err != nil { - panic(err) - } - - value, err := d.Read(key) - if err != nil { - panic(err) - } - fmt.Printf("%v\n", value) - - if err := d.Erase(key); err != nil { - panic(err) - } -} diff --git a/vendor/github.com/peterbourgon/diskv/import_test.go b/vendor/github.com/peterbourgon/diskv/import_test.go deleted file mode 100644 index a08ac7c70..000000000 --- a/vendor/github.com/peterbourgon/diskv/import_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package diskv_test - -import ( - "bytes" - "io/ioutil" - "os" - - "github.com/peterbourgon/diskv" - - "testing" -) - -func TestImportMove(t *testing.T) { - b := []byte(`0123456789`) - f, err := ioutil.TempFile("", "temp-test") - if err != nil { - t.Fatal(err) - } - if _, err := f.Write(b); err != nil { - t.Fatal(err) - } - f.Close() - - d := diskv.New(diskv.Options{ - BasePath: "test-import-move", - }) - defer d.EraseAll() - - key := "key" - - if err := d.Write(key, []byte(`TBD`)); err != nil { - t.Fatal(err) - } - - if err := d.Import(f.Name(), key, true); err != nil { - t.Fatal(err) - } - - if _, err := os.Stat(f.Name()); err == nil || !os.IsNotExist(err) { - t.Errorf("expected temp file to be gone, but err = %v", err) - } - - if !d.Has(key) { - t.Errorf("%q not present", key) - } - - if buf, err := d.Read(key); err != nil || bytes.Compare(b, buf) != 0 { - t.Errorf("want %q, have %q (err = %v)", string(b), string(buf), err) - } -} - -func TestImportCopy(t *testing.T) { - b := []byte(`¡åéîòü!`) - - f, err := ioutil.TempFile("", "temp-test") - if err != nil { - t.Fatal(err) - } - if _, err := f.Write(b); err != nil { - t.Fatal(err) - } - f.Close() - - d := diskv.New(diskv.Options{ - BasePath: "test-import-copy", - }) - defer d.EraseAll() - - if err := d.Import(f.Name(), "key", false); err != nil { - t.Fatal(err) - } - - if _, err := os.Stat(f.Name()); err != nil { - t.Errorf("expected temp file to remain, but got err = %v", err) - } -} diff --git a/vendor/github.com/peterbourgon/diskv/index.go b/vendor/github.com/peterbourgon/diskv/index.go deleted file mode 100644 index 96fee5152..000000000 --- a/vendor/github.com/peterbourgon/diskv/index.go +++ /dev/null @@ -1,115 +0,0 @@ -package diskv - -import ( - "sync" - - "github.com/google/btree" -) - -// Index is a generic interface for things that can -// provide an ordered list of keys. -type Index interface { - Initialize(less LessFunction, keys <-chan string) - Insert(key string) - Delete(key string) - Keys(from string, n int) []string -} - -// LessFunction is used to initialize an Index of keys in a specific order. -type LessFunction func(string, string) bool - -// btreeString is a custom data type that satisfies the BTree Less interface, -// making the strings it wraps sortable by the BTree package. -type btreeString struct { - s string - l LessFunction -} - -// Less satisfies the BTree.Less interface using the btreeString's LessFunction. -func (s btreeString) Less(i btree.Item) bool { - return s.l(s.s, i.(btreeString).s) -} - -// BTreeIndex is an implementation of the Index interface using google/btree. -type BTreeIndex struct { - sync.RWMutex - LessFunction - *btree.BTree -} - -// Initialize populates the BTree tree with data from the keys channel, -// according to the passed less function. It's destructive to the BTreeIndex. -func (i *BTreeIndex) Initialize(less LessFunction, keys <-chan string) { - i.Lock() - defer i.Unlock() - i.LessFunction = less - i.BTree = rebuild(less, keys) -} - -// Insert inserts the given key (only) into the BTree tree. -func (i *BTreeIndex) Insert(key string) { - i.Lock() - defer i.Unlock() - if i.BTree == nil || i.LessFunction == nil { - panic("uninitialized index") - } - i.BTree.ReplaceOrInsert(btreeString{s: key, l: i.LessFunction}) -} - -// Delete removes the given key (only) from the BTree tree. -func (i *BTreeIndex) Delete(key string) { - i.Lock() - defer i.Unlock() - if i.BTree == nil || i.LessFunction == nil { - panic("uninitialized index") - } - i.BTree.Delete(btreeString{s: key, l: i.LessFunction}) -} - -// Keys yields a maximum of n keys in order. If the passed 'from' key is empty, -// Keys will return the first n keys. If the passed 'from' key is non-empty, the -// first key in the returned slice will be the key that immediately follows the -// passed key, in key order. -func (i *BTreeIndex) Keys(from string, n int) []string { - i.RLock() - defer i.RUnlock() - - if i.BTree == nil || i.LessFunction == nil { - panic("uninitialized index") - } - - if i.BTree.Len() <= 0 { - return []string{} - } - - btreeFrom := btreeString{s: from, l: i.LessFunction} - skipFirst := true - if len(from) <= 0 || !i.BTree.Has(btreeFrom) { - // no such key, so fabricate an always-smallest item - btreeFrom = btreeString{s: "", l: func(string, string) bool { return true }} - skipFirst = false - } - - keys := []string{} - iterator := func(i btree.Item) bool { - keys = append(keys, i.(btreeString).s) - return len(keys) < n - } - i.BTree.AscendGreaterOrEqual(btreeFrom, iterator) - - if skipFirst && len(keys) > 0 { - keys = keys[1:] - } - - return keys -} - -// rebuildIndex does the work of regenerating the index -// with the given keys. -func rebuild(less LessFunction, keys <-chan string) *btree.BTree { - tree := btree.New(2) - for key := range keys { - tree.ReplaceOrInsert(btreeString{s: key, l: less}) - } - return tree -} diff --git a/vendor/github.com/peterbourgon/diskv/index_test.go b/vendor/github.com/peterbourgon/diskv/index_test.go deleted file mode 100644 index 72f52a9ff..000000000 --- a/vendor/github.com/peterbourgon/diskv/index_test.go +++ /dev/null @@ -1,148 +0,0 @@ -package diskv - -import ( - "bytes" - "reflect" - "testing" - "time" -) - -func strLess(a, b string) bool { return a < b } - -func cmpStrings(a, b []string) bool { - if len(a) != len(b) { - return false - } - for i := 0; i < len(a); i++ { - if a[i] != b[i] { - return false - } - } - return true -} - -func (d *Diskv) isIndexed(key string) bool { - if d.Index == nil { - return false - } - - for _, got := range d.Index.Keys("", 1000) { - if got == key { - return true - } - } - return false -} - -func TestIndexOrder(t *testing.T) { - d := New(Options{ - BasePath: "index-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 1024, - Index: &BTreeIndex{}, - IndexLess: strLess, - }) - defer d.EraseAll() - - v := []byte{'1', '2', '3'} - d.Write("a", v) - if !d.isIndexed("a") { - t.Fatalf("'a' not indexed after write") - } - d.Write("1", v) - d.Write("m", v) - d.Write("-", v) - d.Write("A", v) - - expectedKeys := []string{"-", "1", "A", "a", "m"} - keys := []string{} - for _, key := range d.Index.Keys("", 100) { - keys = append(keys, key) - } - - if !cmpStrings(keys, expectedKeys) { - t.Fatalf("got %s, expected %s", keys, expectedKeys) - } -} - -func TestIndexLoad(t *testing.T) { - d1 := New(Options{ - BasePath: "index-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 1024, - }) - defer d1.EraseAll() - - val := []byte{'1', '2', '3'} - keys := []string{"a", "b", "c", "d", "e", "f", "g"} - for _, key := range keys { - d1.Write(key, val) - } - - d2 := New(Options{ - BasePath: "index-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 1024, - Index: &BTreeIndex{}, - IndexLess: strLess, - }) - defer d2.EraseAll() - - // check d2 has properly loaded existing d1 data - for _, key := range keys { - if !d2.isIndexed(key) { - t.Fatalf("key '%s' not indexed on secondary", key) - } - } - - // cache one - if readValue, err := d2.Read(keys[0]); err != nil { - t.Fatalf("%s", err) - } else if bytes.Compare(val, readValue) != 0 { - t.Fatalf("%s: got %s, expected %s", keys[0], readValue, val) - } - - // make sure it got cached - for i := 0; i < 10 && !d2.isCached(keys[0]); i++ { - time.Sleep(10 * time.Millisecond) - } - if !d2.isCached(keys[0]) { - t.Fatalf("key '%s' not cached", keys[0]) - } - - // kill the disk - d1.EraseAll() - - // cached value should still be there in the second - if readValue, err := d2.Read(keys[0]); err != nil { - t.Fatalf("%s", err) - } else if bytes.Compare(val, readValue) != 0 { - t.Fatalf("%s: got %s, expected %s", keys[0], readValue, val) - } - - // but not in the original - if _, err := d1.Read(keys[0]); err == nil { - t.Fatalf("expected error reading from flushed store") - } -} - -func TestIndexKeysEmptyFrom(t *testing.T) { - d := New(Options{ - BasePath: "index-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 1024, - Index: &BTreeIndex{}, - IndexLess: strLess, - }) - defer d.EraseAll() - - for _, k := range []string{"a", "c", "z", "b", "x", "b", "y"} { - d.Write(k, []byte("1")) - } - - want := []string{"a", "b", "c", "x", "y", "z"} - have := d.Index.Keys("", 99) - if !reflect.DeepEqual(want, have) { - t.Errorf("want %v, have %v", want, have) - } -} diff --git a/vendor/github.com/peterbourgon/diskv/issues_test.go b/vendor/github.com/peterbourgon/diskv/issues_test.go deleted file mode 100644 index 0b0b10908..000000000 --- a/vendor/github.com/peterbourgon/diskv/issues_test.go +++ /dev/null @@ -1,121 +0,0 @@ -package diskv - -import ( - "bytes" - "io/ioutil" - "sync" - "testing" - "time" -) - -// ReadStream from cache shouldn't panic on a nil dereference from a nonexistent -// Compression :) -func TestIssue2A(t *testing.T) { - d := New(Options{ - BasePath: "test-issue-2a", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 1024, - }) - defer d.EraseAll() - - input := "abcdefghijklmnopqrstuvwxy" - key, writeBuf, sync := "a", bytes.NewBufferString(input), false - if err := d.WriteStream(key, writeBuf, sync); err != nil { - t.Fatal(err) - } - - for i := 0; i < 2; i++ { - began := time.Now() - rc, err := d.ReadStream(key, false) - if err != nil { - t.Fatal(err) - } - buf, err := ioutil.ReadAll(rc) - if err != nil { - t.Fatal(err) - } - if !cmpBytes(buf, []byte(input)) { - t.Fatalf("read #%d: '%s' != '%s'", i+1, string(buf), input) - } - rc.Close() - t.Logf("read #%d in %s", i+1, time.Since(began)) - } -} - -// ReadStream on a key that resolves to a directory should return an error. -func TestIssue2B(t *testing.T) { - blockTransform := func(s string) []string { - transformBlockSize := 3 - sliceSize := len(s) / transformBlockSize - pathSlice := make([]string, sliceSize) - for i := 0; i < sliceSize; i++ { - from, to := i*transformBlockSize, (i*transformBlockSize)+transformBlockSize - pathSlice[i] = s[from:to] - } - return pathSlice - } - - d := New(Options{ - BasePath: "test-issue-2b", - Transform: blockTransform, - CacheSizeMax: 0, - }) - defer d.EraseAll() - - v := []byte{'1', '2', '3'} - if err := d.Write("abcabc", v); err != nil { - t.Fatal(err) - } - - _, err := d.ReadStream("abc", false) - if err == nil { - t.Fatal("ReadStream('abc') should return error") - } - t.Logf("ReadStream('abc') returned error: %v", err) -} - -// Ensure ReadStream with direct=true isn't racy. -func TestIssue17(t *testing.T) { - var ( - basePath = "test-data" - ) - - dWrite := New(Options{ - BasePath: basePath, - CacheSizeMax: 0, - }) - defer dWrite.EraseAll() - - dRead := New(Options{ - BasePath: basePath, - CacheSizeMax: 50, - }) - - cases := map[string]string{ - "a": `1234567890`, - "b": `2345678901`, - "c": `3456789012`, - "d": `4567890123`, - "e": `5678901234`, - } - - for k, v := range cases { - if err := dWrite.Write(k, []byte(v)); err != nil { - t.Fatalf("during write: %s", err) - } - dRead.Read(k) // ensure it's added to cache - } - - var wg sync.WaitGroup - start := make(chan struct{}) - for k, v := range cases { - wg.Add(1) - go func(k, v string) { - <-start - dRead.ReadStream(k, true) - wg.Done() - }(k, v) - } - close(start) - wg.Wait() -} diff --git a/vendor/github.com/peterbourgon/diskv/keys_test.go b/vendor/github.com/peterbourgon/diskv/keys_test.go deleted file mode 100644 index 222e1c444..000000000 --- a/vendor/github.com/peterbourgon/diskv/keys_test.go +++ /dev/null @@ -1,231 +0,0 @@ -package diskv_test - -import ( - "reflect" - "runtime" - "strings" - "testing" - - "github.com/peterbourgon/diskv" -) - -var ( - keysTestData = map[string]string{ - "ab01cd01": "When we started building CoreOS", - "ab01cd02": "we looked at all the various components available to us", - "ab01cd03": "re-using the best tools", - "ef01gh04": "and building the ones that did not exist", - "ef02gh05": "We believe strongly in the Unix philosophy", - "xxxxxxxx": "tools should be independently useful", - } - - prefixes = []string{ - "", // all - "a", - "ab", - "ab0", - "ab01", - "ab01cd0", - "ab01cd01", - "ab01cd01x", // none - "b", // none - "b0", // none - "0", // none - "01", // none - "e", - "ef", - "efx", // none - "ef01gh0", - "ef01gh04", - "ef01gh05", - "ef01gh06", // none - } -) - -func TestKeysFlat(t *testing.T) { - transform := func(s string) []string { - if s == "" { - t.Fatalf(`transform should not be called with ""`) - } - return []string{} - } - d := diskv.New(diskv.Options{ - BasePath: "test-data", - Transform: transform, - }) - defer d.EraseAll() - - for k, v := range keysTestData { - d.Write(k, []byte(v)) - } - - checkKeys(t, d.Keys(nil), keysTestData) -} - -func TestKeysNested(t *testing.T) { - d := diskv.New(diskv.Options{ - BasePath: "test-data", - Transform: blockTransform(2), - }) - defer d.EraseAll() - - for k, v := range keysTestData { - d.Write(k, []byte(v)) - } - - checkKeys(t, d.Keys(nil), keysTestData) -} - -func TestKeysPrefixFlat(t *testing.T) { - d := diskv.New(diskv.Options{ - BasePath: "test-data", - }) - defer d.EraseAll() - - for k, v := range keysTestData { - d.Write(k, []byte(v)) - } - - for _, prefix := range prefixes { - checkKeys(t, d.KeysPrefix(prefix, nil), filterPrefix(keysTestData, prefix)) - } -} - -func TestKeysPrefixNested(t *testing.T) { - d := diskv.New(diskv.Options{ - BasePath: "test-data", - Transform: blockTransform(2), - }) - defer d.EraseAll() - - for k, v := range keysTestData { - d.Write(k, []byte(v)) - } - - for _, prefix := range prefixes { - checkKeys(t, d.KeysPrefix(prefix, nil), filterPrefix(keysTestData, prefix)) - } -} - -func TestKeysCancel(t *testing.T) { - d := diskv.New(diskv.Options{ - BasePath: "test-data", - }) - defer d.EraseAll() - - for k, v := range keysTestData { - d.Write(k, []byte(v)) - } - - var ( - cancel = make(chan struct{}) - received = 0 - cancelAfter = len(keysTestData) / 2 - ) - - for key := range d.Keys(cancel) { - received++ - - if received >= cancelAfter { - close(cancel) - runtime.Gosched() // allow walker to detect cancel - } - - t.Logf("received %d: %q", received, key) - } - - if want, have := cancelAfter, received; want != have { - t.Errorf("want %d, have %d") - } -} - -func checkKeys(t *testing.T, c <-chan string, want map[string]string) { - for k := range c { - if _, ok := want[k]; !ok { - t.Errorf("%q yielded but not expected", k) - continue - } - - delete(want, k) - t.Logf("%q yielded OK", k) - } - - if len(want) != 0 { - t.Errorf("%d expected key(s) not yielded: %s", len(want), strings.Join(flattenKeys(want), ", ")) - } -} - -func blockTransform(blockSize int) func(string) []string { - return func(s string) []string { - var ( - sliceSize = len(s) / blockSize - pathSlice = make([]string, sliceSize) - ) - for i := 0; i < sliceSize; i++ { - from, to := i*blockSize, (i*blockSize)+blockSize - pathSlice[i] = s[from:to] - } - return pathSlice - } -} - -func filterPrefix(in map[string]string, prefix string) map[string]string { - out := map[string]string{} - for k, v := range in { - if strings.HasPrefix(k, prefix) { - out[k] = v - } - } - return out -} - -func TestFilterPrefix(t *testing.T) { - input := map[string]string{ - "all": "", - "and": "", - "at": "", - "available": "", - "best": "", - "building": "", - "components": "", - "coreos": "", - "did": "", - "exist": "", - "looked": "", - "not": "", - "ones": "", - "re-using": "", - "started": "", - "that": "", - "the": "", - "to": "", - "tools": "", - "us": "", - "various": "", - "we": "", - "when": "", - } - - for prefix, want := range map[string]map[string]string{ - "a": map[string]string{"all": "", "and": "", "at": "", "available": ""}, - "al": map[string]string{"all": ""}, - "all": map[string]string{"all": ""}, - "alll": map[string]string{}, - "c": map[string]string{"components": "", "coreos": ""}, - "co": map[string]string{"components": "", "coreos": ""}, - "com": map[string]string{"components": ""}, - } { - have := filterPrefix(input, prefix) - if !reflect.DeepEqual(want, have) { - t.Errorf("%q: want %v, have %v", prefix, flattenKeys(want), flattenKeys(have)) - } - } -} - -func flattenKeys(m map[string]string) []string { - a := make([]string, 0, len(m)) - for k := range m { - a = append(a, k) - } - return a -} diff --git a/vendor/github.com/peterbourgon/diskv/speed_test.go b/vendor/github.com/peterbourgon/diskv/speed_test.go deleted file mode 100644 index 67d05ff27..000000000 --- a/vendor/github.com/peterbourgon/diskv/speed_test.go +++ /dev/null @@ -1,153 +0,0 @@ -package diskv - -import ( - "fmt" - "math/rand" - "testing" -) - -func shuffle(keys []string) { - ints := rand.Perm(len(keys)) - for i := range keys { - keys[i], keys[ints[i]] = keys[ints[i]], keys[i] - } -} - -func genValue(size int) []byte { - v := make([]byte, size) - for i := 0; i < size; i++ { - v[i] = uint8((rand.Int() % 26) + 97) // a-z - } - return v -} - -const ( - keyCount = 1000 -) - -func genKeys() []string { - keys := make([]string, keyCount) - for i := 0; i < keyCount; i++ { - keys[i] = fmt.Sprintf("%d", i) - } - return keys -} - -func (d *Diskv) load(keys []string, val []byte) { - for _, key := range keys { - d.Write(key, val) - } -} - -func benchRead(b *testing.B, size, cachesz int) { - b.StopTimer() - d := New(Options{ - BasePath: "speed-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: uint64(cachesz), - }) - defer d.EraseAll() - - keys := genKeys() - value := genValue(size) - d.load(keys, value) - shuffle(keys) - b.SetBytes(int64(size)) - - b.StartTimer() - for i := 0; i < b.N; i++ { - _, _ = d.Read(keys[i%len(keys)]) - } - b.StopTimer() -} - -func benchWrite(b *testing.B, size int, withIndex bool) { - b.StopTimer() - - options := Options{ - BasePath: "speed-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 0, - } - if withIndex { - options.Index = &BTreeIndex{} - options.IndexLess = strLess - } - - d := New(options) - defer d.EraseAll() - keys := genKeys() - value := genValue(size) - shuffle(keys) - b.SetBytes(int64(size)) - - b.StartTimer() - for i := 0; i < b.N; i++ { - d.Write(keys[i%len(keys)], value) - } - b.StopTimer() -} - -func BenchmarkWrite__32B_NoIndex(b *testing.B) { - benchWrite(b, 32, false) -} - -func BenchmarkWrite__1KB_NoIndex(b *testing.B) { - benchWrite(b, 1024, false) -} - -func BenchmarkWrite__4KB_NoIndex(b *testing.B) { - benchWrite(b, 4096, false) -} - -func BenchmarkWrite_10KB_NoIndex(b *testing.B) { - benchWrite(b, 10240, false) -} - -func BenchmarkWrite__32B_WithIndex(b *testing.B) { - benchWrite(b, 32, true) -} - -func BenchmarkWrite__1KB_WithIndex(b *testing.B) { - benchWrite(b, 1024, true) -} - -func BenchmarkWrite__4KB_WithIndex(b *testing.B) { - benchWrite(b, 4096, true) -} - -func BenchmarkWrite_10KB_WithIndex(b *testing.B) { - benchWrite(b, 10240, true) -} - -func BenchmarkRead__32B_NoCache(b *testing.B) { - benchRead(b, 32, 0) -} - -func BenchmarkRead__1KB_NoCache(b *testing.B) { - benchRead(b, 1024, 0) -} - -func BenchmarkRead__4KB_NoCache(b *testing.B) { - benchRead(b, 4096, 0) -} - -func BenchmarkRead_10KB_NoCache(b *testing.B) { - benchRead(b, 10240, 0) -} - -func BenchmarkRead__32B_WithCache(b *testing.B) { - benchRead(b, 32, keyCount*32*2) -} - -func BenchmarkRead__1KB_WithCache(b *testing.B) { - benchRead(b, 1024, keyCount*1024*2) -} - -func BenchmarkRead__4KB_WithCache(b *testing.B) { - benchRead(b, 4096, keyCount*4096*2) -} - -func BenchmarkRead_10KB_WithCache(b *testing.B) { - benchRead(b, 10240, keyCount*4096*2) -} diff --git a/vendor/github.com/peterbourgon/diskv/stream_test.go b/vendor/github.com/peterbourgon/diskv/stream_test.go deleted file mode 100644 index 7991dbff2..000000000 --- a/vendor/github.com/peterbourgon/diskv/stream_test.go +++ /dev/null @@ -1,117 +0,0 @@ -package diskv - -import ( - "bytes" - "io/ioutil" - "testing" -) - -func TestBasicStreamCaching(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - }) - defer d.EraseAll() - - input := "a1b2c3" - key, writeBuf, sync := "a", bytes.NewBufferString(input), true - if err := d.WriteStream(key, writeBuf, sync); err != nil { - t.Fatal(err) - } - - if d.isCached(key) { - t.Fatalf("'%s' cached, but shouldn't be (yet)", key) - } - - rc, err := d.ReadStream(key, false) - if err != nil { - t.Fatal(err) - } - - readBuf, err := ioutil.ReadAll(rc) - if err != nil { - t.Fatal(err) - } - - if !cmpBytes(readBuf, []byte(input)) { - t.Fatalf("'%s' != '%s'", string(readBuf), input) - } - - if !d.isCached(key) { - t.Fatalf("'%s' isn't cached, but should be", key) - } -} - -func TestReadStreamDirect(t *testing.T) { - var ( - basePath = "test-data" - ) - dWrite := New(Options{ - BasePath: basePath, - CacheSizeMax: 0, - }) - defer dWrite.EraseAll() - dRead := New(Options{ - BasePath: basePath, - CacheSizeMax: 1024, - }) - - // Write - key, val1, val2 := "a", []byte(`1234567890`), []byte(`aaaaaaaaaa`) - if err := dWrite.Write(key, val1); err != nil { - t.Fatalf("during first write: %s", err) - } - - // First, caching read. - val, err := dRead.Read(key) - if err != nil { - t.Fatalf("during initial read: %s", err) - } - t.Logf("read 1: %s => %s", key, string(val)) - if !cmpBytes(val1, val) { - t.Errorf("expected %q, got %q", string(val1), string(val)) - } - if !dRead.isCached(key) { - t.Errorf("%q should be cached, but isn't", key) - } - - // Write a different value. - if err := dWrite.Write(key, val2); err != nil { - t.Fatalf("during second write: %s", err) - } - - // Second read, should hit cache and get the old value. - val, err = dRead.Read(key) - if err != nil { - t.Fatalf("during second (cache-hit) read: %s", err) - } - t.Logf("read 2: %s => %s", key, string(val)) - if !cmpBytes(val1, val) { - t.Errorf("expected %q, got %q", string(val1), string(val)) - } - - // Third, direct read, should get the updated value. - rc, err := dRead.ReadStream(key, true) - if err != nil { - t.Fatalf("during third (direct) read, ReadStream: %s", err) - } - defer rc.Close() - val, err = ioutil.ReadAll(rc) - if err != nil { - t.Fatalf("during third (direct) read, ReadAll: %s", err) - } - t.Logf("read 3: %s => %s", key, string(val)) - if !cmpBytes(val2, val) { - t.Errorf("expected %q, got %q", string(val1), string(val)) - } - - // Fourth read, should hit cache and get the new value. - val, err = dRead.Read(key) - if err != nil { - t.Fatalf("during fourth (cache-hit) read: %s", err) - } - t.Logf("read 4: %s => %s", key, string(val)) - if !cmpBytes(val2, val) { - t.Errorf("expected %q, got %q", string(val1), string(val)) - } -} diff --git a/vendor/golang.org/x/time/AUTHORS b/vendor/golang.org/x/time/AUTHORS new file mode 100644 index 000000000..15167cd74 --- /dev/null +++ b/vendor/golang.org/x/time/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/time/CONTRIBUTING.md b/vendor/golang.org/x/time/CONTRIBUTING.md new file mode 100644 index 000000000..d0485e887 --- /dev/null +++ b/vendor/golang.org/x/time/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to Go + +Go is an open source project. + +It is the work of hundreds of contributors. We appreciate your help! + +## Filing issues + +When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: + +1. What version of Go are you using (`go version`)? +2. What operating system and processor architecture are you using? +3. What did you do? +4. What did you expect to see? +5. What did you see instead? + +General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. +The gophers there will answer or ask you to file an issue if you've tripped over a bug. + +## Contributing code + +Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) +before sending patches. + +Unless otherwise noted, the Go source files are distributed under +the BSD-style license found in the LICENSE file. diff --git a/vendor/golang.org/x/time/CONTRIBUTORS b/vendor/golang.org/x/time/CONTRIBUTORS new file mode 100644 index 000000000..1c4577e96 --- /dev/null +++ b/vendor/golang.org/x/time/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/time/LICENSE b/vendor/golang.org/x/time/LICENSE new file mode 100644 index 000000000..6a66aea5e --- /dev/null +++ b/vendor/golang.org/x/time/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/time/PATENTS b/vendor/golang.org/x/time/PATENTS new file mode 100644 index 000000000..733099041 --- /dev/null +++ b/vendor/golang.org/x/time/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/time/README.md b/vendor/golang.org/x/time/README.md new file mode 100644 index 000000000..ce9becdde --- /dev/null +++ b/vendor/golang.org/x/time/README.md @@ -0,0 +1,17 @@ +# Go Time + +This repository provides supplementary Go time packages. + +## Download/Install + +The easiest way to install is to run `go get -u golang.org/x/time`. You can +also manually git clone the repository to `$GOPATH/src/golang.org/x/time`. + +## Report Issues / Send Patches + +This repository uses Gerrit for code changes. To learn how to submit changes to +this repository, see https://golang.org/doc/contribute.html. + +The main issue tracker for the time repository is located at +https://github.com/golang/go/issues. Prefix your issue with "x/time:" in the +subject line, so it is easy to find. diff --git a/vendor/golang.org/x/time/rate/rate.go b/vendor/golang.org/x/time/rate/rate.go new file mode 100644 index 000000000..7228d97e9 --- /dev/null +++ b/vendor/golang.org/x/time/rate/rate.go @@ -0,0 +1,384 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package rate provides a rate limiter. +package rate + +import ( + "fmt" + "math" + "sync" + "time" +) + +// Limit defines the maximum frequency of some events. +// Limit is represented as number of events per second. +// A zero Limit allows no events. +type Limit float64 + +// Inf is the infinite rate limit; it allows all events (even if burst is zero). +const Inf = Limit(math.MaxFloat64) + +// Every converts a minimum time interval between events to a Limit. +func Every(interval time.Duration) Limit { + if interval <= 0 { + return Inf + } + return 1 / Limit(interval.Seconds()) +} + +// A Limiter controls how frequently events are allowed to happen. +// It implements a "token bucket" of size b, initially full and refilled +// at rate r tokens per second. +// Informally, in any large enough time interval, the Limiter limits the +// rate to r tokens per second, with a maximum burst size of b events. +// As a special case, if r == Inf (the infinite rate), b is ignored. +// See https://en.wikipedia.org/wiki/Token_bucket for more about token buckets. +// +// The zero value is a valid Limiter, but it will reject all events. +// Use NewLimiter to create non-zero Limiters. +// +// Limiter has three main methods, Allow, Reserve, and Wait. +// Most callers should use Wait. +// +// Each of the three methods consumes a single token. +// They differ in their behavior when no token is available. +// If no token is available, Allow returns false. +// If no token is available, Reserve returns a reservation for a future token +// and the amount of time the caller must wait before using it. +// If no token is available, Wait blocks until one can be obtained +// or its associated context.Context is canceled. +// +// The methods AllowN, ReserveN, and WaitN consume n tokens. +type Limiter struct { + limit Limit + burst int + + mu sync.Mutex + tokens float64 + // last is the last time the limiter's tokens field was updated + last time.Time + // lastEvent is the latest time of a rate-limited event (past or future) + lastEvent time.Time +} + +// Limit returns the maximum overall event rate. +func (lim *Limiter) Limit() Limit { + lim.mu.Lock() + defer lim.mu.Unlock() + return lim.limit +} + +// Burst returns the maximum burst size. Burst is the maximum number of tokens +// that can be consumed in a single call to Allow, Reserve, or Wait, so higher +// Burst values allow more events to happen at once. +// A zero Burst allows no events, unless limit == Inf. +func (lim *Limiter) Burst() int { + return lim.burst +} + +// NewLimiter returns a new Limiter that allows events up to rate r and permits +// bursts of at most b tokens. +func NewLimiter(r Limit, b int) *Limiter { + return &Limiter{ + limit: r, + burst: b, + } +} + +// Allow is shorthand for AllowN(time.Now(), 1). +func (lim *Limiter) Allow() bool { + return lim.AllowN(time.Now(), 1) +} + +// AllowN reports whether n events may happen at time now. +// Use this method if you intend to drop / skip events that exceed the rate limit. +// Otherwise use Reserve or Wait. +func (lim *Limiter) AllowN(now time.Time, n int) bool { + return lim.reserveN(now, n, 0).ok +} + +// A Reservation holds information about events that are permitted by a Limiter to happen after a delay. +// A Reservation may be canceled, which may enable the Limiter to permit additional events. +type Reservation struct { + ok bool + lim *Limiter + tokens int + timeToAct time.Time + // This is the Limit at reservation time, it can change later. + limit Limit +} + +// OK returns whether the limiter can provide the requested number of tokens +// within the maximum wait time. If OK is false, Delay returns InfDuration, and +// Cancel does nothing. +func (r *Reservation) OK() bool { + return r.ok +} + +// Delay is shorthand for DelayFrom(time.Now()). +func (r *Reservation) Delay() time.Duration { + return r.DelayFrom(time.Now()) +} + +// InfDuration is the duration returned by Delay when a Reservation is not OK. +const InfDuration = time.Duration(1<<63 - 1) + +// DelayFrom returns the duration for which the reservation holder must wait +// before taking the reserved action. Zero duration means act immediately. +// InfDuration means the limiter cannot grant the tokens requested in this +// Reservation within the maximum wait time. +func (r *Reservation) DelayFrom(now time.Time) time.Duration { + if !r.ok { + return InfDuration + } + delay := r.timeToAct.Sub(now) + if delay < 0 { + return 0 + } + return delay +} + +// Cancel is shorthand for CancelAt(time.Now()). +func (r *Reservation) Cancel() { + r.CancelAt(time.Now()) + return +} + +// CancelAt indicates that the reservation holder will not perform the reserved action +// and reverses the effects of this Reservation on the rate limit as much as possible, +// considering that other reservations may have already been made. +func (r *Reservation) CancelAt(now time.Time) { + if !r.ok { + return + } + + r.lim.mu.Lock() + defer r.lim.mu.Unlock() + + if r.lim.limit == Inf || r.tokens == 0 || r.timeToAct.Before(now) { + return + } + + // calculate tokens to restore + // The duration between lim.lastEvent and r.timeToAct tells us how many tokens were reserved + // after r was obtained. These tokens should not be restored. + restoreTokens := float64(r.tokens) - r.limit.tokensFromDuration(r.lim.lastEvent.Sub(r.timeToAct)) + if restoreTokens <= 0 { + return + } + // advance time to now + now, _, tokens := r.lim.advance(now) + // calculate new number of tokens + tokens += restoreTokens + if burst := float64(r.lim.burst); tokens > burst { + tokens = burst + } + // update state + r.lim.last = now + r.lim.tokens = tokens + if r.timeToAct == r.lim.lastEvent { + prevEvent := r.timeToAct.Add(r.limit.durationFromTokens(float64(-r.tokens))) + if !prevEvent.Before(now) { + r.lim.lastEvent = prevEvent + } + } + + return +} + +// Reserve is shorthand for ReserveN(time.Now(), 1). +func (lim *Limiter) Reserve() *Reservation { + return lim.ReserveN(time.Now(), 1) +} + +// ReserveN returns a Reservation that indicates how long the caller must wait before n events happen. +// The Limiter takes this Reservation into account when allowing future events. +// ReserveN returns false if n exceeds the Limiter's burst size. +// Usage example: +// r := lim.ReserveN(time.Now(), 1) +// if !r.OK() { +// // Not allowed to act! Did you remember to set lim.burst to be > 0 ? +// return +// } +// time.Sleep(r.Delay()) +// Act() +// Use this method if you wish to wait and slow down in accordance with the rate limit without dropping events. +// If you need to respect a deadline or cancel the delay, use Wait instead. +// To drop or skip events exceeding rate limit, use Allow instead. +func (lim *Limiter) ReserveN(now time.Time, n int) *Reservation { + r := lim.reserveN(now, n, InfDuration) + return &r +} + +// contextContext is a temporary(?) copy of the context.Context type +// to support both Go 1.6 using golang.org/x/net/context and Go 1.7+ +// with the built-in context package. If people ever stop using Go 1.6 +// we can remove this. +type contextContext interface { + Deadline() (deadline time.Time, ok bool) + Done() <-chan struct{} + Err() error + Value(key interface{}) interface{} +} + +// Wait is shorthand for WaitN(ctx, 1). +func (lim *Limiter) wait(ctx contextContext) (err error) { + return lim.WaitN(ctx, 1) +} + +// WaitN blocks until lim permits n events to happen. +// It returns an error if n exceeds the Limiter's burst size, the Context is +// canceled, or the expected wait time exceeds the Context's Deadline. +// The burst limit is ignored if the rate limit is Inf. +func (lim *Limiter) waitN(ctx contextContext, n int) (err error) { + if n > lim.burst && lim.limit != Inf { + return fmt.Errorf("rate: Wait(n=%d) exceeds limiter's burst %d", n, lim.burst) + } + // Check if ctx is already cancelled + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + // Determine wait limit + now := time.Now() + waitLimit := InfDuration + if deadline, ok := ctx.Deadline(); ok { + waitLimit = deadline.Sub(now) + } + // Reserve + r := lim.reserveN(now, n, waitLimit) + if !r.ok { + return fmt.Errorf("rate: Wait(n=%d) would exceed context deadline", n) + } + // Wait if necessary + delay := r.DelayFrom(now) + if delay == 0 { + return nil + } + t := time.NewTimer(delay) + defer t.Stop() + select { + case <-t.C: + // We can proceed. + return nil + case <-ctx.Done(): + // Context was canceled before we could proceed. Cancel the + // reservation, which may permit other events to proceed sooner. + r.Cancel() + return ctx.Err() + } +} + +// SetLimit is shorthand for SetLimitAt(time.Now(), newLimit). +func (lim *Limiter) SetLimit(newLimit Limit) { + lim.SetLimitAt(time.Now(), newLimit) +} + +// SetLimitAt sets a new Limit for the limiter. The new Limit, and Burst, may be violated +// or underutilized by those which reserved (using Reserve or Wait) but did not yet act +// before SetLimitAt was called. +func (lim *Limiter) SetLimitAt(now time.Time, newLimit Limit) { + lim.mu.Lock() + defer lim.mu.Unlock() + + now, _, tokens := lim.advance(now) + + lim.last = now + lim.tokens = tokens + lim.limit = newLimit +} + +// reserveN is a helper method for AllowN, ReserveN, and WaitN. +// maxFutureReserve specifies the maximum reservation wait duration allowed. +// reserveN returns Reservation, not *Reservation, to avoid allocation in AllowN and WaitN. +func (lim *Limiter) reserveN(now time.Time, n int, maxFutureReserve time.Duration) Reservation { + lim.mu.Lock() + + if lim.limit == Inf { + lim.mu.Unlock() + return Reservation{ + ok: true, + lim: lim, + tokens: n, + timeToAct: now, + } + } + + now, last, tokens := lim.advance(now) + + // Calculate the remaining number of tokens resulting from the request. + tokens -= float64(n) + + // Calculate the wait duration + var waitDuration time.Duration + if tokens < 0 { + waitDuration = lim.limit.durationFromTokens(-tokens) + } + + // Decide result + ok := n <= lim.burst && waitDuration <= maxFutureReserve + + // Prepare reservation + r := Reservation{ + ok: ok, + lim: lim, + limit: lim.limit, + } + if ok { + r.tokens = n + r.timeToAct = now.Add(waitDuration) + } + + // Update state + if ok { + lim.last = now + lim.tokens = tokens + lim.lastEvent = r.timeToAct + } else { + lim.last = last + } + + lim.mu.Unlock() + return r +} + +// advance calculates and returns an updated state for lim resulting from the passage of time. +// lim is not changed. +func (lim *Limiter) advance(now time.Time) (newNow time.Time, newLast time.Time, newTokens float64) { + last := lim.last + if now.Before(last) { + last = now + } + + // Avoid making delta overflow below when last is very old. + maxElapsed := lim.limit.durationFromTokens(float64(lim.burst) - lim.tokens) + elapsed := now.Sub(last) + if elapsed > maxElapsed { + elapsed = maxElapsed + } + + // Calculate the new number of tokens, due to time that passed. + delta := lim.limit.tokensFromDuration(elapsed) + tokens := lim.tokens + delta + if burst := float64(lim.burst); tokens > burst { + tokens = burst + } + + return now, last, tokens +} + +// durationFromTokens is a unit conversion function from the number of tokens to the duration +// of time it takes to accumulate them at a rate of limit tokens per second. +func (limit Limit) durationFromTokens(tokens float64) time.Duration { + seconds := tokens / float64(limit) + return time.Nanosecond * time.Duration(1e9*seconds) +} + +// tokensFromDuration is a unit conversion function from a time duration to the number of tokens +// which could be accumulated during that duration at a rate of limit tokens per second. +func (limit Limit) tokensFromDuration(d time.Duration) float64 { + return d.Seconds() * float64(limit) +} diff --git a/vendor/golang.org/x/time/rate/rate_go16.go b/vendor/golang.org/x/time/rate/rate_go16.go new file mode 100644 index 000000000..6bab1850f --- /dev/null +++ b/vendor/golang.org/x/time/rate/rate_go16.go @@ -0,0 +1,21 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.7 + +package rate + +import "golang.org/x/net/context" + +// Wait is shorthand for WaitN(ctx, 1). +func (lim *Limiter) Wait(ctx context.Context) (err error) { + return lim.waitN(ctx, 1) +} + +// WaitN blocks until lim permits n events to happen. +// It returns an error if n exceeds the Limiter's burst size, the Context is +// canceled, or the expected wait time exceeds the Context's Deadline. +func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) { + return lim.waitN(ctx, n) +} diff --git a/vendor/golang.org/x/time/rate/rate_go17.go b/vendor/golang.org/x/time/rate/rate_go17.go new file mode 100644 index 000000000..f90d85f51 --- /dev/null +++ b/vendor/golang.org/x/time/rate/rate_go17.go @@ -0,0 +1,21 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.7 + +package rate + +import "context" + +// Wait is shorthand for WaitN(ctx, 1). +func (lim *Limiter) Wait(ctx context.Context) (err error) { + return lim.waitN(ctx, 1) +} + +// WaitN blocks until lim permits n events to happen. +// It returns an error if n exceeds the Limiter's burst size, the Context is +// canceled, or the expected wait time exceeds the Context's Deadline. +func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) { + return lim.waitN(ctx, n) +} diff --git a/vendor/golang.org/x/time/rate/rate_test.go b/vendor/golang.org/x/time/rate/rate_test.go new file mode 100644 index 000000000..ec8c66ddf --- /dev/null +++ b/vendor/golang.org/x/time/rate/rate_test.go @@ -0,0 +1,459 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.7 + +package rate + +import ( + "context" + "math" + "runtime" + "sync" + "sync/atomic" + "testing" + "time" +) + +func TestLimit(t *testing.T) { + if Limit(10) == Inf { + t.Errorf("Limit(10) == Inf should be false") + } +} + +func closeEnough(a, b Limit) bool { + return (math.Abs(float64(a)/float64(b)) - 1.0) < 1e-9 +} + +func TestEvery(t *testing.T) { + cases := []struct { + interval time.Duration + lim Limit + }{ + {0, Inf}, + {-1, Inf}, + {1 * time.Nanosecond, Limit(1e9)}, + {1 * time.Microsecond, Limit(1e6)}, + {1 * time.Millisecond, Limit(1e3)}, + {10 * time.Millisecond, Limit(100)}, + {100 * time.Millisecond, Limit(10)}, + {1 * time.Second, Limit(1)}, + {2 * time.Second, Limit(0.5)}, + {time.Duration(2.5 * float64(time.Second)), Limit(0.4)}, + {4 * time.Second, Limit(0.25)}, + {10 * time.Second, Limit(0.1)}, + {time.Duration(math.MaxInt64), Limit(1e9 / float64(math.MaxInt64))}, + } + for _, tc := range cases { + lim := Every(tc.interval) + if !closeEnough(lim, tc.lim) { + t.Errorf("Every(%v) = %v want %v", tc.interval, lim, tc.lim) + } + } +} + +const ( + d = 100 * time.Millisecond +) + +var ( + t0 = time.Now() + t1 = t0.Add(time.Duration(1) * d) + t2 = t0.Add(time.Duration(2) * d) + t3 = t0.Add(time.Duration(3) * d) + t4 = t0.Add(time.Duration(4) * d) + t5 = t0.Add(time.Duration(5) * d) + t9 = t0.Add(time.Duration(9) * d) +) + +type allow struct { + t time.Time + n int + ok bool +} + +func run(t *testing.T, lim *Limiter, allows []allow) { + for i, allow := range allows { + ok := lim.AllowN(allow.t, allow.n) + if ok != allow.ok { + t.Errorf("step %d: lim.AllowN(%v, %v) = %v want %v", + i, allow.t, allow.n, ok, allow.ok) + } + } +} + +func TestLimiterBurst1(t *testing.T) { + run(t, NewLimiter(10, 1), []allow{ + {t0, 1, true}, + {t0, 1, false}, + {t0, 1, false}, + {t1, 1, true}, + {t1, 1, false}, + {t1, 1, false}, + {t2, 2, false}, // burst size is 1, so n=2 always fails + {t2, 1, true}, + {t2, 1, false}, + }) +} + +func TestLimiterBurst3(t *testing.T) { + run(t, NewLimiter(10, 3), []allow{ + {t0, 2, true}, + {t0, 2, false}, + {t0, 1, true}, + {t0, 1, false}, + {t1, 4, false}, + {t2, 1, true}, + {t3, 1, true}, + {t4, 1, true}, + {t4, 1, true}, + {t4, 1, false}, + {t4, 1, false}, + {t9, 3, true}, + {t9, 0, true}, + }) +} + +func TestLimiterJumpBackwards(t *testing.T) { + run(t, NewLimiter(10, 3), []allow{ + {t1, 1, true}, // start at t1 + {t0, 1, true}, // jump back to t0, two tokens remain + {t0, 1, true}, + {t0, 1, false}, + {t0, 1, false}, + {t1, 1, true}, // got a token + {t1, 1, false}, + {t1, 1, false}, + {t2, 1, true}, // got another token + {t2, 1, false}, + {t2, 1, false}, + }) +} + +func TestSimultaneousRequests(t *testing.T) { + const ( + limit = 1 + burst = 5 + numRequests = 15 + ) + var ( + wg sync.WaitGroup + numOK = uint32(0) + ) + + // Very slow replenishing bucket. + lim := NewLimiter(limit, burst) + + // Tries to take a token, atomically updates the counter and decreases the wait + // group counter. + f := func() { + defer wg.Done() + if ok := lim.Allow(); ok { + atomic.AddUint32(&numOK, 1) + } + } + + wg.Add(numRequests) + for i := 0; i < numRequests; i++ { + go f() + } + wg.Wait() + if numOK != burst { + t.Errorf("numOK = %d, want %d", numOK, burst) + } +} + +func TestLongRunningQPS(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode") + } + if runtime.GOOS == "openbsd" { + t.Skip("low resolution time.Sleep invalidates test (golang.org/issue/14183)") + return + } + + // The test runs for a few seconds executing many requests and then checks + // that overall number of requests is reasonable. + const ( + limit = 100 + burst = 100 + ) + var numOK = int32(0) + + lim := NewLimiter(limit, burst) + + var wg sync.WaitGroup + f := func() { + if ok := lim.Allow(); ok { + atomic.AddInt32(&numOK, 1) + } + wg.Done() + } + + start := time.Now() + end := start.Add(5 * time.Second) + for time.Now().Before(end) { + wg.Add(1) + go f() + + // This will still offer ~500 requests per second, but won't consume + // outrageous amount of CPU. + time.Sleep(2 * time.Millisecond) + } + wg.Wait() + elapsed := time.Since(start) + ideal := burst + (limit * float64(elapsed) / float64(time.Second)) + + // We should never get more requests than allowed. + if want := int32(ideal + 1); numOK > want { + t.Errorf("numOK = %d, want %d (ideal %f)", numOK, want, ideal) + } + // We should get very close to the number of requests allowed. + if want := int32(0.999 * ideal); numOK < want { + t.Errorf("numOK = %d, want %d (ideal %f)", numOK, want, ideal) + } +} + +type request struct { + t time.Time + n int + act time.Time + ok bool +} + +// dFromDuration converts a duration to a multiple of the global constant d +func dFromDuration(dur time.Duration) int { + // Adding a millisecond to be swallowed by the integer division + // because we don't care about small inaccuracies + return int((dur + time.Millisecond) / d) +} + +// dSince returns multiples of d since t0 +func dSince(t time.Time) int { + return dFromDuration(t.Sub(t0)) +} + +func runReserve(t *testing.T, lim *Limiter, req request) *Reservation { + return runReserveMax(t, lim, req, InfDuration) +} + +func runReserveMax(t *testing.T, lim *Limiter, req request, maxReserve time.Duration) *Reservation { + r := lim.reserveN(req.t, req.n, maxReserve) + if r.ok && (dSince(r.timeToAct) != dSince(req.act)) || r.ok != req.ok { + t.Errorf("lim.reserveN(t%d, %v, %v) = (t%d, %v) want (t%d, %v)", + dSince(req.t), req.n, maxReserve, dSince(r.timeToAct), r.ok, dSince(req.act), req.ok) + } + return &r +} + +func TestSimpleReserve(t *testing.T) { + lim := NewLimiter(10, 2) + + runReserve(t, lim, request{t0, 2, t0, true}) + runReserve(t, lim, request{t0, 2, t2, true}) + runReserve(t, lim, request{t3, 2, t4, true}) +} + +func TestMix(t *testing.T) { + lim := NewLimiter(10, 2) + + runReserve(t, lim, request{t0, 3, t1, false}) // should return false because n > Burst + runReserve(t, lim, request{t0, 2, t0, true}) + run(t, lim, []allow{{t1, 2, false}}) // not enought tokens - don't allow + runReserve(t, lim, request{t1, 2, t2, true}) + run(t, lim, []allow{{t1, 1, false}}) // negative tokens - don't allow + run(t, lim, []allow{{t3, 1, true}}) +} + +func TestCancelInvalid(t *testing.T) { + lim := NewLimiter(10, 2) + + runReserve(t, lim, request{t0, 2, t0, true}) + r := runReserve(t, lim, request{t0, 3, t3, false}) + r.CancelAt(t0) // should have no effect + runReserve(t, lim, request{t0, 2, t2, true}) // did not get extra tokens +} + +func TestCancelLast(t *testing.T) { + lim := NewLimiter(10, 2) + + runReserve(t, lim, request{t0, 2, t0, true}) + r := runReserve(t, lim, request{t0, 2, t2, true}) + r.CancelAt(t1) // got 2 tokens back + runReserve(t, lim, request{t1, 2, t2, true}) +} + +func TestCancelTooLate(t *testing.T) { + lim := NewLimiter(10, 2) + + runReserve(t, lim, request{t0, 2, t0, true}) + r := runReserve(t, lim, request{t0, 2, t2, true}) + r.CancelAt(t3) // too late to cancel - should have no effect + runReserve(t, lim, request{t3, 2, t4, true}) +} + +func TestCancel0Tokens(t *testing.T) { + lim := NewLimiter(10, 2) + + runReserve(t, lim, request{t0, 2, t0, true}) + r := runReserve(t, lim, request{t0, 1, t1, true}) + runReserve(t, lim, request{t0, 1, t2, true}) + r.CancelAt(t0) // got 0 tokens back + runReserve(t, lim, request{t0, 1, t3, true}) +} + +func TestCancel1Token(t *testing.T) { + lim := NewLimiter(10, 2) + + runReserve(t, lim, request{t0, 2, t0, true}) + r := runReserve(t, lim, request{t0, 2, t2, true}) + runReserve(t, lim, request{t0, 1, t3, true}) + r.CancelAt(t2) // got 1 token back + runReserve(t, lim, request{t2, 2, t4, true}) +} + +func TestCancelMulti(t *testing.T) { + lim := NewLimiter(10, 4) + + runReserve(t, lim, request{t0, 4, t0, true}) + rA := runReserve(t, lim, request{t0, 3, t3, true}) + runReserve(t, lim, request{t0, 1, t4, true}) + rC := runReserve(t, lim, request{t0, 1, t5, true}) + rC.CancelAt(t1) // get 1 token back + rA.CancelAt(t1) // get 2 tokens back, as if C was never reserved + runReserve(t, lim, request{t1, 3, t5, true}) +} + +func TestReserveJumpBack(t *testing.T) { + lim := NewLimiter(10, 2) + + runReserve(t, lim, request{t1, 2, t1, true}) // start at t1 + runReserve(t, lim, request{t0, 1, t1, true}) // should violate Limit,Burst + runReserve(t, lim, request{t2, 2, t3, true}) +} + +func TestReserveJumpBackCancel(t *testing.T) { + lim := NewLimiter(10, 2) + + runReserve(t, lim, request{t1, 2, t1, true}) // start at t1 + r := runReserve(t, lim, request{t1, 2, t3, true}) + runReserve(t, lim, request{t1, 1, t4, true}) + r.CancelAt(t0) // cancel at t0, get 1 token back + runReserve(t, lim, request{t1, 2, t4, true}) // should violate Limit,Burst +} + +func TestReserveSetLimit(t *testing.T) { + lim := NewLimiter(5, 2) + + runReserve(t, lim, request{t0, 2, t0, true}) + runReserve(t, lim, request{t0, 2, t4, true}) + lim.SetLimitAt(t2, 10) + runReserve(t, lim, request{t2, 1, t4, true}) // violates Limit and Burst +} + +func TestReserveSetLimitCancel(t *testing.T) { + lim := NewLimiter(5, 2) + + runReserve(t, lim, request{t0, 2, t0, true}) + r := runReserve(t, lim, request{t0, 2, t4, true}) + lim.SetLimitAt(t2, 10) + r.CancelAt(t2) // 2 tokens back + runReserve(t, lim, request{t2, 2, t3, true}) +} + +func TestReserveMax(t *testing.T) { + lim := NewLimiter(10, 2) + maxT := d + + runReserveMax(t, lim, request{t0, 2, t0, true}, maxT) + runReserveMax(t, lim, request{t0, 1, t1, true}, maxT) // reserve for close future + runReserveMax(t, lim, request{t0, 1, t2, false}, maxT) // time to act too far in the future +} + +type wait struct { + name string + ctx context.Context + n int + delay int // in multiples of d + nilErr bool +} + +func runWait(t *testing.T, lim *Limiter, w wait) { + start := time.Now() + err := lim.WaitN(w.ctx, w.n) + delay := time.Now().Sub(start) + if (w.nilErr && err != nil) || (!w.nilErr && err == nil) || w.delay != dFromDuration(delay) { + errString := "" + if !w.nilErr { + errString = "" + } + t.Errorf("lim.WaitN(%v, lim, %v) = %v with delay %v ; want %v with delay %v", + w.name, w.n, err, delay, errString, d*time.Duration(w.delay)) + } +} + +func TestWaitSimple(t *testing.T) { + lim := NewLimiter(10, 3) + + ctx, cancel := context.WithCancel(context.Background()) + cancel() + runWait(t, lim, wait{"already-cancelled", ctx, 1, 0, false}) + + runWait(t, lim, wait{"exceed-burst-error", context.Background(), 4, 0, false}) + + runWait(t, lim, wait{"act-now", context.Background(), 2, 0, true}) + runWait(t, lim, wait{"act-later", context.Background(), 3, 2, true}) +} + +func TestWaitCancel(t *testing.T) { + lim := NewLimiter(10, 3) + + ctx, cancel := context.WithCancel(context.Background()) + runWait(t, lim, wait{"act-now", ctx, 2, 0, true}) // after this lim.tokens = 1 + go func() { + time.Sleep(d) + cancel() + }() + runWait(t, lim, wait{"will-cancel", ctx, 3, 1, false}) + // should get 3 tokens back, and have lim.tokens = 2 + t.Logf("tokens:%v last:%v lastEvent:%v", lim.tokens, lim.last, lim.lastEvent) + runWait(t, lim, wait{"act-now-after-cancel", context.Background(), 2, 0, true}) +} + +func TestWaitTimeout(t *testing.T) { + lim := NewLimiter(10, 3) + + ctx, cancel := context.WithTimeout(context.Background(), d) + defer cancel() + runWait(t, lim, wait{"act-now", ctx, 2, 0, true}) + runWait(t, lim, wait{"w-timeout-err", ctx, 3, 0, false}) +} + +func TestWaitInf(t *testing.T) { + lim := NewLimiter(Inf, 0) + + runWait(t, lim, wait{"exceed-burst-no-error", context.Background(), 3, 0, true}) +} + +func BenchmarkAllowN(b *testing.B) { + lim := NewLimiter(Every(1*time.Second), 1) + now := time.Now() + b.ReportAllocs() + b.ResetTimer() + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + lim.AllowN(now, 1) + } + }) +} + +func BenchmarkWaitNNoDelay(b *testing.B) { + lim := NewLimiter(Limit(b.N), b.N) + ctx := context.Background() + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + lim.WaitN(ctx, 1) + } +} diff --git a/vendor/k8s.io/api/.github/PULL_REQUEST_TEMPLATE.md b/vendor/k8s.io/api/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..e559c074b --- /dev/null +++ b/vendor/k8s.io/api/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,2 @@ +Sorry, we do not accept changes directly against this repository. Please see +CONTRIBUTING.md for information on where and how to contribute instead. diff --git a/vendor/k8s.io/api/CONTRIBUTING.md b/vendor/k8s.io/api/CONTRIBUTING.md new file mode 100644 index 000000000..094efca3d --- /dev/null +++ b/vendor/k8s.io/api/CONTRIBUTING.md @@ -0,0 +1,7 @@ +# Contributing guidelines + +Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. + +This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/api](https://git.k8s.io/kubernetes/staging/src/k8s.io/api) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). + +Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/staging.md) for more information diff --git a/vendor/k8s.io/api/Godeps/Godeps.json b/vendor/k8s.io/api/Godeps/Godeps.json index 09dbc5bbd..21f3babad 100644 --- a/vendor/k8s.io/api/Godeps/Godeps.json +++ b/vendor/k8s.io/api/Godeps/Godeps.json @@ -1,230 +1,170 @@ { - "ImportPath": "k8s.io/api", - "GoVersion": "go1.9", - "GodepVersion": "v79", - "Packages": [ - "./..." - ], - "Deps": [ - { - "ImportPath": "github.com/PuerkitoBio/purell", - "Rev": "8a290539e2e8629dbc4e6bad948158f790ec31f4" - }, - { - "ImportPath": "github.com/PuerkitoBio/urlesc", - "Rev": "5bd2802263f21d8788851d5305584c82a5c75d7e" - }, - { - "ImportPath": "github.com/emicklei/go-restful", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, - { - "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, - { - "ImportPath": "github.com/go-openapi/jsonpointer", - "Rev": "46af16f9f7b149af66e5d1bd010e3574dc06de98" - }, - { - "ImportPath": "github.com/go-openapi/jsonreference", - "Rev": "13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272" - }, - { - "ImportPath": "github.com/go-openapi/spec", - "Rev": "7abd5745472fff5eb3685386d5fb8bf38683154d" - }, - { - "ImportPath": "github.com/go-openapi/swag", - "Rev": "f3f9494671f93fcff853e3c6e9e948b3eb71e590" - }, - { - "ImportPath": "github.com/gogo/protobuf/proto", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/sortkeys", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/golang/glog", - "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" - }, - { - "ImportPath": "github.com/google/gofuzz", - "Rev": "44d81051d367757e1c7c6a5a86423ece9afcf63c" - }, - { - "ImportPath": "github.com/mailru/easyjson/buffer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jlexer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jwriter", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/spf13/pflag", - "Rev": "9ff6c6923cfffbcd502984b8e0c80539a94968b7" - }, - { - "ImportPath": "golang.org/x/net/http2", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/http2/hpack", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/idna", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/lex/httplex", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/text/cases", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal/tag", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/language", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/runes", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/secure/bidirule", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/secure/precis", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/transform", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/unicode/bidi", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/unicode/norm", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/width", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "gopkg.in/inf.v0", - "Rev": "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" - }, - { - "ImportPath": "gopkg.in/yaml.v2", - "Rev": "53feefa2559fb8dfa8d81baad31be332c97d6c77" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" - } - ] + "ImportPath": "k8s.io/api", + "GoVersion": "go1.9", + "GodepVersion": "v79", + "Packages": [ + "./..." + ], + "Deps": [ + { + "ImportPath": "github.com/gogo/protobuf/proto", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/sortkeys", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/golang/glog", + "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" + }, + { + "ImportPath": "github.com/google/gofuzz", + "Rev": "44d81051d367757e1c7c6a5a86423ece9afcf63c" + }, + { + "ImportPath": "github.com/spf13/pflag", + "Rev": "4c012f6dcd9546820e378d0bdda4d8fc772cdfea" + }, + { + "ImportPath": "golang.org/x/net/http2", + "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + }, + { + "ImportPath": "golang.org/x/net/http2/hpack", + "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + }, + { + "ImportPath": "golang.org/x/net/idna", + "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + }, + { + "ImportPath": "golang.org/x/net/lex/httplex", + "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + }, + { + "ImportPath": "golang.org/x/text/secure/bidirule", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/transform", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/unicode/bidi", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/unicode/norm", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "gopkg.in/inf.v0", + "Rev": "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/api/resource", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/conversion", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/fields", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/labels", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/selection", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/types", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/errors", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/json", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/net", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/sets", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/validation", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/wait", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/watch", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/api/resource", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/types", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" + } + ] } diff --git a/vendor/k8s.io/api/Godeps/OWNERS b/vendor/k8s.io/api/Godeps/OWNERS new file mode 100644 index 000000000..3d49f3060 --- /dev/null +++ b/vendor/k8s.io/api/Godeps/OWNERS @@ -0,0 +1,2 @@ +approvers: +- dep-approvers diff --git a/vendor/k8s.io/api/OWNERS b/vendor/k8s.io/api/OWNERS index 918b10522..b2c570008 100644 --- a/vendor/k8s.io/api/OWNERS +++ b/vendor/k8s.io/api/OWNERS @@ -43,7 +43,6 @@ reviewers: - sttts - tallclair - thockin -- timothysc - vishh - wojtek-t - yifan-gu diff --git a/vendor/k8s.io/api/admission/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/admission/v1beta1/zz_generated.deepcopy.go index 275a326d2..fc60e1909 100644 --- a/vendor/k8s.io/api/admission/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/admission/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -124,7 +124,6 @@ func (in *AdmissionReview) DeepCopy() *AdmissionReview { func (in *AdmissionReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } diff --git a/vendor/k8s.io/api/admissionregistration/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/admissionregistration/v1alpha1/zz_generated.deepcopy.go index 667b262ab..2ca492946 100644 --- a/vendor/k8s.io/api/admissionregistration/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/admissionregistration/v1alpha1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 @@ -76,9 +76,8 @@ func (in *InitializerConfiguration) DeepCopy() *InitializerConfiguration { func (in *InitializerConfiguration) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -110,9 +109,8 @@ func (in *InitializerConfigurationList) DeepCopy() *InitializerConfigurationList func (in *InitializerConfigurationList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto b/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto index cb1270ea4..3d6cbc1e6 100644 --- a/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto +++ b/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto @@ -155,6 +155,10 @@ message Webhook { // Rules describes what operations on what resources/subresources the webhook cares about. // The webhook cares about an operation if it matches _any_ Rule. + // However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks + // from putting the cluster in a state which cannot be recovered from without completely + // disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called + // on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. repeated RuleWithOperations rules = 3; // FailurePolicy defines how unrecognized errors from the admission endpoint are handled - @@ -165,8 +169,8 @@ message Webhook { // NamespaceSelector decides whether to run the webhook on an object based // on whether the namespace for that object matches the selector. If the // object itself is a namespace, the matching is performed on - // object.metadata.labels. If the object is other cluster scoped resource, - // it is not subjected to the webhook. + // object.metadata.labels. If the object is another cluster scoped resource, + // it never skips the webhook. // // For example, to run the webhook on any objects whose namespace is not // associated with "runlevel" of "0" or "1"; you will set the selector as diff --git a/vendor/k8s.io/api/admissionregistration/v1beta1/types.go b/vendor/k8s.io/api/admissionregistration/v1beta1/types.go index 30d2750ce..9a4a1ddb4 100644 --- a/vendor/k8s.io/api/admissionregistration/v1beta1/types.go +++ b/vendor/k8s.io/api/admissionregistration/v1beta1/types.go @@ -54,11 +54,9 @@ type Rule struct { type FailurePolicyType string const ( - // Ignore means the initializer is removed from the initializers list of an - // object if the initializer is timed out. + // Ignore means that an error calling the webhook is ignored. Ignore FailurePolicyType = "Ignore" - // For 1.7, only "Ignore" is allowed. "Fail" will be allowed when the - // extensible admission feature is beta. + // Fail means that an error calling the webhook causes the admission to fail. Fail FailurePolicyType = "Fail" ) @@ -137,6 +135,10 @@ type Webhook struct { // Rules describes what operations on what resources/subresources the webhook cares about. // The webhook cares about an operation if it matches _any_ Rule. + // However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks + // from putting the cluster in a state which cannot be recovered from without completely + // disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called + // on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. Rules []RuleWithOperations `json:"rules,omitempty" protobuf:"bytes,3,rep,name=rules"` // FailurePolicy defines how unrecognized errors from the admission endpoint are handled - @@ -147,8 +149,8 @@ type Webhook struct { // NamespaceSelector decides whether to run the webhook on an object based // on whether the namespace for that object matches the selector. If the // object itself is a namespace, the matching is performed on - // object.metadata.labels. If the object is other cluster scoped resource, - // it is not subjected to the webhook. + // object.metadata.labels. If the object is another cluster scoped resource, + // it never skips the webhook. // // For example, to run the webhook on any objects whose namespace is not // associated with "runlevel" of "0" or "1"; you will set the selector as diff --git a/vendor/k8s.io/api/admissionregistration/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/admissionregistration/v1beta1/types_swagger_doc_generated.go index ea8c1e37f..b32051424 100644 --- a/vendor/k8s.io/api/admissionregistration/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/admissionregistration/v1beta1/types_swagger_doc_generated.go @@ -102,9 +102,9 @@ var map_Webhook = map[string]string{ "": "Webhook describes an admission webhook and the resources and operations it applies to.", "name": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.", "clientConfig": "ClientConfig defines how to communicate with the hook. Required", - "rules": "Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule.", + "rules": "Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.", "failurePolicy": "FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Ignore.", - "namespaceSelector": "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is other cluster scoped resource, it is not subjected to the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.", + "namespaceSelector": "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.", } func (Webhook) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/admissionregistration/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/admissionregistration/v1beta1/zz_generated.deepcopy.go index fb0cf9c47..d8345d209 100644 --- a/vendor/k8s.io/api/admissionregistration/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/admissionregistration/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -54,9 +54,8 @@ func (in *MutatingWebhookConfiguration) DeepCopy() *MutatingWebhookConfiguration func (in *MutatingWebhookConfiguration) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -88,9 +87,8 @@ func (in *MutatingWebhookConfigurationList) DeepCopy() *MutatingWebhookConfigura func (in *MutatingWebhookConfigurationList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -200,9 +198,8 @@ func (in *ValidatingWebhookConfiguration) DeepCopy() *ValidatingWebhookConfigura func (in *ValidatingWebhookConfiguration) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -234,9 +231,8 @@ func (in *ValidatingWebhookConfigurationList) DeepCopy() *ValidatingWebhookConfi func (in *ValidatingWebhookConfigurationList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/apps/OWNERS b/vendor/k8s.io/api/apps/OWNERS index e06ff4c48..2f260571a 100755 --- a/vendor/k8s.io/api/apps/OWNERS +++ b/vendor/k8s.io/api/apps/OWNERS @@ -9,7 +9,6 @@ reviewers: - saad-ali - ncdc - tallclair -- timothysc - dims - errordeveloper - mml diff --git a/vendor/k8s.io/api/apps/v1/generated.proto b/vendor/k8s.io/api/apps/v1/generated.proto index 184c868e3..46473baa8 100644 --- a/vendor/k8s.io/api/apps/v1/generated.proto +++ b/vendor/k8s.io/api/apps/v1/generated.proto @@ -519,7 +519,7 @@ message RollingUpdateDeployment { // the rolling update starts, such that the total number of old and new pods do not exceed // 130% of desired pods. Once old pods have been killed, // new RC can be scaled up further, ensuring that total number of pods running - // at any time during the update is atmost 130% of desired pods. + // at any time during the update is at most 130% of desired pods. // +optional optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2; } diff --git a/vendor/k8s.io/api/apps/v1/types.go b/vendor/k8s.io/api/apps/v1/types.go index f32300fe9..b5df22c6f 100644 --- a/vendor/k8s.io/api/apps/v1/types.go +++ b/vendor/k8s.io/api/apps/v1/types.go @@ -362,7 +362,7 @@ type RollingUpdateDeployment struct { // the rolling update starts, such that the total number of old and new pods do not exceed // 130% of desired pods. Once old pods have been killed, // new RC can be scaled up further, ensuring that total number of pods running - // at any time during the update is atmost 130% of desired pods. + // at any time during the update is at most 130% of desired pods. // +optional MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"` } diff --git a/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go index 76305393e..4dec6f2f8 100644 --- a/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go @@ -272,7 +272,7 @@ func (RollingUpdateDaemonSet) SwaggerDoc() map[string]string { var map_RollingUpdateDeployment = map[string]string{ "": "Spec to control the desired behavior of rolling update.", "maxUnavailable": "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.", - "maxSurge": "The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods.", + "maxSurge": "The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is at most 130% of desired pods.", } func (RollingUpdateDeployment) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/apps/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/apps/v1/zz_generated.deepcopy.go index 9419e8e72..62984cb89 100644 --- a/vendor/k8s.io/api/apps/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/apps/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -50,9 +50,8 @@ func (in *ControllerRevision) DeepCopy() *ControllerRevision { func (in *ControllerRevision) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -84,9 +83,8 @@ func (in *ControllerRevisionList) DeepCopy() *ControllerRevisionList { func (in *ControllerRevisionList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -113,9 +111,8 @@ func (in *DaemonSet) DeepCopy() *DaemonSet { func (in *DaemonSet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -164,9 +161,8 @@ func (in *DaemonSetList) DeepCopy() *DaemonSetList { func (in *DaemonSetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -286,9 +282,8 @@ func (in *Deployment) DeepCopy() *Deployment { func (in *Deployment) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -338,9 +333,8 @@ func (in *DeploymentList) DeepCopy() *DeploymentList { func (in *DeploymentList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -478,9 +472,8 @@ func (in *ReplicaSet) DeepCopy() *ReplicaSet { func (in *ReplicaSet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -529,9 +522,8 @@ func (in *ReplicaSetList) DeepCopy() *ReplicaSetList { func (in *ReplicaSetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -700,9 +692,8 @@ func (in *StatefulSet) DeepCopy() *StatefulSet { func (in *StatefulSet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -751,9 +742,8 @@ func (in *StatefulSetList) DeepCopy() *StatefulSetList { func (in *StatefulSetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/apps/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/apps/v1beta1/zz_generated.deepcopy.go index d83e9d6fe..b06032e1e 100644 --- a/vendor/k8s.io/api/apps/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/apps/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -50,9 +50,8 @@ func (in *ControllerRevision) DeepCopy() *ControllerRevision { func (in *ControllerRevision) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -84,9 +83,8 @@ func (in *ControllerRevisionList) DeepCopy() *ControllerRevisionList { func (in *ControllerRevisionList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -113,9 +111,8 @@ func (in *Deployment) DeepCopy() *Deployment { func (in *Deployment) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -165,9 +162,8 @@ func (in *DeploymentList) DeepCopy() *DeploymentList { func (in *DeploymentList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -199,9 +195,8 @@ func (in *DeploymentRollback) DeepCopy() *DeploymentRollback { func (in *DeploymentRollback) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -423,9 +418,8 @@ func (in *Scale) DeepCopy() *Scale { func (in *Scale) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -491,9 +485,8 @@ func (in *StatefulSet) DeepCopy() *StatefulSet { func (in *StatefulSet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -542,9 +535,8 @@ func (in *StatefulSetList) DeepCopy() *StatefulSetList { func (in *StatefulSetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/apps/v1beta2/zz_generated.deepcopy.go b/vendor/k8s.io/api/apps/v1beta2/zz_generated.deepcopy.go index f2d847ed5..3db38527d 100644 --- a/vendor/k8s.io/api/apps/v1beta2/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/apps/v1beta2/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta2 @@ -50,9 +50,8 @@ func (in *ControllerRevision) DeepCopy() *ControllerRevision { func (in *ControllerRevision) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -84,9 +83,8 @@ func (in *ControllerRevisionList) DeepCopy() *ControllerRevisionList { func (in *ControllerRevisionList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -113,9 +111,8 @@ func (in *DaemonSet) DeepCopy() *DaemonSet { func (in *DaemonSet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -164,9 +161,8 @@ func (in *DaemonSetList) DeepCopy() *DaemonSetList { func (in *DaemonSetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -286,9 +282,8 @@ func (in *Deployment) DeepCopy() *Deployment { func (in *Deployment) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -338,9 +333,8 @@ func (in *DeploymentList) DeepCopy() *DeploymentList { func (in *DeploymentList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -478,9 +472,8 @@ func (in *ReplicaSet) DeepCopy() *ReplicaSet { func (in *ReplicaSet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -529,9 +522,8 @@ func (in *ReplicaSetList) DeepCopy() *ReplicaSetList { func (in *ReplicaSetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -700,9 +692,8 @@ func (in *Scale) DeepCopy() *Scale { func (in *Scale) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -768,9 +759,8 @@ func (in *StatefulSet) DeepCopy() *StatefulSet { func (in *StatefulSet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -819,9 +809,8 @@ func (in *StatefulSetList) DeepCopy() *StatefulSetList { func (in *StatefulSetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/authentication/OWNERS b/vendor/k8s.io/api/authentication/OWNERS index 952352341..2bdfd0ce5 100755 --- a/vendor/k8s.io/api/authentication/OWNERS +++ b/vendor/k8s.io/api/authentication/OWNERS @@ -4,7 +4,6 @@ reviewers: - wojtek-t - deads2k - sttts -- timothysc - mbohlool - jianhuiz - enj diff --git a/vendor/k8s.io/api/authentication/v1/BUILD b/vendor/k8s.io/api/authentication/v1/BUILD index f2e2b1a98..26e557e46 100644 --- a/vendor/k8s.io/api/authentication/v1/BUILD +++ b/vendor/k8s.io/api/authentication/v1/BUILD @@ -22,6 +22,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", ], ) diff --git a/vendor/k8s.io/api/authentication/v1/generated.pb.go b/vendor/k8s.io/api/authentication/v1/generated.pb.go index 2e66666eb..d090ce579 100644 --- a/vendor/k8s.io/api/authentication/v1/generated.pb.go +++ b/vendor/k8s.io/api/authentication/v1/generated.pb.go @@ -25,7 +25,11 @@ limitations under the License. k8s.io/kubernetes/vendor/k8s.io/api/authentication/v1/generated.proto It has these top-level messages: + BoundObjectReference ExtraValue + TokenRequest + TokenRequestSpec + TokenRequestStatus TokenReview TokenReviewSpec TokenReviewStatus @@ -37,6 +41,8 @@ import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" +import k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" + import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" import strings "strings" @@ -55,33 +61,87 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +func (m *BoundObjectReference) Reset() { *m = BoundObjectReference{} } +func (*BoundObjectReference) ProtoMessage() {} +func (*BoundObjectReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } + func (m *ExtraValue) Reset() { *m = ExtraValue{} } func (*ExtraValue) ProtoMessage() {} -func (*ExtraValue) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } +func (*ExtraValue) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } + +func (m *TokenRequest) Reset() { *m = TokenRequest{} } +func (*TokenRequest) ProtoMessage() {} +func (*TokenRequest) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } + +func (m *TokenRequestSpec) Reset() { *m = TokenRequestSpec{} } +func (*TokenRequestSpec) ProtoMessage() {} +func (*TokenRequestSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } + +func (m *TokenRequestStatus) Reset() { *m = TokenRequestStatus{} } +func (*TokenRequestStatus) ProtoMessage() {} +func (*TokenRequestStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} } func (m *TokenReview) Reset() { *m = TokenReview{} } func (*TokenReview) ProtoMessage() {} -func (*TokenReview) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } +func (*TokenReview) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} } func (m *TokenReviewSpec) Reset() { *m = TokenReviewSpec{} } func (*TokenReviewSpec) ProtoMessage() {} -func (*TokenReviewSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } +func (*TokenReviewSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} } func (m *TokenReviewStatus) Reset() { *m = TokenReviewStatus{} } func (*TokenReviewStatus) ProtoMessage() {} -func (*TokenReviewStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } +func (*TokenReviewStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} } func (m *UserInfo) Reset() { *m = UserInfo{} } func (*UserInfo) ProtoMessage() {} -func (*UserInfo) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} } +func (*UserInfo) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} } func init() { + proto.RegisterType((*BoundObjectReference)(nil), "k8s.io.api.authentication.v1.BoundObjectReference") proto.RegisterType((*ExtraValue)(nil), "k8s.io.api.authentication.v1.ExtraValue") + proto.RegisterType((*TokenRequest)(nil), "k8s.io.api.authentication.v1.TokenRequest") + proto.RegisterType((*TokenRequestSpec)(nil), "k8s.io.api.authentication.v1.TokenRequestSpec") + proto.RegisterType((*TokenRequestStatus)(nil), "k8s.io.api.authentication.v1.TokenRequestStatus") proto.RegisterType((*TokenReview)(nil), "k8s.io.api.authentication.v1.TokenReview") proto.RegisterType((*TokenReviewSpec)(nil), "k8s.io.api.authentication.v1.TokenReviewSpec") proto.RegisterType((*TokenReviewStatus)(nil), "k8s.io.api.authentication.v1.TokenReviewStatus") proto.RegisterType((*UserInfo)(nil), "k8s.io.api.authentication.v1.UserInfo") } +func (m *BoundObjectReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BoundObjectReference) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) + i += copy(dAtA[i:], m.Kind) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIVersion))) + i += copy(dAtA[i:], m.APIVersion) + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.UID))) + i += copy(dAtA[i:], m.UID) + return i, nil +} + func (m ExtraValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -115,7 +175,7 @@ func (m ExtraValue) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *TokenReview) Marshal() (dAtA []byte, err error) { +func (m *TokenRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -125,7 +185,7 @@ func (m *TokenReview) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenReview) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int @@ -157,6 +217,126 @@ func (m *TokenReview) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *TokenRequestSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TokenRequestSpec) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + dAtA[i] = 0xa + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + if m.BoundObjectRef != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.BoundObjectRef.Size())) + n4, err := m.BoundObjectRef.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 + } + if m.ExpirationSeconds != nil { + dAtA[i] = 0x20 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(*m.ExpirationSeconds)) + } + return i, nil +} + +func (m *TokenRequestStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TokenRequestStatus) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Token))) + i += copy(dAtA[i:], m.Token) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.ExpirationTimestamp.Size())) + n5, err := m.ExpirationTimestamp.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 + return i, nil +} + +func (m *TokenReview) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TokenReview) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) + n6, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n6 + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) + n7, err := m.Spec.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n7 + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) + n8, err := m.Status.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n8 + return i, nil +} + func (m *TokenReviewSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -205,11 +385,11 @@ func (m *TokenReviewStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.User.Size())) - n4, err := m.User.MarshalTo(dAtA[i:]) + n9, err := m.User.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n4 + i += n9 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Error))) @@ -279,11 +459,11 @@ func (m *UserInfo) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n5, err := (&v).MarshalTo(dAtA[i:]) + n10, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n5 + i += n10 } } return i, nil @@ -316,6 +496,20 @@ func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return offset + 1 } +func (m *BoundObjectReference) Size() (n int) { + var l int + _ = l + l = len(m.Kind) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.APIVersion) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.UID) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m ExtraValue) Size() (n int) { var l int _ = l @@ -328,6 +522,47 @@ func (m ExtraValue) Size() (n int) { return n } +func (m *TokenRequest) Size() (n int) { + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *TokenRequestSpec) Size() (n int) { + var l int + _ = l + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.BoundObjectRef != nil { + l = m.BoundObjectRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ExpirationSeconds != nil { + n += 1 + sovGenerated(uint64(*m.ExpirationSeconds)) + } + return n +} + +func (m *TokenRequestStatus) Size() (n int) { + var l int + _ = l + l = len(m.Token) + n += 1 + l + sovGenerated(uint64(l)) + l = m.ExpirationTimestamp.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *TokenReview) Size() (n int) { var l int _ = l @@ -397,6 +632,54 @@ func sovGenerated(x uint64) (n int) { func sozGenerated(x uint64) (n int) { return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (this *BoundObjectReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BoundObjectReference{`, + `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, + `APIVersion:` + fmt.Sprintf("%v", this.APIVersion) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `UID:` + fmt.Sprintf("%v", this.UID) + `,`, + `}`, + }, "") + return s +} +func (this *TokenRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TokenRequest{`, + `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "TokenRequestSpec", "TokenRequestSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "TokenRequestStatus", "TokenRequestStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *TokenRequestSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TokenRequestSpec{`, + `Audiences:` + fmt.Sprintf("%v", this.Audiences) + `,`, + `BoundObjectRef:` + strings.Replace(fmt.Sprintf("%v", this.BoundObjectRef), "BoundObjectReference", "BoundObjectReference", 1) + `,`, + `ExpirationSeconds:` + valueToStringGenerated(this.ExpirationSeconds) + `,`, + `}`, + }, "") + return s +} +func (this *TokenRequestStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TokenRequestStatus{`, + `Token:` + fmt.Sprintf("%v", this.Token) + `,`, + `ExpirationTimestamp:` + strings.Replace(strings.Replace(this.ExpirationTimestamp.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} func (this *TokenReview) String() string { if this == nil { return "nil" @@ -462,7 +745,7 @@ func valueToStringGenerated(v interface{}) string { pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } -func (m *ExtraValue) Unmarshal(dAtA []byte) error { +func (m *BoundObjectReference) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -485,15 +768,15 @@ func (m *ExtraValue) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExtraValue: wiretype end group for non-group") + return fmt.Errorf("proto: BoundObjectReference: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExtraValue: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BoundObjectReference: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -518,7 +801,554 @@ func (m *ExtraValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - *m = append(*m, string(dAtA[iNdEx:postIndex])) + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.APIVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UID = k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExtraValue) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExtraValue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExtraValue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + *m = append(*m, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TokenRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TokenRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TokenRequestSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TokenRequestSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenRequestSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Audiences", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Audiences = append(m.Audiences, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BoundObjectRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BoundObjectRef == nil { + m.BoundObjectRef = &BoundObjectReference{} + } + if err := m.BoundObjectRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationSeconds", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ExpirationSeconds = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TokenRequestStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TokenRequestStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenRequestStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTimestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExpirationTimestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1257,46 +2087,62 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 642 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xb5, 0xf3, 0x51, 0x25, 0x1b, 0x0a, 0x65, 0x25, 0xa4, 0x28, 0x02, 0x27, 0x0a, 0x12, 0xca, - 0x81, 0xae, 0x49, 0x41, 0xa5, 0x2a, 0x12, 0x12, 0x16, 0x11, 0xf4, 0x80, 0x2a, 0x2d, 0xb4, 0x48, - 0x9c, 0xd8, 0x38, 0x53, 0xc7, 0xa4, 0xfe, 0xd0, 0x7a, 0x6d, 0xe8, 0xad, 0x3f, 0x81, 0x23, 0xdc, - 0xf8, 0x17, 0x1c, 0xb9, 0xf6, 0xd8, 0x63, 0x0f, 0xa8, 0xa2, 0xe6, 0x8f, 0xa0, 0x5d, 0x2f, 0x4d, - 0xda, 0xd2, 0xd0, 0x9b, 0xf7, 0xcd, 0x7b, 0x6f, 0x67, 0x9e, 0x77, 0xd0, 0x60, 0xb2, 0x96, 0x10, - 0x3f, 0xb2, 0x27, 0xe9, 0x10, 0x78, 0x08, 0x02, 0x12, 0x3b, 0x83, 0x70, 0x14, 0x71, 0x5b, 0x17, - 0x58, 0xec, 0xdb, 0x2c, 0x15, 0x63, 0x08, 0x85, 0xef, 0x32, 0xe1, 0x47, 0xa1, 0x9d, 0xf5, 0x6d, - 0x0f, 0x42, 0xe0, 0x4c, 0xc0, 0x88, 0xc4, 0x3c, 0x12, 0x11, 0xbe, 0x5d, 0xb0, 0x09, 0x8b, 0x7d, - 0x72, 0x96,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x8e, 0xbb, - 0x68, 0xc1, 0xe3, 0x51, 0x1a, 0xcb, 0x9f, 0x25, 0xdf, 0x26, 0x92, 0xb9, 0xbf, 0x50, 0x08, 0xd5, - 0x15, 0xbc, 0x8d, 0xaa, 0x20, 0x1f, 0x73, 0xb3, 0xd2, 0x29, 0xf7, 0x1a, 0x2b, 0xfd, 0xab, 0x4d, - 0x4b, 0xd4, 0x02, 0x0c, 0x42, 0xc1, 0xf7, 0x66, 0xa6, 0x92, 0x18, 0x2d, 0xec, 0x5a, 0x43, 0xbd, - 0x24, 0x8a, 0x83, 0x97, 0x50, 0x79, 0x02, 0x7b, 0xc5, 0x44, 0x54, 0x7e, 0xe2, 0xa7, 0xa8, 0x9a, - 0xc9, 0xfd, 0xd1, 0x29, 0xf7, 0xe6, 0xdf, 0x3b, 0xdd, 0x37, 0x5a, 0xc8, 0xd6, 0x4b, 0x6b, 0xa6, - 0xd3, 0x3b, 0x38, 0xb1, 0x8c, 0xc3, 0x13, 0xcb, 0x38, 0x3a, 0xb1, 0x8c, 0xfd, 0xdc, 0x32, 0x0f, - 0x72, 0xcb, 0x3c, 0xcc, 0x2d, 0xf3, 0x28, 0xb7, 0xcc, 0x5f, 0xb9, 0x65, 0x7e, 0xfe, 0x6d, 0x19, - 0xef, 0x4a, 0x59, 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xeb, 0x3a, 0x3c, 0x31, 0x1b, 0x05, - 0x00, 0x00, + // 905 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xfa, 0x47, 0x64, 0x8f, 0x9b, 0x90, 0x4c, 0xa9, 0x64, 0x05, 0xb0, 0x8d, 0x91, 0x90, + 0x05, 0x74, 0xb7, 0x36, 0xa8, 0x54, 0x45, 0x42, 0xca, 0x12, 0x0b, 0x2c, 0x04, 0xad,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 0xd6, 0x50, 0xf8, 0x51, 0xa0, 0x1e, 0x4b, 0x6d, 0x01, 0xa4, 0x74, 0xff, + 0x54, 0x47, 0x88, 0xc9, 0xe0, 0x63, 0x54, 0x00, 0xb5, 0x99, 0x2b, 0xf9, 0x7a, 0xae, 0x59, 0x6e, + 0xb7, 0x36, 0x9b, 0xd6, 0xd6, 0xdb, 0xbc, 0xc3, 0xa5, 0x98, 0xcc, 0x4d, 0xa5, 0x62, 0x24, 0xa1, + 0xdb, 0xef, 0x99, 0x8d, 0xaf, 0x31, 0x78, 0x17, 0xe5, 0x46, 0x30, 0x49, 0x26, 0x22, 0xea, 0x27, + 0xfe, 0x18, 0x15, 0xc6, 0xea, 0x63, 0x60, 0x54, 0x6e, 0xae, 0xbf, 0x37, 0xfd, 0x78, 0x90, 0xa4, + 0xec, 0x7e, 0xf6, 0x9e, 0xe5, 0x36, 0xcf, 0xce, 0xab, 0x99, 0xe7, 0xe7, 0xd5, 0xcc, 0x8b, 0xf3, + 0x6a, 0xe6, 0x59, 0x5c, 0xb5, 0xce, 0xe2, 0xaa, 0xf5, 0x3c, 0xae, 0x5a, 0x2f, 0xe2, 0xaa, 0xf5, + 0x77, 0x5c, 0xb5, 0x7e, 0xfc, 0xa7, 0x9a, 0xf9, 0x26, 0x3b, 0x6e, 0xfd, 0x1f, 0x00, 0x00, 0xff, + 0xff, 0x5f, 0x39, 0x60, 0xb1, 0xbd, 0x08, 0x00, 0x00, } diff --git a/vendor/k8s.io/api/authentication/v1/generated.proto b/vendor/k8s.io/api/authentication/v1/generated.proto index ea7b3b288..1fd432a70 100644 --- a/vendor/k8s.io/api/authentication/v1/generated.proto +++ b/vendor/k8s.io/api/authentication/v1/generated.proto @@ -29,6 +29,25 @@ import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; // Package-wide variables from generator "generated". option go_package = "v1"; +// BoundObjectReference is a reference to an object that a token is bound to. +message BoundObjectReference { + // Kind of the referent. Valid kinds are 'Pod' and 'Secret'. + // +optional + optional string kind = 1; + + // API version of the referent. + // +optional + optional string aPIVersion = 2; + + // Name of the referent. + // +optional + optional string name = 3; + + // UID of the referent. + // +optional + optional string uID = 4; +} + // ExtraValue masks the value so protobuf can generate // +protobuf.nullable=true // +protobuf.options.(gogoproto.goproto_stringer)=false @@ -38,6 +57,48 @@ message ExtraValue { repeated string items = 1; } +// TokenRequest requests a token for a given service account. +message TokenRequest { + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + optional TokenRequestSpec spec = 2; + + // +optional + optional TokenRequestStatus status = 3; +} + +// TokenRequestSpec contains client provided parameters of a token request. +message TokenRequestSpec { + // Audiences are the intendend audiences of the token. A recipient of a + // token must identitfy themself with an identifier in the list of + // audiences of the token, and otherwise should reject the token. A + // token issued for multiple audiences may be used to authenticate + // against any of the audiences listed but implies a high degree of + // trust between the target audiences. + repeated string audiences = 1; + + // ExpirationSeconds is the requested duration of validity of the request. The + // token issuer may return a token with a different validity duration so a + // client needs to check the 'expiration' field in a response. + // +optional + optional int64 expirationSeconds = 4; + + // BoundObjectRef is a reference to an object that the token will be bound to. + // The token will only be valid for as long as the bound objet exists. + // +optional + optional BoundObjectReference boundObjectRef = 3; +} + +// TokenRequestStatus is the result of a token request. +message TokenRequestStatus { + // Token is the opaque bearer token. + optional string token = 1; + + // ExpirationTimestamp is the time of expiration of the returned token. + optional k8s.io.apimachinery.pkg.apis.meta.v1.Time expirationTimestamp = 2; +} + // TokenReview attempts to authenticate a token to a known user. // Note: TokenReview requests may be cached by the webhook token authenticator // plugin in the kube-apiserver. diff --git a/vendor/k8s.io/api/authentication/v1/register.go b/vendor/k8s.io/api/authentication/v1/register.go index 2ca79a620..c522e4a46 100644 --- a/vendor/k8s.io/api/authentication/v1/register.go +++ b/vendor/k8s.io/api/authentication/v1/register.go @@ -45,6 +45,7 @@ var ( func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &TokenReview{}, + &TokenRequest{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/vendor/k8s.io/api/authentication/v1/types.go b/vendor/k8s.io/api/authentication/v1/types.go index b6d30bbe6..723457a3d 100644 --- a/vendor/k8s.io/api/authentication/v1/types.go +++ b/vendor/k8s.io/api/authentication/v1/types.go @@ -20,6 +20,7 @@ import ( "fmt" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" ) const ( @@ -105,3 +106,63 @@ type ExtraValue []string func (t ExtraValue) String() string { return fmt.Sprintf("%v", []string(t)) } + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TokenRequest requests a token for a given service account. +type TokenRequest struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + Spec TokenRequestSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + // +optional + Status TokenRequestStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// TokenRequestSpec contains client provided parameters of a token request. +type TokenRequestSpec struct { + // Audiences are the intendend audiences of the token. A recipient of a + // token must identitfy themself with an identifier in the list of + // audiences of the token, and otherwise should reject the token. A + // token issued for multiple audiences may be used to authenticate + // against any of the audiences listed but implies a high degree of + // trust between the target audiences. + Audiences []string `json:"audiences" protobuf:"bytes,1,rep,name=audiences"` + + // ExpirationSeconds is the requested duration of validity of the request. The + // token issuer may return a token with a different validity duration so a + // client needs to check the 'expiration' field in a response. + // +optional + ExpirationSeconds *int64 `json:"expirationSeconds" protobuf:"varint,4,opt,name=expirationSeconds"` + + // BoundObjectRef is a reference to an object that the token will be bound to. + // The token will only be valid for as long as the bound objet exists. + // +optional + BoundObjectRef *BoundObjectReference `json:"boundObjectRef" protobuf:"bytes,3,opt,name=boundObjectRef"` +} + +// TokenRequestStatus is the result of a token request. +type TokenRequestStatus struct { + // Token is the opaque bearer token. + Token string `json:"token" protobuf:"bytes,1,opt,name=token"` + // ExpirationTimestamp is the time of expiration of the returned token. + ExpirationTimestamp metav1.Time `json:"expirationTimestamp" protobuf:"bytes,2,opt,name=expirationTimestamp"` +} + +// BoundObjectReference is a reference to an object that a token is bound to. +type BoundObjectReference struct { + // Kind of the referent. Valid kinds are 'Pod' and 'Secret'. + // +optional + Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` + // API version of the referent. + // +optional + APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=aPIVersion"` + + // Name of the referent. + // +optional + Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=name"` + // UID of the referent. + // +optional + UID types.UID `json:"uid,omitempty" protobuf:"bytes,4,opt,name=uID,casttype=k8s.io/apimachinery/pkg/types.UID"` +} diff --git a/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go index bb235e4ea..68ecea8ea 100644 --- a/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go @@ -27,6 +27,47 @@ package v1 // Those methods can be generated by using hack/update-generated-swagger-docs.sh // AUTO-GENERATED FUNCTIONS START HERE +var map_BoundObjectReference = map[string]string{ + "": "BoundObjectReference is a reference to an object that a token is bound to.", + "kind": "Kind of the referent. Valid kinds are 'Pod' and 'Secret'.", + "apiVersion": "API version of the referent.", + "name": "Name of the referent.", + "uid": "UID of the referent.", +} + +func (BoundObjectReference) SwaggerDoc() map[string]string { + return map_BoundObjectReference +} + +var map_TokenRequest = map[string]string{ + "": "TokenRequest requests a token for a given service account.", +} + +func (TokenRequest) SwaggerDoc() map[string]string { + return map_TokenRequest +} + +var map_TokenRequestSpec = map[string]string{ + "": "TokenRequestSpec contains client provided parameters of a token request.", + "audiences": "Audiences are the intendend audiences of the token. A recipient of a token must identitfy themself with an identifier in the list of audiences of the token, and otherwise should reject the token. A token issued for multiple audiences may be used to authenticate against any of the audiences listed but implies a high degree of trust between the target audiences.", + "expirationSeconds": "ExpirationSeconds is the requested duration of validity of the request. The token issuer may return a token with a different validity duration so a client needs to check the 'expiration' field in a response.", + "boundObjectRef": "BoundObjectRef is a reference to an object that the token will be bound to. The token will only be valid for as long as the bound objet exists.", +} + +func (TokenRequestSpec) SwaggerDoc() map[string]string { + return map_TokenRequestSpec +} + +var map_TokenRequestStatus = map[string]string{ + "": "TokenRequestStatus is the result of a token request.", + "token": "Token is the opaque bearer token.", + "expirationTimestamp": "ExpirationTimestamp is the time of expiration of the returned token.", +} + +func (TokenRequestStatus) SwaggerDoc() map[string]string { + return map_TokenRequestStatus +} + var map_TokenReview = map[string]string{ "": "TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.", "spec": "Spec holds information about the request being evaluated", diff --git a/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go index f9b32192c..ad0df8ff4 100644 --- a/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -24,6 +24,126 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BoundObjectReference) DeepCopyInto(out *BoundObjectReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BoundObjectReference. +func (in *BoundObjectReference) DeepCopy() *BoundObjectReference { + if in == nil { + return nil + } + out := new(BoundObjectReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ExtraValue) DeepCopyInto(out *ExtraValue) { + { + in := &in + *out = make(ExtraValue, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraValue. +func (in ExtraValue) DeepCopy() ExtraValue { + if in == nil { + return nil + } + out := new(ExtraValue) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TokenRequest) DeepCopyInto(out *TokenRequest) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenRequest. +func (in *TokenRequest) DeepCopy() *TokenRequest { + if in == nil { + return nil + } + out := new(TokenRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TokenRequest) 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 *TokenRequestSpec) DeepCopyInto(out *TokenRequestSpec) { + *out = *in + if in.Audiences != nil { + in, out := &in.Audiences, &out.Audiences + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExpirationSeconds != nil { + in, out := &in.ExpirationSeconds, &out.ExpirationSeconds + if *in == nil { + *out = nil + } else { + *out = new(int64) + **out = **in + } + } + if in.BoundObjectRef != nil { + in, out := &in.BoundObjectRef, &out.BoundObjectRef + if *in == nil { + *out = nil + } else { + *out = new(BoundObjectReference) + **out = **in + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenRequestSpec. +func (in *TokenRequestSpec) DeepCopy() *TokenRequestSpec { + if in == nil { + return nil + } + out := new(TokenRequestSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TokenRequestStatus) DeepCopyInto(out *TokenRequestStatus) { + *out = *in + in.ExpirationTimestamp.DeepCopyInto(&out.ExpirationTimestamp) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenRequestStatus. +func (in *TokenRequestStatus) DeepCopy() *TokenRequestStatus { + if in == nil { + return nil + } + out := new(TokenRequestStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TokenReview) DeepCopyInto(out *TokenReview) { *out = *in @@ -48,9 +168,8 @@ func (in *TokenReview) DeepCopy() *TokenReview { func (in *TokenReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -98,8 +217,12 @@ func (in *UserInfo) DeepCopyInto(out *UserInfo) { in, out := &in.Extra, &out.Extra *out = make(map[string]ExtraValue, len(*in)) for key, val := range *in { - (*out)[key] = make(ExtraValue, len(val)) - copy((*out)[key], val) + if val == nil { + (*out)[key] = nil + } else { + (*out)[key] = make([]string, len(val)) + copy((*out)[key], val) + } } } return diff --git a/vendor/k8s.io/api/authentication/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/authentication/v1beta1/zz_generated.deepcopy.go index 65aabe7c4..57d878e9a 100644 --- a/vendor/k8s.io/api/authentication/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/authentication/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -24,6 +24,26 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ExtraValue) DeepCopyInto(out *ExtraValue) { + { + in := &in + *out = make(ExtraValue, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraValue. +func (in ExtraValue) DeepCopy() ExtraValue { + if in == nil { + return nil + } + out := new(ExtraValue) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TokenReview) DeepCopyInto(out *TokenReview) { *out = *in @@ -48,9 +68,8 @@ func (in *TokenReview) DeepCopy() *TokenReview { func (in *TokenReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -98,8 +117,12 @@ func (in *UserInfo) DeepCopyInto(out *UserInfo) { in, out := &in.Extra, &out.Extra *out = make(map[string]ExtraValue, len(*in)) for key, val := range *in { - (*out)[key] = make(ExtraValue, len(val)) - copy((*out)[key], val) + if val == nil { + (*out)[key] = nil + } else { + (*out)[key] = make([]string, len(val)) + copy((*out)[key], val) + } } } return diff --git a/vendor/k8s.io/api/authorization/OWNERS b/vendor/k8s.io/api/authorization/OWNERS index a68d7eef5..c1613fc2e 100755 --- a/vendor/k8s.io/api/authorization/OWNERS +++ b/vendor/k8s.io/api/authorization/OWNERS @@ -9,7 +9,6 @@ reviewers: - erictune - sttts - ncdc -- timothysc - dims - mml - mbohlool diff --git a/vendor/k8s.io/api/authorization/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/authorization/v1/zz_generated.deepcopy.go index 06a78643f..3df85934a 100644 --- a/vendor/k8s.io/api/authorization/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/authorization/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -24,6 +24,26 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ExtraValue) DeepCopyInto(out *ExtraValue) { + { + in := &in + *out = make(ExtraValue, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraValue. +func (in ExtraValue) DeepCopy() ExtraValue { + if in == nil { + return nil + } + out := new(ExtraValue) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LocalSubjectAccessReview) DeepCopyInto(out *LocalSubjectAccessReview) { *out = *in @@ -48,9 +68,8 @@ func (in *LocalSubjectAccessReview) DeepCopy() *LocalSubjectAccessReview { func (in *LocalSubjectAccessReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -171,9 +190,8 @@ func (in *SelfSubjectAccessReview) DeepCopy() *SelfSubjectAccessReview { func (in *SelfSubjectAccessReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -234,9 +252,8 @@ func (in *SelfSubjectRulesReview) DeepCopy() *SelfSubjectRulesReview { func (in *SelfSubjectRulesReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -279,9 +296,8 @@ func (in *SubjectAccessReview) DeepCopy() *SubjectAccessReview { func (in *SubjectAccessReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -314,8 +330,12 @@ func (in *SubjectAccessReviewSpec) DeepCopyInto(out *SubjectAccessReviewSpec) { in, out := &in.Extra, &out.Extra *out = make(map[string]ExtraValue, len(*in)) for key, val := range *in { - (*out)[key] = make(ExtraValue, len(val)) - copy((*out)[key], val) + if val == nil { + (*out)[key] = nil + } else { + (*out)[key] = make([]string, len(val)) + copy((*out)[key], val) + } } } return diff --git a/vendor/k8s.io/api/authorization/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/authorization/v1beta1/zz_generated.deepcopy.go index fed07fbb2..7c76b183b 100644 --- a/vendor/k8s.io/api/authorization/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/authorization/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -24,6 +24,26 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ExtraValue) DeepCopyInto(out *ExtraValue) { + { + in := &in + *out = make(ExtraValue, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraValue. +func (in ExtraValue) DeepCopy() ExtraValue { + if in == nil { + return nil + } + out := new(ExtraValue) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LocalSubjectAccessReview) DeepCopyInto(out *LocalSubjectAccessReview) { *out = *in @@ -48,9 +68,8 @@ func (in *LocalSubjectAccessReview) DeepCopy() *LocalSubjectAccessReview { func (in *LocalSubjectAccessReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -171,9 +190,8 @@ func (in *SelfSubjectAccessReview) DeepCopy() *SelfSubjectAccessReview { func (in *SelfSubjectAccessReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -234,9 +252,8 @@ func (in *SelfSubjectRulesReview) DeepCopy() *SelfSubjectRulesReview { func (in *SelfSubjectRulesReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -279,9 +296,8 @@ func (in *SubjectAccessReview) DeepCopy() *SubjectAccessReview { func (in *SubjectAccessReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -314,8 +330,12 @@ func (in *SubjectAccessReviewSpec) DeepCopyInto(out *SubjectAccessReviewSpec) { in, out := &in.Extra, &out.Extra *out = make(map[string]ExtraValue, len(*in)) for key, val := range *in { - (*out)[key] = make(ExtraValue, len(val)) - copy((*out)[key], val) + if val == nil { + (*out)[key] = nil + } else { + (*out)[key] = make([]string, len(val)) + copy((*out)[key], val) + } } } return diff --git a/vendor/k8s.io/api/autoscaling/OWNERS b/vendor/k8s.io/api/autoscaling/OWNERS index 76dffeceb..4a495ec25 100755 --- a/vendor/k8s.io/api/autoscaling/OWNERS +++ b/vendor/k8s.io/api/autoscaling/OWNERS @@ -8,7 +8,6 @@ reviewers: - erictune - sttts - ncdc -- timothysc - piosz - dims - errordeveloper diff --git a/vendor/k8s.io/api/autoscaling/v1/generated.pb.go b/vendor/k8s.io/api/autoscaling/v1/generated.pb.go index 4c6a17127..9e2b235eb 100644 --- a/vendor/k8s.io/api/autoscaling/v1/generated.pb.go +++ b/vendor/k8s.io/api/autoscaling/v1/generated.pb.go @@ -26,6 +26,8 @@ limitations under the License. It has these top-level messages: CrossVersionObjectReference + ExternalMetricSource + ExternalMetricStatus HorizontalPodAutoscaler HorizontalPodAutoscalerCondition HorizontalPodAutoscalerList @@ -76,80 +78,90 @@ func (*CrossVersionObjectReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } +func (m *ExternalMetricSource) Reset() { *m = ExternalMetricSource{} } +func (*ExternalMetricSource) ProtoMessage() {} +func (*ExternalMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } + +func (m *ExternalMetricStatus) Reset() { *m = ExternalMetricStatus{} } +func (*ExternalMetricStatus) ProtoMessage() {} +func (*ExternalMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } + func (m *HorizontalPodAutoscaler) Reset() { *m = HorizontalPodAutoscaler{} } func (*HorizontalPodAutoscaler) ProtoMessage() {} -func (*HorizontalPodAutoscaler) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } +func (*HorizontalPodAutoscaler) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } func (m *HorizontalPodAutoscalerCondition) Reset() { *m = HorizontalPodAutoscalerCondition{} } func (*HorizontalPodAutoscalerCondition) ProtoMessage() {} func (*HorizontalPodAutoscalerCondition) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{2} + return fileDescriptorGenerated, []int{4} } func (m *HorizontalPodAutoscalerList) Reset() { *m = HorizontalPodAutoscalerList{} } func (*HorizontalPodAutoscalerList) ProtoMessage() {} func (*HorizontalPodAutoscalerList) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{3} + return fileDescriptorGenerated, []int{5} } func (m *HorizontalPodAutoscalerSpec) Reset() { *m = HorizontalPodAutoscalerSpec{} } func (*HorizontalPodAutoscalerSpec) ProtoMessage() {} func (*HorizontalPodAutoscalerSpec) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{4} + return fileDescriptorGenerated, []int{6} } func (m *HorizontalPodAutoscalerStatus) Reset() { *m = HorizontalPodAutoscalerStatus{} } func (*HorizontalPodAutoscalerStatus) ProtoMessage() {} func (*HorizontalPodAutoscalerStatus) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{5} + return fileDescriptorGenerated, []int{7} } func (m *MetricSpec) Reset() { *m = MetricSpec{} } func (*MetricSpec) ProtoMessage() {} -func (*MetricSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} } +func (*MetricSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} } func (m *MetricStatus) Reset() { *m = MetricStatus{} } func (*MetricStatus) ProtoMessage() {} -func (*MetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} } +func (*MetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{9} } func (m *ObjectMetricSource) Reset() { *m = ObjectMetricSource{} } func (*ObjectMetricSource) ProtoMessage() {} -func (*ObjectMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} } +func (*ObjectMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{10} } func (m *ObjectMetricStatus) Reset() { *m = ObjectMetricStatus{} } func (*ObjectMetricStatus) ProtoMessage() {} -func (*ObjectMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{9} } +func (*ObjectMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} } func (m *PodsMetricSource) Reset() { *m = PodsMetricSource{} } func (*PodsMetricSource) ProtoMessage() {} -func (*PodsMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{10} } +func (*PodsMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} } func (m *PodsMetricStatus) Reset() { *m = PodsMetricStatus{} } func (*PodsMetricStatus) ProtoMessage() {} -func (*PodsMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} } +func (*PodsMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{13} } func (m *ResourceMetricSource) Reset() { *m = ResourceMetricSource{} } func (*ResourceMetricSource) ProtoMessage() {} -func (*ResourceMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} } +func (*ResourceMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{14} } func (m *ResourceMetricStatus) Reset() { *m = ResourceMetricStatus{} } func (*ResourceMetricStatus) ProtoMessage() {} -func (*ResourceMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{13} } +func (*ResourceMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{15} } func (m *Scale) Reset() { *m = Scale{} } func (*Scale) ProtoMessage() {} -func (*Scale) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{14} } +func (*Scale) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{16} } func (m *ScaleSpec) Reset() { *m = ScaleSpec{} } func (*ScaleSpec) ProtoMessage() {} -func (*ScaleSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{15} } +func (*ScaleSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{17} } func (m *ScaleStatus) Reset() { *m = ScaleStatus{} } func (*ScaleStatus) ProtoMessage() {} -func (*ScaleStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{16} } +func (*ScaleStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{18} } func init() { proto.RegisterType((*CrossVersionObjectReference)(nil), "k8s.io.api.autoscaling.v1.CrossVersionObjectReference") + proto.RegisterType((*ExternalMetricSource)(nil), "k8s.io.api.autoscaling.v1.ExternalMetricSource") + proto.RegisterType((*ExternalMetricStatus)(nil), "k8s.io.api.autoscaling.v1.ExternalMetricStatus") proto.RegisterType((*HorizontalPodAutoscaler)(nil), "k8s.io.api.autoscaling.v1.HorizontalPodAutoscaler") proto.RegisterType((*HorizontalPodAutoscalerCondition)(nil), "k8s.io.api.autoscaling.v1.HorizontalPodAutoscalerCondition") proto.RegisterType((*HorizontalPodAutoscalerList)(nil), "k8s.io.api.autoscaling.v1.HorizontalPodAutoscalerList") @@ -197,6 +209,108 @@ func (m *CrossVersionObjectReference) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ExternalMetricSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExternalMetricSource) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricName))) + i += copy(dAtA[i:], m.MetricName) + if m.MetricSelector != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.MetricSelector.Size())) + n1, err := m.MetricSelector.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if m.TargetValue != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.TargetValue.Size())) + n2, err := m.TargetValue.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } + if m.TargetAverageValue != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.TargetAverageValue.Size())) + n3, err := m.TargetAverageValue.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 + } + return i, nil +} + +func (m *ExternalMetricStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExternalMetricStatus) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricName))) + i += copy(dAtA[i:], m.MetricName) + if m.MetricSelector != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.MetricSelector.Size())) + n4, err := m.MetricSelector.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 + } + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentValue.Size())) + n5, err := m.CurrentValue.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 + if m.CurrentAverageValue != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentAverageValue.Size())) + n6, err := m.CurrentAverageValue.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n6 + } + return i, nil +} + func (m *HorizontalPodAutoscaler) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -215,27 +329,27 @@ func (m *HorizontalPodAutoscaler) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n1, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n7, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n1 + i += n7 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n2, err := m.Spec.MarshalTo(dAtA[i:]) + n8, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n2 + i += n8 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n3, err := m.Status.MarshalTo(dAtA[i:]) + n9, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n3 + i += n9 return i, nil } @@ -265,11 +379,11 @@ func (m *HorizontalPodAutoscalerCondition) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastTransitionTime.Size())) - n4, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) + n10, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n4 + i += n10 dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) @@ -299,11 +413,11 @@ func (m *HorizontalPodAutoscalerList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n5, err := m.ListMeta.MarshalTo(dAtA[i:]) + n11, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n5 + i += n11 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -337,11 +451,11 @@ func (m *HorizontalPodAutoscalerSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ScaleTargetRef.Size())) - n6, err := m.ScaleTargetRef.MarshalTo(dAtA[i:]) + n12, err := m.ScaleTargetRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n6 + i += n12 if m.MinReplicas != nil { dAtA[i] = 0x10 i++ @@ -382,11 +496,11 @@ func (m *HorizontalPodAutoscalerStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastScaleTime.Size())) - n7, err := m.LastScaleTime.MarshalTo(dAtA[i:]) + n13, err := m.LastScaleTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n7 + i += n13 } dAtA[i] = 0x18 i++ @@ -425,31 +539,41 @@ func (m *MetricSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Object.Size())) - n8, err := m.Object.MarshalTo(dAtA[i:]) + n14, err := m.Object.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n8 + i += n14 } if m.Pods != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Pods.Size())) - n9, err := m.Pods.MarshalTo(dAtA[i:]) + n15, err := m.Pods.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n15 } if m.Resource != nil { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Resource.Size())) - n10, err := m.Resource.MarshalTo(dAtA[i:]) + n16, err := m.Resource.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n16 + } + if m.External != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.External.Size())) + n17, err := m.External.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n10 + i += n17 } return i, nil } @@ -477,31 +601,41 @@ func (m *MetricStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Object.Size())) - n11, err := m.Object.MarshalTo(dAtA[i:]) + n18, err := m.Object.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n11 + i += n18 } if m.Pods != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Pods.Size())) - n12, err := m.Pods.MarshalTo(dAtA[i:]) + n19, err := m.Pods.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n12 + i += n19 } if m.Resource != nil { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Resource.Size())) - n13, err := m.Resource.MarshalTo(dAtA[i:]) + n20, err := m.Resource.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n13 + i += n20 + } + if m.External != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.External.Size())) + n21, err := m.External.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n21 } return i, nil } @@ -524,11 +658,11 @@ func (m *ObjectMetricSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Target.Size())) - n14, err := m.Target.MarshalTo(dAtA[i:]) + n22, err := m.Target.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n14 + i += n22 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricName))) @@ -536,11 +670,11 @@ func (m *ObjectMetricSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.TargetValue.Size())) - n15, err := m.TargetValue.MarshalTo(dAtA[i:]) + n23, err := m.TargetValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n15 + i += n23 return i, nil } @@ -562,11 +696,11 @@ func (m *ObjectMetricStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Target.Size())) - n16, err := m.Target.MarshalTo(dAtA[i:]) + n24, err := m.Target.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n16 + i += n24 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricName))) @@ -574,11 +708,11 @@ func (m *ObjectMetricStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentValue.Size())) - n17, err := m.CurrentValue.MarshalTo(dAtA[i:]) + n25, err := m.CurrentValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n17 + i += n25 return i, nil } @@ -604,11 +738,11 @@ func (m *PodsMetricSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.TargetAverageValue.Size())) - n18, err := m.TargetAverageValue.MarshalTo(dAtA[i:]) + n26, err := m.TargetAverageValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n18 + i += n26 return i, nil } @@ -634,11 +768,11 @@ func (m *PodsMetricStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentAverageValue.Size())) - n19, err := m.CurrentAverageValue.MarshalTo(dAtA[i:]) + n27, err := m.CurrentAverageValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n19 + i += n27 return i, nil } @@ -670,11 +804,11 @@ func (m *ResourceMetricSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.TargetAverageValue.Size())) - n20, err := m.TargetAverageValue.MarshalTo(dAtA[i:]) + n28, err := m.TargetAverageValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n20 + i += n28 } return i, nil } @@ -706,11 +840,11 @@ func (m *ResourceMetricStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentAverageValue.Size())) - n21, err := m.CurrentAverageValue.MarshalTo(dAtA[i:]) + n29, err := m.CurrentAverageValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n21 + i += n29 return i, nil } @@ -732,27 +866,27 @@ func (m *Scale) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n22, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n30, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n22 + i += n30 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n23, err := m.Spec.MarshalTo(dAtA[i:]) + n31, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n23 + i += n31 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n24, err := m.Status.MarshalTo(dAtA[i:]) + n32, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n24 + i += n32 return i, nil } @@ -841,6 +975,44 @@ func (m *CrossVersionObjectReference) Size() (n int) { return n } +func (m *ExternalMetricSource) Size() (n int) { + var l int + _ = l + l = len(m.MetricName) + n += 1 + l + sovGenerated(uint64(l)) + if m.MetricSelector != nil { + l = m.MetricSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TargetValue != nil { + l = m.TargetValue.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TargetAverageValue != nil { + l = m.TargetAverageValue.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *ExternalMetricStatus) Size() (n int) { + var l int + _ = l + l = len(m.MetricName) + n += 1 + l + sovGenerated(uint64(l)) + if m.MetricSelector != nil { + l = m.MetricSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = m.CurrentValue.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.CurrentAverageValue != nil { + l = m.CurrentAverageValue.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *HorizontalPodAutoscaler) Size() (n int) { var l int _ = l @@ -933,6 +1105,10 @@ func (m *MetricSpec) Size() (n int) { l = m.Resource.Size() n += 1 + l + sovGenerated(uint64(l)) } + if m.External != nil { + l = m.External.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -953,6 +1129,10 @@ func (m *MetricStatus) Size() (n int) { l = m.Resource.Size() n += 1 + l + sovGenerated(uint64(l)) } + if m.External != nil { + l = m.External.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -1081,6 +1261,32 @@ func (this *CrossVersionObjectReference) String() string { }, "") return s } +func (this *ExternalMetricSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ExternalMetricSource{`, + `MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`, + `MetricSelector:` + strings.Replace(fmt.Sprintf("%v", this.MetricSelector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`, + `TargetValue:` + strings.Replace(fmt.Sprintf("%v", this.TargetValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`, + `TargetAverageValue:` + strings.Replace(fmt.Sprintf("%v", this.TargetAverageValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *ExternalMetricStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ExternalMetricStatus{`, + `MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`, + `MetricSelector:` + strings.Replace(fmt.Sprintf("%v", this.MetricSelector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`, + `CurrentValue:` + strings.Replace(strings.Replace(this.CurrentValue.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`, + `CurrentAverageValue:` + strings.Replace(fmt.Sprintf("%v", this.CurrentAverageValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} func (this *HorizontalPodAutoscaler) String() string { if this == nil { return "nil" @@ -1154,6 +1360,7 @@ func (this *MetricSpec) String() string { `Object:` + strings.Replace(fmt.Sprintf("%v", this.Object), "ObjectMetricSource", "ObjectMetricSource", 1) + `,`, `Pods:` + strings.Replace(fmt.Sprintf("%v", this.Pods), "PodsMetricSource", "PodsMetricSource", 1) + `,`, `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "ResourceMetricSource", "ResourceMetricSource", 1) + `,`, + `External:` + strings.Replace(fmt.Sprintf("%v", this.External), "ExternalMetricSource", "ExternalMetricSource", 1) + `,`, `}`, }, "") return s @@ -1167,6 +1374,7 @@ func (this *MetricStatus) String() string { `Object:` + strings.Replace(fmt.Sprintf("%v", this.Object), "ObjectMetricStatus", "ObjectMetricStatus", 1) + `,`, `Pods:` + strings.Replace(fmt.Sprintf("%v", this.Pods), "PodsMetricStatus", "PodsMetricStatus", 1) + `,`, `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "ResourceMetricStatus", "ResourceMetricStatus", 1) + `,`, + `External:` + strings.Replace(fmt.Sprintf("%v", this.External), "ExternalMetricStatus", "ExternalMetricStatus", 1) + `,`, `}`, }, "") return s @@ -1419,7 +1627,7 @@ func (m *CrossVersionObjectReference) Unmarshal(dAtA []byte) error { } return nil } -func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { +func (m *ExternalMetricSource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1442,15 +1650,44 @@ func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HorizontalPodAutoscaler: wiretype end group for non-group") + return fmt.Errorf("proto: ExternalMetricSource: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HorizontalPodAutoscaler: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExternalMetricSource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MetricName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MetricName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetricSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1474,13 +1711,16 @@ func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.MetricSelector == nil { + m.MetricSelector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{} + } + if err := m.MetricSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TargetValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1504,13 +1744,16 @@ func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.TargetValue == nil { + m.TargetValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{} + } + if err := m.TargetValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TargetAverageValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1534,7 +1777,10 @@ func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.TargetAverageValue == nil { + m.TargetAverageValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{} + } + if err := m.TargetAverageValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1559,7 +1805,7 @@ func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { } return nil } -func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { +func (m *ExternalMetricStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1582,15 +1828,15 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HorizontalPodAutoscalerCondition: wiretype end group for non-group") + return fmt.Errorf("proto: ExternalMetricStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HorizontalPodAutoscalerCondition: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExternalMetricStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MetricName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1615,13 +1861,13 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = HorizontalPodAutoscalerConditionType(dAtA[iNdEx:postIndex]) + m.MetricName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MetricSelector", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1631,24 +1877,28 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex]) + if m.MetricSelector == nil { + m.MetricSelector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{} + } + if err := m.MetricSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CurrentValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1672,15 +1922,15 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CurrentValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CurrentAverageValue", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1690,24 +1940,335 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Reason = string(dAtA[iNdEx:postIndex]) + if m.CurrentAverageValue == nil { + m.CurrentAverageValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{} + } + if err := m.CurrentAverageValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HorizontalPodAutoscaler: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HorizontalPodAutoscaler: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HorizontalPodAutoscalerCondition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HorizontalPodAutoscalerCondition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = HorizontalPodAutoscalerConditionType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2323,6 +2884,39 @@ func (m *MetricSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field External", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.External == nil { + m.External = &ExternalMetricSource{} + } + if err := m.External.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2501,6 +3095,39 @@ func (m *MetricStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field External", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.External == nil { + m.External = &ExternalMetricStatus{} + } + if err := m.External.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -3696,91 +4323,98 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 1370 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4d, 0x6f, 0x13, 0xc7, - 0x1b, 0x8f, 0x5f, 0x12, 0xc2, 0x38, 0x10, 0xfe, 0x03, 0x02, 0x13, 0xfe, 0x78, 0xa3, 0x2d, 0x42, - 0xf4, 0x85, 0xdd, 0xc6, 0xa5, 0x88, 0x1e, 0x63, 0x57, 0x14, 0xd4, 0x04, 0xc2, 0x60, 0x28, 0x7d, - 0x51, 0xc5, 0x64, 0x77, 0x70, 0x86, 0x78, 0x5f, 0x34, 0x33, 0xb6, 0x1a, 0xa4, 0x4a, 0xed, 0xa1, - 0xe7, 0x56, 0x95, 0xfa, 0x31, 0x7a, 0xe6, 0x50, 0xf5, 0xd0, 0x4a, 0x95, 0x38, 0x72, 0xe8, 0x81, - 0x93, 0x55, 0xb6, 0xc7, 0x7e, 0x03, 0x4e, 0xd5, 0xcc, 0x8e, 0xd7, 0xbb, 0xb6, 0xd7, 0x21, 0x21, - 0x42, 0xbd, 0xed, 0xce, 0xfc, 0x9e, 0xdf, 0xf3, 0x3a, 0xcf, 0x3c, 0x03, 0x1a, 0xdb, 0x57, 0xb8, - 0x45, 0x03, 0x7b, 0xbb, 0xbb, 0x49, 0x98, 0x4f, 0x04, 0xe1, 0x76, 0x8f, 0xf8, 0x6e, 0xc0, 0x6c, - 0xbd, 0x81, 0x43, 0x6a, 0xe3, 0xae, 0x08, 0xb8, 0x83, 0x3b, 0xd4, 0x6f, 0xdb, 0xbd, 0x15, 0xbb, - 0x4d, 0x7c, 0xc2, 0xb0, 0x20, 0xae, 0x15, 0xb2, 0x40, 0x04, 0xf0, 0x74, 0x0c, 0xb5, 0x70, 0x48, - 0xad, 0x14, 0xd4, 0xea, 0xad, 0x2c, 0x5d, 0x6c, 0x53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0x16, - 0x30, 0xfa, 0x28, 0xf0, 0x05, 0xee, 0x6c, 0x04, 0xee, 0xaa, 0x2e, 0x0a, 0xc2, 0xe0, 0x7d, 0x30, - 0x2f, 0x83, 0xed, 0x62, 0x81, 0x95, 0x5d, 0x95, 0xfa, 0xbb, 0xd6, 0xb0, 0x7c, 0x12, 0xdf, 0xad, - 0x70, 0xbb, 0x2d, 0x17, 0xb8, 0x25, 0xd1, 0x56, 0x6f, 0xc5, 0x8a, 0x9d, 0x5b, 0x27, 0x02, 0x0f, - 0xf5, 0x0f, 0xd7, 0x50, 0xc2, 0x0a, 0xef, 0x81, 0x32, 0x0f, 0x89, 0xa3, 0x7c, 0xaa, 0xd4, 0x2f, - 0x5b, 0xb9, 0xc5, 0x69, 0xe5, 0xd8, 0x78, 0x3b, 0x24, 0xce, 0x30, 0x16, 0xf2, 0x0f, 0x29, 0x46, - 0x78, 0x1f, 0xcc, 0x71, 0x81, 0x45, 0x97, 0xab, 0x38, 0x54, 0xea, 0x57, 0xf6, 0xc1, 0xad, 0xe4, - 0x1b, 0x47, 0x35, 0xfb, 0x5c, 0xfc, 0x8f, 0x34, 0xaf, 0xf9, 0x5d, 0x09, 0x2c, 0xe7, 0x48, 0x36, - 0x03, 0xdf, 0xa5, 0x82, 0x06, 0x3e, 0xbc, 0x06, 0xca, 0x62, 0x27, 0x24, 0x3a, 0xad, 0x97, 0x06, - 0x86, 0xb6, 0x76, 0x42, 0xf2, 0xa2, 0x6f, 0x9c, 0xdb, 0x4d, 0x5e, 0xe2, 0x90, 0x62, 0x80, 0x6b, - 0x89, 0x43, 0xc5, 0x0c, 0x97, 0x36, 0xeb, 0x45, 0xdf, 0x98, 0x70, 0x20, 0xad, 0x84, 0x29, 0x6b, - 0x3c, 0xec, 0x01, 0xd8, 0xc1, 0x5c, 0xb4, 0x18, 0xf6, 0x79, 0xac, 0x89, 0x7a, 0x44, 0x87, 0xea, - 0xad, 0x97, 0x4b, 0xb2, 0x94, 0x68, 0x2c, 0x69, 0x2b, 0xe0, 0xda, 0x18, 0x1b, 0x9a, 0xa0, 0x01, - 0x9e, 0x07, 0x73, 0x8c, 0x60, 0x1e, 0xf8, 0xd5, 0xb2, 0xf2, 0x22, 0x09, 0x2e, 0x52, 0xab, 0x48, - 0xef, 0xc2, 0x37, 0xc1, 0x21, 0x8f, 0x70, 0x8e, 0xdb, 0xa4, 0x3a, 0xab, 0x80, 0x8b, 0x1a, 0x78, - 0x68, 0x3d, 0x5e, 0x46, 0x83, 0x7d, 0xf3, 0xcf, 0x02, 0x38, 0x93, 0x13, 0xc7, 0x35, 0xca, 0x05, - 0xfc, 0x62, 0xac, 0x8a, 0xad, 0x97, 0x73, 0x50, 0x4a, 0xab, 0x1a, 0x3e, 0xa6, 0x75, 0xcf, 0x0f, - 0x56, 0x52, 0x15, 0xfc, 0x09, 0x98, 0xa5, 0x82, 0x78, 0x32, 0x2b, 0xa5, 0x0b, 0x95, 0x7a, 0x7d, - 0xef, 0x65, 0xd6, 0x38, 0xa2, 0xe9, 0x67, 0xaf, 0x4b, 0x22, 0x14, 0xf3, 0x99, 0xff, 0x14, 0x73, - 0xdd, 0x92, 0x65, 0x0e, 0x7b, 0xe0, 0xa8, 0xfa, 0x6b, 0x61, 0xd6, 0x26, 0xb2, 0x91, 0x68, 0xe7, - 0xa6, 0x1d, 0xa2, 0x29, 0x0d, 0xa8, 0x71, 0x52, 0x5b, 0x71, 0xf4, 0x76, 0x86, 0x15, 0x8d, 0x68, - 0x81, 0x2b, 0xa0, 0xe2, 0x51, 0x1f, 0x91, 0xb0, 0x43, 0x1d, 0x1c, 0x17, 0xe3, 0x6c, 0x63, 0x31, - 0xea, 0x1b, 0x95, 0xf5, 0xe1, 0x32, 0x4a, 0x63, 0xe0, 0xfb, 0xa0, 0xe2, 0xe1, 0xaf, 0x12, 0x91, - 0x92, 0x12, 0x39, 0xae, 0xf5, 0x55, 0xd6, 0x87, 0x5b, 0x28, 0x8d, 0x83, 0x0f, 0x41, 0x4d, 0x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- 0xf9, 0x5d, 0x99, 0xa6, 0x3f, 0x98, 0x3f, 0x00, 0x87, 0x13, 0x85, 0xf0, 0x1d, 0x79, 0x13, 0xeb, - 0xb9, 0xb2, 0xa0, 0x72, 0x9b, 0xbc, 0xb2, 0x92, 0x81, 0x32, 0x41, 0x98, 0x14, 0x54, 0x52, 0x1a, - 0xf6, 0x26, 0x2c, 0xd1, 0x9c, 0x74, 0x88, 0x23, 0x02, 0xa6, 0xaf, 0x83, 0x04, 0x7d, 0x5b, 0xaf, - 0xa3, 0x04, 0xd1, 0xb8, 0xf0, 0xe4, 0x79, 0x6d, 0xe6, 0xe9, 0xf3, 0xda, 0xcc, 0xb3, 0xe7, 0xb5, - 0x99, 0x6f, 0xa2, 0x5a, 0xe1, 0x49, 0x54, 0x2b, 0x3c, 0x8d, 0x6a, 0x85, 0x67, 0x51, 0xad, 0xf0, - 0x57, 0x54, 0x2b, 0xfc, 0xf0, 0x77, 0x6d, 0xe6, 0xb3, 0x62, 0x6f, 0xe5, 0xdf, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x45, 0xeb, 0xd1, 0x70, 0x8f, 0x13, 0x00, 0x00, + // 1485 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcb, 0x6f, 0x14, 0x47, + 0x13, 0xf7, 0x3e, 0x6c, 0xec, 0x5e, 0x63, 0xf3, 0x35, 0x08, 0x8c, 0xf9, 0xd8, 0xb1, 0xe6, 0x43, + 0x88, 0x2f, 0x09, 0x33, 0xb1, 0x21, 0x88, 0x1c, 0xbd, 0x9b, 0x10, 0x50, 0xbc, 0x60, 0xda, 0x86, + 0x90, 0x87, 0x22, 0xda, 0xb3, 0xcd, 0xba, 0xf1, 0xce, 0xcc, 0xaa, 0xa7, 0x77, 0x85, 0x91, 0x22, + 0x25, 0x87, 0x9c, 0x13, 0x45, 0x4a, 0x94, 0x63, 0xfe, 0x81,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 0x0f, 0xb3, 0xca, 0x51, 0x0d, 0x3f, 0x7e, 0x43, 0x00, + 0x21, 0x85, 0x67, 0xfe, 0x95, 0xcf, 0x3c, 0x96, 0x08, 0x73, 0xd8, 0x01, 0x33, 0x72, 0xa5, 0x52, + 0x31, 0x22, 0x0f, 0xf4, 0xe1, 0x46, 0x5d, 0xa2, 0x11, 0xc5, 0xbb, 0x72, 0x52, 0xef, 0x62, 0x66, + 0x2d, 0x85, 0x8a, 0xfa, 0xb4, 0xc0, 0x45, 0x50, 0x72, 0xa9, 0x87, 0x48, 0xab, 0x49, 0x1d, 0xac, + 0x82, 0x71, 0x5c, 0x95, 0x9f, 0x5a, 0xef, 0x37, 0x4a, 0xf2, 0xc0, 0x77, 0x40, 0xc9, 0xc5, 0x8f, + 0x62, 0x91, 0x82, 0x14, 0x39, 0xae, 0xf5, 0x95, 0x6a, 0x3d, 0x12, 0x4a, 0xf2, 0xc1, 0x87, 0xa0, + 0xac, 0x6a, 0x4a, 0x75, 0xf5, 0xce, 0x1d, 0x4e, 0x9b, 0xf4, 0x31, 0x16, 0x71, 0xb4, 0x4a, 0x98, + 0x43, 0x3c, 0x2e, 0x42, 0xa3, 0x28, 0x91, 0xcc, 0x28, 0x34, 0xca, 0xeb, 0x23, 0x39, 0xd1, 0x0e, + 0x48, 0xe6, 0x2f, 0x05, 0x70, 0x76, 0x64, 0x1a, 0x80, 0xd7, 0x00, 0xf4, 0x37, 0x02, 0xc2, 0x3a, + 0xa4, 0xfe, 0x81, 0xea, 0x8b, 0x44, 0x83, 0x22, 0x6c, 0x5e, 0x50, 0x35, 0xf1, 0xd6, 0x00, 0x15, + 0x0d, 0x91, 0x80, 0x0e, 0x38, 0x2a, 0xee, 0x85, 0xb2, 0x32, 0xd5, 0xbd, 0xd0, 0xde, 0x2e, 0xdd, + 0x7f, 0xa2, 0xd0, 0x38, 0xba, 0x92, 0x04, 0x41, 0x69, 0x4c, 0xb8, 0x0c, 0x66, 0x75, 0xb2, 0xef, + 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 0xa4, 0x7d, 0x95, 0x07, 0xe3, + 0xb2, 0xa9, 0x3c, 0x84, 0xa7, 0x80, 0x6b, 0xa9, 0xa7, 0x80, 0x73, 0x23, 0xd2, 0xab, 0xdc, 0x51, + 0xe6, 0xe0, 0x7f, 0xb3, 0x6f, 0xf0, 0x3f, 0xbf, 0x23, 0xd2, 0xe8, 0x31, 0xff, 0x5d, 0x30, 0x15, + 0x2b, 0x84, 0x6f, 0x89, 0x22, 0xaf, 0xbb, 0xe1, 0x9c, 0xf4, 0x6d, 0x3c, 0x1b, 0xc6, 0x6d, 0x70, + 0xcc, 0x61, 0x52, 0x50, 0x4a, 0x68, 0xd8, 0x9b, 0xb0, 0xe0, 0x0e, 0x92, 0x0f, 0x5d, 0x53, 0x3d, + 0xee, 0xf8, 0xc5, 0x2a, 0xe6, 0xa8, 0x5c, 0x78, 0xfa, 0xa2, 0x3c, 0xf6, 0xec, 0x45, 0x79, 0xec, + 0xf9, 0x8b, 0xf2, 0xd8, 0x97, 0x51, 0x39, 0xf7, 0x34, 0x2a, 0xe7, 0x9e, 0x45, 0xe5, 0xdc, 0xf3, + 0xa8, 0x9c, 0xfb, 0x23, 0x2a, 0xe7, 0xbe, 0xfd, 0xb3, 0x3c, 0xf6, 0x49, 0xbe, 0xb3, 0xf8, 0x77, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x61, 0x55, 0xfd, 0xeb, 0x81, 0x17, 0x00, 0x00, } diff --git a/vendor/k8s.io/api/autoscaling/v1/generated.proto b/vendor/k8s.io/api/autoscaling/v1/generated.proto index aa752a806..64f01f477 100644 --- a/vendor/k8s.io/api/autoscaling/v1/generated.proto +++ b/vendor/k8s.io/api/autoscaling/v1/generated.proto @@ -44,6 +44,49 @@ message CrossVersionObjectReference { optional string apiVersion = 3; } +// ExternalMetricSource indicates how to scale on a metric not associated with +// any Kubernetes object (for example length of queue in cloud +// messaging service, or QPS from loadbalancer running outside of cluster). +message ExternalMetricSource { + // metricName is the name of the metric in question. + optional string metricName = 1; + + // metricSelector is used to identify a specific time series + // within a given metric. + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2; + + // targetValue is the target value of the metric (as a quantity). + // Mutually exclusive with TargetAverageValue. + // +optional + optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3; + + // targetAverageValue is the target per-pod value of global metric (as a quantity). + // Mutually exclusive with TargetValue. + // +optional + optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4; +} + +// ExternalMetricStatus indicates the current value of a global metric +// not associated with any Kubernetes object. +message ExternalMetricStatus { + // metricName is the name of a metric used for autoscaling in + // metric system. + optional string metricName = 1; + + // metricSelector is used to identify a specific time series + // within a given metric. + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2; + + // currentValue is the current value of the metric (as a quantity) + optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3; + + // currentAverageValue is the current value of metric averaged over autoscaled pods. + // +optional + optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4; +} + // configuration of a horizontal pod autoscaler. message HorizontalPodAutoscaler { // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata @@ -138,7 +181,8 @@ message HorizontalPodAutoscalerStatus { // MetricSpec specifies how to scale based on a single metric // (only `type` and one other matching field should be set at once). message MetricSpec { - // type is the type of metric source. It should match one of the fields below. + // type is the type of metric source. It should be one of "Object", + // "Pods" or "Resource", each mapping to a matching field in the object. optional string type = 1; // object refers to a metric describing a single kubernetes object @@ -159,11 +203,20 @@ message MetricSpec { // to normal per-pod metrics using the "pods" source. // +optional optional ResourceMetricSource resource = 4; + + // external refers to a global metric that is not associated + // with any Kubernetes object. It allows autoscaling based on information + // coming from components running outside of cluster + // (for example length of queue in cloud messaging service, or + // QPS from loadbalancer running outside of cluster). + // +optional + optional ExternalMetricSource external = 5; } // MetricStatus describes the last-read state of a single metric. message MetricStatus { - // type is the type of metric source. It will match one of the fields below. + // type is the type of metric source. It will be one of "Object", + // "Pods" or "Resource", each corresponds to a matching field in the object. optional string type = 1; // object refers to a metric describing a single kubernetes object @@ -184,6 +237,14 @@ message MetricStatus { // to normal per-pod metrics using the "pods" source. // +optional optional ResourceMetricStatus resource = 4; + + // external refers to a global metric that is not associated + // with any Kubernetes object. It allows autoscaling based on information + // coming from components running outside of cluster + // (for example length of queue in cloud messaging service, or + // QPS from loadbalancer running outside of cluster). + // +optional + optional ExternalMetricStatus external = 5; } // ObjectMetricSource indicates how to scale on a metric describing a diff --git a/vendor/k8s.io/api/autoscaling/v1/types.go b/vendor/k8s.io/api/autoscaling/v1/types.go index e726c1403..344af774f 100644 --- a/vendor/k8s.io/api/autoscaling/v1/types.go +++ b/vendor/k8s.io/api/autoscaling/v1/types.go @@ -161,12 +161,19 @@ var ( // Kubernetes, and have special scaling options on top of those available // to normal per-pod metrics (the "pods" source). ResourceMetricSourceType MetricSourceType = "Resource" + // ExternalMetricSourceType is a global metric that is not associated + // with any Kubernetes object. It allows autoscaling based on information + // coming from components running outside of cluster + // (for example length of queue in cloud messaging service, or + // QPS from loadbalancer running outside of cluster). + ExternalMetricSourceType MetricSourceType = "External" ) // MetricSpec specifies how to scale based on a single metric // (only `type` and one other matching field should be set at once). type MetricSpec struct { - // type is the type of metric source. It should match one of the fields below. + // type is the type of metric source. It should be one of "Object", + // "Pods" or "Resource", each mapping to a matching field in the object. Type MetricSourceType `json:"type" protobuf:"bytes,1,name=type"` // object refers to a metric describing a single kubernetes object @@ -185,6 +192,13 @@ type MetricSpec struct { // to normal per-pod metrics using the "pods" source. // +optional Resource *ResourceMetricSource `json:"resource,omitempty" protobuf:"bytes,4,opt,name=resource"` + // external refers to a global metric that is not associated + // with any Kubernetes object. It allows autoscaling based on information + // coming from components running outside of cluster + // (for example length of queue in cloud messaging service, or + // QPS from loadbalancer running outside of cluster). + // +optional + External *ExternalMetricSource `json:"external,omitempty" protobuf:"bytes,5,opt,name=external"` } // ObjectMetricSource indicates how to scale on a metric describing a @@ -233,9 +247,30 @@ type ResourceMetricSource struct { TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty" protobuf:"bytes,3,opt,name=targetAverageValue"` } +// ExternalMetricSource indicates how to scale on a metric not associated with +// any Kubernetes object (for example length of queue in cloud +// messaging service, or QPS from loadbalancer running outside of cluster). +type ExternalMetricSource struct { + // metricName is the name of the metric in question. + MetricName string `json:"metricName" protobuf:"bytes,1,name=metricName"` + // metricSelector is used to identify a specific time series + // within a given metric. + // +optional + MetricSelector *metav1.LabelSelector `json:"metricSelector,omitempty" protobuf:"bytes,2,opt,name=metricSelector"` + // targetValue is the target value of the metric (as a quantity). + // Mutually exclusive with TargetAverageValue. + // +optional + TargetValue *resource.Quantity `json:"targetValue,omitempty" protobuf:"bytes,3,opt,name=targetValue"` + // targetAverageValue is the target per-pod value of global metric (as a quantity). + // Mutually exclusive with TargetValue. + // +optional + TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty" protobuf:"bytes,4,opt,name=targetAverageValue"` +} + // MetricStatus describes the last-read state of a single metric. type MetricStatus struct { - // type is the type of metric source. It will match one of the fields below. + // type is the type of metric source. It will be one of "Object", + // "Pods" or "Resource", each corresponds to a matching field in the object. Type MetricSourceType `json:"type" protobuf:"bytes,1,name=type"` // object refers to a metric describing a single kubernetes object @@ -254,6 +289,13 @@ type MetricStatus struct { // to normal per-pod metrics using the "pods" source. // +optional Resource *ResourceMetricStatus `json:"resource,omitempty" protobuf:"bytes,4,opt,name=resource"` + // external refers to a global metric that is not associated + // with any Kubernetes object. It allows autoscaling based on information + // coming from components running outside of cluster + // (for example length of queue in cloud messaging service, or + // QPS from loadbalancer running outside of cluster). + // +optional + External *ExternalMetricStatus `json:"external,omitempty" protobuf:"bytes,5,opt,name=external"` } // HorizontalPodAutoscalerConditionType are the valid conditions of @@ -335,3 +377,20 @@ type ResourceMetricStatus struct { // It will always be set, regardless of the corresponding metric specification. CurrentAverageValue resource.Quantity `json:"currentAverageValue" protobuf:"bytes,3,name=currentAverageValue"` } + +// ExternalMetricStatus indicates the current value of a global metric +// not associated with any Kubernetes object. +type ExternalMetricStatus struct { + // metricName is the name of a metric used for autoscaling in + // metric system. + MetricName string `json:"metricName" protobuf:"bytes,1,name=metricName"` + // metricSelector is used to identify a specific time series + // within a given metric. + // +optional + MetricSelector *metav1.LabelSelector `json:"metricSelector,omitempty" protobuf:"bytes,2,opt,name=metricSelector"` + // currentValue is the current value of the metric (as a quantity) + CurrentValue resource.Quantity `json:"currentValue" protobuf:"bytes,3,name=currentValue"` + // currentAverageValue is the current value of metric averaged over autoscaled pods. + // +optional + CurrentAverageValue *resource.Quantity `json:"currentAverageValue,omitempty" protobuf:"bytes,4,opt,name=currentAverageValue"` +} diff --git a/vendor/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go index 7f84c2d93..ec364f53e 100644 --- a/vendor/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go @@ -38,6 +38,30 @@ func (CrossVersionObjectReference) SwaggerDoc() map[string]string { return map_CrossVersionObjectReference } +var map_ExternalMetricSource = map[string]string{ + "": "ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).", + "metricName": "metricName is the name of the metric in question.", + "metricSelector": "metricSelector is used to identify a specific time series within a given metric.", + "targetValue": "targetValue is the target value of the metric (as a quantity). Mutually exclusive with TargetAverageValue.", + "targetAverageValue": "targetAverageValue is the target per-pod value of global metric (as a quantity). Mutually exclusive with TargetValue.", +} + +func (ExternalMetricSource) SwaggerDoc() map[string]string { + return map_ExternalMetricSource +} + +var map_ExternalMetricStatus = map[string]string{ + "": "ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.", + "metricName": "metricName is the name of a metric used for autoscaling in metric system.", + "metricSelector": "metricSelector is used to identify a specific time series within a given metric.", + "currentValue": "currentValue is the current value of the metric (as a quantity)", + "currentAverageValue": "currentAverageValue is the current value of metric averaged over autoscaled pods.", +} + +func (ExternalMetricStatus) SwaggerDoc() map[string]string { + return map_ExternalMetricStatus +} + var map_HorizontalPodAutoscaler = map[string]string{ "": "configuration of a horizontal pod autoscaler.", "metadata": "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", @@ -99,10 +123,11 @@ func (HorizontalPodAutoscalerStatus) SwaggerDoc() map[string]string { var map_MetricSpec = map[string]string{ "": "MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).", - "type": "type is the type of metric source. It should match one of the fields below.", + "type": "type is the type of metric source. It should be one of \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object.", "object": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).", "pods": "pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.", "resource": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", + "external": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).", } func (MetricSpec) SwaggerDoc() map[string]string { @@ -111,10 +136,11 @@ func (MetricSpec) SwaggerDoc() map[string]string { var map_MetricStatus = map[string]string{ "": "MetricStatus describes the last-read state of a single metric.", - "type": "type is the type of metric source. It will match one of the fields below.", + "type": "type is the type of metric source. It will be one of \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object.", "object": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).", "pods": "pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.", "resource": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", + "external": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).", } func (MetricStatus) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go index 3622cf450..011275be4 100644 --- a/vendor/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go @@ -16,12 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 import ( - resource "k8s.io/apimachinery/pkg/api/resource" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -42,6 +41,84 @@ func (in *CrossVersionObjectReference) DeepCopy() *CrossVersionObjectReference { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalMetricSource) DeepCopyInto(out *ExternalMetricSource) { + *out = *in + if in.MetricSelector != nil { + in, out := &in.MetricSelector, &out.MetricSelector + if *in == nil { + *out = nil + } else { + *out = new(meta_v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + } + if in.TargetValue != nil { + in, out := &in.TargetValue, &out.TargetValue + if *in == nil { + *out = nil + } else { + x := (*in).DeepCopy() + *out = &x + } + } + if in.TargetAverageValue != nil { + in, out := &in.TargetAverageValue, &out.TargetAverageValue + if *in == nil { + *out = nil + } else { + x := (*in).DeepCopy() + *out = &x + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalMetricSource. +func (in *ExternalMetricSource) DeepCopy() *ExternalMetricSource { + if in == nil { + return nil + } + out := new(ExternalMetricSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalMetricStatus) DeepCopyInto(out *ExternalMetricStatus) { + *out = *in + if in.MetricSelector != nil { + in, out := &in.MetricSelector, &out.MetricSelector + if *in == nil { + *out = nil + } else { + *out = new(meta_v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + } + out.CurrentValue = in.CurrentValue.DeepCopy() + if in.CurrentAverageValue != nil { + in, out := &in.CurrentAverageValue, &out.CurrentAverageValue + if *in == nil { + *out = nil + } else { + x := (*in).DeepCopy() + *out = &x + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalMetricStatus. +func (in *ExternalMetricStatus) DeepCopy() *ExternalMetricStatus { + if in == nil { + return nil + } + out := new(ExternalMetricStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HorizontalPodAutoscaler) DeepCopyInto(out *HorizontalPodAutoscaler) { *out = *in @@ -66,9 +143,8 @@ func (in *HorizontalPodAutoscaler) DeepCopy() *HorizontalPodAutoscaler { func (in *HorizontalPodAutoscaler) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -117,9 +193,8 @@ func (in *HorizontalPodAutoscalerList) DeepCopy() *HorizontalPodAutoscalerList { func (in *HorizontalPodAutoscalerList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -174,8 +249,7 @@ func (in *HorizontalPodAutoscalerStatus) DeepCopyInto(out *HorizontalPodAutoscal if *in == nil { *out = nil } else { - *out = new(meta_v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } if in.CurrentCPUUtilizationPercentage != nil { @@ -230,6 +304,15 @@ func (in *MetricSpec) DeepCopyInto(out *MetricSpec) { (*in).DeepCopyInto(*out) } } + if in.External != nil { + in, out := &in.External, &out.External + if *in == nil { + *out = nil + } else { + *out = new(ExternalMetricSource) + (*in).DeepCopyInto(*out) + } + } return } @@ -273,6 +356,15 @@ func (in *MetricStatus) DeepCopyInto(out *MetricStatus) { (*in).DeepCopyInto(*out) } } + if in.External != nil { + in, out := &in.External, &out.External + if *in == nil { + *out = nil + } else { + *out = new(ExternalMetricStatus) + (*in).DeepCopyInto(*out) + } + } return } @@ -373,8 +465,8 @@ func (in *ResourceMetricSource) DeepCopyInto(out *ResourceMetricSource) { if *in == nil { *out = nil } else { - *out = new(resource.Quantity) - **out = (*in).DeepCopy() + x := (*in).DeepCopy() + *out = &x } } return @@ -440,9 +532,8 @@ func (in *Scale) DeepCopy() *Scale { func (in *Scale) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/autoscaling/v2beta1/generated.pb.go b/vendor/k8s.io/api/autoscaling/v2beta1/generated.pb.go index 908c049ed..784e4be2b 100644 --- a/vendor/k8s.io/api/autoscaling/v2beta1/generated.pb.go +++ b/vendor/k8s.io/api/autoscaling/v2beta1/generated.pb.go @@ -26,6 +26,8 @@ limitations under the License. It has these top-level messages: CrossVersionObjectReference + ExternalMetricSource + ExternalMetricStatus HorizontalPodAutoscaler HorizontalPodAutoscalerCondition HorizontalPodAutoscalerList @@ -73,68 +75,78 @@ func (*CrossVersionObjectReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } +func (m *ExternalMetricSource) Reset() { *m = ExternalMetricSource{} } +func (*ExternalMetricSource) ProtoMessage() {} +func (*ExternalMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } + +func (m *ExternalMetricStatus) Reset() { *m = ExternalMetricStatus{} } +func (*ExternalMetricStatus) ProtoMessage() {} +func (*ExternalMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } + func (m *HorizontalPodAutoscaler) Reset() { *m = HorizontalPodAutoscaler{} } func (*HorizontalPodAutoscaler) ProtoMessage() {} -func (*HorizontalPodAutoscaler) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } +func (*HorizontalPodAutoscaler) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } func (m *HorizontalPodAutoscalerCondition) Reset() { *m = HorizontalPodAutoscalerCondition{} } func (*HorizontalPodAutoscalerCondition) ProtoMessage() {} func (*HorizontalPodAutoscalerCondition) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{2} + return fileDescriptorGenerated, []int{4} } func (m *HorizontalPodAutoscalerList) Reset() { *m = HorizontalPodAutoscalerList{} } func (*HorizontalPodAutoscalerList) ProtoMessage() {} func (*HorizontalPodAutoscalerList) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{3} + return fileDescriptorGenerated, []int{5} } func (m *HorizontalPodAutoscalerSpec) Reset() { *m = HorizontalPodAutoscalerSpec{} } func (*HorizontalPodAutoscalerSpec) ProtoMessage() {} func (*HorizontalPodAutoscalerSpec) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{4} + return fileDescriptorGenerated, []int{6} } func (m *HorizontalPodAutoscalerStatus) Reset() { *m = HorizontalPodAutoscalerStatus{} } func (*HorizontalPodAutoscalerStatus) ProtoMessage() {} func (*HorizontalPodAutoscalerStatus) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{5} + return fileDescriptorGenerated, []int{7} } func (m *MetricSpec) Reset() { *m = MetricSpec{} } func (*MetricSpec) ProtoMessage() {} -func (*MetricSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} } +func (*MetricSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} } func (m *MetricStatus) Reset() { *m = MetricStatus{} } func (*MetricStatus) ProtoMessage() {} -func (*MetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} } +func (*MetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{9} } func (m *ObjectMetricSource) Reset() { *m = ObjectMetricSource{} } func (*ObjectMetricSource) ProtoMessage() {} -func (*ObjectMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} } +func (*ObjectMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{10} } func (m *ObjectMetricStatus) Reset() { *m = ObjectMetricStatus{} } func (*ObjectMetricStatus) ProtoMessage() {} -func (*ObjectMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{9} } +func (*ObjectMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} } func (m *PodsMetricSource) Reset() { *m = PodsMetricSource{} } func (*PodsMetricSource) ProtoMessage() {} -func (*PodsMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{10} } +func (*PodsMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} } func (m *PodsMetricStatus) Reset() { *m = PodsMetricStatus{} } func (*PodsMetricStatus) ProtoMessage() {} -func (*PodsMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} } +func (*PodsMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{13} } func (m *ResourceMetricSource) Reset() { *m = ResourceMetricSource{} } func (*ResourceMetricSource) ProtoMessage() {} -func (*ResourceMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} } +func (*ResourceMetricSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{14} } func (m *ResourceMetricStatus) Reset() { *m = ResourceMetricStatus{} } func (*ResourceMetricStatus) ProtoMessage() {} -func (*ResourceMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{13} } +func (*ResourceMetricStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{15} } func init() { proto.RegisterType((*CrossVersionObjectReference)(nil), "k8s.io.api.autoscaling.v2beta1.CrossVersionObjectReference") + proto.RegisterType((*ExternalMetricSource)(nil), "k8s.io.api.autoscaling.v2beta1.ExternalMetricSource") + proto.RegisterType((*ExternalMetricStatus)(nil), "k8s.io.api.autoscaling.v2beta1.ExternalMetricStatus") proto.RegisterType((*HorizontalPodAutoscaler)(nil), "k8s.io.api.autoscaling.v2beta1.HorizontalPodAutoscaler") proto.RegisterType((*HorizontalPodAutoscalerCondition)(nil), "k8s.io.api.autoscaling.v2beta1.HorizontalPodAutoscalerCondition") proto.RegisterType((*HorizontalPodAutoscalerList)(nil), "k8s.io.api.autoscaling.v2beta1.HorizontalPodAutoscalerList") @@ -179,6 +191,108 @@ func (m *CrossVersionObjectReference) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ExternalMetricSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExternalMetricSource) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricName))) + i += copy(dAtA[i:], m.MetricName) + if m.MetricSelector != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.MetricSelector.Size())) + n1, err := m.MetricSelector.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if m.TargetValue != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.TargetValue.Size())) + n2, err := m.TargetValue.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } + if m.TargetAverageValue != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.TargetAverageValue.Size())) + n3, err := m.TargetAverageValue.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 + } + return i, nil +} + +func (m *ExternalMetricStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExternalMetricStatus) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricName))) + i += copy(dAtA[i:], m.MetricName) + if m.MetricSelector != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.MetricSelector.Size())) + n4, err := m.MetricSelector.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 + } + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentValue.Size())) + n5, err := m.CurrentValue.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 + if m.CurrentAverageValue != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentAverageValue.Size())) + n6, err := m.CurrentAverageValue.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n6 + } + return i, nil +} + func (m *HorizontalPodAutoscaler) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -197,27 +311,27 @@ func (m *HorizontalPodAutoscaler) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n1, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n7, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n1 + i += n7 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n2, err := m.Spec.MarshalTo(dAtA[i:]) + n8, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n2 + i += n8 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n3, err := m.Status.MarshalTo(dAtA[i:]) + n9, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n3 + i += n9 return i, nil } @@ -247,11 +361,11 @@ func (m *HorizontalPodAutoscalerCondition) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastTransitionTime.Size())) - n4, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) + n10, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n4 + i += n10 dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) @@ -281,11 +395,11 @@ func (m *HorizontalPodAutoscalerList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n5, err := m.ListMeta.MarshalTo(dAtA[i:]) + n11, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n5 + i += n11 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -319,11 +433,11 @@ func (m *HorizontalPodAutoscalerSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ScaleTargetRef.Size())) - n6, err := m.ScaleTargetRef.MarshalTo(dAtA[i:]) + n12, err := m.ScaleTargetRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n6 + i += n12 if m.MinReplicas != nil { dAtA[i] = 0x10 i++ @@ -371,11 +485,11 @@ func (m *HorizontalPodAutoscalerStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastScaleTime.Size())) - n7, err := m.LastScaleTime.MarshalTo(dAtA[i:]) + n13, err := m.LastScaleTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n7 + i += n13 } dAtA[i] = 0x18 i++ @@ -433,31 +547,41 @@ func (m *MetricSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Object.Size())) - n8, err := m.Object.MarshalTo(dAtA[i:]) + n14, err := m.Object.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n8 + i += n14 } if m.Pods != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Pods.Size())) - n9, err := m.Pods.MarshalTo(dAtA[i:]) + n15, err := m.Pods.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n15 } if m.Resource != nil { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Resource.Size())) - n10, err := m.Resource.MarshalTo(dAtA[i:]) + n16, err := m.Resource.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n16 + } + if m.External != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.External.Size())) + n17, err := m.External.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n10 + i += n17 } return i, nil } @@ -485,31 +609,41 @@ func (m *MetricStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Object.Size())) - n11, err := m.Object.MarshalTo(dAtA[i:]) + n18, err := m.Object.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n11 + i += n18 } if m.Pods != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Pods.Size())) - n12, err := m.Pods.MarshalTo(dAtA[i:]) + n19, err := m.Pods.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n12 + i += n19 } if m.Resource != nil { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Resource.Size())) - n13, err := m.Resource.MarshalTo(dAtA[i:]) + n20, err := m.Resource.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n13 + i += n20 + } + if m.External != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.External.Size())) + n21, err := m.External.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n21 } return i, nil } @@ -532,11 +666,11 @@ func (m *ObjectMetricSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Target.Size())) - n14, err := m.Target.MarshalTo(dAtA[i:]) + n22, err := m.Target.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n14 + i += n22 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricName))) @@ -544,11 +678,11 @@ func (m *ObjectMetricSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.TargetValue.Size())) - n15, err := m.TargetValue.MarshalTo(dAtA[i:]) + n23, err := m.TargetValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n15 + i += n23 return i, nil } @@ -570,11 +704,11 @@ func (m *ObjectMetricStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Target.Size())) - n16, err := m.Target.MarshalTo(dAtA[i:]) + n24, err := m.Target.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n16 + i += n24 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricName))) @@ -582,11 +716,11 @@ func (m *ObjectMetricStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentValue.Size())) - n17, err := m.CurrentValue.MarshalTo(dAtA[i:]) + n25, err := m.CurrentValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n17 + i += n25 return i, nil } @@ -612,11 +746,11 @@ func (m *PodsMetricSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.TargetAverageValue.Size())) - n18, err := m.TargetAverageValue.MarshalTo(dAtA[i:]) + n26, err := m.TargetAverageValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n18 + i += n26 return i, nil } @@ -642,11 +776,11 @@ func (m *PodsMetricStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentAverageValue.Size())) - n19, err := m.CurrentAverageValue.MarshalTo(dAtA[i:]) + n27, err := m.CurrentAverageValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n19 + i += n27 return i, nil } @@ -678,11 +812,11 @@ func (m *ResourceMetricSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.TargetAverageValue.Size())) - n20, err := m.TargetAverageValue.MarshalTo(dAtA[i:]) + n28, err := m.TargetAverageValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n20 + i += n28 } return i, nil } @@ -714,11 +848,11 @@ func (m *ResourceMetricStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.CurrentAverageValue.Size())) - n21, err := m.CurrentAverageValue.MarshalTo(dAtA[i:]) + n29, err := m.CurrentAverageValue.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n21 + i += n29 return i, nil } @@ -761,6 +895,44 @@ func (m *CrossVersionObjectReference) Size() (n int) { return n } +func (m *ExternalMetricSource) Size() (n int) { + var l int + _ = l + l = len(m.MetricName) + n += 1 + l + sovGenerated(uint64(l)) + if m.MetricSelector != nil { + l = m.MetricSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TargetValue != nil { + l = m.TargetValue.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TargetAverageValue != nil { + l = m.TargetAverageValue.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *ExternalMetricStatus) Size() (n int) { + var l int + _ = l + l = len(m.MetricName) + n += 1 + l + sovGenerated(uint64(l)) + if m.MetricSelector != nil { + l = m.MetricSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = m.CurrentValue.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.CurrentAverageValue != nil { + l = m.CurrentAverageValue.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *HorizontalPodAutoscaler) Size() (n int) { var l int _ = l @@ -865,6 +1037,10 @@ func (m *MetricSpec) Size() (n int) { l = m.Resource.Size() n += 1 + l + sovGenerated(uint64(l)) } + if m.External != nil { + l = m.External.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -885,6 +1061,10 @@ func (m *MetricStatus) Size() (n int) { l = m.Resource.Size() n += 1 + l + sovGenerated(uint64(l)) } + if m.External != nil { + l = m.External.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -985,6 +1165,32 @@ func (this *CrossVersionObjectReference) String() string { }, "") return s } +func (this *ExternalMetricSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ExternalMetricSource{`, + `MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`, + `MetricSelector:` + strings.Replace(fmt.Sprintf("%v", this.MetricSelector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`, + `TargetValue:` + strings.Replace(fmt.Sprintf("%v", this.TargetValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`, + `TargetAverageValue:` + strings.Replace(fmt.Sprintf("%v", this.TargetAverageValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *ExternalMetricStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ExternalMetricStatus{`, + `MetricName:` + fmt.Sprintf("%v", this.MetricName) + `,`, + `MetricSelector:` + strings.Replace(fmt.Sprintf("%v", this.MetricSelector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`, + `CurrentValue:` + strings.Replace(strings.Replace(this.CurrentValue.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`, + `CurrentAverageValue:` + strings.Replace(fmt.Sprintf("%v", this.CurrentAverageValue), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} func (this *HorizontalPodAutoscaler) String() string { if this == nil { return "nil" @@ -1059,6 +1265,7 @@ func (this *MetricSpec) String() string { `Object:` + strings.Replace(fmt.Sprintf("%v", this.Object), "ObjectMetricSource", "ObjectMetricSource", 1) + `,`, `Pods:` + strings.Replace(fmt.Sprintf("%v", this.Pods), "PodsMetricSource", "PodsMetricSource", 1) + `,`, `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "ResourceMetricSource", "ResourceMetricSource", 1) + `,`, + `External:` + strings.Replace(fmt.Sprintf("%v", this.External), "ExternalMetricSource", "ExternalMetricSource", 1) + `,`, `}`, }, "") return s @@ -1072,6 +1279,7 @@ func (this *MetricStatus) String() string { `Object:` + strings.Replace(fmt.Sprintf("%v", this.Object), "ObjectMetricStatus", "ObjectMetricStatus", 1) + `,`, `Pods:` + strings.Replace(fmt.Sprintf("%v", this.Pods), "PodsMetricStatus", "PodsMetricStatus", 1) + `,`, `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "ResourceMetricStatus", "ResourceMetricStatus", 1) + `,`, + `External:` + strings.Replace(fmt.Sprintf("%v", this.External), "ExternalMetricStatus", "ExternalMetricStatus", 1) + `,`, `}`, }, "") return s @@ -1291,7 +1499,7 @@ func (m *CrossVersionObjectReference) Unmarshal(dAtA []byte) error { } return nil } -func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { +func (m *ExternalMetricSource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1314,15 +1522,44 @@ func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HorizontalPodAutoscaler: wiretype end group for non-group") + return fmt.Errorf("proto: ExternalMetricSource: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HorizontalPodAutoscaler: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExternalMetricSource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MetricName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MetricName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetricSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1346,13 +1583,16 @@ func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.MetricSelector == nil { + m.MetricSelector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{} + } + if err := m.MetricSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TargetValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1376,13 +1616,16 @@ func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.TargetValue == nil { + m.TargetValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{} + } + if err := m.TargetValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TargetAverageValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1406,7 +1649,10 @@ func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.TargetAverageValue == nil { + m.TargetAverageValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{} + } + if err := m.TargetAverageValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1431,7 +1677,7 @@ func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { } return nil } -func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { +func (m *ExternalMetricStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1454,15 +1700,15 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HorizontalPodAutoscalerCondition: wiretype end group for non-group") + return fmt.Errorf("proto: ExternalMetricStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HorizontalPodAutoscalerCondition: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExternalMetricStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MetricName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1487,13 +1733,13 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = HorizontalPodAutoscalerConditionType(dAtA[iNdEx:postIndex]) + m.MetricName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MetricSelector", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1503,24 +1749,28 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex]) + if m.MetricSelector == nil { + m.MetricSelector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{} + } + if err := m.MetricSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CurrentValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1544,15 +1794,15 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CurrentValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CurrentAverageValue", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1562,31 +1812,342 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Reason = string(dAtA[iNdEx:postIndex]) + if m.CurrentAverageValue == nil { + m.CurrentAverageValue = &k8s_io_apimachinery_pkg_api_resource.Quantity{} + } + if err := m.CurrentAverageValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HorizontalPodAutoscaler) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HorizontalPodAutoscaler: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HorizontalPodAutoscaler: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HorizontalPodAutoscalerCondition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HorizontalPodAutoscalerCondition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = HorizontalPodAutoscalerConditionType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] @@ -2248,6 +2809,39 @@ func (m *MetricSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field External", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.External == nil { + m.External = &ExternalMetricSource{} + } + if err := m.External.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2426,6 +3020,39 @@ func (m *MetricStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field External", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.External == nil { + m.External = &ExternalMetricStatus{} + } + if err := m.External.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -3314,88 +3941,96 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 1316 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0x8f, 0x1d, 0x27, 0x0d, 0xe3, 0x34, 0x29, 0xd3, 0xaa, 0x75, 0x53, 0x6a, 0x47, 0x2b, 0x84, - 0x4a, 0x45, 0x77, 0x5b, 0x13, 0x3e, 0x24, 0x84, 0x44, 0x6c, 0x44, 0x5b, 0x91, 0xb4, 0x65, 0x9a, - 0x56, 0x08, 0x0a, 0x62, 0xb2, 0x3b, 0x75, 0x86, 0x78, 0x3f, 0x34, 0x33, 0xb6, 0x48, 0x11, 0x12, - 0x17, 0xee, 0x1c, 0x40, 0xfc, 0x15, 0x5c, 0xe1, 0x0c, 0x12, 0x52, 0x85, 0x38, 0xf4, 0x58, 0x84, - 0x64, 0x51, 0xf3, 0x5f, 0xf4, 0x84, 0xe6, 0xc3, 0xfb, 0x61, 0x7b, 0xe3, 0xc4, 0x44, 0xc0, 0xcd, - 0x3b, 0xef, 0xf7, 0x7e, 0xef, 0xbd, 0xdf, 0xbc, 0x79, 0x33, 0x06, 0x57, 0x77, 0x5f, 0xe7, 0x36, - 0x0d, 0x9d, 0xdd, 0xce, 0x36, 0x61, 0x01, 0x11, 0x84, 0x3b, 0x5d, 0x12, 0x78, 0x21, 0x73, 0x8c, - 0x01, 0x47, 0xd4, 0xc1, 0x1d, 0x11, 0x72, 0x17, 0xb7, 0x69, 0xd0, 0x72, 0xba, 0xf5, 0x6d, 0x22, - 0xf0, 0x15, 0xa7, 0x45, 0x02, 0xc2, 0xb0, 0x20, 0x9e, 0x1d, 0xb1, 0x50, 0x84,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, 0xd0, 0xe0, 0xc0, 0xfa, 0xad, 0xeb, 0xc6, 0x82, 0x52, 0x28, 0xeb, 0xa7, - 0x22, 0x38, 0x73, 0x2d, 0x64, 0xf4, 0x41, 0x18, 0x08, 0xdc, 0xbe, 0x15, 0x7a, 0xeb, 0xa6, 0x33, - 0x08, 0x83, 0x9f, 0x80, 0x05, 0x29, 0xb6, 0x87, 0x05, 0x56, 0x79, 0x95, 0xeb, 0x97, 0xed, 0xa4, - 0x87, 0xe2, 0xda, 0xed, 0x68, 0xb7, 0x25, 0x17, 0xb8, 0x2d, 0xd1, 0x76, 0xf7, 0x8a, 0xad, 0x8b, - 0xdb, 0x24, 0x02, 0x27, 0xf1, 0x93, 0x35, 0x14, 0xb3, 0xc2, 0x8f, 0x40, 0x89, 0x47, 0xc4, 0x55, - 0x35, 0x95, 0xeb, 0x6f, 0xd8, 0xfb, 0x77, 0xa8, 0x9d, 0x93, 0xe8, 0xed, 0x88, 0xb8, 0x89, 0x20, - 0xf2, 0x0b, 0x29, 0x5a, 0x48, 0xc0, 0x3c, 0x17, 0x58, 0x74, 0xb8, 0x12, 0xa3, 0x5c, 0x7f, 0x73, - 0xda, 0x00, 0x8a, 0xa4, 0xb1, 0x64, 0x42, 0xcc, 0xeb, 0x6f, 0x64, 0xc8, 0xad, 0xaf, 0x66, 0xc1, - 0x6a, 0x8e, 0x67, 0x33, 0x0c, 0x3c, 0x2a, 0x68, 0x18, 0xc0, 0x6b, 0xa0, 0x24, 0xf6, 0x22, 0x62, - 0x36, 0x78, 0x6d, 0x90, 0xed, 0xd6, 0x5e, 0x44, 0x9e, 0xf6, 0x6a, 0xcf, 0x4f, 0xf2, 0x97, 0x38, - 0xa4, 0x18, 0xe0, 0x46, 0x5c, 0x55, 0x31, 0xc3, 0x65, 0xd2, 0x7a, 0xda, 0xab, 0x8d, 0x39, 0x9a, - 0x76, 0xcc, 0x94, 0x4d, 0x1e, 0x76, 0x01, 0x6c, 0x63, 0x2e, 0xb6, 0x18, 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 0x7f, 0x5e, 0xa7, 0xcd, 0xfe, 0x3b, 0x9d, 0xd6, 0xb8, 0xf4, 0xf0, 0x49, - 0x75, 0xe6, 0xd1, 0x93, 0xea, 0xcc, 0xe3, 0x27, 0xd5, 0x99, 0x2f, 0xfb, 0xd5, 0xc2, 0xc3, 0x7e, - 0xb5, 0xf0, 0xa8, 0x5f, 0x2d, 0x3c, 0xee, 0x57, 0x0b, 0x7f, 0xf6, 0xab, 0x85, 0xaf, 0xff, 0xaa, - 0xce, 0x7c, 0x70, 0xcc, 0xcc, 0xbd, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xac, 0xf1, 0x6a, 0x4f, - 0x90, 0x12, 0x00, 0x00, + // 1441 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x8f, 0x1b, 0xc5, + 0x12, 0x5f, 0x7f, 0xec, 0x66, 0xd3, 0xde, 0xec, 0xe6, 0x75, 0xa2, 0xc4, 0xd9, 0xbc, 0xd8, 0xab, + 0xd1, 0xd3, 0x53, 0x88, 0xc8, 0x4c, 0xe2, 0x2c, 0x1f, 0x12, 0x42, 0x62, 0x6d, 0x20, 0x89, 0x58, + 0x27, 0xa1, 0x77, 0x13, 0x21, 0x08, 0x88, 0xf6, 0xb8, 0xe3, 0x6d, 0xd6, 0x33, 0x63, 0x75, 0xb7, + 0xad, 0x6c, 0x10, 0x12, 0x17, 0xee, 0x1c, 0xf8, 0xb8, 0x72, 0x46, 0x70, 0x85, 0x33, 0x48, 0x48, + 0x39, 0xe6, 0x18, 0x84, 0x64, 0x91, 0xe1, 0xbf, 0xc8, 0x09, 0x4d, 0x77, 0xcf, 0x78, 0xc6, 0xf6, + 0xac, 0x1d, 0xb3, 0x09, 0x70, 0x9b, 0xee, 0xaa, 0xfa, 0x55, 0x75, 0x55, 0x75, 0x75, 0xd5, 0x80, + 0xcb, 0xbb, 0x2f,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b, 0x20, 0xbf, 0x4b, 0xdd, 0x66, 0x31, 0xb3, + 0x96, 0x39, 0x7b, 0xb8, 0xba, 0x74, 0xbf, 0x5f, 0x9e, 0xf3, 0xfb, 0xe5, 0xfc, 0x5b, 0xd4, 0x6d, + 0x22, 0x49, 0x09, 0x38, 0x5c, 0xec, 0x90, 0x62, 0x36, 0xc9, 0x71, 0x0d, 0x3b, 0x04, 0x49, 0x0a, + 0xac, 0x00, 0x80, 0x3b, 0x54, 0x2b, 0x28, 0xe6, 0x24, 0x1f, 0xd4, 0x7c, 0x60, 0xe3, 0xc6, 0x55, + 0x4d, 0x41, 0x31, 0x2e, 0xe3, 0xab, 0x1c, 0x38, 0xfe, 0xc6, 0x5d, 0x41, 0x98, 0x8b, 0xdb, 0x75, + 0x22, 0x18, 0xb5, 0xb7, 0x64, 0x50, 0x02, 0x30, 0x47, 0xae, 0x03, 0x05, 0xda, 0xac, 0x08, 0xac, + 0x1e, 0x51, 0x50, 0x8c, 0x0b, 0x7a, 0x60, 0x59, 0xad, 0xb6, 0x48, 0x9b, 0xd8, 0xc2, 0x63, 0xd2, + 0xd8, 0x42, 0xe5, 0x92, 0x39, 0x48, 0xbd, 0xc8, 0x65, 0x66, 0x67, 0xb7, 0x15, 0x6c, 0x70, 0x33, + 0x88, 0xa8, 0xd9, 0xbb, 0x68, 0x6e, 0xe2, 0x06, 0x69, 0x87, 0xa2, 0x55, 0xe8, 0xf7, 0xcb, 0xcb, + 0xf5, 0x04, 0x1c, 0x1a, 0x82, 0x87, 0x18, 0x14, 0x04, 0x66, 0x2d, 0x22, 0x6e, 0xe1, 0x76, 0x97, + 0xc8, 0x23, 0x17, 0x2a, 0xe6, 0x7e, 0xda, 0xcc, 0x30, 0xeb, 0xcc, 0xb7, 0xbb, 0xd8, 0x15, 0x54, + 0xec, 0x55, 0x57, 0xfc, 0x7e, 0xb9, 0xb0, 0x3d, 0x80, 0x41, 0x71, 0x4c, 0xd8, 0x03, 0x50, 0x2d, + 0x37, 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, 0xf5, + 0x84, 0x36, 0x65, 0x79, 0x2b, 0x01, 0x8d, 0x86, 0x54, 0xc1, 0x8b, 0xa0, 0xe0, 0x50, 0x17, 0x91, + 0x4e, 0x9b, 0xda, 0x58, 0xa5, 0xe5, 0xbc, 0x7a, 0x92, 0xea, 0x83, 0x6d, 0x14, 0xe7, 0x81, 0x2f, + 0x80, 0x82, 0x83, 0xef, 0x46, 0x22, 0x39, 0x29, 0x72, 0x4c, 0xeb, 0x2b, 0xd4, 0x07, 0x24, 0x14, + 0xe7, 0x83, 0x37, 0x83, 0x6c, 0x08, 0xaa, 0x34, 0x2f, 0xe6, 0xa5, 0x9b, 0xcf, 0x4d, 0x3a, 0x9f, + 0x2e, 0xf2, 0x41, 0x89, 0x88, 0x65, 0x8e, 0x84, 0x40, 0x21, 0x96, 0xf1, 0x43, 0x1e, 0x9c, 0xd9, + 0xf7, 0xee, 0xc3, 0x37, 0x01, 0xf4, 0x1a, 0x9c, 0xb0, 0x1e, 0x69, 0x5e, 0x56, 0x6d, 0x51, 0xd0, + 0x9f, 0x04, 0x3e, 0xce, 0xa9, 0x27, 0xf1, 0xfa, 0x08, 0x15, 0x8d, 0x91, 0x80, 0x36, 0x38, 0x12, + 0x5c, 0x06, 0xe5, 0x50, 0xaa, 0x5b, 0xa1, 0x27, 0xbb, 0x69, 0xff, 0xf1, 0xfb, 0xe5, 0x23, 0x9b, + 0x71, 0x10, 0x94, 0xc4, 0x84, 0x1b, 0x60, 0x45, 0xd7, 0xfa, 0x21, 0x07, 0x9f, 0xd4, 0x1e, 0x58, + 0xa9, 0x25, 0xc9, 0x68, 0x98, 0x3f, 0x80, 0x68, 0x12, 0x4e, 0x19, 0x69, 0x46, 0x10, 0xf9, 0x24, + 0xc4, 0xeb, 0x49, 0x32, 0x1a, 0xe6, 0x87, 0x6d, 0xb0, 0xac, 0x51, 0xb5, 0xbf, 0x8b, 0xf3, 0x32, + 0x64, 0xcf, 0x4f, 0x19, 0x32, 0x55, 0x74, 0x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 0xdc, 0xc3, 0x47, 0xa5, 0xb9, 0x4f, 0xfd, 0x52, 0xe6, 0xbe, 0x5f, 0xca, 0x3c, + 0xf0, 0x4b, 0x99, 0x87, 0x7e, 0x29, 0xf3, 0xbb, 0x5f, 0xca, 0x7c, 0xfe, 0x47, 0x69, 0xee, 0xdd, + 0x43, 0xba, 0xee, 0xfd, 0x19, 0x00, 0x00, 0xff, 0xff, 0x91, 0x09, 0xa9, 0x38, 0x8c, 0x16, 0x00, + 0x00, } diff --git a/vendor/k8s.io/api/autoscaling/v2beta1/generated.proto b/vendor/k8s.io/api/autoscaling/v2beta1/generated.proto index cce8e4251..b565920c3 100644 --- a/vendor/k8s.io/api/autoscaling/v2beta1/generated.proto +++ b/vendor/k8s.io/api/autoscaling/v2beta1/generated.proto @@ -44,6 +44,50 @@ message CrossVersionObjectReference { optional string apiVersion = 3; } +// ExternalMetricSource indicates how to scale on a metric not associated with +// any Kubernetes object (for example length of queue in cloud +// messaging service, or QPS from loadbalancer running outside of cluster). +// Exactly one "target" type should be set. +message ExternalMetricSource { + // metricName is the name of the metric in question. + optional string metricName = 1; + + // metricSelector is used to identify a specific time series + // within a given metric. + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2; + + // targetValue is the target value of the metric (as a quantity). + // Mutually exclusive with TargetAverageValue. + // +optional + optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3; + + // targetAverageValue is the target per-pod value of global metric (as a quantity). + // Mutually exclusive with TargetValue. + // +optional + optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4; +} + +// ExternalMetricStatus indicates the current value of a global metric +// not associated with any Kubernetes object. +message ExternalMetricStatus { + // metricName is the name of a metric used for autoscaling in + // metric system. + optional string metricName = 1; + + // metricSelector is used to identify a specific time series + // within a given metric. + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2; + + // currentValue is the current value of the metric (as a quantity) + optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3; + + // currentAverageValue is the current value of metric averaged over autoscaled pods. + // +optional + optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4; +} + // HorizontalPodAutoscaler is the configuration for a horizontal pod // autoscaler, which automatically manages the replica count of any resource // implementing the scale subresource based on the metrics specified. @@ -153,7 +197,8 @@ message HorizontalPodAutoscalerStatus { // MetricSpec specifies how to scale based on a single metric // (only `type` and one other matching field should be set at once). message MetricSpec { - // type is the type of metric source. It should match one of the fields below. + // type is the type of metric source. It should be one of "Object", + // "Pods" or "Resource", each mapping to a matching field in the object. optional string type = 1; // object refers to a metric describing a single kubernetes object @@ -174,11 +219,20 @@ message MetricSpec { // to normal per-pod metrics using the "pods" source. // +optional optional ResourceMetricSource resource = 4; + + // external refers to a global metric that is not associated + // with any Kubernetes object. It allows autoscaling based on information + // coming from components running outside of cluster + // (for example length of queue in cloud messaging service, or + // QPS from loadbalancer running outside of cluster). + // +optional + optional ExternalMetricSource external = 5; } // MetricStatus describes the last-read state of a single metric. message MetricStatus { - // type is the type of metric source. It will match one of the fields below. + // type is the type of metric source. It will be one of "Object", + // "Pods" or "Resource", each corresponds to a matching field in the object. optional string type = 1; // object refers to a metric describing a single kubernetes object @@ -199,6 +253,14 @@ message MetricStatus { // to normal per-pod metrics using the "pods" source. // +optional optional ResourceMetricStatus resource = 4; + + // external refers to a global metric that is not associated + // with any Kubernetes object. It allows autoscaling based on information + // coming from components running outside of cluster + // (for example length of queue in cloud messaging service, or + // QPS from loadbalancer running outside of cluster). + // +optional + optional ExternalMetricStatus external = 5; } // ObjectMetricSource indicates how to scale on a metric describing a diff --git a/vendor/k8s.io/api/autoscaling/v2beta1/types.go b/vendor/k8s.io/api/autoscaling/v2beta1/types.go index 9c72ae25c..f842cc342 100644 --- a/vendor/k8s.io/api/autoscaling/v2beta1/types.go +++ b/vendor/k8s.io/api/autoscaling/v2beta1/types.go @@ -73,12 +73,19 @@ var ( // Kubernetes, and have special scaling options on top of those available // to normal per-pod metrics (the "pods" source). ResourceMetricSourceType MetricSourceType = "Resource" + // ExternalMetricSourceType is a global metric that is not associated + // with any Kubernetes object. It allows autoscaling based on information + // coming from components running outside of cluster + // (for example length of queue in cloud messaging service, or + // QPS from loadbalancer running outside of cluster). + ExternalMetricSourceType MetricSourceType = "External" ) // MetricSpec specifies how to scale based on a single metric // (only `type` and one other matching field should be set at once). type MetricSpec struct { - // type is the type of metric source. It should match one of the fields below. + // type is the type of metric source. It should be one of "Object", + // "Pods" or "Resource", each mapping to a matching field in the object. Type MetricSourceType `json:"type" protobuf:"bytes,1,name=type"` // object refers to a metric describing a single kubernetes object @@ -97,6 +104,13 @@ type MetricSpec struct { // to normal per-pod metrics using the "pods" source. // +optional Resource *ResourceMetricSource `json:"resource,omitempty" protobuf:"bytes,4,opt,name=resource"` + // external refers to a global metric that is not associated + // with any Kubernetes object. It allows autoscaling based on information + // coming from components running outside of cluster + // (for example length of queue in cloud messaging service, or + // QPS from loadbalancer running outside of cluster). + // +optional + External *ExternalMetricSource `json:"external,omitempty" protobuf:"bytes,5,opt,name=external"` } // ObjectMetricSource indicates how to scale on a metric describing a @@ -145,6 +159,27 @@ type ResourceMetricSource struct { TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty" protobuf:"bytes,3,opt,name=targetAverageValue"` } +// ExternalMetricSource indicates how to scale on a metric not associated with +// any Kubernetes object (for example length of queue in cloud +// messaging service, or QPS from loadbalancer running outside of cluster). +// Exactly one "target" type should be set. +type ExternalMetricSource struct { + // metricName is the name of the metric in question. + MetricName string `json:"metricName" protobuf:"bytes,1,name=metricName"` + // metricSelector is used to identify a specific time series + // within a given metric. + // +optional + MetricSelector *metav1.LabelSelector `json:"metricSelector,omitempty" protobuf:"bytes,2,opt,name=metricSelector"` + // targetValue is the target value of the metric (as a quantity). + // Mutually exclusive with TargetAverageValue. + // +optional + TargetValue *resource.Quantity `json:"targetValue,omitempty" protobuf:"bytes,3,opt,name=targetValue"` + // targetAverageValue is the target per-pod value of global metric (as a quantity). + // Mutually exclusive with TargetValue. + // +optional + TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty" protobuf:"bytes,4,opt,name=targetAverageValue"` +} + // HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler. type HorizontalPodAutoscalerStatus struct { // observedGeneration is the most recent generation observed by this autoscaler. @@ -210,7 +245,8 @@ type HorizontalPodAutoscalerCondition struct { // MetricStatus describes the last-read state of a single metric. type MetricStatus struct { - // type is the type of metric source. It will match one of the fields below. + // type is the type of metric source. It will be one of "Object", + // "Pods" or "Resource", each corresponds to a matching field in the object. Type MetricSourceType `json:"type" protobuf:"bytes,1,name=type"` // object refers to a metric describing a single kubernetes object @@ -229,6 +265,13 @@ type MetricStatus struct { // to normal per-pod metrics using the "pods" source. // +optional Resource *ResourceMetricStatus `json:"resource,omitempty" protobuf:"bytes,4,opt,name=resource"` + // external refers to a global metric that is not associated + // with any Kubernetes object. It allows autoscaling based on information + // coming from components running outside of cluster + // (for example length of queue in cloud messaging service, or + // QPS from loadbalancer running outside of cluster). + // +optional + External *ExternalMetricStatus `json:"external,omitempty" protobuf:"bytes,5,opt,name=external"` } // ObjectMetricStatus indicates the current value of a metric describing a @@ -275,6 +318,23 @@ type ResourceMetricStatus struct { CurrentAverageValue resource.Quantity `json:"currentAverageValue" protobuf:"bytes,3,name=currentAverageValue"` } +// ExternalMetricStatus indicates the current value of a global metric +// not associated with any Kubernetes object. +type ExternalMetricStatus struct { + // metricName is the name of a metric used for autoscaling in + // metric system. + MetricName string `json:"metricName" protobuf:"bytes,1,name=metricName"` + // metricSelector is used to identify a specific time series + // within a given metric. + // +optional + MetricSelector *metav1.LabelSelector `json:"metricSelector,omitempty" protobuf:"bytes,2,opt,name=metricSelector"` + // currentValue is the current value of the metric (as a quantity) + CurrentValue resource.Quantity `json:"currentValue" protobuf:"bytes,3,name=currentValue"` + // currentAverageValue is the current value of metric averaged over autoscaled pods. + // +optional + CurrentAverageValue *resource.Quantity `json:"currentAverageValue,omitempty" protobuf:"bytes,4,opt,name=currentAverageValue"` +} + // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go index c7002b3d1..12cfa7649 100644 --- a/vendor/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go @@ -38,6 +38,30 @@ func (CrossVersionObjectReference) SwaggerDoc() map[string]string { return map_CrossVersionObjectReference } +var map_ExternalMetricSource = map[string]string{ + "": "ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). Exactly one \"target\" type should be set.", + "metricName": "metricName is the name of the metric in question.", + "metricSelector": "metricSelector is used to identify a specific time series within a given metric.", + "targetValue": "targetValue is the target value of the metric (as a quantity). Mutually exclusive with TargetAverageValue.", + "targetAverageValue": "targetAverageValue is the target per-pod value of global metric (as a quantity). Mutually exclusive with TargetValue.", +} + +func (ExternalMetricSource) SwaggerDoc() map[string]string { + return map_ExternalMetricSource +} + +var map_ExternalMetricStatus = map[string]string{ + "": "ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.", + "metricName": "metricName is the name of a metric used for autoscaling in metric system.", + "metricSelector": "metricSelector is used to identify a specific time series within a given metric.", + "currentValue": "currentValue is the current value of the metric (as a quantity)", + "currentAverageValue": "currentAverageValue is the current value of metric averaged over autoscaled pods.", +} + +func (ExternalMetricStatus) SwaggerDoc() map[string]string { + return map_ExternalMetricStatus +} + var map_HorizontalPodAutoscaler = map[string]string{ "": "HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.", "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", @@ -100,10 +124,11 @@ func (HorizontalPodAutoscalerStatus) SwaggerDoc() map[string]string { var map_MetricSpec = map[string]string{ "": "MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).", - "type": "type is the type of metric source. It should match one of the fields below.", + "type": "type is the type of metric source. It should be one of \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object.", "object": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).", "pods": "pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.", "resource": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", + "external": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).", } func (MetricSpec) SwaggerDoc() map[string]string { @@ -112,10 +137,11 @@ func (MetricSpec) SwaggerDoc() map[string]string { var map_MetricStatus = map[string]string{ "": "MetricStatus describes the last-read state of a single metric.", - "type": "type is the type of metric source. It will match one of the fields below.", + "type": "type is the type of metric source. It will be one of \"Object\", \"Pods\" or \"Resource\", each corresponds to a matching field in the object.", "object": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).", "pods": "pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.", "resource": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", + "external": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).", } func (MetricStatus) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/autoscaling/v2beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/autoscaling/v2beta1/zz_generated.deepcopy.go index 70bec2b5b..dc59dc2d3 100644 --- a/vendor/k8s.io/api/autoscaling/v2beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/autoscaling/v2beta1/zz_generated.deepcopy.go @@ -16,12 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v2beta1 import ( - resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -42,6 +41,84 @@ func (in *CrossVersionObjectReference) DeepCopy() *CrossVersionObjectReference { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalMetricSource) DeepCopyInto(out *ExternalMetricSource) { + *out = *in + if in.MetricSelector != nil { + in, out := &in.MetricSelector, &out.MetricSelector + if *in == nil { + *out = nil + } else { + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + } + if in.TargetValue != nil { + in, out := &in.TargetValue, &out.TargetValue + if *in == nil { + *out = nil + } else { + x := (*in).DeepCopy() + *out = &x + } + } + if in.TargetAverageValue != nil { + in, out := &in.TargetAverageValue, &out.TargetAverageValue + if *in == nil { + *out = nil + } else { + x := (*in).DeepCopy() + *out = &x + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalMetricSource. +func (in *ExternalMetricSource) DeepCopy() *ExternalMetricSource { + if in == nil { + return nil + } + out := new(ExternalMetricSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalMetricStatus) DeepCopyInto(out *ExternalMetricStatus) { + *out = *in + if in.MetricSelector != nil { + in, out := &in.MetricSelector, &out.MetricSelector + if *in == nil { + *out = nil + } else { + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + } + out.CurrentValue = in.CurrentValue.DeepCopy() + if in.CurrentAverageValue != nil { + in, out := &in.CurrentAverageValue, &out.CurrentAverageValue + if *in == nil { + *out = nil + } else { + x := (*in).DeepCopy() + *out = &x + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalMetricStatus. +func (in *ExternalMetricStatus) DeepCopy() *ExternalMetricStatus { + if in == nil { + return nil + } + out := new(ExternalMetricStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HorizontalPodAutoscaler) DeepCopyInto(out *HorizontalPodAutoscaler) { *out = *in @@ -66,9 +143,8 @@ func (in *HorizontalPodAutoscaler) DeepCopy() *HorizontalPodAutoscaler { func (in *HorizontalPodAutoscaler) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -117,9 +193,8 @@ func (in *HorizontalPodAutoscalerList) DeepCopy() *HorizontalPodAutoscalerList { func (in *HorizontalPodAutoscalerList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -172,8 +247,7 @@ func (in *HorizontalPodAutoscalerStatus) DeepCopyInto(out *HorizontalPodAutoscal if *in == nil { *out = nil } else { - *out = new(v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } if in.CurrentMetrics != nil { @@ -233,6 +307,15 @@ func (in *MetricSpec) DeepCopyInto(out *MetricSpec) { (*in).DeepCopyInto(*out) } } + if in.External != nil { + in, out := &in.External, &out.External + if *in == nil { + *out = nil + } else { + *out = new(ExternalMetricSource) + (*in).DeepCopyInto(*out) + } + } return } @@ -276,6 +359,15 @@ func (in *MetricStatus) DeepCopyInto(out *MetricStatus) { (*in).DeepCopyInto(*out) } } + if in.External != nil { + in, out := &in.External, &out.External + if *in == nil { + *out = nil + } else { + *out = new(ExternalMetricStatus) + (*in).DeepCopyInto(*out) + } + } return } @@ -376,8 +468,8 @@ func (in *ResourceMetricSource) DeepCopyInto(out *ResourceMetricSource) { if *in == nil { *out = nil } else { - *out = new(resource.Quantity) - **out = (*in).DeepCopy() + x := (*in).DeepCopy() + *out = &x } } return diff --git a/vendor/k8s.io/api/batch/OWNERS b/vendor/k8s.io/api/batch/OWNERS index 502f90771..38935ff16 100755 --- a/vendor/k8s.io/api/batch/OWNERS +++ b/vendor/k8s.io/api/batch/OWNERS @@ -9,7 +9,6 @@ reviewers: - sttts - saad-ali - ncdc -- timothysc - soltysh - dims - errordeveloper diff --git a/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go index 53392f45a..a7179849b 100644 --- a/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -49,9 +49,8 @@ func (in *Job) DeepCopy() *Job { func (in *Job) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -101,9 +100,8 @@ func (in *JobList) DeepCopy() *JobList { func (in *JobList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -192,8 +190,7 @@ func (in *JobStatus) DeepCopyInto(out *JobStatus) { if *in == nil { *out = nil } else { - *out = new(meta_v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } if in.CompletionTime != nil { @@ -201,8 +198,7 @@ func (in *JobStatus) DeepCopyInto(out *JobStatus) { if *in == nil { *out = nil } else { - *out = new(meta_v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } return diff --git a/vendor/k8s.io/api/batch/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/batch/v1beta1/zz_generated.deepcopy.go index 528283773..78e361aba 100644 --- a/vendor/k8s.io/api/batch/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/batch/v1beta1/zz_generated.deepcopy.go @@ -16,13 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/api/core/v1" - meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -50,9 +49,8 @@ func (in *CronJob) DeepCopy() *CronJob { func (in *CronJob) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -84,9 +82,8 @@ func (in *CronJobList) DeepCopy() *CronJobList { func (in *CronJobList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -155,8 +152,7 @@ func (in *CronJobStatus) DeepCopyInto(out *CronJobStatus) { if *in == nil { *out = nil } else { - *out = new(meta_v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } return @@ -195,9 +191,8 @@ func (in *JobTemplate) DeepCopy() *JobTemplate { func (in *JobTemplate) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/batch/v2alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/batch/v2alpha1/zz_generated.deepcopy.go index 387e5610e..d8352bfbe 100644 --- a/vendor/k8s.io/api/batch/v2alpha1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/batch/v2alpha1/zz_generated.deepcopy.go @@ -16,13 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v2alpha1 import ( v1 "k8s.io/api/core/v1" - meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -50,9 +49,8 @@ func (in *CronJob) DeepCopy() *CronJob { func (in *CronJob) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -84,9 +82,8 @@ func (in *CronJobList) DeepCopy() *CronJobList { func (in *CronJobList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -155,8 +152,7 @@ func (in *CronJobStatus) DeepCopyInto(out *CronJobStatus) { if *in == nil { *out = nil } else { - *out = new(meta_v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } return @@ -195,9 +191,8 @@ func (in *JobTemplate) DeepCopy() *JobTemplate { func (in *JobTemplate) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/certificates/OWNERS b/vendor/k8s.io/api/certificates/OWNERS index 6066d2c12..1d1ab36e7 100755 --- a/vendor/k8s.io/api/certificates/OWNERS +++ b/vendor/k8s.io/api/certificates/OWNERS @@ -6,7 +6,6 @@ reviewers: - caesarxuchao - liggitt - sttts -- timothysc - dims - errordeveloper - mbohlool diff --git a/vendor/k8s.io/api/certificates/v1beta1/types.go b/vendor/k8s.io/api/certificates/v1beta1/types.go index cc33043ee..bb9e82d30 100644 --- a/vendor/k8s.io/api/certificates/v1beta1/types.go +++ b/vendor/k8s.io/api/certificates/v1beta1/types.go @@ -131,7 +131,7 @@ type KeyUsage string const ( UsageSigning KeyUsage = "signing" UsageDigitalSignature KeyUsage = "digital signature" - UsageContentCommittment KeyUsage = "content committment" + UsageContentCommittment KeyUsage = "content commitment" UsageKeyEncipherment KeyUsage = "key encipherment" UsageKeyAgreement KeyUsage = "key agreement" UsageDataEncipherment KeyUsage = "data encipherment" diff --git a/vendor/k8s.io/api/certificates/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/certificates/v1beta1/zz_generated.deepcopy.go index 53634ad17..5848a255b 100644 --- a/vendor/k8s.io/api/certificates/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/certificates/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -48,9 +48,8 @@ func (in *CertificateSigningRequest) DeepCopy() *CertificateSigningRequest { func (in *CertificateSigningRequest) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -99,9 +98,8 @@ func (in *CertificateSigningRequestList) DeepCopy() *CertificateSigningRequestLi func (in *CertificateSigningRequestList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -126,8 +124,12 @@ func (in *CertificateSigningRequestSpec) DeepCopyInto(out *CertificateSigningReq in, out := &in.Extra, &out.Extra *out = make(map[string]ExtraValue, len(*in)) for key, val := range *in { - (*out)[key] = make(ExtraValue, len(val)) - copy((*out)[key], val) + if val == nil { + (*out)[key] = nil + } else { + (*out)[key] = make([]string, len(val)) + copy((*out)[key], val) + } } } return @@ -170,3 +172,23 @@ func (in *CertificateSigningRequestStatus) DeepCopy() *CertificateSigningRequest in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ExtraValue) DeepCopyInto(out *ExtraValue) { + { + in := &in + *out = make(ExtraValue, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraValue. +func (in ExtraValue) DeepCopy() ExtraValue { + if in == nil { + return nil + } + out := new(ExtraValue) + in.DeepCopyInto(out) + return *out +} diff --git a/vendor/k8s.io/api/code-of-conduct.md b/vendor/k8s.io/api/code-of-conduct.md new file mode 100644 index 000000000..0d15c00cf --- /dev/null +++ b/vendor/k8s.io/api/code-of-conduct.md @@ -0,0 +1,3 @@ +# Kubernetes Community Code of Conduct + +Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/k8s.io/api/core/v1/BUILD b/vendor/k8s.io/api/core/v1/BUILD index 2ffdd3453..560ff5bd7 100644 --- a/vendor/k8s.io/api/core/v1/BUILD +++ b/vendor/k8s.io/api/core/v1/BUILD @@ -12,8 +12,7 @@ go_test( "taint_test.go", "toleration_test.go", ], - importpath = "k8s.io/api/core/v1", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/api/core/v1/generated.pb.go b/vendor/k8s.io/api/core/v1/generated.pb.go index 5aeae2cbc..85c7b634b 100644 --- a/vendor/k8s.io/api/core/v1/generated.pb.go +++ b/vendor/k8s.io/api/core/v1/generated.pb.go @@ -76,6 +76,7 @@ limitations under the License. EventSource ExecAction FCVolumeSource + FlexPersistentVolumeSource FlexVolumeSource FlockerVolumeSource GCEPersistentDiskVolumeSource @@ -207,6 +208,7 @@ limitations under the License. Volume VolumeDevice VolumeMount + VolumeNodeAffinity VolumeProjection VolumeSource VsphereVirtualDiskVolumeSource @@ -458,586 +460,596 @@ func (m *FCVolumeSource) Reset() { *m = FCVolumeSource{} } func (*FCVolumeSource) ProtoMessage() {} func (*FCVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{50} } +func (m *FlexPersistentVolumeSource) Reset() { *m = FlexPersistentVolumeSource{} } +func (*FlexPersistentVolumeSource) ProtoMessage() {} +func (*FlexPersistentVolumeSource) Descriptor() ([]byte, []int) { + return fileDescriptorGenerated, []int{51} +} + func (m *FlexVolumeSource) Reset() { *m = FlexVolumeSource{} } func (*FlexVolumeSource) ProtoMessage() {} -func (*FlexVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{51} } +func (*FlexVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{52} } func (m *FlockerVolumeSource) Reset() { *m = FlockerVolumeSource{} } func (*FlockerVolumeSource) ProtoMessage() {} -func (*FlockerVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{52} } +func (*FlockerVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{53} } func (m *GCEPersistentDiskVolumeSource) Reset() { *m = GCEPersistentDiskVolumeSource{} } func (*GCEPersistentDiskVolumeSource) ProtoMessage() {} func (*GCEPersistentDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{53} + return fileDescriptorGenerated, []int{54} } func (m *GitRepoVolumeSource) Reset() { *m = GitRepoVolumeSource{} } func (*GitRepoVolumeSource) ProtoMessage() {} -func (*GitRepoVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{54} } +func (*GitRepoVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{55} } func (m *GlusterfsVolumeSource) Reset() { *m = GlusterfsVolumeSource{} } func (*GlusterfsVolumeSource) ProtoMessage() {} -func (*GlusterfsVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{55} } +func (*GlusterfsVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{56} } func (m *HTTPGetAction) Reset() { *m = HTTPGetAction{} } func (*HTTPGetAction) ProtoMessage() {} -func (*HTTPGetAction) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{56} } +func (*HTTPGetAction) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{57} } func (m *HTTPHeader) Reset() { *m = HTTPHeader{} } func (*HTTPHeader) ProtoMessage() {} -func (*HTTPHeader) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{57} } +func (*HTTPHeader) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{58} } func (m *Handler) Reset() { *m = Handler{} } func (*Handler) ProtoMessage() {} -func (*Handler) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{58} } +func (*Handler) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{59} } func (m *HostAlias) Reset() { *m = HostAlias{} } func (*HostAlias) ProtoMessage() {} -func (*HostAlias) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{59} } +func (*HostAlias) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{60} } func (m *HostPathVolumeSource) Reset() { *m = HostPathVolumeSource{} } func (*HostPathVolumeSource) ProtoMessage() {} -func (*HostPathVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{60} } +func (*HostPathVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{61} } func (m *ISCSIPersistentVolumeSource) Reset() { *m = ISCSIPersistentVolumeSource{} } func (*ISCSIPersistentVolumeSource) ProtoMessage() {} func (*ISCSIPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{61} + return fileDescriptorGenerated, []int{62} } func (m *ISCSIVolumeSource) Reset() { *m = ISCSIVolumeSource{} } func (*ISCSIVolumeSource) ProtoMessage() {} -func (*ISCSIVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{62} } +func (*ISCSIVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{63} } func (m *KeyToPath) Reset() { *m = KeyToPath{} } func (*KeyToPath) ProtoMessage() {} -func (*KeyToPath) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{63} } +func (*KeyToPath) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{64} } func (m *Lifecycle) Reset() { *m = Lifecycle{} } func (*Lifecycle) ProtoMessage() {} -func (*Lifecycle) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{64} } +func (*Lifecycle) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{65} } func (m *LimitRange) Reset() { *m = LimitRange{} } func (*LimitRange) ProtoMessage() {} -func (*LimitRange) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{65} } +func (*LimitRange) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{66} } func (m *LimitRangeItem) Reset() { *m = LimitRangeItem{} } func (*LimitRangeItem) ProtoMessage() {} -func (*LimitRangeItem) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{66} } +func (*LimitRangeItem) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{67} } func (m *LimitRangeList) Reset() { *m = LimitRangeList{} } func (*LimitRangeList) ProtoMessage() {} -func (*LimitRangeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{67} } +func (*LimitRangeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{68} } func (m *LimitRangeSpec) Reset() { *m = LimitRangeSpec{} } func (*LimitRangeSpec) ProtoMessage() {} -func (*LimitRangeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{68} } +func (*LimitRangeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{69} } func (m *List) Reset() { *m = List{} } func (*List) ProtoMessage() {} -func (*List) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{69} } +func (*List) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{70} } func (m *ListOptions) Reset() { *m = ListOptions{} } func (*ListOptions) ProtoMessage() {} -func (*ListOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{70} } +func (*ListOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{71} } func (m *LoadBalancerIngress) Reset() { *m = LoadBalancerIngress{} } func (*LoadBalancerIngress) ProtoMessage() {} -func (*LoadBalancerIngress) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{71} } +func (*LoadBalancerIngress) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{72} } func (m *LoadBalancerStatus) Reset() { *m = LoadBalancerStatus{} } func (*LoadBalancerStatus) ProtoMessage() {} -func (*LoadBalancerStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{72} } +func (*LoadBalancerStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{73} } func (m *LocalObjectReference) Reset() { *m = LocalObjectReference{} } func (*LocalObjectReference) ProtoMessage() {} -func (*LocalObjectReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{73} } +func (*LocalObjectReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{74} } func (m *LocalVolumeSource) Reset() { *m = LocalVolumeSource{} } func (*LocalVolumeSource) ProtoMessage() {} -func (*LocalVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{74} } +func (*LocalVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{75} } func (m *NFSVolumeSource) Reset() { *m = NFSVolumeSource{} } func (*NFSVolumeSource) ProtoMessage() {} -func (*NFSVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{75} } +func (*NFSVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{76} } func (m *Namespace) Reset() { *m = Namespace{} } func (*Namespace) ProtoMessage() {} -func (*Namespace) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{76} } +func (*Namespace) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{77} } func (m *NamespaceList) Reset() { *m = NamespaceList{} } func (*NamespaceList) ProtoMessage() {} -func (*NamespaceList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{77} } +func (*NamespaceList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{78} } func (m *NamespaceSpec) Reset() { *m = NamespaceSpec{} } func (*NamespaceSpec) ProtoMessage() {} -func (*NamespaceSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{78} } +func (*NamespaceSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{79} } func (m *NamespaceStatus) Reset() { *m = NamespaceStatus{} } func (*NamespaceStatus) ProtoMessage() {} -func (*NamespaceStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{79} } +func (*NamespaceStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{80} } func (m *Node) Reset() { *m = Node{} } func (*Node) ProtoMessage() {} -func (*Node) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{80} } +func (*Node) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{81} } func (m *NodeAddress) Reset() { *m = NodeAddress{} } func (*NodeAddress) ProtoMessage() {} -func (*NodeAddress) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{81} } +func (*NodeAddress) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{82} } func (m *NodeAffinity) Reset() { *m = NodeAffinity{} } func (*NodeAffinity) ProtoMessage() {} -func (*NodeAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{82} } +func (*NodeAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{83} } func (m *NodeCondition) Reset() { *m = NodeCondition{} } func (*NodeCondition) ProtoMessage() {} -func (*NodeCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{83} } +func (*NodeCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{84} } func (m *NodeConfigSource) Reset() { *m = NodeConfigSource{} } func (*NodeConfigSource) ProtoMessage() {} -func (*NodeConfigSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{84} } +func (*NodeConfigSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{85} } func (m *NodeDaemonEndpoints) Reset() { *m = NodeDaemonEndpoints{} } func (*NodeDaemonEndpoints) ProtoMessage() {} -func (*NodeDaemonEndpoints) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{85} } +func (*NodeDaemonEndpoints) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{86} } func (m *NodeList) Reset() { *m = NodeList{} } func (*NodeList) ProtoMessage() {} -func (*NodeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{86} } +func (*NodeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{87} } func (m *NodeProxyOptions) Reset() { *m = NodeProxyOptions{} } func (*NodeProxyOptions) ProtoMessage() {} -func (*NodeProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{87} } +func (*NodeProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{88} } func (m *NodeResources) Reset() { *m = NodeResources{} } func (*NodeResources) ProtoMessage() {} -func (*NodeResources) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{88} } +func (*NodeResources) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{89} } func (m *NodeSelector) Reset() { *m = NodeSelector{} } func (*NodeSelector) ProtoMessage() {} -func (*NodeSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{89} } +func (*NodeSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{90} } func (m *NodeSelectorRequirement) Reset() { *m = NodeSelectorRequirement{} } func (*NodeSelectorRequirement) ProtoMessage() {} func (*NodeSelectorRequirement) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{90} + return fileDescriptorGenerated, []int{91} } func (m *NodeSelectorTerm) Reset() { *m = NodeSelectorTerm{} } func (*NodeSelectorTerm) ProtoMessage() {} -func (*NodeSelectorTerm) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{91} } +func (*NodeSelectorTerm) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{92} } func (m *NodeSpec) Reset() { *m = NodeSpec{} } func (*NodeSpec) ProtoMessage() {} -func (*NodeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{92} } +func (*NodeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{93} } func (m *NodeStatus) Reset() { *m = NodeStatus{} } func (*NodeStatus) ProtoMessage() {} -func (*NodeStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{93} } +func (*NodeStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{94} } func (m *NodeSystemInfo) Reset() { *m = NodeSystemInfo{} } func (*NodeSystemInfo) ProtoMessage() {} -func (*NodeSystemInfo) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{94} } +func (*NodeSystemInfo) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{95} } func (m *ObjectFieldSelector) Reset() { *m = ObjectFieldSelector{} } func (*ObjectFieldSelector) ProtoMessage() {} -func (*ObjectFieldSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{95} } +func (*ObjectFieldSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{96} } func (m *ObjectMeta) Reset() { *m = ObjectMeta{} } func (*ObjectMeta) ProtoMessage() {} -func (*ObjectMeta) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{96} } +func (*ObjectMeta) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{97} } func (m *ObjectReference) Reset() { *m = ObjectReference{} } func (*ObjectReference) ProtoMessage() {} -func (*ObjectReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{97} } +func (*ObjectReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{98} } func (m *PersistentVolume) Reset() { *m = PersistentVolume{} } func (*PersistentVolume) ProtoMessage() {} -func (*PersistentVolume) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{98} } +func (*PersistentVolume) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{99} } func (m *PersistentVolumeClaim) Reset() { *m = PersistentVolumeClaim{} } func (*PersistentVolumeClaim) ProtoMessage() {} -func (*PersistentVolumeClaim) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{99} } +func (*PersistentVolumeClaim) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{100} } func (m *PersistentVolumeClaimCondition) Reset() { *m = PersistentVolumeClaimCondition{} } func (*PersistentVolumeClaimCondition) ProtoMessage() {} func (*PersistentVolumeClaimCondition) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{100} + return fileDescriptorGenerated, []int{101} } func (m *PersistentVolumeClaimList) Reset() { *m = PersistentVolumeClaimList{} } func (*PersistentVolumeClaimList) ProtoMessage() {} func (*PersistentVolumeClaimList) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{101} + return fileDescriptorGenerated, []int{102} } func (m *PersistentVolumeClaimSpec) Reset() { *m = PersistentVolumeClaimSpec{} } func (*PersistentVolumeClaimSpec) ProtoMessage() {} func (*PersistentVolumeClaimSpec) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{102} + return fileDescriptorGenerated, []int{103} } func (m *PersistentVolumeClaimStatus) Reset() { *m = PersistentVolumeClaimStatus{} } func (*PersistentVolumeClaimStatus) ProtoMessage() {} func (*PersistentVolumeClaimStatus) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{103} + return fileDescriptorGenerated, []int{104} } func (m *PersistentVolumeClaimVolumeSource) Reset() { *m = PersistentVolumeClaimVolumeSource{} } func (*PersistentVolumeClaimVolumeSource) ProtoMessage() {} func (*PersistentVolumeClaimVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{104} + return fileDescriptorGenerated, []int{105} } func (m *PersistentVolumeList) Reset() { *m = PersistentVolumeList{} } func (*PersistentVolumeList) ProtoMessage() {} -func (*PersistentVolumeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{105} } +func (*PersistentVolumeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{106} } func (m *PersistentVolumeSource) Reset() { *m = PersistentVolumeSource{} } func (*PersistentVolumeSource) ProtoMessage() {} func (*PersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{106} + return fileDescriptorGenerated, []int{107} } func (m *PersistentVolumeSpec) Reset() { *m = PersistentVolumeSpec{} } func (*PersistentVolumeSpec) ProtoMessage() {} -func (*PersistentVolumeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{107} } +func (*PersistentVolumeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{108} } func (m *PersistentVolumeStatus) Reset() { *m = PersistentVolumeStatus{} } func (*PersistentVolumeStatus) ProtoMessage() {} func (*PersistentVolumeStatus) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{108} + return fileDescriptorGenerated, []int{109} } func (m *PhotonPersistentDiskVolumeSource) Reset() { *m = PhotonPersistentDiskVolumeSource{} } func (*PhotonPersistentDiskVolumeSource) ProtoMessage() {} func (*PhotonPersistentDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{109} + return fileDescriptorGenerated, []int{110} } func (m *Pod) Reset() { *m = Pod{} } func (*Pod) ProtoMessage() {} -func (*Pod) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{110} } +func (*Pod) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{111} } func (m *PodAffinity) Reset() { *m = PodAffinity{} } func (*PodAffinity) ProtoMessage() {} -func (*PodAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{111} } +func (*PodAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{112} } func (m *PodAffinityTerm) Reset() { *m = PodAffinityTerm{} } func (*PodAffinityTerm) ProtoMessage() {} -func (*PodAffinityTerm) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{112} } +func (*PodAffinityTerm) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{113} } func (m *PodAntiAffinity) Reset() { *m = PodAntiAffinity{} } func (*PodAntiAffinity) ProtoMessage() {} -func (*PodAntiAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{113} } +func (*PodAntiAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{114} } func (m *PodAttachOptions) Reset() { *m = PodAttachOptions{} } func (*PodAttachOptions) ProtoMessage() {} -func (*PodAttachOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{114} } +func (*PodAttachOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{115} } func (m *PodCondition) Reset() { *m = PodCondition{} } func (*PodCondition) ProtoMessage() {} -func (*PodCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{115} } +func (*PodCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{116} } func (m *PodDNSConfig) Reset() { *m = PodDNSConfig{} } func (*PodDNSConfig) ProtoMessage() {} -func (*PodDNSConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{116} } +func (*PodDNSConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{117} } func (m *PodDNSConfigOption) Reset() { *m = PodDNSConfigOption{} } func (*PodDNSConfigOption) ProtoMessage() {} -func (*PodDNSConfigOption) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{117} } +func (*PodDNSConfigOption) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{118} } func (m *PodExecOptions) Reset() { *m = PodExecOptions{} } func (*PodExecOptions) ProtoMessage() {} -func (*PodExecOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{118} } +func (*PodExecOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{119} } func (m *PodList) Reset() { *m = PodList{} } func (*PodList) ProtoMessage() {} -func (*PodList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{119} } +func (*PodList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{120} } func (m *PodLogOptions) Reset() { *m = PodLogOptions{} } func (*PodLogOptions) ProtoMessage() {} -func (*PodLogOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{120} } +func (*PodLogOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{121} } func (m *PodPortForwardOptions) Reset() { *m = PodPortForwardOptions{} } func (*PodPortForwardOptions) ProtoMessage() {} -func (*PodPortForwardOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{121} } +func (*PodPortForwardOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{122} } func (m *PodProxyOptions) Reset() { *m = PodProxyOptions{} } func (*PodProxyOptions) ProtoMessage() {} -func (*PodProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{122} } +func (*PodProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{123} } func (m *PodSecurityContext) Reset() { *m = PodSecurityContext{} } func (*PodSecurityContext) ProtoMessage() {} -func (*PodSecurityContext) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{123} } +func (*PodSecurityContext) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{124} } func (m *PodSignature) Reset() { *m = PodSignature{} } func (*PodSignature) ProtoMessage() {} -func (*PodSignature) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{124} } +func (*PodSignature) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{125} } func (m *PodSpec) Reset() { *m = PodSpec{} } func (*PodSpec) ProtoMessage() {} -func (*PodSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{125} } +func (*PodSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{126} } func (m *PodStatus) Reset() { *m = PodStatus{} } func (*PodStatus) ProtoMessage() {} -func (*PodStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{126} } +func (*PodStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{127} } func (m *PodStatusResult) Reset() { *m = PodStatusResult{} } func (*PodStatusResult) ProtoMessage() {} -func (*PodStatusResult) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{127} } +func (*PodStatusResult) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{128} } func (m *PodTemplate) Reset() { *m = PodTemplate{} } func (*PodTemplate) ProtoMessage() {} -func (*PodTemplate) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{128} } +func (*PodTemplate) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{129} } func (m *PodTemplateList) Reset() { *m = PodTemplateList{} } func (*PodTemplateList) ProtoMessage() {} -func (*PodTemplateList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{129} } +func (*PodTemplateList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{130} } func (m *PodTemplateSpec) Reset() { *m = PodTemplateSpec{} } func (*PodTemplateSpec) ProtoMessage() {} -func (*PodTemplateSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{130} } +func (*PodTemplateSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{131} } func (m *PortworxVolumeSource) Reset() { *m = PortworxVolumeSource{} } func (*PortworxVolumeSource) ProtoMessage() {} -func (*PortworxVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{131} } +func (*PortworxVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{132} } func (m *Preconditions) Reset() { *m = Preconditions{} } func (*Preconditions) ProtoMessage() {} -func (*Preconditions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{132} } +func (*Preconditions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{133} } func (m *PreferAvoidPodsEntry) Reset() { *m = PreferAvoidPodsEntry{} } func (*PreferAvoidPodsEntry) ProtoMessage() {} -func (*PreferAvoidPodsEntry) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{133} } +func (*PreferAvoidPodsEntry) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{134} } func (m *PreferredSchedulingTerm) Reset() { *m = PreferredSchedulingTerm{} } func (*PreferredSchedulingTerm) ProtoMessage() {} func (*PreferredSchedulingTerm) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{134} + return fileDescriptorGenerated, []int{135} } func (m *Probe) Reset() { *m = Probe{} } func (*Probe) ProtoMessage() {} -func (*Probe) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{135} } +func (*Probe) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{136} } func (m *ProjectedVolumeSource) Reset() { *m = ProjectedVolumeSource{} } func (*ProjectedVolumeSource) ProtoMessage() {} -func (*ProjectedVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{136} } +func (*ProjectedVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{137} } func (m *QuobyteVolumeSource) Reset() { *m = QuobyteVolumeSource{} } func (*QuobyteVolumeSource) ProtoMessage() {} -func (*QuobyteVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{137} } +func (*QuobyteVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{138} } func (m *RBDPersistentVolumeSource) Reset() { *m = RBDPersistentVolumeSource{} } func (*RBDPersistentVolumeSource) ProtoMessage() {} func (*RBDPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{138} + return fileDescriptorGenerated, []int{139} } func (m *RBDVolumeSource) Reset() { *m = RBDVolumeSource{} } func (*RBDVolumeSource) ProtoMessage() {} -func (*RBDVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{139} } +func (*RBDVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{140} } func (m *RangeAllocation) Reset() { *m = RangeAllocation{} } func (*RangeAllocation) ProtoMessage() {} -func (*RangeAllocation) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{140} } +func (*RangeAllocation) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{141} } func (m *ReplicationController) Reset() { *m = ReplicationController{} } func (*ReplicationController) ProtoMessage() {} -func (*ReplicationController) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{141} } +func (*ReplicationController) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{142} } func (m *ReplicationControllerCondition) Reset() { *m = ReplicationControllerCondition{} } func (*ReplicationControllerCondition) ProtoMessage() {} func (*ReplicationControllerCondition) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{142} + return fileDescriptorGenerated, []int{143} } func (m *ReplicationControllerList) Reset() { *m = ReplicationControllerList{} } func (*ReplicationControllerList) ProtoMessage() {} func (*ReplicationControllerList) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{143} + return fileDescriptorGenerated, []int{144} } func (m *ReplicationControllerSpec) Reset() { *m = ReplicationControllerSpec{} } func (*ReplicationControllerSpec) ProtoMessage() {} func (*ReplicationControllerSpec) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{144} + return fileDescriptorGenerated, []int{145} } func (m *ReplicationControllerStatus) Reset() { *m = ReplicationControllerStatus{} } func (*ReplicationControllerStatus) ProtoMessage() {} func (*ReplicationControllerStatus) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{145} + return fileDescriptorGenerated, []int{146} } func (m *ResourceFieldSelector) Reset() { *m = ResourceFieldSelector{} } func (*ResourceFieldSelector) ProtoMessage() {} -func (*ResourceFieldSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{146} } +func (*ResourceFieldSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{147} } func (m *ResourceQuota) Reset() { *m = ResourceQuota{} } func (*ResourceQuota) ProtoMessage() {} -func (*ResourceQuota) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{147} } +func (*ResourceQuota) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{148} } func (m *ResourceQuotaList) Reset() { *m = ResourceQuotaList{} } func (*ResourceQuotaList) ProtoMessage() {} -func (*ResourceQuotaList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{148} } +func (*ResourceQuotaList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{149} } func (m *ResourceQuotaSpec) Reset() { *m = ResourceQuotaSpec{} } func (*ResourceQuotaSpec) ProtoMessage() {} -func (*ResourceQuotaSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{149} } +func (*ResourceQuotaSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{150} } func (m *ResourceQuotaStatus) Reset() { *m = ResourceQuotaStatus{} } func (*ResourceQuotaStatus) ProtoMessage() {} -func (*ResourceQuotaStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{150} } +func (*ResourceQuotaStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{151} } func (m *ResourceRequirements) Reset() { *m = ResourceRequirements{} } func (*ResourceRequirements) ProtoMessage() {} -func (*ResourceRequirements) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{151} } +func (*ResourceRequirements) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{152} } func (m *SELinuxOptions) Reset() { *m = SELinuxOptions{} } func (*SELinuxOptions) ProtoMessage() {} -func (*SELinuxOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{152} } +func (*SELinuxOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{153} } func (m *ScaleIOPersistentVolumeSource) Reset() { *m = ScaleIOPersistentVolumeSource{} } func (*ScaleIOPersistentVolumeSource) ProtoMessage() {} func (*ScaleIOPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{153} + return fileDescriptorGenerated, []int{154} } func (m *ScaleIOVolumeSource) Reset() { *m = ScaleIOVolumeSource{} } func (*ScaleIOVolumeSource) ProtoMessage() {} -func (*ScaleIOVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{154} } +func (*ScaleIOVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{155} } func (m *Secret) Reset() { *m = Secret{} } func (*Secret) ProtoMessage() {} -func (*Secret) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{155} } +func (*Secret) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{156} } func (m *SecretEnvSource) Reset() { *m = SecretEnvSource{} } func (*SecretEnvSource) ProtoMessage() {} -func (*SecretEnvSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{156} } +func (*SecretEnvSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{157} } func (m *SecretKeySelector) Reset() { *m = SecretKeySelector{} } func (*SecretKeySelector) ProtoMessage() {} -func (*SecretKeySelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{157} } +func (*SecretKeySelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{158} } func (m *SecretList) Reset() { *m = SecretList{} } func (*SecretList) ProtoMessage() {} -func (*SecretList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{158} } +func (*SecretList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{159} } func (m *SecretProjection) Reset() { *m = SecretProjection{} } func (*SecretProjection) ProtoMessage() {} -func (*SecretProjection) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{159} } +func (*SecretProjection) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{160} } func (m *SecretReference) Reset() { *m = SecretReference{} } func (*SecretReference) ProtoMessage() {} -func (*SecretReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{160} } +func (*SecretReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{161} } func (m *SecretVolumeSource) Reset() { *m = SecretVolumeSource{} } func (*SecretVolumeSource) ProtoMessage() {} -func (*SecretVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{161} } +func (*SecretVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{162} } func (m *SecurityContext) Reset() { *m = SecurityContext{} } func (*SecurityContext) ProtoMessage() {} -func (*SecurityContext) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{162} } +func (*SecurityContext) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{163} } func (m *SerializedReference) Reset() { *m = SerializedReference{} } func (*SerializedReference) ProtoMessage() {} -func (*SerializedReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{163} } +func (*SerializedReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{164} } func (m *Service) Reset() { *m = Service{} } func (*Service) ProtoMessage() {} -func (*Service) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{164} } +func (*Service) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{165} } func (m *ServiceAccount) Reset() { *m = ServiceAccount{} } func (*ServiceAccount) ProtoMessage() {} -func (*ServiceAccount) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{165} } +func (*ServiceAccount) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{166} } func (m *ServiceAccountList) Reset() { *m = ServiceAccountList{} } func (*ServiceAccountList) ProtoMessage() {} -func (*ServiceAccountList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{166} } +func (*ServiceAccountList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{167} } func (m *ServiceList) Reset() { *m = ServiceList{} } func (*ServiceList) ProtoMessage() {} -func (*ServiceList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{167} } +func (*ServiceList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{168} } func (m *ServicePort) Reset() { *m = ServicePort{} } func (*ServicePort) ProtoMessage() {} -func (*ServicePort) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{168} } +func (*ServicePort) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{169} } func (m *ServiceProxyOptions) Reset() { *m = ServiceProxyOptions{} } func (*ServiceProxyOptions) ProtoMessage() {} -func (*ServiceProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{169} } +func (*ServiceProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{170} } func (m *ServiceSpec) Reset() { *m = ServiceSpec{} } func (*ServiceSpec) ProtoMessage() {} -func (*ServiceSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{170} } +func (*ServiceSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{171} } func (m *ServiceStatus) Reset() { *m = ServiceStatus{} } func (*ServiceStatus) ProtoMessage() {} -func (*ServiceStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{171} } +func (*ServiceStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{172} } func (m *SessionAffinityConfig) Reset() { *m = SessionAffinityConfig{} } func (*SessionAffinityConfig) ProtoMessage() {} -func (*SessionAffinityConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{172} } +func (*SessionAffinityConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{173} } func (m *StorageOSPersistentVolumeSource) Reset() { *m = StorageOSPersistentVolumeSource{} } func (*StorageOSPersistentVolumeSource) ProtoMessage() {} func (*StorageOSPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{173} + return fileDescriptorGenerated, []int{174} } func (m *StorageOSVolumeSource) Reset() { *m = StorageOSVolumeSource{} } func (*StorageOSVolumeSource) ProtoMessage() {} -func (*StorageOSVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{174} } +func (*StorageOSVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{175} } func (m *Sysctl) Reset() { *m = Sysctl{} } func (*Sysctl) ProtoMessage() {} -func (*Sysctl) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{175} } +func (*Sysctl) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{176} } func (m *TCPSocketAction) Reset() { *m = TCPSocketAction{} } func (*TCPSocketAction) ProtoMessage() {} -func (*TCPSocketAction) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{176} } +func (*TCPSocketAction) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{177} } func (m *Taint) Reset() { *m = Taint{} } func (*Taint) ProtoMessage() {} -func (*Taint) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{177} } +func (*Taint) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{178} } func (m *Toleration) Reset() { *m = Toleration{} } func (*Toleration) ProtoMessage() {} -func (*Toleration) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{178} } +func (*Toleration) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{179} } func (m *Volume) Reset() { *m = Volume{} } func (*Volume) ProtoMessage() {} -func (*Volume) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{179} } +func (*Volume) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{180} } func (m *VolumeDevice) Reset() { *m = VolumeDevice{} } func (*VolumeDevice) ProtoMessage() {} -func (*VolumeDevice) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{180} } +func (*VolumeDevice) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{181} } func (m *VolumeMount) Reset() { *m = VolumeMount{} } func (*VolumeMount) ProtoMessage() {} -func (*VolumeMount) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{181} } +func (*VolumeMount) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{182} } + +func (m *VolumeNodeAffinity) Reset() { *m = VolumeNodeAffinity{} } +func (*VolumeNodeAffinity) ProtoMessage() {} +func (*VolumeNodeAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{183} } func (m *VolumeProjection) Reset() { *m = VolumeProjection{} } func (*VolumeProjection) ProtoMessage() {} -func (*VolumeProjection) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{182} } +func (*VolumeProjection) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{184} } func (m *VolumeSource) Reset() { *m = VolumeSource{} } func (*VolumeSource) ProtoMessage() {} -func (*VolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{183} } +func (*VolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{185} } func (m *VsphereVirtualDiskVolumeSource) Reset() { *m = VsphereVirtualDiskVolumeSource{} } func (*VsphereVirtualDiskVolumeSource) ProtoMessage() {} func (*VsphereVirtualDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{184} + return fileDescriptorGenerated, []int{186} } func (m *WeightedPodAffinityTerm) Reset() { *m = WeightedPodAffinityTerm{} } func (*WeightedPodAffinityTerm) ProtoMessage() {} func (*WeightedPodAffinityTerm) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{185} + return fileDescriptorGenerated, []int{187} } func init() { @@ -1092,6 +1104,7 @@ func init() { proto.RegisterType((*EventSource)(nil), "k8s.io.api.core.v1.EventSource") proto.RegisterType((*ExecAction)(nil), "k8s.io.api.core.v1.ExecAction") proto.RegisterType((*FCVolumeSource)(nil), "k8s.io.api.core.v1.FCVolumeSource") + proto.RegisterType((*FlexPersistentVolumeSource)(nil), "k8s.io.api.core.v1.FlexPersistentVolumeSource") proto.RegisterType((*FlexVolumeSource)(nil), "k8s.io.api.core.v1.FlexVolumeSource") proto.RegisterType((*FlockerVolumeSource)(nil), "k8s.io.api.core.v1.FlockerVolumeSource") proto.RegisterType((*GCEPersistentDiskVolumeSource)(nil), "k8s.io.api.core.v1.GCEPersistentDiskVolumeSource") @@ -1223,6 +1236,7 @@ func init() { proto.RegisterType((*Volume)(nil), "k8s.io.api.core.v1.Volume") proto.RegisterType((*VolumeDevice)(nil), "k8s.io.api.core.v1.VolumeDevice") proto.RegisterType((*VolumeMount)(nil), "k8s.io.api.core.v1.VolumeMount") + proto.RegisterType((*VolumeNodeAffinity)(nil), "k8s.io.api.core.v1.VolumeNodeAffinity") proto.RegisterType((*VolumeProjection)(nil), "k8s.io.api.core.v1.VolumeProjection") proto.RegisterType((*VolumeSource)(nil), "k8s.io.api.core.v1.VolumeSource") proto.RegisterType((*VsphereVirtualDiskVolumeSource)(nil), "k8s.io.api.core.v1.VsphereVirtualDiskVolumeSource") @@ -1562,6 +1576,62 @@ func (m *CSIPersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0 } i++ + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FSType))) + i += copy(dAtA[i:], m.FSType) + if len(m.VolumeAttributes) > 0 { + keysForVolumeAttributes := make([]string, 0, len(m.VolumeAttributes)) + for k := range m.VolumeAttributes { + keysForVolumeAttributes = append(keysForVolumeAttributes, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForVolumeAttributes) + for _, k := range keysForVolumeAttributes { + dAtA[i] = 0x2a + i++ + v := m.VolumeAttributes[string(k)] + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } + if m.ControllerPublishSecretRef != nil { + dAtA[i] = 0x32 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.ControllerPublishSecretRef.Size())) + n6, err := m.ControllerPublishSecretRef.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n6 + } + if m.NodeStageSecretRef != nil { + dAtA[i] = 0x3a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.NodeStageSecretRef.Size())) + n7, err := m.NodeStageSecretRef.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n7 + } + if m.NodePublishSecretRef != nil { + dAtA[i] = 0x42 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.NodePublishSecretRef.Size())) + n8, err := m.NodePublishSecretRef.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n8 + } return i, nil } @@ -1659,11 +1729,11 @@ func (m *CephFSPersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n6, err := m.SecretRef.MarshalTo(dAtA[i:]) + n9, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n6 + i += n9 } dAtA[i] = 0x30 i++ @@ -1722,11 +1792,11 @@ func (m *CephFSVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n7, err := m.SecretRef.MarshalTo(dAtA[i:]) + n10, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n7 + i += n10 } dAtA[i] = 0x30 i++ @@ -1848,11 +1918,11 @@ func (m *ComponentStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n8, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n11, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n8 + i += n11 if len(m.Conditions) > 0 { for _, msg := range m.Conditions { dAtA[i] = 0x12 @@ -1886,11 +1956,11 @@ func (m *ComponentStatusList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n9, err := m.ListMeta.MarshalTo(dAtA[i:]) + n12, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n12 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -1924,11 +1994,11 @@ func (m *ConfigMap) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n10, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n13, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n10 + i += n13 if len(m.Data) > 0 { keysForData := make([]string, 0, len(m.Data)) for k := range m.Data { @@ -1951,6 +2021,34 @@ func (m *ConfigMap) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], v) } } + if len(m.BinaryData) > 0 { + keysForBinaryData := make([]string, 0, len(m.BinaryData)) + for k := range m.BinaryData { + keysForBinaryData = append(keysForBinaryData, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForBinaryData) + for _, k := range keysForBinaryData { + dAtA[i] = 0x1a + i++ + v := m.BinaryData[string(k)] + byteSize := 0 + if v != nil { + byteSize = 1 + len(v) + sovGenerated(uint64(len(v))) + } + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + byteSize + i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + if v != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } + } return i, nil } @@ -1972,11 +2070,11 @@ func (m *ConfigMapEnvSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LocalObjectReference.Size())) - n11, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) + n14, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n11 + i += n14 if m.Optional != nil { dAtA[i] = 0x10 i++ @@ -2008,11 +2106,11 @@ func (m *ConfigMapKeySelector) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LocalObjectReference.Size())) - n12, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) + n15, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n12 + i += n15 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) @@ -2048,11 +2146,11 @@ func (m *ConfigMapList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n13, err := m.ListMeta.MarshalTo(dAtA[i:]) + n16, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n13 + i += n16 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -2086,11 +2184,11 @@ func (m *ConfigMapProjection) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LocalObjectReference.Size())) - n14, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) + n17, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n14 + i += n17 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -2134,11 +2232,11 @@ func (m *ConfigMapVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LocalObjectReference.Size())) - n15, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) + n18, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n15 + i += n18 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -2253,11 +2351,11 @@ func (m *Container) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x42 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Resources.Size())) - n16, err := m.Resources.MarshalTo(dAtA[i:]) + n19, err := m.Resources.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n16 + i += n19 if len(m.VolumeMounts) > 0 { for _, msg := range m.VolumeMounts { dAtA[i] = 0x4a @@ -2274,31 +2372,31 @@ func (m *Container) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x52 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LivenessProbe.Size())) - n17, err := m.LivenessProbe.MarshalTo(dAtA[i:]) + n20, err := m.LivenessProbe.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n17 + i += n20 } if m.ReadinessProbe != nil { dAtA[i] = 0x5a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ReadinessProbe.Size())) - n18, err := m.ReadinessProbe.MarshalTo(dAtA[i:]) + n21, err := m.ReadinessProbe.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n18 + i += n21 } if m.Lifecycle != nil { dAtA[i] = 0x62 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Lifecycle.Size())) - n19, err := m.Lifecycle.MarshalTo(dAtA[i:]) + n22, err := m.Lifecycle.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n19 + i += n22 } dAtA[i] = 0x6a i++ @@ -2312,11 +2410,11 @@ func (m *Container) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x7a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecurityContext.Size())) - n20, err := m.SecurityContext.MarshalTo(dAtA[i:]) + n23, err := m.SecurityContext.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n20 + i += n23 } dAtA[i] = 0x80 i++ @@ -2476,31 +2574,31 @@ func (m *ContainerState) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Waiting.Size())) - n21, err := m.Waiting.MarshalTo(dAtA[i:]) + n24, err := m.Waiting.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n21 + i += n24 } if m.Running != nil { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Running.Size())) - n22, err := m.Running.MarshalTo(dAtA[i:]) + n25, err := m.Running.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n22 + i += n25 } if m.Terminated != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Terminated.Size())) - n23, err := m.Terminated.MarshalTo(dAtA[i:]) + n26, err := m.Terminated.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n23 + i += n26 } return i, nil } @@ -2523,11 +2621,11 @@ func (m *ContainerStateRunning) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.StartedAt.Size())) - n24, err := m.StartedAt.MarshalTo(dAtA[i:]) + n27, err := m.StartedAt.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n24 + i += n27 return i, nil } @@ -2563,19 +2661,19 @@ func (m *ContainerStateTerminated) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.StartedAt.Size())) - n25, err := m.StartedAt.MarshalTo(dAtA[i:]) + n28, err := m.StartedAt.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n25 + i += n28 dAtA[i] = 0x32 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.FinishedAt.Size())) - n26, err := m.FinishedAt.MarshalTo(dAtA[i:]) + n29, err := m.FinishedAt.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n26 + i += n29 dAtA[i] = 0x3a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.ContainerID))) @@ -2631,19 +2729,19 @@ func (m *ContainerStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.State.Size())) - n27, err := m.State.MarshalTo(dAtA[i:]) + n30, err := m.State.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n27 + i += n30 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastTerminationState.Size())) - n28, err := m.LastTerminationState.MarshalTo(dAtA[i:]) + n31, err := m.LastTerminationState.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n28 + i += n31 dAtA[i] = 0x20 i++ if m.Ready { @@ -2715,11 +2813,11 @@ func (m *DeleteOptions) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Preconditions.Size())) - n29, err := m.Preconditions.MarshalTo(dAtA[i:]) + n32, err := m.Preconditions.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n29 + i += n32 } if m.OrphanDependents != nil { dAtA[i] = 0x18 @@ -2793,21 +2891,21 @@ func (m *DownwardAPIVolumeFile) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.FieldRef.Size())) - n30, err := m.FieldRef.MarshalTo(dAtA[i:]) + n33, err := m.FieldRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n30 + i += n33 } if m.ResourceFieldRef != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ResourceFieldRef.Size())) - n31, err := m.ResourceFieldRef.MarshalTo(dAtA[i:]) + n34, err := m.ResourceFieldRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n31 + i += n34 } if m.Mode != nil { dAtA[i] = 0x20 @@ -2875,11 +2973,11 @@ func (m *EmptyDirVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SizeLimit.Size())) - n32, err := m.SizeLimit.MarshalTo(dAtA[i:]) + n35, err := m.SizeLimit.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n32 + i += n35 } return i, nil } @@ -2907,11 +3005,11 @@ func (m *EndpointAddress) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.TargetRef.Size())) - n33, err := m.TargetRef.MarshalTo(dAtA[i:]) + n36, err := m.TargetRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n33 + i += n36 } dAtA[i] = 0x1a i++ @@ -3027,11 +3125,11 @@ func (m *Endpoints) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n34, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n37, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n34 + i += n37 if len(m.Subsets) > 0 { for _, msg := range m.Subsets { dAtA[i] = 0x12 @@ -3065,11 +3163,11 @@ func (m *EndpointsList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n35, err := m.ListMeta.MarshalTo(dAtA[i:]) + n38, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n35 + i += n38 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -3108,21 +3206,21 @@ func (m *EnvFromSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ConfigMapRef.Size())) - n36, err := m.ConfigMapRef.MarshalTo(dAtA[i:]) + n39, err := m.ConfigMapRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n36 + i += n39 } if m.SecretRef != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n37, err := m.SecretRef.MarshalTo(dAtA[i:]) + n40, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n37 + i += n40 } return i, nil } @@ -3154,11 +3252,11 @@ func (m *EnvVar) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ValueFrom.Size())) - n38, err := m.ValueFrom.MarshalTo(dAtA[i:]) + n41, err := m.ValueFrom.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n38 + i += n41 } return i, nil } @@ -3182,41 +3280,41 @@ func (m *EnvVarSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.FieldRef.Size())) - n39, err := m.FieldRef.MarshalTo(dAtA[i:]) + n42, err := m.FieldRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n39 + i += n42 } if m.ResourceFieldRef != nil { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ResourceFieldRef.Size())) - n40, err := m.ResourceFieldRef.MarshalTo(dAtA[i:]) + n43, err := m.ResourceFieldRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n40 + i += n43 } if m.ConfigMapKeyRef != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ConfigMapKeyRef.Size())) - n41, err := m.ConfigMapKeyRef.MarshalTo(dAtA[i:]) + n44, err := m.ConfigMapKeyRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n41 + i += n44 } if m.SecretKeyRef != nil { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretKeyRef.Size())) - n42, err := m.SecretKeyRef.MarshalTo(dAtA[i:]) + n45, err := m.SecretKeyRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n42 + i += n45 } return i, nil } @@ -3239,19 +3337,19 @@ func (m *Event) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n43, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n46, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n43 + i += n46 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.InvolvedObject.Size())) - n44, err := m.InvolvedObject.MarshalTo(dAtA[i:]) + n47, err := m.InvolvedObject.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n44 + i += n47 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) @@ -3263,27 +3361,27 @@ func (m *Event) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Source.Size())) - n45, err := m.Source.MarshalTo(dAtA[i:]) + n48, err := m.Source.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n45 + i += n48 dAtA[i] = 0x32 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.FirstTimestamp.Size())) - n46, err := m.FirstTimestamp.MarshalTo(dAtA[i:]) + n49, err := m.FirstTimestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n46 + i += n49 dAtA[i] = 0x3a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastTimestamp.Size())) - n47, err := m.LastTimestamp.MarshalTo(dAtA[i:]) + n50, err := m.LastTimestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n47 + i += n50 dAtA[i] = 0x40 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Count)) @@ -3294,20 +3392,20 @@ func (m *Event) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x52 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.EventTime.Size())) - n48, err := m.EventTime.MarshalTo(dAtA[i:]) + n51, err := m.EventTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n48 + i += n51 if m.Series != nil { dAtA[i] = 0x5a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Series.Size())) - n49, err := m.Series.MarshalTo(dAtA[i:]) + n52, err := m.Series.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n49 + i += n52 } dAtA[i] = 0x62 i++ @@ -3317,11 +3415,11 @@ func (m *Event) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x6a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Related.Size())) - n50, err := m.Related.MarshalTo(dAtA[i:]) + n53, err := m.Related.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n50 + i += n53 } dAtA[i] = 0x72 i++ @@ -3352,11 +3450,11 @@ func (m *EventList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n51, err := m.ListMeta.MarshalTo(dAtA[i:]) + n54, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n51 + i += n54 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -3393,11 +3491,11 @@ func (m *EventSeries) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastObservedTime.Size())) - n52, err := m.LastObservedTime.MarshalTo(dAtA[i:]) + n55, err := m.LastObservedTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n52 + i += n55 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.State))) @@ -3529,6 +3627,72 @@ func (m *FCVolumeSource) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *FlexPersistentVolumeSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FlexPersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver))) + i += copy(dAtA[i:], m.Driver) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FSType))) + i += copy(dAtA[i:], m.FSType) + if m.SecretRef != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) + n56, err := m.SecretRef.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n56 + } + dAtA[i] = 0x20 + i++ + if m.ReadOnly { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + if len(m.Options) > 0 { + keysForOptions := make([]string, 0, len(m.Options)) + for k := range m.Options { + keysForOptions = append(keysForOptions, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForOptions) + for _, k := range keysForOptions { + dAtA[i] = 0x2a + i++ + v := m.Options[string(k)] + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } + return i, nil +} + func (m *FlexVolumeSource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3556,11 +3720,11 @@ func (m *FlexVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n53, err := m.SecretRef.MarshalTo(dAtA[i:]) + n57, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n53 + i += n57 } dAtA[i] = 0x20 i++ @@ -3744,11 +3908,11 @@ func (m *HTTPGetAction) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Port.Size())) - n54, err := m.Port.MarshalTo(dAtA[i:]) + n58, err := m.Port.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n54 + i += n58 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Host))) @@ -3817,31 +3981,31 @@ func (m *Handler) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Exec.Size())) - n55, err := m.Exec.MarshalTo(dAtA[i:]) + n59, err := m.Exec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n55 + i += n59 } if m.HTTPGet != nil { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.HTTPGet.Size())) - n56, err := m.HTTPGet.MarshalTo(dAtA[i:]) + n60, err := m.HTTPGet.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n56 + i += n60 } if m.TCPSocket != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.TCPSocket.Size())) - n57, err := m.TCPSocket.MarshalTo(dAtA[i:]) + n61, err := m.TCPSocket.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n57 + i += n61 } return i, nil } @@ -3980,11 +4144,11 @@ func (m *ISCSIPersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x52 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n58, err := m.SecretRef.MarshalTo(dAtA[i:]) + n62, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n58 + i += n62 } dAtA[i] = 0x58 i++ @@ -4072,11 +4236,11 @@ func (m *ISCSIVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x52 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n59, err := m.SecretRef.MarshalTo(dAtA[i:]) + n63, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n59 + i += n63 } dAtA[i] = 0x58 i++ @@ -4145,21 +4309,21 @@ func (m *Lifecycle) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.PostStart.Size())) - n60, err := m.PostStart.MarshalTo(dAtA[i:]) + n64, err := m.PostStart.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n60 + i += n64 } if m.PreStop != nil { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.PreStop.Size())) - n61, err := m.PreStop.MarshalTo(dAtA[i:]) + n65, err := m.PreStop.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n61 + i += n65 } return i, nil } @@ -4182,19 +4346,19 @@ func (m *LimitRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n62, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n66, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n62 + i += n66 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n63, err := m.Spec.MarshalTo(dAtA[i:]) + n67, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n63 + i += n67 return i, nil } @@ -4241,11 +4405,11 @@ func (m *LimitRangeItem) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n64, err := (&v).MarshalTo(dAtA[i:]) + n68, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n64 + i += n68 } } if len(m.Min) > 0 { @@ -4272,11 +4436,11 @@ func (m *LimitRangeItem) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n65, err := (&v).MarshalTo(dAtA[i:]) + n69, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n65 + i += n69 } } if len(m.Default) > 0 { @@ -4303,11 +4467,11 @@ func (m *LimitRangeItem) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n66, err := (&v).MarshalTo(dAtA[i:]) + n70, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n66 + i += n70 } } if len(m.DefaultRequest) > 0 { @@ -4334,11 +4498,11 @@ func (m *LimitRangeItem) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n67, err := (&v).MarshalTo(dAtA[i:]) + n71, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n67 + i += n71 } } if len(m.MaxLimitRequestRatio) > 0 { @@ -4365,11 +4529,11 @@ func (m *LimitRangeItem) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n68, err := (&v).MarshalTo(dAtA[i:]) + n72, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n68 + i += n72 } } return i, nil @@ -4393,11 +4557,11 @@ func (m *LimitRangeList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n69, err := m.ListMeta.MarshalTo(dAtA[i:]) + n73, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n69 + i += n73 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -4461,11 +4625,11 @@ func (m *List) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n70, err := m.ListMeta.MarshalTo(dAtA[i:]) + n74, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n70 + i += n74 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -4684,27 +4848,27 @@ func (m *Namespace) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n71, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n75, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n71 + i += n75 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n72, err := m.Spec.MarshalTo(dAtA[i:]) + n76, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n72 + i += n76 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n73, err := m.Status.MarshalTo(dAtA[i:]) + n77, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n73 + i += n77 return i, nil } @@ -4726,11 +4890,11 @@ func (m *NamespaceList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n74, err := m.ListMeta.MarshalTo(dAtA[i:]) + n78, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n74 + i += n78 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -4819,27 +4983,27 @@ func (m *Node) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n75, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n79, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n75 + i += n79 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n76, err := m.Spec.MarshalTo(dAtA[i:]) + n80, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n76 + i += n80 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n77, err := m.Status.MarshalTo(dAtA[i:]) + n81, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n77 + i += n81 return i, nil } @@ -4888,11 +5052,11 @@ func (m *NodeAffinity) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.RequiredDuringSchedulingIgnoredDuringExecution.Size())) - n78, err := m.RequiredDuringSchedulingIgnoredDuringExecution.MarshalTo(dAtA[i:]) + n82, err := m.RequiredDuringSchedulingIgnoredDuringExecution.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n78 + i += n82 } if len(m.PreferredDuringSchedulingIgnoredDuringExecution) > 0 { for _, msg := range m.PreferredDuringSchedulingIgnoredDuringExecution { @@ -4935,19 +5099,19 @@ func (m *NodeCondition) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastHeartbeatTime.Size())) - n79, err := m.LastHeartbeatTime.MarshalTo(dAtA[i:]) + n83, err := m.LastHeartbeatTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n79 + i += n83 dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastTransitionTime.Size())) - n80, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) + n84, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n80 + i += n84 dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) @@ -4978,11 +5142,11 @@ func (m *NodeConfigSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ConfigMapRef.Size())) - n81, err := m.ConfigMapRef.MarshalTo(dAtA[i:]) + n85, err := m.ConfigMapRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n81 + i += n85 } return i, nil } @@ -5005,11 +5169,11 @@ func (m *NodeDaemonEndpoints) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.KubeletEndpoint.Size())) - n82, err := m.KubeletEndpoint.MarshalTo(dAtA[i:]) + n86, err := m.KubeletEndpoint.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n82 + i += n86 return i, nil } @@ -5031,11 +5195,11 @@ func (m *NodeList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n83, err := m.ListMeta.MarshalTo(dAtA[i:]) + n87, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n83 + i += n87 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -5112,11 +5276,11 @@ func (m *NodeResources) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n84, err := (&v).MarshalTo(dAtA[i:]) + n88, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n84 + i += n88 } } return i, nil @@ -5274,11 +5438,11 @@ func (m *NodeSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x32 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ConfigSource.Size())) - n85, err := m.ConfigSource.MarshalTo(dAtA[i:]) + n89, err := m.ConfigSource.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n85 + i += n89 } return i, nil } @@ -5322,11 +5486,11 @@ func (m *NodeStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n86, err := (&v).MarshalTo(dAtA[i:]) + n90, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n86 + i += n90 } } if len(m.Allocatable) > 0 { @@ -5353,11 +5517,11 @@ func (m *NodeStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n87, err := (&v).MarshalTo(dAtA[i:]) + n91, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n87 + i += n91 } } dAtA[i] = 0x1a @@ -5391,19 +5555,19 @@ func (m *NodeStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x32 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.DaemonEndpoints.Size())) - n88, err := m.DaemonEndpoints.MarshalTo(dAtA[i:]) + n92, err := m.DaemonEndpoints.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n88 + i += n92 dAtA[i] = 0x3a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.NodeInfo.Size())) - n89, err := m.NodeInfo.MarshalTo(dAtA[i:]) + n93, err := m.NodeInfo.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n89 + i += n93 if len(m.Images) > 0 { for _, msg := range m.Images { dAtA[i] = 0x42 @@ -5575,20 +5739,20 @@ func (m *ObjectMeta) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x42 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.CreationTimestamp.Size())) - n90, err := m.CreationTimestamp.MarshalTo(dAtA[i:]) + n94, err := m.CreationTimestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n90 + i += n94 if m.DeletionTimestamp != nil { dAtA[i] = 0x4a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.DeletionTimestamp.Size())) - n91, err := m.DeletionTimestamp.MarshalTo(dAtA[i:]) + n95, err := m.DeletionTimestamp.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n91 + i += n95 } if m.DeletionGracePeriodSeconds != nil { dAtA[i] = 0x50 @@ -5676,11 +5840,11 @@ func (m *ObjectMeta) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Initializers.Size())) - n92, err := m.Initializers.MarshalTo(dAtA[i:]) + n96, err := m.Initializers.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n92 + i += n96 } return i, nil } @@ -5749,27 +5913,27 @@ func (m *PersistentVolume) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n93, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n97, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n93 + i += n97 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n94, err := m.Spec.MarshalTo(dAtA[i:]) + n98, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n94 + i += n98 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n95, err := m.Status.MarshalTo(dAtA[i:]) + n99, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n95 + i += n99 return i, nil } @@ -5791,27 +5955,27 @@ func (m *PersistentVolumeClaim) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n96, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n100, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n96 + i += n100 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n97, err := m.Spec.MarshalTo(dAtA[i:]) + n101, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n97 + i += n101 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n98, err := m.Status.MarshalTo(dAtA[i:]) + n102, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n98 + i += n102 return i, nil } @@ -5841,19 +6005,19 @@ func (m *PersistentVolumeClaimCondition) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastProbeTime.Size())) - n99, err := m.LastProbeTime.MarshalTo(dAtA[i:]) + n103, err := m.LastProbeTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n99 + i += n103 dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastTransitionTime.Size())) - n100, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) + n104, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n100 + i += n104 dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) @@ -5883,11 +6047,11 @@ func (m *PersistentVolumeClaimList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n101, err := m.ListMeta.MarshalTo(dAtA[i:]) + n105, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n101 + i += n105 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -5936,11 +6100,11 @@ func (m *PersistentVolumeClaimSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Resources.Size())) - n102, err := m.Resources.MarshalTo(dAtA[i:]) + n106, err := m.Resources.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n102 + i += n106 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.VolumeName))) @@ -5949,11 +6113,11 @@ func (m *PersistentVolumeClaimSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size())) - n103, err := m.Selector.MarshalTo(dAtA[i:]) + n107, err := m.Selector.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n103 + i += n107 } if m.StorageClassName != nil { dAtA[i] = 0x2a @@ -6028,11 +6192,11 @@ func (m *PersistentVolumeClaimStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n104, err := (&v).MarshalTo(dAtA[i:]) + n108, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n104 + i += n108 } } if len(m.Conditions) > 0 { @@ -6098,11 +6262,11 @@ func (m *PersistentVolumeList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n105, err := m.ListMeta.MarshalTo(dAtA[i:]) + n109, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n105 + i += n109 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -6137,151 +6301,151 @@ func (m *PersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.GCEPersistentDisk.Size())) - n106, err := m.GCEPersistentDisk.MarshalTo(dAtA[i:]) + n110, err := m.GCEPersistentDisk.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n106 + i += n110 } if m.AWSElasticBlockStore != nil { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.AWSElasticBlockStore.Size())) - n107, err := m.AWSElasticBlockStore.MarshalTo(dAtA[i:]) + n111, err := m.AWSElasticBlockStore.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n107 + i += n111 } if m.HostPath != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.HostPath.Size())) - n108, err := m.HostPath.MarshalTo(dAtA[i:]) + n112, err := m.HostPath.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n108 + i += n112 } if m.Glusterfs != nil { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Glusterfs.Size())) - n109, err := m.Glusterfs.MarshalTo(dAtA[i:]) + n113, err := m.Glusterfs.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n109 + i += n113 } if m.NFS != nil { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.NFS.Size())) - n110, err := m.NFS.MarshalTo(dAtA[i:]) + n114, err := m.NFS.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n110 + i += n114 } if m.RBD != nil { dAtA[i] = 0x32 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.RBD.Size())) - n111, err := m.RBD.MarshalTo(dAtA[i:]) + n115, err := m.RBD.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n111 + i += n115 } if m.ISCSI != nil { dAtA[i] = 0x3a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ISCSI.Size())) - n112, err := m.ISCSI.MarshalTo(dAtA[i:]) + n116, err := m.ISCSI.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n112 + i += n116 } if m.Cinder != nil { dAtA[i] = 0x42 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Cinder.Size())) - n113, err := m.Cinder.MarshalTo(dAtA[i:]) + n117, err := m.Cinder.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n113 + i += n117 } if m.CephFS != nil { dAtA[i] = 0x4a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.CephFS.Size())) - n114, err := m.CephFS.MarshalTo(dAtA[i:]) + n118, err := m.CephFS.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n114 + i += n118 } if m.FC != nil { dAtA[i] = 0x52 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.FC.Size())) - n115, err := m.FC.MarshalTo(dAtA[i:]) + n119, err := m.FC.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n115 + i += n119 } if m.Flocker != nil { dAtA[i] = 0x5a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Flocker.Size())) - n116, err := m.Flocker.MarshalTo(dAtA[i:]) + n120, err := m.Flocker.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n116 + i += n120 } if m.FlexVolume != nil { dAtA[i] = 0x62 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.FlexVolume.Size())) - n117, err := m.FlexVolume.MarshalTo(dAtA[i:]) + n121, err := m.FlexVolume.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n117 + i += n121 } if m.AzureFile != nil { dAtA[i] = 0x6a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.AzureFile.Size())) - n118, err := m.AzureFile.MarshalTo(dAtA[i:]) + n122, err := m.AzureFile.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n118 + i += n122 } if m.VsphereVolume != nil { dAtA[i] = 0x72 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.VsphereVolume.Size())) - n119, err := m.VsphereVolume.MarshalTo(dAtA[i:]) + n123, err := m.VsphereVolume.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n119 + i += n123 } if m.Quobyte != nil { dAtA[i] = 0x7a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Quobyte.Size())) - n120, err := m.Quobyte.MarshalTo(dAtA[i:]) + n124, err := m.Quobyte.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n120 + i += n124 } if m.AzureDisk != nil { dAtA[i] = 0x82 @@ -6289,11 +6453,11 @@ func (m *PersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.AzureDisk.Size())) - n121, err := m.AzureDisk.MarshalTo(dAtA[i:]) + n125, err := m.AzureDisk.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n121 + i += n125 } if m.PhotonPersistentDisk != nil { dAtA[i] = 0x8a @@ -6301,11 +6465,11 @@ func (m *PersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.PhotonPersistentDisk.Size())) - n122, err := m.PhotonPersistentDisk.MarshalTo(dAtA[i:]) + n126, err := m.PhotonPersistentDisk.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n122 + i += n126 } if m.PortworxVolume != nil { dAtA[i] = 0x92 @@ -6313,11 +6477,11 @@ func (m *PersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.PortworxVolume.Size())) - n123, err := m.PortworxVolume.MarshalTo(dAtA[i:]) + n127, err := m.PortworxVolume.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n123 + i += n127 } if m.ScaleIO != nil { dAtA[i] = 0x9a @@ -6325,11 +6489,11 @@ func (m *PersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ScaleIO.Size())) - n124, err := m.ScaleIO.MarshalTo(dAtA[i:]) + n128, err := m.ScaleIO.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n124 + i += n128 } if m.Local != nil { dAtA[i] = 0xa2 @@ -6337,11 +6501,11 @@ func (m *PersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Local.Size())) - n125, err := m.Local.MarshalTo(dAtA[i:]) + n129, err := m.Local.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n125 + i += n129 } if m.StorageOS != nil { dAtA[i] = 0xaa @@ -6349,11 +6513,11 @@ func (m *PersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.StorageOS.Size())) - n126, err := m.StorageOS.MarshalTo(dAtA[i:]) + n130, err := m.StorageOS.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n126 + i += n130 } if m.CSI != nil { dAtA[i] = 0xb2 @@ -6361,11 +6525,11 @@ func (m *PersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.CSI.Size())) - n127, err := m.CSI.MarshalTo(dAtA[i:]) + n131, err := m.CSI.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n127 + i += n131 } return i, nil } @@ -6409,21 +6573,21 @@ func (m *PersistentVolumeSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n128, err := (&v).MarshalTo(dAtA[i:]) + n132, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n128 + i += n132 } } dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.PersistentVolumeSource.Size())) - n129, err := m.PersistentVolumeSource.MarshalTo(dAtA[i:]) + n133, err := m.PersistentVolumeSource.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n129 + i += n133 if len(m.AccessModes) > 0 { for _, s := range m.AccessModes { dAtA[i] = 0x1a @@ -6443,11 +6607,11 @@ func (m *PersistentVolumeSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ClaimRef.Size())) - n130, err := m.ClaimRef.MarshalTo(dAtA[i:]) + n134, err := m.ClaimRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n130 + i += n134 } dAtA[i] = 0x2a i++ @@ -6478,6 +6642,16 @@ func (m *PersistentVolumeSpec) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(len(*m.VolumeMode))) i += copy(dAtA[i:], *m.VolumeMode) } + if m.NodeAffinity != nil { + dAtA[i] = 0x4a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.NodeAffinity.Size())) + n135, err := m.NodeAffinity.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n135 + } return i, nil } @@ -6555,27 +6729,27 @@ func (m *Pod) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n131, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n136, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n131 + i += n136 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n132, err := m.Spec.MarshalTo(dAtA[i:]) + n137, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n132 + i += n137 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n133, err := m.Status.MarshalTo(dAtA[i:]) + n138, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n133 + i += n138 return i, nil } @@ -6640,11 +6814,11 @@ func (m *PodAffinityTerm) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LabelSelector.Size())) - n134, err := m.LabelSelector.MarshalTo(dAtA[i:]) + n139, err := m.LabelSelector.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n134 + i += n139 } if len(m.Namespaces) > 0 { for _, s := range m.Namespaces { @@ -6790,19 +6964,19 @@ func (m *PodCondition) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastProbeTime.Size())) - n135, err := m.LastProbeTime.MarshalTo(dAtA[i:]) + n140, err := m.LastProbeTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n135 + i += n140 dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastTransitionTime.Size())) - n136, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) + n141, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n136 + i += n141 dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) @@ -6989,11 +7163,11 @@ func (m *PodList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n137, err := m.ListMeta.MarshalTo(dAtA[i:]) + n142, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n137 + i += n142 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -7053,11 +7227,11 @@ func (m *PodLogOptions) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SinceTime.Size())) - n138, err := m.SinceTime.MarshalTo(dAtA[i:]) + n143, err := m.SinceTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n138 + i += n143 } dAtA[i] = 0x30 i++ @@ -7146,11 +7320,11 @@ func (m *PodSecurityContext) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SELinuxOptions.Size())) - n139, err := m.SELinuxOptions.MarshalTo(dAtA[i:]) + n144, err := m.SELinuxOptions.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n139 + i += n144 } if m.RunAsUser != nil { dAtA[i] = 0x10 @@ -7179,6 +7353,11 @@ func (m *PodSecurityContext) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintGenerated(dAtA, i, uint64(*m.FSGroup)) } + if m.RunAsGroup != nil { + dAtA[i] = 0x30 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(*m.RunAsGroup)) + } return i, nil } @@ -7201,11 +7380,11 @@ func (m *PodSignature) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.PodController.Size())) - n140, err := m.PodController.MarshalTo(dAtA[i:]) + n145, err := m.PodController.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n140 + i += n145 } return i, nil } @@ -7329,11 +7508,11 @@ func (m *PodSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x72 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecurityContext.Size())) - n141, err := m.SecurityContext.MarshalTo(dAtA[i:]) + n146, err := m.SecurityContext.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n141 + i += n146 } if len(m.ImagePullSecrets) > 0 { for _, msg := range m.ImagePullSecrets { @@ -7365,11 +7544,11 @@ func (m *PodSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Affinity.Size())) - n142, err := m.Affinity.MarshalTo(dAtA[i:]) + n147, err := m.Affinity.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n142 + i += n147 } dAtA[i] = 0x9a i++ @@ -7450,11 +7629,23 @@ func (m *PodSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.DNSConfig.Size())) - n143, err := m.DNSConfig.MarshalTo(dAtA[i:]) + n148, err := m.DNSConfig.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n143 + i += n148 + } + if m.ShareProcessNamespace != nil { + dAtA[i] = 0xd8 + i++ + dAtA[i] = 0x1 + i++ + if *m.ShareProcessNamespace { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ } return i, nil } @@ -7510,11 +7701,11 @@ func (m *PodStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x3a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.StartTime.Size())) - n144, err := m.StartTime.MarshalTo(dAtA[i:]) + n149, err := m.StartTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n144 + i += n149 } if len(m.ContainerStatuses) > 0 { for _, msg := range m.ContainerStatuses { @@ -7544,6 +7735,10 @@ func (m *PodStatus) MarshalTo(dAtA []byte) (int, error) { i += n } } + dAtA[i] = 0x5a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.NominatedNodeName))) + i += copy(dAtA[i:], m.NominatedNodeName) return i, nil } @@ -7565,19 +7760,19 @@ func (m *PodStatusResult) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n145, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n150, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n145 + i += n150 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n146, err := m.Status.MarshalTo(dAtA[i:]) + n151, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n146 + i += n151 return i, nil } @@ -7599,19 +7794,19 @@ func (m *PodTemplate) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n147, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n152, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n147 + i += n152 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Template.Size())) - n148, err := m.Template.MarshalTo(dAtA[i:]) + n153, err := m.Template.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n148 + i += n153 return i, nil } @@ -7633,11 +7828,11 @@ func (m *PodTemplateList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n149, err := m.ListMeta.MarshalTo(dAtA[i:]) + n154, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n149 + i += n154 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -7671,19 +7866,19 @@ func (m *PodTemplateSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n150, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n155, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n150 + i += n155 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n151, err := m.Spec.MarshalTo(dAtA[i:]) + n156, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n151 + i += n156 return i, nil } @@ -7763,19 +7958,19 @@ func (m *PreferAvoidPodsEntry) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.PodSignature.Size())) - n152, err := m.PodSignature.MarshalTo(dAtA[i:]) + n157, err := m.PodSignature.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n152 + i += n157 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.EvictionTime.Size())) - n153, err := m.EvictionTime.MarshalTo(dAtA[i:]) + n158, err := m.EvictionTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n153 + i += n158 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) @@ -7808,11 +8003,11 @@ func (m *PreferredSchedulingTerm) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Preference.Size())) - n154, err := m.Preference.MarshalTo(dAtA[i:]) + n159, err := m.Preference.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n154 + i += n159 return i, nil } @@ -7834,11 +8029,11 @@ func (m *Probe) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Handler.Size())) - n155, err := m.Handler.MarshalTo(dAtA[i:]) + n160, err := m.Handler.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n155 + i += n160 dAtA[i] = 0x10 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.InitialDelaySeconds)) @@ -7988,11 +8183,11 @@ func (m *RBDPersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x3a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n156, err := m.SecretRef.MarshalTo(dAtA[i:]) + n161, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n156 + i += n161 } dAtA[i] = 0x40 i++ @@ -8059,11 +8254,11 @@ func (m *RBDVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x3a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n157, err := m.SecretRef.MarshalTo(dAtA[i:]) + n162, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n157 + i += n162 } dAtA[i] = 0x40 i++ @@ -8094,11 +8289,11 @@ func (m *RangeAllocation) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n158, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n163, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n158 + i += n163 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Range))) @@ -8130,27 +8325,27 @@ func (m *ReplicationController) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n159, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n164, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n159 + i += n164 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n160, err := m.Spec.MarshalTo(dAtA[i:]) + n165, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n160 + i += n165 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n161, err := m.Status.MarshalTo(dAtA[i:]) + n166, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n161 + i += n166 return i, nil } @@ -8180,11 +8375,11 @@ func (m *ReplicationControllerCondition) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastTransitionTime.Size())) - n162, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) + n167, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n162 + i += n167 dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) @@ -8214,11 +8409,11 @@ func (m *ReplicationControllerList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n163, err := m.ListMeta.MarshalTo(dAtA[i:]) + n168, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n163 + i += n168 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -8280,11 +8475,11 @@ func (m *ReplicationControllerSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Template.Size())) - n164, err := m.Template.MarshalTo(dAtA[i:]) + n169, err := m.Template.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n164 + i += n169 } dAtA[i] = 0x20 i++ @@ -8363,11 +8558,11 @@ func (m *ResourceFieldSelector) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Divisor.Size())) - n165, err := m.Divisor.MarshalTo(dAtA[i:]) + n170, err := m.Divisor.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n165 + i += n170 return i, nil } @@ -8389,27 +8584,27 @@ func (m *ResourceQuota) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n166, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n171, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n166 + i += n171 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n167, err := m.Spec.MarshalTo(dAtA[i:]) + n172, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n167 + i += n172 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n168, err := m.Status.MarshalTo(dAtA[i:]) + n173, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n168 + i += n173 return i, nil } @@ -8431,11 +8626,11 @@ func (m *ResourceQuotaList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n169, err := m.ListMeta.MarshalTo(dAtA[i:]) + n174, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n169 + i += n174 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -8490,11 +8685,11 @@ func (m *ResourceQuotaSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n170, err := (&v).MarshalTo(dAtA[i:]) + n175, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n170 + i += n175 } } if len(m.Scopes) > 0 { @@ -8554,11 +8749,11 @@ func (m *ResourceQuotaStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n171, err := (&v).MarshalTo(dAtA[i:]) + n176, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n171 + i += n176 } } if len(m.Used) > 0 { @@ -8585,11 +8780,11 @@ func (m *ResourceQuotaStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n172, err := (&v).MarshalTo(dAtA[i:]) + n177, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n172 + i += n177 } } return i, nil @@ -8634,11 +8829,11 @@ func (m *ResourceRequirements) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n173, err := (&v).MarshalTo(dAtA[i:]) + n178, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n173 + i += n178 } } if len(m.Requests) > 0 { @@ -8665,11 +8860,11 @@ func (m *ResourceRequirements) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n174, err := (&v).MarshalTo(dAtA[i:]) + n179, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n174 + i += n179 } } return i, nil @@ -8736,11 +8931,11 @@ func (m *ScaleIOPersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n175, err := m.SecretRef.MarshalTo(dAtA[i:]) + n180, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n175 + i += n180 } dAtA[i] = 0x20 i++ @@ -8808,11 +9003,11 @@ func (m *ScaleIOVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n176, err := m.SecretRef.MarshalTo(dAtA[i:]) + n181, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n176 + i += n181 } dAtA[i] = 0x20 i++ @@ -8871,11 +9066,11 @@ func (m *Secret) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n177, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n182, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n177 + i += n182 if len(m.Data) > 0 { keysForData := make([]string, 0, len(m.Data)) for k := range m.Data { @@ -8951,11 +9146,11 @@ func (m *SecretEnvSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LocalObjectReference.Size())) - n178, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) + n183, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n178 + i += n183 if m.Optional != nil { dAtA[i] = 0x10 i++ @@ -8987,11 +9182,11 @@ func (m *SecretKeySelector) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LocalObjectReference.Size())) - n179, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) + n184, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n179 + i += n184 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) @@ -9027,11 +9222,11 @@ func (m *SecretList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n180, err := m.ListMeta.MarshalTo(dAtA[i:]) + n185, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n180 + i += n185 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -9065,11 +9260,11 @@ func (m *SecretProjection) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LocalObjectReference.Size())) - n181, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) + n186, err := m.LocalObjectReference.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n181 + i += n186 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -9189,11 +9384,11 @@ func (m *SecurityContext) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Capabilities.Size())) - n182, err := m.Capabilities.MarshalTo(dAtA[i:]) + n187, err := m.Capabilities.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n182 + i += n187 } if m.Privileged != nil { dAtA[i] = 0x10 @@ -9209,11 +9404,11 @@ func (m *SecurityContext) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SELinuxOptions.Size())) - n183, err := m.SELinuxOptions.MarshalTo(dAtA[i:]) + n188, err := m.SELinuxOptions.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n183 + i += n188 } if m.RunAsUser != nil { dAtA[i] = 0x20 @@ -9250,6 +9445,11 @@ func (m *SecurityContext) MarshalTo(dAtA []byte) (int, error) { } i++ } + if m.RunAsGroup != nil { + dAtA[i] = 0x40 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(*m.RunAsGroup)) + } return i, nil } @@ -9271,11 +9471,11 @@ func (m *SerializedReference) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Reference.Size())) - n184, err := m.Reference.MarshalTo(dAtA[i:]) + n189, err := m.Reference.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n184 + i += n189 return i, nil } @@ -9297,27 +9497,27 @@ func (m *Service) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n185, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n190, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n185 + i += n190 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n186, err := m.Spec.MarshalTo(dAtA[i:]) + n191, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n186 + i += n191 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n187, err := m.Status.MarshalTo(dAtA[i:]) + n192, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n187 + i += n192 return i, nil } @@ -9339,11 +9539,11 @@ func (m *ServiceAccount) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n188, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + n193, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n188 + i += n193 if len(m.Secrets) > 0 { for _, msg := range m.Secrets { dAtA[i] = 0x12 @@ -9399,11 +9599,11 @@ func (m *ServiceAccountList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n189, err := m.ListMeta.MarshalTo(dAtA[i:]) + n194, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n189 + i += n194 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -9437,11 +9637,11 @@ func (m *ServiceList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n190, err := m.ListMeta.MarshalTo(dAtA[i:]) + n195, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n190 + i += n195 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -9486,11 +9686,11 @@ func (m *ServicePort) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.TargetPort.Size())) - n191, err := m.TargetPort.MarshalTo(dAtA[i:]) + n196, err := m.TargetPort.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n191 + i += n196 dAtA[i] = 0x28 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.NodePort)) @@ -9637,11 +9837,11 @@ func (m *ServiceSpec) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x72 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SessionAffinityConfig.Size())) - n192, err := m.SessionAffinityConfig.MarshalTo(dAtA[i:]) + n197, err := m.SessionAffinityConfig.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n192 + i += n197 } return i, nil } @@ -9664,11 +9864,11 @@ func (m *ServiceStatus) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LoadBalancer.Size())) - n193, err := m.LoadBalancer.MarshalTo(dAtA[i:]) + n198, err := m.LoadBalancer.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n193 + i += n198 return i, nil } @@ -9691,11 +9891,11 @@ func (m *SessionAffinityConfig) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ClientIP.Size())) - n194, err := m.ClientIP.MarshalTo(dAtA[i:]) + n199, err := m.ClientIP.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n194 + i += n199 } return i, nil } @@ -9739,11 +9939,11 @@ func (m *StorageOSPersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n195, err := m.SecretRef.MarshalTo(dAtA[i:]) + n200, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n195 + i += n200 } return i, nil } @@ -9787,11 +9987,11 @@ func (m *StorageOSVolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n196, err := m.SecretRef.MarshalTo(dAtA[i:]) + n201, err := m.SecretRef.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n196 + i += n201 } return i, nil } @@ -9840,11 +10040,11 @@ func (m *TCPSocketAction) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Port.Size())) - n197, err := m.Port.MarshalTo(dAtA[i:]) + n202, err := m.Port.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n197 + i += n202 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Host))) @@ -9883,11 +10083,11 @@ func (m *Taint) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.TimeAdded.Size())) - n198, err := m.TimeAdded.MarshalTo(dAtA[i:]) + n203, err := m.TimeAdded.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n198 + i += n203 } return i, nil } @@ -9953,11 +10153,11 @@ func (m *Volume) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.VolumeSource.Size())) - n199, err := m.VolumeSource.MarshalTo(dAtA[i:]) + n204, err := m.VolumeSource.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n199 + i += n204 return i, nil } @@ -10031,6 +10231,34 @@ func (m *VolumeMount) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *VolumeNodeAffinity) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeNodeAffinity) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Required != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Required.Size())) + n205, err := m.Required.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n205 + } + return i, nil +} + func (m *VolumeProjection) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -10050,31 +10278,31 @@ func (m *VolumeProjection) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Secret.Size())) - n200, err := m.Secret.MarshalTo(dAtA[i:]) + n206, err := m.Secret.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n200 + i += n206 } if m.DownwardAPI != nil { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.DownwardAPI.Size())) - n201, err := m.DownwardAPI.MarshalTo(dAtA[i:]) + n207, err := m.DownwardAPI.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n201 + i += n207 } if m.ConfigMap != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ConfigMap.Size())) - n202, err := m.ConfigMap.MarshalTo(dAtA[i:]) + n208, err := m.ConfigMap.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n202 + i += n208 } return i, nil } @@ -10098,151 +10326,151 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.HostPath.Size())) - n203, err := m.HostPath.MarshalTo(dAtA[i:]) + n209, err := m.HostPath.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n203 + i += n209 } if m.EmptyDir != nil { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.EmptyDir.Size())) - n204, err := m.EmptyDir.MarshalTo(dAtA[i:]) + n210, err := m.EmptyDir.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n204 + i += n210 } if m.GCEPersistentDisk != nil { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.GCEPersistentDisk.Size())) - n205, err := m.GCEPersistentDisk.MarshalTo(dAtA[i:]) + n211, err := m.GCEPersistentDisk.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n205 + i += n211 } if m.AWSElasticBlockStore != nil { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.AWSElasticBlockStore.Size())) - n206, err := m.AWSElasticBlockStore.MarshalTo(dAtA[i:]) + n212, err := m.AWSElasticBlockStore.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n206 + i += n212 } if m.GitRepo != nil { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.GitRepo.Size())) - n207, err := m.GitRepo.MarshalTo(dAtA[i:]) + n213, err := m.GitRepo.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n207 + i += n213 } if m.Secret != nil { dAtA[i] = 0x32 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Secret.Size())) - n208, err := m.Secret.MarshalTo(dAtA[i:]) + n214, err := m.Secret.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n208 + i += n214 } if m.NFS != nil { dAtA[i] = 0x3a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.NFS.Size())) - n209, err := m.NFS.MarshalTo(dAtA[i:]) + n215, err := m.NFS.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n209 + i += n215 } if m.ISCSI != nil { dAtA[i] = 0x42 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ISCSI.Size())) - n210, err := m.ISCSI.MarshalTo(dAtA[i:]) + n216, err := m.ISCSI.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n210 + i += n216 } if m.Glusterfs != nil { dAtA[i] = 0x4a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Glusterfs.Size())) - n211, err := m.Glusterfs.MarshalTo(dAtA[i:]) + n217, err := m.Glusterfs.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n211 + i += n217 } if m.PersistentVolumeClaim != nil { dAtA[i] = 0x52 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.PersistentVolumeClaim.Size())) - n212, err := m.PersistentVolumeClaim.MarshalTo(dAtA[i:]) + n218, err := m.PersistentVolumeClaim.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n212 + i += n218 } if m.RBD != nil { dAtA[i] = 0x5a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.RBD.Size())) - n213, err := m.RBD.MarshalTo(dAtA[i:]) + n219, err := m.RBD.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n213 + i += n219 } if m.FlexVolume != nil { dAtA[i] = 0x62 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.FlexVolume.Size())) - n214, err := m.FlexVolume.MarshalTo(dAtA[i:]) + n220, err := m.FlexVolume.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n214 + i += n220 } if m.Cinder != nil { dAtA[i] = 0x6a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Cinder.Size())) - n215, err := m.Cinder.MarshalTo(dAtA[i:]) + n221, err := m.Cinder.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n215 + i += n221 } if m.CephFS != nil { dAtA[i] = 0x72 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.CephFS.Size())) - n216, err := m.CephFS.MarshalTo(dAtA[i:]) + n222, err := m.CephFS.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n216 + i += n222 } if m.Flocker != nil { dAtA[i] = 0x7a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Flocker.Size())) - n217, err := m.Flocker.MarshalTo(dAtA[i:]) + n223, err := m.Flocker.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n217 + i += n223 } if m.DownwardAPI != nil { dAtA[i] = 0x82 @@ -10250,11 +10478,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.DownwardAPI.Size())) - n218, err := m.DownwardAPI.MarshalTo(dAtA[i:]) + n224, err := m.DownwardAPI.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n218 + i += n224 } if m.FC != nil { dAtA[i] = 0x8a @@ -10262,11 +10490,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.FC.Size())) - n219, err := m.FC.MarshalTo(dAtA[i:]) + n225, err := m.FC.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n219 + i += n225 } if m.AzureFile != nil { dAtA[i] = 0x92 @@ -10274,11 +10502,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.AzureFile.Size())) - n220, err := m.AzureFile.MarshalTo(dAtA[i:]) + n226, err := m.AzureFile.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n220 + i += n226 } if m.ConfigMap != nil { dAtA[i] = 0x9a @@ -10286,11 +10514,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ConfigMap.Size())) - n221, err := m.ConfigMap.MarshalTo(dAtA[i:]) + n227, err := m.ConfigMap.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n221 + i += n227 } if m.VsphereVolume != nil { dAtA[i] = 0xa2 @@ -10298,11 +10526,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.VsphereVolume.Size())) - n222, err := m.VsphereVolume.MarshalTo(dAtA[i:]) + n228, err := m.VsphereVolume.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n222 + i += n228 } if m.Quobyte != nil { dAtA[i] = 0xaa @@ -10310,11 +10538,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Quobyte.Size())) - n223, err := m.Quobyte.MarshalTo(dAtA[i:]) + n229, err := m.Quobyte.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n223 + i += n229 } if m.AzureDisk != nil { dAtA[i] = 0xb2 @@ -10322,11 +10550,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.AzureDisk.Size())) - n224, err := m.AzureDisk.MarshalTo(dAtA[i:]) + n230, err := m.AzureDisk.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n224 + i += n230 } if m.PhotonPersistentDisk != nil { dAtA[i] = 0xba @@ -10334,11 +10562,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.PhotonPersistentDisk.Size())) - n225, err := m.PhotonPersistentDisk.MarshalTo(dAtA[i:]) + n231, err := m.PhotonPersistentDisk.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n225 + i += n231 } if m.PortworxVolume != nil { dAtA[i] = 0xc2 @@ -10346,11 +10574,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.PortworxVolume.Size())) - n226, err := m.PortworxVolume.MarshalTo(dAtA[i:]) + n232, err := m.PortworxVolume.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n226 + i += n232 } if m.ScaleIO != nil { dAtA[i] = 0xca @@ -10358,11 +10586,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ScaleIO.Size())) - n227, err := m.ScaleIO.MarshalTo(dAtA[i:]) + n233, err := m.ScaleIO.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n227 + i += n233 } if m.Projected != nil { dAtA[i] = 0xd2 @@ -10370,11 +10598,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Projected.Size())) - n228, err := m.Projected.MarshalTo(dAtA[i:]) + n234, err := m.Projected.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n228 + i += n234 } if m.StorageOS != nil { dAtA[i] = 0xda @@ -10382,11 +10610,11 @@ func (m *VolumeSource) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.StorageOS.Size())) - n229, err := m.StorageOS.MarshalTo(dAtA[i:]) + n235, err := m.StorageOS.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n229 + i += n235 } return i, nil } @@ -10446,11 +10674,11 @@ func (m *WeightedPodAffinityTerm) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.PodAffinityTerm.Size())) - n230, err := m.PodAffinityTerm.MarshalTo(dAtA[i:]) + n236, err := m.PodAffinityTerm.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n230 + i += n236 return i, nil } @@ -10602,6 +10830,28 @@ func (m *CSIPersistentVolumeSource) Size() (n int) { l = len(m.VolumeHandle) n += 1 + l + sovGenerated(uint64(l)) n += 2 + l = len(m.FSType) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.VolumeAttributes) > 0 { + for k, v := range m.VolumeAttributes { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.ControllerPublishSecretRef != nil { + l = m.ControllerPublishSecretRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.NodeStageSecretRef != nil { + l = m.NodeStageSecretRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.NodePublishSecretRef != nil { + l = m.NodePublishSecretRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -10744,6 +10994,18 @@ func (m *ConfigMap) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if len(m.BinaryData) > 0 { + for k, v := range m.BinaryData { + _ = k + _ = v + l = 0 + if v != nil { + l = 1 + len(v) + sovGenerated(uint64(len(v))) + } + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + l + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } return n } @@ -11332,6 +11594,29 @@ func (m *FCVolumeSource) Size() (n int) { return n } +func (m *FlexPersistentVolumeSource) Size() (n int) { + var l int + _ = l + l = len(m.Driver) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.FSType) + n += 1 + l + sovGenerated(uint64(l)) + if m.SecretRef != nil { + l = m.SecretRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if len(m.Options) > 0 { + for k, v := range m.Options { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + func (m *FlexVolumeSource) Size() (n int) { var l int _ = l @@ -12400,6 +12685,10 @@ func (m *PersistentVolumeSpec) Size() (n int) { l = len(*m.VolumeMode) n += 1 + l + sovGenerated(uint64(l)) } + if m.NodeAffinity != nil { + l = m.NodeAffinity.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -12653,6 +12942,9 @@ func (m *PodSecurityContext) Size() (n int) { if m.FSGroup != nil { n += 1 + sovGenerated(uint64(*m.FSGroup)) } + if m.RunAsGroup != nil { + n += 1 + sovGenerated(uint64(*m.RunAsGroup)) + } return n } @@ -12758,6 +13050,9 @@ func (m *PodSpec) Size() (n int) { l = m.DNSConfig.Size() n += 2 + l + sovGenerated(uint64(l)) } + if m.ShareProcessNamespace != nil { + n += 3 + } return n } @@ -12798,6 +13093,8 @@ func (m *PodStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + l = len(m.NominatedNodeName) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -13395,6 +13692,9 @@ func (m *SecurityContext) Size() (n int) { if m.AllowPrivilegeEscalation != nil { n += 2 } + if m.RunAsGroup != nil { + n += 1 + sovGenerated(uint64(*m.RunAsGroup)) + } return n } @@ -13683,6 +13983,16 @@ func (m *VolumeMount) Size() (n int) { return n } +func (m *VolumeNodeAffinity) Size() (n int) { + var l int + _ = l + if m.Required != nil { + l = m.Required.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *VolumeProjection) Size() (n int) { var l int _ = l @@ -13952,10 +14262,25 @@ func (this *CSIPersistentVolumeSource) String() string { if this == nil { return "nil" } + keysForVolumeAttributes := make([]string, 0, len(this.VolumeAttributes)) + for k := range this.VolumeAttributes { + keysForVolumeAttributes = append(keysForVolumeAttributes, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForVolumeAttributes) + mapStringForVolumeAttributes := "map[string]string{" + for _, k := range keysForVolumeAttributes { + mapStringForVolumeAttributes += fmt.Sprintf("%v: %v,", k, this.VolumeAttributes[k]) + } + mapStringForVolumeAttributes += "}" s := strings.Join([]string{`&CSIPersistentVolumeSource{`, `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, `VolumeHandle:` + fmt.Sprintf("%v", this.VolumeHandle) + `,`, `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, + `FSType:` + fmt.Sprintf("%v", this.FSType) + `,`, + `VolumeAttributes:` + mapStringForVolumeAttributes + `,`, + `ControllerPublishSecretRef:` + strings.Replace(fmt.Sprintf("%v", this.ControllerPublishSecretRef), "SecretReference", "SecretReference", 1) + `,`, + `NodeStageSecretRef:` + strings.Replace(fmt.Sprintf("%v", this.NodeStageSecretRef), "SecretReference", "SecretReference", 1) + `,`, + `NodePublishSecretRef:` + strings.Replace(fmt.Sprintf("%v", this.NodePublishSecretRef), "SecretReference", "SecretReference", 1) + `,`, `}`, }, "") return s @@ -14072,9 +14397,20 @@ func (this *ConfigMap) String() string { mapStringForData += fmt.Sprintf("%v: %v,", k, this.Data[k]) } mapStringForData += "}" + keysForBinaryData := make([]string, 0, len(this.BinaryData)) + for k := range this.BinaryData { + keysForBinaryData = append(keysForBinaryData, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForBinaryData) + mapStringForBinaryData := "map[string][]byte{" + for _, k := range keysForBinaryData { + mapStringForBinaryData += fmt.Sprintf("%v: %v,", k, this.BinaryData[k]) + } + mapStringForBinaryData += "}" s := strings.Join([]string{`&ConfigMap{`, `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Data:` + mapStringForData + `,`, + `BinaryData:` + mapStringForBinaryData + `,`, `}`, }, "") return s @@ -14505,6 +14841,30 @@ func (this *FCVolumeSource) String() string { }, "") return s } +func (this *FlexPersistentVolumeSource) String() string { + if this == nil { + return "nil" + } + keysForOptions := make([]string, 0, len(this.Options)) + for k := range this.Options { + keysForOptions = append(keysForOptions, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForOptions) + mapStringForOptions := "map[string]string{" + for _, k := range keysForOptions { + mapStringForOptions += fmt.Sprintf("%v: %v,", k, this.Options[k]) + } + mapStringForOptions += "}" + s := strings.Join([]string{`&FlexPersistentVolumeSource{`, + `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, + `FSType:` + fmt.Sprintf("%v", this.FSType) + `,`, + `SecretRef:` + strings.Replace(fmt.Sprintf("%v", this.SecretRef), "SecretReference", "SecretReference", 1) + `,`, + `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, + `Options:` + mapStringForOptions + `,`, + `}`, + }, "") + return s +} func (this *FlexVolumeSource) String() string { if this == nil { return "nil" @@ -15331,7 +15691,7 @@ func (this *PersistentVolumeSource) String() string { `CephFS:` + strings.Replace(fmt.Sprintf("%v", this.CephFS), "CephFSPersistentVolumeSource", "CephFSPersistentVolumeSource", 1) + `,`, `FC:` + strings.Replace(fmt.Sprintf("%v", this.FC), "FCVolumeSource", "FCVolumeSource", 1) + `,`, `Flocker:` + strings.Replace(fmt.Sprintf("%v", this.Flocker), "FlockerVolumeSource", "FlockerVolumeSource", 1) + `,`, - `FlexVolume:` + strings.Replace(fmt.Sprintf("%v", this.FlexVolume), "FlexVolumeSource", "FlexVolumeSource", 1) + `,`, + `FlexVolume:` + strings.Replace(fmt.Sprintf("%v", this.FlexVolume), "FlexPersistentVolumeSource", "FlexPersistentVolumeSource", 1) + `,`, `AzureFile:` + strings.Replace(fmt.Sprintf("%v", this.AzureFile), "AzureFilePersistentVolumeSource", "AzureFilePersistentVolumeSource", 1) + `,`, `VsphereVolume:` + strings.Replace(fmt.Sprintf("%v", this.VsphereVolume), "VsphereVirtualDiskVolumeSource", "VsphereVirtualDiskVolumeSource", 1) + `,`, `Quobyte:` + strings.Replace(fmt.Sprintf("%v", this.Quobyte), "QuobyteVolumeSource", "QuobyteVolumeSource", 1) + `,`, @@ -15369,6 +15729,7 @@ func (this *PersistentVolumeSpec) String() string { `StorageClassName:` + fmt.Sprintf("%v", this.StorageClassName) + `,`, `MountOptions:` + fmt.Sprintf("%v", this.MountOptions) + `,`, `VolumeMode:` + valueToStringGenerated(this.VolumeMode) + `,`, + `NodeAffinity:` + strings.Replace(fmt.Sprintf("%v", this.NodeAffinity), "VolumeNodeAffinity", "VolumeNodeAffinity", 1) + `,`, `}`, }, "") return s @@ -15567,6 +15928,7 @@ func (this *PodSecurityContext) String() string { `RunAsNonRoot:` + valueToStringGenerated(this.RunAsNonRoot) + `,`, `SupplementalGroups:` + fmt.Sprintf("%v", this.SupplementalGroups) + `,`, `FSGroup:` + valueToStringGenerated(this.FSGroup) + `,`, + `RunAsGroup:` + valueToStringGenerated(this.RunAsGroup) + `,`, `}`, }, "") return s @@ -15622,6 +15984,7 @@ func (this *PodSpec) String() string { `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, `Priority:` + valueToStringGenerated(this.Priority) + `,`, `DNSConfig:` + strings.Replace(fmt.Sprintf("%v", this.DNSConfig), "PodDNSConfig", "PodDNSConfig", 1) + `,`, + `ShareProcessNamespace:` + valueToStringGenerated(this.ShareProcessNamespace) + `,`, `}`, }, "") return s @@ -15641,6 +16004,7 @@ func (this *PodStatus) String() string { `ContainerStatuses:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ContainerStatuses), "ContainerStatus", "ContainerStatus", 1), `&`, ``, 1) + `,`, `QOSClass:` + fmt.Sprintf("%v", this.QOSClass) + `,`, `InitContainerStatuses:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.InitContainerStatuses), "ContainerStatus", "ContainerStatus", 1), `&`, ``, 1) + `,`, + `NominatedNodeName:` + fmt.Sprintf("%v", this.NominatedNodeName) + `,`, `}`, }, "") return s @@ -16180,6 +16544,7 @@ func (this *SecurityContext) String() string { `RunAsNonRoot:` + valueToStringGenerated(this.RunAsNonRoot) + `,`, `ReadOnlyRootFilesystem:` + valueToStringGenerated(this.ReadOnlyRootFilesystem) + `,`, `AllowPrivilegeEscalation:` + valueToStringGenerated(this.AllowPrivilegeEscalation) + `,`, + `RunAsGroup:` + valueToStringGenerated(this.RunAsGroup) + `,`, `}`, }, "") return s @@ -16430,6 +16795,16 @@ func (this *VolumeMount) String() string { }, "") return s } +func (this *VolumeNodeAffinity) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeNodeAffinity{`, + `Required:` + strings.Replace(fmt.Sprintf("%v", this.Required), "NodeSelector", "NodeSelector", 1) + `,`, + `}`, + }, "") + return s +} func (this *VolumeProjection) String() string { if this == nil { return "nil" @@ -17717,6 +18092,250 @@ func (m *CSIPersistentVolumeSource) Unmarshal(dAtA []byte) error { } } m.ReadOnly = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FSType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FSType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + var keykey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + keykey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + if m.VolumeAttributes == nil { + m.VolumeAttributes = make(map[string]string) + } + if iNdEx < postIndex { + var valuekey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + valuekey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + m.VolumeAttributes[mapkey] = mapvalue + } else { + var mapvalue string + m.VolumeAttributes[mapkey] = mapvalue + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ControllerPublishSecretRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ControllerPublishSecretRef == nil { + m.ControllerPublishSecretRef = &SecretReference{} + } + if err := m.ControllerPublishSecretRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeStageSecretRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeStageSecretRef == nil { + m.NodeStageSecretRef = &SecretReference{} + } + if err := m.NodeStageSecretRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodePublishSecretRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodePublishSecretRef == nil { + m.NodePublishSecretRef = &SecretReference{} + } + if err := m.NodePublishSecretRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -19045,6 +19664,123 @@ func (m *ConfigMap) Unmarshal(dAtA []byte) error { m.Data[mapkey] = mapvalue } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BinaryData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + var keykey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + keykey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + if m.BinaryData == nil { + m.BinaryData = make(map[string][]byte) + } + if iNdEx < postIndex { + var valuekey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + valuekey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var mapbyteLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapbyteLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intMapbyteLen := int(mapbyteLen) + if intMapbyteLen < 0 { + return ErrInvalidLengthGenerated + } + postbytesIndex := iNdEx + intMapbyteLen + if postbytesIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue := make([]byte, mapbyteLen) + copy(mapvalue, dAtA[iNdEx:postbytesIndex]) + iNdEx = postbytesIndex + m.BinaryData[mapkey] = mapvalue + } else { + var mapvalue []byte + m.BinaryData[mapkey] = mapvalue + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -24366,7 +25102,7 @@ func (m *FCVolumeSource) Unmarshal(dAtA []byte) error { } return nil } -func (m *FlexVolumeSource) Unmarshal(dAtA []byte) error { +func (m *FlexPersistentVolumeSource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -24389,10 +25125,10 @@ func (m *FlexVolumeSource) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FlexVolumeSource: wiretype end group for non-group") + return fmt.Errorf("proto: FlexPersistentVolumeSource: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FlexVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FlexPersistentVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -24480,7 +25216,7 @@ func (m *FlexVolumeSource) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.SecretRef == nil { - m.SecretRef = &LocalObjectReference{} + m.SecretRef = &SecretReference{} } if err := m.SecretRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -24643,115 +25379,7 @@ func (m *FlexVolumeSource) Unmarshal(dAtA []byte) error { } return nil } -func (m *FlockerVolumeSource) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FlockerVolumeSource: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FlockerVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DatasetName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DatasetName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DatasetUUID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DatasetUUID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GCEPersistentDiskVolumeSource) Unmarshal(dAtA []byte) error { +func (m *FlexVolumeSource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -24774,44 +25402,429 @@ func (m *GCEPersistentDiskVolumeSource) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GCEPersistentDiskVolumeSource: wiretype end group for non-group") + return fmt.Errorf("proto: FlexVolumeSource: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GCEPersistentDiskVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FlexVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PDName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PDName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FSType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Driver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FSType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FSType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretRef == nil { + m.SecretRef = &LocalObjectReference{} + } + if err := m.SecretRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ReadOnly = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + var keykey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + keykey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + if m.Options == nil { + m.Options = make(map[string]string) + } + if iNdEx < postIndex { + var valuekey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + valuekey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + m.Options[mapkey] = mapvalue + } else { + var mapvalue string + m.Options[mapkey] = mapvalue + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FlockerVolumeSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FlockerVolumeSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlockerVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DatasetName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DatasetName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DatasetUUID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DatasetUUID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GCEPersistentDiskVolumeSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GCEPersistentDiskVolumeSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GCEPersistentDiskVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PDName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PDName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FSType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -34215,7 +35228,7 @@ func (m *PersistentVolumeSource) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.FlexVolume == nil { - m.FlexVolume = &FlexVolumeSource{} + m.FlexVolume = &FlexPersistentVolumeSource{} } if err := m.FlexVolume.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -34870,13 +35883,72 @@ func (m *PersistentVolumeSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.StorageClassName = string(dAtA[iNdEx:postIndex]) + m.StorageClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MountOptions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MountOptions = append(m.MountOptions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeMode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := PersistentVolumeMode(dAtA[iNdEx:postIndex]) + m.VolumeMode = &s iNdEx = postIndex - case 7: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MountOptions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeAffinity", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -34886,50 +35958,24 @@ func (m *PersistentVolumeSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.MountOptions = append(m.MountOptions, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeMode", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated + if m.NodeAffinity == nil { + m.NodeAffinity = &VolumeNodeAffinity{} } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.NodeAffinity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - s := PersistentVolumeMode(dAtA[iNdEx:postIndex]) - m.VolumeMode = &s iNdEx = postIndex default: iNdEx = preIndex @@ -37242,6 +38288,26 @@ func (m *PodSecurityContext) Unmarshal(dAtA []byte) error { } } m.FSGroup = &v + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAsGroup", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.RunAsGroup = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -38178,6 +39244,27 @@ func (m *PodSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 27: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ShareProcessNamespace", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.ShareProcessNamespace = &b default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -38315,131 +39402,191 @@ func (m *PodStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Reason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostIP", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HostIP = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PodIP", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PodIP = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.StartTime == nil { - m.StartTime = &k8s_io_apimachinery_pkg_apis_meta_v1.Time{} - } - if err := m.StartTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostIP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostIP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PodIP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PodIP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StartTime == nil { + m.StartTime = &k8s_io_apimachinery_pkg_apis_meta_v1.Time{} + } + if err := m.StartTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerStatuses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerStatuses = append(m.ContainerStatuses, ContainerStatus{}) + if err := m.ContainerStatuses[len(m.ContainerStatuses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QOSClass", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QOSClass = PodQOSClass(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerStatuses", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitContainerStatuses", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -38463,14 +39610,14 @@ func (m *PodStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ContainerStatuses = append(m.ContainerStatuses, ContainerStatus{}) - if err := m.ContainerStatuses[len(m.ContainerStatuses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.InitContainerStatuses = append(m.InitContainerStatuses, ContainerStatus{}) + if err := m.InitContainerStatuses[len(m.InitContainerStatuses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 9: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QOSClass", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NominatedNodeName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -38495,38 +39642,7 @@ func (m *PodStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.QOSClass = PodQOSClass(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitContainerStatuses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InitContainerStatuses = append(m.InitContainerStatuses, ContainerStatus{}) - if err := m.InitContainerStatuses[len(m.InitContainerStatuses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.NominatedNodeName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -44747,6 +45863,26 @@ func (m *SecurityContext) Unmarshal(dAtA []byte) error { } b := bool(v != 0) m.AllowPrivilegeEscalation = &b + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAsGroup", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.RunAsGroup = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -47649,6 +48785,89 @@ func (m *VolumeMount) Unmarshal(dAtA []byte) error { } return nil } +func (m *VolumeNodeAffinity) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeNodeAffinity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeNodeAffinity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Required", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Required == nil { + m.Required = &NodeSelector{} + } + if err := m.Required.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *VolumeProjection) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -49114,777 +50333,797 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 12346 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x6d, 0x90, 0x24, 0x47, - 0x56, 0xd8, 0x55, 0xf7, 0x7c, 0xf5, 0x9b, 0xef, 0xdc, 0x5d, 0xa9, 0x77, 0x24, 0x6d, 0xaf, 0x4a, - 0x77, 0xd2, 0xea, 0x6b, 0xe6, 0xb4, 0x92, 0x4e, 0xcb, 0xe9, 0x4e, 0x30, 0x33, 0x3d, 0xb3, 0xdb, - 0xda, 0x9d, 0xd9, 0x56, 0xf6, 0xec, 0xee, 0x9d, 0x10, 0xe7, 0xab, 0xe9, 0xce, 0x99, 0x29, 0x4d, - 0x4d, 0x55, 0xab, 0xaa, 0x7a, 0x76, 0x47, 0x01, 0x11, 0xf6, 0x19, 0xf0, 0x07, 0xfc, 0x20, 0x6c, - 0xc2, 0xc6, 0x40, 0xe0, 0x08, 0x1b, 0x07, 0x9c, 0xb1, 0x1d, 0xc6, 0x60, 0xc0, 0x80, 0x6d, 0x8c, - 0x1d, 0x0e, 0xf8, 0x83, 0xc1, 0xfe, 0x71, 0x44, 0x10, 0x1e, 0xc3, 0x40, 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 0x42, 0xcf, 0x41, - 0xd1, 0x69, 0xb5, 0x18, 0x0f, 0x2b, 0x2d, 0x5d, 0x38, 0x3a, 0xac, 0x14, 0x17, 0x5b, 0x74, 0x33, - 0x81, 0xc2, 0x3a, 0xc0, 0x14, 0x03, 0xbd, 0x00, 0x43, 0xad, 0x30, 0x68, 0x97, 0x0b, 0x0c, 0xf3, - 0x31, 0xba, 0xef, 0xaa, 0x61, 0xd0, 0x4e, 0xa1, 0x32, 0x1c, 0xfb, 0x57, 0x0a, 0xf0, 0xe4, 0x32, - 0x69, 0xef, 0xac, 0x36, 0x72, 0x46, 0xe5, 0x0a, 0x8c, 0xed, 0x05, 0xbe, 0x1b, 0x07, 0x61, 0x24, - 0x9a, 0x66, 0xdb, 0x7d, 0x4d, 0x94, 0x61, 0x05, 0x45, 0x97, 0x61, 0xa8, 0x9d, 0xb0, 0xea, 0x09, - 0xc9, 0xe6, 0x19, 0x93, 0x66, 0x10, 0x8a, 0xd1, 0x89, 0x48, 0x28, 0xd8, 0x94, 0xc2, 0xb8, 0x13, - 0x91, 0x10, 0x33, 0x48, 0xb2, 0xde, 0xe9, 0x4e, 0x10, 0x7b, 0x28, 0xb5, 0xde, 0x29, 0x04, 0x6b, - 0x58, 0xa8, 0x0e, 0x25, 0xfe, 0x0f, 0x93, 0x2d, 0xc6, 0x91, 0x72, 0x56, 0x49, 0x43, 0x22, 0x89, - 0x55, 0x32, 0xc9, 0x36, 0x84, 0x2c, 0xc4, 0x09, 0x11, 0x63, 0x9e, 0x46, 0xfa, 0xce, 0xd3, 0x2f, - 0x15, 0x00, 0xf1, 0x21, 0xfc, 0x33, 0x36, 0x70, 0x77, 0xba, 0x07, 0x2e, 0xf3, 0x68, 0xbc, 0x15, - 0x34, 0x1d, 0x2f, 0xbd, 0xc7, 0x4e, 0x6b, 0xf4, 0x7e, 0xc8, 0x02, 0xb4, 0xec, 0xfa, 0x2d, 0x12, - 0x9e, 0x81, 0x5c, 0x78, 0xb2, 0x0d, 0x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f, - 0xdd, 0x22, 0xcd, 0x83, 0xa6, 0x47, 0xca, 0x13, 0x8c, 0x62, 0xe6, 0xb6, 0xba, 0x25, 0x91, 0xf8, - 0x05, 0x40, 0xfd, 0xc5, 0x49, 0x75, 0x74, 0x17, 0x1e, 0x8b, 0x49, 0xb8, 0xe7, 0xfa, 0x0e, 0xdd, - 0x0e, 0x42, 0x9e, 0x64, 0x5a, 0xbc, 0x49, 0xb6, 0xde, 0x2e, 0x89, 0xa1, 0x7b, 0x6c, 0x23, 0x13, - 0x0b, 0xe7, 0xd4, 0x46, 0xb7, 0x61, 0x9a, 0xed, 0x84, 0x7a, 0xc7, 0xf3, 0xea, 0x81, 0xe7, 0x36, - 0x0f, 0xca, 0x53, 0x8c, 0xe0, 0x67, 0xa4, 0x9a, 0xae, 0x66, 0x82, 0xe9, 0x8d, 0x37, 0xf9, 0x87, - 0xd3, 0xb5, 0xd1, 0x26, 0x53, 0xdb, 0x74, 0x42, 0x37, 0x3e, 0xa0, 0xeb, 0x97, 0x3c, 0x88, 0xcb, - 0xd3, 0x3d, 0xef, 0x8f, 0x3a, 0xaa, 0xd2, 0xed, 0xe8, 0x85, 0x38, 0x4d, 0x90, 0x6e, 0xed, 0x28, - 0x6e, 0xb9, 0x7e, 0x79, 0x86, 0x71, 0x0c, 0xb5, 0x33, 0x1a, 0xb4, 0x10, 0x73, 0x18, 0x53, 0xd9, - 0xd0, 0x1f, 0xb7, 0x29, 0x07, 0x9d, 0x65, 0x88, 0x89, 0xca, 0x46, 0x02, 0x70, 0x82, 0x43, 0x8f, - 0xe5, 0x38, 0x3e, 0x28, 0x23, 0x86, 0xaa, 0xb6, 0xcb, 0xc6, 0xc6, 0x97, 0x31, 0x2d, 0x47, 0xb7, - 0x60, 0x94, 0xf8, 0xfb, 0xab, 0x61, 0xb0, 0x57, 0x3e, 0x97, 0xbf, 0x67, 0x57, 0x38, 0x0a, 0x67, - 0xe8, 0xc9, 0x05, 0x40, 0x14, 0x63, 0x49, 0x02,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x56, 0x01, 0x26, - 0xab, 0xc4, 0x23, 0x31, 0xe1, 0x57, 0x99, 0x08, 0xad, 0x02, 0xda, 0x0e, 0x9d, 0x26, 0xa9, 0x93, - 0xd0, 0x0d, 0x5a, 0xba, 0xae, 0xb3, 0xc8, 0xde, 0x13, 0xd0, 0xf5, 0x2e, 0x28, 0xce, 0xa8, 0x81, - 0xde, 0x85, 0xc9, 0x76, 0x48, 0x0c, 0x15, 0x9d, 0x95, 0x27, 0x8d, 0xd4, 0x75, 0x44, 0x2e, 0x08, - 0x1b, 0x45, 0xd8, 0x24, 0x85, 0xbe, 0x0d, 0x66, 0x82, 0xb0, 0xbd, 0xe3, 0xf8, 0x55, 0xd2, 0x26, - 0x7e, 0x8b, 0x4a, 0xfa, 0x42, 0x05, 0x71, 0xfe, 0xe8, 0xb0, 0x32, 0x73, 0x3b, 0x05, 0xc3, 0x5d, - 0xd8, 0xe8, 0x5d, 0x98, 0x6d, 0x87, 0x41, 0xdb, 0xd9, 0x66, 0x0b, 0x45, 0x08, 0x34, 0x9c, 0xfb, - 0xbc, 0x74, 0x74, 0x58, 0x99, 0xad, 0xa7, 0x81, 0xc7, 0x87, 0x95, 0x73, 0x6c, 0xa0, 0x68, 0x49, - 0x02, 0xc4, 0xdd, 0x64, 0xec, 0x6d, 0xb8, 0x50, 0x0d, 0xee, 0xfb, 0xf7, 0x9d, 0xb0, 0xb5, 0x58, - 0xaf, 0x69, 0xba, 0x83, 0x75, 0x79, 0x77, 0xe5, 0x6f, 0xd1, 0x99, 0xe7, 0x94, 0x56, 0x93, 0xcb, - 0x2f, 0xab, 0xae, 0x47, 0x72, 0x74, 0x14, 0x7f, 0xbb, 0x60, 0xb4, 0x94, 0xe0, 0xab, 0x67, 0x05, - 0x2b, 0xf7, 0x59, 0xe1, 0x1d, 0x18, 0xdb, 0x72, 0x89, 0xd7, 0xc2, 0x64, 0x4b, 0xcc, 0xcc, 0x73, - 0xf9, 0xcf, 0x6b, 0xab, 0x14, 0x53, 0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x07, 0x1b, 0xb2, 0x26, - 0x4e, 0x88, 0x48, 0xa9, 0x98, 0x9d, 0x43, 0x45, 0xf3, 0x49, 0xe8, 0x86, 0x28, 0xc7, 0x0a, 0x03, - 0x5d, 0x81, 0x31, 0x3f, 0x68, 0xf1, 0x47, 0x70, 0xbe, 0xa7, 0xd9, 0x92, 0x5d, 0x17, 0x65, 0x58, - 0x41, 0xed, 0xef, 0xb7, 0x60, 0x42, 0x7e, 0xd9, 0x80, 0x02, 0x3a, 0xdd, 0x5a, 0x89, 0x70, 0x9e, - 0x6c, 0x2d, 0x2a, 0x60, 0x33, 0x88, 0x21, 0x57, 0x17, 0x4f, 0x22, 0x57, 0xdb, 0x3f, 0x52, 0x80, - 0x29, 0xd9, 0x9d, 0x46, 0x67, 0x33, 0x22, 0x31, 0xda, 0x80, 0x92, 0xc3, 0x87, 0x9c, 0xc8, 0x15, - 0xfb, 0x4c, 0xf6, 0x85, 0xce, 0x98, 0x9f, 0x44, 0xd4, 0x59, 0x94, 0xb5, 0x71, 0x42, 0x08, 0x79, - 0x30, 0xeb, 0x07, 0x31, 0x3b, 0xf6, 0x14, 0xbc, 0xd7, 0xb3, 0x43, 0x9a, 0xfa, 0x45, 0x41, 0x7d, - 0x76, 0x3d, 0x4d, 0x05, 0x77, 0x13, 0x46, 0x2b, 0x52, 0x89, 0x54, 0xcc, 0xbf, 0xc2, 0xe9, 0xb3, - 0x90, 0xad, 0x43, 0xb2, 0x7f, 0xd9, 0x82, 0x92, 0x44, 0x3b, 0x8b, 0x17, 0xa6, 0x35, 0x18, 0x8d, - 0xd8, 0x24, 0xc8, 0xa1, 0xb1, 0x7b, 0x75, 0x9c, 0xcf, 0x57, 0x72, 0x9a, 0xf3, 0xff, 0x11, 0x96, - 0x34, 0x98, 0x16, 0x5c, 0x75, 0xff, 0x13, 0xa2, 0x05, 0x57, 0xfd, 0xc9, 0x39, 0x61, 0xfe, 0x1b, - 0xeb, 0xb3, 0xa6, 0x2a, 0xa0, 0x42,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0x48, 0x4f, 0xd5, 0x0c, - 0x12, 0x38, 0x45, 0xf2, 0x51, 0xdc, 0xda, 0xaf, 0xc3, 0x08, 0x9f, 0x7b, 0x71, 0x65, 0xcf, 0x54, - 0xb0, 0xb3, 0x41, 0x14, 0xbb, 0x20, 0xd1, 0x28, 0x70, 0x8d, 0xbe, 0xa8, 0x8e, 0xde, 0x87, 0xa9, - 0x2d, 0x37, 0x8c, 0x62, 0x7a, 0xdd, 0x8e, 0x62, 0x67, 0xaf, 0xfd, 0x10, 0xb7, 0x74, 0x35, 0x0e, - 0xab, 0x06, 0x25, 0x9c, 0xa2, 0x8c, 0xb6, 0x61, 0x92, 0x5e, 0x1c, 0x93, 0xa6, 0x46, 0x4f, 0xdc, - 0x94, 0x52, 0xc3, 0xdd, 0xd2, 0x09, 0x61, 0x93, 0x2e, 0x65, 0x26, 0x4d, 0x76, 0xd1, 0x1c, 0x63, - 0x12, 0x85, 0x62, 0x26, 0xfc, 0x86, 0xc9, 0x61, 0x94, 0x27, 0x31, 0x53, 0x91, 0x92, 0xc9, 0x93, - 0x34, 0x83, 0x90, 0xaf, 0x42, 0x89, 0xd0, 0x21, 0xa4, 0x84, 0xc5, 0x63, 0xc3, 0xc2, 0x60, 0x7d, - 0x5d, 0x73, 0x9b, 0x61, 0x60, 0xea, 0x47, 0x56, 0x24, 0x25, 0x9c, 0x10, 0x45, 0xcb, 0x30, 0x12, - 0x91, 0xd0, 0x25, 0x91, 0x78, 0x76, 0xe8, 0x31, 0x8d, 0x0c, 0x8d, 0x9b, 0x90, 0xf2, 0xdf, 0x58, - 0x54, 0xa5, 0xcb, 0xcb, 0x61, 0xb7, 0x21, 0xf6, 0xd2, 0xa0, 0x2d, 0xaf, 0x45, 0x56, 0x8a, 0x05, - 0x14, 0xbd, 0x0d, 0xa3, 0x21, 0xf1, 0x98, 0x02, 0x6e, 0x72, 0xf0, 0x45, 0xce, 0xf5, 0x79, 0xbc, - 0x1e, 0x96, 0x04, 0xd0, 0x4d, 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0x8a, 0xee, 0xc0, 0xf8, 0x4e, 0x1c, 0xb7, 0x6f, 0x10, 0xa7, - 0x45, 0x42, 0xc9, 0x1d, 0x2e, 0x65, 0x71, 0x07, 0x3a, 0x08, 0x1c, 0x2d, 0xd9, 0x50, 0x49, 0x59, - 0x84, 0x75, 0x3a, 0x76, 0x03, 0x20, 0x81, 0x9d, 0xd2, 0x65, 0xd6, 0xfe, 0x7d, 0x0b, 0x46, 0xb9, - 0x27, 0x43, 0x88, 0xbe, 0x00, 0x43, 0xe4, 0x01, 0x69, 0x0a, 0x31, 0x25, 0xb3, 0xc3, 0xc9, 0x29, - 0xc7, 0x55, 0xb3, 0xf4, 0x3f, 0x66, 0xb5, 0xd0, 0x0d, 0x18, 0xa5, 0xbd, 0xbd, 0xae, 0xdc, 0x3a, - 0x9e, 0xce, 0xfb, 0x62, 0x35, 0xed, 0xfc, 0x60, 0x14, 0x45, 0x58, 0x56, 0x67, 0x6a, 0xc6, 0x66, - 0xbb, 0x41, 0x19, 0x58, 0xdc, 0x4b, 0x09, 0xb0, 0xb1, 0x5c, 0xe7, 0x48, 0x82, 0x1a, 0x57, 0x33, - 0xca, 0x42, 0x9c, 0x10, 0xb1, 0x37, 0xa0, 0x44, 0x27, 0x75, 0xd1, 0x73, 0x9d, 0xde, 0x1a, 0xce, - 0x17, 0xa1, 0x24, 0xb5, 0x8d, 0x91, 0xf0, 0xb5, 0x60, 0x54, 0xa5, 0x32, 0x32, 0xc2, 0x09, 0xdc, - 0xde, 0x82, 0xf3, 0xec, 0xe9, 0xde, 0x89, 0x77, 0x8c, 0x3d, 0xd6, 0x7f, 0x31, 0xbf, 0x24, 0xa4, - 0x7e, 0x3e, 0x33, 0x65, 0xcd, 0x38, 0x7c, 0x42, 0x52, 0x4c, 0x6e, 0x00, 0xf6, 0x1f, 0x0e, 0xc1, - 0x13, 0xb5, 0x46, 0xbe, 0x93, 0xcb, 0x35, 0x98, 0xe0, 0x32, 0x01, 0x5d, 0xda, 0x8e, 0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0x69, 0xc1, 0xd0, 0x7a, - 0xd0, 0x3a, 0x8b, 0xc5, 0xf4, 0x96, 0xb1, 0x98, 0x9e, 0xcc, 0x8b, 0xf9, 0x95, 0xbb, 0x8e, 0x56, - 0x53, 0xeb, 0xe8, 0x52, 0x2e, 0x85, 0xde, 0x4b, 0x68, 0x0f, 0xc6, 0x59, 0x24, 0x31, 0x61, 0x97, - 0xf9, 0xaa, 0x71, 0xbf, 0xaa, 0xa4, 0xee, 0x57, 0xd3, 0x1a, 0xaa, 0x76, 0xcb, 0x7a, 0x1e, 0x46, - 0x85, 0x6d, 0x60, 0xda, 0x43, 0x40, 0xe0, 0x62, 0x09, 0xb7, 0x7f, 0xac, 0x08, 0x46, 0xe4, 0x32, - 0xf4, 0xcb, 0x16, 0xcc, 0x87, 0xdc, 0xe5, 0xb2, 0x55, 0xed, 0x84, 0xae, 0xbf, 0xdd, 0x68, 0xee, - 0x90, 0x56, 0xc7, 0x73, 0xfd, 0xed, 0xda, 0xb6, 0x1f, 0xa8, 0xe2, 0x95, 0x07, 0xa4, 0xd9, 0x61, - 0x6f, 0x2e, 0x7d, 0xc2, 0xa4, 0x29, 0xdb, 0x9b, 0xab, 0x47, 0x87, 0x95, 0x79, 0x7c, 0x22, 0xda, - 0xf8, 0x84, 0x7d, 0x41, 0xbf, 0x61, 0xc1, 0x02, 0x0f, 0xe8, 0x35, 0x78, 0xff, 0x7b, 0xdc, 0x46, - 0xeb, 0x92, 0x54, 0x42, 0x64, 0x83, 0x84, 0x7b, 0x4b, 0x6f, 0x88, 0x01, 0x5d, 0xa8, 0x9f, 0xac, - 0x2d, 0x7c, 0xd2, 0xce, 0xd9, 0xff, 0xa6, 0x08, 0x93, 0x74, 0x14, 0x93, 0x30, 0x23, 0xaf, 0x1b, - 0x4b, 0xe2, 0xe9, 0xd4, 0x92, 0x98, 0x35, 0x90, 0x4f, 0x27, 0xc2, 0x48, 0x04, 0xb3, 0x9e, 0x13, - 0xc5, 0x37, 0x88, 0x13, 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 0x93, 0x03, 0x36, 0x05, 0xc0, 0x69, 0xc2, 0xa8, 0xce, 0xdd, 0xa1, - 0x6a, 0xfe, 0x56, 0x20, 0x8c, 0x98, 0xed, 0xdc, 0xb9, 0x3c, 0x88, 0x62, 0xb2, 0x47, 0x31, 0x93, - 0x73, 0x74, 0x5d, 0xd4, 0xc5, 0x8a, 0x0a, 0x7a, 0x1b, 0x46, 0x98, 0x8f, 0x6a, 0x54, 0x1e, 0xcb, - 0xd7, 0x03, 0x9a, 0xe1, 0x15, 0x92, 0x4d, 0xc5, 0xfe, 0x46, 0x58, 0x50, 0x40, 0x37, 0x64, 0x0c, - 0x96, 0xa8, 0xe6, 0xdf, 0x89, 0x08, 0x8b, 0xc1, 0x52, 0x5a, 0xfa, 0x74, 0x12, 0x5e, 0x85, 0x97, - 0x67, 0x46, 0x0b, 0x36, 0x6a, 0x52, 0x79, 0x45, 0xfc, 0x97, 0x41, 0x88, 0xcb, 0x90, 0xdf, 0x3d, - 0x33, 0x50, 0x71, 0x32, 0x9c, 0x77, 0x4d, 0x12, 0x38, 0x4d, 0xf3, 0x4c, 0x8f, 0xcf, 0x39, 0x1f, - 0x66, 0xd2, 0x1b, 0xeb, 0x91, 0x1e, 0xd7, 0xbf, 0x3f, 0x04, 0x53, 0xe6, 0x42, 0x40, 0x0b, 0x50, - 0x12, 0x44, 0x54, 0x3c, 0x46, 0xb5, 0xb6, 0xd7, 0x24, 0x00, 0x27, 0x38, 0x2c, 0x1e, 0x25, 0xab, - 0xae, 0xd9, 0x01, 0x26, 0xf1, 0x28, 0x15, 0x04, 0x6b, 0x58, 0x54, 0x88, 0xde, 0x0c, 0x82, 0x58, - 0x1d, 0x05, 0x6a, 0xb5, 0x2c, 0xb1, 0x52, 0x2c, 0xa0, 0xf4, 0x08, 0xd8, 0x25, 0xa1, 0x4f, 0x3c, - 0x53, 0x93, 0xa9, 0x8e, 0x80, 0x9b, 0x3a, 0x10, 0x9b, 0xb8, 0xf4, 0x48, 0x0b, 0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, 0xeb, 0x13, 0x33, 0xec, 0xc7, - 0xc5, 0xa3, 0xc3, 0xca, 0x85, 0xc5, 0x2c, 0x04, 0x9c, 0x5d, 0x0f, 0x7d, 0x01, 0x4a, 0x2d, 0x3f, - 0x12, 0x63, 0x30, 0x62, 0xa4, 0x82, 0x2d, 0x55, 0xd7, 0x1b, 0xea, 0xfb, 0x93, 0x3f, 0x38, 0xa9, - 0x80, 0xb6, 0x61, 0x42, 0x77, 0xed, 0x13, 0x69, 0x84, 0x5f, 0xee, 0x71, 0xeb, 0x37, 0xfc, 0xe1, - 0xb8, 0x5e, 0x53, 0x59, 0x6c, 0x1b, 0xae, 0x72, 0x06, 0x61, 0xf4, 0x36, 0x20, 0x2a, 0xcc, 0xb8, - 0x4d, 0xb2, 0xd8, 0x64, 0x41, 0xcc, 0x99, 0x36, 0x6c, 0xcc, 0x70, 0x3f, 0x42, 0x8d, 0x2e, 0x0c, - 0x9c, 0x51, 0x0b, 0xdd, 0xa0, 0x1c, 0x45, 0x2f, 0x15, 0x06, 0xf6, 0x52, 0x00, 0x2e, 0x57, 0x49, - 0x3b, 0x24, 0x4d, 0x27, 0x26, 0x2d, 0x93, 0x22, 0x4e, 0xd5, 0xa3, 0xe7, 0x8d, 0xca, 0x67, 0x04, - 0xa6, 0x59, 0x78, 0x77, 0x4e, 0x23, 0x7a, 0x77, 0xdc, 0x09, 0xa2, 0x78, 0x9d, 0xc4, 0xf7, 0x83, - 0x70, 0x57, 0xc4, 0xea, 0x4b, 0xc2, 0xc6, 0x26, 0x20, 0xac, 0xe3, 0x51, 0x59, 0x91, 0x3d, 0x67, - 0xd6, 0xaa, 0xec, 0x75, 0x69, 0x2c, 0xd9, 0x27, 0x37, 0x78, 0x31, 0x96, 0x70, 0x89, 0x5a, 0xab, - 0x2f, 0xb3, 0x37, 0xa3, 0x14, 0x6a, 0xad, 0xbe, 0x8c, 0x25, 0x1c, 0x91, 0xee, 0x34, 0xbb, 0x53, - 0xf9, 0xaf, 0x7d, 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, 0xb1, 0x13, 0x92, 0x68, 0x27, 0xf0, 0x5a, 0x22, - 0xf5, 0x79, 0x62, 0x06, 0x92, 0x82, 0xe3, 0xae, 0x1a, 0x94, 0xca, 0x96, 0xe3, 0x7a, 0x9d, 0x90, - 0x24, 0x54, 0x46, 0x4c, 0x2a, 0xab, 0x29, 0x38, 0xee, 0xaa, 0x41, 0xd7, 0xd1, 0x05, 0x91, 0x37, - 0x5b, 0x06, 0x68, 0x50, 0xb6, 0x3d, 0xa3, 0xd2, 0x51, 0xa3, 0x47, 0xd0, 0x20, 0x61, 0x5b, 0xa1, - 0x32, 0x6f, 0x6b, 0x59, 0x59, 0x85, 0x8b, 0x86, 0xa4, 0xf2, 0x30, 0xd9, 0x9b, 0x7f, 0xd7, 0x82, - 0x73, 0x19, 0x36, 0x84, 0x9c, 0x55, 0x6d, 0xbb, 0x51, 0xac, 0xd2, 0xfb, 0x68, 0xac, 0x8a, 0x97, - 0x63, 0x85, 0x41, 0xf7, 0x03, 0x67, 0x86, 0x69, 0x06, 0x28, 0x6c, 0x74, 0x04, 0xf4, 0x64, 0x0c, - 0x10, 0x5d, 0x86, 0xa1, 0x4e, 0x44, 0x42, 0x99, 0xf6, 0x58, 0xf2, 0x6f, 0xa6, 0x60, 0x64, 0x10, - 0x2a, 0x51, 0x6e, 0x2b, 0xdd, 0x9e, 0x26, 0x51, 0x72, 0xed, 0x1e, 0x87, 0xd9, 0x3f, 0x50, 0x84, - 0x8b, 0xb9, 0x96, 0xc1, 0xb4, 0x4b, 0x7b, 0x81, 0xef, 0xc6, 0x81, 0x7a, 0x17, 0xe2, 0xd1, 0x6d, - 0x48, 0x7b, 0x67, 0x4d, 0x94, 0x63, 0x85, 0x81, 0x9e, 0x95, 0x59, 0xf1, 0xd3, 0x09, 0x8c, 0x96, - 0xaa, 0x46, 0x62, 0xfc, 0x41, 0x33, 0x91, 0x3d, 0x03, 0x43, 0xed, 0x20, 0xf0, 0xd2, 0xcc, 0x88, - 0x76, 0x37, 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 0xfa, 0x71, 0xfe, 0xdd, 0x00, 0x00, + // 12666 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x6d, 0x70, 0x24, 0x49, + 0x56, 0xd8, 0x55, 0xb7, 0xbe, 0xfa, 0xe9, 0x3b, 0x67, 0x66, 0x57, 0xa3, 0xdd, 0x9d, 0x9e, 0xad, + 0xbd, 0x9b, 0x9b, 0xfd, 0x92, 0x6e, 0x67, 0x77, 0x6f, 0x97, 0xdb, 0xbb, 0x05, 0x49, 0x2d, 0xcd, + 0xf4, 0xce, 0x48, 0xd3, 0x9b, 0xad, 0x99, 0xb9, 0x5b, 0x96, 0xf3, 0x95, 0xba, 0x53, 0xad, 0x5a, + 0x95, 0xaa, 0x7a, 0xab, 0xaa, 0x35, 0xa3, 0x0d, 0x88, 0xb0, 0x8f, 0x0f, 0x1b, 0xc3, 0x8f, 0x0b, + 0x43, 0xd8, 0x18, 0x08, 0x1c, 0x61, 0xe3, 0x80, 0x33, 0xb6, 0x23, 0x30, 0x18, 0xf0, 0x81, 0x6d, + 0x8c, 0xfd, 0x03, 0xfe, 0x60, 0xf0, 0x9f, 0x23, 0x82, 0xb0, 0x0c, 0x82, 0xb0, 0x83, 0x1f, 0x76, + 0x38, 0x4c, 0x84, 0x23, 0x90, 0xb1, 0x71, 0xe4, 0x67, 0x65, 0x56, 0x57, 0x75, 0xb7, 0x66, 0x35, + 0xda, 0x85, 0xb8, 0x7f, 0xdd, 0xf9, 0x5e, 0xbe, 0xcc, 0xca, 0x8f, 0x97, 0x2f, 0x5f, 0xbe, 0x0f, + 0x78, 0x63, 0xf7, 0xf5, 0x68, 0xc1, 0x0d, 0x16, 0x77, 0x3b, 0x5b, 0x24, 0xf4, 0x49, 0x4c, 0xa2, + 0xc5, 0x7d, 0xe2, 0x37, 0x83, 0x70, 0x51, 0x00, 0x9c, 0xb6, 0xbb, 0xd8, 0x08, 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x39, 0x54, 0x48, 0x62, 0x0e, 0x2f, + 0x1d, 0x1d, 0x96, 0xe7, 0x57, 0x72, 0x49, 0xe1, 0x1e, 0xcd, 0xa0, 0x5d, 0x40, 0xf4, 0x28, 0xad, + 0xc7, 0x4e, 0x8b, 0x24, 0x8d, 0x8f, 0x0e, 0xde, 0xf8, 0x63, 0x47, 0x87, 0x65, 0xb4, 0xd1, 0x45, + 0x02, 0x67, 0x90, 0x45, 0xef, 0xc3, 0x79, 0x5a, 0xda, 0xf5, 0xad, 0x63, 0x83, 0x37, 0x37, 0x77, + 0x74, 0x58, 0x3e, 0xbf, 0x91, 0x41, 0x04, 0x67, 0x92, 0x9e, 0x5f, 0x81, 0x0b, 0x99, 0x53, 0x85, + 0x66, 0xa0, 0xb8, 0x4b, 0xb8, 0x08, 0x52, 0xc2, 0xf4, 0x27, 0x3a, 0x0f, 0xc3, 0xfb, 0x8e, 0xd7, + 0x11, 0xab, 0x14, 0xf3, 0x3f, 0x9f, 0x2b, 0xbc, 0x6e, 0xd9, 0x0d, 0x98, 0x58, 0x71, 0xda, 0xce, + 0x96, 0xeb, 0xb9, 0xb1, 0x4b, 0x22, 0xf4, 0x69, 0x28, 0x3a, 0xcd, 0x26, 0x3b, 0x22, 0x4b, 0xcb, + 0x17, 0x8e, 0x0e, 0xcb, 0xc5, 0xa5, 0x26, 0xe5, 0xd5, 0xa0, 0xb0, 0x0e, 0x30, 0xc5, 0x40, 0xcf, + 0xc1, 0x50, 0x33, 0x0c, 0xda, 0x73, 0x05, 0x86, 0x49, 0x87, 0x6a, 0xa8, 0x12, 0x06, 0xed, 0x14, + 0x2a, 0xc3, 0xb1, 0x7f, 0xbd, 0x00, 0x4f, 0xae, 0x90, 0xf6, 0xce, 0x5a, 0x3d, 0x67, 0xd3, 0x5d, + 0x85, 0xb1, 0xbd, 0xc0, 0x77, 0xe3, 0x20, 0x8c, 0x44, 0xd3, 0xec, 0x34, 0x59, 0x17, 0x65, 0x58, + 0x41, 0xd1, 0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0xad, 0xa2, 0x9f, 0x85, 0x74, 0x07, 0xf0, 0xfa, 0xe8, + 0xcb, 0x50, 0xf2, 0x9c, 0x88, 0x69, 0x5f, 0x88, 0xd8, 0x77, 0x83, 0x10, 0x4b, 0xee, 0x11, 0x4e, + 0x14, 0x6b, 0x47, 0x0d, 0xa7, 0x9d, 0x90, 0xa4, 0x07, 0x32, 0x95, 0x7d, 0xa4, 0xa1, 0x83, 0xea, + 0x04, 0x15, 0x90, 0x0e, 0x30, 0x87, 0xa1, 0xd7, 0x61, 0x22, 0x24, 0x6c, 0x55, 0xac, 0x50, 0x51, + 0x8e, 0x2d, 0xb3, 0xe1, 0x44, 0xe6, 0xc3, 0x1a, 0x0c, 0x1b, 0x98, 0x89, 0x28, 0x3f, 0xd2, 0x43, + 0x94, 0x7f, 0x16, 0x46, 0xd9, 0x0f, 0xb5, 0x02, 0xd4, 0x6c, 0x54, 0x79, 0x31, 0x96, 0xf0, 0xf4, + 0x82, 0x19, 0x1b, 0x70, 0xc1, 0x3c, 0x07, 0x53, 0x15, 0x87, 0xec, 0x05, 0xfe, 0xaa, 0xdf, 0x6c, + 0x07, 0xae, 0x1f, 0xa3, 0x39, 0x18, 0x62, 0xa7, 0x03, 0xdf, 0xdb, 0x43, 0x94, 0x02, 0x1e, 0xa2, + 0x82, 0xb9, 0xfd, 0xbb, 0x05, 0x98, 0xac, 0x10, 0x8f, 0xc4, 0x84, 0x5f, 0x65, 0x22, 0xb4, 0x06, + 0xa8, 0x15, 0x3a, 0x0d, 0x52, 0x23, 0xa1, 0x1b, 0x34, 0x75, 0x6d, 0x6c, 0x91, 0x3f, 0x0e, 0x5d, + 0xef, 0x82, 0xe2, 0x8c, 0x1a, 0xe8, 0x1d, 0x98, 0x6c, 0x87, 0xc4, 0x50, 0x22, 0x5a, 0x79, 0xd2, + 0x48, 0x4d, 0x47, 0xe4, 0x82, 0xb0, 0x51, 0x84, 0x4d, 0x52, 0xe8, 0x3b, 0x60, 0x26, 0x08, 0xdb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 0x86, 0x5c, 0x5d, 0x3c, 0x89, + 0x5c, 0x6d, 0xff, 0x44, 0x01, 0xa6, 0x64, 0x77, 0xea, 0x9d, 0xad, 0x88, 0xc4, 0x68, 0x13, 0x4a, + 0x0e, 0x1f, 0x72, 0x22, 0x57, 0xec, 0x33, 0xd9, 0x17, 0x3a, 0x63, 0x7e, 0x12, 0x51, 0x67, 0x49, + 0xd6, 0xc6, 0x09, 0x21, 0xe4, 0xc1, 0xac, 0x1f, 0xc4, 0xec, 0xd8, 0x53, 0xf0, 0x5e, 0x0f, 0x23, + 0x69, 0xea, 0x17, 0x05, 0xf5, 0xd9, 0x8d, 0x34, 0x15, 0xdc, 0x4d, 0x18, 0xad, 0x4a, 0x25, 0x52, + 0x31, 0xff, 0x0a, 0xa7, 0xcf, 0x42, 0xb6, 0x0e, 0xc9, 0xfe, 0x35, 0x0b, 0x4a, 0x12, 0xed, 0x2c, + 0xde, 0xc0, 0xd6, 0x61, 0x34, 0x62, 0x93, 0x20, 0x87, 0xc6, 0xee, 0xd5, 0x71, 0x3e, 0x5f, 0xc9, + 0x69, 0xce, 0xff, 0x47, 0x58, 0xd2, 0x60, 0x5a, 0x70, 0xd5, 0xfd, 0x8f, 0x89, 0x16, 0x5c, 0xf5, + 0x27, 0xe7, 0x84, 0xf9, 0x6f, 0xac, 0xcf, 0x9a, 0xaa, 0x80, 0x0a, 0x9d, 0xed, 0x90, 0x6c, 0xbb, + 0x0f, 0xd2, 0x42, 0x67, 0x8d, 0x95, 0x62, 0x01, 0x45, 0xef, 0xc2, 0x44, 0x43, 0x2a, 0x8f, 0x13, + 0x36, 0x70, 0xa5, 0xa7, 0x2a, 0x5e, 0xbd, 0xda, 0x70, 0x0b, 0xd1, 0x15, 0xad, 0x3e, 0x36, 0xa8, + 0x99, 0x96, 0x09, 0xc5, 0x7e, 0x96, 0x09, 0x09, 0xdd, 0xdc, 0xb7, 0x75, 0xfb, 0xa7, 0x2c, 0x18, + 0xe1, 0x2a, 0xc8, 0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8c, 0x5a, 0x30, 0x49, 0x2f, 0x8e, + 0x49, 0x53, 0xa3, 0x27, 0x6e, 0x4a, 0xa9, 0xe1, 0x6e, 0xe9, 0x84, 0xb0, 0x49, 0x97, 0x32, 0x93, + 0x06, 0xbb, 0x68, 0x8e, 0x31, 0x89, 0x42, 0x31, 0x13, 0x7e, 0xc3, 0xe4, 0x30, 0xca, 0x93, 0x98, + 0x31, 0x4b, 0xc9, 0xe4, 0x49, 0x9a, 0xc9, 0xca, 0x57, 0xa0, 0x44, 0xe8, 0x10, 0x52, 0xc2, 0xe2, + 0xb1, 0x61, 0x71, 0xb0, 0xbe, 0xae, 0xbb, 0x8d, 0x30, 0x30, 0xf5, 0x23, 0xab, 0x92, 0x12, 0x4e, + 0x88, 0xa2, 0x15, 0x18, 0x89, 0x48, 0xe8, 0x92, 0x48, 0x3c, 0x3b, 0xf4, 0x98, 0x46, 0x86, 0xc6, + 0x6d, 0xa8, 0xf9, 0x6f, 0x2c, 0xaa, 0xd2, 0xe5, 0xe5, 0xb0, 0xdb, 0x10, 0x7b, 0x69, 0xd0, 0x96, + 0xd7, 0x12, 0x2b, 0xc5, 0x02, 0x8a, 0xde, 0x82, 0xd1, 0x90, 0x78, 0x4c, 0x01, 0x37, 0x39, 0xf8, + 0x22, 0xe7, 0xfa, 0x3c, 0x5e, 0x0f, 0x4b, 0x02, 0xe8, 0x26, 0xa0, 0x90, 0x50, 0x19, 0xc2, 0xf5, + 0x5b, 0xca, 0xc4, 0x43, 0xbc, 0x1f, 0x3c, 0x21, 0xda, 0x3f, 0x87, 0x13, 0x0c, 0x69, 0x5d, 0x89, + 0x33, 0xaa, 0xa1, 0xeb, 0x30, 0xab, 0x4a, 0xab, 0x7e, 0x14, 0x3b, 0x7e, 0x83, 0xb0, 0xa7, 0x83, + 0x52, 0x22, 0x15, 0xe1, 0x34, 0x02, 0xee, 0xae, 0x63, 0x7f, 0x9d, 0x8a, 0x33, 0x74, 0xb4, 0xce, + 0x40, 0x16, 0x78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xc4, 0xb8, 0x59, 0x3f, 0xbe, 0x92, 0x8d, 0x86, 0xf3, 0xea, 0xa3, 0x37, 0x61, 0x4a, 0x88, + 0xc0, 0x92, 0xe2, 0xa8, 0x69, 0xac, 0x70, 0xd3, 0x80, 0xe2, 0x14, 0x36, 0xaa, 0xc0, 0x0c, 0x2d, + 0x61, 0x52, 0xa8, 0xa4, 0xc0, 0xbd, 0xf5, 0xd5, 0x59, 0x7f, 0x33, 0x05, 0xc7, 0x5d, 0x35, 0xd0, + 0x12, 0x4c, 0x73, 0x19, 0x85, 0xde, 0x29, 0xd9, 0x3c, 0x08, 0x77, 0x0f, 0xb5, 0x11, 0x6e, 0x9b, + 0x60, 0x9c, 0xc6, 0x47, 0xaf, 0xc3, 0x84, 0x13, 0x36, 0x76, 0xdc, 0x98, 0x34, 0xe2, 0x4e, 0xc8, + 0xfd, 0x40, 0x34, 0x6b, 0x8f, 0x25, 0x0d, 0x86, 0x0d, 0x4c, 0xfb, 0x03, 0x38, 0x97, 0xe1, 0x29, + 0x46, 0x17, 0x8e, 0xd3, 0x76, 0xe5, 0x37, 0xa5, 0x2c, 0x24, 0x97, 0x6a, 0x55, 0xf9, 0x35, 0x1a, + 0x16, 0x5d, 0x9d, 0x4c, 0x25, 0xae, 0x65, 0x2f, 0x50, 0xab, 0x73, 0x4d, 0x02, 0x70, 0x82, 0x63, + 0xff, 0x16, 0x80, 0xa6, 0xd0, 0x19, 0xc0, 0x3e, 0xee, 0x75, 0x98, 0x90, 0x29, 0x37, 0xb4, 0x50, + 0xef, 0xea, 0x33, 0xaf, 0x6b, 0x30, 0x6c, 0x60, 0xd2, 0xbe, 0xf9, 0x2a, 0x50, 0x7d, 0xca, 0x1e, + 0x33, 0x09, 0x53, 0x9f, 0xe0, 0xa0, 0x17, 0x60, 0x2c, 0x22, 0xde, 0xf6, 0x2d, 0xd7, 0xdf, 0x15, + 0x0b, 0x5b, 0x71, 0xe1, 0xba, 0x28, 0xc7, 0x0a, 0x03, 0x2d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0, 0xc2, 0x76, 0x03, 0x6d, 0xc0, 0xe8, 0x36, 0xf7, + 0xad, 0x17, 0x01, 0x6c, 0x3e, 0x9d, 0xed, 0xf6, 0xdf, 0xe5, 0x7e, 0xcf, 0x3d, 0x80, 0x04, 0x00, + 0x4b, 0x22, 0x2c, 0x5e, 0xb0, 0x8a, 0x11, 0x20, 0x02, 0xe7, 0x2f, 0x9c, 0x2c, 0xae, 0x83, 0x50, + 0x73, 0x28, 0x2a, 0x58, 0xa3, 0x88, 0xbe, 0x02, 0x25, 0x47, 0xa6, 0xc6, 0x14, 0x41, 0x70, 0x5e, + 0xce, 0xdc, 0x8e, 0xbd, 0xb3, 0x86, 0xf2, 0xb5, 0xac, 0x90, 0x70, 0x42, 0x14, 0xed, 0xc2, 0xe4, + 0x7e, 0xd4, 0xde, 0x21, 0x72, 0xfb, 0xb2, 0x98, 0x38, 0x39, 0xc7, 0xd5, 0x5d, 0x81, 0xe8, 0x86, + 0x71, 0xc7, 0xf1, 0xba, 0x38, 0x0e, 0x73, 0x1c, 0xbb, 0xab, 0x13, 0xc3, 0x26, 0x6d, 0x3a, 0xfc, + 0xef, 0x77, 0x82, 0xad, 0x83, 0x98, 0x88, 0x48, 0xfb, 0x99, 0xc3, 0xff, 0x36, 0x47, 0xe9, 0x1e, + 0x7e, 0x01, 0xc0, 0x92, 0x08, 0xdd, 0xe0, 0x8e, 0x4c, 0x3b, 0x2b, 0x74, 0x39, 0xcf, 0xe6, 0x0e, + 0x4f, 0x57, 0x7f, 0x93, 0x41, 0x61, 0x9c, 0x31, 0x21, 0xc5, 0x38, 0x62, 0x7b, 0x27, 0x88, 0x03, + 0x3f, 0xc5, 0x8d, 0x67, 0xf3, 0x39, 0x62, 0x2d, 0x03, 0xbf, 0x9b, 0x23, 0x66, 0x61, 0xe1, 0xcc, + 0xb6, 0x50, 0x13, 0xa6, 0xda, 0x41, 0x18, 0xdf, 0x0f, 0x42, 0xb9, 0xbe, 0x50, 0x8f, 0x4b, 0xbe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, 0x69, 0xa6, 0x3f, + 0xe7, 0xec, 0x4c, 0xef, 0xff, 0xab, 0x05, 0xd3, 0xa9, 0xd6, 0x91, 0x97, 0xe5, 0x1b, 0xf8, 0x90, + 0x1a, 0xbd, 0xd9, 0xbe, 0xce, 0x84, 0x0b, 0x00, 0xea, 0xd9, 0x4c, 0x6a, 0xbb, 0x98, 0xd4, 0xaf, + 0xde, 0xd5, 0x22, 0xac, 0x61, 0xa0, 0x57, 0x61, 0x3c, 0x0e, 0xda, 0x81, 0x17, 0xb4, 0x0e, 0x6e, + 0x12, 0x19, 0x33, 0x4a, 0x3d, 0x6e, 0x6e, 0x26, 0x20, 0xac, 0xe3, 0xd9, 0x3f, 0x5b, 0xe4, 0x1f, + 0xea, 0xc7, 0xee, 0xb7, 0xd6, 0xe4, 0xc7, 0x7b, 0x4d, 0x7e, 0xd3, 0x82, 0x19, 0xda, 0x3a, 0xb3, + 0x5e, 0x93, 0x87, 0xad, 0xca, 0x15, 0x66, 0xf5, 0xc8, 0x15, 0x76, 0x85, 0xf2, 0xae, 0x66, 0xd0, + 0x89, 0x85, 0xb6, 0x4c, 0x63, 0x4e, 0xb4, 0x14, 0x0b, 0xa8, 0xc0, 0x23, 0x61, 0x28, 0x3c, 0xfe, + 0x74, 0x3c, 0x12, 0x86, 0x58, 0x40, 0x65, 0x2a, 0xb1, 0xa1, 0x9c, 0x54, 0x62, 0x2c, 0x02, 0xa6, + 0xb0, 0x98, 0x12, 0x62, 0x8f, 0x16, 0x01, 0x53, 0x9a, 0x52, 0x25, 0x38, 0xf6, 0x2f, 0x14, 0x61, + 0xa2, 0x16, 0x34, 0x93, 0x87, 0xab, 0x57, 0x8c, 0x87, 0xab, 0xcb, 0xa9, 0x87, 0xab, 0x19, 0x1d, + 0xf7, 0x5b, 0xcf, 0x54, 0x1f, 0xd5, 0x33, 0xd5, 0xbf, 0xb1, 0xd8, 0xac, 0x55, 0x36, 0xea, 0x22, + 0x19, 0xf7, 0x4b, 0x30, 0xce,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0xfa, 0x55, 0xee, 0x46, 0x10, 0xc5, 0x98, 0x41, 0xec, 0xdf, 0xb7, 0x60, 0x98, + 0x25, 0x95, 0xed, 0x97, 0x7c, 0x78, 0x90, 0xef, 0x42, 0xaf, 0xc2, 0x08, 0xd9, 0xde, 0x26, 0x8d, + 0x58, 0xcc, 0xaa, 0x74, 0xeb, 0x1b, 0x59, 0x65, 0xa5, 0xf4, 0xd0, 0x67, 0x8d, 0xf1, 0xbf, 0x58, + 0x20, 0xa3, 0x7b, 0x50, 0x8a, 0xdd, 0x3d, 0xb2, 0xd4, 0x6c, 0x8a, 0x77, 0x8d, 0x87, 0xf0, 0xa2, + 0xdc, 0x94, 0x04, 0x70, 0x42, 0xcb, 0xfe, 0x5a, 0x01, 0x20, 0x71, 0x4d, 0xee, 0xf7, 0x89, 0xcb, + 0x5d, 0xf9, 0x95, 0xaf, 0x64, 0xe4, 0x57, 0x46, 0x09, 0xc1, 0x8c, 0xec, 0xca, 0x6a, 0x98, 0x8a, + 0x03, 0x0d, 0xd3, 0xd0, 0x49, 0x86, 0x69, 0x05, 0x66, 0x13, 0xd7, 0x6a, 0x33, 0xce, 0x04, 0x8b, + 0x78, 0xbf, 0x99, 0x06, 0xe2, 0x6e, 0x7c, 0xfb, 0x07, 0x2c, 0x10, 0xee, 0x09, 0x03, 0x2c, 0xe6, + 0x77, 0x64, 0x2a, 0x54, 0x23, 0x50, 0xee, 0xe5, 0x7c, 0x7f, 0x0d, 0x11, 0x1e, 0x57, 0x1d, 0x1e, + 0x46, 0x50, 0x5c, 0x83, 0x96, 0xdd, 0x04, 0x01, 0xad, 0x10, 0xa6, 0x64, 0xe8, 0xdf, 0x9b, 0x6b, + 0x00, 0x4d, 0x86, 0xab, 0xa5, 0x56, 0x54, 0xac, 0xaa, 0xa2, 0x20, 0x58, 0xc3, 0xb2, 0x7f, 0xa4, + 0x00, 0xe3, 0x32, 0x30, 0x2b, 0xbd, 0xc7, 0xf7, 0x6f, 0xe5, 0x44, 0x59, 0x19, 0x58, 0x2e, 0x52, + 0x4a, 0x58, 0x05, 0xef, 0xd7, 0x73, 0x91, 0x4a, 0x00, 0x4e, 0x70, 0xd0, 0xb3, 0x30, 0x1a, 0x75, + 0xb6, 0x18, 0x7a, 0xca, 0xe8, 0xbe, 0xce, 0x8b, 0xb1, 0x84, 0xa3, 0x2f, 0xc2, 0x0c, 0xaf, 0x17, + 0x06, 0x6d, 0xa7, 0xc5, 0x35, 0x4e, 0xc3, 0xca, 0x0b, 0x6e, 0x66, 0x3d, 0x05, 0x3b, 0x3e, 0x2c, + 0x9f, 0x4f, 0x97, 0x31, 0x5d, 0x65, 0x17, 0x15, 0xfb, 0x2b, 0x80, 0xba, 0x63, 0xcd, 0xa2, 0xb7, + 0xb8, 0x59, 0x85, 0x1b, 0x92, 0x66, 0x2f, 0x25, 0xa4, 0xee, 0xb4, 0x25, 0x0d, 0x5f, 0x79, 0x2d, + 0xac, 0xea, 0xd3, 0x9d, 0x37, 0x93, 0x76, 0xe1, 0x41, 0x37, 0x60, 0x84, 0x33, 0x55, 0x41, 0xbe, + 0xc7, 0x1b, 0x97, 0xe6, 0xf8, 0xc3, 0x02, 0xe1, 0x0b, 0xbe, 0x2c, 0xea, 0xa3, 0x77, 0x61, 0xbc, + 0x19, 0xdc, 0xf7, 0xef, 0x3b, 0x61, 0x73, 0xa9, 0x56, 0x15, 0xeb, 0x32, 0x53, 0x36, 0xab, 0x24, + 0x68, 0xba, 0x33, 0x11, 0xd3, 0xe7, 0x26, 0x20, 0xac, 0x93, 0x43, 0x9b, 0x2c, 0x7e, 0xd6, 0xb6, + 0xdb, 0x5a, 0x77, 0xda, 0xbd, 0xec, 0xe0, 0x56, 0x24, 0x92, 0x46, 0x79, 0x52, 0x04, 0xd9, 0xe2, + 0x00, 0x9c, 0x10, 0xb2, 0xbf, 0x7a, 0x0e, 0x8c, 0xfd, 0x60, 0xe4, 0x7d, 0xb0, 0x4e, 0x29, 0xef, + 0x03, 0x86, 0x31, 0xb2,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0x13, 0x0e, 0x7c, 0xe0, 0x48, 0x0f, 0xdb, 0x30, 0xdd, 0x36, 0xab, 0xf6, 0x09, 0x08, 0x63, + 0x04, 0x1d, 0x57, 0x7d, 0x4d, 0x01, 0x70, 0x9a, 0xe8, 0xf2, 0xd5, 0xdf, 0xfc, 0xc3, 0x4b, 0x9f, + 0xf8, 0x9d, 0x3f, 0xbc, 0xf4, 0x89, 0xdf, 0xfb, 0xc3, 0x4b, 0x9f, 0xf8, 0xeb, 0x47, 0x97, 0xac, + 0xdf, 0x3c, 0xba, 0x64, 0xfd, 0xce, 0xd1, 0x25, 0xeb, 0xf7, 0x8e, 0x2e, 0x59, 0x7f, 0x70, 0x74, + 0xc9, 0xfa, 0xda, 0x1f, 0x5d, 0xfa, 0xc4, 0x3b, 0x85, 0xfd, 0x97, 0xfe, 0x7f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xcc, 0x93, 0x27, 0x7c, 0x56, 0xe4, 0x00, 0x00, } diff --git a/vendor/k8s.io/api/core/v1/generated.proto b/vendor/k8s.io/api/core/v1/generated.proto index 663b86f11..845db97b1 100644 --- a/vendor/k8s.io/api/core/v1/generated.proto +++ b/vendor/k8s.io/api/core/v1/generated.proto @@ -170,7 +170,7 @@ message Binding { optional ObjectReference target = 2; } -// Represents storage that is managed by an external CSI volume driver +// Represents storage that is managed by an external CSI volume driver (Beta feature) message CSIPersistentVolumeSource { // Driver is the name of the driver to use for this volume. // Required. @@ -185,6 +185,40 @@ message CSIPersistentVolumeSource { // Defaults to false (read/write). // +optional optional bool readOnly = 3; + + // Filesystem type to mount. + // Must be a filesystem type supported by the host operating system. + // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + // +optional + optional string fsType = 4; + + // Attributes of the volume to publish. + // +optional + map volumeAttributes = 5; + + // ControllerPublishSecretRef is a reference to the secret object containing + // sensitive information to pass to the CSI driver to complete the CSI + // ControllerPublishVolume and ControllerUnpublishVolume calls. + // This field is optional, and may be empty if no secret is required. If the + // secret object contains more than one secret, all secrets are passed. + // +optional + optional SecretReference controllerPublishSecretRef = 6; + + // NodeStageSecretRef is a reference to the secret object containing sensitive + // information to pass to the CSI driver to complete the CSI NodeStageVolume + // and NodeStageVolume and NodeUnstageVolume calls. + // This field is optional, and may be empty if no secret is required. If the + // secret object contains more than one secret, all secrets are passed. + // +optional + optional SecretReference nodeStageSecretRef = 7; + + // NodePublishSecretRef is a reference to the secret object containing + // sensitive information to pass to the CSI driver to complete the CSI + // NodePublishVolume and NodeUnpublishVolume calls. + // This field is optional, and may be empty if no secret is required. If the + // secret object contains more than one secret, all secrets are passed. + // +optional + optional SecretReference nodePublishSecretRef = 8; } // Adds and removes POSIX capabilities from running containers. @@ -351,8 +385,21 @@ message ConfigMap { // Data contains the configuration data. // Each key must consist of alphanumeric characters, '-', '_' or '.'. + // Values with non-UTF-8 byte sequences must use the BinaryData field. + // The keys stored in Data must not overlap with the keys in + // the BinaryData field, this is enforced during validation process. // +optional map data = 2; + + // BinaryData contains the binary data. + // Each key must consist of alphanumeric characters, '-', '_' or '.'. + // BinaryData can contain byte sequences that are not in the UTF-8 range. + // The keys stored in BinaryData must not overlap with the ones in + // the Data field, this is enforced during validation process. + // Using this field will require 1.10+ apiserver and + // kubelet. + // +optional + map binaryData = 3; } // ConfigMapEnvSource selects a ConfigMap to populate the environment @@ -618,7 +665,7 @@ message Container { // Describe a container image message ContainerImage { // Names by which this image is known. - // e.g. ["gcr.io/google_containers/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"] + // e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"] repeated string names = 1; // The size of the image in bytes. @@ -957,6 +1004,7 @@ message Endpoints { // subsets for the different ports. No address will appear in both Addresses and // NotReadyAddresses in the same subset. // Sets of addresses and ports that comprise a service. + // +optional repeated EndpointSubset subsets = 2; } @@ -973,7 +1021,7 @@ message EndpointsList { // EnvFromSource represents the source of a set of ConfigMaps message EnvFromSource { - // An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. + // An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. // +optional optional string prefix = 1; @@ -1105,12 +1153,12 @@ message EventList { } // EventSeries contain information on series of events, i.e. thing that was/is happening -// continously for some time. +// continuously for some time. message EventSeries { // Number of occurrences in this series up to the last heartbeat time optional int32 count = 1; - // Time of the last occurence observed + // Time of the last occurrence observed optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2; // State of this Series: Ongoing or Finished @@ -1169,6 +1217,36 @@ message FCVolumeSource { repeated string wwids = 5; } +// FlexPersistentVolumeSource represents a generic persistent volume resource that is +// provisioned/attached using an exec based plugin. +message FlexPersistentVolumeSource { + // Driver is the name of the driver to use for this volume. + optional string driver = 1; + + // Filesystem type to mount. + // Must be a filesystem type supported by the host operating system. + // Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. + // +optional + optional string fsType = 2; + + // Optional: SecretRef is reference to the secret object containing + // sensitive information to pass to the plugin scripts. This may be + // empty if no secret object is specified. If the secret object + // contains more than one secret, all secrets are passed to the plugin + // scripts. + // +optional + optional SecretReference secretRef = 3; + + // Optional: Defaults to false (read/write). ReadOnly here will force + // the ReadOnly setting in VolumeMounts. + // +optional + optional bool readOnly = 4; + + // Optional: Extra command options if any. + // +optional + map options = 5; +} + // FlexVolume represents a generic volume resource that is // provisioned/attached using an exec based plugin. message FlexVolumeSource { @@ -2441,7 +2519,7 @@ message PersistentVolumeSource { // FlexVolume represents a generic volume resource that is // provisioned/attached using an exec based plugin. // +optional - optional FlexVolumeSource flexVolume = 12; + optional FlexPersistentVolumeSource flexVolume = 12; // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. // +optional @@ -2479,7 +2557,7 @@ message PersistentVolumeSource { // +optional optional StorageOSPersistentVolumeSource storageos = 21; - // CSI represents storage that handled by an external CSI driver + // CSI represents storage that handled by an external CSI driver (Beta feature). // +optional optional CSIPersistentVolumeSource csi = 22; } @@ -2507,8 +2585,9 @@ message PersistentVolumeSpec { optional ObjectReference claimRef = 4; // What happens to a persistent volume when released from its claim. - // Valid options are Retain (default) and Recycle. - // Recycling must be supported by the volume plugin underlying this persistent volume. + // Valid options are Retain (default for manually created PersistentVolumes), Delete (default + // for dynamically provisioned PersistentVolumes), and Recycle (deprecated). + // Recycle must be supported by the volume plugin underlying this PersistentVolume. // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming // +optional optional string persistentVolumeReclaimPolicy = 5; @@ -2529,6 +2608,11 @@ message PersistentVolumeSpec { // This is an alpha feature and may change in the future. // +optional optional string volumeMode = 8; + + // NodeAffinity defines constraints that limit what nodes this volume can be accessed from. + // This field influences the scheduling of pods that use this volume. + // +optional + optional VolumeNodeAffinity nodeAffinity = 9; } // PersistentVolumeStatus is the current status of a persistent volume. @@ -2619,6 +2703,7 @@ message PodAffinityTerm { // namespaces specifies which namespaces the labelSelector applies to (matches against); // null or empty list means "this pod's namespace" + // +optional repeated string namespaces = 2; // This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching @@ -2879,6 +2964,14 @@ message PodSecurityContext { // +optional optional int64 runAsUser = 2; + // The GID to run the entrypoint of the container process. + // Uses runtime default if unset. + // May also be set in SecurityContext. If set in both SecurityContext and + // PodSecurityContext, the value specified in SecurityContext takes precedence + // for that container. + // +optional + optional int64 runAsGroup = 6; + // Indicates that the container must run as a non-root user. // If true, the Kubelet will validate the image at runtime to ensure that it // does not run as UID 0 (root) and fail to start the container if it does. @@ -2978,7 +3071,6 @@ message PodSpec { // DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. // To have DNS options set along with hostNetwork, you have to specify DNS policy // explicitly to 'ClusterFirstWithHostNet'. - // Note that 'None' policy is an alpha feature introduced in v1.9 and CustomPodDNS feature gate must be enabled to use it. // +optional optional string dnsPolicy = 6; @@ -3028,6 +3120,16 @@ message PodSpec { // +optional optional bool hostIPC = 13; + // Share a single process namespace between all of the containers in a pod. + // When this is set containers will be able to view and signal processes from other containers + // in the same pod, and the first process in each container will not be assigned PID 1. + // HostPID and ShareProcessNamespace cannot both be set. + // Optional: Default to false. + // This field is alpha-level and is honored only by servers that enable the PodShareProcessNamespace feature. + // +k8s:conversion-gen=false + // +optional + optional bool shareProcessNamespace = 27; + // SecurityContext holds pod-level security attributes and common container settings. // Optional: Defaults to empty. See type description for default values of each field. // +optional @@ -3072,9 +3174,10 @@ message PodSpec { // +patchStrategy=merge repeated HostAlias hostAliases = 23; - // If specified, indicates the pod's priority. "SYSTEM" is a special keyword - // which indicates the highest priority. Any other name must be defined by - // creating a PriorityClass object with that name. + // If specified, indicates the pod's priority. "system-node-critical" and + // "system-cluster-critical" are two special keywords which indicate the + // highest priorities with the former being the highest priority. Any other + // name must be defined by creating a PriorityClass object with that name. // If not specified, the pod priority will be default or zero if there is no // default. // +optional @@ -3091,7 +3194,6 @@ message PodSpec { // Specifies the DNS parameters of a pod. // Parameters specified here will be merged to the generated DNS // configuration based on DNSPolicy. - // This is an alpha feature introduced in v1.9 and CustomPodDNS feature gate must be enabled to use it. // +optional optional PodDNSConfig dnsConfig = 26; } @@ -3120,6 +3222,16 @@ message PodStatus { // +optional optional string reason = 4; + // nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be + // scheduled right away as preemption victims receive their graceful termination periods. + // This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide + // to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to + // give the resources on this node to a higher priority pod that is created after preemption. + // As a result, this field may be different than PodSpec.nodeName when the pod is + // scheduled. + // +optional + optional string nominatedNodeName = 11; + // IP address of the host to which the pod is assigned. Empty if not yet scheduled. // +optional optional string hostIP = 5; @@ -3148,7 +3260,7 @@ message PodStatus { // The Quality of Service (QOS) classification assigned to the pod based on resource requirements // See PodQOSClass type for available QOS classes - // More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md + // More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md // +optional optional string qosClass = 9; } @@ -3920,6 +4032,13 @@ message SecurityContext { // +optional optional int64 runAsUser = 4; + // The GID to run the entrypoint of the container process. + // Uses runtime default if unset. + // May also be set in PodSecurityContext. If set in both SecurityContext and + // PodSecurityContext, the value specified in SecurityContext takes precedence. + // +optional + optional int64 runAsGroup = 8; + // Indicates that the container must run as a non-root user. // If true, the Kubelet will validate the image at runtime to ensure that it // does not run as UID 0 (root) and fail to start the container if it does. @@ -4390,12 +4509,17 @@ message VolumeMount { // mountPropagation determines how mounts are propagated from the host // to container and the other way around. // When not set, MountPropagationHostToContainer is used. - // This field is alpha in 1.8 and can be reworked or removed in a future - // release. + // This field is beta in 1.10. // +optional optional string mountPropagation = 5; } +// VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from. +message VolumeNodeAffinity { + // Required specifies hard node constraints that must be met. + optional NodeSelector required = 1; +} + // Projection that may be projected along with other supported volume types message VolumeProjection { // information about the secret data to project diff --git a/vendor/k8s.io/api/core/v1/register.go b/vendor/k8s.io/api/core/v1/register.go index 62bf076eb..526e1320a 100644 --- a/vendor/k8s.io/api/core/v1/register.go +++ b/vendor/k8s.io/api/core/v1/register.go @@ -14,8 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -//TODO: this file is going to be moved to k8s.io/api - package v1 import ( diff --git a/vendor/k8s.io/api/core/v1/types.go b/vendor/k8s.io/api/core/v1/types.go index 728cbd5a6..08ef4194e 100644 --- a/vendor/k8s.io/api/core/v1/types.go +++ b/vendor/k8s.io/api/core/v1/types.go @@ -418,7 +418,7 @@ type PersistentVolumeSource struct { // FlexVolume represents a generic volume resource that is // provisioned/attached using an exec based plugin. // +optional - FlexVolume *FlexVolumeSource `json:"flexVolume,omitempty" protobuf:"bytes,12,opt,name=flexVolume"` + FlexVolume *FlexPersistentVolumeSource `json:"flexVolume,omitempty" protobuf:"bytes,12,opt,name=flexVolume"` // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. // +optional AzureFile *AzureFilePersistentVolumeSource `json:"azureFile,omitempty" protobuf:"bytes,13,opt,name=azureFile"` @@ -446,7 +446,7 @@ type PersistentVolumeSource struct { // More info: https://releases.k8s.io/HEAD/examples/volumes/storageos/README.md // +optional StorageOS *StorageOSPersistentVolumeSource `json:"storageos,omitempty" protobuf:"bytes,21,opt,name=storageos"` - // CSI represents storage that handled by an external CSI driver + // CSI represents storage that handled by an external CSI driver (Beta feature). // +optional CSI *CSIPersistentVolumeSource `json:"csi,omitempty" protobuf:"bytes,22,opt,name=csi"` } @@ -511,8 +511,9 @@ type PersistentVolumeSpec struct { // +optional ClaimRef *ObjectReference `json:"claimRef,omitempty" protobuf:"bytes,4,opt,name=claimRef"` // What happens to a persistent volume when released from its claim. - // Valid options are Retain (default) and Recycle. - // Recycling must be supported by the volume plugin underlying this persistent volume. + // Valid options are Retain (default for manually created PersistentVolumes), Delete (default + // for dynamically provisioned PersistentVolumes), and Recycle (deprecated). + // Recycle must be supported by the volume plugin underlying this PersistentVolume. // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming // +optional PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty" protobuf:"bytes,5,opt,name=persistentVolumeReclaimPolicy,casttype=PersistentVolumeReclaimPolicy"` @@ -530,6 +531,16 @@ type PersistentVolumeSpec struct { // This is an alpha feature and may change in the future. // +optional VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,8,opt,name=volumeMode,casttype=PersistentVolumeMode"` + // NodeAffinity defines constraints that limit what nodes this volume can be accessed from. + // This field influences the scheduling of pods that use this volume. + // +optional + NodeAffinity *VolumeNodeAffinity `json:"nodeAffinity,omitempty" protobuf:"bytes,9,opt,name=nodeAffinity"` +} + +// VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from. +type VolumeNodeAffinity struct { + // Required specifies hard node constraints that must be met. + Required *NodeSelector `json:"required,omitempty" protobuf:"bytes,1,opt,name=required"` } // PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes. @@ -657,6 +668,8 @@ type PersistentVolumeClaimConditionType string const ( // PersistentVolumeClaimResizing - a user trigger resize of pvc has been started PersistentVolumeClaimResizing PersistentVolumeClaimConditionType = "Resizing" + // PersistentVolumeClaimFileSystemResizePending - controller resize is finished and a file system resize is pending on node + PersistentVolumeClaimFileSystemResizePending PersistentVolumeClaimConditionType = "FileSystemResizePending" ) // PersistentVolumeClaimCondition contails details about state of pvc @@ -1008,8 +1021,8 @@ type FlockerVolumeSource struct { type StorageMedium string const ( - StorageMediumDefault StorageMedium = "" // use whatever the default is for the node - StorageMediumMemory StorageMedium = "Memory" // use memory (tmpfs) + StorageMediumDefault StorageMedium = "" // use whatever the default is for the node, assume anything we don't explicitly handle is this + StorageMediumMemory StorageMedium = "Memory" // use memory (e.g. tmpfs on linux) StorageMediumHugePages StorageMedium = "HugePages" // use hugepages ) @@ -1081,6 +1094,32 @@ type QuobyteVolumeSource struct { Group string `json:"group,omitempty" protobuf:"bytes,5,opt,name=group"` } +// FlexPersistentVolumeSource represents a generic persistent volume resource that is +// provisioned/attached using an exec based plugin. +type FlexPersistentVolumeSource struct { + // Driver is the name of the driver to use for this volume. + Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"` + // Filesystem type to mount. + // Must be a filesystem type supported by the host operating system. + // Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. + // +optional + FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` + // Optional: SecretRef is reference to the secret object containing + // sensitive information to pass to the plugin scripts. This may be + // empty if no secret object is specified. If the secret object + // contains more than one secret, all secrets are passed to the plugin + // scripts. + // +optional + SecretRef *SecretReference `json:"secretRef,omitempty" protobuf:"bytes,3,opt,name=secretRef"` + // Optional: Defaults to false (read/write). ReadOnly here will force + // the ReadOnly setting in VolumeMounts. + // +optional + ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` + // Optional: Extra command options if any. + // +optional + Options map[string]string `json:"options,omitempty" protobuf:"bytes,5,rep,name=options"` +} + // FlexVolume represents a generic volume resource that is // provisioned/attached using an exec based plugin. type FlexVolumeSource struct { @@ -1689,7 +1728,7 @@ type LocalVolumeSource struct { Path string `json:"path" protobuf:"bytes,1,opt,name=path"` } -// Represents storage that is managed by an external CSI volume driver +// Represents storage that is managed by an external CSI volume driver (Beta feature) type CSIPersistentVolumeSource struct { // Driver is the name of the driver to use for this volume. // Required. @@ -1704,6 +1743,40 @@ type CSIPersistentVolumeSource struct { // Defaults to false (read/write). // +optional ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` + + // Filesystem type to mount. + // Must be a filesystem type supported by the host operating system. + // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + // +optional + FSType string `json:"fsType,omitempty" protobuf:"bytes,4,opt,name=fsType"` + + // Attributes of the volume to publish. + // +optional + VolumeAttributes map[string]string `json:"volumeAttributes,omitempty" protobuf:"bytes,5,rep,name=volumeAttributes"` + + // ControllerPublishSecretRef is a reference to the secret object containing + // sensitive information to pass to the CSI driver to complete the CSI + // ControllerPublishVolume and ControllerUnpublishVolume calls. + // This field is optional, and may be empty if no secret is required. If the + // secret object contains more than one secret, all secrets are passed. + // +optional + ControllerPublishSecretRef *SecretReference `json:"controllerPublishSecretRef,omitempty" protobuf:"bytes,6,opt,name=controllerPublishSecretRef"` + + // NodeStageSecretRef is a reference to the secret object containing sensitive + // information to pass to the CSI driver to complete the CSI NodeStageVolume + // and NodeStageVolume and NodeUnstageVolume calls. + // This field is optional, and may be empty if no secret is required. If the + // secret object contains more than one secret, all secrets are passed. + // +optional + NodeStageSecretRef *SecretReference `json:"nodeStageSecretRef,omitempty" protobuf:"bytes,7,opt,name=nodeStageSecretRef"` + + // NodePublishSecretRef is a reference to the secret object containing + // sensitive information to pass to the CSI driver to complete the CSI + // NodePublishVolume and NodeUnpublishVolume calls. + // This field is optional, and may be empty if no secret is required. If the + // secret object contains more than one secret, all secrets are passed. + // +optional + NodePublishSecretRef *SecretReference `json:"nodePublishSecretRef,omitempty" protobuf:"bytes,8,opt,name=nodePublishSecretRef"` } // ContainerPort represents a network port in a single container. @@ -1749,8 +1822,7 @@ type VolumeMount struct { // mountPropagation determines how mounts are propagated from the host // to container and the other way around. // When not set, MountPropagationHostToContainer is used. - // This field is alpha in 1.8 and can be reworked or removed in a future - // release. + // This field is beta in 1.10. // +optional MountPropagation *MountPropagationMode `json:"mountPropagation,omitempty" protobuf:"bytes,5,opt,name=mountPropagation,casttype=MountPropagationMode"` } @@ -1867,7 +1939,7 @@ type SecretKeySelector struct { // EnvFromSource represents the source of a set of ConfigMaps type EnvFromSource struct { - // An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. + // An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. // +optional Prefix string `json:"prefix,omitempty" protobuf:"bytes,1,opt,name=prefix"` // The ConfigMap to select from @@ -2433,7 +2505,11 @@ const ( // parameters such as nameservers and search paths should be defined via // DNSConfig. DNSNone DNSPolicy = "None" +) +const ( + // DefaultTerminationGracePeriodSeconds indicates the default duration in + // seconds a pod needs to terminate gracefully. DefaultTerminationGracePeriodSeconds = 30 ) @@ -2585,6 +2661,7 @@ type PodAffinityTerm struct { LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty" protobuf:"bytes,1,opt,name=labelSelector"` // namespaces specifies which namespaces the labelSelector applies to (matches against); // null or empty list means "this pod's namespace" + // +optional Namespaces []string `json:"namespaces,omitempty" protobuf:"bytes,2,rep,name=namespaces"` // This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching // the labelSelector in the specified namespaces, where co-located is defined as running on a node @@ -2769,7 +2846,6 @@ type PodSpec struct { // DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. // To have DNS options set along with hostNetwork, you have to specify DNS policy // explicitly to 'ClusterFirstWithHostNet'. - // Note that 'None' policy is an alpha feature introduced in v1.9 and CustomPodDNS feature gate must be enabled to use it. // +optional DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" protobuf:"bytes,6,opt,name=dnsPolicy,casttype=DNSPolicy"` // NodeSelector is a selector which must be true for the pod to fit on a node. @@ -2812,6 +2888,15 @@ type PodSpec struct { // +k8s:conversion-gen=false // +optional HostIPC bool `json:"hostIPC,omitempty" protobuf:"varint,13,opt,name=hostIPC"` + // Share a single process namespace between all of the containers in a pod. + // When this is set containers will be able to view and signal processes from other containers + // in the same pod, and the first process in each container will not be assigned PID 1. + // HostPID and ShareProcessNamespace cannot both be set. + // Optional: Default to false. + // This field is alpha-level and is honored only by servers that enable the PodShareProcessNamespace feature. + // +k8s:conversion-gen=false + // +optional + ShareProcessNamespace *bool `json:"shareProcessNamespace,omitempty" protobuf:"varint,27,opt,name=shareProcessNamespace"` // SecurityContext holds pod-level security attributes and common container settings. // Optional: Defaults to empty. See type description for default values of each field. // +optional @@ -2848,9 +2933,10 @@ type PodSpec struct { // +patchMergeKey=ip // +patchStrategy=merge HostAliases []HostAlias `json:"hostAliases,omitempty" patchStrategy:"merge" patchMergeKey:"ip" protobuf:"bytes,23,rep,name=hostAliases"` - // If specified, indicates the pod's priority. "SYSTEM" is a special keyword - // which indicates the highest priority. Any other name must be defined by - // creating a PriorityClass object with that name. + // If specified, indicates the pod's priority. "system-node-critical" and + // "system-cluster-critical" are two special keywords which indicate the + // highest priorities with the former being the highest priority. Any other + // name must be defined by creating a PriorityClass object with that name. // If not specified, the pod priority will be default or zero if there is no // default. // +optional @@ -2865,7 +2951,6 @@ type PodSpec struct { // Specifies the DNS parameters of a pod. // Parameters specified here will be merged to the generated DNS // configuration based on DNSPolicy. - // This is an alpha feature introduced in v1.9 and CustomPodDNS feature gate must be enabled to use it. // +optional DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty" protobuf:"bytes,26,opt,name=dnsConfig"` } @@ -2897,6 +2982,13 @@ type PodSecurityContext struct { // for that container. // +optional RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,2,opt,name=runAsUser"` + // The GID to run the entrypoint of the container process. + // Uses runtime default if unset. + // May also be set in SecurityContext. If set in both SecurityContext and + // PodSecurityContext, the value specified in SecurityContext takes precedence + // for that container. + // +optional + RunAsGroup *int64 `json:"runAsGroup,omitempty" protobuf:"varint,6,opt,name=runAsGroup"` // Indicates that the container must run as a non-root user. // If true, the Kubelet will validate the image at runtime to ensure that it // does not run as UID 0 (root) and fail to start the container if it does. @@ -2984,6 +3076,15 @@ type PodStatus struct { // e.g. 'Evicted' // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` + // nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be + // scheduled right away as preemption victims receive their graceful termination periods. + // This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide + // to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to + // give the resources on this node to a higher priority pod that is created after preemption. + // As a result, this field may be different than PodSpec.nodeName when the pod is + // scheduled. + // +optional + NominatedNodeName string `json:"nominatedNodeName,omitempty" protobuf:"bytes,11,opt,name=nominatedNodeName"` // IP address of the host to which the pod is assigned. Empty if not yet scheduled. // +optional @@ -3011,7 +3112,7 @@ type PodStatus struct { ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty" protobuf:"bytes,8,rep,name=containerStatuses"` // The Quality of Service (QOS) classification assigned to the pod based on resource requirements // See PodQOSClass type for available QOS classes - // More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md + // More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md // +optional QOSClass PodQOSClass `json:"qosClass,omitempty" protobuf:"bytes,9,rep,name=qosClass"` } @@ -3626,7 +3727,8 @@ type Endpoints struct { // subsets for the different ports. No address will appear in both Addresses and // NotReadyAddresses in the same subset. // Sets of addresses and ports that comprise a service. - Subsets []EndpointSubset `json:"subsets" protobuf:"bytes,2,rep,name=subsets"` + // +optional + Subsets []EndpointSubset `json:"subsets,omitempty" protobuf:"bytes,2,rep,name=subsets"` } // EndpointSubset is a group of addresses with a common set of ports. The @@ -3879,7 +3981,7 @@ type PodSignature struct { // Describe a container image type ContainerImage struct { // Names by which this image is known. - // e.g. ["gcr.io/google_containers/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"] + // e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"] Names []string `json:"names" protobuf:"bytes,1,rep,name=names"` // The size of the image in bytes. // +optional @@ -3913,10 +4015,12 @@ const ( NodeMemoryPressure NodeConditionType = "MemoryPressure" // NodeDiskPressure means the kubelet is under pressure due to insufficient available disk. NodeDiskPressure NodeConditionType = "DiskPressure" + // NodePIDPressure means the kubelet is under pressure due to insufficient available PID. + NodePIDPressure NodeConditionType = "PIDPressure" // NodeNetworkUnavailable means that network for the node is not correctly configured. NodeNetworkUnavailable NodeConditionType = "NetworkUnavailable" - // NodeConfigOK indicates whether the kubelet is correctly configured - NodeConfigOK NodeConditionType = "ConfigOK" + // NodeKubeletConfigOk indicates whether the kubelet is correctly configured + NodeKubeletConfigOk NodeConditionType = "KubeletConfigOk" ) // NodeCondition contains condition information for a node. @@ -4534,11 +4638,11 @@ type Event struct { } // EventSeries contain information on series of events, i.e. thing that was/is happening -// continously for some time. +// continuously for some time. type EventSeries struct { // Number of occurrences in this series up to the last heartbeat time Count int32 `json:"count,omitempty" protobuf:"varint,1,name=count"` - // Time of the last occurence observed + // Time of the last occurrence observed LastObservedTime metav1.MicroTime `json:"lastObservedTime,omitempty" protobuf:"bytes,2,name=lastObservedTime"` // State of this Series: Ongoing or Finished State EventSeriesState `json:"state,omitempty" protobuf:"bytes,3,name=state"` @@ -4684,6 +4788,8 @@ const ( // HugePages request, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) // As burst is not supported for HugePages, we would only quota its request, and ignore the limit. ResourceRequestsHugePagesPrefix = "requests.hugepages-" + // Default resource requests prefix + DefaultResourceRequestsPrefix = "requests." ) // A ResourceQuotaScope defines a filter that must match each object tracked by a quota @@ -4903,8 +5009,21 @@ type ConfigMap struct { // Data contains the configuration data. // Each key must consist of alphanumeric characters, '-', '_' or '.'. + // Values with non-UTF-8 byte sequences must use the BinaryData field. + // The keys stored in Data must not overlap with the keys in + // the BinaryData field, this is enforced during validation process. // +optional Data map[string]string `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"` + + // BinaryData contains the binary data. + // Each key must consist of alphanumeric characters, '-', '_' or '.'. + // BinaryData can contain byte sequences that are not in the UTF-8 range. + // The keys stored in BinaryData must not overlap with the ones in + // the Data field, this is enforced during validation process. + // Using this field will require 1.10+ apiserver and + // kubelet. + // +optional + BinaryData map[string][]byte `json:"binaryData,omitempty" protobuf:"bytes,3,rep,name=binaryData"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -5052,6 +5171,12 @@ type SecurityContext struct { // PodSecurityContext, the value specified in SecurityContext takes precedence. // +optional RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,4,opt,name=runAsUser"` + // The GID to run the entrypoint of the container process. + // Uses runtime default if unset. + // May also be set in PodSecurityContext. If set in both SecurityContext and + // PodSecurityContext, the value specified in SecurityContext takes precedence. + // +optional + RunAsGroup *int64 `json:"runAsGroup,omitempty" protobuf:"varint,8,opt,name=runAsGroup"` // Indicates that the container must run as a non-root user. // If true, the Kubelet will validate the image at runtime to ensure that it // does not run as UID 0 (root) and fail to start the container if it does. diff --git a/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go index c50dd0a05..7b41f018a 100644 --- a/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -117,10 +117,15 @@ func (Binding) SwaggerDoc() map[string]string { } var map_CSIPersistentVolumeSource = map[string]string{ - "": "Represents storage that is managed by an external CSI volume driver", - "driver": "Driver is the name of the driver to use for this volume. Required.", - "volumeHandle": "VolumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required.", - "readOnly": "Optional: The value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write).", + "": "Represents storage that is managed by an external CSI volume driver (Beta feature)", + "driver": "Driver is the name of the driver to use for this volume. Required.", + "volumeHandle": "VolumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required.", + "readOnly": "Optional: The value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write).", + "fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", + "volumeAttributes": "Attributes of the volume to publish.", + "controllerPublishSecretRef": "ControllerPublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", + "nodeStageSecretRef": "NodeStageSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", + "nodePublishSecretRef": "NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", } func (CSIPersistentVolumeSource) SwaggerDoc() map[string]string { @@ -218,9 +223,10 @@ func (ComponentStatusList) SwaggerDoc() map[string]string { } var map_ConfigMap = map[string]string{ - "": "ConfigMap holds configuration data for pods to consume.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "data": "Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'.", + "": "ConfigMap holds configuration data for pods to consume.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "data": "Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.", + "binaryData": "BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet.", } func (ConfigMap) SwaggerDoc() map[string]string { @@ -308,7 +314,7 @@ func (Container) SwaggerDoc() map[string]string { var map_ContainerImage = map[string]string{ "": "Describe a container image", - "names": "Names by which this image is known. e.g. [\"gcr.io/google_containers/hyperkube:v1.0.7\", \"dockerhub.io/google_containers/hyperkube:v1.0.7\"]", + "names": "Names by which this image is known. e.g. [\"k8s.gcr.io/hyperkube:v1.0.7\", \"dockerhub.io/google_containers/hyperkube:v1.0.7\"]", "sizeBytes": "The size of the image in bytes.", } @@ -508,7 +514,7 @@ func (EndpointsList) SwaggerDoc() map[string]string { var map_EnvFromSource = map[string]string{ "": "EnvFromSource represents the source of a set of ConfigMaps", - "prefix": "An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.", + "prefix": "An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.", "configMapRef": "The ConfigMap to select from", "secretRef": "The Secret to select from", } @@ -574,9 +580,9 @@ func (EventList) SwaggerDoc() map[string]string { } var map_EventSeries = map[string]string{ - "": "EventSeries contain information on series of events, i.e. thing that was/is happening continously for some time.", + "": "EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time.", "count": "Number of occurrences in this series up to the last heartbeat time", - "lastObservedTime": "Time of the last occurence observed", + "lastObservedTime": "Time of the last occurrence observed", "state": "State of this Series: Ongoing or Finished", } @@ -616,6 +622,19 @@ func (FCVolumeSource) SwaggerDoc() map[string]string { return map_FCVolumeSource } +var map_FlexPersistentVolumeSource = map[string]string{ + "": "FlexPersistentVolumeSource represents a generic persistent volume resource that is provisioned/attached using an exec based plugin.", + "driver": "Driver is the name of the driver to use for this volume.", + "fsType": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", + "secretRef": "Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.", + "readOnly": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", + "options": "Optional: Extra command options if any.", +} + +func (FlexPersistentVolumeSource) SwaggerDoc() map[string]string { + return map_FlexPersistentVolumeSource +} + var map_FlexVolumeSource = map[string]string{ "": "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", "driver": "Driver is the name of the driver to use for this volume.", @@ -1261,7 +1280,7 @@ var map_PersistentVolumeSource = map[string]string{ "scaleIO": "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", "local": "Local represents directly-attached storage with node affinity", "storageos": "StorageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod More info: https://releases.k8s.io/HEAD/examples/volumes/storageos/README.md", - "csi": "CSI represents storage that handled by an external CSI driver", + "csi": "CSI represents storage that handled by an external CSI driver (Beta feature).", } func (PersistentVolumeSource) SwaggerDoc() map[string]string { @@ -1273,10 +1292,11 @@ var map_PersistentVolumeSpec = map[string]string{ "capacity": "A description of the persistent volume's resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", "accessModes": "AccessModes contains all ways the volume can be mounted. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes", "claimRef": "ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. Expected to be non-nil when bound. claim.VolumeName is the authoritative bind between PV and PVC. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding", - "persistentVolumeReclaimPolicy": "What happens to a persistent volume when released from its claim. Valid options are Retain (default) and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming", + "persistentVolumeReclaimPolicy": "What happens to a persistent volume when released from its claim. Valid options are Retain (default for manually created PersistentVolumes), Delete (default for dynamically provisioned PersistentVolumes), and Recycle (deprecated). Recycle must be supported by the volume plugin underlying this PersistentVolume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming", "storageClassName": "Name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.", "mountOptions": "A list of mount options, e.g. [\"ro\", \"soft\"]. Not validated - mount will simply fail if one is invalid. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options", "volumeMode": "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec. This is an alpha feature and may change in the future.", + "nodeAffinity": "NodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume.", } func (PersistentVolumeSpec) SwaggerDoc() map[string]string { @@ -1455,6 +1475,7 @@ var map_PodSecurityContext = map[string]string{ "": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.", "seLinuxOptions": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.", "runAsUser": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.", + "runAsGroup": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.", "runAsNonRoot": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "supplementalGroups": "A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container.", "fsGroup": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw ", @@ -1481,7 +1502,7 @@ var map_PodSpec = map[string]string{ "restartPolicy": "Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy", "terminationGracePeriodSeconds": "Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.", "activeDeadlineSeconds": "Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.", - "dnsPolicy": "Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'. Note that 'None' policy is an alpha feature introduced in v1.9 and CustomPodDNS feature gate must be enabled to use it.", + "dnsPolicy": "Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.", "nodeSelector": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", "serviceAccountName": "ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", "serviceAccount": "DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", @@ -1490,6 +1511,7 @@ var map_PodSpec = map[string]string{ "hostNetwork": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.", "hostPID": "Use the host's pid namespace. Optional: Default to false.", "hostIPC": "Use the host's ipc namespace. Optional: Default to false.", + "shareProcessNamespace": "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false. This field is alpha-level and is honored only by servers that enable the PodShareProcessNamespace feature.", "securityContext": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", "imagePullSecrets": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", "hostname": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", @@ -1498,9 +1520,9 @@ var map_PodSpec = map[string]string{ "schedulerName": "If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.", "tolerations": "If specified, the pod's tolerations.", "hostAliases": "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.", - "priorityClassName": "If specified, indicates the pod's priority. \"SYSTEM\" is a special keyword which indicates the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", + "priorityClassName": "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", "priority": "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.", - "dnsConfig": "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. This is an alpha feature introduced in v1.9 and CustomPodDNS feature gate must be enabled to use it.", + "dnsConfig": "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.", } func (PodSpec) SwaggerDoc() map[string]string { @@ -1513,12 +1535,13 @@ var map_PodStatus = map[string]string{ "conditions": "Current service state of pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", "message": "A human readable message indicating details about why the pod is in this condition.", "reason": "A brief CamelCase message indicating details about why the pod is in this state. e.g. 'Evicted'", + "nominatedNodeName": "nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be scheduled right away as preemption victims receive their graceful termination periods. This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to give the resources on this node to a higher priority pod that is created after preemption. As a result, this field may be different than PodSpec.nodeName when the pod is scheduled.", "hostIP": "IP address of the host to which the pod is assigned. Empty if not yet scheduled.", "podIP": "IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.", "startTime": "RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.", "initContainerStatuses": "The list has one entry per init container in the manifest. The most recent successful init container will have ready = true, the most recently started container will have startTime set. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", "containerStatuses": "The list has one entry per container in the manifest. Each entry is currently the output of `docker inspect`. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", - "qosClass": "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md", + "qosClass": "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md", } func (PodStatus) SwaggerDoc() map[string]string { @@ -1935,6 +1958,7 @@ var map_SecurityContext = map[string]string{ "privileged": "Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false.", "seLinuxOptions": "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "runAsUser": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", + "runAsGroup": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "runAsNonRoot": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "readOnlyRootFilesystem": "Whether this container has a read-only root filesystem. Default is false.", "allowPrivilegeEscalation": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN", @@ -2153,13 +2177,22 @@ var map_VolumeMount = map[string]string{ "readOnly": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.", "mountPath": "Path within the container at which the volume should be mounted. Must not contain ':'.", "subPath": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).", - "mountPropagation": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.", + "mountPropagation": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is beta in 1.10.", } func (VolumeMount) SwaggerDoc() map[string]string { return map_VolumeMount } +var map_VolumeNodeAffinity = map[string]string{ + "": "VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from.", + "required": "Required specifies hard node constraints that must be met.", +} + +func (VolumeNodeAffinity) SwaggerDoc() map[string]string { + return map_VolumeNodeAffinity +} + var map_VolumeProjection = map[string]string{ "": "Projection that may be projected along with other supported volume types", "secret": "information about the secret data to project", diff --git a/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go index b96314d45..ebdcb890d 100644 --- a/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go @@ -16,12 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 import ( - resource "k8s.io/apimachinery/pkg/api/resource" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" @@ -241,14 +240,47 @@ func (in *Binding) DeepCopy() *Binding { func (in *Binding) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CSIPersistentVolumeSource) DeepCopyInto(out *CSIPersistentVolumeSource) { *out = *in + if in.VolumeAttributes != nil { + in, out := &in.VolumeAttributes, &out.VolumeAttributes + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ControllerPublishSecretRef != nil { + in, out := &in.ControllerPublishSecretRef, &out.ControllerPublishSecretRef + if *in == nil { + *out = nil + } else { + *out = new(SecretReference) + **out = **in + } + } + if in.NodeStageSecretRef != nil { + in, out := &in.NodeStageSecretRef, &out.NodeStageSecretRef + if *in == nil { + *out = nil + } else { + *out = new(SecretReference) + **out = **in + } + } + if in.NodePublishSecretRef != nil { + in, out := &in.NodePublishSecretRef, &out.NodePublishSecretRef + if *in == nil { + *out = nil + } else { + *out = new(SecretReference) + **out = **in + } + } return } @@ -432,9 +464,8 @@ func (in *ComponentStatus) DeepCopy() *ComponentStatus { func (in *ComponentStatus) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -466,9 +497,8 @@ func (in *ComponentStatusList) DeepCopy() *ComponentStatusList { func (in *ComponentStatusList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -483,6 +513,18 @@ func (in *ConfigMap) DeepCopyInto(out *ConfigMap) { (*out)[key] = val } } + if in.BinaryData != nil { + in, out := &in.BinaryData, &out.BinaryData + *out = make(map[string][]byte, len(*in)) + for key, val := range *in { + if val == nil { + (*out)[key] = nil + } else { + (*out)[key] = make([]byte, len(val)) + copy((*out)[key], val) + } + } + } return } @@ -500,9 +542,8 @@ func (in *ConfigMap) DeepCopy() *ConfigMap { func (in *ConfigMap) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -586,9 +627,8 @@ func (in *ConfigMapList) DeepCopy() *ConfigMapList { func (in *ConfigMapList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -982,9 +1022,8 @@ func (in *DeleteOptions) DeepCopy() *DeleteOptions { func (in *DeleteOptions) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -1093,8 +1132,8 @@ func (in *EmptyDirVolumeSource) DeepCopyInto(out *EmptyDirVolumeSource) { if *in == nil { *out = nil } else { - *out = new(resource.Quantity) - **out = (*in).DeepCopy() + x := (*in).DeepCopy() + *out = &x } } return @@ -1224,9 +1263,8 @@ func (in *Endpoints) DeepCopy() *Endpoints { func (in *Endpoints) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -1258,9 +1296,8 @@ func (in *EndpointsList) DeepCopy() *EndpointsList { func (in *EndpointsList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -1419,9 +1456,8 @@ func (in *Event) DeepCopy() *Event { func (in *Event) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -1453,9 +1489,8 @@ func (in *EventList) DeepCopy() *EventList { func (in *EventList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -1547,6 +1582,38 @@ func (in *FCVolumeSource) DeepCopy() *FCVolumeSource { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlexPersistentVolumeSource) DeepCopyInto(out *FlexPersistentVolumeSource) { + *out = *in + if in.SecretRef != nil { + in, out := &in.SecretRef, &out.SecretRef + if *in == nil { + *out = nil + } else { + *out = new(SecretReference) + **out = **in + } + } + if in.Options != nil { + in, out := &in.Options, &out.Options + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlexPersistentVolumeSource. +func (in *FlexPersistentVolumeSource) DeepCopy() *FlexPersistentVolumeSource { + if in == nil { + return nil + } + out := new(FlexPersistentVolumeSource) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FlexVolumeSource) DeepCopyInto(out *FlexVolumeSource) { *out = *in @@ -1930,9 +1997,8 @@ func (in *LimitRange) DeepCopy() *LimitRange { func (in *LimitRange) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2015,9 +2081,8 @@ func (in *LimitRangeList) DeepCopy() *LimitRangeList { func (in *LimitRangeList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2072,9 +2137,8 @@ func (in *List) DeepCopy() *List { func (in *List) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2107,9 +2171,8 @@ func (in *ListOptions) DeepCopy() *ListOptions { func (in *ListOptions) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2221,9 +2284,8 @@ func (in *Namespace) DeepCopy() *Namespace { func (in *Namespace) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2255,9 +2317,8 @@ func (in *NamespaceList) DeepCopy() *NamespaceList { func (in *NamespaceList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2321,9 +2382,8 @@ func (in *Node) DeepCopy() *Node { func (in *Node) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2422,9 +2482,8 @@ func (in *NodeConfigSource) DeepCopy() *NodeConfigSource { func (in *NodeConfigSource) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2473,9 +2532,8 @@ func (in *NodeList) DeepCopy() *NodeList { func (in *NodeList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2499,9 +2557,8 @@ func (in *NodeProxyOptions) DeepCopy() *NodeProxyOptions { func (in *NodeProxyOptions) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2728,8 +2785,7 @@ func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta) { if *in == nil { *out = nil } else { - *out = new(meta_v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } if in.DeletionGracePeriodSeconds != nil { @@ -2809,9 +2865,8 @@ func (in *ObjectReference) DeepCopy() *ObjectReference { func (in *ObjectReference) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2838,9 +2893,8 @@ func (in *PersistentVolume) DeepCopy() *PersistentVolume { func (in *PersistentVolume) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2867,9 +2921,8 @@ func (in *PersistentVolumeClaim) DeepCopy() *PersistentVolumeClaim { func (in *PersistentVolumeClaim) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -2919,9 +2972,8 @@ func (in *PersistentVolumeClaimList) DeepCopy() *PersistentVolumeClaimList { func (in *PersistentVolumeClaimList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -3053,9 +3105,8 @@ func (in *PersistentVolumeList) DeepCopy() *PersistentVolumeList { func (in *PersistentVolumeList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -3165,7 +3216,7 @@ func (in *PersistentVolumeSource) DeepCopyInto(out *PersistentVolumeSource) { if *in == nil { *out = nil } else { - *out = new(FlexVolumeSource) + *out = new(FlexPersistentVolumeSource) (*in).DeepCopyInto(*out) } } @@ -3256,7 +3307,7 @@ func (in *PersistentVolumeSource) DeepCopyInto(out *PersistentVolumeSource) { *out = nil } else { *out = new(CSIPersistentVolumeSource) - **out = **in + (*in).DeepCopyInto(*out) } } return @@ -3311,6 +3362,15 @@ func (in *PersistentVolumeSpec) DeepCopyInto(out *PersistentVolumeSpec) { **out = **in } } + if in.NodeAffinity != nil { + in, out := &in.NodeAffinity, &out.NodeAffinity + if *in == nil { + *out = nil + } else { + *out = new(VolumeNodeAffinity) + (*in).DeepCopyInto(*out) + } + } return } @@ -3380,9 +3440,8 @@ func (in *Pod) DeepCopy() *Pod { func (in *Pod) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -3496,9 +3555,8 @@ func (in *PodAttachOptions) DeepCopy() *PodAttachOptions { func (in *PodAttachOptions) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -3603,9 +3661,8 @@ func (in *PodExecOptions) DeepCopy() *PodExecOptions { func (in *PodExecOptions) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -3637,9 +3694,8 @@ func (in *PodList) DeepCopy() *PodList { func (in *PodList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -3660,8 +3716,7 @@ func (in *PodLogOptions) DeepCopyInto(out *PodLogOptions) { if *in == nil { *out = nil } else { - *out = new(meta_v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } if in.TailLines != nil { @@ -3699,9 +3754,8 @@ func (in *PodLogOptions) DeepCopy() *PodLogOptions { func (in *PodLogOptions) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -3730,9 +3784,8 @@ func (in *PodPortForwardOptions) DeepCopy() *PodPortForwardOptions { func (in *PodPortForwardOptions) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -3756,9 +3809,8 @@ func (in *PodProxyOptions) DeepCopy() *PodProxyOptions { func (in *PodProxyOptions) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -3782,6 +3834,15 @@ func (in *PodSecurityContext) DeepCopyInto(out *PodSecurityContext) { **out = **in } } + if in.RunAsGroup != nil { + in, out := &in.RunAsGroup, &out.RunAsGroup + if *in == nil { + *out = nil + } else { + *out = new(int64) + **out = **in + } + } if in.RunAsNonRoot != nil { in, out := &in.RunAsNonRoot, &out.RunAsNonRoot if *in == nil { @@ -3901,6 +3962,15 @@ func (in *PodSpec) DeepCopyInto(out *PodSpec) { **out = **in } } + if in.ShareProcessNamespace != nil { + in, out := &in.ShareProcessNamespace, &out.ShareProcessNamespace + if *in == nil { + *out = nil + } else { + *out = new(bool) + **out = **in + } + } if in.SecurityContext != nil { in, out := &in.SecurityContext, &out.SecurityContext if *in == nil { @@ -3984,8 +4054,7 @@ func (in *PodStatus) DeepCopyInto(out *PodStatus) { if *in == nil { *out = nil } else { - *out = new(meta_v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } if in.InitContainerStatuses != nil { @@ -4038,9 +4107,8 @@ func (in *PodStatusResult) DeepCopy() *PodStatusResult { func (in *PodStatusResult) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -4066,9 +4134,8 @@ func (in *PodTemplate) DeepCopy() *PodTemplate { func (in *PodTemplate) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -4100,9 +4167,8 @@ func (in *PodTemplateList) DeepCopy() *PodTemplateList { func (in *PodTemplateList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -4351,9 +4417,8 @@ func (in *RangeAllocation) DeepCopy() *RangeAllocation { func (in *RangeAllocation) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -4380,9 +4445,8 @@ func (in *ReplicationController) DeepCopy() *ReplicationController { func (in *ReplicationController) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -4431,9 +4495,8 @@ func (in *ReplicationControllerList) DeepCopy() *ReplicationControllerList { func (in *ReplicationControllerList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -4517,6 +4580,28 @@ func (in *ResourceFieldSelector) DeepCopy() *ResourceFieldSelector { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ResourceList) DeepCopyInto(out *ResourceList) { + { + in := &in + *out = make(ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceList. +func (in ResourceList) DeepCopy() ResourceList { + if in == nil { + return nil + } + out := new(ResourceList) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceQuota) DeepCopyInto(out *ResourceQuota) { *out = *in @@ -4541,9 +4626,8 @@ func (in *ResourceQuota) DeepCopy() *ResourceQuota { func (in *ResourceQuota) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -4575,9 +4659,8 @@ func (in *ResourceQuotaList) DeepCopy() *ResourceQuotaList { func (in *ResourceQuotaList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -4775,9 +4858,8 @@ func (in *Secret) DeepCopy() *Secret { func (in *Secret) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -4861,9 +4943,8 @@ func (in *SecretList) DeepCopy() *SecretList { func (in *SecretList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -4995,6 +5076,15 @@ func (in *SecurityContext) DeepCopyInto(out *SecurityContext) { **out = **in } } + if in.RunAsGroup != nil { + in, out := &in.RunAsGroup, &out.RunAsGroup + if *in == nil { + *out = nil + } else { + *out = new(int64) + **out = **in + } + } if in.RunAsNonRoot != nil { in, out := &in.RunAsNonRoot, &out.RunAsNonRoot if *in == nil { @@ -5057,9 +5147,8 @@ func (in *SerializedReference) DeepCopy() *SerializedReference { func (in *SerializedReference) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -5086,9 +5175,8 @@ func (in *Service) DeepCopy() *Service { func (in *Service) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -5132,9 +5220,8 @@ func (in *ServiceAccount) DeepCopy() *ServiceAccount { func (in *ServiceAccount) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -5166,9 +5253,8 @@ func (in *ServiceAccountList) DeepCopy() *ServiceAccountList { func (in *ServiceAccountList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -5200,9 +5286,8 @@ func (in *ServiceList) DeepCopy() *ServiceList { func (in *ServiceList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -5243,9 +5328,8 @@ func (in *ServiceProxyOptions) DeepCopy() *ServiceProxyOptions { func (in *ServiceProxyOptions) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -5428,8 +5512,7 @@ func (in *Taint) DeepCopyInto(out *Taint) { if *in == nil { *out = nil } else { - *out = new(meta_v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } return @@ -5528,6 +5611,31 @@ func (in *VolumeMount) DeepCopy() *VolumeMount { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeNodeAffinity) DeepCopyInto(out *VolumeNodeAffinity) { + *out = *in + if in.Required != nil { + in, out := &in.Required, &out.Required + if *in == nil { + *out = nil + } else { + *out = new(NodeSelector) + (*in).DeepCopyInto(*out) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeNodeAffinity. +func (in *VolumeNodeAffinity) DeepCopy() *VolumeNodeAffinity { + if in == nil { + return nil + } + out := new(VolumeNodeAffinity) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VolumeProjection) DeepCopyInto(out *VolumeProjection) { *out = *in diff --git a/vendor/k8s.io/api/events/v1beta1/generated.proto b/vendor/k8s.io/api/events/v1beta1/generated.proto index 81be470f0..0637f780a 100644 --- a/vendor/k8s.io/api/events/v1beta1/generated.proto +++ b/vendor/k8s.io/api/events/v1beta1/generated.proto @@ -108,7 +108,7 @@ message EventList { } // EventSeries contain information on series of events, i.e. thing that was/is happening -// continously for some time. +// continuously for some time. message EventSeries { // Number of occurrences in this series up to the last heartbeat time optional int32 count = 1; diff --git a/vendor/k8s.io/api/events/v1beta1/types.go b/vendor/k8s.io/api/events/v1beta1/types.go index 1b68bd743..dc48ddb06 100644 --- a/vendor/k8s.io/api/events/v1beta1/types.go +++ b/vendor/k8s.io/api/events/v1beta1/types.go @@ -89,7 +89,7 @@ type Event struct { } // EventSeries contain information on series of events, i.e. thing that was/is happening -// continously for some time. +// continuously for some time. type EventSeries struct { // Number of occurrences in this series up to the last heartbeat time Count int32 `json:"count" protobuf:"varint,1,opt,name=count"` diff --git a/vendor/k8s.io/api/events/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/events/v1beta1/types_swagger_doc_generated.go index 04a4a9122..17ec3d777 100644 --- a/vendor/k8s.io/api/events/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/events/v1beta1/types_swagger_doc_generated.go @@ -60,7 +60,7 @@ func (EventList) SwaggerDoc() map[string]string { } var map_EventSeries = map[string]string{ - "": "EventSeries contain information on series of events, i.e. thing that was/is happening continously for some time.", + "": "EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time.", "count": "Number of occurrences in this series up to the last heartbeat time", "lastObservedTime": "Time when last Event from the series was seen before last heartbeat.", "state": "Information whether this series is ongoing or finished.", diff --git a/vendor/k8s.io/api/events/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/events/v1beta1/zz_generated.deepcopy.go index 626feacf0..546d69e7e 100644 --- a/vendor/k8s.io/api/events/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/events/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -70,9 +70,8 @@ func (in *Event) DeepCopy() *Event { func (in *Event) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -104,9 +103,8 @@ func (in *EventList) DeepCopy() *EventList { func (in *EventList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/extensions/OWNERS b/vendor/k8s.io/api/extensions/OWNERS index 82c173c98..cfac47110 100755 --- a/vendor/k8s.io/api/extensions/OWNERS +++ b/vendor/k8s.io/api/extensions/OWNERS @@ -19,7 +19,6 @@ reviewers: - ncdc - tallclair - mwielgus -- timothysc - soltysh - piosz - dims diff --git a/vendor/k8s.io/api/extensions/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/extensions/v1beta1/zz_generated.deepcopy.go index 564d4177d..de1970c8f 100644 --- a/vendor/k8s.io/api/extensions/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/extensions/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -163,9 +163,8 @@ func (in *DaemonSet) DeepCopy() *DaemonSet { func (in *DaemonSet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -214,9 +213,8 @@ func (in *DaemonSetList) DeepCopy() *DaemonSetList { func (in *DaemonSetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -336,9 +334,8 @@ func (in *Deployment) DeepCopy() *Deployment { func (in *Deployment) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -388,9 +385,8 @@ func (in *DeploymentList) DeepCopy() *DeploymentList { func (in *DeploymentList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -422,9 +418,8 @@ func (in *DeploymentRollback) DeepCopy() *DeploymentRollback { func (in *DeploymentRollback) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -683,9 +678,8 @@ func (in *Ingress) DeepCopy() *Ingress { func (in *Ingress) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -734,9 +728,8 @@ func (in *IngressList) DeepCopy() *IngressList { func (in *IngressList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -881,9 +874,8 @@ func (in *NetworkPolicy) DeepCopy() *NetworkPolicy { func (in *NetworkPolicy) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -975,9 +967,8 @@ func (in *NetworkPolicyList) DeepCopy() *NetworkPolicyList { func (in *NetworkPolicyList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -1116,9 +1107,8 @@ func (in *PodSecurityPolicy) DeepCopy() *PodSecurityPolicy { func (in *PodSecurityPolicy) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -1150,9 +1140,8 @@ func (in *PodSecurityPolicyList) DeepCopy() *PodSecurityPolicyList { func (in *PodSecurityPolicyList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -1252,9 +1241,8 @@ func (in *ReplicaSet) DeepCopy() *ReplicaSet { func (in *ReplicaSet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -1303,9 +1291,8 @@ func (in *ReplicaSetList) DeepCopy() *ReplicaSetList { func (in *ReplicaSetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -1387,9 +1374,8 @@ func (in *ReplicationControllerDummy) DeepCopy() *ReplicationControllerDummy { func (in *ReplicationControllerDummy) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -1537,9 +1523,8 @@ func (in *Scale) DeepCopy() *Scale { func (in *Scale) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/imagepolicy/v1alpha1/zz_generated.deepcopy.go index f0463d29d..50f314886 100644 --- a/vendor/k8s.io/api/imagepolicy/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/imagepolicy/v1alpha1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 @@ -48,9 +48,8 @@ func (in *ImageReview) DeepCopy() *ImageReview { func (in *ImageReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/networking/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/networking/v1/zz_generated.deepcopy.go index 3dbe87055..8a7c1530e 100644 --- a/vendor/k8s.io/api/networking/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/networking/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -71,9 +71,8 @@ func (in *NetworkPolicy) DeepCopy() *NetworkPolicy { func (in *NetworkPolicy) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -165,9 +164,8 @@ func (in *NetworkPolicyList) DeepCopy() *NetworkPolicyList { func (in *NetworkPolicyList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/policy/OWNERS b/vendor/k8s.io/api/policy/OWNERS index 99e0bffb5..a245fde35 100755 --- a/vendor/k8s.io/api/policy/OWNERS +++ b/vendor/k8s.io/api/policy/OWNERS @@ -2,3 +2,7 @@ approvers: - sig-apps-api-approvers reviewers: - sig-apps-reviewers +- pweil- +- liggitt +- tallclair +- php-coder diff --git a/vendor/k8s.io/api/policy/v1beta1/BUILD b/vendor/k8s.io/api/policy/v1beta1/BUILD index 6e4a07deb..d55d68e5d 100644 --- a/vendor/k8s.io/api/policy/v1beta1/BUILD +++ b/vendor/k8s.io/api/policy/v1beta1/BUILD @@ -19,6 +19,7 @@ go_library( deps = [ "//vendor/github.com/gogo/protobuf/proto:go_default_library", "//vendor/github.com/gogo/protobuf/sortkeys:go_default_library", + "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/vendor/k8s.io/api/policy/v1beta1/generated.pb.go b/vendor/k8s.io/api/policy/v1beta1/generated.pb.go index 4ed4d29ca..24bbe8975 100644 --- a/vendor/k8s.io/api/policy/v1beta1/generated.pb.go +++ b/vendor/k8s.io/api/policy/v1beta1/generated.pb.go @@ -25,11 +25,22 @@ limitations under the License. k8s.io/kubernetes/vendor/k8s.io/api/policy/v1beta1/generated.proto It has these top-level messages: + AllowedFlexVolume + AllowedHostPath Eviction + FSGroupStrategyOptions + HostPortRange + IDRange PodDisruptionBudget PodDisruptionBudgetList PodDisruptionBudgetSpec PodDisruptionBudgetStatus + PodSecurityPolicy + PodSecurityPolicyList + PodSecurityPolicySpec + RunAsUserStrategyOptions + SELinuxStrategyOptions + SupplementalGroupsStrategyOptions */ package v1beta1 @@ -37,6 +48,7 @@ import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" +import k8s_io_api_core_v1 "k8s.io/api/core/v1" import k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" import k8s_io_apimachinery_pkg_util_intstr "k8s.io/apimachinery/pkg/util/intstr" @@ -59,35 +71,138 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +func (m *AllowedFlexVolume) Reset() { *m = AllowedFlexVolume{} } +func (*AllowedFlexVolume) ProtoMessage() {} +func (*AllowedFlexVolume) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } + +func (m *AllowedHostPath) Reset() { *m = AllowedHostPath{} } +func (*AllowedHostPath) ProtoMessage() {} +func (*AllowedHostPath) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } + func (m *Eviction) Reset() { *m = Eviction{} } func (*Eviction) ProtoMessage() {} -func (*Eviction) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } +func (*Eviction) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } + +func (m *FSGroupStrategyOptions) Reset() { *m = FSGroupStrategyOptions{} } +func (*FSGroupStrategyOptions) ProtoMessage() {} +func (*FSGroupStrategyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } + +func (m *HostPortRange) Reset() { *m = HostPortRange{} } +func (*HostPortRange) ProtoMessage() {} +func (*HostPortRange) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} } + +func (m *IDRange) Reset() { *m = IDRange{} } +func (*IDRange) ProtoMessage() {} +func (*IDRange) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} } func (m *PodDisruptionBudget) Reset() { *m = PodDisruptionBudget{} } func (*PodDisruptionBudget) ProtoMessage() {} -func (*PodDisruptionBudget) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } +func (*PodDisruptionBudget) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} } func (m *PodDisruptionBudgetList) Reset() { *m = PodDisruptionBudgetList{} } func (*PodDisruptionBudgetList) ProtoMessage() {} -func (*PodDisruptionBudgetList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } +func (*PodDisruptionBudgetList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} } func (m *PodDisruptionBudgetSpec) Reset() { *m = PodDisruptionBudgetSpec{} } func (*PodDisruptionBudgetSpec) ProtoMessage() {} -func (*PodDisruptionBudgetSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } +func (*PodDisruptionBudgetSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} } func (m *PodDisruptionBudgetStatus) Reset() { *m = PodDisruptionBudgetStatus{} } func (*PodDisruptionBudgetStatus) ProtoMessage() {} func (*PodDisruptionBudgetStatus) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{4} + return fileDescriptorGenerated, []int{9} +} + +func (m *PodSecurityPolicy) Reset() { *m = PodSecurityPolicy{} } +func (*PodSecurityPolicy) ProtoMessage() {} +func (*PodSecurityPolicy) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{10} } + +func (m *PodSecurityPolicyList) Reset() { *m = PodSecurityPolicyList{} } +func (*PodSecurityPolicyList) ProtoMessage() {} +func (*PodSecurityPolicyList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} } + +func (m *PodSecurityPolicySpec) Reset() { *m = PodSecurityPolicySpec{} } +func (*PodSecurityPolicySpec) ProtoMessage() {} +func (*PodSecurityPolicySpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} } + +func (m *RunAsUserStrategyOptions) Reset() { *m = RunAsUserStrategyOptions{} } +func (*RunAsUserStrategyOptions) ProtoMessage() {} +func (*RunAsUserStrategyOptions) Descriptor() ([]byte, []int) { + return fileDescriptorGenerated, []int{13} +} + +func (m *SELinuxStrategyOptions) Reset() { *m = SELinuxStrategyOptions{} } +func (*SELinuxStrategyOptions) ProtoMessage() {} +func (*SELinuxStrategyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{14} } + +func (m *SupplementalGroupsStrategyOptions) Reset() { *m = SupplementalGroupsStrategyOptions{} } +func (*SupplementalGroupsStrategyOptions) ProtoMessage() {} +func (*SupplementalGroupsStrategyOptions) Descriptor() ([]byte, []int) { + return fileDescriptorGenerated, []int{15} } func init() { + proto.RegisterType((*AllowedFlexVolume)(nil), "k8s.io.api.policy.v1beta1.AllowedFlexVolume") + proto.RegisterType((*AllowedHostPath)(nil), "k8s.io.api.policy.v1beta1.AllowedHostPath") proto.RegisterType((*Eviction)(nil), "k8s.io.api.policy.v1beta1.Eviction") + proto.RegisterType((*FSGroupStrategyOptions)(nil), "k8s.io.api.policy.v1beta1.FSGroupStrategyOptions") + proto.RegisterType((*HostPortRange)(nil), "k8s.io.api.policy.v1beta1.HostPortRange") + proto.RegisterType((*IDRange)(nil), "k8s.io.api.policy.v1beta1.IDRange") proto.RegisterType((*PodDisruptionBudget)(nil), "k8s.io.api.policy.v1beta1.PodDisruptionBudget") proto.RegisterType((*PodDisruptionBudgetList)(nil), "k8s.io.api.policy.v1beta1.PodDisruptionBudgetList") proto.RegisterType((*PodDisruptionBudgetSpec)(nil), "k8s.io.api.policy.v1beta1.PodDisruptionBudgetSpec") proto.RegisterType((*PodDisruptionBudgetStatus)(nil), "k8s.io.api.policy.v1beta1.PodDisruptionBudgetStatus") + proto.RegisterType((*PodSecurityPolicy)(nil), "k8s.io.api.policy.v1beta1.PodSecurityPolicy") + proto.RegisterType((*PodSecurityPolicyList)(nil), "k8s.io.api.policy.v1beta1.PodSecurityPolicyList") + proto.RegisterType((*PodSecurityPolicySpec)(nil), "k8s.io.api.policy.v1beta1.PodSecurityPolicySpec") + proto.RegisterType((*RunAsUserStrategyOptions)(nil), "k8s.io.api.policy.v1beta1.RunAsUserStrategyOptions") + proto.RegisterType((*SELinuxStrategyOptions)(nil), "k8s.io.api.policy.v1beta1.SELinuxStrategyOptions") + proto.RegisterType((*SupplementalGroupsStrategyOptions)(nil), "k8s.io.api.policy.v1beta1.SupplementalGroupsStrategyOptions") +} +func (m *AllowedFlexVolume) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AllowedFlexVolume) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver))) + i += copy(dAtA[i:], m.Driver) + return i, nil +} + +func (m *AllowedHostPath) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AllowedHostPath) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PathPrefix))) + i += copy(dAtA[i:], m.PathPrefix) + return i, nil } + func (m *Eviction) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -124,6 +239,88 @@ func (m *Eviction) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *FSGroupStrategyOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FSGroupStrategyOptions) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Rule))) + i += copy(dAtA[i:], m.Rule) + if len(m.Ranges) > 0 { + for _, msg := range m.Ranges { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *HostPortRange) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HostPortRange) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0x8 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Min)) + dAtA[i] = 0x10 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Max)) + return i, nil +} + +func (m *IDRange) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IDRange) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0x8 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Min)) + dAtA[i] = 0x10 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Max)) + return i, nil +} + func (m *PodDisruptionBudget) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -316,204 +513,2344 @@ func (m *PodDisruptionBudgetStatus) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func encodeFixed64Generated(dAtA []byte, offset int, v uint64) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - dAtA[offset+4] = uint8(v >> 32) - dAtA[offset+5] = uint8(v >> 40) - dAtA[offset+6] = uint8(v >> 48) - dAtA[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Generated(dAtA []byte, offset int, v uint32) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *PodSecurityPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return offset + 1 + return dAtA[:n], nil } -func (m *Eviction) Size() (n int) { + +func (m *PodSecurityPolicy) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if m.DeleteOptions != nil { - l = m.DeleteOptions.Size() - n += 1 + l + sovGenerated(uint64(l)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) + n11, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - return n + i += n11 + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) + n12, err := m.Spec.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n12 + return i, nil } -func (m *PodDisruptionBudget) Size() (n int) { - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n +func (m *PodSecurityPolicyList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -func (m *PodDisruptionBudgetList) Size() (n int) { +func (m *PodSecurityPolicyList) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) + n13, err := m.ListMeta.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n13 if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) + for _, msg := range m.Items { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - return n + return i, nil } -func (m *PodDisruptionBudgetSpec) Size() (n int) { - var l int - _ = l - if m.MinAvailable != nil { - l = m.MinAvailable.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.Selector != nil { - l = m.Selector.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.MaxUnavailable != nil { - l = m.MaxUnavailable.Size() - n += 1 + l + sovGenerated(uint64(l)) +func (m *PodSecurityPolicySpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *PodDisruptionBudgetStatus) Size() (n int) { +func (m *PodSecurityPolicySpec) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - n += 1 + sovGenerated(uint64(m.ObservedGeneration)) - if len(m.DisruptedPods) > 0 { - for k, v := range m.DisruptedPods { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + dAtA[i] = 0x8 + i++ + if m.Privileged { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + if len(m.DefaultAddCapabilities) > 0 { + for _, s := range m.DefaultAddCapabilities { + dAtA[i] = 0x12 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) } } - n += 1 + sovGenerated(uint64(m.PodDisruptionsAllowed)) - n += 1 + sovGenerated(uint64(m.CurrentHealthy)) - n += 1 + sovGenerated(uint64(m.DesiredHealthy)) - n += 1 + sovGenerated(uint64(m.ExpectedPods)) - return n -} - -func sovGenerated(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break + if len(m.RequiredDropCapabilities) > 0 { + for _, s := range m.RequiredDropCapabilities { + dAtA[i] = 0x1a + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) } } - return n -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Eviction) String() string { - if this == nil { - return "nil" + if len(m.AllowedCapabilities) > 0 { + for _, s := range m.AllowedCapabilities { + dAtA[i] = 0x22 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } } - s := strings.Join([]string{`&Eviction{`, - `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `DeleteOptions:` + strings.Replace(fmt.Sprintf("%v", this.DeleteOptions), "DeleteOptions", "k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions", 1) + `,`, - `}`, - }, "") - return s + if len(m.Volumes) > 0 { + for _, s := range m.Volumes { + dAtA[i] = 0x2a + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + dAtA[i] = 0x30 + i++ + if m.HostNetwork { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + if len(m.HostPorts) > 0 { + for _, msg := range m.HostPorts { + dAtA[i] = 0x3a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + dAtA[i] = 0x40 + i++ + if m.HostPID { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + dAtA[i] = 0x48 + i++ + if m.HostIPC { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + dAtA[i] = 0x52 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.SELinux.Size())) + n14, err := m.SELinux.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n14 + dAtA[i] = 0x5a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.RunAsUser.Size())) + n15, err := m.RunAsUser.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n15 + dAtA[i] = 0x62 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.SupplementalGroups.Size())) + n16, err := m.SupplementalGroups.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n16 + dAtA[i] = 0x6a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.FSGroup.Size())) + n17, err := m.FSGroup.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n17 + dAtA[i] = 0x70 + i++ + if m.ReadOnlyRootFilesystem { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + if m.DefaultAllowPrivilegeEscalation != nil { + dAtA[i] = 0x78 + i++ + if *m.DefaultAllowPrivilegeEscalation { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.AllowPrivilegeEscalation != nil { + dAtA[i] = 0x80 + i++ + dAtA[i] = 0x1 + i++ + if *m.AllowPrivilegeEscalation { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if len(m.AllowedHostPaths) > 0 { + for _, msg := range m.AllowedHostPaths { + dAtA[i] = 0x8a + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if len(m.AllowedFlexVolumes) > 0 { + for _, msg := range m.AllowedFlexVolumes { + dAtA[i] = 0x92 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil } -func (this *PodDisruptionBudget) String() string { - if this == nil { - return "nil" + +func (m *RunAsUserStrategyOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - s := strings.Join([]string{`&PodDisruptionBudget{`, - `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodDisruptionBudgetSpec", "PodDisruptionBudgetSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PodDisruptionBudgetStatus", "PodDisruptionBudgetStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s + return dAtA[:n], nil } -func (this *PodDisruptionBudgetList) String() string { - if this == nil { - return "nil" + +func (m *RunAsUserStrategyOptions) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Rule))) + i += copy(dAtA[i:], m.Rule) + if len(m.Ranges) > 0 { + for _, msg := range m.Ranges { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - s := strings.Join([]string{`&PodDisruptionBudgetList{`, - `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "PodDisruptionBudget", "PodDisruptionBudget", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s + return i, nil } -func (this *PodDisruptionBudgetSpec) String() string { - if this == nil { - return "nil" + +func (m *SELinuxStrategyOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - s := strings.Join([]string{`&PodDisruptionBudgetSpec{`, - `MinAvailable:` + strings.Replace(fmt.Sprintf("%v", this.MinAvailable), "IntOrString", "k8s_io_apimachinery_pkg_util_intstr.IntOrString", 1) + `,`, - `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`, - `MaxUnavailable:` + strings.Replace(fmt.Sprintf("%v", this.MaxUnavailable), "IntOrString", "k8s_io_apimachinery_pkg_util_intstr.IntOrString", 1) + `,`, - `}`, - }, "") - return s + return dAtA[:n], nil } -func (this *PodDisruptionBudgetStatus) String() string { - if this == nil { - return "nil" + +func (m *SELinuxStrategyOptions) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Rule))) + i += copy(dAtA[i:], m.Rule) + if m.SELinuxOptions != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.SELinuxOptions.Size())) + n18, err := m.SELinuxOptions.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n18 } - keysForDisruptedPods := make([]string, 0, len(this.DisruptedPods)) - for k := range this.DisruptedPods { - keysForDisruptedPods = append(keysForDisruptedPods, k) + return i, nil +} + +func (m *SupplementalGroupsStrategyOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - github_com_gogo_protobuf_sortkeys.Strings(keysForDisruptedPods) - mapStringForDisruptedPods := "map[string]k8s_io_apimachinery_pkg_apis_meta_v1.Time{" - for _, k := range keysForDisruptedPods { - mapStringForDisruptedPods += fmt.Sprintf("%v: %v,", k, this.DisruptedPods[k]) + return dAtA[:n], nil +} + +func (m *SupplementalGroupsStrategyOptions) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Rule))) + i += copy(dAtA[i:], m.Rule) + if len(m.Ranges) > 0 { + for _, msg := range m.Ranges { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - mapStringForDisruptedPods += "}" - s := strings.Join([]string{`&PodDisruptionBudgetStatus{`, - `ObservedGeneration:` + fmt.Sprintf("%v", this.ObservedGeneration) + `,`, - `DisruptedPods:` + mapStringForDisruptedPods + `,`, - `PodDisruptionsAllowed:` + fmt.Sprintf("%v", this.PodDisruptionsAllowed) + `,`, - `CurrentHealthy:` + fmt.Sprintf("%v", this.CurrentHealthy) + `,`, - `DesiredHealthy:` + fmt.Sprintf("%v", this.DesiredHealthy) + `,`, - `ExpectedPods:` + fmt.Sprintf("%v", this.ExpectedPods) + `,`, - `}`, - }, "") - return s + return i, nil } -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" + +func encodeFixed64Generated(dAtA []byte, offset int, v uint64) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + dAtA[offset+4] = uint8(v >> 32) + dAtA[offset+5] = uint8(v >> 40) + dAtA[offset+6] = uint8(v >> 48) + dAtA[offset+7] = uint8(v >> 56) + return offset + 8 +} +func encodeFixed32Generated(dAtA []byte, offset int, v uint32) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + return offset + 4 +} +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + dAtA[offset] = uint8(v) + return offset + 1 } -func (m *Eviction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 +func (m *AllowedFlexVolume) Size() (n int) { + var l int + _ = l + l = len(m.Driver) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *AllowedHostPath) Size() (n int) { + var l int + _ = l + l = len(m.PathPrefix) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Eviction) Size() (n int) { + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.DeleteOptions != nil { + l = m.DeleteOptions.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *FSGroupStrategyOptions) Size() (n int) { + var l int + _ = l + l = len(m.Rule) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Ranges) > 0 { + for _, e := range m.Ranges { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *HostPortRange) Size() (n int) { + var l int + _ = l + n += 1 + sovGenerated(uint64(m.Min)) + n += 1 + sovGenerated(uint64(m.Max)) + return n +} + +func (m *IDRange) Size() (n int) { + var l int + _ = l + n += 1 + sovGenerated(uint64(m.Min)) + n += 1 + sovGenerated(uint64(m.Max)) + return n +} + +func (m *PodDisruptionBudget) Size() (n int) { + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PodDisruptionBudgetList) Size() (n int) { + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodDisruptionBudgetSpec) Size() (n int) { + var l int + _ = l + if m.MinAvailable != nil { + l = m.MinAvailable.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Selector != nil { + l = m.Selector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MaxUnavailable != nil { + l = m.MaxUnavailable.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodDisruptionBudgetStatus) Size() (n int) { + var l int + _ = l + n += 1 + sovGenerated(uint64(m.ObservedGeneration)) + if len(m.DisruptedPods) > 0 { + for k, v := range m.DisruptedPods { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + n += 1 + sovGenerated(uint64(m.PodDisruptionsAllowed)) + n += 1 + sovGenerated(uint64(m.CurrentHealthy)) + n += 1 + sovGenerated(uint64(m.DesiredHealthy)) + n += 1 + sovGenerated(uint64(m.ExpectedPods)) + return n +} + +func (m *PodSecurityPolicy) Size() (n int) { + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PodSecurityPolicyList) Size() (n int) { + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodSecurityPolicySpec) Size() (n int) { + var l int + _ = l + n += 2 + if len(m.DefaultAddCapabilities) > 0 { + for _, s := range m.DefaultAddCapabilities { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.RequiredDropCapabilities) > 0 { + for _, s := range m.RequiredDropCapabilities { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.AllowedCapabilities) > 0 { + for _, s := range m.AllowedCapabilities { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Volumes) > 0 { + for _, s := range m.Volumes { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 2 + if len(m.HostPorts) > 0 { + for _, e := range m.HostPorts { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 2 + n += 2 + l = m.SELinux.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.RunAsUser.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.SupplementalGroups.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.FSGroup.Size() + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if m.DefaultAllowPrivilegeEscalation != nil { + n += 2 + } + if m.AllowPrivilegeEscalation != nil { + n += 3 + } + if len(m.AllowedHostPaths) > 0 { + for _, e := range m.AllowedHostPaths { + l = e.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + } + if len(m.AllowedFlexVolumes) > 0 { + for _, e := range m.AllowedFlexVolumes { + l = e.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *RunAsUserStrategyOptions) Size() (n int) { + var l int + _ = l + l = len(m.Rule) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Ranges) > 0 { + for _, e := range m.Ranges { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *SELinuxStrategyOptions) Size() (n int) { + var l int + _ = l + l = len(m.Rule) + n += 1 + l + sovGenerated(uint64(l)) + if m.SELinuxOptions != nil { + l = m.SELinuxOptions.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *SupplementalGroupsStrategyOptions) Size() (n int) { + var l int + _ = l + l = len(m.Rule) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Ranges) > 0 { + for _, e := range m.Ranges { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func sovGenerated(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *AllowedFlexVolume) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AllowedFlexVolume{`, + `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, + `}`, + }, "") + return s +} +func (this *AllowedHostPath) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AllowedHostPath{`, + `PathPrefix:` + fmt.Sprintf("%v", this.PathPrefix) + `,`, + `}`, + }, "") + return s +} +func (this *Eviction) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Eviction{`, + `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `DeleteOptions:` + strings.Replace(fmt.Sprintf("%v", this.DeleteOptions), "DeleteOptions", "k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions", 1) + `,`, + `}`, + }, "") + return s +} +func (this *FSGroupStrategyOptions) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FSGroupStrategyOptions{`, + `Rule:` + fmt.Sprintf("%v", this.Rule) + `,`, + `Ranges:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Ranges), "IDRange", "IDRange", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *HostPortRange) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&HostPortRange{`, + `Min:` + fmt.Sprintf("%v", this.Min) + `,`, + `Max:` + fmt.Sprintf("%v", this.Max) + `,`, + `}`, + }, "") + return s +} +func (this *IDRange) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IDRange{`, + `Min:` + fmt.Sprintf("%v", this.Min) + `,`, + `Max:` + fmt.Sprintf("%v", this.Max) + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudget) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodDisruptionBudget{`, + `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodDisruptionBudgetSpec", "PodDisruptionBudgetSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PodDisruptionBudgetStatus", "PodDisruptionBudgetStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudgetList) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodDisruptionBudgetList{`, + `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "PodDisruptionBudget", "PodDisruptionBudget", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudgetSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodDisruptionBudgetSpec{`, + `MinAvailable:` + strings.Replace(fmt.Sprintf("%v", this.MinAvailable), "IntOrString", "k8s_io_apimachinery_pkg_util_intstr.IntOrString", 1) + `,`, + `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`, + `MaxUnavailable:` + strings.Replace(fmt.Sprintf("%v", this.MaxUnavailable), "IntOrString", "k8s_io_apimachinery_pkg_util_intstr.IntOrString", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodDisruptionBudgetStatus) String() string { + if this == nil { + return "nil" + } + keysForDisruptedPods := make([]string, 0, len(this.DisruptedPods)) + for k := range this.DisruptedPods { + keysForDisruptedPods = append(keysForDisruptedPods, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForDisruptedPods) + mapStringForDisruptedPods := "map[string]k8s_io_apimachinery_pkg_apis_meta_v1.Time{" + for _, k := range keysForDisruptedPods { + mapStringForDisruptedPods += fmt.Sprintf("%v: %v,", k, this.DisruptedPods[k]) + } + mapStringForDisruptedPods += "}" + s := strings.Join([]string{`&PodDisruptionBudgetStatus{`, + `ObservedGeneration:` + fmt.Sprintf("%v", this.ObservedGeneration) + `,`, + `DisruptedPods:` + mapStringForDisruptedPods + `,`, + `PodDisruptionsAllowed:` + fmt.Sprintf("%v", this.PodDisruptionsAllowed) + `,`, + `CurrentHealthy:` + fmt.Sprintf("%v", this.CurrentHealthy) + `,`, + `DesiredHealthy:` + fmt.Sprintf("%v", this.DesiredHealthy) + `,`, + `ExpectedPods:` + fmt.Sprintf("%v", this.ExpectedPods) + `,`, + `}`, + }, "") + return s +} +func (this *PodSecurityPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodSecurityPolicy{`, + `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodSecurityPolicySpec", "PodSecurityPolicySpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodSecurityPolicyList) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodSecurityPolicyList{`, + `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "PodSecurityPolicy", "PodSecurityPolicy", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodSecurityPolicySpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodSecurityPolicySpec{`, + `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, + `DefaultAddCapabilities:` + fmt.Sprintf("%v", this.DefaultAddCapabilities) + `,`, + `RequiredDropCapabilities:` + fmt.Sprintf("%v", this.RequiredDropCapabilities) + `,`, + `AllowedCapabilities:` + fmt.Sprintf("%v", this.AllowedCapabilities) + `,`, + `Volumes:` + fmt.Sprintf("%v", this.Volumes) + `,`, + `HostNetwork:` + fmt.Sprintf("%v", this.HostNetwork) + `,`, + `HostPorts:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.HostPorts), "HostPortRange", "HostPortRange", 1), `&`, ``, 1) + `,`, + `HostPID:` + fmt.Sprintf("%v", this.HostPID) + `,`, + `HostIPC:` + fmt.Sprintf("%v", this.HostIPC) + `,`, + `SELinux:` + strings.Replace(strings.Replace(this.SELinux.String(), "SELinuxStrategyOptions", "SELinuxStrategyOptions", 1), `&`, ``, 1) + `,`, + `RunAsUser:` + strings.Replace(strings.Replace(this.RunAsUser.String(), "RunAsUserStrategyOptions", "RunAsUserStrategyOptions", 1), `&`, ``, 1) + `,`, + `SupplementalGroups:` + strings.Replace(strings.Replace(this.SupplementalGroups.String(), "SupplementalGroupsStrategyOptions", "SupplementalGroupsStrategyOptions", 1), `&`, ``, 1) + `,`, + `FSGroup:` + strings.Replace(strings.Replace(this.FSGroup.String(), "FSGroupStrategyOptions", "FSGroupStrategyOptions", 1), `&`, ``, 1) + `,`, + `ReadOnlyRootFilesystem:` + fmt.Sprintf("%v", this.ReadOnlyRootFilesystem) + `,`, + `DefaultAllowPrivilegeEscalation:` + valueToStringGenerated(this.DefaultAllowPrivilegeEscalation) + `,`, + `AllowPrivilegeEscalation:` + valueToStringGenerated(this.AllowPrivilegeEscalation) + `,`, + `AllowedHostPaths:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.AllowedHostPaths), "AllowedHostPath", "AllowedHostPath", 1), `&`, ``, 1) + `,`, + `AllowedFlexVolumes:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.AllowedFlexVolumes), "AllowedFlexVolume", "AllowedFlexVolume", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *RunAsUserStrategyOptions) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RunAsUserStrategyOptions{`, + `Rule:` + fmt.Sprintf("%v", this.Rule) + `,`, + `Ranges:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Ranges), "IDRange", "IDRange", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *SELinuxStrategyOptions) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SELinuxStrategyOptions{`, + `Rule:` + fmt.Sprintf("%v", this.Rule) + `,`, + `SELinuxOptions:` + strings.Replace(fmt.Sprintf("%v", this.SELinuxOptions), "SELinuxOptions", "k8s_io_api_core_v1.SELinuxOptions", 1) + `,`, + `}`, + }, "") + return s +} +func (this *SupplementalGroupsStrategyOptions) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SupplementalGroupsStrategyOptions{`, + `Rule:` + fmt.Sprintf("%v", this.Rule) + `,`, + `Ranges:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Ranges), "IDRange", "IDRange", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *AllowedFlexVolume) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllowedFlexVolume: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllowedFlexVolume: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Driver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AllowedHostPath) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllowedHostPath: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllowedHostPath: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PathPrefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PathPrefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Eviction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Eviction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Eviction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DeleteOptions == nil { + m.DeleteOptions = &k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions{} + } + if err := m.DeleteOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FSGroupStrategyOptions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FSGroupStrategyOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FSGroupStrategyOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rule = FSGroupStrategyType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ranges = append(m.Ranges, IDRange{}) + if err := m.Ranges[len(m.Ranges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HostPortRange) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HostPortRange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HostPortRange: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + } + m.Min = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Min |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + } + m.Max = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Max |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IDRange) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IDRange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IDRange: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + } + m.Min = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Min |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + } + m.Max = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Max |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudget: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudget: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudgetList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudgetList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, PodDisruptionBudget{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudgetSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudgetSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinAvailable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MinAvailable == nil { + m.MinAvailable = &k8s_io_apimachinery_pkg_util_intstr.IntOrString{} + } + if err := m.MinAvailable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Selector == nil { + m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{} + } + if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxUnavailable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MaxUnavailable == nil { + m.MaxUnavailable = &k8s_io_apimachinery_pkg_util_intstr.IntOrString{} + } + if err := m.MaxUnavailable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodDisruptionBudgetStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodDisruptionBudgetStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType) + } + m.ObservedGeneration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ObservedGeneration |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptedPods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + var keykey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + keykey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + if m.DisruptedPods == nil { + m.DisruptedPods = make(map[string]k8s_io_apimachinery_pkg_apis_meta_v1.Time) + } + if iNdEx < postIndex { + var valuekey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + valuekey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue := &k8s_io_apimachinery_pkg_apis_meta_v1.Time{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + m.DisruptedPods[mapkey] = *mapvalue + } else { + var mapvalue k8s_io_apimachinery_pkg_apis_meta_v1.Time + m.DisruptedPods[mapkey] = mapvalue + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PodDisruptionsAllowed", wireType) + } + m.PodDisruptionsAllowed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PodDisruptionsAllowed |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentHealthy", wireType) + } + m.CurrentHealthy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentHealthy |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DesiredHealthy", wireType) + } + m.DesiredHealthy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DesiredHealthy |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedPods", wireType) + } + m.ExpectedPods = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpectedPods |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSecurityPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodSecurityPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSecurityPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSecurityPolicyList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodSecurityPolicyList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSecurityPolicyList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, PodSecurityPolicy{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSecurityPolicySpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 @@ -521,28 +2858,184 @@ func (m *Eviction) Unmarshal(dAtA []byte) error { if shift >= 64 { return ErrIntOverflowGenerated } - if iNdEx >= l { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodSecurityPolicySpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSecurityPolicySpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Privileged = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultAddCapabilities", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DefaultAddCapabilities = append(m.DefaultAddCapabilities, k8s_io_api_core_v1.Capability(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequiredDropCapabilities", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + m.RequiredDropCapabilities = append(m.RequiredDropCapabilities, k8s_io_api_core_v1.Capability(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedCapabilities", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Eviction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Eviction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowedCapabilities = append(m.AllowedCapabilities, k8s_io_api_core_v1.Capability(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Volumes = append(m.Volumes, FSType(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostNetwork", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.HostNetwork = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostPorts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -566,13 +3059,54 @@ func (m *Eviction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.HostPorts = append(m.HostPorts, HostPortRange{}) + if err := m.HostPorts[len(m.HostPorts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostPID", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.HostPID = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostIPC", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.HostIPC = bool(v != 0) + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeleteOptions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SELinux", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -596,66 +3130,73 @@ func (m *Eviction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.DeleteOptions == nil { - m.DeleteOptions = &k8s_io_apimachinery_pkg_apis_meta_v1.DeleteOptions{} - } - if err := m.DeleteOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.SELinux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAsUser", wireType) } - if skippy < 0 { + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { return ErrInvalidLengthGenerated } - if (iNdEx + skippy) > l { + postIndex := iNdEx + msglen + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated + if err := m.RunAsUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - if iNdEx >= l { + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplementalGroups", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + if err := m.SupplementalGroups.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PodDisruptionBudget: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PodDisruptionBudget: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FSGroup", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -679,13 +3220,75 @@ func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.FSGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadOnlyRootFilesystem", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ReadOnlyRootFilesystem = bool(v != 0) + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultAllowPrivilegeEscalation", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.DefaultAllowPrivilegeEscalation = &b + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowPrivilegeEscalation", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.AllowPrivilegeEscalation = &b + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowedHostPaths", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -709,13 +3312,14 @@ func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AllowedHostPaths = append(m.AllowedHostPaths, AllowedHostPath{}) + if err := m.AllowedHostPaths[len(m.AllowedHostPaths)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 18: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowedFlexVolumes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -739,7 +3343,8 @@ func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AllowedFlexVolumes = append(m.AllowedFlexVolumes, AllowedFlexVolume{}) + if err := m.AllowedFlexVolumes[len(m.AllowedFlexVolumes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -764,7 +3369,7 @@ func (m *PodDisruptionBudget) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { +func (m *RunAsUserStrategyOptions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -787,17 +3392,17 @@ func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodDisruptionBudgetList: wiretype end group for non-group") + return fmt.Errorf("proto: RunAsUserStrategyOptions: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodDisruptionBudgetList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RunAsUserStrategyOptions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -807,25 +3412,24 @@ func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Rule = RunAsUserStrategy(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -849,8 +3453,8 @@ func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, PodDisruptionBudget{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Ranges = append(m.Ranges, IDRange{}) + if err := m.Ranges[len(m.Ranges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -875,7 +3479,7 @@ func (m *PodDisruptionBudgetList) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { +func (m *SELinuxStrategyOptions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -898,17 +3502,17 @@ func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodDisruptionBudgetSpec: wiretype end group for non-group") + return fmt.Errorf("proto: SELinuxStrategyOptions: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodDisruptionBudgetSpec: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SELinuxStrategyOptions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinAvailable", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -918,61 +3522,24 @@ func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.MinAvailable == nil { - m.MinAvailable = &k8s_io_apimachinery_pkg_util_intstr.IntOrString{} - } - if err := m.MinAvailable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Rule = SELinuxStrategy(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Selector == nil { - m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{} - } - if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxUnavailable", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SELinuxOptions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -996,10 +3563,10 @@ func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.MaxUnavailable == nil { - m.MaxUnavailable = &k8s_io_apimachinery_pkg_util_intstr.IntOrString{} + if m.SELinuxOptions == nil { + m.SELinuxOptions = &k8s_io_api_core_v1.SELinuxOptions{} } - if err := m.MaxUnavailable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.SELinuxOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1024,7 +3591,7 @@ func (m *PodDisruptionBudgetSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { +func (m *SupplementalGroupsStrategyOptions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1047,17 +3614,17 @@ func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodDisruptionBudgetStatus: wiretype end group for non-group") + return fmt.Errorf("proto: SupplementalGroupsStrategyOptions: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodDisruptionBudgetStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SupplementalGroupsStrategyOptions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) } - m.ObservedGeneration = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1067,14 +3634,24 @@ func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ObservedGeneration |= (int64(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rule = SupplementalGroupsStrategyType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DisruptedPods", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1098,177 +3675,11 @@ func (m *PodDisruptionBudgetStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var keykey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - keykey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - if m.DisruptedPods == nil { - m.DisruptedPods = make(map[string]k8s_io_apimachinery_pkg_apis_meta_v1.Time) - } - if iNdEx < postIndex { - var valuekey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - valuekey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue := &k8s_io_apimachinery_pkg_apis_meta_v1.Time{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - m.DisruptedPods[mapkey] = *mapvalue - } else { - var mapvalue k8s_io_apimachinery_pkg_apis_meta_v1.Time - m.DisruptedPods[mapkey] = mapvalue + m.Ranges = append(m.Ranges, IDRange{}) + if err := m.Ranges[len(m.Ranges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PodDisruptionsAllowed", wireType) - } - m.PodDisruptionsAllowed = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PodDisruptionsAllowed |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentHealthy", wireType) - } - m.CurrentHealthy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CurrentHealthy |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredHealthy", wireType) - } - m.DesiredHealthy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DesiredHealthy |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpectedPods", wireType) - } - m.ExpectedPods = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExpectedPods |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -1400,55 +3811,106 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 795 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0x41, 0x6f, 0xdc, 0x44, - 0x14, 0xc7, 0xd7, 0xd9, 0x6c, 0x08, 0xc3, 0xee, 0x2a, 0x0c, 0x14, 0xd2, 0x95, 0xf0, 0xa2, 0x3d, - 0x21, 0xa4, 0x8e, 0x49, 0x5b, 0xa1, 0x88, 0x03, 0xa2, 0x26, 0x51, 0x29, 0x6a, 0x94, 0x6a, 0x52, - 0x2e, 0xa8, 0x48, 0x8c, 0xed, 0x57, 0x67, 0x58, 0xdb, 0x63, 0xcd, 0x8c, 0x4d, 0xf7, 0xc6, 0x81, - 0x0f, 0xc0, 0xf7, 0xe0, 0x8b, 0xe4, 0x80, 0x50, 0x8f, 0x15, 0x87, 0x15, 0x31, 0xe2, 0x7b, 0x20, - 0xdb, 0xb3, 0x9b, 0xf5, 0xee, 0x46, 0xdd, 0xe6, 0xc0, 0xc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ef, 0xac, 0x88, 0xae, - 0x11, 0xe2, 0x2f, 0x51, 0xdf, 0xcf, 0xa4, 0x84, 0x44, 0x7f, 0x03, 0x2c, 0xd2, 0xe7, 0x93, 0xfd, - 0xed, 0x0a, 0xf5, 0x81, 0x41, 0xf5, 0xbf, 0x6e, 0x64, 0xe9, 0x52, 0x75, 0xa9, 0x0f, 0x40, 0x71, - 0x09, 0xc1, 0x4c, 0xdf, 0x69, 0xea, 0x8f, 0x1a, 0x59, 0xba, 0x54, 0x8d, 0x0f, 0x51, 0x17, 0x5e, - 0xa4, 0xe0, 0xcf, 0x3c, 0xdd, 0xa9, 0xd4, 0xef, 0x1b, 0x75, 0xf7, 0x78, 0x21, 0x47, 0x1b, 0x95, - 0x83, 0x08, 0xe1, 0x55, 0x13, 0xf1, 0x1e, 0x6a, 0x8f, 0x61, 0x52, 0x5d, 0xf1, 0xdb, 0xb4, 0x7c, - 0xc4, 0x5f, 0xa1, 0x4e, 0xce, 0xa2, 0x0c, 0xcc, 0xae, 0x7f, 0xba, 0xd9, 0xae, 0x3f, 0xe5, 0x31, - 0xd0, 0x5a, 0xf8, 0xc5, 0xd6, 0xa1, 0xe5, 0xde, 0xb9, 0xb8, 0xb4, 0x5b, 0x2f, 0x2f, 0xed, 0xd6, - 0xab, 0x4b, 0xbb, 0xf5, 0x4b, 0x61, 0x5b, 0x17, 0x85, 0x6d, 0xbd, 0x2c, 0x6c, 0xeb, 0x55, 0x61, - 0x5b, 0x7f, 0x17, 0xb6, 0xf5, 0xdb, 0x3f, 0x76, 0xeb, 0xfb, 0xb7, 0xcc, 0xc5, 0xff, 0x17, 0x00, - 0x00, 0xff, 0xff, 0x00, 0xc0, 0xac, 0xb5, 0x48, 0x08, 0x00, 0x00, + // 1605 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4f, 0x6f, 0x1b, 0xb9, + 0x15, 0xf7, 0x58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 0x4b, 0xf0, 0x3e, 0xc1, 0x0b, 0xf8, 0xff, 0x1a, 0xd8, + 0x1c, 0x5d, 0x30, 0xe0, 0x83, 0x48, 0x74, 0xb9, 0x58, 0x74, 0x2b, 0x31, 0x96, 0x8a, 0xed, 0x6f, + 0x60, 0x59, 0x95, 0x95, 0xe8, 0x1f, 0x0c, 0x91, 0x18, 0x83, 0xfb, 0x20, 0xe8, 0x08, 0x94, 0x44, + 0x78, 0xa4, 0x64, 0x2f, 0x1f, 0x1d, 0x43, 0x31, 0xb5, 0xfc, 0x17, 0x1a, 0xb8, 0x75, 0x65, 0x41, + 0x80, 0x66, 0x24, 0x74, 0x23, 0x16, 0x7a, 0x76, 0xbc, 0xc0, 0xa7, 0xf9, 0x9f, 0xc1, 0xbc, 0x77, + 0xf9, 0x2e, 0x3b, 0xf5, 0xe6, 0x5d, 0x76, 0xea, 0xed, 0xbb, 0xec, 0xd4, 0x3f, 0xbb, 0x59, 0xed, + 0xb2, 0x9b, 0xd5, 0xde, 0x74, 0xb3, 0xda, 0xdb, 0x6e, 0x56, 0xfb, 0xb6, 0x9b, 0xd5, 0xfe, 0xf3, + 0x5d, 0x76, 0xea, 0x2f, 0x69, 0x25, 0xf7, 0x43, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x7d, 0x0b, + 0x1d, 0x1e, 0x14, 0x00, 0x00, } diff --git a/vendor/k8s.io/api/policy/v1beta1/generated.proto b/vendor/k8s.io/api/policy/v1beta1/generated.proto index 2e01cf3d9..514868a9f 100644 --- a/vendor/k8s.io/api/policy/v1beta1/generated.proto +++ b/vendor/k8s.io/api/policy/v1beta1/generated.proto @@ -30,6 +30,25 @@ import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; // Package-wide variables from generator "generated". option go_package = "v1beta1"; +// AllowedFlexVolume represents a single Flexvolume that is allowed to be used. +message AllowedFlexVolume { + // Driver is the name of the Flexvolume driver. + optional string driver = 1; +} + +// defines the host volume conditions that will be enabled by a policy +// for pods to use. It requires the path prefix to be defined. +message AllowedHostPath { + // is the path prefix that the host volume must match. + // It does not support `*`. + // Trailing slashes are trimmed when validating the path prefix with a host path. + // + // Examples: + // `/foo` would allow `/foo`, `/foo/` and `/foo/bar` + // `/foo` would not allow `/food` or `/etc/foo` + optional string pathPrefix = 1; +} + // Eviction evicts a pod from its node subject to certain policies and safety constraints. // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods//evictions. @@ -41,6 +60,37 @@ message Eviction { optional k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2; } +// FSGroupStrategyOptions defines the strategy type and options used to create the strategy. +message FSGroupStrategyOptions { + // Rule is the strategy that will dictate what FSGroup is used in the SecurityContext. + // +optional + optional string rule = 1; + + // Ranges are the allowed ranges of fs groups. If you would like to force a single + // fs group then supply a single range with the same start and end. + // +optional + repeated IDRange ranges = 2; +} + +// Host Port Range defines a range of host ports that will be enabled by a policy +// for pods to use. It requires both the start and end to be defined. +message HostPortRange { + // min is the start of the range, inclusive. + optional int32 min = 1; + + // max is the end of the range, inclusive. + optional int32 max = 2; +} + +// ID Range provides a min/max of an allowed range of IDs. +message IDRange { + // Min is the start of the range, inclusive. + optional int64 min = 1; + + // Max is the end of the range, inclusive. + optional int64 max = 2; +} + // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods message PodDisruptionBudget { optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -112,3 +162,146 @@ message PodDisruptionBudgetStatus { optional int32 expectedPods = 6; } +// Pod Security Policy governs the ability to make requests that affect the Security Context +// that will be applied to a pod and container. +message PodSecurityPolicy { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec defines the policy enforced. + // +optional + optional PodSecurityPolicySpec spec = 2; +} + +// Pod Security Policy List is a list of PodSecurityPolicy objects. +message PodSecurityPolicyList { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is a list of schema objects. + repeated PodSecurityPolicy items = 2; +} + +// Pod Security Policy Spec defines the policy enforced. +message PodSecurityPolicySpec { + // privileged determines if a pod can request to be run as privileged. + // +optional + optional bool privileged = 1; + + // DefaultAddCapabilities is the default set of capabilities that will be added to the container + // unless the pod spec specifically drops the capability. You may not list a capability in both + // DefaultAddCapabilities and RequiredDropCapabilities. Capabilities added here are implicitly + // allowed, and need not be included in the AllowedCapabilities list. + // +optional + repeated string defaultAddCapabilities = 2; + + // RequiredDropCapabilities are the capabilities that will be dropped from the container. These + // are required to be dropped and cannot be added. + // +optional + repeated string requiredDropCapabilities = 3; + + // AllowedCapabilities is a list of capabilities that can be requested to add to the container. + // Capabilities in this field may be added at the pod author's discretion. + // You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities. + // +optional + repeated string allowedCapabilities = 4; + + // volumes is a white list of allowed volume plugins. Empty indicates that all plugins + // may be used. + // +optional + repeated string volumes = 5; + + // hostNetwork determines if the policy allows the use of HostNetwork in the pod spec. + // +optional + optional bool hostNetwork = 6; + + // hostPorts determines which host port ranges are allowed to be exposed. + // +optional + repeated HostPortRange hostPorts = 7; + + // hostPID determines if the policy allows the use of HostPID in the pod spec. + // +optional + optional bool hostPID = 8; + + // hostIPC determines if the policy allows the use of HostIPC in the pod spec. + // +optional + optional bool hostIPC = 9; + + // seLinux is the strategy that will dictate the allowable labels that may be set. + optional SELinuxStrategyOptions seLinux = 10; + + // runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. + optional RunAsUserStrategyOptions runAsUser = 11; + + // SupplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext. + optional SupplementalGroupsStrategyOptions supplementalGroups = 12; + + // FSGroup is the strategy that will dictate what fs group is used by the SecurityContext. + optional FSGroupStrategyOptions fsGroup = 13; + + // ReadOnlyRootFilesystem when set to true will force containers to run with a read only root file + // system. If the container specifically requests to run with a non-read only root file system + // the PSP should deny the pod. + // If set to false the container may run with a read only root file system if it wishes but it + // will not be forced to. + // +optional + optional bool readOnlyRootFilesystem = 14; + + // DefaultAllowPrivilegeEscalation controls the default setting for whether a + // process can gain more privileges than its parent process. + // +optional + optional bool defaultAllowPrivilegeEscalation = 15; + + // AllowPrivilegeEscalation determines if a pod can request to allow + // privilege escalation. If unspecified, defaults to true. + // +optional + optional bool allowPrivilegeEscalation = 16; + + // is a white list of allowed host paths. Empty indicates that all host paths may be used. + // +optional + repeated AllowedHostPath allowedHostPaths = 17; + + // AllowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all + // Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes + // is allowed in the "Volumes" field. + // +optional + repeated AllowedFlexVolume allowedFlexVolumes = 18; +} + +// Run A sUser Strategy Options defines the strategy type and any options used to create the strategy. +message RunAsUserStrategyOptions { + // Rule is the strategy that will dictate the allowable RunAsUser values that may be set. + optional string rule = 1; + + // Ranges are the allowed ranges of uids that may be used. + // +optional + repeated IDRange ranges = 2; +} + +// SELinux Strategy Options defines the strategy type and any options used to create the strategy. +message SELinuxStrategyOptions { + // type is the strategy that will dictate the allowable labels that may be set. + optional string rule = 1; + + // seLinuxOptions required to run as; required for MustRunAs + // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + // +optional + optional k8s.io.api.core.v1.SELinuxOptions seLinuxOptions = 2; +} + +// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy. +message SupplementalGroupsStrategyOptions { + // Rule is the strategy that will dictate what supplemental groups is used in the SecurityContext. + // +optional + optional string rule = 1; + + // Ranges are the allowed ranges of supplemental groups. If you would like to force a single + // supplemental group then supply a single range with the same start and end. + // +optional + repeated IDRange ranges = 2; +} + diff --git a/vendor/k8s.io/api/policy/v1beta1/register.go b/vendor/k8s.io/api/policy/v1beta1/register.go index d77f13040..b3efd6326 100644 --- a/vendor/k8s.io/api/policy/v1beta1/register.go +++ b/vendor/k8s.io/api/policy/v1beta1/register.go @@ -46,6 +46,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &PodDisruptionBudget{}, &PodDisruptionBudgetList{}, + &PodSecurityPolicy{}, + &PodSecurityPolicyList{}, &Eviction{}, ) // Add the watch version that applies diff --git a/vendor/k8s.io/api/policy/v1beta1/types.go b/vendor/k8s.io/api/policy/v1beta1/types.go index a69a57207..6cea9615f 100644 --- a/vendor/k8s.io/api/policy/v1beta1/types.go +++ b/vendor/k8s.io/api/policy/v1beta1/types.go @@ -17,6 +17,7 @@ limitations under the License. package v1beta1 import ( + "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" ) @@ -113,3 +114,255 @@ type Eviction struct { // DeleteOptions may be provided DeleteOptions *metav1.DeleteOptions `json:"deleteOptions,omitempty" protobuf:"bytes,2,opt,name=deleteOptions"` } + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Pod Security Policy governs the ability to make requests that affect the Security Context +// that will be applied to a pod and container. +type PodSecurityPolicy struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec defines the policy enforced. + // +optional + Spec PodSecurityPolicySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` +} + +// Pod Security Policy Spec defines the policy enforced. +type PodSecurityPolicySpec struct { + // privileged determines if a pod can request to be run as privileged. + // +optional + Privileged bool `json:"privileged,omitempty" protobuf:"varint,1,opt,name=privileged"` + // DefaultAddCapabilities is the default set of capabilities that will be added to the container + // unless the pod spec specifically drops the capability. You may not list a capability in both + // DefaultAddCapabilities and RequiredDropCapabilities. Capabilities added here are implicitly + // allowed, and need not be included in the AllowedCapabilities list. + // +optional + DefaultAddCapabilities []v1.Capability `json:"defaultAddCapabilities,omitempty" protobuf:"bytes,2,rep,name=defaultAddCapabilities,casttype=k8s.io/api/core/v1.Capability"` + // RequiredDropCapabilities are the capabilities that will be dropped from the container. These + // are required to be dropped and cannot be added. + // +optional + RequiredDropCapabilities []v1.Capability `json:"requiredDropCapabilities,omitempty" protobuf:"bytes,3,rep,name=requiredDropCapabilities,casttype=k8s.io/api/core/v1.Capability"` + // AllowedCapabilities is a list of capabilities that can be requested to add to the container. + // Capabilities in this field may be added at the pod author's discretion. + // You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities. + // +optional + AllowedCapabilities []v1.Capability `json:"allowedCapabilities,omitempty" protobuf:"bytes,4,rep,name=allowedCapabilities,casttype=k8s.io/api/core/v1.Capability"` + // volumes is a white list of allowed volume plugins. Empty indicates that all plugins + // may be used. + // +optional + Volumes []FSType `json:"volumes,omitempty" protobuf:"bytes,5,rep,name=volumes,casttype=FSType"` + // hostNetwork determines if the policy allows the use of HostNetwork in the pod spec. + // +optional + HostNetwork bool `json:"hostNetwork,omitempty" protobuf:"varint,6,opt,name=hostNetwork"` + // hostPorts determines which host port ranges are allowed to be exposed. + // +optional + HostPorts []HostPortRange `json:"hostPorts,omitempty" protobuf:"bytes,7,rep,name=hostPorts"` + // hostPID determines if the policy allows the use of HostPID in the pod spec. + // +optional + HostPID bool `json:"hostPID,omitempty" protobuf:"varint,8,opt,name=hostPID"` + // hostIPC determines if the policy allows the use of HostIPC in the pod spec. + // +optional + HostIPC bool `json:"hostIPC,omitempty" protobuf:"varint,9,opt,name=hostIPC"` + // seLinux is the strategy that will dictate the allowable labels that may be set. + SELinux SELinuxStrategyOptions `json:"seLinux" protobuf:"bytes,10,opt,name=seLinux"` + // runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. + RunAsUser RunAsUserStrategyOptions `json:"runAsUser" protobuf:"bytes,11,opt,name=runAsUser"` + // SupplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext. + SupplementalGroups SupplementalGroupsStrategyOptions `json:"supplementalGroups" protobuf:"bytes,12,opt,name=supplementalGroups"` + // FSGroup is the strategy that will dictate what fs group is used by the SecurityContext. + FSGroup FSGroupStrategyOptions `json:"fsGroup" protobuf:"bytes,13,opt,name=fsGroup"` + // ReadOnlyRootFilesystem when set to true will force containers to run with a read only root file + // system. If the container specifically requests to run with a non-read only root file system + // the PSP should deny the pod. + // If set to false the container may run with a read only root file system if it wishes but it + // will not be forced to. + // +optional + ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem,omitempty" protobuf:"varint,14,opt,name=readOnlyRootFilesystem"` + // DefaultAllowPrivilegeEscalation controls the default setting for whether a + // process can gain more privileges than its parent process. + // +optional + DefaultAllowPrivilegeEscalation *bool `json:"defaultAllowPrivilegeEscalation,omitempty" protobuf:"varint,15,opt,name=defaultAllowPrivilegeEscalation"` + // AllowPrivilegeEscalation determines if a pod can request to allow + // privilege escalation. If unspecified, defaults to true. + // +optional + AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" protobuf:"varint,16,opt,name=allowPrivilegeEscalation"` + // is a white list of allowed host paths. Empty indicates that all host paths may be used. + // +optional + AllowedHostPaths []AllowedHostPath `json:"allowedHostPaths,omitempty" protobuf:"bytes,17,rep,name=allowedHostPaths"` + // AllowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all + // Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes + // is allowed in the "Volumes" field. + // +optional + AllowedFlexVolumes []AllowedFlexVolume `json:"allowedFlexVolumes,omitempty" protobuf:"bytes,18,rep,name=allowedFlexVolumes"` +} + +// defines the host volume conditions that will be enabled by a policy +// for pods to use. It requires the path prefix to be defined. +type AllowedHostPath struct { + // is the path prefix that the host volume must match. + // It does not support `*`. + // Trailing slashes are trimmed when validating the path prefix with a host path. + // + // Examples: + // `/foo` would allow `/foo`, `/foo/` and `/foo/bar` + // `/foo` would not allow `/food` or `/etc/foo` + PathPrefix string `json:"pathPrefix,omitempty" protobuf:"bytes,1,rep,name=pathPrefix"` +} + +// FS Type gives strong typing to different file systems that are used by volumes. +type FSType string + +var ( + AzureFile FSType = "azureFile" + Flocker FSType = "flocker" + FlexVolume FSType = "flexVolume" + HostPath FSType = "hostPath" + EmptyDir FSType = "emptyDir" + GCEPersistentDisk FSType = "gcePersistentDisk" + AWSElasticBlockStore FSType = "awsElasticBlockStore" + GitRepo FSType = "gitRepo" + Secret FSType = "secret" + NFS FSType = "nfs" + ISCSI FSType = "iscsi" + Glusterfs FSType = "glusterfs" + PersistentVolumeClaim FSType = "persistentVolumeClaim" + RBD FSType = "rbd" + Cinder FSType = "cinder" + CephFS FSType = "cephFS" + DownwardAPI FSType = "downwardAPI" + FC FSType = "fc" + ConfigMap FSType = "configMap" + Quobyte FSType = "quobyte" + AzureDisk FSType = "azureDisk" + All FSType = "*" +) + +// AllowedFlexVolume represents a single Flexvolume that is allowed to be used. +type AllowedFlexVolume struct { + // Driver is the name of the Flexvolume driver. + Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"` +} + +// Host Port Range defines a range of host ports that will be enabled by a policy +// for pods to use. It requires both the start and end to be defined. +type HostPortRange struct { + // min is the start of the range, inclusive. + Min int32 `json:"min" protobuf:"varint,1,opt,name=min"` + // max is the end of the range, inclusive. + Max int32 `json:"max" protobuf:"varint,2,opt,name=max"` +} + +// SELinux Strategy Options defines the strategy type and any options used to create the strategy. +type SELinuxStrategyOptions struct { + // type is the strategy that will dictate the allowable labels that may be set. + Rule SELinuxStrategy `json:"rule" protobuf:"bytes,1,opt,name=rule,casttype=SELinuxStrategy"` + // seLinuxOptions required to run as; required for MustRunAs + // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + // +optional + SELinuxOptions *v1.SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,2,opt,name=seLinuxOptions"` +} + +// SELinuxStrategy denotes strategy types for generating SELinux options for a +// Security Context. +type SELinuxStrategy string + +const ( + // container must have SELinux labels of X applied. + SELinuxStrategyMustRunAs SELinuxStrategy = "MustRunAs" + // container may make requests for any SELinux context labels. + SELinuxStrategyRunAsAny SELinuxStrategy = "RunAsAny" +) + +// Run A sUser Strategy Options defines the strategy type and any options used to create the strategy. +type RunAsUserStrategyOptions struct { + // Rule is the strategy that will dictate the allowable RunAsUser values that may be set. + Rule RunAsUserStrategy `json:"rule" protobuf:"bytes,1,opt,name=rule,casttype=RunAsUserStrategy"` + // Ranges are the allowed ranges of uids that may be used. + // +optional + Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"` +} + +// ID Range provides a min/max of an allowed range of IDs. +type IDRange struct { + // Min is the start of the range, inclusive. + Min int64 `json:"min" protobuf:"varint,1,opt,name=min"` + // Max is the end of the range, inclusive. + Max int64 `json:"max" protobuf:"varint,2,opt,name=max"` +} + +// RunAsUserStrategy denotes strategy types for generating RunAsUser values for a +// Security Context. +type RunAsUserStrategy string + +const ( + // container must run as a particular uid. + RunAsUserStrategyMustRunAs RunAsUserStrategy = "MustRunAs" + // container must run as a non-root uid + RunAsUserStrategyMustRunAsNonRoot RunAsUserStrategy = "MustRunAsNonRoot" + // container may make requests for any uid. + RunAsUserStrategyRunAsAny RunAsUserStrategy = "RunAsAny" +) + +// FSGroupStrategyOptions defines the strategy type and options used to create the strategy. +type FSGroupStrategyOptions struct { + // Rule is the strategy that will dictate what FSGroup is used in the SecurityContext. + // +optional + Rule FSGroupStrategyType `json:"rule,omitempty" protobuf:"bytes,1,opt,name=rule,casttype=FSGroupStrategyType"` + // Ranges are the allowed ranges of fs groups. If you would like to force a single + // fs group then supply a single range with the same start and end. + // +optional + Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"` +} + +// FSGroupStrategyType denotes strategy types for generating FSGroup values for a +// SecurityContext +type FSGroupStrategyType string + +const ( + // container must have FSGroup of X applied. + FSGroupStrategyMustRunAs FSGroupStrategyType = "MustRunAs" + // container may make requests for any FSGroup labels. + FSGroupStrategyRunAsAny FSGroupStrategyType = "RunAsAny" +) + +// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy. +type SupplementalGroupsStrategyOptions struct { + // Rule is the strategy that will dictate what supplemental groups is used in the SecurityContext. + // +optional + Rule SupplementalGroupsStrategyType `json:"rule,omitempty" protobuf:"bytes,1,opt,name=rule,casttype=SupplementalGroupsStrategyType"` + // Ranges are the allowed ranges of supplemental groups. If you would like to force a single + // supplemental group then supply a single range with the same start and end. + // +optional + Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"` +} + +// SupplementalGroupsStrategyType denotes strategy types for determining valid supplemental +// groups for a SecurityContext. +type SupplementalGroupsStrategyType string + +const ( + // container must run as a particular gid. + SupplementalGroupsStrategyMustRunAs SupplementalGroupsStrategyType = "MustRunAs" + // container may make requests for any gid. + SupplementalGroupsStrategyRunAsAny SupplementalGroupsStrategyType = "RunAsAny" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Pod Security Policy List is a list of PodSecurityPolicy objects. +type PodSecurityPolicyList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is a list of schema objects. + Items []PodSecurityPolicy `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go index 29432506d..8c51518d4 100644 --- a/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go @@ -27,6 +27,24 @@ package v1beta1 // Those methods can be generated by using hack/update-generated-swagger-docs.sh // AUTO-GENERATED FUNCTIONS START HERE +var map_AllowedFlexVolume = map[string]string{ + "": "AllowedFlexVolume represents a single Flexvolume that is allowed to be used.", + "driver": "Driver is the name of the Flexvolume driver.", +} + +func (AllowedFlexVolume) SwaggerDoc() map[string]string { + return map_AllowedFlexVolume +} + +var map_AllowedHostPath = map[string]string{ + "": "defines the host volume conditions that will be enabled by a policy for pods to use. It requires the path prefix to be defined.", + "pathPrefix": "is the path prefix that the host volume must match. It does not support `*`. Trailing slashes are trimmed when validating the path prefix with a host path.\n\nExamples: `/foo` would allow `/foo`, `/foo/` and `/foo/bar` `/foo` would not allow `/food` or `/etc/foo`", +} + +func (AllowedHostPath) SwaggerDoc() map[string]string { + return map_AllowedHostPath +} + var map_Eviction = map[string]string{ "": "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions.", "metadata": "ObjectMeta describes the pod that is being evicted.", @@ -37,6 +55,36 @@ func (Eviction) SwaggerDoc() map[string]string { return map_Eviction } +var map_FSGroupStrategyOptions = map[string]string{ + "": "FSGroupStrategyOptions defines the strategy type and options used to create the strategy.", + "rule": "Rule is the strategy that will dictate what FSGroup is used in the SecurityContext.", + "ranges": "Ranges are the allowed ranges of fs groups. If you would like to force a single fs group then supply a single range with the same start and end.", +} + +func (FSGroupStrategyOptions) SwaggerDoc() map[string]string { + return map_FSGroupStrategyOptions +} + +var map_HostPortRange = map[string]string{ + "": "Host Port Range defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined.", + "min": "min is the start of the range, inclusive.", + "max": "max is the end of the range, inclusive.", +} + +func (HostPortRange) SwaggerDoc() map[string]string { + return map_HostPortRange +} + +var map_IDRange = map[string]string{ + "": "ID Range provides a min/max of an allowed range of IDs.", + "min": "Min is the start of the range, inclusive.", + "max": "Max is the end of the range, inclusive.", +} + +func (IDRange) SwaggerDoc() map[string]string { + return map_IDRange +} + var map_PodDisruptionBudget = map[string]string{ "": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods", "spec": "Specification of the desired behavior of the PodDisruptionBudget.", @@ -80,4 +128,80 @@ func (PodDisruptionBudgetStatus) SwaggerDoc() map[string]string { return map_PodDisruptionBudgetStatus } +var map_PodSecurityPolicy = map[string]string{ + "": "Pod Security Policy governs the ability to make requests that affect the Security Context that will be applied to a pod and container.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "spec": "spec defines the policy enforced.", +} + +func (PodSecurityPolicy) SwaggerDoc() map[string]string { + return map_PodSecurityPolicy +} + +var map_PodSecurityPolicyList = map[string]string{ + "": "Pod Security Policy List is a list of PodSecurityPolicy objects.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "items": "Items is a list of schema objects.", +} + +func (PodSecurityPolicyList) SwaggerDoc() map[string]string { + return map_PodSecurityPolicyList +} + +var map_PodSecurityPolicySpec = map[string]string{ + "": "Pod Security Policy Spec defines the policy enforced.", + "privileged": "privileged determines if a pod can request to be run as privileged.", + "defaultAddCapabilities": "DefaultAddCapabilities is the default set of capabilities that will be added to the container unless the pod spec specifically drops the capability. You may not list a capability in both DefaultAddCapabilities and RequiredDropCapabilities. Capabilities added here are implicitly allowed, and need not be included in the AllowedCapabilities list.", + "requiredDropCapabilities": "RequiredDropCapabilities are the capabilities that will be dropped from the container. These are required to be dropped and cannot be added.", + "allowedCapabilities": "AllowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field may be added at the pod author's discretion. You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities.", + "volumes": "volumes is a white list of allowed volume plugins. Empty indicates that all plugins may be used.", + "hostNetwork": "hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.", + "hostPorts": "hostPorts determines which host port ranges are allowed to be exposed.", + "hostPID": "hostPID determines if the policy allows the use of HostPID in the pod spec.", + "hostIPC": "hostIPC determines if the policy allows the use of HostIPC in the pod spec.", + "seLinux": "seLinux is the strategy that will dictate the allowable labels that may be set.", + "runAsUser": "runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set.", + "supplementalGroups": "SupplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext.", + "fsGroup": "FSGroup is the strategy that will dictate what fs group is used by the SecurityContext.", + "readOnlyRootFilesystem": "ReadOnlyRootFilesystem when set to true will force containers to run with a read only root file system. If the container specifically requests to run with a non-read only root file system the PSP should deny the pod. If set to false the container may run with a read only root file system if it wishes but it will not be forced to.", + "defaultAllowPrivilegeEscalation": "DefaultAllowPrivilegeEscalation controls the default setting for whether a process can gain more privileges than its parent process.", + "allowPrivilegeEscalation": "AllowPrivilegeEscalation determines if a pod can request to allow privilege escalation. If unspecified, defaults to true.", + "allowedHostPaths": "is a white list of allowed host paths. Empty indicates that all host paths may be used.", + "allowedFlexVolumes": "AllowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the \"Volumes\" field.", +} + +func (PodSecurityPolicySpec) SwaggerDoc() map[string]string { + return map_PodSecurityPolicySpec +} + +var map_RunAsUserStrategyOptions = map[string]string{ + "": "Run A sUser Strategy Options defines the strategy type and any options used to create the strategy.", + "rule": "Rule is the strategy that will dictate the allowable RunAsUser values that may be set.", + "ranges": "Ranges are the allowed ranges of uids that may be used.", +} + +func (RunAsUserStrategyOptions) SwaggerDoc() map[string]string { + return map_RunAsUserStrategyOptions +} + +var map_SELinuxStrategyOptions = map[string]string{ + "": "SELinux Strategy Options defines the strategy type and any options used to create the strategy.", + "rule": "type is the strategy that will dictate the allowable labels that may be set.", + "seLinuxOptions": "seLinuxOptions required to run as; required for MustRunAs More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/", +} + +func (SELinuxStrategyOptions) SwaggerDoc() map[string]string { + return map_SELinuxStrategyOptions +} + +var map_SupplementalGroupsStrategyOptions = map[string]string{ + "": "SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.", + "rule": "Rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.", + "ranges": "Ranges are the allowed ranges of supplemental groups. If you would like to force a single supplemental group then supply a single range with the same start and end.", +} + +func (SupplementalGroupsStrategyOptions) SwaggerDoc() map[string]string { + return map_SupplementalGroupsStrategyOptions +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go index 78a597b5b..8a770b2f0 100644 --- a/vendor/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go @@ -16,16 +16,49 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 import ( + core_v1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" intstr "k8s.io/apimachinery/pkg/util/intstr" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllowedFlexVolume) DeepCopyInto(out *AllowedFlexVolume) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllowedFlexVolume. +func (in *AllowedFlexVolume) DeepCopy() *AllowedFlexVolume { + if in == nil { + return nil + } + out := new(AllowedFlexVolume) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllowedHostPath) DeepCopyInto(out *AllowedHostPath) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllowedHostPath. +func (in *AllowedHostPath) DeepCopy() *AllowedHostPath { + if in == nil { + return nil + } + out := new(AllowedHostPath) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Eviction) DeepCopyInto(out *Eviction) { *out = *in @@ -57,9 +90,61 @@ func (in *Eviction) DeepCopy() *Eviction { func (in *Eviction) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FSGroupStrategyOptions) DeepCopyInto(out *FSGroupStrategyOptions) { + *out = *in + if in.Ranges != nil { + in, out := &in.Ranges, &out.Ranges + *out = make([]IDRange, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FSGroupStrategyOptions. +func (in *FSGroupStrategyOptions) DeepCopy() *FSGroupStrategyOptions { + if in == nil { + return nil + } + out := new(FSGroupStrategyOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HostPortRange) DeepCopyInto(out *HostPortRange) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPortRange. +func (in *HostPortRange) DeepCopy() *HostPortRange { + if in == nil { return nil } + out := new(HostPortRange) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IDRange) DeepCopyInto(out *IDRange) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IDRange. +func (in *IDRange) DeepCopy() *IDRange { + if in == nil { + return nil + } + out := new(IDRange) + in.DeepCopyInto(out) + return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -86,9 +171,8 @@ func (in *PodDisruptionBudget) DeepCopy() *PodDisruptionBudget { func (in *PodDisruptionBudget) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -120,9 +204,8 @@ func (in *PodDisruptionBudgetList) DeepCopy() *PodDisruptionBudgetList { func (in *PodDisruptionBudgetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -190,3 +273,203 @@ func (in *PodDisruptionBudgetStatus) DeepCopy() *PodDisruptionBudgetStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodSecurityPolicy) DeepCopyInto(out *PodSecurityPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSecurityPolicy. +func (in *PodSecurityPolicy) DeepCopy() *PodSecurityPolicy { + if in == nil { + return nil + } + out := new(PodSecurityPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodSecurityPolicy) 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 *PodSecurityPolicyList) DeepCopyInto(out *PodSecurityPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PodSecurityPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSecurityPolicyList. +func (in *PodSecurityPolicyList) DeepCopy() *PodSecurityPolicyList { + if in == nil { + return nil + } + out := new(PodSecurityPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodSecurityPolicyList) 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 *PodSecurityPolicySpec) DeepCopyInto(out *PodSecurityPolicySpec) { + *out = *in + if in.DefaultAddCapabilities != nil { + in, out := &in.DefaultAddCapabilities, &out.DefaultAddCapabilities + *out = make([]core_v1.Capability, len(*in)) + copy(*out, *in) + } + if in.RequiredDropCapabilities != nil { + in, out := &in.RequiredDropCapabilities, &out.RequiredDropCapabilities + *out = make([]core_v1.Capability, len(*in)) + copy(*out, *in) + } + if in.AllowedCapabilities != nil { + in, out := &in.AllowedCapabilities, &out.AllowedCapabilities + *out = make([]core_v1.Capability, len(*in)) + copy(*out, *in) + } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]FSType, len(*in)) + copy(*out, *in) + } + if in.HostPorts != nil { + in, out := &in.HostPorts, &out.HostPorts + *out = make([]HostPortRange, len(*in)) + copy(*out, *in) + } + in.SELinux.DeepCopyInto(&out.SELinux) + in.RunAsUser.DeepCopyInto(&out.RunAsUser) + in.SupplementalGroups.DeepCopyInto(&out.SupplementalGroups) + in.FSGroup.DeepCopyInto(&out.FSGroup) + if in.DefaultAllowPrivilegeEscalation != nil { + in, out := &in.DefaultAllowPrivilegeEscalation, &out.DefaultAllowPrivilegeEscalation + if *in == nil { + *out = nil + } else { + *out = new(bool) + **out = **in + } + } + if in.AllowPrivilegeEscalation != nil { + in, out := &in.AllowPrivilegeEscalation, &out.AllowPrivilegeEscalation + if *in == nil { + *out = nil + } else { + *out = new(bool) + **out = **in + } + } + if in.AllowedHostPaths != nil { + in, out := &in.AllowedHostPaths, &out.AllowedHostPaths + *out = make([]AllowedHostPath, len(*in)) + copy(*out, *in) + } + if in.AllowedFlexVolumes != nil { + in, out := &in.AllowedFlexVolumes, &out.AllowedFlexVolumes + *out = make([]AllowedFlexVolume, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSecurityPolicySpec. +func (in *PodSecurityPolicySpec) DeepCopy() *PodSecurityPolicySpec { + if in == nil { + return nil + } + out := new(PodSecurityPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RunAsUserStrategyOptions) DeepCopyInto(out *RunAsUserStrategyOptions) { + *out = *in + if in.Ranges != nil { + in, out := &in.Ranges, &out.Ranges + *out = make([]IDRange, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunAsUserStrategyOptions. +func (in *RunAsUserStrategyOptions) DeepCopy() *RunAsUserStrategyOptions { + if in == nil { + return nil + } + out := new(RunAsUserStrategyOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SELinuxStrategyOptions) DeepCopyInto(out *SELinuxStrategyOptions) { + *out = *in + if in.SELinuxOptions != nil { + in, out := &in.SELinuxOptions, &out.SELinuxOptions + if *in == nil { + *out = nil + } else { + *out = new(core_v1.SELinuxOptions) + **out = **in + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SELinuxStrategyOptions. +func (in *SELinuxStrategyOptions) DeepCopy() *SELinuxStrategyOptions { + if in == nil { + return nil + } + out := new(SELinuxStrategyOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SupplementalGroupsStrategyOptions) DeepCopyInto(out *SupplementalGroupsStrategyOptions) { + *out = *in + if in.Ranges != nil { + in, out := &in.Ranges, &out.Ranges + *out = make([]IDRange, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SupplementalGroupsStrategyOptions. +func (in *SupplementalGroupsStrategyOptions) DeepCopy() *SupplementalGroupsStrategyOptions { + if in == nil { + return nil + } + out := new(SupplementalGroupsStrategyOptions) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/api/rbac/OWNERS b/vendor/k8s.io/api/rbac/OWNERS index 53710111c..1aefde049 100755 --- a/vendor/k8s.io/api/rbac/OWNERS +++ b/vendor/k8s.io/api/rbac/OWNERS @@ -5,7 +5,6 @@ reviewers: - deads2k - sttts - ncdc -- timothysc - dims - krousey - mml diff --git a/vendor/k8s.io/api/rbac/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/rbac/v1/zz_generated.deepcopy.go index 085edaa12..0a2a4d08e 100644 --- a/vendor/k8s.io/api/rbac/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/rbac/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -86,9 +86,8 @@ func (in *ClusterRole) DeepCopy() *ClusterRole { func (in *ClusterRole) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -119,9 +118,8 @@ func (in *ClusterRoleBinding) DeepCopy() *ClusterRoleBinding { func (in *ClusterRoleBinding) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -153,9 +151,8 @@ func (in *ClusterRoleBindingList) DeepCopy() *ClusterRoleBindingList { func (in *ClusterRoleBindingList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -187,9 +184,8 @@ func (in *ClusterRoleList) DeepCopy() *ClusterRoleList { func (in *ClusterRoleList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -262,9 +258,8 @@ func (in *Role) DeepCopy() *Role { func (in *Role) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -295,9 +290,8 @@ func (in *RoleBinding) DeepCopy() *RoleBinding { func (in *RoleBinding) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -329,9 +323,8 @@ func (in *RoleBindingList) DeepCopy() *RoleBindingList { func (in *RoleBindingList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -363,9 +356,8 @@ func (in *RoleList) DeepCopy() *RoleList { func (in *RoleList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/rbac/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/rbac/v1alpha1/zz_generated.deepcopy.go index 3037f666c..562451cd6 100644 --- a/vendor/k8s.io/api/rbac/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/rbac/v1alpha1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 @@ -86,9 +86,8 @@ func (in *ClusterRole) DeepCopy() *ClusterRole { func (in *ClusterRole) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -119,9 +118,8 @@ func (in *ClusterRoleBinding) DeepCopy() *ClusterRoleBinding { func (in *ClusterRoleBinding) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -153,9 +151,8 @@ func (in *ClusterRoleBindingList) DeepCopy() *ClusterRoleBindingList { func (in *ClusterRoleBindingList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -187,9 +184,8 @@ func (in *ClusterRoleList) DeepCopy() *ClusterRoleList { func (in *ClusterRoleList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -262,9 +258,8 @@ func (in *Role) DeepCopy() *Role { func (in *Role) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -295,9 +290,8 @@ func (in *RoleBinding) DeepCopy() *RoleBinding { func (in *RoleBinding) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -329,9 +323,8 @@ func (in *RoleBindingList) DeepCopy() *RoleBindingList { func (in *RoleBindingList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -363,9 +356,8 @@ func (in *RoleList) DeepCopy() *RoleList { func (in *RoleList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/rbac/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/rbac/v1beta1/zz_generated.deepcopy.go index 7e035cd27..0ef823a07 100644 --- a/vendor/k8s.io/api/rbac/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/rbac/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -86,9 +86,8 @@ func (in *ClusterRole) DeepCopy() *ClusterRole { func (in *ClusterRole) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -119,9 +118,8 @@ func (in *ClusterRoleBinding) DeepCopy() *ClusterRoleBinding { func (in *ClusterRoleBinding) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -153,9 +151,8 @@ func (in *ClusterRoleBindingList) DeepCopy() *ClusterRoleBindingList { func (in *ClusterRoleBindingList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -187,9 +184,8 @@ func (in *ClusterRoleList) DeepCopy() *ClusterRoleList { func (in *ClusterRoleList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -262,9 +258,8 @@ func (in *Role) DeepCopy() *Role { func (in *Role) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -295,9 +290,8 @@ func (in *RoleBinding) DeepCopy() *RoleBinding { func (in *RoleBinding) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -329,9 +323,8 @@ func (in *RoleBindingList) DeepCopy() *RoleBindingList { func (in *RoleBindingList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -363,9 +356,8 @@ func (in *RoleList) DeepCopy() *RoleList { func (in *RoleList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/scheduling/v1alpha1/generated.proto b/vendor/k8s.io/api/scheduling/v1alpha1/generated.proto index 75b4968cc..e964a76dd 100644 --- a/vendor/k8s.io/api/scheduling/v1alpha1/generated.proto +++ b/vendor/k8s.io/api/scheduling/v1alpha1/generated.proto @@ -33,7 +33,7 @@ option go_package = "v1alpha1"; // integer value. The value can be any valid integer. message PriorityClass { // Standard object's metadata. - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -43,6 +43,9 @@ message PriorityClass { // globalDefault specifies whether this PriorityClass should be considered as // the default priority for pods that do not have any priority class. + // Only one PriorityClass can be marked as `globalDefault`. However, if more than + // one PriorityClasses exists with their `globalDefault` field set to true, + // the smallest value of such global default PriorityClasses will be used as the default priority. // +optional optional bool globalDefault = 3; @@ -55,7 +58,7 @@ message PriorityClass { // PriorityClassList is a collection of priority classes. message PriorityClassList { // Standard list metadata - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; diff --git a/vendor/k8s.io/api/scheduling/v1alpha1/types.go b/vendor/k8s.io/api/scheduling/v1alpha1/types.go index bca0f3471..21e3df0af 100644 --- a/vendor/k8s.io/api/scheduling/v1alpha1/types.go +++ b/vendor/k8s.io/api/scheduling/v1alpha1/types.go @@ -29,7 +29,7 @@ import ( type PriorityClass struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -39,6 +39,9 @@ type PriorityClass struct { // globalDefault specifies whether this PriorityClass should be considered as // the default priority for pods that do not have any priority class. + // Only one PriorityClass can be marked as `globalDefault`. However, if more than + // one PriorityClasses exists with their `globalDefault` field set to true, + // the smallest value of such global default PriorityClasses will be used as the default priority. // +optional GlobalDefault bool `json:"globalDefault,omitempty" protobuf:"bytes,3,opt,name=globalDefault"` @@ -54,7 +57,7 @@ type PriorityClass struct { type PriorityClassList struct { metav1.TypeMeta `json:",inline"` // Standard list metadata - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` diff --git a/vendor/k8s.io/api/scheduling/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/scheduling/v1alpha1/types_swagger_doc_generated.go index c6187398d..9080dd9d6 100644 --- a/vendor/k8s.io/api/scheduling/v1alpha1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/scheduling/v1alpha1/types_swagger_doc_generated.go @@ -29,9 +29,9 @@ package v1alpha1 // AUTO-GENERATED FUNCTIONS START HERE var map_PriorityClass = map[string]string{ "": "PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer.", - "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", "value": "The value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec.", - "globalDefault": "globalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class.", + "globalDefault": "globalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as `globalDefault`. However, if more than one PriorityClasses exists with their `globalDefault` field set to true, the smallest value of such global default PriorityClasses will be used as the default priority.", "description": "description is an arbitrary string that usually provides guidelines on when this priority class should be used.", } @@ -41,7 +41,7 @@ func (PriorityClass) SwaggerDoc() map[string]string { var map_PriorityClassList = map[string]string{ "": "PriorityClassList is a collection of priority classes.", - "metadata": "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", + "metadata": "Standard list metadata More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", "items": "items is the list of PriorityClasses", } diff --git a/vendor/k8s.io/api/scheduling/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/scheduling/v1alpha1/zz_generated.deepcopy.go index 344e6cc62..51f8d0473 100644 --- a/vendor/k8s.io/api/scheduling/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/scheduling/v1alpha1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 @@ -46,9 +46,8 @@ func (in *PriorityClass) DeepCopy() *PriorityClass { func (in *PriorityClass) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -80,7 +79,6 @@ func (in *PriorityClassList) DeepCopy() *PriorityClassList { func (in *PriorityClassList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } diff --git a/vendor/k8s.io/api/settings/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/settings/v1alpha1/zz_generated.deepcopy.go index 537668658..3fe7f6ca4 100644 --- a/vendor/k8s.io/api/settings/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/settings/v1alpha1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 @@ -48,9 +48,8 @@ func (in *PodPreset) DeepCopy() *PodPreset { func (in *PodPreset) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -82,9 +81,8 @@ func (in *PodPresetList) DeepCopy() *PodPresetList { func (in *PodPresetList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go index 63bdcc43c..ccab05ccc 100644 --- a/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -86,9 +86,8 @@ func (in *StorageClass) DeepCopy() *StorageClass { func (in *StorageClass) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -120,7 +119,6 @@ func (in *StorageClassList) DeepCopy() *StorageClassList { func (in *StorageClassList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } diff --git a/vendor/k8s.io/api/storage/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/storage/v1alpha1/zz_generated.deepcopy.go index e1561dba1..04221c67c 100644 --- a/vendor/k8s.io/api/storage/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/storage/v1alpha1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 @@ -48,9 +48,8 @@ func (in *VolumeAttachment) DeepCopy() *VolumeAttachment { func (in *VolumeAttachment) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -82,9 +81,8 @@ func (in *VolumeAttachmentList) DeepCopy() *VolumeAttachmentList { func (in *VolumeAttachmentList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/api/storage/v1beta1/generated.pb.go b/vendor/k8s.io/api/storage/v1beta1/generated.pb.go index c9ae2c8b7..425d0e717 100644 --- a/vendor/k8s.io/api/storage/v1beta1/generated.pb.go +++ b/vendor/k8s.io/api/storage/v1beta1/generated.pb.go @@ -27,6 +27,12 @@ limitations under the License. It has these top-level messages: StorageClass StorageClassList + VolumeAttachment + VolumeAttachmentList + VolumeAttachmentSource + VolumeAttachmentSpec + VolumeAttachmentStatus + VolumeError */ package v1beta1 @@ -62,9 +68,39 @@ func (m *StorageClassList) Reset() { *m = StorageClassList{} func (*StorageClassList) ProtoMessage() {} func (*StorageClassList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } +func (m *VolumeAttachment) Reset() { *m = VolumeAttachment{} } +func (*VolumeAttachment) ProtoMessage() {} +func (*VolumeAttachment) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } + +func (m *VolumeAttachmentList) Reset() { *m = VolumeAttachmentList{} } +func (*VolumeAttachmentList) ProtoMessage() {} +func (*VolumeAttachmentList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } + +func (m *VolumeAttachmentSource) Reset() { *m = VolumeAttachmentSource{} } +func (*VolumeAttachmentSource) ProtoMessage() {} +func (*VolumeAttachmentSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} } + +func (m *VolumeAttachmentSpec) Reset() { *m = VolumeAttachmentSpec{} } +func (*VolumeAttachmentSpec) ProtoMessage() {} +func (*VolumeAttachmentSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} } + +func (m *VolumeAttachmentStatus) Reset() { *m = VolumeAttachmentStatus{} } +func (*VolumeAttachmentStatus) ProtoMessage() {} +func (*VolumeAttachmentStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} } + +func (m *VolumeError) Reset() { *m = VolumeError{} } +func (*VolumeError) ProtoMessage() {} +func (*VolumeError) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} } + func init() { proto.RegisterType((*StorageClass)(nil), "k8s.io.api.storage.v1beta1.StorageClass") proto.RegisterType((*StorageClassList)(nil), "k8s.io.api.storage.v1beta1.StorageClassList") + proto.RegisterType((*VolumeAttachment)(nil), "k8s.io.api.storage.v1beta1.VolumeAttachment") + proto.RegisterType((*VolumeAttachmentList)(nil), "k8s.io.api.storage.v1beta1.VolumeAttachmentList") + proto.RegisterType((*VolumeAttachmentSource)(nil), "k8s.io.api.storage.v1beta1.VolumeAttachmentSource") + proto.RegisterType((*VolumeAttachmentSpec)(nil), "k8s.io.api.storage.v1beta1.VolumeAttachmentSpec") + proto.RegisterType((*VolumeAttachmentStatus)(nil), "k8s.io.api.storage.v1beta1.VolumeAttachmentStatus") + proto.RegisterType((*VolumeError)(nil), "k8s.io.api.storage.v1beta1.VolumeError") } func (m *StorageClass) Marshal() (dAtA []byte, err error) { size := m.Size() @@ -193,6 +229,242 @@ func (m *StorageClassList) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *VolumeAttachment) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeAttachment) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) + n3, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) + n4, err := m.Spec.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) + n5, err := m.Status.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 + return i, nil +} + +func (m *VolumeAttachmentList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeAttachmentList) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) + n6, err := m.ListMeta.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n6 + if len(m.Items) > 0 { + for _, msg := range m.Items { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *VolumeAttachmentSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeAttachmentSource) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.PersistentVolumeName != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PersistentVolumeName))) + i += copy(dAtA[i:], *m.PersistentVolumeName) + } + return i, nil +} + +func (m *VolumeAttachmentSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeAttachmentSpec) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Attacher))) + i += copy(dAtA[i:], m.Attacher) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Source.Size())) + n7, err := m.Source.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n7 + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.NodeName))) + i += copy(dAtA[i:], m.NodeName) + return i, nil +} + +func (m *VolumeAttachmentStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeAttachmentStatus) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0x8 + i++ + if m.Attached { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + if len(m.AttachmentMetadata) > 0 { + keysForAttachmentMetadata := make([]string, 0, len(m.AttachmentMetadata)) + for k := range m.AttachmentMetadata { + keysForAttachmentMetadata = append(keysForAttachmentMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAttachmentMetadata) + for _, k := range keysForAttachmentMetadata { + dAtA[i] = 0x12 + i++ + v := m.AttachmentMetadata[string(k)] + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } + if m.AttachError != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.AttachError.Size())) + n8, err := m.AttachError.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n8 + } + if m.DetachError != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.DetachError.Size())) + n9, err := m.DetachError.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n9 + } + return i, nil +} + +func (m *VolumeError) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeError) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Time.Size())) + n10, err := m.Time.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n10 + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) + i += copy(dAtA[i:], m.Message) + return i, nil +} + func encodeFixed64Generated(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) @@ -269,6 +541,87 @@ func (m *StorageClassList) Size() (n int) { return n } +func (m *VolumeAttachment) Size() (n int) { + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *VolumeAttachmentList) Size() (n int) { + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *VolumeAttachmentSource) Size() (n int) { + var l int + _ = l + if m.PersistentVolumeName != nil { + l = len(*m.PersistentVolumeName) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *VolumeAttachmentSpec) Size() (n int) { + var l int + _ = l + l = len(m.Attacher) + n += 1 + l + sovGenerated(uint64(l)) + l = m.Source.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.NodeName) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *VolumeAttachmentStatus) Size() (n int) { + var l int + _ = l + n += 2 + if len(m.AttachmentMetadata) > 0 { + for k, v := range m.AttachmentMetadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AttachError != nil { + l = m.AttachError.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.DetachError != nil { + l = m.DetachError.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *VolumeError) Size() (n int) { + var l int + _ = l + l = m.Time.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func sovGenerated(x uint64) (n int) { for { n++ @@ -312,22 +665,878 @@ func (this *StorageClassList) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&StorageClassList{`, - `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "StorageClass", "StorageClass", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" + s := strings.Join([]string{`&StorageClassList{`, + `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "StorageClass", "StorageClass", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeAttachment) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeAttachment{`, + `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "VolumeAttachmentSpec", "VolumeAttachmentSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "VolumeAttachmentStatus", "VolumeAttachmentStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeAttachmentList) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeAttachmentList{`, + `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "VolumeAttachment", "VolumeAttachment", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeAttachmentSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeAttachmentSource{`, + `PersistentVolumeName:` + valueToStringGenerated(this.PersistentVolumeName) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeAttachmentSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeAttachmentSpec{`, + `Attacher:` + fmt.Sprintf("%v", this.Attacher) + `,`, + `Source:` + strings.Replace(strings.Replace(this.Source.String(), "VolumeAttachmentSource", "VolumeAttachmentSource", 1), `&`, ``, 1) + `,`, + `NodeName:` + fmt.Sprintf("%v", this.NodeName) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeAttachmentStatus) String() string { + if this == nil { + return "nil" + } + keysForAttachmentMetadata := make([]string, 0, len(this.AttachmentMetadata)) + for k := range this.AttachmentMetadata { + keysForAttachmentMetadata = append(keysForAttachmentMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAttachmentMetadata) + mapStringForAttachmentMetadata := "map[string]string{" + for _, k := range keysForAttachmentMetadata { + mapStringForAttachmentMetadata += fmt.Sprintf("%v: %v,", k, this.AttachmentMetadata[k]) + } + mapStringForAttachmentMetadata += "}" + s := strings.Join([]string{`&VolumeAttachmentStatus{`, + `Attached:` + fmt.Sprintf("%v", this.Attached) + `,`, + `AttachmentMetadata:` + mapStringForAttachmentMetadata + `,`, + `AttachError:` + strings.Replace(fmt.Sprintf("%v", this.AttachError), "VolumeError", "VolumeError", 1) + `,`, + `DetachError:` + strings.Replace(fmt.Sprintf("%v", this.DetachError), "VolumeError", "VolumeError", 1) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeError) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeError{`, + `Time:` + strings.Replace(strings.Replace(this.Time.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *StorageClass) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageClass: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageClass: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Provisioner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Provisioner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + var keykey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + keykey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + if m.Parameters == nil { + m.Parameters = make(map[string]string) + } + if iNdEx < postIndex { + var valuekey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + valuekey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + m.Parameters[mapkey] = mapvalue + } else { + var mapvalue string + m.Parameters[mapkey] = mapvalue + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReclaimPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := k8s_io_api_core_v1.PersistentVolumeReclaimPolicy(dAtA[iNdEx:postIndex]) + m.ReclaimPolicy = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MountOptions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MountOptions = append(m.MountOptions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowVolumeExpansion", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.AllowVolumeExpansion = &b + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeBindingMode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := VolumeBindingMode(dAtA[iNdEx:postIndex]) + m.VolumeBindingMode = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StorageClassList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageClassList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageClassList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, StorageClass{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeAttachment) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeAttachment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeAttachment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeAttachmentList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeAttachmentList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeAttachmentList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, VolumeAttachment{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeAttachmentSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeAttachmentSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeAttachmentSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PersistentVolumeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.PersistentVolumeName = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + return nil } -func (m *StorageClass) Unmarshal(dAtA []byte) error { +func (m *VolumeAttachmentSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -350,15 +1559,44 @@ func (m *StorageClass) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StorageClass: wiretype end group for non-group") + return fmt.Errorf("proto: VolumeAttachmentSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StorageClass: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VolumeAttachmentSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Attacher", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attacher = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -382,13 +1620,13 @@ func (m *StorageClass) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Provisioner", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -413,11 +1651,81 @@ func (m *StorageClass) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Provisioner = string(dAtA[iNdEx:postIndex]) + m.NodeName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeAttachmentStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeAttachmentStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeAttachmentStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Attached", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Attached = bool(v != 0) + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AttachmentMetadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -481,8 +1789,8 @@ func (m *StorageClass) Unmarshal(dAtA []byte) error { } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey - if m.Parameters == nil { - m.Parameters = make(map[string]string) + if m.AttachmentMetadata == nil { + m.AttachmentMetadata = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 @@ -525,17 +1833,17 @@ func (m *StorageClass) Unmarshal(dAtA []byte) error { } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue - m.Parameters[mapkey] = mapvalue + m.AttachmentMetadata[mapkey] = mapvalue } else { var mapvalue string - m.Parameters[mapkey] = mapvalue + m.AttachmentMetadata[mapkey] = mapvalue } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReclaimPolicy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AttachError", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -545,77 +1853,30 @@ func (m *StorageClass) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - s := k8s_io_api_core_v1.PersistentVolumeReclaimPolicy(dAtA[iNdEx:postIndex]) - m.ReclaimPolicy = &s - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MountOptions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated + if m.AttachError == nil { + m.AttachError = &VolumeError{} } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.AttachError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.MountOptions = append(m.MountOptions, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowVolumeExpansion", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.AllowVolumeExpansion = &b - case 7: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeBindingMode", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DetachError", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -625,21 +1886,24 @@ func (m *StorageClass) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - s := VolumeBindingMode(dAtA[iNdEx:postIndex]) - m.VolumeBindingMode = &s + if m.DetachError == nil { + m.DetachError = &VolumeError{} + } + if err := m.DetachError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -662,7 +1926,7 @@ func (m *StorageClass) Unmarshal(dAtA []byte) error { } return nil } -func (m *StorageClassList) Unmarshal(dAtA []byte) error { +func (m *VolumeError) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -685,15 +1949,15 @@ func (m *StorageClassList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StorageClassList: wiretype end group for non-group") + return fmt.Errorf("proto: VolumeError: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StorageClassList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VolumeError: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -717,15 +1981,15 @@ func (m *StorageClassList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Time.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -735,22 +1999,20 @@ func (m *StorageClassList) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, StorageClass{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -883,44 +2145,67 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 622 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcd, 0x6e, 0xd3, 0x40, - 0x14, 0x85, 0xe3, 0x86, 0xd0, 0x76, 0xd2, 0x8a, 0xd4, 0x74, 0x61, 0x65, 0x61, 0x47, 0x5d, 0x45, - 0x48, 0x1d, 0xb7, 0xa5, 0xa0, 0x0a, 0x89, 0x05, 0xae, 0xba, 0x40, 0x6a, 0xd4, 0xc8, 0x48, 0x15, - 0x42, 0x2c, 0x98, 0x38, 0x17, 0x77, 0x88, 0x3d, 0x63, 0xcd, 0x8c, 0x03, 0xd9, 0xf1, 0x08, 0xbc, - 0x01, 0x8f, 0xc2, 0xb6,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e2, 0x8e, 0x84, 0x1b, 0x05, 0x00, 0x00, + // 977 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xc6, 0xf9, 0x1c, 0x27, 0x34, 0x1d, 0x22, 0xb0, 0x7c, 0x58, 0x47, 0xbe, 0x60, 0xaa, + 0x66, 0xb7, 0x09, 0x05, 0x45, 0x48, 0x1c, 0xb2, 0x25, 0x07, 0x50, 0xdc, 0x86, 0x29, 0xaa, 0x50, + 0xc5, 0x81, 0xc9, 0xee, 0xab, 0x33, 0xd8, 0xfb, 0xa1, 0x99, 0x59, 0xd3, 0xdc, 0x38, 0x71, 0xe6, + 0xc4, 0x95, 0x0b, 0xff, 0x07, 0x47, 0x72, 0x42, 0x3d, 0xf6, 0x64, 0x91, 0xe5, 0xbf, 0x88, 0x38, + 0xa0, 0x99, 0x9d, 0x78, 0xd7, 0x5e, 0x5b, 0x4d, 0x7a, 0xe8, 0x2d, 0xf3, 0xde, 0xfb, 0xfd, 0xde, + 0xd7, 0xef, 0xad, 0x83, 0x1e, 0xf5, 0x0f, 0x84, 0xc3, 0x62, 0xb7, 0x9f, 0x9e, 0x02, 0x8f, 0x40, + 0x82, 0x70, 0x87, 0x10, 0x05, 0x31, 0x77, 0x8d, 0x83, 0x26, 0xcc, 0x15, 0x32, 0xe6, 0xb4, 0x07, + 0xee, 0x70, 0xef, 0x14, 0x24, 0xdd, 0x73, 0x7b, 0x10, 0x01, 0xa7, 0x12, 0x02, 0x27, 0xe1, 0xb1, + 0x8c, 0x71, 0x33, 0x8f, 0x75, 0x68, 0xc2, 0x1c, 0x13, 0xeb, 0x98, 0xd8, 0xe6, 0x6e, 0x8f, 0xc9, + 0xb3, 0xf4, 0xd4, 0xf1, 0xe3, 0xd0, 0xed, 0xc5, 0xbd, 0xd8, 0xd5, 0x90, 0xd3, 0xf4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b7, 0x4b, 0xbd, 0x88, 0x66, 0xc1, 0x1f, 0xa3, 0xd5, 0x10, 0x84, 0xa0, + 0x3d, 0x93, 0xd9, 0xbb, 0x63, 0x82, 0x56, 0xbb, 0xb9, 0x99, 0x5c, 0xfb, 0xbd, 0xdd, 0x8b, 0x4b, + 0x7b, 0xe1, 0xd5, 0xa5, 0xbd, 0xf0, 0xfa, 0xd2, 0x5e, 0xf8, 0x39, 0xb3, 0xad, 0x8b, 0xcc, 0xb6, + 0x5e, 0x65, 0xb6, 0xf5, 0x3a, 0xb3, 0xad, 0x7f, 0x32, 0xdb, 0xfa, 0xf5, 0x5f, 0x7b, 0xe1, 0xf9, + 0xaa, 0x99, 0xdb, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4b, 0x7f, 0x8a, 0x3b, 0x1c, 0x0b, 0x00, + 0x00, } diff --git a/vendor/k8s.io/api/storage/v1beta1/generated.proto b/vendor/k8s.io/api/storage/v1beta1/generated.proto index f9e1d2950..1c6db8d41 100644 --- a/vendor/k8s.io/api/storage/v1beta1/generated.proto +++ b/vendor/k8s.io/api/storage/v1beta1/generated.proto @@ -22,6 +22,7 @@ syntax = 'proto2'; package k8s.io.api.storage.v1beta1; import "k8s.io/api/core/v1/generated.proto"; +import "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto"; import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; @@ -83,3 +84,99 @@ message StorageClassList { repeated StorageClass items = 2; } +// VolumeAttachment captures the intent to attach or detach the specified volume +// to/from the specified node. +// +// VolumeAttachment objects are non-namespaced. +message VolumeAttachment { + // Standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Specification of the desired attach/detach volume behavior. + // Populated by the Kubernetes system. + optional VolumeAttachmentSpec spec = 2; + + // Status of the VolumeAttachment request. + // Populated by the entity completing the attach or detach + // operation, i.e. the external-attacher. + // +optional + optional VolumeAttachmentStatus status = 3; +} + +// VolumeAttachmentList is a collection of VolumeAttachment objects. +message VolumeAttachmentList { + // Standard list metadata + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of VolumeAttachments + repeated VolumeAttachment items = 2; +} + +// VolumeAttachmentSource represents a volume that should be attached. +// Right now only PersistenVolumes can be attached via external attacher, +// in future we may allow also inline volumes in pods. +// Exactly one member can be set. +message VolumeAttachmentSource { + // Name of the persistent volume to attach. + // +optional + optional string persistentVolumeName = 1; +} + +// VolumeAttachmentSpec is the specification of a VolumeAttachment request. +message VolumeAttachmentSpec { + // Attacher indicates the name of the volume driver that MUST handle this + // request. This is the name returned by GetPluginName(). + optional string attacher = 1; + + // Source represents the volume that should be attached. + optional VolumeAttachmentSource source = 2; + + // The node that the volume should be attached to. + optional string nodeName = 3; +} + +// VolumeAttachmentStatus is the status of a VolumeAttachment request. +message VolumeAttachmentStatus { + // Indicates the volume is successfully attached. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + optional bool attached = 1; + + // Upon successful attach, this field is populated with any + // information returned by the attach operation that must be passed + // into subsequent WaitForAttach or Mount calls. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + // +optional + map attachmentMetadata = 2; + + // The last error encountered during attach operation, if any. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + // +optional + optional VolumeError attachError = 3; + + // The last error encountered during detach operation, if any. + // This field must only be set by the entity completing the detach + // operation, i.e. the external-attacher. + // +optional + optional VolumeError detachError = 4; +} + +// VolumeError captures an error encountered during a volume operation. +message VolumeError { + // Time the error was encountered. + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1; + + // String detailing the error encountered during Attach or Detach operation. + // This string maybe logged, so it should not contain sensitive + // information. + // +optional + optional string message = 2; +} + diff --git a/vendor/k8s.io/api/storage/v1beta1/register.go b/vendor/k8s.io/api/storage/v1beta1/register.go index 7f1f0c8e8..06b0f3d52 100644 --- a/vendor/k8s.io/api/storage/v1beta1/register.go +++ b/vendor/k8s.io/api/storage/v1beta1/register.go @@ -46,6 +46,9 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &StorageClass{}, &StorageClassList{}, + + &VolumeAttachment{}, + &VolumeAttachmentList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) diff --git a/vendor/k8s.io/api/storage/v1beta1/types.go b/vendor/k8s.io/api/storage/v1beta1/types.go index 7fb9ad980..99c9e4594 100644 --- a/vendor/k8s.io/api/storage/v1beta1/types.go +++ b/vendor/k8s.io/api/storage/v1beta1/types.go @@ -96,3 +96,110 @@ const ( // binding will occur during Pod scheduing. VolumeBindingWaitForFirstConsumer VolumeBindingMode = "WaitForFirstConsumer" ) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VolumeAttachment captures the intent to attach or detach the specified volume +// to/from the specified node. +// +// VolumeAttachment objects are non-namespaced. +type VolumeAttachment struct { + metav1.TypeMeta `json:",inline"` + + // Standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Specification of the desired attach/detach volume behavior. + // Populated by the Kubernetes system. + Spec VolumeAttachmentSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + + // Status of the VolumeAttachment request. + // Populated by the entity completing the attach or detach + // operation, i.e. the external-attacher. + // +optional + Status VolumeAttachmentStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VolumeAttachmentList is a collection of VolumeAttachment objects. +type VolumeAttachmentList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is the list of VolumeAttachments + Items []VolumeAttachment `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// VolumeAttachmentSpec is the specification of a VolumeAttachment request. +type VolumeAttachmentSpec struct { + // Attacher indicates the name of the volume driver that MUST handle this + // request. This is the name returned by GetPluginName(). + Attacher string `json:"attacher" protobuf:"bytes,1,opt,name=attacher"` + + // Source represents the volume that should be attached. + Source VolumeAttachmentSource `json:"source" protobuf:"bytes,2,opt,name=source"` + + // The node that the volume should be attached to. + NodeName string `json:"nodeName" protobuf:"bytes,3,opt,name=nodeName"` +} + +// VolumeAttachmentSource represents a volume that should be attached. +// Right now only PersistenVolumes can be attached via external attacher, +// in future we may allow also inline volumes in pods. +// Exactly one member can be set. +type VolumeAttachmentSource struct { + // Name of the persistent volume to attach. + // +optional + PersistentVolumeName *string `json:"persistentVolumeName,omitempty" protobuf:"bytes,1,opt,name=persistentVolumeName"` + + // Placeholder for *VolumeSource to accommodate inline volumes in pods. +} + +// VolumeAttachmentStatus is the status of a VolumeAttachment request. +type VolumeAttachmentStatus struct { + // Indicates the volume is successfully attached. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + Attached bool `json:"attached" protobuf:"varint,1,opt,name=attached"` + + // Upon successful attach, this field is populated with any + // information returned by the attach operation that must be passed + // into subsequent WaitForAttach or Mount calls. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + // +optional + AttachmentMetadata map[string]string `json:"attachmentMetadata,omitempty" protobuf:"bytes,2,rep,name=attachmentMetadata"` + + // The last error encountered during attach operation, if any. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + // +optional + AttachError *VolumeError `json:"attachError,omitempty" protobuf:"bytes,3,opt,name=attachError,casttype=VolumeError"` + + // The last error encountered during detach operation, if any. + // This field must only be set by the entity completing the detach + // operation, i.e. the external-attacher. + // +optional + DetachError *VolumeError `json:"detachError,omitempty" protobuf:"bytes,4,opt,name=detachError,casttype=VolumeError"` +} + +// VolumeError captures an error encountered during a volume operation. +type VolumeError struct { + // Time the error was encountered. + // +optional + Time metav1.Time `json:"time,omitempty" protobuf:"bytes,1,opt,name=time"` + + // String detailing the error encountered during Attach or Detach operation. + // This string maybe logged, so it should not contain sensitive + // information. + // +optional + Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` +} diff --git a/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go index 85886f7df..c9c20c453 100644 --- a/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go @@ -52,4 +52,67 @@ func (StorageClassList) SwaggerDoc() map[string]string { return map_StorageClassList } +var map_VolumeAttachment = map[string]string{ + "": "VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node.\n\nVolumeAttachment objects are non-namespaced.", + "metadata": "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "spec": "Specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.", + "status": "Status of the VolumeAttachment request. Populated by the entity completing the attach or detach operation, i.e. the external-attacher.", +} + +func (VolumeAttachment) SwaggerDoc() map[string]string { + return map_VolumeAttachment +} + +var map_VolumeAttachmentList = map[string]string{ + "": "VolumeAttachmentList is a collection of VolumeAttachment objects.", + "metadata": "Standard list metadata More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "items": "Items is the list of VolumeAttachments", +} + +func (VolumeAttachmentList) SwaggerDoc() map[string]string { + return map_VolumeAttachmentList +} + +var map_VolumeAttachmentSource = map[string]string{ + "": "VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.", + "persistentVolumeName": "Name of the persistent volume to attach.", +} + +func (VolumeAttachmentSource) SwaggerDoc() map[string]string { + return map_VolumeAttachmentSource +} + +var map_VolumeAttachmentSpec = map[string]string{ + "": "VolumeAttachmentSpec is the specification of a VolumeAttachment request.", + "attacher": "Attacher indicates the name of the volume driver that MUST handle this request. This is the name returned by GetPluginName().", + "source": "Source represents the volume that should be attached.", + "nodeName": "The node that the volume should be attached to.", +} + +func (VolumeAttachmentSpec) SwaggerDoc() map[string]string { + return map_VolumeAttachmentSpec +} + +var map_VolumeAttachmentStatus = map[string]string{ + "": "VolumeAttachmentStatus is the status of a VolumeAttachment request.", + "attached": "Indicates the volume is successfully attached. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", + "attachmentMetadata": "Upon successful attach, this field is populated with any information returned by the attach operation that must be passed into subsequent WaitForAttach or Mount calls. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", + "attachError": "The last error encountered during attach operation, if any. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", + "detachError": "The last error encountered during detach operation, if any. This field must only be set by the entity completing the detach operation, i.e. the external-attacher.", +} + +func (VolumeAttachmentStatus) SwaggerDoc() map[string]string { + return map_VolumeAttachmentStatus +} + +var map_VolumeError = map[string]string{ + "": "VolumeError captures an error encountered during a volume operation.", + "time": "Time the error was encountered.", + "message": "String detailing the error encountered during Attach or Detach operation. This string maybe logged, so it should not contain sensitive information.", +} + +func (VolumeError) SwaggerDoc() map[string]string { + return map_VolumeError +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go index 715b17f43..9a6a7266d 100644 --- a/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -86,9 +86,8 @@ func (in *StorageClass) DeepCopy() *StorageClass { func (in *StorageClass) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -120,7 +119,167 @@ func (in *StorageClassList) DeepCopy() *StorageClassList { func (in *StorageClassList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeAttachment) DeepCopyInto(out *VolumeAttachment) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachment. +func (in *VolumeAttachment) DeepCopy() *VolumeAttachment { + if in == nil { + return nil + } + out := new(VolumeAttachment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VolumeAttachment) 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 *VolumeAttachmentList) DeepCopyInto(out *VolumeAttachmentList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VolumeAttachment, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachmentList. +func (in *VolumeAttachmentList) DeepCopy() *VolumeAttachmentList { + if in == nil { return nil } + out := new(VolumeAttachmentList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VolumeAttachmentList) 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 *VolumeAttachmentSource) DeepCopyInto(out *VolumeAttachmentSource) { + *out = *in + if in.PersistentVolumeName != nil { + in, out := &in.PersistentVolumeName, &out.PersistentVolumeName + if *in == nil { + *out = nil + } else { + *out = new(string) + **out = **in + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachmentSource. +func (in *VolumeAttachmentSource) DeepCopy() *VolumeAttachmentSource { + if in == nil { + return nil + } + out := new(VolumeAttachmentSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeAttachmentSpec) DeepCopyInto(out *VolumeAttachmentSpec) { + *out = *in + in.Source.DeepCopyInto(&out.Source) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachmentSpec. +func (in *VolumeAttachmentSpec) DeepCopy() *VolumeAttachmentSpec { + if in == nil { + return nil + } + out := new(VolumeAttachmentSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeAttachmentStatus) DeepCopyInto(out *VolumeAttachmentStatus) { + *out = *in + if in.AttachmentMetadata != nil { + in, out := &in.AttachmentMetadata, &out.AttachmentMetadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AttachError != nil { + in, out := &in.AttachError, &out.AttachError + if *in == nil { + *out = nil + } else { + *out = new(VolumeError) + (*in).DeepCopyInto(*out) + } + } + if in.DetachError != nil { + in, out := &in.DetachError, &out.DetachError + if *in == nil { + *out = nil + } else { + *out = new(VolumeError) + (*in).DeepCopyInto(*out) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachmentStatus. +func (in *VolumeAttachmentStatus) DeepCopy() *VolumeAttachmentStatus { + if in == nil { + return nil + } + out := new(VolumeAttachmentStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeError) DeepCopyInto(out *VolumeError) { + *out = *in + in.Time.DeepCopyInto(&out.Time) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeError. +func (in *VolumeError) DeepCopy() *VolumeError { + if in == nil { + return nil + } + out := new(VolumeError) + in.DeepCopyInto(out) + return out } diff --git a/vendor/k8s.io/apiserver/.github/PULL_REQUEST_TEMPLATE.md b/vendor/k8s.io/apiserver/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..e559c074b --- /dev/null +++ b/vendor/k8s.io/apiserver/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,2 @@ +Sorry, we do not accept changes directly against this repository. Please see +CONTRIBUTING.md for information on where and how to contribute instead. diff --git a/vendor/k8s.io/apiserver/Godeps/Godeps.json b/vendor/k8s.io/apiserver/Godeps/Godeps.json index 842a41e4b..07cc018b4 100644 --- a/vendor/k8s.io/apiserver/Godeps/Godeps.json +++ b/vendor/k8s.io/apiserver/Godeps/Godeps.json @@ -27,252 +27,308 @@ "Rev": "3ac7bf7a47d159a033b107610db8a1b6575507a4" }, { - "ImportPath": "github.com/boltdb/bolt", - "Rev": "583e8937c61f1af6513608ccc75c97b6abdf4ff9" + "ImportPath": "github.com/cockroachdb/cmux", + "Rev": "112f0506e7743d64a6eb8fedbcff13d9979bbf92" + }, + { + "ImportPath": "github.com/coreos/bbolt", + "Rev": "48ea1b39c25fc1bab3506fbc712ecbaa842c4d2d" }, { "ImportPath": "github.com/coreos/etcd/alarm", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/auth", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/auth/authpb", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/client", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/clientv3", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/clientv3/concurrency", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/clientv3/namespace", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/clientv3/naming", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/compactor", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/discovery", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/embed", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/error", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/etcdserver", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/etcdserver/api", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/etcdhttp", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/etcdserver/api/v2http", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/etcdserver/api/v2http/httptypes", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3client", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3election", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3election/v3electionpb", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3election/v3electionpb/gw", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3lock", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3lock/v3lockpb", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3lock/v3lockpb/gw", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3rpc", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/etcdserver/auth", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/etcdserver/etcdserverpb", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/etcdserverpb/gw", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/etcdserver/membership", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/etcdserver/stats", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/integration", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/lease", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/lease/leasehttp", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/lease/leasepb", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/mvcc", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/mvcc/backend", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/mvcc/mvccpb", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/adt", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/contention", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/pkg/cors", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/cpuutil", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/crc", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/pkg/debugutil", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/fileutil", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/httputil", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/idutil", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/ioutil", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/logutil", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/monotime", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/netutil", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/pathutil", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/pbutil", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/runtime", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/schedule", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/pkg/srv", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/testutil", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/tlsutil", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/transport", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/types", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/pkg/wait", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/proxy/grpcproxy", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" + }, + { + "ImportPath": "github.com/coreos/etcd/proxy/grpcproxy/adapter", + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/proxy/grpcproxy/cache", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/raft", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/raft/raftpb", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/rafthttp", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/snap", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/snap/snappb", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/store", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/version", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/wal", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { "ImportPath": "github.com/coreos/etcd/wal/walpb", - "Rev": "0520cb9304cb2385f7e72b8bc02d6e4d3257158a" + "Rev": "95a726a27e09030f9ccbd9982a1508f5a6d25ada" }, { - "ImportPath": "github.com/coreos/go-oidc/http", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/jose", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/key", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/oauth2", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/oidc", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" + "ImportPath": "github.com/coreos/go-oidc", + "Rev": "065b426bd41667456c1a924468f507673629c46b" }, { "ImportPath": "github.com/coreos/go-semver/semver", @@ -290,22 +346,14 @@ "ImportPath": "github.com/coreos/pkg/capnslog", "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" }, - { - "ImportPath": "github.com/coreos/pkg/health", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" - }, - { - "ImportPath": "github.com/coreos/pkg/httputil", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" - }, - { - "ImportPath": "github.com/coreos/pkg/timeutil", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" - }, { "ImportPath": "github.com/davecgh/go-spew/spew", "Rev": "782f4967f2dc4564575ca782fe2d04090b5faca8" }, + { + "ImportPath": "github.com/dgrijalva/jwt-go", + "Rev": "01aeca54ebda6e0fbfafd0a524d234159c05ec20" + }, { "ImportPath": "github.com/elazarl/go-bindata-assetfs", "Rev": "3dcc96556217539f50599357fb481ac0dc7439b9" @@ -340,7 +388,7 @@ }, { "ImportPath": "github.com/go-openapi/spec", - "Rev": "7abd5745472fff5eb3685386d5fb8bf38683154d" + "Rev": "1de3e0542de65ad8d75452a595886fdd0befb363" }, { "ImportPath": "github.com/go-openapi/swag", @@ -358,6 +406,10 @@ "ImportPath": "github.com/golang/glog", "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" }, + { + "ImportPath": "github.com/golang/groupcache/lru", + "Rev": "02826c3e79038b59d737d3b1c0a1d937f71a4433" + }, { "ImportPath": "github.com/golang/protobuf/jsonpb", "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" @@ -366,6 +418,10 @@ "ImportPath": "github.com/golang/protobuf/proto", "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" }, + { + "ImportPath": "github.com/golang/protobuf/protoc-gen-go/descriptor", + "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" + }, { "ImportPath": "github.com/golang/protobuf/ptypes", "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" @@ -406,57 +462,21 @@ "ImportPath": "github.com/googleapis/gnostic/extensions", "Rev": "0c5108395e2debce0d731cf0287ddf7242066aba" }, - { - "ImportPath": "github.com/gophercloud/gophercloud", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/utils", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/pagination", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" - }, - { - "ImportPath": "github.com/gregjones/httpcache", - "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" - }, - { - "ImportPath": "github.com/gregjones/httpcache/diskcache", - "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" - }, { "ImportPath": "github.com/grpc-ecosystem/go-grpc-prometheus", "Rev": "2500245aa6110c562d17020fb31a2c133d737799" }, { "ImportPath": "github.com/grpc-ecosystem/grpc-gateway/runtime", - "Rev": "84398b94e188ee336f307779b57b3aa91af7063c" + "Rev": "8cc3a55af3bcf171a1c23a90c4df9cf591706104" }, { "ImportPath": "github.com/grpc-ecosystem/grpc-gateway/runtime/internal", - "Rev": "84398b94e188ee336f307779b57b3aa91af7063c" + "Rev": "8cc3a55af3bcf171a1c23a90c4df9cf591706104" }, { "ImportPath": "github.com/grpc-ecosystem/grpc-gateway/utilities", - "Rev": "84398b94e188ee336f307779b57b3aa91af7063c" + "Rev": "8cc3a55af3bcf171a1c23a90c4df9cf591706104" }, { "ImportPath": "github.com/hashicorp/golang-lru", @@ -480,15 +500,7 @@ }, { "ImportPath": "github.com/json-iterator/go", - "Rev": "36b14963da70d11297d313183d7e6388c8510e1e" - }, - { - "ImportPath": "github.com/juju/ratelimit", - "Rev": "5b9ff866471762aa2ab2dced63c9fb6f53921342" - }, - { - "ImportPath": "github.com/karlseguin/ccache", - "Rev": "3ba9789cfd2cb7b4fb4657efc994cc1c599a648c" + "Rev": "13f86432b882000a51c6e610c620974462691a97" }, { "ImportPath": "github.com/mailru/easyjson/buffer", @@ -506,22 +518,22 @@ "ImportPath": "github.com/matttproud/golang_protobuf_extensions/pbutil", "Rev": "fc2b8d3a73c4867e51861bbdd5ae3c1f0869dd6a" }, - { - "ImportPath": "github.com/mxk/go-flowrate/flowrate", - "Rev": "cca7078d478f8520f85629ad7c68962d31ed7682" - }, { "ImportPath": "github.com/pborman/uuid", "Rev": "ca53cad383cad2479bbba7f7a1a05797ec1386e4" }, - { - "ImportPath": "github.com/peterbourgon/diskv", - "Rev": "5f041e8faa004a95c88a202771f4cc3e991971e6" - }, { "ImportPath": "github.com/pmezard/go-difflib/difflib", "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" }, + { + "ImportPath": "github.com/pquerna/cachecontrol", + "Rev": "0dec1b30a0215bb68605dfc568e8855066c9202d" + }, + { + "ImportPath": "github.com/pquerna/cachecontrol/cacheobject", + "Rev": "0dec1b30a0215bb68605dfc568e8855066c9202d" + }, { "ImportPath": "github.com/prometheus/client_golang/prometheus", "Rev": "e7e903064f5e9eb5da98208bae10b475d4db0f8c" @@ -552,7 +564,7 @@ }, { "ImportPath": "github.com/spf13/pflag", - "Rev": "9ff6c6923cfffbcd502984b8e0c80539a94968b7" + "Rev": "4c012f6dcd9546820e378d0bdda4d8fc772cdfea" }, { "ImportPath": "github.com/stretchr/testify/assert", @@ -578,6 +590,14 @@ "ImportPath": "golang.org/x/crypto/blowfish", "Rev": "81e90905daefcd6fd217b62423c0908922eadb30" }, + { + "ImportPath": "golang.org/x/crypto/ed25519", + "Rev": "81e90905daefcd6fd217b62423c0908922eadb30" + }, + { + "ImportPath": "golang.org/x/crypto/ed25519/internal/edwards25519", + "Rev": "81e90905daefcd6fd217b62423c0908922eadb30" + }, { "ImportPath": "golang.org/x/crypto/nacl/secretbox", "Rev": "81e90905daefcd6fd217b62423c0908922eadb30" @@ -598,14 +618,6 @@ "ImportPath": "golang.org/x/net/context", "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" }, - { - "ImportPath": "golang.org/x/net/html", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/html/atom", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, { "ImportPath": "golang.org/x/net/http2", "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" @@ -634,6 +646,14 @@ "ImportPath": "golang.org/x/net/websocket", "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" }, + { + "ImportPath": "golang.org/x/oauth2", + "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" + }, + { + "ImportPath": "golang.org/x/oauth2/internal", + "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" + }, { "ImportPath": "golang.org/x/sys/unix", "Rev": "95c6576299259db960f6c5b9b69ea52422860fce" @@ -690,65 +710,85 @@ "ImportPath": "golang.org/x/time/rate", "Rev": "f51c12702a4d776e4c1fa9b0fabab841babae631" }, + { + "ImportPath": "google.golang.org/genproto/googleapis/api/annotations", + "Rev": "09f6ed296fc66555a25fe4ce95173148778dfa85" + }, { "ImportPath": "google.golang.org/genproto/googleapis/rpc/status", "Rev": "09f6ed296fc66555a25fe4ce95173148778dfa85" }, { "ImportPath": "google.golang.org/grpc", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + }, + { + "ImportPath": "google.golang.org/grpc/balancer", + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/codes", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + }, + { + "ImportPath": "google.golang.org/grpc/connectivity", + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/credentials", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { - "ImportPath": "google.golang.org/grpc/grpclb/grpc_lb_v1", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "ImportPath": "google.golang.org/grpc/grpclb/grpc_lb_v1/messages", + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/grpclog", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + }, + { + "ImportPath": "google.golang.org/grpc/health/grpc_health_v1", + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/internal", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/keepalive", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/metadata", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/naming", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/peer", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + }, + { + "ImportPath": "google.golang.org/grpc/resolver", + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/stats", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/status", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/tap", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "google.golang.org/grpc/transport", - "Rev": "d2e1b51f33ff8c5e4a15560ff049d200e83726c5" + "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" }, { "ImportPath": "gopkg.in/inf.v0", @@ -758,953 +798,1033 @@ "ImportPath": "gopkg.in/natefinch/lumberjack.v2", "Rev": "20b71e5b60d756d3d2f80def009790325acc2b23" }, + { + "ImportPath": "gopkg.in/square/go-jose.v2", + "Rev": "f8f38de21b4dcd69d0413faf231983f5fd6634b1" + }, + { + "ImportPath": "gopkg.in/square/go-jose.v2/cipher", + "Rev": "f8f38de21b4dcd69d0413faf231983f5fd6634b1" + }, + { + "ImportPath": "gopkg.in/square/go-jose.v2/json", + "Rev": "f8f38de21b4dcd69d0413faf231983f5fd6634b1" + }, { "ImportPath": "gopkg.in/yaml.v2", - "Rev": "53feefa2559fb8dfa8d81baad31be332c97d6c77" + "Rev": "670d4cfef0544295bc27a114dbac37980d83185a" }, { "ImportPath": "k8s.io/api/admission/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/admissionregistration/v1alpha1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/admissionregistration/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/apps/v1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/apps/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/apps/v1beta2", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authentication/v1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authentication/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authorization/v1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authorization/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/autoscaling/v1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/autoscaling/v2beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/batch/v1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/batch/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/batch/v2alpha1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/certificates/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/core/v1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/events/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/extensions/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/networking/v1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/policy/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/rbac/v1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/rbac/v1alpha1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/rbac/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/scheduling/v1alpha1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/settings/v1alpha1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/storage/v1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/storage/v1alpha1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/storage/v1beta1", - "Rev": "006a217681ae70cbacdd66a5e2fca1a61a8ff28e" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/equality", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/errors", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/testing", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/validation", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/validation/path", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/validation", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/cache", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/clock", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/proxy", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/rand", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/uuid", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/waitgroup", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/version", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "68f9c3a1feb3140df59c67ced62d3a5df8e6c9c2" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/client-go/discovery", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/discovery/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" - }, - { - "ImportPath": "k8s.io/client-go/informers", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/admissionregistration", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/admissionregistration/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/admissionregistration/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/apps", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/apps/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/apps/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/apps/v1beta2", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/autoscaling", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/autoscaling/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/batch", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/batch/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/batch/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/batch/v2alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/certificates", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/certificates/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/core", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/core/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/events", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/events/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/extensions", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/extensions/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/internalinterfaces", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/networking", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/networking/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/policy", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/policy/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/rbac", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/rbac/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/rbac/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/rbac/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/scheduling", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/scheduling/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/settings", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/settings/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/storage", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/storage/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/storage/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/informers/storage/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/scheme", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta2", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v2alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/certificates/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/core/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/core/v1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/events/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/events/v1beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/extensions/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/networking/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/networking/v1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/policy/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/settings/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/admissionregistration/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/admissionregistration/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/apps/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/apps/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/apps/v1beta2", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/autoscaling/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/batch/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/batch/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/batch/v2alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/certificates/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/core/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/events/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/extensions/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/networking/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/policy/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/rbac/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/rbac/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/rbac/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/scheduling/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/settings/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/storage/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/storage/v1alpha1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/listers/storage/v1beta1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/pkg/apis/clientauthentication", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/pkg/version", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/plugin/pkg/client/auth/exec", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/rest", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/rest/watch", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/testing", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/tools/auth", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/tools/cache", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" - }, - { - "ImportPath": "k8s.io/client-go/tools/clientcmd", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/tools/clientcmd/api", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/tools/clientcmd/api/latest", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/tools/clientcmd/api/v1", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/tools/metrics", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/tools/pager", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/tools/reference", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/transport", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/util/cert", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/util/flowcontrol", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/util/homedir", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "9389c055a838d4f208b699b3c7c51b70f2368861" + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/util/retry", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" + "Rev": "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" + "Rev": "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" + "Rev": "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" + "Rev": "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" + "Rev": "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" + }, + { + "ImportPath": "k8s.io/client-go/discovery", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/informers", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/informers/admissionregistration/v1beta1", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/kubernetes", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/kubernetes/fake", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/kubernetes/scheme", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1beta1", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1beta1", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/kubernetes/typed/core/v1", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/listers/admissionregistration/v1beta1", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/listers/core/v1", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/rest", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/testing", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/tools/cache", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/tools/clientcmd", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/tools/clientcmd/api", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/tools/clientcmd/api/v1", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/util/cert", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" + }, + { + "ImportPath": "k8s.io/client-go/util/flowcontrol", + "Rev": "23781f4d6632d88e869066eaebb743857aa1ef9b" } ] } diff --git a/vendor/k8s.io/apiserver/Godeps/OWNERS b/vendor/k8s.io/apiserver/Godeps/OWNERS new file mode 100644 index 000000000..ca3bdf4cc --- /dev/null +++ b/vendor/k8s.io/apiserver/Godeps/OWNERS @@ -0,0 +1,4 @@ +reviewers: +- dep-reviewers +approvers: +- dep-approvers diff --git a/vendor/k8s.io/apiserver/OWNERS b/vendor/k8s.io/apiserver/OWNERS index 52f250446..bc61d5ffa 100644 --- a/vendor/k8s.io/apiserver/OWNERS +++ b/vendor/k8s.io/apiserver/OWNERS @@ -14,5 +14,4 @@ reviewers: - sttts - ncdc - tallclair -- timothysc - enj diff --git a/vendor/k8s.io/apiserver/README.md b/vendor/k8s.io/apiserver/README.md index 96927ae70..130ba87de 100644 --- a/vendor/k8s.io/apiserver/README.md +++ b/vendor/k8s.io/apiserver/README.md @@ -25,6 +25,6 @@ Code changes are made in that location, merged into `k8s.io/kubernetes` and late ## Things you should *NOT* do - 1. Directly modify any files under `pkg` in this repo. Those are driven from `k8s.io/kuberenetes/staging/src/k8s.io/apiserver`. + 1. Directly modify any files under `pkg` in this repo. Those are driven from `k8s.io/kubernetes/staging/src/k8s.io/apiserver`. 2. Expect compatibility. This repo is changing quickly in direct support of Kubernetes and the API isn't yet stable enough for API guarantees. diff --git a/vendor/k8s.io/apiserver/code-of-conduct.md b/vendor/k8s.io/apiserver/code-of-conduct.md new file mode 100644 index 000000000..0d15c00cf --- /dev/null +++ b/vendor/k8s.io/apiserver/code-of-conduct.md @@ -0,0 +1,3 @@ +# Kubernetes Community Code of Conduct + +Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/k8s.io/apiserver/hack/godep-deps.sh b/vendor/k8s.io/apiserver/hack/godep-deps.sh deleted file mode 100755 index d3341292d..000000000 --- a/vendor/k8s.io/apiserver/hack/godep-deps.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# overall flow -# 1. make a clean gopath -# 2. godep restore based on k8s.io/kuberentes provided manifest -# 3. go get anything unlisted. This handles deps from k8s.io/* -# 4. remove old vendoring data -# 5. vendor packages we need -# 6. remove anything vendored from k8s.io/* from vendor, but not manifest. -# This allows go get to work and still be able to flatten dependencies. -# 6. copy new vendored packages and save them - -set -o errexit -set -o nounset -set -o pipefail - -goPath=$(mktemp -d "${TMPDIR:-/tmp/}$(basename 0).XXXXXXXXXXXX") -echo ${goPath} - -export GOPATH=${goPath} - -mkdir -p ${goPath}/src/k8s.io/apiserver -cp -R . ${goPath}/src/k8s.io/apiserver - -pushd ${goPath}/src/k8s.io/apiserver -rm -rf vendor || true - -# restore what we have in our new manifest that we've sync -godep restore - -# we have to some crazy schenanigans for client-go until it can keep its syncs up to date -# we have to restore its old/bad deps -go get -d k8s.io/client-go/... || true -pushd ${goPath}/src/k8s.io/client-go -godep restore -rm -rf ${goPath}/src/k8s.io/apimachinery -popd - -# the manifest doesn't include any levels of k8s.io dependencies so load them using the go get -# assume you sync all the repos at the same time, the leves you get will be correct -go get -d ./... || true - - -# save the new levels of dependencies -rm -rf vendor || true -rm -rf Godeps || true -godep save ./... - -# remove the vendored k8s.io/* go files -rm -rf vendor/k8s.io -popd - -# remove the vendor dir we have and move the one we just made -rm -rf vendor || true -rm -rf Godeps || true -git rm -rf vendor || true -git rm -rf Godeps || true -mv ${goPath}/src/k8s.io/apiserver/vendor . -mv ${goPath}/src/k8s.io/apiserver/Godeps . -git add vendor -git add Godeps -git commit -m "sync: resync vendor folder" - diff --git a/vendor/k8s.io/apiserver/hack/sync-from-kubernetes.sh b/vendor/k8s.io/apiserver/hack/sync-from-kubernetes.sh deleted file mode 100755 index 17ec6de2b..000000000 --- a/vendor/k8s.io/apiserver/hack/sync-from-kubernetes.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# overall flow -# 1. fetch the current level of k8s.io/kubernetes -# 2. check out the k8s.io/kubernetes HEAD into a separate branch -# 3. rewrite the history on that branch to *only* include staging/src/k8s.io/apiserver -# 4. locate all commits between the last time we sync'ed and now -# 5. switch back to the starting branch -# 6. for each commit, cherry-pick it (which will keep authorship) into current branch -# 7. update metadata files indicating which commits we've sync'ed to - -set -e - -ROOT=$(dirname "${BASH_SOURCE}")/.. -dir=$(mktemp -d "${TMPDIR:-/tmp/}$(basename 0).XXXXXXXXXXXX") - -git remote add upstream-kube git@github.com:kubernetes/kubernetes.git || true -git fetch upstream-kube - -currBranch=$(git rev-parse --abbrev-ref HEAD) -previousKubeSHA=$(cat kubernetes-sha) -previousBranchSHA=$(cat filter-branch-sha) - -git branch -D kube-sync || true -git checkout upstream-kube/master -b kube-sync -git reset --hard upstream-kube/master -newKubeSHA=$(git log --oneline --format='%H' kube-sync -1) - -# this command rewrite git history to *only* include staging/src/k8s.io/apiserver -git filter-branch -f --subdirectory-filter staging/src/k8s.io/apiserver HEAD - -newBranchSHA=$(git log --oneline --format='%H' kube-sync -1) -git log --no-merges --format='%H' --reverse ${previousBranchSHA}..HEAD > ${dir}/commits - -git checkout ${currBranch} - -# we must reset Godeps.json to what it looked like BEFORE the last vendor sync so that any -# new Godep.json changes from k8s.io/kubernetes will apply cleanly. Since its always auto-generated -# it doesn't matter that we're removing it -lastResyncCommit=$(git rev-list -n 1 --grep "sync: resync vendor folder" HEAD) -cleanGodepJsonCommit=$(git rev-list -n 1 ${lastResyncCommit}^) -git checkout ${cleanGodepJsonCommit} Godeps/Godeps.json -git commit -m "sync: reset Godeps.json" -- Godeps/Godeps.json - -while read commitSHA; do - echo "working ${commitSHA}" - git cherry-pick ${commitSHA} -done <${dir}/commits - -# update the vendored godeps -${ROOT}/hack/godep-deps.sh - -# track the k8s.io/kubernetes commit SHA so we can always determine which level of kube this repo matches -# track the filtered branch commit SHA so that we can determine which commits need to be picked -echo ${newKubeSHA} > kubernetes-sha -echo ${newBranchSHA} > filter-branch-sha -git commit -m "sync(k8s.io/kubernetes): ${newKubeSHA}" -- kubernetes-sha filter-branch-sha - diff --git a/vendor/k8s.io/apiserver/pkg/admission/BUILD b/vendor/k8s.io/apiserver/pkg/admission/BUILD index 65542c020..78aed4c7e 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/BUILD @@ -14,12 +14,12 @@ go_test( "errors_test.go", "handler_test.go", ], - importpath = "k8s.io/apiserver/pkg/admission", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/json:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/apiserver:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1:go_default_library", ], @@ -31,6 +31,7 @@ go_library( "attributes.go", "chain.go", "config.go", + "decorator.go", "errors.go", "handler.go", "interfaces.go", diff --git a/vendor/k8s.io/apiserver/pkg/admission/config.go b/vendor/k8s.io/apiserver/pkg/admission/config.go index 72da98fe2..f59d0608b 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/config.go +++ b/vendor/k8s.io/apiserver/pkg/admission/config.go @@ -17,6 +17,7 @@ limitations under the License. package admission import ( + "bytes" "fmt" "io" "io/ioutil" @@ -27,10 +28,7 @@ import ( "github.com/ghodss/yaml" "github.com/golang/glog" - "bytes" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apiserver/pkg/apis/apiserver" @@ -96,6 +94,18 @@ func ReadAdmissionConfiguration(pluginNames []string, configFilePath string, con if !(runtime.IsMissingVersion(err) || runtime.IsMissingKind(err) || runtime.IsNotRegisteredError(err)) { return nil, err } + + // Only tolerate load errors if the file appears to be one of the two legacy plugin configs + unstructuredData := map[string]interface{}{} + if err2 := yaml.Unmarshal(data, &unstructuredData); err2 != nil { + return nil, err + } + _, isLegacyImagePolicy := unstructuredData["imagePolicy"] + _, isLegacyPodNodeSelector := unstructuredData["podNodeSelectorPluginConfig"] + if !isLegacyImagePolicy && !isLegacyPodNodeSelector { + return nil, err + } + // convert the legacy format to the new admission control format // in order to preserve backwards compatibility, we set plugins that // previously read input from a non-versioned file configuration to the @@ -127,16 +137,10 @@ type configProvider struct { } // GetAdmissionPluginConfigurationFor returns a reader that holds the admission plugin configuration. -func GetAdmissionPluginConfigurationFor(pluginCfg apiserver.AdmissionPluginConfiguration, scheme *runtime.Scheme) (io.Reader, error) { - // if there is nothing nested in the object, we return the named location - obj := pluginCfg.Configuration - if obj != nil { - // serialize the configuration and build a reader for it - content, err := writeYAML(obj, scheme) - if err != nil { - return nil, err - } - return bytes.NewBuffer(content), nil +func GetAdmissionPluginConfigurationFor(pluginCfg apiserver.AdmissionPluginConfiguration) (io.Reader, error) { + // if there is a nest object, return it directly + if pluginCfg.Configuration != nil { + return bytes.NewBuffer(pluginCfg.Configuration.Raw), nil } // there is nothing nested, so we delegate to path if pluginCfg.Path != "" { @@ -151,8 +155,8 @@ func GetAdmissionPluginConfigurationFor(pluginCfg apiserver.AdmissionPluginConfi return nil, nil } -// GetAdmissionPluginConfiguration takes the admission configuration and returns a reader -// for the specified plugin. If no specific configuration is present, we return a nil reader. +// ConfigFor returns a reader for the specified plugin. +// If no specific configuration is present, we return a nil reader. func (p configProvider) ConfigFor(pluginName string) (io.Reader, error) { // there is no config, so there is no potential config if p.config == nil { @@ -163,7 +167,7 @@ func (p configProvider) ConfigFor(pluginName string) (io.Reader, error) { if pluginName != pluginCfg.Name { continue } - pluginConfig, err := GetAdmissionPluginConfigurationFor(pluginCfg, p.scheme) + pluginConfig, err := GetAdmissionPluginConfigurationFor(pluginCfg) if err != nil { return nil, err } @@ -172,26 +176,3 @@ func (p configProvider) ConfigFor(pluginName string) (io.Reader, error) { // there is no registered config that matches on plugin name. return nil, nil } - -// writeYAML writes the specified object to a byte array as yaml. -func writeYAML(obj runtime.Object, scheme *runtime.Scheme) ([]byte, error) { - gvks, _, err := scheme.ObjectKinds(obj) - if err != nil { - return nil, err - } - gvs := []schema.GroupVersion{} - for _, gvk := range gvks { - gvs = append(gvs, gvk.GroupVersion()) - } - codecs := serializer.NewCodecFactory(scheme) - json, err := runtime.Encode(codecs.LegacyCodec(gvs...), obj) - if err != nil { - return nil, err - } - - content, err := yaml.JSONToYAML(json) - if err != nil { - return nil, err - } - return content, err -} diff --git a/vendor/k8s.io/apiserver/pkg/admission/config_test.go b/vendor/k8s.io/apiserver/pkg/admission/config_test.go index debde2463..459a2093e 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/config_test.go +++ b/vendor/k8s.io/apiserver/pkg/admission/config_test.go @@ -23,8 +23,8 @@ import ( "testing" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/json" "k8s.io/apiserver/pkg/apis/apiserver" - apiserverapi "k8s.io/apiserver/pkg/apis/apiserver" apiserverapiv1alpha1 "k8s.io/apiserver/pkg/apis/apiserver/v1alpha1" ) @@ -49,7 +49,7 @@ func TestReadAdmissionConfiguration(t *testing.T) { ExpectedAdmissionConfig *apiserver.AdmissionConfiguration PluginNames []string }{ - "v1Alpha1 configuration - path fixup": { + "v1alpha1 configuration - path fixup": { ConfigBody: `{ "apiVersion": "apiserver.k8s.io/v1alpha1", "kind": "AdmissionConfiguration", @@ -70,7 +70,7 @@ func TestReadAdmissionConfiguration(t *testing.T) { }, PluginNames: []string{}, }, - "v1Alpha1 configuration - abspath": { + "v1alpha1 configuration - abspath": { ConfigBody: `{ "apiVersion": "apiserver.k8s.io/v1alpha1", "kind": "AdmissionConfiguration", @@ -137,7 +137,7 @@ func TestReadAdmissionConfiguration(t *testing.T) { } scheme := runtime.NewScheme() - apiserverapi.AddToScheme(scheme) + apiserver.AddToScheme(scheme) apiserverapiv1alpha1.AddToScheme(scheme) for testName, testCase := range testCases { @@ -153,3 +153,98 @@ func TestReadAdmissionConfiguration(t *testing.T) { } } } + +func TestEmbeddedConfiguration(t *testing.T) { + // create a place holder file to hold per test config + configFile, err := ioutil.TempFile("", "admission-plugin-config") + if err != nil { + t.Fatalf("unexpected err: %v", err) + } + if err = configFile.Close(); err != nil { + t.Fatalf("unexpected err: %v", err) + } + configFileName := configFile.Name() + + testCases := map[string]struct { + ConfigBody string + ExpectedConfig string + }{ + "versioned configuration": { + ConfigBody: `{ + "apiVersion": "apiserver.k8s.io/v1alpha1", + "kind": "AdmissionConfiguration", + "plugins": [ + { + "name": "Foo", + "configuration": { + "apiVersion": "foo.admission.k8s.io/v1alpha1", + "kind": "Configuration", + "foo": "bar" + } + } + ]}`, + ExpectedConfig: `{ + "apiVersion": "foo.admission.k8s.io/v1alpha1", + "kind": "Configuration", + "foo": "bar" + }`, + }, + "legacy configuration": { + ConfigBody: `{ + "apiVersion": "apiserver.k8s.io/v1alpha1", + "kind": "AdmissionConfiguration", + "plugins": [ + { + "name": "Foo", + "configuration": { + "foo": "bar" + } + } + ]}`, + ExpectedConfig: `{ + "foo": "bar" + }`, + }, + } + + for desc, test := range testCases { + scheme := runtime.NewScheme() + apiserver.AddToScheme(scheme) + apiserverapiv1alpha1.AddToScheme(scheme) + + if err = ioutil.WriteFile(configFileName, []byte(test.ConfigBody), 0644); err != nil { + t.Errorf("[%s] unexpected err writing temp file: %v", desc, err) + continue + } + config, err := ReadAdmissionConfiguration([]string{"Foo"}, configFileName, scheme) + if err != nil { + t.Errorf("[%s] unexpected err: %v", desc, err) + continue + } + r, err := config.ConfigFor("Foo") + if err != nil { + t.Errorf("[%s] Failed to get Foo config: %v", desc, err) + continue + } + bs, err := ioutil.ReadAll(r) + if err != nil { + t.Errorf("[%s] Failed to read Foo config data: %v", desc, err) + continue + } + + if !equalJSON(test.ExpectedConfig, string(bs)) { + t.Errorf("Unexpected config: expected=%q got=%q", test.ExpectedConfig, string(bs)) + } + } +} + +func equalJSON(a, b string) bool { + var x, y interface{} + if err := json.Unmarshal([]byte(a), &x); err != nil { + return false + } + if err := json.Unmarshal([]byte(b), &y); err != nil { + return false + } + return reflect.DeepEqual(x, y) +} diff --git a/vendor/k8s.io/apiserver/pkg/admission/configuration/BUILD b/vendor/k8s.io/apiserver/pkg/admission/configuration/BUILD index d6d2f3ee1..95d8f6545 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/configuration/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/configuration/BUILD @@ -14,16 +14,18 @@ go_test( "mutating_webhook_manager_test.go", "validating_webhook_manager_test.go", ], - importpath = "k8s.io/apiserver/pkg/admission/configuration", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/admissionregistration/v1alpha1:go_default_library", "//vendor/k8s.io/api/admissionregistration/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", + "//vendor/k8s.io/client-go/listers/admissionregistration/v1beta1:go_default_library", + "//vendor/k8s.io/client-go/tools/cache:go_default_library", ], ) @@ -42,8 +44,13 @@ go_library( "//vendor/k8s.io/api/admissionregistration/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", + "//vendor/k8s.io/client-go/informers/admissionregistration/v1beta1:go_default_library", + "//vendor/k8s.io/client-go/listers/admissionregistration/v1beta1:go_default_library", + "//vendor/k8s.io/client-go/tools/cache:go_default_library", ], ) diff --git a/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager.go b/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager.go index bf4d0eabf..3c0990699 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager.go +++ b/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager.go @@ -18,84 +18,70 @@ package configuration import ( "fmt" - "reflect" "sort" - - "github.com/golang/glog" + "sync/atomic" "k8s.io/api/admissionregistration/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/labels" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + admissionregistrationinformers "k8s.io/client-go/informers/admissionregistration/v1beta1" + admissionregistrationlisters "k8s.io/client-go/listers/admissionregistration/v1beta1" + "k8s.io/client-go/tools/cache" ) -type MutatingWebhookConfigurationLister interface { - List(opts metav1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error) -} - // MutatingWebhookConfigurationManager collects the mutating webhook objects so that they can be called. type MutatingWebhookConfigurationManager struct { - *poller + configuration *atomic.Value + lister admissionregistrationlisters.MutatingWebhookConfigurationLister } -func NewMutatingWebhookConfigurationManager(c MutatingWebhookConfigurationLister) *MutatingWebhookConfigurationManager { - getFn := func() (runtime.Object, error) { - list, err := c.List(metav1.ListOptions{}) - if err != nil { - if errors.IsNotFound(err) || errors.IsForbidden(err) { - glog.V(5).Infof("MutatingWebhookConfiguration are disabled due to an error: %v", err) - return nil, ErrDisabled - } - return nil, err - } - return mergeMutatingWebhookConfigurations(list), nil +func NewMutatingWebhookConfigurationManager(informer admissionregistrationinformers.MutatingWebhookConfigurationInformer) *MutatingWebhookConfigurationManager { + manager := &MutatingWebhookConfigurationManager{ + configuration: &atomic.Value{}, + lister: informer.Lister(), } - return &MutatingWebhookConfigurationManager{ - newPoller(getFn), - } + // Start with an empty list + manager.configuration.Store(&v1beta1.MutatingWebhookConfiguration{}) + + // On any change, rebuild the config + informer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(_ interface{}) { manager.updateConfiguration() }, + UpdateFunc: func(_, _ interface{}) { manager.updateConfiguration() }, + DeleteFunc: func(_ interface{}) { manager.updateConfiguration() }, + }) + + return manager } // Webhooks returns the merged MutatingWebhookConfiguration. -func (im *MutatingWebhookConfigurationManager) Webhooks() (*v1beta1.MutatingWebhookConfiguration, error) { - configuration, err := im.poller.configuration() - if err != nil { - return nil, err - } - mutatingWebhookConfiguration, ok := configuration.(*v1beta1.MutatingWebhookConfiguration) - if !ok { - return nil, fmt.Errorf("expected type %v, got type %v", reflect.TypeOf(mutatingWebhookConfiguration), reflect.TypeOf(configuration)) - } - return mutatingWebhookConfiguration, nil +func (m *MutatingWebhookConfigurationManager) Webhooks() *v1beta1.MutatingWebhookConfiguration { + return m.configuration.Load().(*v1beta1.MutatingWebhookConfiguration) } -func (im *MutatingWebhookConfigurationManager) Run(stopCh <-chan struct{}) { - im.poller.Run(stopCh) +func (m *MutatingWebhookConfigurationManager) updateConfiguration() { + configurations, err := m.lister.List(labels.Everything()) + if err != nil { + utilruntime.HandleError(fmt.Errorf("error updating configuration: %v", err)) + return + } + m.configuration.Store(mergeMutatingWebhookConfigurations(configurations)) } -func mergeMutatingWebhookConfigurations( - list *v1beta1.MutatingWebhookConfigurationList, -) *v1beta1.MutatingWebhookConfiguration { - configurations := append([]v1beta1.MutatingWebhookConfiguration{}, list.Items...) +func mergeMutatingWebhookConfigurations(configurations []*v1beta1.MutatingWebhookConfiguration) *v1beta1.MutatingWebhookConfiguration { var ret v1beta1.MutatingWebhookConfiguration // The internal order of webhooks for each configuration is provided by the user // but configurations themselves can be in any order. As we are going to run these // webhooks in serial, they are sorted here to have a deterministic order. - sort.Sort(byName(configurations)) + sort.SliceStable(configurations, MutatingWebhookConfigurationSorter(configurations).ByName) for _, c := range configurations { ret.Webhooks = append(ret.Webhooks, c.Webhooks...) } return &ret } -// byName sorts MutatingWebhookConfiguration by name. These objects are all in -// cluster namespace (aka no namespace) thus they all have unique names. -type byName []v1beta1.MutatingWebhookConfiguration - -func (x byName) Len() int { return len(x) } - -func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +type MutatingWebhookConfigurationSorter []*v1beta1.MutatingWebhookConfiguration -func (x byName) Less(i, j int) bool { - return x[i].ObjectMeta.Name < x[j].ObjectMeta.Name +func (a MutatingWebhookConfigurationSorter) ByName(i, j int) bool { + return a[i].Name < a[j].Name } diff --git a/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager_test.go b/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager_test.go index 97333880b..d6f4f1a45 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager_test.go +++ b/vendor/k8s.io/apiserver/pkg/admission/configuration/mutating_webhook_manager_test.go @@ -17,24 +17,107 @@ limitations under the License. package configuration import ( + "fmt" + "reflect" "testing" + "time" "k8s.io/api/admissionregistration/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/labels" + admissionregistrationlisters "k8s.io/client-go/listers/admissionregistration/v1beta1" + "k8s.io/client-go/tools/cache" ) -type disabledMutatingWebhookConfigLister struct{} +type fakeMutatingWebhookConfigSharedInformer struct { + informer *fakeMutatingWebhookConfigInformer + lister *fakeMutatingWebhookConfigLister +} + +func (f *fakeMutatingWebhookConfigSharedInformer) Informer() cache.SharedIndexInformer { + return f.informer +} +func (f *fakeMutatingWebhookConfigSharedInformer) Lister() admissionregistrationlisters.MutatingWebhookConfigurationLister { + return f.lister +} + +type fakeMutatingWebhookConfigInformer struct { + eventHandler cache.ResourceEventHandler +} + +func (f *fakeMutatingWebhookConfigInformer) AddEventHandler(handler cache.ResourceEventHandler) { + fmt.Println("added handler") + f.eventHandler = handler +} +func (f *fakeMutatingWebhookConfigInformer) AddEventHandlerWithResyncPeriod(handler cache.ResourceEventHandler, resyncPeriod time.Duration) { + panic("unsupported") +} +func (f *fakeMutatingWebhookConfigInformer) GetStore() cache.Store { + panic("unsupported") +} +func (f *fakeMutatingWebhookConfigInformer) GetController() cache.Controller { + panic("unsupported") +} +func (f *fakeMutatingWebhookConfigInformer) Run(stopCh <-chan struct{}) { + panic("unsupported") +} +func (f *fakeMutatingWebhookConfigInformer) HasSynced() bool { + panic("unsupported") +} +func (f *fakeMutatingWebhookConfigInformer) LastSyncResourceVersion() string { + panic("unsupported") +} +func (f *fakeMutatingWebhookConfigInformer) AddIndexers(indexers cache.Indexers) error { + panic("unsupported") +} +func (f *fakeMutatingWebhookConfigInformer) GetIndexer() cache.Indexer { panic("unsupported") } + +type fakeMutatingWebhookConfigLister struct { + list []*v1beta1.MutatingWebhookConfiguration + err error +} -func (l *disabledMutatingWebhookConfigLister) List(options metav1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error) { - return nil, errors.NewNotFound(schema.GroupResource{Group: "admissionregistration", Resource: "MutatingWebhookConfigurations"}, "") +func (f *fakeMutatingWebhookConfigLister) List(selector labels.Selector) (ret []*v1beta1.MutatingWebhookConfiguration, err error) { + return f.list, f.err } -func TestMutatingWebhookConfigDisabled(t *testing.T) { - manager := NewMutatingWebhookConfigurationManager(&disabledMutatingWebhookConfigLister{}) - manager.sync() - _, err := manager.Webhooks() - if err.Error() != ErrDisabled.Error() { - t.Errorf("expected %v, got %v", ErrDisabled, err) + +func (f *fakeMutatingWebhookConfigLister) Get(name string) (*v1beta1.MutatingWebhookConfiguration, error) { + panic("unsupported") +} + +func TestGetMutatingWebhookConfig(t *testing.T) { + informer := &fakeMutatingWebhookConfigSharedInformer{ + informer: &fakeMutatingWebhookConfigInformer{}, + lister: &fakeMutatingWebhookConfigLister{}, + } + + // no configurations + informer.lister.list = nil + manager := NewMutatingWebhookConfigurationManager(informer) + if configurations := manager.Webhooks(); len(configurations.Webhooks) != 0 { + t.Errorf("expected empty webhooks, but got %v", configurations.Webhooks) + } + + // list err + webhookConfiguration := &v1beta1.MutatingWebhookConfiguration{ + ObjectMeta: metav1.ObjectMeta{Name: "webhook1"}, + Webhooks: []v1beta1.Webhook{{Name: "webhook1.1"}}, + } + informer.lister.list = []*v1beta1.MutatingWebhookConfiguration{webhookConfiguration.DeepCopy()} + informer.lister.err = fmt.Errorf("mutating webhook configuration list error") + informer.informer.eventHandler.OnAdd(webhookConfiguration.DeepCopy()) + if configurations := manager.Webhooks(); len(configurations.Webhooks) != 0 { + t.Errorf("expected empty webhooks, but got %v", configurations.Webhooks) + } + + // configuration populated + informer.lister.err = nil + informer.informer.eventHandler.OnAdd(webhookConfiguration.DeepCopy()) + configurations := manager.Webhooks() + if len(configurations.Webhooks) == 0 { + t.Errorf("expected non empty webhooks") + } + if !reflect.DeepEqual(configurations.Webhooks, webhookConfiguration.Webhooks) { + t.Errorf("Expected\n%#v\ngot\n%#v", webhookConfiguration.Webhooks, configurations.Webhooks) } } diff --git a/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager.go b/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager.go index 8f9fd34da..33644f57f 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager.go +++ b/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager.go @@ -18,67 +18,69 @@ package configuration import ( "fmt" - "reflect" - - "github.com/golang/glog" + "sort" + "sync/atomic" "k8s.io/api/admissionregistration/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/labels" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + admissionregistrationinformers "k8s.io/client-go/informers/admissionregistration/v1beta1" + admissionregistrationlisters "k8s.io/client-go/listers/admissionregistration/v1beta1" + "k8s.io/client-go/tools/cache" ) -type ValidatingWebhookConfigurationLister interface { - List(opts metav1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error) -} - // ValidatingWebhookConfigurationManager collects the validating webhook objects so that they can be called. type ValidatingWebhookConfigurationManager struct { - *poller + configuration *atomic.Value + lister admissionregistrationlisters.ValidatingWebhookConfigurationLister } -func NewValidatingWebhookConfigurationManager(c ValidatingWebhookConfigurationLister) *ValidatingWebhookConfigurationManager { - getFn := func() (runtime.Object, error) { - list, err := c.List(metav1.ListOptions{}) - if err != nil { - if errors.IsNotFound(err) || errors.IsForbidden(err) { - glog.V(5).Infof("ValidatingWebhookConfiguration are disabled due to an error: %v", err) - return nil, ErrDisabled - } - return nil, err - } - return mergeValidatingWebhookConfigurations(list), nil +func NewValidatingWebhookConfigurationManager(informer admissionregistrationinformers.ValidatingWebhookConfigurationInformer) *ValidatingWebhookConfigurationManager { + manager := &ValidatingWebhookConfigurationManager{ + configuration: &atomic.Value{}, + lister: informer.Lister(), } - return &ValidatingWebhookConfigurationManager{ - newPoller(getFn), - } + // Start with an empty list + manager.configuration.Store(&v1beta1.ValidatingWebhookConfiguration{}) + + // On any change, rebuild the config + informer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(_ interface{}) { manager.updateConfiguration() }, + UpdateFunc: func(_, _ interface{}) { manager.updateConfiguration() }, + DeleteFunc: func(_ interface{}) { manager.updateConfiguration() }, + }) + + return manager } // Webhooks returns the merged ValidatingWebhookConfiguration. -func (im *ValidatingWebhookConfigurationManager) Webhooks() (*v1beta1.ValidatingWebhookConfiguration, error) { - configuration, err := im.poller.configuration() - if err != nil { - return nil, err - } - validatingWebhookConfiguration, ok := configuration.(*v1beta1.ValidatingWebhookConfiguration) - if !ok { - return nil, fmt.Errorf("expected type %v, got type %v", reflect.TypeOf(validatingWebhookConfiguration), reflect.TypeOf(configuration)) - } - return validatingWebhookConfiguration, nil +func (v *ValidatingWebhookConfigurationManager) Webhooks() *v1beta1.ValidatingWebhookConfiguration { + return v.configuration.Load().(*v1beta1.ValidatingWebhookConfiguration) } -func (im *ValidatingWebhookConfigurationManager) Run(stopCh <-chan struct{}) { - im.poller.Run(stopCh) +func (v *ValidatingWebhookConfigurationManager) updateConfiguration() { + configurations, err := v.lister.List(labels.Everything()) + if err != nil { + utilruntime.HandleError(fmt.Errorf("error updating configuration: %v", err)) + return + } + v.configuration.Store(mergeValidatingWebhookConfigurations(configurations)) } func mergeValidatingWebhookConfigurations( - list *v1beta1.ValidatingWebhookConfigurationList, + configurations []*v1beta1.ValidatingWebhookConfiguration, ) *v1beta1.ValidatingWebhookConfiguration { - configurations := list.Items + sort.SliceStable(configurations, ValidatingWebhookConfigurationSorter(configurations).ByName) var ret v1beta1.ValidatingWebhookConfiguration for _, c := range configurations { ret.Webhooks = append(ret.Webhooks, c.Webhooks...) } return &ret } + +type ValidatingWebhookConfigurationSorter []*v1beta1.ValidatingWebhookConfiguration + +func (a ValidatingWebhookConfigurationSorter) ByName(i, j int) bool { + return a[i].Name < a[j].Name +} diff --git a/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager_test.go b/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager_test.go index 60ba53673..6505b2b9b 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager_test.go +++ b/vendor/k8s.io/apiserver/pkg/admission/configuration/validating_webhook_manager_test.go @@ -17,24 +17,107 @@ limitations under the License. package configuration import ( + "fmt" + "reflect" "testing" + "time" "k8s.io/api/admissionregistration/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/labels" + admissionregistrationlisters "k8s.io/client-go/listers/admissionregistration/v1beta1" + "k8s.io/client-go/tools/cache" ) -type disabledValidatingWebhookConfigLister struct{} +type fakeValidatingWebhookConfigSharedInformer struct { + informer *fakeValidatingWebhookConfigInformer + lister *fakeValidatingWebhookConfigLister +} + +func (f *fakeValidatingWebhookConfigSharedInformer) Informer() cache.SharedIndexInformer { + return f.informer +} +func (f *fakeValidatingWebhookConfigSharedInformer) Lister() admissionregistrationlisters.ValidatingWebhookConfigurationLister { + return f.lister +} + +type fakeValidatingWebhookConfigInformer struct { + eventHandler cache.ResourceEventHandler +} + +func (f *fakeValidatingWebhookConfigInformer) AddEventHandler(handler cache.ResourceEventHandler) { + fmt.Println("added handler") + f.eventHandler = handler +} +func (f *fakeValidatingWebhookConfigInformer) AddEventHandlerWithResyncPeriod(handler cache.ResourceEventHandler, resyncPeriod time.Duration) { + panic("unsupported") +} +func (f *fakeValidatingWebhookConfigInformer) GetStore() cache.Store { + panic("unsupported") +} +func (f *fakeValidatingWebhookConfigInformer) GetController() cache.Controller { + panic("unsupported") +} +func (f *fakeValidatingWebhookConfigInformer) Run(stopCh <-chan struct{}) { + panic("unsupported") +} +func (f *fakeValidatingWebhookConfigInformer) HasSynced() bool { + panic("unsupported") +} +func (f *fakeValidatingWebhookConfigInformer) LastSyncResourceVersion() string { + panic("unsupported") +} +func (f *fakeValidatingWebhookConfigInformer) AddIndexers(indexers cache.Indexers) error { + panic("unsupported") +} +func (f *fakeValidatingWebhookConfigInformer) GetIndexer() cache.Indexer { panic("unsupported") } + +type fakeValidatingWebhookConfigLister struct { + list []*v1beta1.ValidatingWebhookConfiguration + err error +} -func (l *disabledValidatingWebhookConfigLister) List(options metav1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error) { - return nil, errors.NewNotFound(schema.GroupResource{Group: "admissionregistration", Resource: "ValidatingWebhookConfigurations"}, "") +func (f *fakeValidatingWebhookConfigLister) List(selector labels.Selector) (ret []*v1beta1.ValidatingWebhookConfiguration, err error) { + return f.list, f.err } -func TestWebhookConfigDisabled(t *testing.T) { - manager := NewValidatingWebhookConfigurationManager(&disabledValidatingWebhookConfigLister{}) - manager.sync() - _, err := manager.Webhooks() - if err.Error() != ErrDisabled.Error() { - t.Errorf("expected %v, got %v", ErrDisabled, err) + +func (f *fakeValidatingWebhookConfigLister) Get(name string) (*v1beta1.ValidatingWebhookConfiguration, error) { + panic("unsupported") +} + +func TestGettValidatingWebhookConfig(t *testing.T) { + informer := &fakeValidatingWebhookConfigSharedInformer{ + informer: &fakeValidatingWebhookConfigInformer{}, + lister: &fakeValidatingWebhookConfigLister{}, + } + + // no configurations + informer.lister.list = nil + manager := NewValidatingWebhookConfigurationManager(informer) + if configurations := manager.Webhooks(); len(configurations.Webhooks) != 0 { + t.Errorf("expected empty webhooks, but got %v", configurations.Webhooks) + } + + // list error + webhookConfiguration := &v1beta1.ValidatingWebhookConfiguration{ + ObjectMeta: metav1.ObjectMeta{Name: "webhook1"}, + Webhooks: []v1beta1.Webhook{{Name: "webhook1.1"}}, + } + informer.lister.list = []*v1beta1.ValidatingWebhookConfiguration{webhookConfiguration.DeepCopy()} + informer.lister.err = fmt.Errorf("validating webhook configuration list error") + informer.informer.eventHandler.OnAdd(webhookConfiguration.DeepCopy()) + if configurations := manager.Webhooks(); len(configurations.Webhooks) != 0 { + t.Errorf("expected empty webhooks, but got %v", configurations.Webhooks) + } + + // configuration populated + informer.lister.err = nil + informer.informer.eventHandler.OnAdd(webhookConfiguration.DeepCopy()) + configurations := manager.Webhooks() + if len(configurations.Webhooks) == 0 { + t.Errorf("expected non empty webhooks") + } + if !reflect.DeepEqual(configurations.Webhooks, webhookConfiguration.Webhooks) { + t.Errorf("Expected\n%#v\ngot\n%#v", webhookConfiguration.Webhooks, configurations.Webhooks) } } diff --git a/vendor/k8s.io/apiserver/pkg/admission/decorator.go b/vendor/k8s.io/apiserver/pkg/admission/decorator.go new file mode 100644 index 000000000..a4b0b28b5 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/admission/decorator.go @@ -0,0 +1,39 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package admission + +type Decorator interface { + Decorate(handler Interface, name string) Interface +} + +type DecoratorFunc func(handler Interface, name string) Interface + +func (d DecoratorFunc) Decorate(handler Interface, name string) Interface { + return d(handler, name) +} + +type Decorators []Decorator + +// Decorate applies the decorator in inside-out order, i.e. the first decorator in the slice is first applied to the given handler. +func (d Decorators) Decorate(handler Interface, name string) Interface { + result := handler + for _, d := range d { + result = d.Decorate(result, name) + } + + return result +} diff --git a/vendor/k8s.io/apiserver/pkg/admission/initializer/BUILD b/vendor/k8s.io/apiserver/pkg/admission/initializer/BUILD index 6884d643a..a5fcdf48b 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/initializer/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/initializer/BUILD @@ -25,7 +25,6 @@ go_library( go_test( name = "go_default_xtest", srcs = ["initializer_test.go"], - importpath = "k8s.io/apiserver/pkg/admission/initializer_test", deps = [ "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/admission/metrics/BUILD b/vendor/k8s.io/apiserver/pkg/admission/metrics/BUILD index 32feb2f9f..84a134927 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/metrics/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/metrics/BUILD @@ -17,8 +17,7 @@ go_test( "metrics_test.go", "testutil_test.go", ], - importpath = "k8s.io/apiserver/pkg/admission/metrics", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", "//vendor/github.com/prometheus/client_model/go:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/admission/metrics/metrics_test.go b/vendor/k8s.io/apiserver/pkg/admission/metrics/metrics_test.go index dff2598dd..859e3d30e 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/metrics/metrics_test.go +++ b/vendor/k8s.io/apiserver/pkg/admission/metrics/metrics_test.go @@ -65,7 +65,7 @@ func TestObserveAdmissionController(t *testing.T) { "version": resource.Version, "resource": resource.Resource, "subresource": "subresource", - "type": "validate", + "type": "admit", "rejected": "false", } expectHistogramCountTotal(t, "apiserver_admission_controller_admission_latencies_seconds", wantLabels, 1) @@ -133,7 +133,7 @@ func TestWithMetrics(t *testing.T) { "validate-interfaces-dont-validate", "some-ns", admission.Create, - &validatingFakeHandler{admission.NewHandler(admission.Create, admission.Update), true}, + &validatingFakeHandler{admission.NewHandler(admission.Create, admission.Update), false}, true, false, }, { @@ -148,7 +148,7 @@ func TestWithMetrics(t *testing.T) { "some-ns", admission.Create, &mutatingFakeHandler{admission.NewHandler(admission.Create, admission.Update), false}, - true, false, + false, true, }, } { Metrics.reset() @@ -165,7 +165,7 @@ func TestWithMetrics(t *testing.T) { continue } - filter := map[string]string{"rejected": "false"} + filter := map[string]string{"type": "admit", "rejected": "false"} if !test.admit { filter["rejected"] = "true" } @@ -175,7 +175,7 @@ func TestWithMetrics(t *testing.T) { expectHistogramCountTotal(t, "apiserver_admission_controller_admission_latencies_seconds", filter, 0) } - if err == nil { + if err != nil { // skip validation step if mutation failed continue } @@ -190,8 +190,8 @@ func TestWithMetrics(t *testing.T) { continue } - filter = map[string]string{"rejected": "false"} - if !test.admit { + filter = map[string]string{"type": "validate", "rejected": "false"} + if !test.validate { filter["rejected"] = "true" } if _, validating := test.handler.(admission.ValidationInterface); validating { @@ -239,7 +239,7 @@ type mutatingFakeHandler struct { admit bool } -func (h *mutatingFakeHandler) Amit(a admission.Attributes) (err error) { +func (h *mutatingFakeHandler) Admit(a admission.Attributes) (err error) { if h.admit { return nil } diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/initialization/BUILD b/vendor/k8s.io/apiserver/pkg/admission/plugin/initialization/BUILD index 6479a4488..06596dc93 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/initialization/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/initialization/BUILD @@ -46,8 +46,7 @@ filegroup( go_test( name = "go_default_test", srcs = ["initialization_test.go"], - importpath = "k8s.io/apiserver/pkg/admission/plugin/initialization", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/admissionregistration/v1alpha1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/BUILD b/vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/BUILD index 1c821c23c..8fec752b0 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/BUILD @@ -30,8 +30,7 @@ go_library( go_test( name = "go_default_test", srcs = ["admission_test.go"], - importpath = "k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission.go index 158f41642..81c24f6a5 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission.go @@ -69,22 +69,9 @@ type Lifecycle struct { forceLiveLookupCache *utilcache.LRUExpireCache } -type forceLiveLookupEntry struct { - expiry time.Time -} - var _ = initializer.WantsExternalKubeInformerFactory(&Lifecycle{}) var _ = initializer.WantsExternalKubeClientSet(&Lifecycle{}) -func makeNamespaceKey(namespace string) *v1.Namespace { - return &v1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespace, - Namespace: "", - }, - } -} - func (l *Lifecycle) Admit(a admission.Attributes) error { // prevent deletion of immortal namespaces if a.GetOperation() == admission.Delete && a.GetKind().GroupKind() == v1.SchemeGroupVersion.WithKind("Namespace").GroupKind() && l.immortalNamespaces.Has(a.GetName()) { @@ -182,7 +169,7 @@ func (l *Lifecycle) Admit(a admission.Attributes) error { } // TODO: This should probably not be a 403 - return admission.NewForbidden(a, fmt.Errorf("unable to create new content in namespace %s because it is being terminated.", a.GetNamespace())) + return admission.NewForbidden(a, fmt.Errorf("unable to create new content in namespace %s because it is being terminated", a.GetNamespace())) } return nil diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/BUILD b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/BUILD index 76c2fd3dc..24b372cf7 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/BUILD @@ -12,6 +12,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//vendor/github.com/hashicorp/golang-lru:go_default_library", + "//vendor/k8s.io/api/admission/v1beta1:go_default_library", "//vendor/k8s.io/api/admissionregistration/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", @@ -32,8 +33,7 @@ go_test( "authentication_test.go", "serviceresolver_test.go", ], - importpath = "k8s.io/apiserver/pkg/admission/plugin/webhook/config", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/diff:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.conversion.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.conversion.go index d7e35ffed..190d47744 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.conversion.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.conversion.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.deepcopy.go index c9ef335c7..f89cef9d3 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 @@ -45,7 +45,6 @@ func (in *WebhookAdmission) DeepCopy() *WebhookAdmission { func (in *WebhookAdmission) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.defaults.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.defaults.go index 5e24d22ca..2bd0078a3 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.defaults.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1/zz_generated.defaults.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by defaulter-gen. Do not edit it manually! +// Code generated by defaulter-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/zz_generated.deepcopy.go index 890594a7d..4ec1eade1 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package webhookadmission @@ -45,7 +45,6 @@ func (in *WebhookAdmission) DeepCopy() *WebhookAdmission { func (in *WebhookAdmission) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/authentication.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/authentication.go index dd956f140..9b70c976e 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/authentication.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/authentication.go @@ -31,17 +31,28 @@ import ( // rest.Config generated by the resolver. type AuthenticationInfoResolverWrapper func(AuthenticationInfoResolver) AuthenticationInfoResolver -// AuthenticationInfoResolver builds rest.Config base on the server name. +// AuthenticationInfoResolver builds rest.Config base on the server or service +// name and service namespace. type AuthenticationInfoResolver interface { + // ClientConfigFor builds rest.Config based on the server. ClientConfigFor(server string) (*rest.Config, error) + // ClientConfigForService builds rest.Config based on the serviceName and + // serviceNamespace. + ClientConfigForService(serviceName, serviceNamespace string) (*rest.Config, error) } -// AuthenticationInfoResolverFunc implements AuthenticationInfoResolver. -type AuthenticationInfoResolverFunc func(server string) (*rest.Config, error) +// AuthenticationInfoResolverDelegator implements AuthenticationInfoResolver. +type AuthenticationInfoResolverDelegator struct { + ClientConfigForFunc func(server string) (*rest.Config, error) + ClientConfigForServiceFunc func(serviceName, serviceNamespace string) (*rest.Config, error) +} + +func (a *AuthenticationInfoResolverDelegator) ClientConfigFor(server string) (*rest.Config, error) { + return a.ClientConfigForFunc(server) +} -//ClientConfigFor implements AuthenticationInfoResolver. -func (a AuthenticationInfoResolverFunc) ClientConfigFor(server string) (*rest.Config, error) { - return a(server) +func (a *AuthenticationInfoResolverDelegator) ClientConfigForService(serviceName, serviceNamespace string) (*rest.Config, error) { + return a.ClientConfigForServiceFunc(serviceName, serviceNamespace) } type defaultAuthenticationInfoResolver struct { @@ -68,13 +79,21 @@ func NewDefaultAuthenticationInfoResolver(kubeconfigFile string) (Authentication } func (c *defaultAuthenticationInfoResolver) ClientConfigFor(server string) (*rest.Config, error) { + return c.clientConfig(server) +} + +func (c *defaultAuthenticationInfoResolver) ClientConfigForService(serviceName, serviceNamespace string) (*rest.Config, error) { + return c.clientConfig(serviceName + "." + serviceNamespace + ".svc") +} + +func (c *defaultAuthenticationInfoResolver) clientConfig(target string) (*rest.Config, error) { // exact match - if authConfig, ok := c.kubeconfig.AuthInfos[server]; ok { + if authConfig, ok := c.kubeconfig.AuthInfos[target]; ok { return restConfigFromKubeconfig(authConfig) } // star prefixed match - serverSteps := strings.Split(server, ".") + serverSteps := strings.Split(target, ".") for i := 1; i < len(serverSteps); i++ { nickName := "*." + strings.Join(serverSteps[i:], ".") if authConfig, ok := c.kubeconfig.AuthInfos[nickName]; ok { @@ -83,7 +102,7 @@ func (c *defaultAuthenticationInfoResolver) ClientConfigFor(server string) (*res } // if we're trying to hit the kube-apiserver and there wasn't an explicit config, use the in-cluster config - if server == "kubernetes.default.svc" { + if target == "kubernetes.default.svc" { // if we can find an in-cluster-config use that. If we can't, fall through. inClusterConfig, err := rest.InClusterConfig() if err == nil { diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/client.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/client.go index 28fac414e..bfc9bbd7f 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/client.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/client.go @@ -24,8 +24,10 @@ import ( "net/url" lru "github.com/hashicorp/golang-lru" + admissionv1beta1 "k8s.io/api/admission/v1beta1" "k8s.io/api/admissionregistration/v1beta1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer" utilerrors "k8s.io/apimachinery/pkg/util/errors" webhookerrors "k8s.io/apiserver/pkg/admission/plugin/webhook/errors" "k8s.io/client-go/rest" @@ -54,8 +56,13 @@ func NewClientManager() (ClientManager, error) { if err != nil { return ClientManager{}, err } + admissionScheme := runtime.NewScheme() + admissionv1beta1.AddToScheme(admissionScheme) return ClientManager{ cache: cache, + negotiatedSerializer: serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{ + Serializer: serializer.NewCodecFactory(admissionScheme).LegacyCodec(admissionv1beta1.SchemeGroupVersion), + }), }, nil } @@ -79,11 +86,6 @@ func (cm *ClientManager) SetServiceResolver(sr ServiceResolver) { } } -// SetNegotiatedSerializer sets the NegotiatedSerializer. -func (cm *ClientManager) SetNegotiatedSerializer(n runtime.NegotiatedSerializer) { - cm.negotiatedSerializer = n -} - // Validate checks if ClientManager is properly set up. func (cm *ClientManager) Validate() error { var errs []error @@ -122,12 +124,12 @@ func (cm *ClientManager) HookClient(h *v1beta1.Webhook) (*rest.RESTClient, error } if svc := h.ClientConfig.Service; svc != nil { - serverName := svc.Name + "." + svc.Namespace + ".svc" - restConfig, err := cm.authInfoResolver.ClientConfigFor(serverName) + restConfig, err := cm.authInfoResolver.ClientConfigForService(svc.Name, svc.Namespace) if err != nil { return nil, err } cfg := rest.CopyConfig(restConfig) + serverName := svc.Name + "." + svc.Namespace + ".svc" host := serverName + ":443" cfg.Host = "https://" + host if svc.Path != nil { @@ -168,7 +170,7 @@ func (cm *ClientManager) HookClient(h *v1beta1.Webhook) (*rest.RESTClient, error } cfg := rest.CopyConfig(restConfig) - cfg.Host = u.Host + cfg.Host = u.Scheme + "://" + u.Host cfg.APIPath = u.Path return complete(cfg) diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/errors/BUILD b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/errors/BUILD index 288007238..eabd499e1 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/errors/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/errors/BUILD @@ -18,8 +18,7 @@ go_library( go_test( name = "go_default_test", srcs = ["statuserror_test.go"], - importpath = "k8s.io/apiserver/pkg/admission/plugin/webhook/errors", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/BUILD b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/BUILD index 14fa71007..e09f051d9 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/BUILD @@ -14,8 +14,7 @@ go_library( go_test( name = "go_default_test", srcs = ["initializer_test.go"], - importpath = "k8s.io/apiserver/pkg/admission/plugin/webhook/initializer", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apiserver/pkg/admission:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/initializer.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/initializer.go index 398200b92..7367cff46 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/initializer.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/initializer.go @@ -23,7 +23,7 @@ import ( webhookconfig "k8s.io/apiserver/pkg/admission/plugin/webhook/config" ) -// WantsServiceResolver defines a fuction that accepts a ServiceResolver for +// WantsServiceResolver defines a function that accepts a ServiceResolver for // admission plugins that need to make calls to services. type WantsServiceResolver interface { SetServiceResolver(webhookconfig.ServiceResolver) diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/initializer_test.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/initializer_test.go index 553690d9a..bc05b9c5d 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/initializer_test.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer/initializer_test.go @@ -26,9 +26,7 @@ import ( type doNothingAdmission struct{} -func (doNothingAdmission) Admit(a admission.Attributes) error { return nil } func (doNothingAdmission) Handles(o admission.Operation) bool { return false } -func (doNothingAdmission) Validate() error { return nil } type fakeServiceResolver struct{} diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/BUILD b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/BUILD index d94dc0f6b..36f81528c 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/BUILD @@ -14,12 +14,9 @@ go_library( "//vendor/k8s.io/api/admission/v1beta1:go_default_library", "//vendor/k8s.io/api/admissionregistration/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/serializer/json:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission/configuration:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission/initializer:go_default_library", @@ -38,8 +35,7 @@ go_library( go_test( name = "go_default_test", srcs = ["admission_test.go"], - importpath = "k8s.io/apiserver/pkg/admission/plugin/webhook/mutating", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/admission/v1beta1:go_default_library", "//vendor/k8s.io/api/admissionregistration/v1beta1:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/admission.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/admission.go index f94415277..57f82d4d5 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/admission.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/admission.go @@ -30,12 +30,9 @@ import ( admissionv1beta1 "k8s.io/api/admission/v1beta1" "k8s.io/api/admissionregistration/v1beta1" apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/runtime/serializer/json" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/admission/configuration" genericadmissioninit "k8s.io/apiserver/pkg/admission/initializer" @@ -69,8 +66,7 @@ func Register(plugins *admission.Plugins) { // WebhookSource can list dynamic webhook plugins. type WebhookSource interface { - Run(stopCh <-chan struct{}) - Webhooks() (*v1beta1.MutatingWebhookConfiguration, error) + Webhooks() *v1beta1.MutatingWebhookConfiguration } // NewMutatingWebhook returns a generic admission webhook plugin. @@ -112,6 +108,7 @@ type MutatingWebhook struct { namespaceMatcher namespace.Matcher clientManager config.ClientManager convertor versioned.Convertor + defaulter runtime.ObjectDefaulter jsonSerializer runtime.Serializer } @@ -133,10 +130,8 @@ func (a *MutatingWebhook) SetServiceResolver(sr config.ServiceResolver) { // SetScheme sets a serializer(NegotiatedSerializer) which is derived from the scheme func (a *MutatingWebhook) SetScheme(scheme *runtime.Scheme) { if scheme != nil { - a.clientManager.SetNegotiatedSerializer(serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{ - Serializer: serializer.NewCodecFactory(scheme).LegacyCodec(admissionv1beta1.SchemeGroupVersion), - })) a.convertor.Scheme = scheme + a.defaulter = scheme a.jsonSerializer = json.NewSerializer(json.DefaultMetaFactory, scheme, scheme, false) } } @@ -144,14 +139,17 @@ func (a *MutatingWebhook) SetScheme(scheme *runtime.Scheme) { // WantsExternalKubeClientSet defines a function which sets external ClientSet for admission plugins that need it func (a *MutatingWebhook) SetExternalKubeClientSet(client clientset.Interface) { a.namespaceMatcher.Client = client - a.hookSource = configuration.NewMutatingWebhookConfigurationManager(client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations()) } // SetExternalKubeInformerFactory implements the WantsExternalKubeInformerFactory interface. func (a *MutatingWebhook) SetExternalKubeInformerFactory(f informers.SharedInformerFactory) { namespaceInformer := f.Core().V1().Namespaces() a.namespaceMatcher.NamespaceLister = namespaceInformer.Lister() - a.SetReadyFunc(namespaceInformer.Informer().HasSynced) + mutatingWebhookConfigurationsInformer := f.Admissionregistration().V1beta1().MutatingWebhookConfigurations() + a.hookSource = configuration.NewMutatingWebhookConfigurationManager(mutatingWebhookConfigurationsInformer) + a.SetReadyFunc(func() bool { + return namespaceInformer.Informer().HasSynced() && mutatingWebhookConfigurationsInformer.Informer().HasSynced() + }) } // ValidateInitialization implements the InitializationValidator interface. @@ -171,35 +169,28 @@ func (a *MutatingWebhook) ValidateInitialization() error { if err := a.convertor.Validate(); err != nil { return fmt.Errorf("MutatingWebhook.convertor is not properly setup: %v", err) } - go a.hookSource.Run(wait.NeverStop) + if a.defaulter == nil { + return fmt.Errorf("MutatingWebhook.defaulter is not properly setup") + } return nil } -func (a *MutatingWebhook) loadConfiguration(attr admission.Attributes) (*v1beta1.MutatingWebhookConfiguration, error) { - hookConfig, err := a.hookSource.Webhooks() - // if Webhook configuration is disabled, fail open - if err == configuration.ErrDisabled { - return &v1beta1.MutatingWebhookConfiguration{}, nil - } - if err != nil { - e := apierrors.NewServerTimeout(attr.GetResource().GroupResource(), string(attr.GetOperation()), 1) - e.ErrStatus.Message = fmt.Sprintf("Unable to refresh the Webhook configuration: %v", err) - e.ErrStatus.Reason = "LoadingConfiguration" - e.ErrStatus.Details.Causes = append(e.ErrStatus.Details.Causes, metav1.StatusCause{ - Type: "MutatingWebhookConfigurationFailure", - Message: "An error has occurred while refreshing the MutatingWebhook configuration, no resources can be created/updated/deleted/connected until a refresh succeeds.", - }) - return nil, e - } - return hookConfig, nil +func (a *MutatingWebhook) loadConfiguration(attr admission.Attributes) *v1beta1.MutatingWebhookConfiguration { + hookConfig := a.hookSource.Webhooks() + return hookConfig } // Admit makes an admission decision based on the request attributes. func (a *MutatingWebhook) Admit(attr admission.Attributes) error { - hookConfig, err := a.loadConfiguration(attr) - if err != nil { - return err + if rules.IsWebhookConfigurationResource(attr) { + return nil } + + if !a.WaitForReady() { + return admission.NewForbidden(attr, fmt.Errorf("not yet ready to handle request")) + } + + hookConfig := a.loadConfiguration(attr) hooks := hookConfig.Webhooks ctx := context.TODO() @@ -312,10 +303,9 @@ func (a *MutatingWebhook) callAttrMutatingHook(ctx context.Context, h *v1beta1.W if err != nil { return apierrors.NewInternalError(err) } - // TODO: if we have multiple mutating webhooks, we can remember the json - // instead of encoding and decoding for each one. if _, _, err := a.jsonSerializer.Decode(patchedJS, nil, attr.Object); err != nil { return apierrors.NewInternalError(err) } + a.defaulter.Default(attr.Object) return nil } diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/admission_test.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/admission_test.go index 203baa9c3..523e03762 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/admission_test.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/admission_test.go @@ -32,7 +32,6 @@ import ( registrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -48,16 +47,16 @@ type fakeHookSource struct { err error } -func (f *fakeHookSource) Webhooks() (*registrationv1beta1.MutatingWebhookConfiguration, error) { +func (f *fakeHookSource) Webhooks() *registrationv1beta1.MutatingWebhookConfiguration { if f.err != nil { - return nil, f.err + return nil } for i, h := range f.hooks { if h.NamespaceSelector == nil { f.hooks[i].NamespaceSelector = &metav1.LabelSelector{} } } - return ®istrationv1beta1.MutatingWebhookConfiguration{Webhooks: f.hooks}, nil + return ®istrationv1beta1.MutatingWebhookConfiguration{Webhooks: f.hooks} } func (f *fakeHookSource) Run(stopCh <-chan struct{}) {} @@ -381,7 +380,7 @@ func TestAdmit(t *testing.T) { t.Errorf(" expected an error saying %q, but got %v", tt.errorContains, err) } } - if _, isStatusErr := err.(*apierrors.StatusError); err != nil && !isStatusErr { + if _, isStatusErr := err.(*errors.StatusError); err != nil && !isStatusErr { t.Errorf("%s: expected a StatusError, got %T", name, err) } }) @@ -637,6 +636,11 @@ func (c *fakeAuthenticationInfoResolver) ClientConfigFor(server string) (*rest.C return c.restConfig, nil } +func (c *fakeAuthenticationInfoResolver) ClientConfigForService(serviceName, serviceNamespace string) (*rest.Config, error) { + atomic.AddInt32(c.cachedCount, 1) + return c.restConfig, nil +} + func newMatchEverythingRules() []registrationv1beta1.RuleWithOperations { return []registrationv1beta1.RuleWithOperations{{ Operations: []registrationv1beta1.OperationType{registrationv1beta1.OperationAll}, diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/BUILD b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/BUILD index a75286a68..3a71df210 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/BUILD @@ -24,8 +24,7 @@ go_library( go_test( name = "go_default_test", srcs = ["matcher_test.go"], - importpath = "k8s.io/apiserver/pkg/admission/plugin/webhook/namespace", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/admissionregistration/v1beta1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher.go index b9157b9ba..a05411915 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher.go @@ -90,10 +90,10 @@ func (m *Matcher) MatchNamespaceSelector(h *v1beta1.Webhook, attr admission.Attr namespaceName := attr.GetNamespace() if len(namespaceName) == 0 && attr.GetResource().Resource != "namespaces" { // If the request is about a cluster scoped resource, and it is not a - // namespace, it is exempted from all webhooks for now. + // namespace, it is never exempted. // TODO: figure out a way selective exempt cluster scoped resources. // Also update the comment in types.go - return false, nil + return true, nil } namespaceLabels, err := m.GetNamespaceLabels(attr) // this means the namespace is not found, for backwards compatibility, diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher_test.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher_test.go index e8f77ba90..d0aee1499 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher_test.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher_test.go @@ -113,7 +113,7 @@ func TestGetNamespaceLabels(t *testing.T) { } } -func TestExemptClusterScopedResource(t *testing.T) { +func TestNotExemptClusterScopedResource(t *testing.T) { hook := ®istrationv1beta1.Webhook{ NamespaceSelector: &metav1.LabelSelector{}, } @@ -123,7 +123,7 @@ func TestExemptClusterScopedResource(t *testing.T) { if err != nil { t.Fatal(err) } - if matches { - t.Errorf("cluster scoped resources (but not a namespace) should be exempted from all webhooks") + if !matches { + t.Errorf("cluster scoped resources (but not a namespace) should not be exempted from webhooks") } } diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/BUILD b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/BUILD index 6152811d1..7328fe301 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/BUILD @@ -14,8 +14,7 @@ go_library( go_test( name = "go_default_test", srcs = ["rules_test.go"], - importpath = "k8s.io/apiserver/pkg/admission/plugin/webhook/rules", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/admissionregistration/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go index eb9935756..096ab5021 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go @@ -93,3 +93,15 @@ func (r *Matcher) resource() bool { } return false } + +// IsWebhookConfigurationResource determines if an admission.Attributes object is describing +// the admission of a ValidatingWebhookConfiguration or a MutatingWebhookConfiguration +func IsWebhookConfigurationResource(attr admission.Attributes) bool { + gvk := attr.GetKind() + if gvk.Group == "admissionregistration.k8s.io" { + if gvk.Kind == "ValidatingWebhookConfiguration" || gvk.Kind == "MutatingWebhookConfiguration" { + return true + } + } + return false +} diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/BUILD b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/BUILD index f4a982d12..01f2f57c7 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/BUILD @@ -13,18 +13,13 @@ go_library( "//vendor/k8s.io/api/admission/v1beta1:go_default_library", "//vendor/k8s.io/api/admissionregistration/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission/configuration:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission/initializer:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission/metrics:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config:go_default_library", - "//vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission:go_default_library", - "//vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/errors:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/request:go_default_library", @@ -38,8 +33,7 @@ go_library( go_test( name = "go_default_test", srcs = ["admission_test.go"], - importpath = "k8s.io/apiserver/pkg/admission/plugin/webhook/validating", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/admission/v1beta1:go_default_library", "//vendor/k8s.io/api/admissionregistration/v1beta1:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/admission.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/admission.go index b88556631..d3bcb3389 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/admission.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/admission.go @@ -30,18 +30,13 @@ import ( admissionv1beta1 "k8s.io/api/admission/v1beta1" "k8s.io/api/admissionregistration/v1beta1" apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/admission/configuration" genericadmissioninit "k8s.io/apiserver/pkg/admission/initializer" admissionmetrics "k8s.io/apiserver/pkg/admission/metrics" "k8s.io/apiserver/pkg/admission/plugin/webhook/config" - webhookadmissionapi "k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission" - webhookadmissionapiv1alpha1 "k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1" webhookerrors "k8s.io/apiserver/pkg/admission/plugin/webhook/errors" "k8s.io/apiserver/pkg/admission/plugin/webhook/namespace" "k8s.io/apiserver/pkg/admission/plugin/webhook/request" @@ -66,15 +61,11 @@ func Register(plugins *admission.Plugins) { return plugin, nil }) - // add our config types - webhookadmissionapi.AddToScheme(plugins.ConfigScheme) - webhookadmissionapiv1alpha1.AddToScheme(plugins.ConfigScheme) } // WebhookSource can list dynamic webhook plugins. type WebhookSource interface { - Run(stopCh <-chan struct{}) - Webhooks() (*v1beta1.ValidatingWebhookConfiguration, error) + Webhooks() *v1beta1.ValidatingWebhookConfiguration } // NewValidatingAdmissionWebhook returns a generic admission webhook plugin. @@ -136,9 +127,6 @@ func (a *ValidatingAdmissionWebhook) SetServiceResolver(sr config.ServiceResolve // SetScheme sets a serializer(NegotiatedSerializer) which is derived from the scheme func (a *ValidatingAdmissionWebhook) SetScheme(scheme *runtime.Scheme) { if scheme != nil { - a.clientManager.SetNegotiatedSerializer(serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{ - Serializer: serializer.NewCodecFactory(scheme).LegacyCodec(admissionv1beta1.SchemeGroupVersion), - })) a.convertor.Scheme = scheme } } @@ -146,20 +134,23 @@ func (a *ValidatingAdmissionWebhook) SetScheme(scheme *runtime.Scheme) { // WantsExternalKubeClientSet defines a function which sets external ClientSet for admission plugins that need it func (a *ValidatingAdmissionWebhook) SetExternalKubeClientSet(client clientset.Interface) { a.namespaceMatcher.Client = client - a.hookSource = configuration.NewValidatingWebhookConfigurationManager(client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations()) } // SetExternalKubeInformerFactory implements the WantsExternalKubeInformerFactory interface. func (a *ValidatingAdmissionWebhook) SetExternalKubeInformerFactory(f informers.SharedInformerFactory) { namespaceInformer := f.Core().V1().Namespaces() a.namespaceMatcher.NamespaceLister = namespaceInformer.Lister() - a.SetReadyFunc(namespaceInformer.Informer().HasSynced) + validatingWebhookConfigurationsInformer := f.Admissionregistration().V1beta1().ValidatingWebhookConfigurations() + a.hookSource = configuration.NewValidatingWebhookConfigurationManager(validatingWebhookConfigurationsInformer) + a.SetReadyFunc(func() bool { + return namespaceInformer.Informer().HasSynced() && validatingWebhookConfigurationsInformer.Informer().HasSynced() + }) } // ValidateInitialization implements the InitializationValidator interface. func (a *ValidatingAdmissionWebhook) ValidateInitialization() error { if a.hookSource == nil { - return fmt.Errorf("ValidatingAdmissionWebhook admission plugin requires a Kubernetes client to be provided") + return fmt.Errorf("ValidatingAdmissionWebhook admission plugin requires a Kubernetes informer to be provided") } if err := a.namespaceMatcher.Validate(); err != nil { return fmt.Errorf("ValidatingAdmissionWebhook.namespaceMatcher is not properly setup: %v", err) @@ -170,35 +161,23 @@ func (a *ValidatingAdmissionWebhook) ValidateInitialization() error { if err := a.convertor.Validate(); err != nil { return fmt.Errorf("ValidatingAdmissionWebhook.convertor is not properly setup: %v", err) } - go a.hookSource.Run(wait.NeverStop) return nil } -func (a *ValidatingAdmissionWebhook) loadConfiguration(attr admission.Attributes) (*v1beta1.ValidatingWebhookConfiguration, error) { - hookConfig, err := a.hookSource.Webhooks() - // if Webhook configuration is disabled, fail open - if err == configuration.ErrDisabled { - return &v1beta1.ValidatingWebhookConfiguration{}, nil - } - if err != nil { - e := apierrors.NewServerTimeout(attr.GetResource().GroupResource(), string(attr.GetOperation()), 1) - e.ErrStatus.Message = fmt.Sprintf("Unable to refresh the Webhook configuration: %v", err) - e.ErrStatus.Reason = "LoadingConfiguration" - e.ErrStatus.Details.Causes = append(e.ErrStatus.Details.Causes, metav1.StatusCause{ - Type: "ValidatingWebhookConfigurationFailure", - Message: "An error has occurred while refreshing the ValidatingWebhook configuration, no resources can be created/updated/deleted/connected until a refresh succeeds.", - }) - return nil, e - } - return hookConfig, nil +func (a *ValidatingAdmissionWebhook) loadConfiguration(attr admission.Attributes) *v1beta1.ValidatingWebhookConfiguration { + return a.hookSource.Webhooks() } // Validate makes an admission decision based on the request attributes. func (a *ValidatingAdmissionWebhook) Validate(attr admission.Attributes) error { - hookConfig, err := a.loadConfiguration(attr) - if err != nil { - return err + if rules.IsWebhookConfigurationResource(attr) { + return nil + } + + if !a.WaitForReady() { + return admission.NewForbidden(attr, fmt.Errorf("not yet ready to handle request")) } + hookConfig := a.loadConfiguration(attr) hooks := hookConfig.Webhooks ctx := context.TODO() @@ -287,7 +266,7 @@ func (a *ValidatingAdmissionWebhook) Validate(attr admission.Attributes) error { return errs[0] } -// TODO: factor into a common place along with the validating webhook version. +// TODO: factor into a common place along with the mutating webhook version. func (a *ValidatingAdmissionWebhook) shouldCallHook(h *v1beta1.Webhook, attr admission.Attributes) (bool, *apierrors.StatusError) { var matches bool for _, r := range h.Rules { diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/admission_test.go b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/admission_test.go index 46ae76d63..77871f019 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/admission_test.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/admission_test.go @@ -32,7 +32,6 @@ import ( registrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -48,16 +47,16 @@ type fakeHookSource struct { err error } -func (f *fakeHookSource) Webhooks() (*registrationv1beta1.ValidatingWebhookConfiguration, error) { +func (f *fakeHookSource) Webhooks() *registrationv1beta1.ValidatingWebhookConfiguration { if f.err != nil { - return nil, f.err + return nil } for i, h := range f.hooks { if h.NamespaceSelector == nil { f.hooks[i].NamespaceSelector = &metav1.LabelSelector{} } } - return ®istrationv1beta1.ValidatingWebhookConfiguration{Webhooks: f.hooks}, nil + return ®istrationv1beta1.ValidatingWebhookConfiguration{Webhooks: f.hooks} } func (f *fakeHookSource) Run(stopCh <-chan struct{}) {} @@ -403,7 +402,7 @@ func TestValidate(t *testing.T) { t.Errorf(" expected an error saying %q, but got %v", tt.errorContains, err) } } - if _, isStatusErr := err.(*apierrors.StatusError); err != nil && !isStatusErr { + if _, isStatusErr := err.(*errors.StatusError); err != nil && !isStatusErr { t.Errorf("%s: expected a StatusError, got %T", name, err) } }) @@ -662,6 +661,11 @@ func (c *fakeAuthenticationInfoResolver) ClientConfigFor(server string) (*rest.C return c.restConfig, nil } +func (c *fakeAuthenticationInfoResolver) ClientConfigForService(serviceName, serviceNamespace string) (*rest.Config, error) { + atomic.AddInt32(c.cachedCount, 1) + return c.restConfig, nil +} + func newMatchEverythingRules() []registrationv1beta1.RuleWithOperations { return []registrationv1beta1.RuleWithOperations{{ Operations: []registrationv1beta1.OperationType{registrationv1beta1.OperationAll}, diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/versioned/BUILD b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/versioned/BUILD index 4bd5efbf3..f3446c1c4 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/versioned/BUILD +++ b/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/versioned/BUILD @@ -19,8 +19,7 @@ go_library( go_test( name = "go_default_test", srcs = ["conversion_test.go"], - importpath = "k8s.io/apiserver/pkg/admission/plugin/webhook/versioned", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/admission/plugins.go b/vendor/k8s.io/apiserver/pkg/admission/plugins.go index 3ede44a17..50139780f 100644 --- a/vendor/k8s.io/apiserver/pkg/admission/plugins.go +++ b/vendor/k8s.io/apiserver/pkg/admission/plugins.go @@ -23,10 +23,9 @@ import ( "io/ioutil" "reflect" "sort" + "strings" "sync" - "k8s.io/apimachinery/pkg/runtime" - "github.com/golang/glog" ) @@ -39,16 +38,10 @@ type Factory func(config io.Reader) (Interface, error) type Plugins struct { lock sync.Mutex registry map[string]Factory - - // ConfigScheme is used to parse the admission plugin config file. - // It is exposed to act as a hook for extending server providing their own config. - ConfigScheme *runtime.Scheme } func NewPlugins() *Plugins { - return &Plugins{ - ConfigScheme: runtime.NewScheme(), - } + return &Plugins{} } // All registered admission options. @@ -130,8 +123,6 @@ func splitStream(config io.Reader) (io.Reader, io.Reader, error) { return bytes.NewBuffer(configBytes), bytes.NewBuffer(configBytes), nil } -type Decorator func(handler Interface, name string) Interface - // NewFromPlugins returns an admission.Interface that will enforce admission control decisions of all // the given plugins. func (ps *Plugins) NewFromPlugins(pluginNames []string, configProvider ConfigProvider, pluginInitializer PluginInitializer, decorator Decorator) (Interface, error) { @@ -148,12 +139,15 @@ func (ps *Plugins) NewFromPlugins(pluginNames []string, configProvider ConfigPro } if plugin != nil { if decorator != nil { - handlers = append(handlers, decorator(plugin, pluginName)) + handlers = append(handlers, decorator.Decorate(plugin, pluginName)) } else { handlers = append(handlers, plugin) } } } + if len(pluginNames) != 0 { + glog.Infof("Loaded %d admission controller(s) successfully in the following order: %s.", len(pluginNames), strings.Join(pluginNames, ",")) + } return chainAdmissionHandler(handlers), nil } diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/types.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/types.go index f84fd04a3..e55da95f9 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/types.go +++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/types.go @@ -46,5 +46,5 @@ type AdmissionPluginConfiguration struct { // Configuration is an embedded configuration object to be used as the plugin's // configuration. If present, it will be used instead of the path to the configuration file. // +optional - Configuration runtime.Object + Configuration *runtime.Unknown } diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/BUILD b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/BUILD index 2640ff64b..3075c3bbe 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/BUILD +++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/BUILD @@ -8,7 +8,6 @@ load( go_library( name = "go_default_library", srcs = [ - "conversion.go", "doc.go", "register.go", "types.go", diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/conversion.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/conversion.go deleted file mode 100644 index 378cc080d..000000000 --- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/conversion.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -var _ runtime.NestedObjectDecoder = &AdmissionConfiguration{} - -// DecodeNestedObjects handles encoding RawExtensions on the AdmissionConfiguration, ensuring the -// objects are decoded with the provided decoder. -func (c *AdmissionConfiguration) DecodeNestedObjects(d runtime.Decoder) error { - // decoding failures result in a runtime.Unknown object being created in Object and passed - // to conversion - for k, v := range c.Plugins { - decodeNestedRawExtensionOrUnknown(d, &v.Configuration) - c.Plugins[k] = v - } - return nil -} - -var _ runtime.NestedObjectEncoder = &AdmissionConfiguration{} - -// EncodeNestedObjects handles encoding RawExtensions on the AdmissionConfiguration, ensuring the -// objects are encoded with the provided encoder. -func (c *AdmissionConfiguration) EncodeNestedObjects(e runtime.Encoder) error { - for k, v := range c.Plugins { - if err := encodeNestedRawExtension(e, &v.Configuration); err != nil { - return err - } - c.Plugins[k] = v - } - return nil -} - -// decodeNestedRawExtensionOrUnknown decodes the raw extension into an object once. If called -// On a RawExtension that has already been decoded (has an object), it will not run again. -func decodeNestedRawExtensionOrUnknown(d runtime.Decoder, ext *runtime.RawExtension) { - if ext.Raw == nil || ext.Object != nil { - return - } - obj, gvk, err := d.Decode(ext.Raw, nil, nil) - if err != nil { - unk := &runtime.Unknown{Raw: ext.Raw} - if runtime.IsNotRegisteredError(err) { - if _, gvk, err := d.Decode(ext.Raw, nil, unk); err == nil { - unk.APIVersion = gvk.GroupVersion().String() - unk.Kind = gvk.Kind - ext.Object = unk - return - } - } - // TODO: record mime-type with the object - if gvk != nil { - unk.APIVersion = gvk.GroupVersion().String() - unk.Kind = gvk.Kind - } - obj = unk - } - ext.Object = obj -} - -func encodeNestedRawExtension(e runtime.Encoder, ext *runtime.RawExtension) error { - if ext.Raw != nil || ext.Object == nil { - return nil - } - data, err := runtime.Encode(e, ext.Object) - if err != nil { - return err - } - ext.Raw = data - return nil -} diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go index 522c41c41..239b8e20e 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go +++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/types.go @@ -46,5 +46,5 @@ type AdmissionPluginConfiguration struct { // Configuration is an embedded configuration object to be used as the plugin's // configuration. If present, it will be used instead of the path to the configuration file. // +optional - Configuration runtime.RawExtension `json:"configuration"` + Configuration *runtime.Unknown `json:"configuration"` } diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.conversion.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.conversion.go index b1af97ec3..3468b998b 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.conversion.go +++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.conversion.go @@ -16,11 +16,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package v1alpha1 import ( + unsafe "unsafe" + conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" apiserver "k8s.io/apiserver/pkg/apis/apiserver" @@ -42,17 +44,7 @@ func RegisterConversions(scheme *runtime.Scheme) error { } func autoConvert_v1alpha1_AdmissionConfiguration_To_apiserver_AdmissionConfiguration(in *AdmissionConfiguration, out *apiserver.AdmissionConfiguration, s conversion.Scope) error { - if in.Plugins != nil { - in, out := &in.Plugins, &out.Plugins - *out = make([]apiserver.AdmissionPluginConfiguration, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_AdmissionPluginConfiguration_To_apiserver_AdmissionPluginConfiguration(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Plugins = nil - } + out.Plugins = *(*[]apiserver.AdmissionPluginConfiguration)(unsafe.Pointer(&in.Plugins)) return nil } @@ -62,17 +54,7 @@ func Convert_v1alpha1_AdmissionConfiguration_To_apiserver_AdmissionConfiguration } func autoConvert_apiserver_AdmissionConfiguration_To_v1alpha1_AdmissionConfiguration(in *apiserver.AdmissionConfiguration, out *AdmissionConfiguration, s conversion.Scope) error { - if in.Plugins != nil { - in, out := &in.Plugins, &out.Plugins - *out = make([]AdmissionPluginConfiguration, len(*in)) - for i := range *in { - if err := Convert_apiserver_AdmissionPluginConfiguration_To_v1alpha1_AdmissionPluginConfiguration(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Plugins = nil - } + out.Plugins = *(*[]AdmissionPluginConfiguration)(unsafe.Pointer(&in.Plugins)) return nil } @@ -84,9 +66,7 @@ func Convert_apiserver_AdmissionConfiguration_To_v1alpha1_AdmissionConfiguration func autoConvert_v1alpha1_AdmissionPluginConfiguration_To_apiserver_AdmissionPluginConfiguration(in *AdmissionPluginConfiguration, out *apiserver.AdmissionPluginConfiguration, s conversion.Scope) error { out.Name = in.Name out.Path = in.Path - if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.Configuration, &out.Configuration, s); err != nil { - return err - } + out.Configuration = (*runtime.Unknown)(unsafe.Pointer(in.Configuration)) return nil } @@ -98,9 +78,7 @@ func Convert_v1alpha1_AdmissionPluginConfiguration_To_apiserver_AdmissionPluginC func autoConvert_apiserver_AdmissionPluginConfiguration_To_v1alpha1_AdmissionPluginConfiguration(in *apiserver.AdmissionPluginConfiguration, out *AdmissionPluginConfiguration, s conversion.Scope) error { out.Name = in.Name out.Path = in.Path - if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.Configuration, &out.Configuration, s); err != nil { - return err - } + out.Configuration = (*runtime.Unknown)(unsafe.Pointer(in.Configuration)) return nil } diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.deepcopy.go index c8b46fac5..0bc0606d9 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 @@ -52,15 +52,22 @@ func (in *AdmissionConfiguration) DeepCopy() *AdmissionConfiguration { func (in *AdmissionConfiguration) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AdmissionPluginConfiguration) DeepCopyInto(out *AdmissionPluginConfiguration) { *out = *in - in.Configuration.DeepCopyInto(&out.Configuration) + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + if *in == nil { + *out = nil + } else { + *out = new(runtime.Unknown) + (*in).DeepCopyInto(*out) + } + } return } diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.defaults.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.defaults.go index 5e24d22ca..2bd0078a3 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.defaults.go +++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/zz_generated.defaults.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by defaulter-gen. Do not edit it manually! +// Code generated by defaulter-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/apiserver/pkg/apis/apiserver/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/apiserver/zz_generated.deepcopy.go index 7e5fb6edb..e6bc8e2c9 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/apiserver/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/apis/apiserver/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package apiserver @@ -52,18 +52,21 @@ func (in *AdmissionConfiguration) DeepCopy() *AdmissionConfiguration { func (in *AdmissionConfiguration) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AdmissionPluginConfiguration) DeepCopyInto(out *AdmissionPluginConfiguration) { *out = *in - if in.Configuration == nil { - out.Configuration = nil - } else { - out.Configuration = in.Configuration.DeepCopyObject() + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + if *in == nil { + *out = nil + } else { + *out = new(runtime.Unknown) + (*in).DeepCopyInto(*out) + } } return } diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/install/BUILD b/vendor/k8s.io/apiserver/pkg/apis/audit/install/BUILD index f6489a534..2da7015f5 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/install/BUILD +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/install/BUILD @@ -37,8 +37,7 @@ filegroup( go_test( name = "go_default_test", srcs = ["roundtrip_test.go"], - importpath = "k8s.io/apiserver/pkg/apis/audit/install", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/api/testing/roundtrip:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/audit/fuzzer:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/types.go b/vendor/k8s.io/apiserver/pkg/apis/audit/types.go index 2b318d575..d72505d10 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/types.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/types.go @@ -125,6 +125,14 @@ type Event struct { RequestReceivedTimestamp metav1.MicroTime // Time the request reached current audit stage. StageTimestamp metav1.MicroTime + + // Annotations is an unstructured key value map stored with an audit event that may be set by + // plugins invoked in the request serving chain, including authentication, authorization and + // admission plugins. Keys should uniquely identify the informing component to avoid name + // collisions (e.g. podsecuritypolicy.admission.k8s.io/policy). Values should be short. Annotations + // are included in the Metadata level. + // +optional + Annotations map[string]string } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -226,10 +234,19 @@ type GroupResources struct { // The empty string represents the core API group. // +optional Group string - // Resources is a list of resources within the API group. Subresources are - // matched using a "/" to indicate the subresource. For example, "pods/log" - // would match request to the log subresource of pods. The top level resource - // does not match subresources, "pods" doesn't match "pods/log". + // Resources is a list of resources this rule applies to. + // + // For example: + // 'pods' matches pods. + // 'pods/log' matches the log subresource of pods. + // '*' matches all resources and their subresources. + // 'pods/*' matches all subresources of pods. + // '*/scale' matches all scale subresources. + // + // If wildcard is present, the validation rule will ensure resources do not + // overlap with each other. + // + // An empty list implies all resources and subresources in this API groups apply. // +optional Resources []string // ResourceNames is a list of resource instance names that the policy matches. diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/BUILD b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/BUILD index 04b9b943d..b6729cdf9 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/BUILD +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/BUILD @@ -21,6 +21,7 @@ go_library( importpath = "k8s.io/apiserver/pkg/apis/audit/v1alpha1", deps = [ "//vendor/github.com/gogo/protobuf/proto:go_default_library", + "//vendor/github.com/gogo/protobuf/sortkeys:go_default_library", "//vendor/k8s.io/api/authentication/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library", @@ -53,8 +54,7 @@ filegroup( go_test( name = "go_default_test", srcs = ["conversion_test.go"], - importpath = "k8s.io/apiserver/pkg/apis/audit/v1alpha1", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.pb.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.pb.go index 12e674bb1..5f21dfaf2 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.pb.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.pb.go @@ -45,6 +45,8 @@ import k8s_io_apimachinery_pkg_runtime "k8s.io/apimachinery/pkg/runtime" import k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" +import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + import strings "strings" import reflect "reflect" @@ -240,6 +242,30 @@ func (m *Event) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n10 + if len(m.Annotations) > 0 { + keysForAnnotations := make([]string, 0, len(m.Annotations)) + for k := range m.Annotations { + keysForAnnotations = append(keysForAnnotations, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + for _, k := range keysForAnnotations { + dAtA[i] = 0x8a + i++ + dAtA[i] = 0x1 + i++ + v := m.Annotations[string(k)] + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } return i, nil } @@ -670,6 +696,14 @@ func (m *Event) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.StageTimestamp.Size() n += 2 + l + sovGenerated(uint64(l)) + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } return n } @@ -828,6 +862,16 @@ func (this *Event) String() string { if this == nil { return "nil" } + keysForAnnotations := make([]string, 0, len(this.Annotations)) + for k := range this.Annotations { + keysForAnnotations = append(keysForAnnotations, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + mapStringForAnnotations := "map[string]string{" + for _, k := range keysForAnnotations { + mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + } + mapStringForAnnotations += "}" s := strings.Join([]string{`&Event{`, `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Level:` + fmt.Sprintf("%v", this.Level) + `,`, @@ -845,6 +889,7 @@ func (this *Event) String() string { `ResponseObject:` + strings.Replace(fmt.Sprintf("%v", this.ResponseObject), "Unknown", "k8s_io_apimachinery_pkg_runtime.Unknown", 1) + `,`, `RequestReceivedTimestamp:` + strings.Replace(strings.Replace(this.RequestReceivedTimestamp.String(), "MicroTime", "k8s_io_apimachinery_pkg_apis_meta_v1.MicroTime", 1), `&`, ``, 1) + `,`, `StageTimestamp:` + strings.Replace(strings.Replace(this.StageTimestamp.String(), "MicroTime", "k8s_io_apimachinery_pkg_apis_meta_v1.MicroTime", 1), `&`, ``, 1) + `,`, + `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s @@ -1454,6 +1499,122 @@ func (m *Event) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + var keykey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + keykey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + if m.Annotations == nil { + m.Annotations = make(map[string]string) + } + if iNdEx < postIndex { + var valuekey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + valuekey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + m.Annotations[mapkey] = mapvalue + } else { + var mapvalue string + m.Annotations[mapkey] = mapvalue + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2621,80 +2782,84 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 1190 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xd6, 0x71, 0x62, 0x4f, 0x1a, 0x27, 0x9d, 0x22, 0xba, 0xca, 0xc1, 0x36, 0x46, 0x42, - 0x11, 0x84, 0xdd, 0xa4, 0x04, 0x5a, 0x0e, 0x1c, 0x62, 0x15, 0x81, 0xa5, 0x34, 0x84, 0x49, 0x5c, - 0x89, 0x3f, 0x07, 0xd6, 0xf6, 0x8b, 0xbd, 0xc4, 0xde, 0x5d, 0x66, 0x66, 0x8d, 0x72, 0xe3, 0xc0, - 0x15, 0x89, 0x3b, 0x1f, 0xa6, 0xe2, 0x80, 0x94, 0x63, 0x8f, 0x3d, 0x59, 0xc4, 0x7c, 0x8b, 0x1c, - 0x10, 0x9a, 0xd9, 0x99, 0x9d, 0x5d, 0xa7, 0x56, 0x1d, 0x0e, 0xbd, 0xed, 0xbc, 0xf7, 0x7b, 0xbf, - 0xf7, 0xe6, 0xed, 0xfb, 0x33, 0xe8, 0xeb, 0xf3, 0xc7, 0xcc, 0xf1, 0x43, 0xf7, 0x3c, 0xee, 0x00, -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0x75, 0x4c, 0xde, 0x53, 0x46, 0x93, 0x7a, 0x81, 0x76, 0xc6, 0x7b, 0xce, 0x57, - 0x9d, 0x1f, 0xa1, 0xcb, 0x9f, 0x02, 0xf7, 0x9a, 0xf8, 0x72, 0x52, 0x5b, 0x9a, 0x4e, 0x6a, 0xc8, - 0xc8, 0x48, 0xca, 0x8a, 0x77, 0x50, 0x71, 0x08, 0x63, 0x18, 0xda, 0x77, 0xea, 0xd6, 0x76, 0xb9, - 0xf9, 0xb6, 0x02, 0x17, 0x0f, 0x85, 0xf0, 0x5a, 0x7f, 0x90, 0x04, 0x84, 0xbf, 0x43, 0x65, 0x71, - 0x5b, 0xc6, 0xbd, 0x51, 0x64, 0x17, 0x64, 0x40, 0xef, 0x2f, 0x16, 0xd0, 0xa9, 0x3f, 0x82, 0xe6, - 0x3d, 0xc5, 0x5e, 0x3e, 0xd5, 0x24, 0xc4, 0xf0, 0xe1, 0x23, 0xb4, 0x2a, 0x2b, 0xa7, 0xf5, 0xc4, - 0x5e, 0x96, 0xc1, 0xec, 0x2b, 0xf8, 0xea, 0x41, 0x22, 0xbe, 0x9e, 0xd4, 0xde, 0x99, 0x97, 0x4f, - 0x7e, 0x11, 0x01, 0x73, 0xda, 0xad, 0x27, 0x44, 0x93, 0x88, 0xab, 0x31, 0xee, 0xf5, 0xc1, 0x2e, - 0xe6, 0xaf, 0x76, 0x22, 0x84, 0xd7, 0xfa, 0x83, 0x24, 0x20, 0xfc, 0x10, 0x21, 0x0a, 0x3f, 0xc5, - 0xc0, 0x78, 0x9b, 0xb4, 0xec, 0x15, 0x69, 0x92, 0xa6, 0x8e, 0xa4, 0x1a, 0x92, 0x41, 0xe1, 0x3a, - 0x5a, 0x1e, 0x03, 0xed, 0xd8, 0xab, 0x12, 0x7d, 0x57, 0xa1, 0x97, 0x9f, 0x01, 0xed, 0x10, 0xa9, - 0xc1, 0x5f, 0xa2, 0xe5, 0x98, 0x01, 0xb5, 0x4b, 0x32, 0x57, 0xef, 0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xef, 0x20, 0x72, - 0x62, 0x9e, 0x65, 0xd6, 0x22, 0xcf, 0xb2, 0x1a, 0x2a, 0x8a, 0x37, 0x82, 0x6e, 0xf5, 0xb2, 0x40, - 0x8a, 0x55, 0xce, 0x48, 0x22, 0xc7, 0x0e, 0x42, 0xe2, 0x43, 0xce, 0x08, 0x9d, 0xda, 0x8a, 0x48, - 0x6d, 0x3b, 0x95, 0x92, 0x0c, 0x42, 0x10, 0x8a, 0xe7, 0x0b, 0xb3, 0x97, 0x0d, 0xa1, 0x78, 0xd5, - 0x30, 0x92, 0xc8, 0xb1, 0x9f, 0x1d, 0x30, 0x45, 0x99, 0x89, 0xc7, 0x8b, 0x67, 0x22, 0x3f, 0xd2, - 0x4c, 0xcb, 0xbf, 0x72, 0x3c, 0x39, 0x08, 0xa5, 0xfd, 0xcf, 0xec, 0x15, 0x13, 0x7b, 0x3a, 0x20, - 0x18, 0xc9, 0x20, 0xf0, 0x67, 0x68, 0x23, 0x08, 0x03, 0x4d, 0xd5, 0x26, 0x87, 0xcc, 0x5e, 0x95, - 0x46, 0xf7, 0x45, 0x13, 0x1e, 0xe5, 0x55, 0x64, 0x16, 0x3b, 0x53, 0x85, 0xa5, 0x85, 0xab, 0xb0, - 0xe9, 0x5c, 0x5e, 0x55, 0x97, 0x5e, 0x5c, 0x55, 0x97, 0x5e, 0x5e, 0x55, 0x97, 0x7e, 0x99, 0x56, - 0xad, 0xcb, 0x69, 0xd5, 0x7a, 0x31, 0xad, 0x5a, 0x2f, 0xa7, 0x55, 0xeb, 0xef, 0x69, 0xd5, 0xfa, - 0xfd, 0x9f, 0xea, 0xd2, 0xb7, 0x25, 0x9d, 0x84, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x55, 0x14, - 0x18, 0x3e, 0x94, 0x0d, 0x00, 0x00, + // 1258 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x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 0x9c, 0x5e, 0x34, 0xee, 0x2b, 0xf7, 0x85, 0x94, 0x86, 0xa4, 0x3d, 0x6d, 0x7d, 0x8e, + 0x4a, 0xf3, 0x56, 0xb8, 0x84, 0x32, 0x03, 0xb8, 0x90, 0x53, 0x3c, 0x4f, 0xc4, 0x27, 0x7e, 0x80, + 0xb2, 0x63, 0x67, 0x18, 0x42, 0x34, 0x7a, 0x49, 0x74, 0xf8, 0xf4, 0xce, 0x81, 0x51, 0x7b, 0x61, + 0xa0, 0xbc, 0x74, 0x7e, 0xe4, 0x32, 0x8e, 0x7f, 0xb8, 0xb1, 0x04, 0xac, 0xe5, 0x32, 0x26, 0xac, + 0xe5, 0x0a, 0x28, 0xa9, 0x88, 0x73, 0xb1, 0x24, 0xb5, 0x00, 0xce, 0x50, 0xd6, 0xe5, 0x30, 0x62, + 0xe6, 0x1d, 0x99, 0x1e, 0xfb, 0x96, 0xe9, 0x69, 0xac, 0xc7, 0x63, 0xb5, 0x29, 0x58, 0x48, 0x44, + 0x56, 0xfb, 0xc3, 0x40, 0xc5, 0x2f, 0xa9, 0x1f, 0x06, 0x04, 0xa2, 0x59, 0xc1, 0xf0, 0x3b, 0x28, + 0xdb, 0x13, 0x92, 0x28, 0x05, 0xda, 0x2e, 0x82, 0x45, 0x3a, 0x31, 0x7b, 0x68, 0x6c, 0x21, 0x23, + 0x52, 0xb3, 0x27, 0xa1, 0x21, 0x5a, 0x8f, 0x1f, 0x89, 0x4e, 0x8d, 0x0e, 0xc7, 0xce, 0x08, 0x98, + 0x99, 0x91, 0x06, 0xaa, 0xff, 0x52, 0x0a, 0x32, 0x8b, 0xab, 0xfd, 0x9a, 0x41, 0x1b, 0x73, 0xa3, + 0x07, 0x6f, 0xa3, 0x5c, 0x0c, 0x52, 0x11, 0x26, 0x59, 0x8b, 0xb9, 0x48, 0x82, 0xc0, 0x36, 0xca, + 0x7b, 0x82, 0x2a, 0x70, 0x3a, 0xea, 0xff, 0xe9, 0xe5, 0x76, 0x1c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0x02, 0x29, 0xde, 0x20, 0x8c, 0x44, 0x72, 0x6c, 0x21, 0x24, 0x3e, 0xe4, 0x8c, 0x88, + 0x53, 0x5b, 0x14, 0xa9, 0x6d, 0x25, 0x52, 0x92, 0x42, 0x08, 0x42, 0xf1, 0xee, 0x62, 0xe6, 0xaa, + 0x26, 0x14, 0xcf, 0x31, 0x46, 0x22, 0x39, 0x76, 0xd3, 0x03, 0x26, 0x2b, 0x33, 0x71, 0xb0, 0x7c, + 0x26, 0x66, 0x47, 0x9a, 0x6e, 0xf9, 0x37, 0x8e, 0x27, 0x0b, 0xa1, 0xa4, 0xff, 0x99, 0x79, 0x57, + 0xc7, 0x9e, 0x0c, 0x08, 0x46, 0x52, 0x08, 0xfc, 0x19, 0xda, 0xf0, 0x7c, 0x2f, 0xa6, 0x6a, 0x91, + 0x23, 0x66, 0xae, 0x49, 0xa3, 0xfb, 0xa2, 0x09, 0x8f, 0x67, 0x55, 0x64, 0x1e, 0x3b, 0x57, 0x85, + 0xb9, 0xa5, 0xab, 0xb0, 0x61, 0x5d, 0x5e, 0x95, 0x57, 0x5e, 0x5e, 0x95, 0x57, 0x5e, 0x5d, 0x95, + 0x57, 0x7e, 0x99, 0x96, 0x8d, 0xcb, 0x69, 0xd9, 0x78, 0x39, 0x2d, 0x1b, 0xaf, 0xa6, 0x65, 0xe3, + 0xaf, 0x69, 0xd9, 0xf8, 0xfd, 0xef, 0xf2, 0xca, 0x77, 0xb9, 0x38, 0x09, 0xff, 0x04, 0x00, 0x00, + 0xff, 0xff, 0x3e, 0x3d, 0x28, 0x0e, 0x4d, 0x0e, 0x00, 0x00, } diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.proto b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.proto index 926eb65ed..2043e9ea8 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.proto +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.proto @@ -97,6 +97,14 @@ message Event { // Time the request reached current audit stage. // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime stageTimestamp = 16; + + // Annotations is an unstructured key value map stored with an audit event that may be set by + // plugins invoked in the request serving chain, including authentication, authorization and + // admission plugins. Keys should uniquely identify the informing component to avoid name + // collisions (e.g. podsecuritypolicy.admission.k8s.io/policy). Values should be short. Annotations + // are included in the Metadata level. + // +optional + map annotations = 17; } // EventList is a list of audit Events. @@ -114,10 +122,19 @@ message GroupResources { // +optional optional string group = 1; - // Resources is a list of resources within the API group. Subresources are - // matched using a "/" to indicate the subresource. For example, "pods/logs" - // would match request to the logs subresource of pods. The top level resource - // does not match subresources, "pods" doesn't match "pods/logs". + // Resources is a list of resources this rule applies to. + // + // For example: + // 'pods' matches pods. + // 'pods/log' matches the log subresource of pods. + // '*' matches all resources and their subresources. + // 'pods/*' matches all subresources of pods. + // '*/scale' matches all scale subresources. + // + // If wildcard is present, the validation rule will ensure resources do not + // overlap with each other. + // + // An empty list implies all resources and subresources in this API groups apply. // +optional repeated string resources = 2; diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go index 21f10c78d..7e8af12b8 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go @@ -132,6 +132,14 @@ type Event struct { // Time the request reached current audit stage. // +optional StageTimestamp metav1.MicroTime `json:"stageTimestamp" protobuf:"bytes,16,opt,name=stageTimestamp"` + + // Annotations is an unstructured key value map stored with an audit event that may be set by + // plugins invoked in the request serving chain, including authentication, authorization and + // admission plugins. Keys should uniquely identify the informing component to avoid name + // collisions (e.g. podsecuritypolicy.admission.k8s.io/policy). Values should be short. Annotations + // are included in the Metadata level. + // +optional + Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,17,rep,name=annotations"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -233,10 +241,19 @@ type GroupResources struct { // The empty string represents the core API group. // +optional Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"` - // Resources is a list of resources within the API group. Subresources are - // matched using a "/" to indicate the subresource. For example, "pods/logs" - // would match request to the logs subresource of pods. The top level resource - // does not match subresources, "pods" doesn't match "pods/logs". + // Resources is a list of resources this rule applies to. + // + // For example: + // 'pods' matches pods. + // 'pods/log' matches the log subresource of pods. + // '*' matches all resources and their subresources. + // 'pods/*' matches all subresources of pods. + // '*/scale' matches all scale subresources. + // + // If wildcard is present, the validation rule will ensure resources do not + // overlap with each other. + // + // An empty list implies all resources and subresources in this API groups apply. // +optional Resources []string `json:"resources,omitempty" protobuf:"bytes,2,rep,name=resources"` // ResourceNames is a list of resource instance names that the policy matches. diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.conversion.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.conversion.go index b3b27c31c..d12466044 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.conversion.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.conversion.go @@ -16,18 +16,19 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package v1alpha1 import ( + unsafe "unsafe" + authentication_v1 "k8s.io/api/authentication/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" audit "k8s.io/apiserver/pkg/apis/audit" - unsafe "unsafe" ) func init() { @@ -83,6 +84,7 @@ func autoConvert_v1alpha1_Event_To_audit_Event(in *Event, out *audit.Event, s co out.ResponseObject = (*runtime.Unknown)(unsafe.Pointer(in.ResponseObject)) out.RequestReceivedTimestamp = in.RequestReceivedTimestamp out.StageTimestamp = in.StageTimestamp + out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) return nil } @@ -112,6 +114,7 @@ func autoConvert_audit_Event_To_v1alpha1_Event(in *audit.Event, out *Event, s co out.ResponseObject = (*runtime.Unknown)(unsafe.Pointer(in.ResponseObject)) out.RequestReceivedTimestamp = in.RequestReceivedTimestamp out.StageTimestamp = in.StageTimestamp + out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) return nil } diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.deepcopy.go index bb4ea5310..ab3c5320c 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 @@ -85,6 +85,13 @@ func (in *Event) DeepCopyInto(out *Event) { } in.RequestReceivedTimestamp.DeepCopyInto(&out.RequestReceivedTimestamp) in.StageTimestamp.DeepCopyInto(&out.StageTimestamp) + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } return } @@ -102,9 +109,8 @@ func (in *Event) DeepCopy() *Event { func (in *Event) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -136,9 +142,8 @@ func (in *EventList) DeepCopy() *EventList { func (in *EventList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -217,9 +222,8 @@ func (in *Policy) DeepCopy() *Policy { func (in *Policy) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -251,9 +255,8 @@ func (in *PolicyList) DeepCopy() *PolicyList { func (in *PolicyList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.defaults.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.defaults.go index 5e24d22ca..2bd0078a3 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.defaults.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.defaults.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by defaulter-gen. Do not edit it manually! +// Code generated by defaulter-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/BUILD b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/BUILD index 07e14e74c..6088e4aa6 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/BUILD +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/BUILD @@ -21,6 +21,7 @@ go_library( importpath = "k8s.io/apiserver/pkg/apis/audit/v1beta1", deps = [ "//vendor/github.com/gogo/protobuf/proto:go_default_library", + "//vendor/github.com/gogo/protobuf/sortkeys:go_default_library", "//vendor/k8s.io/api/authentication/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library", @@ -54,8 +55,7 @@ filegroup( go_test( name = "go_default_test", srcs = ["conversion_test.go"], - importpath = "k8s.io/apiserver/pkg/apis/audit/v1beta1", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.pb.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.pb.go index b982df3ed..5cfab75fa 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.pb.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.pb.go @@ -45,6 +45,8 @@ import k8s_io_apimachinery_pkg_runtime "k8s.io/apimachinery/pkg/runtime" import k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" +import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + import strings "strings" import reflect "reflect" @@ -240,6 +242,30 @@ func (m *Event) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n10 + if len(m.Annotations) > 0 { + keysForAnnotations := make([]string, 0, len(m.Annotations)) + for k := range m.Annotations { + keysForAnnotations = append(keysForAnnotations, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + for _, k := range keysForAnnotations { + dAtA[i] = 0x8a + i++ + dAtA[i] = 0x1 + i++ + v := m.Annotations[string(k)] + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } return i, nil } @@ -674,6 +700,14 @@ func (m *Event) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.StageTimestamp.Size() n += 2 + l + sovGenerated(uint64(l)) + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } return n } @@ -834,6 +868,16 @@ func (this *Event) String() string { if this == nil { return "nil" } + keysForAnnotations := make([]string, 0, len(this.Annotations)) + for k := range this.Annotations { + keysForAnnotations = append(keysForAnnotations, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + mapStringForAnnotations := "map[string]string{" + for _, k := range keysForAnnotations { + mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + } + mapStringForAnnotations += "}" s := strings.Join([]string{`&Event{`, `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Level:` + fmt.Sprintf("%v", this.Level) + `,`, @@ -851,6 +895,7 @@ func (this *Event) String() string { `ResponseObject:` + strings.Replace(fmt.Sprintf("%v", this.ResponseObject), "Unknown", "k8s_io_apimachinery_pkg_runtime.Unknown", 1) + `,`, `RequestReceivedTimestamp:` + strings.Replace(strings.Replace(this.RequestReceivedTimestamp.String(), "MicroTime", "k8s_io_apimachinery_pkg_apis_meta_v1.MicroTime", 1), `&`, ``, 1) + `,`, `StageTimestamp:` + strings.Replace(strings.Replace(this.StageTimestamp.String(), "MicroTime", "k8s_io_apimachinery_pkg_apis_meta_v1.MicroTime", 1), `&`, ``, 1) + `,`, + `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s @@ -1461,6 +1506,122 @@ func (m *Event) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + var keykey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + keykey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + if m.Annotations == nil { + m.Annotations = make(map[string]string) + } + if iNdEx < postIndex { + var valuekey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + valuekey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + m.Annotations[mapkey] = mapvalue + } else { + var mapvalue string + m.Annotations[mapkey] = mapvalue + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2657,81 +2818,86 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 1216 bytes of a gzipped FileDescriptorProto + // 1283 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0xd6, 0x71, 0x63, 0x4f, 0x1a, 0x27, 0x9d, 0x22, 0xba, 0xca, 0xc1, 0x36, 0x46, 0x82, - 0x08, 0xd2, 0xdd, 0xa6, 0x2d, 0x24, 0x17, 0x0e, 0xb1, 0x8a, 0xc0, 0x52, 0x1a, 0xa2, 0x71, 0x5c, - 0x21, 0xe0, 0xc0, 0xda, 0x7e, 0xb1, 0x87, 0xd8, 0xbb, 0xcb, 0xcc, 0xac, 0x51, 0x6e, 0xfc, 0x01, - 0x24, 0xee, 0xfc, 0x0b, 0x7e, 0x40, 0xc5, 0x81, 0x43, 0x8e, 0x3d, 0xf6, 0x64, 0x11, 0xf3, 0x2f, - 0x22, 0x21, 0xa1, 0x99, 0x9d, 0xdd, 0x59, 0xdb, 0x35, 0x75, 0x38, 0xf4, 0xb6, 0xf3, 0xde, 0xf7, - 0x7d, 0xf3, 0xe6, 0xcd, 0x7b, 0x6f, 0x16, 0x9d, 0x9c, 0x1f, 0x70, 0x87, 0x06, 0xee, 0x79, 0xd4, - 0x06, 0xe6, 0x83, 0x00, 0xee, 0x8e, 0xc0, 0xef, 0x06, 0xcc, 0xd5, 0x0e, 0x2f, 0xa4, 0x1c, 0x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 0x18, 0x6d, 0xc8, 0xc2, 0x34, 0x9e, 0x98, 0xeb, 0x32, 0x99, 0xc7, 0x0a, 0xbe, 0x71, 0x18, + 0x99, 0xaf, 0x26, 0x95, 0x77, 0x97, 0xed, 0x04, 0x3f, 0x0f, 0x80, 0x59, 0xad, 0xc6, 0x13, 0x12, + 0x8b, 0x88, 0xa5, 0x31, 0xee, 0xf4, 0xc0, 0xcc, 0xce, 0x2e, 0xad, 0x29, 0x8c, 0x57, 0xf1, 0x80, + 0x44, 0x20, 0xbc, 0x87, 0x10, 0x85, 0x9f, 0x42, 0x60, 0xbc, 0x45, 0x1a, 0xe6, 0x4d, 0x49, 0x49, + 0x4a, 0x47, 0x12, 0x0f, 0x49, 0xa1, 0x70, 0x15, 0xad, 0x8f, 0x81, 0xb6, 0xcd, 0x0d, 0x89, 0xbe, + 0xa5, 0xd0, 0xeb, 0xcf, 0x81, 0xb6, 0x89, 0xf4, 0xe0, 0xaf, 0xd0, 0x7a, 0xc8, 0x80, 0x9a, 0x39, + 0x59, 0xab, 0xf7, 0x53, 0xb5, 0xb2, 0x66, 0x6f, 0x85, 0xa8, 0x51, 0x8b, 0x01, 0x6d, 0x78, 0x67, + 0xbe, 0x56, 0x12, 0x16, 0x22, 0x15, 0x70, 0x1f, 0x95, 0xdc, 0x51, 0x00, 0x94, 0xf9, 0x9e, 0x38, + 0x2a, 0xc2, 0x63, 0xe6, 0xaf, 0xa5, 0x7a, 0x77, 0x3a, 0xa9, 0x94, 0x1a, 0x73, 0x1a, 0x64, 0x41, + 0x15, 0x7f, 0x84, 0xf2, 0xcc, 0x0f, 0x69, 0x07, 0x1a, 0x27, 0xcc, 0x44, 0xd5, 0xcc, 0x4e, 0xbe, + 0xbe, 0x29, 0x36, 0xad, 0x19, 0x1b, 0x89, 0xf6, 0x63, 0x40, 0x79, 0x5f, 0x9e, 0x2b, 0x02, 0x67, + 0x66, 0x41, 0xe6, 0x73, 0x60, 0xad, 0xd8, 0x53, 0xd4, 0x29, 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, 0x90, 0x74, 0xa0, 0xed, 0xcf, 0x51, 0x69, 0x9e, 0x85, 0x4b, 0x28, 0x33, 0x80, 0x73, + 0xd9, 0xc3, 0xf3, 0x44, 0x0c, 0xf1, 0x5d, 0x94, 0x1d, 0x3b, 0xc3, 0x10, 0xa2, 0xc6, 0x4b, 0xa2, + 0xc9, 0xa7, 0x37, 0x0e, 0x8c, 0xda, 0x0b, 0x03, 0xe5, 0x65, 0xf0, 0x23, 0x97, 0x71, 0xfc, 0xfd, + 0xc2, 0x13, 0x60, 0xad, 0x56, 0x30, 0xc1, 0x96, 0x0f, 0x40, 0x49, 0x65, 0x9c, 0x8b, 0x2d, 0xa9, + 0xf6, 0xdf, 0x44, 0x59, 0x97, 0xc3, 0x88, 0x99, 0x37, 0x64, 0x75, 0xac, 0xeb, 0x55, 0xa7, 0xbe, + 0x19, 0xf7, 0xd4, 0x86, 0x10, 0x21, 0x91, 0x56, 0xed, 0x77, 0x03, 0x15, 0xbf, 0xa4, 0x7e, 0x18, + 0x10, 0x88, 0x1a, 0x05, 0xc3, 0xef, 0xa1, 0x6c, 0x4f, 0x58, 0xa2, 0x0a, 0x68, 0x5e, 0x04, 0x8b, + 0x7c, 0xa2, 0xf1, 0xd0, 0x98, 0x21, 0x13, 0x52, 0x8d, 0x27, 0x91, 0x21, 0xda, 0x8f, 0xf7, 0xc5, + 0x3d, 0x8d, 0x26, 0xc7, 0xce, 0x08, 0x98, 0x99, 0x91, 0x04, 0x75, 0xfb, 0x52, 0x0e, 0x32, 0x8b, + 0xab, 0xfd, 0x91, 0x41, 0x5b, 0x73, 0x8d, 0x07, 0xef, 0xa2, 0x5c, 0x0c, 0x52, 0x19, 0x26, 0x45, + 0x8b, 0xb5, 0x48, 0x82, 0xc0, 0x36, 0xca, 0x7b, 0x42, 0x2a, 0x70, 0x3a, 0x6a, 0xfb, 0xf4, 0xcb, + 0x76, 0x1c, 0x3b, 0x88, 0xc6, 0x88, 0x77, 0x42, 0x4c, 0xe4, 0x8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e, 0x15, 0x94, 0x15, 0xbf, 0xa0, 0xb8, 0x2d, 0xe4, 0x05, 0x52, 0x7c, 0x56, 0x18, 0x89, + 0xec, 0xd8, 0x42, 0x48, 0x0c, 0xe4, 0xd9, 0x8e, 0x2b, 0x5b, 0x14, 0x95, 0x6d, 0x25, 0x56, 0x92, + 0x42, 0x08, 0x41, 0xf1, 0x41, 0x63, 0xe6, 0xba, 0x16, 0x14, 0xff, 0x36, 0x46, 0x22, 0x3b, 0xee, + 0xa7, 0x9b, 0x51, 0x56, 0x16, 0x62, 0x7f, 0xe5, 0x42, 0xcc, 0x76, 0x3f, 0xdd, 0x1d, 0x5e, 0xdb, + 0xc9, 0x2c, 0x84, 0x92, 0x56, 0xc1, 0xcc, 0x9b, 0x3a, 0xf5, 0xa4, 0x97, 0x30, 0x92, 0x42, 0xe0, + 0xcf, 0xd0, 0x96, 0xe7, 0x7b, 0xb1, 0x54, 0x8b, 0x1c, 0x31, 0x73, 0x43, 0x92, 0xee, 0x88, 0x1b, + 0x78, 0x3c, 0xeb, 0x22, 0xf3, 0xd8, 0xb9, 0x33, 0x98, 0x5b, 0xf9, 0x0c, 0xd6, 0xef, 0x5f, 0x5c, + 0x96, 0xd7, 0x5e, 0x5e, 0x96, 0xd7, 0x5e, 0x5d, 0x96, 0xd7, 0x7e, 0x99, 0x96, 0x8d, 0x8b, 0x69, + 0xd9, 0x78, 0x39, 0x2d, 0x1b, 0xaf, 0xa6, 0x65, 0xe3, 0xaf, 0x69, 0xd9, 0xf8, 0xed, 0xef, 0xf2, + 0xda, 0xb7, 0x1b, 0xaa, 0x06, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x5e, 0xf6, 0x8d, 0xaa, 0xac, + 0x0e, 0x00, 0x00, } diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.proto b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.proto index bbac7f2b7..fcbf669ae 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.proto +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.proto @@ -101,6 +101,14 @@ message Event { // Time the request reached current audit stage. // +optional optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime stageTimestamp = 16; + + // Annotations is an unstructured key value map stored with an audit event that may be set by + // plugins invoked in the request serving chain, including authentication, authorization and + // admission plugins. Keys should uniquely identify the informing component to avoid name + // collisions (e.g. podsecuritypolicy.admission.k8s.io/policy). Values should be short. Annotations + // are included in the Metadata level. + // +optional + map annotations = 17; } // EventList is a list of audit Events. @@ -118,10 +126,19 @@ message GroupResources { // +optional optional string group = 1; - // Resources is a list of resources within the API group. Subresources are - // matched using a "/" to indicate the subresource. For example, "pods/log" - // would match request to the log subresource of pods. The top level resource - // does not match subresources, "pods" doesn't match "pods/log". + // Resources is a list of resources this rule applies to. + // + // For example: + // 'pods' matches pods. + // 'pods/log' matches the log subresource of pods. + // '*' matches all resources and their subresources. + // 'pods/*' matches all subresources of pods. + // '*/scale' matches all scale subresources. + // + // If wildcard is present, the validation rule will ensure resources do not + // overlap with each other. + // + // An empty list implies all resources and subresources in this API groups apply. // +optional repeated string resources = 2; diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go index 259599c05..0c3299b4a 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go @@ -62,7 +62,7 @@ const ( // The stage for events generated once the response body has been completed, and no more bytes // will be sent. StageResponseComplete = "ResponseComplete" - // The stage for events generated when a panic occured. + // The stage for events generated when a panic occurred. StagePanic = "Panic" ) @@ -128,6 +128,14 @@ type Event struct { // Time the request reached current audit stage. // +optional StageTimestamp metav1.MicroTime `json:"stageTimestamp" protobuf:"bytes,16,opt,name=stageTimestamp"` + + // Annotations is an unstructured key value map stored with an audit event that may be set by + // plugins invoked in the request serving chain, including authentication, authorization and + // admission plugins. Keys should uniquely identify the informing component to avoid name + // collisions (e.g. podsecuritypolicy.admission.k8s.io/policy). Values should be short. Annotations + // are included in the Metadata level. + // +optional + Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,17,rep,name=annotations"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -229,10 +237,19 @@ type GroupResources struct { // The empty string represents the core API group. // +optional Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"` - // Resources is a list of resources within the API group. Subresources are - // matched using a "/" to indicate the subresource. For example, "pods/log" - // would match request to the log subresource of pods. The top level resource - // does not match subresources, "pods" doesn't match "pods/log". + // Resources is a list of resources this rule applies to. + // + // For example: + // 'pods' matches pods. + // 'pods/log' matches the log subresource of pods. + // '*' matches all resources and their subresources. + // 'pods/*' matches all subresources of pods. + // '*/scale' matches all scale subresources. + // + // If wildcard is present, the validation rule will ensure resources do not + // overlap with each other. + // + // An empty list implies all resources and subresources in this API groups apply. // +optional Resources []string `json:"resources,omitempty" protobuf:"bytes,2,rep,name=resources"` // ResourceNames is a list of resource instance names that the policy matches. diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.conversion.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.conversion.go index c29f61e74..01e5d4a9d 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.conversion.go @@ -16,18 +16,19 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package v1beta1 import ( + unsafe "unsafe" + authentication_v1 "k8s.io/api/authentication/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" audit "k8s.io/apiserver/pkg/apis/audit" - unsafe "unsafe" ) func init() { @@ -75,6 +76,7 @@ func autoConvert_v1beta1_Event_To_audit_Event(in *Event, out *audit.Event, s con out.ResponseObject = (*runtime.Unknown)(unsafe.Pointer(in.ResponseObject)) out.RequestReceivedTimestamp = in.RequestReceivedTimestamp out.StageTimestamp = in.StageTimestamp + out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) return nil } @@ -96,6 +98,7 @@ func autoConvert_audit_Event_To_v1beta1_Event(in *audit.Event, out *Event, s con out.ResponseObject = (*runtime.Unknown)(unsafe.Pointer(in.ResponseObject)) out.RequestReceivedTimestamp = in.RequestReceivedTimestamp out.StageTimestamp = in.StageTimestamp + out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) return nil } diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.deepcopy.go index 67f5fdac3..e85589758 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 @@ -85,6 +85,13 @@ func (in *Event) DeepCopyInto(out *Event) { } in.RequestReceivedTimestamp.DeepCopyInto(&out.RequestReceivedTimestamp) in.StageTimestamp.DeepCopyInto(&out.StageTimestamp) + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } return } @@ -102,9 +109,8 @@ func (in *Event) DeepCopy() *Event { func (in *Event) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -136,9 +142,8 @@ func (in *EventList) DeepCopy() *EventList { func (in *EventList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -217,9 +222,8 @@ func (in *Policy) DeepCopy() *Policy { func (in *Policy) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -251,9 +255,8 @@ func (in *PolicyList) DeepCopy() *PolicyList { func (in *PolicyList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.defaults.go b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.defaults.go index b61dda74c..544e569dc 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.defaults.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.defaults.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by defaulter-gen. Do not edit it manually! +// Code generated by defaulter-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/validation/BUILD b/vendor/k8s.io/apiserver/pkg/apis/audit/validation/BUILD index 956db3591..960213674 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/validation/BUILD +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/validation/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["validation_test.go"], - importpath = "k8s.io/apiserver/pkg/apis/audit/validation", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apiserver/pkg/apis/audit:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go index c52aea05a..521b96a9b 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package audit @@ -82,6 +82,13 @@ func (in *Event) DeepCopyInto(out *Event) { } in.RequestReceivedTimestamp.DeepCopyInto(&out.RequestReceivedTimestamp) in.StageTimestamp.DeepCopyInto(&out.StageTimestamp) + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } return } @@ -99,9 +106,8 @@ func (in *Event) DeepCopy() *Event { func (in *Event) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -133,9 +139,28 @@ func (in *EventList) DeepCopy() *EventList { func (in *EventList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ExtraValue) DeepCopyInto(out *ExtraValue) { + { + in := &in + *out = make(ExtraValue, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraValue. +func (in ExtraValue) DeepCopy() ExtraValue { + if in == nil { return nil } + out := new(ExtraValue) + in.DeepCopyInto(out) + return *out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -214,9 +239,8 @@ func (in *Policy) DeepCopy() *Policy { func (in *Policy) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -248,9 +272,8 @@ func (in *PolicyList) DeepCopy() *PolicyList { func (in *PolicyList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -318,8 +341,12 @@ func (in *UserInfo) DeepCopyInto(out *UserInfo) { in, out := &in.Extra, &out.Extra *out = make(map[string]ExtraValue, len(*in)) for key, val := range *in { - (*out)[key] = make(ExtraValue, len(val)) - copy((*out)[key], val) + if val == nil { + (*out)[key] = nil + } else { + (*out)[key] = make([]string, len(val)) + copy((*out)[key], val) + } } } return diff --git a/vendor/k8s.io/apiserver/pkg/apis/example/install/BUILD b/vendor/k8s.io/apiserver/pkg/apis/example/install/BUILD index 69f1cbb7b..011bc1dff 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example/install/BUILD +++ b/vendor/k8s.io/apiserver/pkg/apis/example/install/BUILD @@ -22,8 +22,7 @@ go_library( go_test( name = "go_default_test", srcs = ["roundtrip_test.go"], - importpath = "k8s.io/apiserver/pkg/apis/example/install", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/api/testing/roundtrip:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/example/fuzzer:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/apis/example/v1/BUILD b/vendor/k8s.io/apiserver/pkg/apis/example/v1/BUILD index 8fe73ebfe..2e10de650 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example/v1/BUILD +++ b/vendor/k8s.io/apiserver/pkg/apis/example/v1/BUILD @@ -14,7 +14,6 @@ go_library( "generated.pb.go", "register.go", "types.go", - "types_swagger_doc_generated.go", "zz_generated.conversion.go", "zz_generated.deepcopy.go", "zz_generated.defaults.go", diff --git a/vendor/k8s.io/apiserver/pkg/apis/example/v1/generated.proto b/vendor/k8s.io/apiserver/pkg/apis/example/v1/generated.proto index de59bc3dd..dc78ca40e 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example/v1/generated.proto +++ b/vendor/k8s.io/apiserver/pkg/apis/example/v1/generated.proto @@ -122,7 +122,7 @@ message PodSpec { map nodeSelector = 7; // ServiceAccountName is the name of the ServiceAccount to use to run this pod. - // More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md + // More info: https://git.k8s.io/community/contributors/design-proposals/auth/service_accounts.md // +optional optional string serviceAccountName = 8; diff --git a/vendor/k8s.io/apiserver/pkg/apis/example/v1/types.go b/vendor/k8s.io/apiserver/pkg/apis/example/v1/types.go index 7be2a0c6f..06c3f9f88 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example/v1/types.go +++ b/vendor/k8s.io/apiserver/pkg/apis/example/v1/types.go @@ -136,7 +136,7 @@ type PodSpec struct { NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,7,rep,name=nodeSelector"` // ServiceAccountName is the name of the ServiceAccount to use to run this pod. - // More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md + // More info: https://git.k8s.io/community/contributors/design-proposals/auth/service_accounts.md // +optional ServiceAccountName string `json:"serviceAccountName,omitempty" protobuf:"bytes,8,opt,name=serviceAccountName"` // DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. diff --git a/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.conversion.go b/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.conversion.go index e1bfe92b2..dbdbcabad 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.conversion.go +++ b/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.conversion.go @@ -16,16 +16,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package v1 import ( + unsafe "unsafe" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" example "k8s.io/apiserver/pkg/apis/example" - unsafe "unsafe" ) func init() { diff --git a/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.deepcopy.go index 8a28b30b5..c8d841365 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.deepcopy.go @@ -16,12 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 import ( - meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -49,9 +48,8 @@ func (in *Pod) DeepCopy() *Pod { func (in *Pod) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -101,9 +99,8 @@ func (in *PodList) DeepCopy() *PodList { func (in *PodList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -162,8 +159,7 @@ func (in *PodStatus) DeepCopyInto(out *PodStatus) { if *in == nil { *out = nil } else { - *out = new(meta_v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } return diff --git a/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.defaults.go b/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.defaults.go index 88d7af085..40d9ab00e 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.defaults.go +++ b/vendor/k8s.io/apiserver/pkg/apis/example/v1/zz_generated.defaults.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by defaulter-gen. Do not edit it manually! +// Code generated by defaulter-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/apiserver/pkg/apis/example/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/example/zz_generated.deepcopy.go index 7a102f3e1..9ae912746 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/apis/example/zz_generated.deepcopy.go @@ -16,12 +16,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package example import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -49,9 +48,8 @@ func (in *Pod) DeepCopy() *Pod { func (in *Pod) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -101,9 +99,8 @@ func (in *PodList) DeepCopy() *PodList { func (in *PodList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -162,8 +159,7 @@ func (in *PodStatus) DeepCopyInto(out *PodStatus) { if *in == nil { *out = nil } else { - *out = new(v1.Time) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } } return @@ -203,9 +199,8 @@ func (in *ReplicaSet) DeepCopy() *ReplicaSet { func (in *ReplicaSet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/apiserver/pkg/apis/example2/install/BUILD b/vendor/k8s.io/apiserver/pkg/apis/example2/install/BUILD index 30d67d313..2bcdf82d9 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example2/install/BUILD +++ b/vendor/k8s.io/apiserver/pkg/apis/example2/install/BUILD @@ -23,8 +23,7 @@ go_library( go_test( name = "go_default_test", srcs = ["roundtrip_test.go"], - importpath = "k8s.io/apiserver/pkg/apis/example2/install", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/api/testing/roundtrip:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/example/fuzzer:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/apis/example2/v1/BUILD b/vendor/k8s.io/apiserver/pkg/apis/example2/v1/BUILD index 92280a1a1..b273bedfd 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example2/v1/BUILD +++ b/vendor/k8s.io/apiserver/pkg/apis/example2/v1/BUILD @@ -14,7 +14,6 @@ go_library( "generated.pb.go", "register.go", "types.go", - "types_swagger_doc_generated.go", "zz_generated.conversion.go", "zz_generated.deepcopy.go", "zz_generated.defaults.go", diff --git a/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.conversion.go b/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.conversion.go index 7e22d8e0d..551ab0154 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.conversion.go +++ b/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.conversion.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.deepcopy.go index f843a758d..c8a37af45 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -48,9 +48,8 @@ func (in *ReplicaSet) DeepCopy() *ReplicaSet { func (in *ReplicaSet) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.defaults.go b/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.defaults.go index 88d7af085..40d9ab00e 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.defaults.go +++ b/vendor/k8s.io/apiserver/pkg/apis/example2/v1/zz_generated.defaults.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by defaulter-gen. Do not edit it manually! +// Code generated by defaulter-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/apiserver/pkg/apis/example2/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/example2/zz_generated.deepcopy.go index 3d312899b..f4d4732ad 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example2/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/apis/example2/zz_generated.deepcopy.go @@ -16,6 +16,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package example2 diff --git a/vendor/k8s.io/apiserver/pkg/audit/BUILD b/vendor/k8s.io/apiserver/pkg/audit/BUILD index 525424cdd..bb477b602 100644 --- a/vendor/k8s.io/apiserver/pkg/audit/BUILD +++ b/vendor/k8s.io/apiserver/pkg/audit/BUILD @@ -38,10 +38,13 @@ go_library( go_test( name = "go_default_test", - srcs = ["union_test.go"], - importpath = "k8s.io/apiserver/pkg/audit", - library = ":go_default_library", + srcs = [ + "request_test.go", + "union_test.go", + ], + embed = [":go_default_library"], deps = [ + "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/audit:go_default_library", ], diff --git a/vendor/k8s.io/apiserver/pkg/audit/policy/BUILD b/vendor/k8s.io/apiserver/pkg/audit/policy/BUILD index 17d5881b0..893935d32 100644 --- a/vendor/k8s.io/apiserver/pkg/audit/policy/BUILD +++ b/vendor/k8s.io/apiserver/pkg/audit/policy/BUILD @@ -12,8 +12,7 @@ go_test( "checker_test.go", "reader_test.go", ], - importpath = "k8s.io/apiserver/pkg/audit/policy", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/github.com/stretchr/testify/require:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/audit/policy/checker.go b/vendor/k8s.io/apiserver/pkg/audit/policy/checker.go index 3259013ad..41c6b1a49 100644 --- a/vendor/k8s.io/apiserver/pkg/audit/policy/checker.go +++ b/vendor/k8s.io/apiserver/pkg/audit/policy/checker.go @@ -76,14 +76,18 @@ func (p *policyChecker) LevelAndStages(attrs authorizer.Attributes) (audit.Level // Check whether the rule matches the request attrs. func ruleMatches(r *audit.PolicyRule, attrs authorizer.Attributes) bool { - if len(r.Users) > 0 && attrs.GetUser() != nil { - if !hasString(r.Users, attrs.GetUser().GetName()) { + user := attrs.GetUser() + if len(r.Users) > 0 { + if user == nil || !hasString(r.Users, user.GetName()) { return false } } - if len(r.UserGroups) > 0 && attrs.GetUser() != nil { + if len(r.UserGroups) > 0 { + if user == nil { + return false + } matched := false - for _, group := range attrs.GetUser().GetGroups() { + for _, group := range user.GetGroups() { if hasString(r.UserGroups, group) { matched = true break @@ -160,11 +164,11 @@ func ruleMatchesResource(r *audit.PolicyRule, attrs authorizer.Attributes) bool apiGroup := attrs.GetAPIGroup() resource := attrs.GetResource() + subresource := attrs.GetSubresource() + combinedResource := resource // If subresource, the resource in the policy must match "(resource)/(subresource)" - // - // TODO: consider adding options like "pods/*" to match all subresources. - if sr := attrs.GetSubresource(); sr != "" { - resource = resource + "/" + sr + if subresource != "" { + combinedResource = resource + "/" + subresource } name := attrs.GetName() @@ -175,8 +179,17 @@ func ruleMatchesResource(r *audit.PolicyRule, attrs authorizer.Attributes) bool return true } for _, res := range gr.Resources { - if res == resource { - if len(gr.ResourceNames) == 0 || hasString(gr.ResourceNames, name) { + if len(gr.ResourceNames) == 0 || hasString(gr.ResourceNames, name) { + // match "*" + if res == combinedResource || res == "*" { + return true + } + // match "*/subresource" + if len(subresource) > 0 && strings.HasPrefix(res, "*/") && subresource == strings.TrimLeft(res, "*/") { + return true + } + // match "resource/*" + if strings.HasSuffix(res, "/*") && resource == strings.TrimRight(res, "/*") { return true } } diff --git a/vendor/k8s.io/apiserver/pkg/audit/policy/checker_test.go b/vendor/k8s.io/apiserver/pkg/audit/policy/checker_test.go index 0f323436a..d1818ef69 100644 --- a/vendor/k8s.io/apiserver/pkg/audit/policy/checker_test.go +++ b/vendor/k8s.io/apiserver/pkg/audit/policy/checker_test.go @@ -73,6 +73,16 @@ var ( ResourceRequest: true, Path: "/api/v1/namespaces/default/pods/busybox", }, + "Unauthorized": &authorizer.AttributesRecord{ + Verb: "get", + Namespace: "default", + APIGroup: "", // Core + APIVersion: "v1", + Resource: "pods", + Name: "busybox", + ResourceRequest: true, + Path: "/api/v1/namespaces/default/pods/busybox", + }, } rules = map[string]audit.PolicyRule{ @@ -105,6 +115,21 @@ var ( Verbs: []string{"get"}, Resources: []audit.GroupResources{{Resources: []string{"pods/log"}}}, }, + "getPodWildcardMatching": { + Level: audit.LevelRequest, + Verbs: []string{"get"}, + Resources: []audit.GroupResources{{Resources: []string{"*"}}}, + }, + "getPodResourceWildcardMatching": { + Level: audit.LevelRequest, + Verbs: []string{"get"}, + Resources: []audit.GroupResources{{Resources: []string{"*/log"}}}, + }, + "getPodSubResourceWildcardMatching": { + Level: audit.LevelRequest, + Verbs: []string{"get"}, + Resources: []audit.GroupResources{{Resources: []string{"pods/*"}}}, + }, "getClusterRoles": { Level: audit.LevelRequestResponse, Verbs: []string{"get"}, @@ -208,7 +233,14 @@ func testAuditLevel(t *testing.T, stages []audit.Stage) { test(t, "nonResource", audit.LevelNone, stages, stages, "getPodLogs", "getPods") test(t, "subresource", audit.LevelRequest, stages, stages, "getPodLogs", "getPods") + test(t, "subresource", audit.LevelRequest, stages, stages, "getPodWildcardMatching") + test(t, "subresource", audit.LevelRequest, stages, stages, "getPodResourceWildcardMatching") + test(t, "subresource", audit.LevelRequest, stages, stages, "getPodSubResourceWildcardMatching") + test(t, "Unauthorized", audit.LevelNone, stages, stages, "tims") + test(t, "Unauthorized", audit.LevelMetadata, stages, stages, "tims", "default") + test(t, "Unauthorized", audit.LevelNone, stages, stages, "humans") + test(t, "Unauthorized", audit.LevelMetadata, stages, stages, "humans", "default") } func TestChecker(t *testing.T) { diff --git a/vendor/k8s.io/apiserver/pkg/audit/request.go b/vendor/k8s.io/apiserver/pkg/audit/request.go index b738076a7..47c0fca80 100644 --- a/vendor/k8s.io/apiserver/pkg/audit/request.go +++ b/vendor/k8s.io/apiserver/pkg/audit/request.go @@ -32,7 +32,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" utilnet "k8s.io/apimachinery/pkg/util/net" - "k8s.io/apiserver/pkg/apis/audit" auditinternal "k8s.io/apiserver/pkg/apis/audit" "k8s.io/apiserver/pkg/authentication/user" "k8s.io/apiserver/pkg/authorization/authorizer" @@ -88,7 +87,7 @@ func NewEventFromRequest(req *http.Request, level auditinternal.Level, attribs a // LogImpersonatedUser fills in the impersonated user attributes into an audit event. func LogImpersonatedUser(ae *auditinternal.Event, user user.Info) { - if ae == nil || ae.Level.Less(audit.LevelMetadata) { + if ae == nil || ae.Level.Less(auditinternal.LevelMetadata) { return } ae.ImpersonatedUser = &auditinternal.UserInfo{ @@ -104,14 +103,14 @@ func LogImpersonatedUser(ae *auditinternal.Event, user user.Info) { // LogRequestObject fills in the request object into an audit event. The passed runtime.Object // will be converted to the given gv. -func LogRequestObject(ae *audit.Event, obj runtime.Object, gvr schema.GroupVersionResource, subresource string, s runtime.NegotiatedSerializer) { - if ae == nil || ae.Level.Less(audit.LevelMetadata) { +func LogRequestObject(ae *auditinternal.Event, obj runtime.Object, gvr schema.GroupVersionResource, subresource string, s runtime.NegotiatedSerializer) { + if ae == nil || ae.Level.Less(auditinternal.LevelMetadata) { return } // complete ObjectRef if ae.ObjectRef == nil { - ae.ObjectRef = &audit.ObjectReference{} + ae.ObjectRef = &auditinternal.ObjectReference{} } if acc, ok := obj.(metav1.ObjectMetaAccessor); ok { meta := acc.GetObjectMeta() @@ -128,7 +127,6 @@ func LogRequestObject(ae *audit.Event, obj runtime.Object, gvr schema.GroupVersi ae.ObjectRef.ResourceVersion = meta.GetResourceVersion() } } - // TODO: ObjectRef should include the API group. if len(ae.ObjectRef.APIVersion) == 0 { ae.ObjectRef.APIGroup = gvr.Group ae.ObjectRef.APIVersion = gvr.Version @@ -140,7 +138,7 @@ func LogRequestObject(ae *audit.Event, obj runtime.Object, gvr schema.GroupVersi ae.ObjectRef.Subresource = subresource } - if ae.Level.Less(audit.LevelRequest) { + if ae.Level.Less(auditinternal.LevelRequest) { return } @@ -154,9 +152,9 @@ func LogRequestObject(ae *audit.Event, obj runtime.Object, gvr schema.GroupVersi } } -// LogRquestPatch fills in the given patch as the request object into an audit event. -func LogRequestPatch(ae *audit.Event, patch []byte) { - if ae == nil || ae.Level.Less(audit.LevelRequest) { +// LogRequestPatch fills in the given patch as the request object into an audit event. +func LogRequestPatch(ae *auditinternal.Event, patch []byte) { + if ae == nil || ae.Level.Less(auditinternal.LevelRequest) { return } @@ -168,15 +166,15 @@ func LogRequestPatch(ae *audit.Event, patch []byte) { // LogResponseObject fills in the response object into an audit event. The passed runtime.Object // will be converted to the given gv. -func LogResponseObject(ae *audit.Event, obj runtime.Object, gv schema.GroupVersion, s runtime.NegotiatedSerializer) { - if ae == nil || ae.Level.Less(audit.LevelMetadata) { +func LogResponseObject(ae *auditinternal.Event, obj runtime.Object, gv schema.GroupVersion, s runtime.NegotiatedSerializer) { + if ae == nil || ae.Level.Less(auditinternal.LevelMetadata) { return } if status, ok := obj.(*metav1.Status); ok { ae.ResponseStatus = status } - if ae.Level.Less(audit.LevelRequestResponse) { + if ae.Level.Less(auditinternal.LevelRequestResponse) { return } // TODO(audit): hook into the serializer to avoid double conversion @@ -205,3 +203,28 @@ func encodeObject(obj runtime.Object, gv schema.GroupVersion, serializer runtime } return nil, fmt.Errorf("no json encoder found") } + +// LogAnnotation fills in the Annotations according to the key value pair. +func LogAnnotation(ae *auditinternal.Event, key, value string) { + if ae == nil || ae.Level.Less(auditinternal.LevelMetadata) { + return + } + if ae.Annotations == nil { + ae.Annotations = make(map[string]string) + } + if v, ok := ae.Annotations[key]; ok && v != value { + glog.Warningf("Failed to set annotations[%q] to %q for audit:%q, it has already been set to %q", key, value, ae.AuditID, ae.Annotations[key]) + return + } + ae.Annotations[key] = value +} + +// LogAnnotations fills in the Annotations according to the annotations map. +func LogAnnotations(ae *auditinternal.Event, annotations map[string]string) { + if ae == nil || ae.Level.Less(auditinternal.LevelMetadata) { + return + } + for key, value := range annotations { + LogAnnotation(ae, key, value) + } +} diff --git a/vendor/k8s.io/apiserver/pkg/audit/request_test.go b/vendor/k8s.io/apiserver/pkg/audit/request_test.go new file mode 100644 index 000000000..b8bfacbda --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/audit/request_test.go @@ -0,0 +1,38 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package audit + +import ( + "testing" + + "github.com/stretchr/testify/assert" + auditinternal "k8s.io/apiserver/pkg/apis/audit" +) + +func TestLogAnnotation(t *testing.T) { + ev := &auditinternal.Event{ + Level: auditinternal.LevelMetadata, + AuditID: "fake id", + } + LogAnnotation(ev, "foo", "bar") + LogAnnotation(ev, "foo", "baz") + assert.Equal(t, "bar", ev.Annotations["foo"], "audit annotation should not be overwritten.") + + LogAnnotation(ev, "qux", "") + LogAnnotation(ev, "qux", "baz") + assert.Equal(t, "", ev.Annotations["qux"], "audit annotation should not be overwritten.") +} diff --git a/vendor/k8s.io/apiserver/pkg/audit/union.go b/vendor/k8s.io/apiserver/pkg/audit/union.go index 856b5c125..6ee441533 100644 --- a/vendor/k8s.io/apiserver/pkg/audit/union.go +++ b/vendor/k8s.io/apiserver/pkg/audit/union.go @@ -17,6 +17,9 @@ limitations under the License. package audit import ( + "fmt" + "strings" + "k8s.io/apimachinery/pkg/util/errors" auditinternal "k8s.io/apiserver/pkg/apis/audit" ) @@ -55,3 +58,11 @@ func (u union) Shutdown() { backend.Shutdown() } } + +func (u union) String() string { + var backendStrings []string + for _, backend := range u.backends { + backendStrings = append(backendStrings, fmt.Sprintf("%s", backend)) + } + return fmt.Sprintf("union[%s]", strings.Join(backendStrings, ",")) +} diff --git a/vendor/k8s.io/apiserver/pkg/authentication/group/BUILD b/vendor/k8s.io/apiserver/pkg/authentication/group/BUILD index ea84fb9dc..e84022f3b 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/group/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authentication/group/BUILD @@ -12,8 +12,7 @@ go_test( "group_adder_test.go", "token_group_adder_test.go", ], - importpath = "k8s.io/apiserver/pkg/authentication/group", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library", "//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/authentication/request/anonymous/BUILD b/vendor/k8s.io/apiserver/pkg/authentication/request/anonymous/BUILD index c20d90c88..79738848a 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/request/anonymous/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authentication/request/anonymous/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["anonymous_test.go"], - importpath = "k8s.io/apiserver/pkg/authentication/request/anonymous", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/authentication/request/bearertoken/BUILD b/vendor/k8s.io/apiserver/pkg/authentication/request/bearertoken/BUILD index 93f6ad9e9..1443815cd 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/request/bearertoken/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authentication/request/bearertoken/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["bearertoken_test.go"], - importpath = "k8s.io/apiserver/pkg/authentication/request/bearertoken", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library", "//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/BUILD b/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/BUILD index a37735742..a5511a388 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["requestheader_test.go"], - importpath = "k8s.io/apiserver/pkg/authentication/request/headerrequest", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/pkg/authentication/request/union/BUILD b/vendor/k8s.io/apiserver/pkg/authentication/request/union/BUILD index 4b2dcadf2..ec4e17c89 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/request/union/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authentication/request/union/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["unionauth_test.go"], - importpath = "k8s.io/apiserver/pkg/authentication/request/union", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/pkg/authentication/request/websocket/BUILD b/vendor/k8s.io/apiserver/pkg/authentication/request/websocket/BUILD index 1ea8e4c5b..f5b500351 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/request/websocket/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authentication/request/websocket/BUILD @@ -20,8 +20,7 @@ go_library( go_test( name = "go_default_test", srcs = ["protocol_test.go"], - importpath = "k8s.io/apiserver/pkg/authentication/request/websocket", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library", "//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/authentication/request/x509/BUILD b/vendor/k8s.io/apiserver/pkg/authentication/request/x509/BUILD index 2114dc00b..45d1bda2e 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/request/x509/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authentication/request/x509/BUILD @@ -15,8 +15,7 @@ go_test( "testdata/intermediate.pem", "testdata/root.pem", ], - importpath = "k8s.io/apiserver/pkg/authentication/request/x509", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/authentication/serviceaccount/BUILD b/vendor/k8s.io/apiserver/pkg/authentication/serviceaccount/BUILD index db06fbde3..3a60436e4 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/serviceaccount/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authentication/serviceaccount/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["util_test.go"], - importpath = "k8s.io/apiserver/pkg/authentication/serviceaccount", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/apiserver/pkg/authentication/token/cache/BUILD b/vendor/k8s.io/apiserver/pkg/authentication/token/cache/BUILD index 59cd4322f..e225acccc 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/token/cache/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authentication/token/cache/BUILD @@ -12,8 +12,7 @@ go_test( "cache_test.go", "cached_token_authenticator_test.go", ], - importpath = "k8s.io/apiserver/pkg/authentication/token/cache", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/pborman/uuid:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/clock:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/authentication/token/cache/cache_test.go b/vendor/k8s.io/apiserver/pkg/authentication/token/cache/cache_test.go index d4e9adff7..d1ae1fc82 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/token/cache/cache_test.go +++ b/vendor/k8s.io/apiserver/pkg/authentication/token/cache/cache_test.go @@ -77,13 +77,13 @@ func testCache(cache cache, t *testing.T) { // when empty, record is stored cache.set("foo", record1, time.Hour) if result, ok := cache.get("foo"); !ok || result != record1 { - t.Errorf("Expected %#v, true, got %#v, %v", record1, ok) + t.Errorf("Expected %#v, true, got %#v, %v", record1, result, ok) } // newer record overrides cache.set("foo", record2, time.Hour) if result, ok := cache.get("foo"); !ok || result != record2 { - t.Errorf("Expected %#v, true, got %#v, %v", record2, ok) + t.Errorf("Expected %#v, true, got %#v, %v", record2, result, ok) } // removing the current value removes diff --git a/vendor/k8s.io/apiserver/pkg/authentication/token/tokenfile/BUILD b/vendor/k8s.io/apiserver/pkg/authentication/token/tokenfile/BUILD index 4d32dd1d3..dfa436888 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/token/tokenfile/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authentication/token/tokenfile/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["tokenfile_test.go"], - importpath = "k8s.io/apiserver/pkg/authentication/token/tokenfile", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/pkg/authentication/token/union/BUILD b/vendor/k8s.io/apiserver/pkg/authentication/token/union/BUILD index 0f940c334..a8ba31c28 100644 --- a/vendor/k8s.io/apiserver/pkg/authentication/token/union/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authentication/token/union/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["unionauth_test.go"], - importpath = "k8s.io/apiserver/pkg/authentication/token/union", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go b/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go index 594109096..95ade009e 100644 --- a/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go +++ b/vendor/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go @@ -152,7 +152,7 @@ const ( DecisionDeny Decision = iota // DecisionAllow means that an authorizer decided to allow the action. DecisionAllow - // DecisionNoOpionion means that an authorizer has no opinion on wether + // DecisionNoOpionion means that an authorizer has no opinion on whether // to allow or deny an action. DecisionNoOpinion ) diff --git a/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/BUILD b/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/BUILD index 7fff4c90a..d40a88c5a 100644 --- a/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["builtin_test.go"], - importpath = "k8s.io/apiserver/pkg/authorization/authorizerfactory", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library", "//vendor/k8s.io/apiserver/pkg/authorization/authorizer:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/authorization/union/BUILD b/vendor/k8s.io/apiserver/pkg/authorization/union/BUILD index 0614f330c..103f9790b 100644 --- a/vendor/k8s.io/apiserver/pkg/authorization/union/BUILD +++ b/vendor/k8s.io/apiserver/pkg/authorization/union/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["union_test.go"], - importpath = "k8s.io/apiserver/pkg/authorization/union", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library", "//vendor/k8s.io/apiserver/pkg/authorization/authorizer:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/authorization/union/union.go b/vendor/k8s.io/apiserver/pkg/authorization/union/union.go index 3246e4c07..15753789c 100644 --- a/vendor/k8s.io/apiserver/pkg/authorization/union/union.go +++ b/vendor/k8s.io/apiserver/pkg/authorization/union/union.go @@ -20,7 +20,7 @@ limitations under the License. // subauthorizer returns a NoOpinion, then the union authorizer moves onto the // next authorizer or, if the subauthorizer was the last authorizer, returns // NoOpinion as the aggregate decision. I.e. union authorizer creates an -// aggregate decision and supports short-circut allows and denies from +// aggregate decision and supports short-circuit allows and denies from // subauthorizers. package union diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/BUILD b/vendor/k8s.io/apiserver/pkg/endpoints/BUILD index f73d61925..dd08b1e09 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/BUILD +++ b/vendor/k8s.io/apiserver/pkg/endpoints/BUILD @@ -12,11 +12,9 @@ go_test( "apiserver_test.go", "audit_test.go", "installer_test.go", - "proxy_test.go", "watch_test.go", ], - importpath = "k8s.io/apiserver/pkg/endpoints", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/golang.org/x/net/websocket:go_default_library", @@ -27,7 +25,7 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1alpha1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/fields:go_default_library", "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", @@ -36,7 +34,6 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/runtime/serializer/streaming:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/diff:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", @@ -60,7 +57,6 @@ go_test( go_library( name = "go_default_library", srcs = [ - "apiserver.go", "doc.go", "groupversion.go", "installer.go", diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/apiserver_test.go b/vendor/k8s.io/apiserver/pkg/endpoints/apiserver_test.go index eda013582..54172d70e 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/apiserver_test.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/apiserver_test.go @@ -45,7 +45,7 @@ import ( metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - metav1alpha1 "k8s.io/apimachinery/pkg/apis/meta/v1alpha1" + metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -434,7 +434,7 @@ func (storage *SimpleRESTStorage) Export(ctx request.Context, name string, opts return obj, storage.errors["export"] } -func (storage *SimpleRESTStorage) ConvertToTable(ctx request.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1alpha1.Table, error) { +func (storage *SimpleRESTStorage) ConvertToTable(ctx request.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1beta1.Table, error) { return rest.NewDefaultTableConvertor(schema.GroupResource{Resource: "simple"}).ConvertToTable(ctx, obj, tableOptions) } @@ -594,26 +594,6 @@ func (storage *SimpleRESTStorage) Watcher() *watch.FakeWatcher { return storage.fakeWatch } -// Implement Redirector. -var _ = rest.Redirector(&SimpleRESTStorage{}) - -// Implement Redirector. -func (storage *SimpleRESTStorage) ResourceLocation(ctx request.Context, id string) (*url.URL, http.RoundTripper, error) { - storage.checkContext(ctx) - // validate that the namespace context on the request matches the expected input - storage.requestedResourceNamespace = request.NamespaceValue(ctx) - if storage.expectedResourceNamespace != storage.requestedResourceNamespace { - return nil, nil, fmt.Errorf("Expected request namespace %s, but got namespace %s", storage.expectedResourceNamespace, storage.requestedResourceNamespace) - } - storage.requestedResourceLocationID = id - if err := storage.errors["resourceLocation"]; err != nil { - return nil, nil, err - } - // Make a copy so the internal URL never gets mutated - locationCopy := *storage.resourceLocation - return &locationCopy, storage.resourceLocationTransport, nil -} - // Implement Connecter type ConnecterRESTStorage struct { connectHandler http.Handler @@ -1526,18 +1506,30 @@ func TestMetadata(t *testing.T) { matches := map[string]int{} for _, w := range ws { for _, r := range w.Routes() { + t.Logf("%v %v %#v", r.Method, r.Path, r.Produces) s := strings.Join(r.Produces, ",") i := matches[s] matches[s] = i + 1 } } - - if matches["text/plain,application/json,application/yaml,application/vnd.kubernetes.protobuf"] == 0 || - matches["application/json,application/yaml,application/vnd.kubernetes.protobuf,application/json;stream=watch,application/vnd.kubernetes.protobuf;stream=watch"] == 0 || - matches["application/json,application/yaml,application/vnd.kubernetes.protobuf"] == 0 || - matches["*/*"] == 0 || - len(matches) != 5 { - t.Errorf("unexpected mime types: %v", matches) + cs := []func() bool{ + func() bool { + return matches["text/plain,application/json,application/yaml,application/vnd.kubernetes.protobuf"] == 0 + }, + func() bool { + return matches["application/json,application/yaml,application/vnd.kubernetes.protobuf,application/json;stream=watch,application/vnd.kubernetes.protobuf;stream=watch"] == 0 + }, + func() bool { + return matches["application/json,application/yaml,application/vnd.kubernetes.protobuf"] == 0 + }, + func() bool { + return len(matches) != 4 + }, + } + for i, c := range cs { + if c() { + t.Errorf("[%d]unexpected mime types: %#v", i, matches) + } } } @@ -1846,8 +1838,8 @@ func TestGetTable(t *testing.T) { t.Fatal(err) } partial := meta.AsPartialObjectMetadata(m) - partial.GetObjectKind().SetGroupVersionKind(metav1alpha1.SchemeGroupVersion.WithKind("PartialObjectMetadata")) - encodedBody, err := runtime.Encode(metainternalversion.Codecs.LegacyCodec(metav1alpha1.SchemeGroupVersion), partial) + partial.GetObjectKind().SetGroupVersionKind(metav1beta1.SchemeGroupVersion.WithKind("PartialObjectMetadata")) + encodedBody, err := runtime.Encode(metainternalversion.Codecs.LegacyCodec(metav1beta1.SchemeGroupVersion), partial) if err != nil { t.Fatal(err) } @@ -1860,7 +1852,7 @@ func TestGetTable(t *testing.T) { accept string params url.Values pretty bool - expected *metav1alpha1.Table + expected *metav1beta1.Table statusCode int item bool }{ @@ -1870,46 +1862,46 @@ func TestGetTable(t *testing.T) { }, { item: true, - accept: runtime.ContentTypeJSON + ";as=Table;v=v1alpha1;g=meta.k8s.io", - expected: &metav1alpha1.Table{ - TypeMeta: metav1.TypeMeta{Kind: "Table", APIVersion: "meta.k8s.io/v1alpha1"}, + accept: runtime.ContentTypeJSON + ";as=Table;v=v1beta1;g=meta.k8s.io", + expected: &metav1beta1.Table{ + TypeMeta: metav1.TypeMeta{Kind: "Table", APIVersion: "meta.k8s.io/v1beta1"}, ListMeta: metav1.ListMeta{ResourceVersion: "10", SelfLink: "/blah"}, - ColumnDefinitions: []metav1alpha1.TableColumnDefinition{ + ColumnDefinitions: []metav1beta1.TableColumnDefinition{ {Name: "Name", Type: "string", Format: "name", Description: metaDoc["name"]}, {Name: "Created At", Type: "date", Description: metaDoc["creationTimestamp"]}, }, - Rows: []metav1alpha1.TableRow{ + Rows: []metav1beta1.TableRow{ {Cells: []interface{}{"foo1", now.Time.UTC().Format(time.RFC3339)}, Object: runtime.RawExtension{Raw: encodedBody}}, }, }, }, { item: true, - accept: runtime.ContentTypeJSON + ";as=Table;v=v1alpha1;g=meta.k8s.io", + accept: runtime.ContentTypeJSON + ";as=Table;v=v1beta1;g=meta.k8s.io", params: url.Values{"includeObject": []string{"Metadata"}}, - expected: &metav1alpha1.Table{ - TypeMeta: metav1.TypeMeta{Kind: "Table", APIVersion: "meta.k8s.io/v1alpha1"}, + expected: &metav1beta1.Table{ + TypeMeta: metav1.TypeMeta{Kind: "Table", APIVersion: "meta.k8s.io/v1beta1"}, ListMeta: metav1.ListMeta{ResourceVersion: "10", SelfLink: "/blah"}, - ColumnDefinitions: []metav1alpha1.TableColumnDefinition{ + ColumnDefinitions: []metav1beta1.TableColumnDefinition{ {Name: "Name", Type: "string", Format: "name", Description: metaDoc["name"]}, {Name: "Created At", Type: "date", Description: metaDoc["creationTimestamp"]}, }, - Rows: []metav1alpha1.TableRow{ + Rows: []metav1beta1.TableRow{ {Cells: []interface{}{"foo1", now.Time.UTC().Format(time.RFC3339)}, Object: runtime.RawExtension{Raw: encodedBody}}, }, }, }, { - accept: runtime.ContentTypeJSON + ";as=Table;v=v1alpha1;g=meta.k8s.io", + accept: runtime.ContentTypeJSON + ";as=Table;v=v1beta1;g=meta.k8s.io", params: url.Values{"includeObject": []string{"Metadata"}}, - expected: &metav1alpha1.Table{ - TypeMeta: metav1.TypeMeta{Kind: "Table", APIVersion: "meta.k8s.io/v1alpha1"}, + expected: &metav1beta1.Table{ + TypeMeta: metav1.TypeMeta{Kind: "Table", APIVersion: "meta.k8s.io/v1beta1"}, ListMeta: metav1.ListMeta{ResourceVersion: "10", SelfLink: "/test/link"}, - ColumnDefinitions: []metav1alpha1.TableColumnDefinition{ + ColumnDefinitions: []metav1beta1.TableColumnDefinition{ {Name: "Name", Type: "string", Format: "name", Description: metaDoc["name"]}, {Name: "Created At", Type: "date", Description: metaDoc["creationTimestamp"]}, }, - Rows: []metav1alpha1.TableRow{ + Rows: []metav1beta1.TableRow{ {Cells: []interface{}{"foo1", now.Time.UTC().Format(time.RFC3339)}, Object: runtime.RawExtension{Raw: encodedBody}}, }, }, @@ -1958,18 +1950,18 @@ func TestGetTable(t *testing.T) { } obj, _, err := extractBodyObject(resp, unstructured.UnstructuredJSONScheme) if err != nil { - t.Fatalf("%d: unexpected body read error: %v", err) + t.Fatalf("%d: unexpected body read error: %v", i, err) } gvk := schema.GroupVersionKind{Version: "v1", Kind: "Status"} if obj.GetObjectKind().GroupVersionKind() != gvk { - t.Fatalf("%d: unexpected error body: %#v", obj) + t.Fatalf("%d: unexpected error body: %#v", i, obj) } return } if resp.StatusCode != http.StatusOK { t.Errorf("%d: unexpected response: %#v", i, resp) } - var itemOut metav1alpha1.Table + var itemOut metav1beta1.Table body, err := extractBody(resp, &itemOut) if err != nil { t.Fatal(err) @@ -2026,38 +2018,56 @@ func TestGetPartialObjectMetadata(t *testing.T) { accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadata;v=v1;g=meta.k8s.io", statusCode: http.StatusNotAcceptable, }, + { + accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadata;v=v1;g=meta.k8s.io, application/json", + expectKind: schema.GroupVersionKind{Kind: "Simple", Group: testGroupVersion.Group, Version: testGroupVersion.Version}, + }, + { + accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadata;v=v1beta1;g=meta.k8s.io, application/json", + expectKind: schema.GroupVersionKind{Kind: "PartialObjectMetadata", Group: "meta.k8s.io", Version: "v1beta1"}, + }, { list: true, - accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadata;v=v1alpha1;g=meta.k8s.io", + accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadata;v=v1beta1;g=meta.k8s.io", statusCode: http.StatusNotAcceptable, }, { - accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io", + list: true, + accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadata;v=v1;g=meta.k8s.io, application/json", + expectKind: schema.GroupVersionKind{Kind: "SimpleList", Group: testGroupVersion.Group, Version: testGroupVersion.Version}, + }, + { + list: true, + accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadataList;v=v1beta1;g=meta.k8s.io, application/json", + expectKind: schema.GroupVersionKind{Kind: "PartialObjectMetadataList", Group: "meta.k8s.io", Version: "v1beta1"}, + }, + { + accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadataList;v=v1beta1;g=meta.k8s.io", statusCode: http.StatusNotAcceptable, }, { - accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadata;v=v1alpha1;g=meta.k8s.io", - expected: &metav1alpha1.PartialObjectMetadata{ + accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadata;v=v1beta1;g=meta.k8s.io", + expected: &metav1beta1.PartialObjectMetadata{ ObjectMeta: metav1.ObjectMeta{Name: "foo1", Namespace: "ns1", CreationTimestamp: now, UID: types.UID("abcdef0123")}, }, - expectKind: schema.GroupVersionKind{Kind: "PartialObjectMetadata", Group: "meta.k8s.io", Version: "v1alpha1"}, + expectKind: schema.GroupVersionKind{Kind: "PartialObjectMetadata", Group: "meta.k8s.io", Version: "v1beta1"}, }, { list: true, - accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadataList;v=v1alpha1;g=meta.k8s.io", - expected: &metav1alpha1.PartialObjectMetadataList{ - Items: []*metav1alpha1.PartialObjectMetadata{ + accept: runtime.ContentTypeJSON + ";as=PartialObjectMetadataList;v=v1beta1;g=meta.k8s.io", + expected: &metav1beta1.PartialObjectMetadataList{ + Items: []*metav1beta1.PartialObjectMetadata{ { - TypeMeta: metav1.TypeMeta{APIVersion: "meta.k8s.io/v1alpha1", Kind: "PartialObjectMetadata"}, + TypeMeta: metav1.TypeMeta{APIVersion: "meta.k8s.io/v1beta1", Kind: "PartialObjectMetadata"}, ObjectMeta: metav1.ObjectMeta{Name: "foo1", Namespace: "ns1", CreationTimestamp: now, UID: types.UID("newer")}, }, { - TypeMeta: metav1.TypeMeta{APIVersion: "meta.k8s.io/v1alpha1", Kind: "PartialObjectMetadata"}, + TypeMeta: metav1.TypeMeta{APIVersion: "meta.k8s.io/v1beta1", Kind: "PartialObjectMetadata"}, ObjectMeta: metav1.ObjectMeta{Name: "foo2", Namespace: "ns2", CreationTimestamp: now, UID: types.UID("older")}, }, }, }, - expectKind: schema.GroupVersionKind{Kind: "PartialObjectMetadataList", Group: "meta.k8s.io", Version: "v1alpha1"}, + expectKind: schema.GroupVersionKind{Kind: "PartialObjectMetadataList", Group: "meta.k8s.io", Version: "v1beta1"}, }, } for i, test := range tests { @@ -2083,12 +2093,12 @@ func TestGetPartialObjectMetadata(t *testing.T) { } obj, _, err := extractBodyObject(resp, unstructured.UnstructuredJSONScheme) if err != nil { - t.Errorf("%d: unexpected body read error: %v", err) + t.Errorf("%d: unexpected body read error: %v", i, err) continue } gvk := schema.GroupVersionKind{Version: "v1", Kind: "Status"} if obj.GetObjectKind().GroupVersionKind() != gvk { - t.Errorf("%d: unexpected error body: %#v", obj) + t.Errorf("%d: unexpected error body: %#v", i, obj) } continue } @@ -2096,12 +2106,22 @@ func TestGetPartialObjectMetadata(t *testing.T) { t.Errorf("%d: invalid status: %#v\n%s", i, resp, bodyOrDie(resp)) continue } - itemOut, body, err := extractBodyObject(resp, metainternalversion.Codecs.LegacyCodec(metav1alpha1.SchemeGroupVersion)) - if err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(test.expected, itemOut) { - t.Errorf("%d: did not match: %s", i, diff.ObjectReflectDiff(test.expected, itemOut)) + body := "" + if test.expected != nil { + itemOut, d, err := extractBodyObject(resp, metainternalversion.Codecs.LegacyCodec(metav1beta1.SchemeGroupVersion)) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(test.expected, itemOut) { + t.Errorf("%d: did not match: %s", i, diff.ObjectReflectDiff(test.expected, itemOut)) + } + body = d + } else { + d, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatal(err) + } + body = string(d) } obj := &unstructured.Unstructured{} if err := json.Unmarshal([]byte(body), obj); err != nil { @@ -2819,65 +2839,6 @@ func TestDeleteWithOptionsQueryAndBody(t *testing.T) { } } -func TestLegacyDelete(t *testing.T) { - storage := map[string]rest.Storage{} - simpleStorage := SimpleRESTStorage{} - ID := "id" - storage["simple"] = LegacyRESTStorage{&simpleStorage} - var _ rest.Deleter = storage["simple"].(LegacyRESTStorage) - handler := handle(storage) - server := httptest.NewServer(handler) - defer server.Close() - - client := http.Client{} - request, err := http.NewRequest("DELETE", server.URL+"/"+prefix+"/"+testGroupVersion.Group+"/"+testGroupVersion.Version+"/namespaces/default/simple/"+ID, nil) - res, err := client.Do(request) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - if res.StatusCode != http.StatusOK { - t.Errorf("unexpected response: %#v", res) - } - if simpleStorage.deleted != ID { - t.Errorf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID) - } - if simpleStorage.deleteOptions != nil { - t.Errorf("unexpected delete options: %#v", simpleStorage.deleteOptions) - } -} - -func TestLegacyDeleteIgnoresOptions(t *testing.T) { - storage := map[string]rest.Storage{} - simpleStorage := SimpleRESTStorage{} - ID := "id" - storage["simple"] = LegacyRESTStorage{&simpleStorage} - handler := handle(storage) - server := httptest.NewServer(handler) - defer server.Close() - - item := metav1.NewDeleteOptions(300) - body, err := runtime.Encode(codec, item) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - client := http.Client{} - request, err := http.NewRequest("DELETE", server.URL+"/"+prefix+"/"+testGroupVersion.Group+"/"+testGroupVersion.Version+"/namespaces/default/simple/"+ID, bytes.NewReader(body)) - res, err := client.Do(request) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - if res.StatusCode != http.StatusOK { - t.Errorf("unexpected response: %#v", res) - } - if simpleStorage.deleted != ID { - t.Errorf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID) - } - if simpleStorage.deleteOptions != nil { - t.Errorf("unexpected delete options: %#v", simpleStorage.deleteOptions) - } -} - func TestDeleteInvokesAdmissionControl(t *testing.T) { // TODO: remove mutating deny when we removed it from the endpoint implementation and ported all plugins for _, admit := range []admission.Interface{alwaysMutatingDeny{}, alwaysValidatingDeny{}} { diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/BUILD b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/BUILD index 008dcff56..cf2da3c32 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/discovery/BUILD +++ b/vendor/k8s.io/apiserver/pkg/endpoints/discovery/BUILD @@ -12,8 +12,7 @@ go_test( "addresses_test.go", "root_test.go", ], - importpath = "k8s.io/apiserver/pkg/endpoints/discovery", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/filters/BUILD b/vendor/k8s.io/apiserver/pkg/endpoints/filters/BUILD index 664756aba..98dbb32b7 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/filters/BUILD +++ b/vendor/k8s.io/apiserver/pkg/endpoints/filters/BUILD @@ -17,8 +17,7 @@ go_test( "legacy_audit_test.go", "requestinfo_test.go", ], - importpath = "k8s.io/apiserver/pkg/endpoints/filters", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/pborman/uuid:go_default_library", "//vendor/k8s.io/api/authentication/v1:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit.go b/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit.go index 01fc957c1..6b72bfb32 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit.go @@ -239,7 +239,7 @@ func (f *fancyResponseWriterDelegator) Hijack() (net.Conn, *bufio.ReadWriter, er // fake a response status before protocol switch happens f.processCode(http.StatusSwitchingProtocols) - // This will be ignored if WriteHeader() function has aready been called. + // This will be ignored if WriteHeader() function has already been called. // It's not guaranteed Audit-ID http header is sent for all requests. // For example, when user run "kubectl exec", apiserver uses a proxy handler // to deal with the request, users can only get http headers returned by kubelet node. diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit_test.go b/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit_test.go index fe0317d73..a7c1486a7 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit_test.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit_test.go @@ -848,7 +848,7 @@ func TestAuditIDHttpHeader(t *testing.T) { } } else { if resp.Header.Get("Audit-ID") != "" { - t.Errorf("[%s] expected no Audit-ID http header returned, but got %p", test.desc, resp.Header.Get("Audit-ID")) + t.Errorf("[%s] expected no Audit-ID http header returned, but got %s", test.desc, resp.Header.Get("Audit-ID")) } } } diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go b/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go index a53db7213..d07bab317 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go @@ -29,7 +29,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/authentication/authenticator" "k8s.io/apiserver/pkg/endpoints/handlers/responsewriters" - "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request" ) @@ -82,7 +81,7 @@ func WithAuthentication(handler http.Handler, mapper genericapirequest.RequestCo ) } -func Unauthorized(requestContextMapper request.RequestContextMapper, s runtime.NegotiatedSerializer, supportsBasicAuth bool) http.Handler { +func Unauthorized(requestContextMapper genericapirequest.RequestContextMapper, s runtime.NegotiatedSerializer, supportsBasicAuth bool) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { if supportsBasicAuth { w.Header().Set("WWW-Authenticate", `Basic realm="kubernetes-master"`) @@ -92,7 +91,7 @@ func Unauthorized(requestContextMapper request.RequestContextMapper, s runtime.N responsewriters.InternalError(w, req, errors.New("no context found for request")) return } - requestInfo, found := request.RequestInfoFrom(ctx) + requestInfo, found := genericapirequest.RequestInfoFrom(ctx) if !found { responsewriters.InternalError(w, req, errors.New("no RequestInfo found in the context")) return diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go b/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go index f60756b6f..b4610dfce 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go @@ -47,6 +47,7 @@ func WithAuthorization(handler http.Handler, requestContextMapper request.Reques return } authorized, reason, err := a.Authorize(attributes) + // an authorizer like RBAC could encounter evaluation errors and still allow the request, so authorizer decision is checked before error here. if authorized == authorizer.DecisionAllow { handler.ServeHTTP(w, req) return diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/BUILD b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/BUILD index 7e2cdcc1b..bb30cf273 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/BUILD +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/BUILD @@ -12,8 +12,7 @@ go_test( "namer_test.go", "rest_test.go", ], - importpath = "k8s.io/apiserver/pkg/endpoints/handlers", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/evanphx/json-patch:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", @@ -32,6 +31,7 @@ go_test( "//vendor/k8s.io/apiserver/pkg/apis/example/v1:go_default_library", "//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library", "//vendor/k8s.io/apiserver/pkg/registry/rest:go_default_library", + "//vendor/k8s.io/apiserver/pkg/util/trace:go_default_library", ], ) @@ -44,7 +44,6 @@ go_library( "get.go", "namer.go", "patch.go", - "proxy.go", "response.go", "rest.go", "update.go", @@ -59,18 +58,16 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1alpha1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/fields:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/serializer/streaming:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/httpstream:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/json:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/mergepatch:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/proxy:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/strategicpatch:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/apiserver/pkg/admission:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go index dc3560623..1d474267d 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go @@ -61,7 +61,7 @@ func createHandler(r rest.NamedCreater, scope RequestScope, typer runtime.Object ctx = request.WithNamespace(ctx, namespace) gv := scope.Kind.GroupVersion() - s, err := negotiation.NegotiateInputSerializer(req, scope.Serializer) + s, err := negotiation.NegotiateInputSerializer(req, false, scope.Serializer) if err != nil { scope.err(err, w, req) return diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go index 0bc5a659b..b8ac281fa 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go @@ -60,7 +60,7 @@ func DeleteResource(r rest.GracefulDeleter, allowsOptions bool, scope RequestSco return } if len(body) > 0 { - s, err := negotiation.NegotiateInputSerializer(req, metainternalversion.Codecs) + s, err := negotiation.NegotiateInputSerializer(req, false, metainternalversion.Codecs) if err != nil { scope.err(err, w, req) return @@ -228,7 +228,7 @@ func DeleteCollection(r rest.CollectionDeleter, checkBody bool, scope RequestSco return } if len(body) > 0 { - s, err := negotiation.NegotiateInputSerializer(req, scope.Serializer) + s, err := negotiation.NegotiateInputSerializer(req, false, scope.Serializer) if err != nil { scope.err(err, w, req) return diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/BUILD b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/BUILD index c0ceb323d..828e556d5 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/BUILD +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["negotiate_test.go"], - importpath = "k8s.io/apiserver/pkg/endpoints/handlers/negotiation", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/doc.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/doc.go index 759db7a08..80f4feb72 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/doc.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/doc.go @@ -14,5 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package negotation contains media type negotiation logic. +// Package negotiation contains media type negotiation logic. package negotiation // import "k8s.io/apiserver/pkg/endpoints/handlers/negotiation" diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/errors.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/errors.go index 07bc8e280..93b17cfb0 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/errors.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/errors.go @@ -41,7 +41,7 @@ func (e errNotAcceptable) Status() metav1.Status { return metav1.Status{ Status: metav1.StatusFailure, Code: http.StatusNotAcceptable, - Reason: metav1.StatusReason("NotAcceptable"), + Reason: metav1.StatusReasonNotAcceptable, Message: e.Error(), } } @@ -63,7 +63,7 @@ func (e errUnsupportedMediaType) Status() metav1.Status { return metav1.Status{ Status: metav1.StatusFailure, Code: http.StatusUnsupportedMediaType, - Reason: metav1.StatusReason("UnsupportedMediaType"), + Reason: metav1.StatusReasonUnsupportedMediaType, Message: e.Error(), } } diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate.go index 7f4225a5b..f9bb47bab 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate.go @@ -73,31 +73,30 @@ func NegotiateOutputStreamSerializer(req *http.Request, ns runtime.NegotiatedSer } // NegotiateInputSerializer returns the input serializer for the provided request. -func NegotiateInputSerializer(req *http.Request, ns runtime.NegotiatedSerializer) (runtime.SerializerInfo, error) { +func NegotiateInputSerializer(req *http.Request, streaming bool, ns runtime.NegotiatedSerializer) (runtime.SerializerInfo, error) { mediaType := req.Header.Get("Content-Type") - return NegotiateInputSerializerForMediaType(mediaType, ns) + return NegotiateInputSerializerForMediaType(mediaType, streaming, ns) } // NegotiateInputSerializerForMediaType returns the appropriate serializer for the given media type or an error. -func NegotiateInputSerializerForMediaType(mediaType string, ns runtime.NegotiatedSerializer) (runtime.SerializerInfo, error) { +func NegotiateInputSerializerForMediaType(mediaType string, streaming bool, ns runtime.NegotiatedSerializer) (runtime.SerializerInfo, error) { mediaTypes := ns.SupportedMediaTypes() if len(mediaType) == 0 { mediaType = mediaTypes[0].MediaType } - mediaType, _, err := mime.ParseMediaType(mediaType) - if err != nil { - _, supported := MediaTypesForSerializer(ns) - return runtime.SerializerInfo{}, NewUnsupportedMediaTypeError(supported) - } - - for _, info := range mediaTypes { - if info.MediaType != mediaType { - continue + if mediaType, _, err := mime.ParseMediaType(mediaType); err == nil { + for _, info := range mediaTypes { + if info.MediaType != mediaType { + continue + } + return info, nil } - return info, nil } - _, supported := MediaTypesForSerializer(ns) + supported, streamingSupported := MediaTypesForSerializer(ns) + if streaming { + return runtime.SerializerInfo{}, NewUnsupportedMediaTypeError(streamingSupported) + } return runtime.SerializerInfo{}, NewUnsupportedMediaTypeError(supported) } @@ -113,39 +112,13 @@ func isPrettyPrint(req *http.Request) bool { } } userAgent := req.UserAgent() - // This covers basic all browers and cli http tools + // This covers basic all browsers and cli http tools if strings.HasPrefix(userAgent, "curl") || strings.HasPrefix(userAgent, "Wget") || strings.HasPrefix(userAgent, "Mozilla/5.0") { return true } return false } -// negotiate the most appropriate content type given the accept header and a list of -// alternatives. -func negotiate(header string, alternatives []string) (goautoneg.Accept, bool) { - alternates := make([][]string, 0, len(alternatives)) - for _, alternate := range alternatives { - alternates = append(alternates, strings.SplitN(alternate, "/", 2)) - } - for _, clause := range goautoneg.ParseAccept(header) { - for _, alternate := range alternates { - if clause.Type == alternate[0] && clause.SubType == alternate[1] { - return clause, true - } - if clause.Type == alternate[0] && clause.SubType == "*" { - clause.SubType = alternate[1] - return clause, true - } - if clause.Type == "*" && clause.SubType == "*" { - clause.Type = alternate[0] - clause.SubType = alternate[1] - return clause, true - } - } - } - return goautoneg.Accept{}, false -} - // EndpointRestrictions is an interface that allows content-type negotiation // to verify server support for specific options type EndpointRestrictions interface { diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate_test.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate_test.go index 1d11d0a30..e69ba02af 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate_test.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate_test.go @@ -184,7 +184,7 @@ func TestNegotiate(t *testing.T) { { req: &http.Request{ Header: http.Header{ - "Accept": []string{"application/json;as=BOGUS;v=v1alpha1;g=meta.k8s.io, application/json"}, + "Accept": []string{"application/json;as=BOGUS;v=v1beta1;g=meta.k8s.io, application/json"}, }, }, contentType: "application/json", diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go index 1ac736d09..00bebdd2d 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go @@ -32,17 +32,39 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/json" "k8s.io/apimachinery/pkg/util/mergepatch" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/audit" + "k8s.io/apiserver/pkg/endpoints/handlers/negotiation" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/registry/rest" + utiltrace "k8s.io/apiserver/pkg/util/trace" ) // PatchResource returns a function that will handle a resource patch // TODO: Eventually PatchResource should just use GuaranteedUpdate and this routine should be a bit cleaner -func PatchResource(r rest.Patcher, scope RequestScope, admit admission.Interface, converter runtime.ObjectConvertor) http.HandlerFunc { +func PatchResource(r rest.Patcher, scope RequestScope, admit admission.Interface, converter runtime.ObjectConvertor, patchTypes []string) http.HandlerFunc { return func(w http.ResponseWriter, req *http.Request) { + // For performance tracking purposes. + trace := utiltrace.New("Patch " + req.URL.Path) + defer trace.LogIfLong(500 * time.Millisecond) + + // Do this first, otherwise name extraction can fail for unrecognized content types + // TODO: handle this in negotiation + contentType := req.Header.Get("Content-Type") + // Remove "; charset=" if included in header. + if idx := strings.Index(contentType, ";"); idx > 0 { + contentType = contentType[:idx] + } + patchType := types.PatchType(contentType) + + // Ensure the patchType is one we support + if !sets.NewString(patchTypes...).Has(contentType) { + scope.err(negotiation.NewUnsupportedMediaTypeError(patchTypes), w, req) + return + } + // TODO: we either want to remove timeout or document it (if we // document, move timeout out of this function and declare it in // api_installer) @@ -63,14 +85,6 @@ func PatchResource(r rest.Patcher, scope RequestScope, admit admission.Interface return } - // TODO: handle this in negotiation - contentType := req.Header.Get("Content-Type") - // Remove "; charset=" if included in header. - if idx := strings.Index(contentType, ";"); idx > 0 { - contentType = contentType[:idx] - } - patchType := types.PatchType(contentType) - patchJS, err := readBody(req) if err != nil { scope.err(err, w, req) @@ -79,6 +93,7 @@ func PatchResource(r rest.Patcher, scope RequestScope, admit admission.Interface ae := request.AuditEventFrom(ctx) audit.LogRequestPatch(ae, patchJS) + trace.Step("Recorded the audit event") s, ok := runtime.SerializerInfoForMediaType(scope.Serializer.SupportedMediaTypes(), runtime.ContentTypeJSON) if !ok { @@ -110,11 +125,12 @@ func PatchResource(r rest.Patcher, scope RequestScope, admit admission.Interface name, patchType, patchJS, - scope.Namer, scope.Creater, scope.Defaulter, scope.UnsafeConvertor, scope.Kind, scope.Resource, codec) + scope.Namer, scope.Creater, scope.Defaulter, scope.UnsafeConvertor, scope.Kind, scope.Resource, codec, trace) if err != nil { scope.err(err, w, req) return } + trace.Step("Object stored in database") requestInfo, ok := request.RequestInfoFrom(ctx) if !ok { @@ -125,6 +141,7 @@ func PatchResource(r rest.Patcher, scope RequestScope, admit admission.Interface scope.err(err, w, req) return } + trace.Step("Self-link added") transformResponseObject(ctx, scope, req, w, http.StatusOK, result) } @@ -151,6 +168,7 @@ func patchResource( kind schema.GroupVersionKind, resource schema.GroupVersionResource, codec runtime.Codec, + trace *utiltrace.Trace, ) (runtime.Object, error) { namespace := request.NamespaceValue(ctx) @@ -168,6 +186,7 @@ func patchResource( // and is given the currently persisted object as input. applyPatch := func(_ request.Context, _, currentObject runtime.Object) (runtime.Object, error) { // Make sure we actually have a persisted currentObject + trace.Step("About to apply patch") if hasUID, err := hasUID(currentObject); err != nil { return nil, err } else if !hasUID { @@ -351,6 +370,7 @@ func patchResource( // applyAdmission is called every time GuaranteedUpdate asks for the updated object, // and is given the currently persisted object and the patched object as input. applyAdmission := func(ctx request.Context, patchedObject runtime.Object, currentObject runtime.Object) (runtime.Object, error) { + trace.Step("About to check admission control") return patchedObject, updateMutation(patchedObject, currentObject) } updatedObjectInfo := rest.DefaultUpdatedObjectInfo(nil, applyPatch, applyAdmission) diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/proxy.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/proxy.go deleted file mode 100644 index 3e8c917a7..000000000 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/proxy.go +++ /dev/null @@ -1,285 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handlers - -import ( - "context" - "errors" - "io" - "math/rand" - "net/http" - "net/http/httputil" - "net/url" - "path" - "strings" - "time" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/httpstream" - "k8s.io/apimachinery/pkg/util/net" - proxyutil "k8s.io/apimachinery/pkg/util/proxy" - "k8s.io/apiserver/pkg/endpoints/handlers/responsewriters" - "k8s.io/apiserver/pkg/endpoints/metrics" - "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/registry/rest" - "k8s.io/apiserver/pkg/server/httplog" - - "github.com/golang/glog" -) - -// ProxyHandler provides a http.Handler which will proxy traffic to locations -// specified by items implementing Redirector. -type ProxyHandler struct { - Prefix string - Storage map[string]rest.Storage - Serializer runtime.NegotiatedSerializer - Mapper request.RequestContextMapper -} - -func (r *ProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { - reqStart := time.Now() - - var httpCode int - var requestInfo *request.RequestInfo - defer func() { - responseLength := 0 - if rw, ok := w.(*metrics.ResponseWriterDelegator); ok { - responseLength = rw.ContentLength() - if httpCode == 0 { - httpCode = rw.Status() - } - } - metrics.Record(req, requestInfo, w.Header().Get("Content-Type"), httpCode, responseLength, time.Now().Sub(reqStart)) - }() - - ctx, ok := r.Mapper.Get(req) - if !ok { - responsewriters.InternalError(w, req, errors.New("Error getting request context")) - httpCode = http.StatusInternalServerError - return - } - - requestInfo, ok = request.RequestInfoFrom(ctx) - if !ok { - responsewriters.InternalError(w, req, errors.New("Error getting RequestInfo from context")) - httpCode = http.StatusInternalServerError - return - } - - metrics.RecordLongRunning(req, requestInfo, func() { - httpCode = r.serveHTTP(w, req, ctx, requestInfo) - }) -} - -// serveHTTP performs proxy handling and returns the status code of the operation. -func (r *ProxyHandler) serveHTTP(w http.ResponseWriter, req *http.Request, ctx request.Context, requestInfo *request.RequestInfo) int { - proxyHandlerTraceID := rand.Int63() - - if !requestInfo.IsResourceRequest { - responsewriters.NotFound(w, req) - return http.StatusNotFound - } - namespace, resource, parts := requestInfo.Namespace, requestInfo.Resource, requestInfo.Parts - - ctx = request.WithNamespace(ctx, namespace) - if len(parts) < 2 { - responsewriters.NotFound(w, req) - return http.StatusNotFound - } - id := parts[1] - remainder := "" - if len(parts) > 2 { - proxyParts := parts[2:] - remainder = strings.Join(proxyParts, "/") - if strings.HasSuffix(req.URL.Path, "/") { - // The original path had a trailing slash, which has been stripped - // by KindAndNamespace(). We should add it back because some - // servers (like etcd) require it. - remainder = remainder + "/" - } - } - storage, ok := r.Storage[resource] - if !ok { - httplog.LogOf(req, w).Addf("'%v' has no storage object", resource) - responsewriters.NotFound(w, req) - return http.StatusNotFound - } - - gv := schema.GroupVersion{Group: requestInfo.APIGroup, Version: requestInfo.APIVersion} - - redirector, ok := storage.(rest.Redirector) - if !ok { - httplog.LogOf(req, w).Addf("'%v' is not a redirector", resource) - return responsewriters.ErrorNegotiated(ctx, apierrors.NewMethodNotSupported(schema.GroupResource{Resource: resource}, "proxy"), r.Serializer, gv, w, req) - } - - location, roundTripper, err := redirector.ResourceLocation(ctx, id) - if err != nil { - httplog.LogOf(req, w).Addf("Error getting ResourceLocation: %v", err) - return responsewriters.ErrorNegotiated(ctx, err, r.Serializer, gv, w, req) - } - if location == nil { - httplog.LogOf(req, w).Addf("ResourceLocation for %v returned nil", id) - responsewriters.NotFound(w, req) - return http.StatusNotFound - } - - if roundTripper != nil { - glog.V(5).Infof("[%x: %v] using transport %T...", proxyHandlerTraceID, req.URL, roundTripper) - } - - // Default to http - if location.Scheme == "" { - location.Scheme = "http" - } - // Add the subpath - if len(remainder) > 0 { - location.Path = singleJoiningSlash(location.Path, remainder) - } - // Start with anything returned from the storage, and add the original request's parameters - values := location.Query() - for k, vs := range req.URL.Query() { - for _, v := range vs { - values.Add(k, v) - } - } - location.RawQuery = values.Encode() - - // WithContext creates a shallow clone of the request with the new context. - newReq := req.WithContext(context.Background()) - newReq.Header = net.CloneHeader(req.Header) - newReq.URL = location - - // TODO convert this entire proxy to an UpgradeAwareProxy similar to - // https://github.com/openshift/origin/blob/master/pkg/util/httpproxy/upgradeawareproxy.go. - // That proxy needs to be modified to support multiple backends, not just 1. - if r.tryUpgrade(ctx, w, req, newReq, location, roundTripper, gv) { - return http.StatusSwitchingProtocols - } - - // Redirect requests of the form "/{resource}/{name}" to "/{resource}/{name}/" - // This is essentially a hack for http://issue.k8s.io/4958. - // Note: Keep this code after tryUpgrade to not break that flow. - if len(parts) == 2 && !strings.HasSuffix(req.URL.Path, "/") { - var queryPart string - if len(req.URL.RawQuery) > 0 { - queryPart = "?" + req.URL.RawQuery - } - w.Header().Set("Location", req.URL.Path+"/"+queryPart) - w.WriteHeader(http.StatusMovedPermanently) - return http.StatusMovedPermanently - } - - start := time.Now() - glog.V(4).Infof("[%x] Beginning proxy %s...", proxyHandlerTraceID, req.URL) - defer func() { - glog.V(4).Infof("[%x] Proxy %v finished %v.", proxyHandlerTraceID, req.URL, time.Now().Sub(start)) - }() - - proxy := httputil.NewSingleHostReverseProxy(&url.URL{Scheme: location.Scheme, Host: location.Host}) - alreadyRewriting := false - if roundTripper != nil { - _, alreadyRewriting = roundTripper.(*proxyutil.Transport) - glog.V(5).Infof("[%x] Not making a rewriting transport for proxy %s...", proxyHandlerTraceID, req.URL) - } - if !alreadyRewriting { - glog.V(5).Infof("[%x] making a transport for proxy %s...", proxyHandlerTraceID, req.URL) - prepend := path.Join(r.Prefix, resource, id) - if len(namespace) > 0 { - prepend = path.Join(r.Prefix, "namespaces", namespace, resource, id) - } - pTransport := &proxyutil.Transport{ - Scheme: req.URL.Scheme, - Host: req.URL.Host, - PathPrepend: prepend, - RoundTripper: roundTripper, - } - roundTripper = pTransport - } - proxy.Transport = roundTripper - proxy.FlushInterval = 200 * time.Millisecond - proxy.ServeHTTP(w, newReq) - return 0 -} - -// tryUpgrade returns true if the request was handled. -func (r *ProxyHandler) tryUpgrade(ctx request.Context, w http.ResponseWriter, req, newReq *http.Request, location *url.URL, transport http.RoundTripper, gv schema.GroupVersion) bool { - if !httpstream.IsUpgradeRequest(req) { - return false - } - // Only append X-Forwarded-For in the upgrade path, since httputil.NewSingleHostReverseProxy - // handles this in the non-upgrade path. - net.AppendForwardedForHeader(newReq) - - backendConn, err := proxyutil.DialURL(location, transport) - if err != nil { - responsewriters.ErrorNegotiated(ctx, err, r.Serializer, gv, w, req) - return true - } - defer backendConn.Close() - - // TODO should we use _ (a bufio.ReadWriter) instead of requestHijackedConn - // when copying between the client and the backend? Docker doesn't when they - // hijack, just for reference... - requestHijackedConn, _, err := w.(http.Hijacker).Hijack() - if err != nil { - responsewriters.ErrorNegotiated(ctx, err, r.Serializer, gv, w, req) - return true - } - defer requestHijackedConn.Close() - - if err = newReq.Write(backendConn); err != nil { - responsewriters.ErrorNegotiated(ctx, err, r.Serializer, gv, w, req) - return true - } - - done := make(chan struct{}, 2) - - go func() { - _, err := io.Copy(backendConn, requestHijackedConn) - if err != nil && !strings.Contains(err.Error(), "use of closed network connection") { - glog.Errorf("Error proxying data from client to backend: %v", err) - } - done <- struct{}{} - }() - - go func() { - _, err := io.Copy(requestHijackedConn, backendConn) - if err != nil && !strings.Contains(err.Error(), "use of closed network connection") { - glog.Errorf("Error proxying data from backend to client: %v", err) - } - done <- struct{}{} - }() - - <-done - return true -} - -// borrowed from net/http/httputil/reverseproxy.go -func singleJoiningSlash(a, b string) string { - aslash := strings.HasSuffix(a, "/") - bslash := strings.HasPrefix(b, "/") - switch { - case aslash && bslash: - return a + b[1:] - case !aslash && !bslash: - return a + "/" + b - } - return a + b -} diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/response.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/response.go index 1aec3ba2d..508b0aede 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/response.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/response.go @@ -24,7 +24,7 @@ import ( "k8s.io/apimachinery/pkg/api/meta" metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1alpha1 "k8s.io/apimachinery/pkg/apis/meta/v1alpha1" + metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apiserver/pkg/endpoints/handlers/negotiation" "k8s.io/apiserver/pkg/endpoints/handlers/responsewriters" @@ -46,7 +46,7 @@ func transformResponseObject(ctx request.Context, scope RequestScope, req *http. if target := mediaType.Convert; target != nil { switch { - case target.Kind == "PartialObjectMetadata" && target.GroupVersion() == metav1alpha1.SchemeGroupVersion: + case target.Kind == "PartialObjectMetadata" && target.GroupVersion() == metav1beta1.SchemeGroupVersion: if meta.IsListType(result) { // TODO: this should be calculated earlier err = newNotAcceptableError(fmt.Sprintf("you requested PartialObjectMetadata, but the requested object is a list (%T)", result)) @@ -59,7 +59,7 @@ func transformResponseObject(ctx request.Context, scope RequestScope, req *http. return } partial := meta.AsPartialObjectMetadata(m) - partial.GetObjectKind().SetGroupVersionKind(metav1alpha1.SchemeGroupVersion.WithKind("PartialObjectMetadata")) + partial.GetObjectKind().SetGroupVersionKind(metav1beta1.SchemeGroupVersion.WithKind("PartialObjectMetadata")) // renegotiate under the internal version _, info, err := negotiation.NegotiateOutputMediaType(req, metainternalversion.Codecs, &scope) @@ -67,25 +67,25 @@ func transformResponseObject(ctx request.Context, scope RequestScope, req *http. scope.err(err, w, req) return } - encoder := metainternalversion.Codecs.EncoderForVersion(info.Serializer, metav1alpha1.SchemeGroupVersion) + encoder := metainternalversion.Codecs.EncoderForVersion(info.Serializer, metav1beta1.SchemeGroupVersion) responsewriters.SerializeObject(info.MediaType, encoder, w, req, statusCode, partial) return - case target.Kind == "PartialObjectMetadataList" && target.GroupVersion() == metav1alpha1.SchemeGroupVersion: + case target.Kind == "PartialObjectMetadataList" && target.GroupVersion() == metav1beta1.SchemeGroupVersion: if !meta.IsListType(result) { // TODO: this should be calculated earlier err = newNotAcceptableError(fmt.Sprintf("you requested PartialObjectMetadataList, but the requested object is not a list (%T)", result)) scope.err(err, w, req) return } - list := &metav1alpha1.PartialObjectMetadataList{} + list := &metav1beta1.PartialObjectMetadataList{} err := meta.EachListItem(result, func(obj runtime.Object) error { m, err := meta.Accessor(obj) if err != nil { return err } partial := meta.AsPartialObjectMetadata(m) - partial.GetObjectKind().SetGroupVersionKind(metav1alpha1.SchemeGroupVersion.WithKind("PartialObjectMetadata")) + partial.GetObjectKind().SetGroupVersionKind(metav1beta1.SchemeGroupVersion.WithKind("PartialObjectMetadata")) list.Items = append(list.Items, partial) return nil }) @@ -100,16 +100,16 @@ func transformResponseObject(ctx request.Context, scope RequestScope, req *http. scope.err(err, w, req) return } - encoder := metainternalversion.Codecs.EncoderForVersion(info.Serializer, metav1alpha1.SchemeGroupVersion) + encoder := metainternalversion.Codecs.EncoderForVersion(info.Serializer, metav1beta1.SchemeGroupVersion) responsewriters.SerializeObject(info.MediaType, encoder, w, req, statusCode, list) return - case target.Kind == "Table" && target.GroupVersion() == metav1alpha1.SchemeGroupVersion: + case target.Kind == "Table" && target.GroupVersion() == metav1beta1.SchemeGroupVersion: // TODO: relax the version abstraction // TODO: skip if this is a status response (delete without body)? - opts := &metav1alpha1.TableOptions{} - if err := metav1alpha1.ParameterCodec.DecodeParameters(req.URL.Query(), metav1alpha1.SchemeGroupVersion, opts); err != nil { + opts := &metav1beta1.TableOptions{} + if err := metav1beta1.ParameterCodec.DecodeParameters(req.URL.Query(), metav1beta1.SchemeGroupVersion, opts); err != nil { scope.err(err, w, req) return } @@ -123,14 +123,14 @@ func transformResponseObject(ctx request.Context, scope RequestScope, req *http. for i := range table.Rows { item := &table.Rows[i] switch opts.IncludeObject { - case metav1alpha1.IncludeObject: + case metav1beta1.IncludeObject: item.Object.Object, err = scope.Convertor.ConvertToVersion(item.Object.Object, scope.Kind.GroupVersion()) if err != nil { scope.err(err, w, req) return } // TODO: rely on defaulting for the value here? - case metav1alpha1.IncludeMetadata, "": + case metav1beta1.IncludeMetadata, "": m, err := meta.Accessor(item.Object.Object) if err != nil { scope.err(err, w, req) @@ -138,9 +138,9 @@ func transformResponseObject(ctx request.Context, scope RequestScope, req *http. } // TODO: turn this into an internal type and do conversion in order to get object kind automatically set? partial := meta.AsPartialObjectMetadata(m) - partial.GetObjectKind().SetGroupVersionKind(metav1alpha1.SchemeGroupVersion.WithKind("PartialObjectMetadata")) + partial.GetObjectKind().SetGroupVersionKind(metav1beta1.SchemeGroupVersion.WithKind("PartialObjectMetadata")) item.Object.Object = partial - case metav1alpha1.IncludeNone: + case metav1beta1.IncludeNone: item.Object.Object = nil default: // TODO: move this to validation on the table options? @@ -155,7 +155,7 @@ func transformResponseObject(ctx request.Context, scope RequestScope, req *http. scope.err(err, w, req) return } - encoder := metainternalversion.Codecs.EncoderForVersion(info.Serializer, metav1alpha1.SchemeGroupVersion) + encoder := metainternalversion.Codecs.EncoderForVersion(info.Serializer, metav1beta1.SchemeGroupVersion) responsewriters.SerializeObject(info.MediaType, encoder, w, req, statusCode, table) return diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/BUILD b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/BUILD index 31963fd3b..a8505eb93 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/BUILD +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/BUILD @@ -12,8 +12,7 @@ go_test( "errors_test.go", "status_test.go", ], - importpath = "k8s.io/apiserver/pkg/endpoints/handlers/responsewriters", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest.go index 768005daa..63135aaa8 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1alpha1 "k8s.io/apimachinery/pkg/apis/meta/v1alpha1" + metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" utilruntime "k8s.io/apimachinery/pkg/util/runtime" @@ -69,7 +69,7 @@ func (scope *RequestScope) err(err error, w http.ResponseWriter, req *http.Reque func (scope *RequestScope) AllowsConversion(gvk schema.GroupVersionKind) bool { // TODO: this is temporary, replace with an abstraction calculated at endpoint installation time - if gvk.GroupVersion() == metav1alpha1.SchemeGroupVersion { + if gvk.GroupVersion() == metav1beta1.SchemeGroupVersion { switch gvk.Kind { case "Table": return scope.TableConvertor != nil @@ -110,7 +110,7 @@ func ConnectResource(connecter rest.Connecter, scope RequestScope, admit admissi scope.err(err, w, req) return } - if admit.Handles(admission.Connect) { + if admit != nil && admit.Handles(admission.Connect) { connectRequest := &rest.ConnectRequest{ Name: name, Options: opts, diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go index e6dc7b2cd..d87d77006 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go @@ -40,6 +40,7 @@ import ( examplev1 "k8s.io/apiserver/pkg/apis/example/v1" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/registry/rest" + utiltrace "k8s.io/apiserver/pkg/util/trace" ) var ( @@ -347,7 +348,7 @@ func (tc *patchTestCase) Run(t *testing.T) { name, patchType, patch, - namer, creater, defaulter, convertor, kind, resource, codec) + namer, creater, defaulter, convertor, kind, resource, codec, utiltrace.New("Patch"+name)) if len(tc.expectedError) != 0 { if err == nil || err.Error() != tc.expectedError { t.Errorf("%s: expected error %v, but got %v", tc.name, tc.expectedError, err) diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go index 319bfd51b..0eac36660 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go @@ -56,7 +56,7 @@ func UpdateResource(r rest.Updater, scope RequestScope, typer runtime.ObjectType return } - s, err := negotiation.NegotiateInputSerializer(req, scope.Serializer) + s, err := negotiation.NegotiateInputSerializer(req, false, scope.Serializer) if err != nil { scope.err(err, w, req) return diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/installer.go b/vendor/k8s.io/apiserver/pkg/endpoints/installer.go index 87bf1700d..934ee94f7 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/installer.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/installer.go @@ -96,13 +96,6 @@ func (a *APIInstaller) Install() ([]metav1.APIResource, *restful.WebService, []e var errors []error ws := a.newWebService() - proxyHandler := (&handlers.ProxyHandler{ - Prefix: a.prefix + "/proxy/", - Storage: a.group.Storage, - Serializer: a.group.Serializer, - Mapper: a.group.Context, - }) - // Register the paths in a deterministic (sorted) order to get a deterministic swagger spec. paths := make([]string, len(a.group.Storage)) var i int = 0 @@ -112,7 +105,7 @@ func (a *APIInstaller) Install() ([]metav1.APIResource, *restful.WebService, []e } sort.Strings(paths) for _, path := range paths { - apiResource, err := a.registerResourceHandlers(path, a.group.Storage[path], ws, proxyHandler) + apiResource, err := a.registerResourceHandlers(path, a.group.Storage[path], ws) if err != nil { errors = append(errors, fmt.Errorf("error in registering resource: %s, %v", path, err)) } @@ -193,7 +186,7 @@ func (a *APIInstaller) restMapping(resource string) (*meta.RESTMapping, error) { return a.group.Mapper.RESTMapping(fqKindToRegister.GroupKind(), fqKindToRegister.Version) } -func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storage, ws *restful.WebService, proxyHandler http.Handler) (*metav1.APIResource, error) { +func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storage, ws *restful.WebService) (*metav1.APIResource, error) { admit := a.group.Admit context := a.group.Context if context == nil { @@ -234,13 +227,11 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag lister, isLister := storage.(rest.Lister) getter, isGetter := storage.(rest.Getter) getterWithOptions, isGetterWithOptions := storage.(rest.GetterWithOptions) - deleter, isDeleter := storage.(rest.Deleter) gracefulDeleter, isGracefulDeleter := storage.(rest.GracefulDeleter) collectionDeleter, isCollectionDeleter := storage.(rest.CollectionDeleter) updater, isUpdater := storage.(rest.Updater) patcher, isPatcher := storage.(rest.Patcher) watcher, isWatcher := storage.(rest.Watcher) - _, isRedirector := storage.(rest.Redirector) connecter, isConnecter := storage.(rest.Connecter) storageMeta, isMetadata := storage.(rest.StorageMetadata) if !isMetadata { @@ -281,16 +272,12 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag var versionedDeleteOptions runtime.Object var versionedDeleterObject interface{} - switch { - case isGracefulDeleter: + if isGracefulDeleter { versionedDeleteOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind("DeleteOptions")) if err != nil { return nil, err } versionedDeleterObject = indirectArbitraryPointer(versionedDeleteOptions) - isDeleter = true - case isDeleter: - gracefulDeleter = rest.GracefulDeleteAdapter{Deleter: deleter} } versionedStatusPtr, err := a.group.Creater.New(optionsExternalVersion.WithKind("Status")) @@ -424,14 +411,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } actions = appendIf(actions, action{"PUT", itemPath, nameParams, namer, false}, isUpdater) actions = appendIf(actions, action{"PATCH", itemPath, nameParams, namer, false}, isPatcher) - actions = appendIf(actions, action{"DELETE", itemPath, nameParams, namer, false}, isDeleter) + actions = appendIf(actions, action{"DELETE", itemPath, nameParams, namer, false}, isGracefulDeleter) actions = appendIf(actions, action{"WATCH", "watch/" + itemPath, nameParams, namer, false}, isWatcher) - // We add "proxy" subresource to remove the need for the generic top level prefix proxy. - // The generic top level prefix proxy is deprecated in v1.2, and will be removed in 1.3, or 1.4 at the latest. - // TODO: DEPRECATED in v1.2. - actions = appendIf(actions, action{"PROXY", "proxy/" + itemPath + "/{path:*}", proxyParams, namer, false}, isRedirector) - // TODO: DEPRECATED in v1.2. - actions = appendIf(actions, action{"PROXY", "proxy/" + itemPath, nameParams, namer, false}, isRedirector) actions = appendIf(actions, action{"CONNECT", itemPath, nameParams, namer, false}, isConnecter) actions = appendIf(actions, action{"CONNECT", itemPath + "/{path:*}", proxyParams, namer, false}, isConnecter && connectSubpath) break @@ -476,14 +457,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } actions = appendIf(actions, action{"PUT", itemPath, nameParams, namer, false}, isUpdater) actions = appendIf(actions, action{"PATCH", itemPath, nameParams, namer, false}, isPatcher) - actions = appendIf(actions, action{"DELETE", itemPath, nameParams, namer, false}, isDeleter) + actions = appendIf(actions, action{"DELETE", itemPath, nameParams, namer, false}, isGracefulDeleter) actions = appendIf(actions, action{"WATCH", "watch/" + itemPath, nameParams, namer, false}, isWatcher) - // We add "proxy" subresource to remove the need for the generic top level prefix proxy. - // The generic top level prefix proxy is deprecated in v1.2, and will be removed in 1.3, or 1.4 at the latest. - // TODO: DEPRECATED in v1.2. - actions = appendIf(actions, action{"PROXY", "proxy/" + itemPath + "/{path:*}", proxyParams, namer, false}, isRedirector) - // TODO: DEPRECATED in v1.2. - actions = appendIf(actions, action{"PROXY", "proxy/" + itemPath, nameParams, namer, false}, isRedirector) actions = appendIf(actions, action{"CONNECT", itemPath, nameParams, namer, false}, isConnecter) actions = appendIf(actions, action{"CONNECT", itemPath + "/{path:*}", proxyParams, namer, false}, isConnecter && connectSubpath) @@ -690,7 +665,12 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag if hasSubresource { doc = "partially update " + subresource + " of the specified " + kind } - handler := metrics.InstrumentRouteFunc(action.Verb, resource, subresource, requestScope, restfulPatchResource(patcher, reqScope, admit, mapping.ObjectConvertor)) + supportedTypes := []string{ + string(types.JSONPatchType), + string(types.MergePatchType), + string(types.StrategicMergePatchType), + } + handler := metrics.InstrumentRouteFunc(action.Verb, resource, subresource, requestScope, restfulPatchResource(patcher, reqScope, admit, mapping.ObjectConvertor, supportedTypes)) route := ws.PATCH(action.Path).To(handler). Doc(doc). Param(ws.QueryParameter("pretty", "If 'true', then the output is pretty printed.")). @@ -807,18 +787,6 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } addParams(route, action.Params) routes = append(routes, route) - // We add "proxy" subresource to remove the need for the generic top level prefix proxy. - // The generic top level prefix proxy is deprecated in v1.2, and will be removed in 1.3, or 1.4 at the latest. - // TODO: DEPRECATED in v1.2. - case "PROXY": // Proxy requests to a resource. - // Accept all methods as per http://issue.k8s.io/3996 - routes = append(routes, buildProxyRoute(ws, "GET", a.prefix, action.Path, kind, resource, subresource, namespaced, requestScope, hasSubresource, action.Params, proxyHandler, operationSuffix)) - routes = append(routes, buildProxyRoute(ws, "PUT", a.prefix, action.Path, kind, resource, subresource, namespaced, requestScope, hasSubresource, action.Params, proxyHandler, operationSuffix)) - routes = append(routes, buildProxyRoute(ws, "POST", a.prefix, action.Path, kind, resource, subresource, namespaced, requestScope, hasSubresource, action.Params, proxyHandler, operationSuffix)) - routes = append(routes, buildProxyRoute(ws, "PATCH", a.prefix, action.Path, kind, resource, subresource, namespaced, requestScope, hasSubresource, action.Params, proxyHandler, operationSuffix)) - routes = append(routes, buildProxyRoute(ws, "DELETE", a.prefix, action.Path, kind, resource, subresource, namespaced, requestScope, hasSubresource, action.Params, proxyHandler, operationSuffix)) - routes = append(routes, buildProxyRoute(ws, "HEAD", a.prefix, action.Path, kind, resource, subresource, namespaced, requestScope, hasSubresource, action.Params, proxyHandler, operationSuffix)) - routes = append(routes, buildProxyRoute(ws, "OPTIONS", a.prefix, action.Path, kind, resource, subresource, namespaced, requestScope, hasSubresource, action.Params, proxyHandler, operationSuffix)) case "CONNECT": for _, method := range connecter.ConnectMethods() { connectProducedObject := storageMeta.ProducesObject(method) @@ -901,27 +869,6 @@ func routeFunction(handler http.Handler) restful.RouteFunction { } } -func buildProxyRoute(ws *restful.WebService, - method, prefix, path, kind, resource, subresource, namespaced, requestScope string, - hasSubresource bool, - params []*restful.Parameter, - proxyHandler http.Handler, - operationSuffix string) *restful.RouteBuilder { - doc := "proxy " + method + " requests to " + kind - if hasSubresource { - doc = "proxy " + method + " requests to " + subresource + " of " + kind - } - handler := metrics.InstrumentRouteFunc("PROXY", resource, subresource, requestScope, routeFunction(proxyHandler)) - proxyRoute := ws.Method(method).Path(path).To(handler). - Doc(doc). - Operation("proxy" + strings.Title(method) + namespaced + kind + strings.Title(subresource) + operationSuffix). - Produces("*/*"). - Consumes("*/*"). - Writes("string") - addParams(proxyRoute, params) - return proxyRoute -} - func addParams(route *restful.RouteBuilder, params []*restful.Parameter) { for _, param := range params { route.Param(param) @@ -1099,9 +1046,9 @@ func restfulUpdateResource(r rest.Updater, scope handlers.RequestScope, typer ru } } -func restfulPatchResource(r rest.Patcher, scope handlers.RequestScope, admit admission.Interface, converter runtime.ObjectConvertor) restful.RouteFunction { +func restfulPatchResource(r rest.Patcher, scope handlers.RequestScope, admit admission.Interface, converter runtime.ObjectConvertor, supportedTypes []string) restful.RouteFunction { return func(req *restful.Request, res *restful.Response) { - handlers.PatchResource(r, scope, admit, converter)(res.ResponseWriter, req.Request) + handlers.PatchResource(r, scope, admit, converter, supportedTypes)(res.ResponseWriter, req.Request) } } diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/metrics/BUILD b/vendor/k8s.io/apiserver/pkg/endpoints/metrics/BUILD index 8d57d273e..6aef95e2d 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/metrics/BUILD +++ b/vendor/k8s.io/apiserver/pkg/endpoints/metrics/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["metrics_test.go"], - importpath = "k8s.io/apiserver/pkg/endpoints/metrics", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go b/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go index 65e651a33..d3f155c11 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go @@ -78,16 +78,47 @@ var ( }, []string{"verb", "resource", "subresource", "scope"}, ) + // DroppedRequests is a number of requests dropped with 'Try again later' response" + DroppedRequests = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "apiserver_dropped_requests", + Help: "Number of requests dropped with 'Try again later' response", + }, + []string{"requestKind"}, + ) + // Because of volatality of the base metric this is pre-aggregated one. Instead of reporing current usage all the time + // it reports maximal usage during the last second. + currentInflightRequests = prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Name: "apiserver_current_inflight_requests", + Help: "Maximal mumber of currently used inflight request limit of this apiserver per request kind in last second.", + }, + []string{"requestKind"}, + ) kubectlExeRegexp = regexp.MustCompile(`^.*((?i:kubectl\.exe))`) ) -// Register all metrics. -func Register() { +const ( + // ReadOnlyKind is a string identifying read only request kind + ReadOnlyKind = "readOnly" + // MutatingKind is a string identifying mutating request kind + MutatingKind = "mutating" +) + +func init() { + // Register all metrics. prometheus.MustRegister(requestCounter) prometheus.MustRegister(longRunningRequestGauge) prometheus.MustRegister(requestLatencies) prometheus.MustRegister(requestLatenciesSummary) prometheus.MustRegister(responseSizes) + prometheus.MustRegister(DroppedRequests) + prometheus.MustRegister(currentInflightRequests) +} + +func UpdateInflightRequestMetrics(nonmutating, mutating int) { + currentInflightRequests.WithLabelValues(ReadOnlyKind).Set(float64(nonmutating)) + currentInflightRequests.WithLabelValues(MutatingKind).Set(float64(mutating)) } // Record records a single request to the standard metrics endpoints. For use by handlers that perform their own @@ -97,7 +128,7 @@ func Record(req *http.Request, requestInfo *request.RequestInfo, contentType str if requestInfo == nil { requestInfo = &request.RequestInfo{Verb: req.Method, Path: req.URL.Path} } - scope := cleanScope(requestInfo) + scope := CleanScope(requestInfo) if requestInfo.IsResourceRequest { MonitorRequest(req, strings.ToUpper(requestInfo.Verb), requestInfo.Resource, requestInfo.Subresource, contentType, scope, code, responseSizeInBytes, elapsed) } else { @@ -112,7 +143,7 @@ func RecordLongRunning(req *http.Request, requestInfo *request.RequestInfo, fn f requestInfo = &request.RequestInfo{Verb: req.Method, Path: req.URL.Path} } var g prometheus.Gauge - scope := cleanScope(requestInfo) + scope := CleanScope(requestInfo) reportedVerb := cleanVerb(strings.ToUpper(requestInfo.Verb), req) if requestInfo.IsResourceRequest { g = longRunningRequestGauge.WithLabelValues(reportedVerb, requestInfo.Resource, requestInfo.Subresource, scope) @@ -147,7 +178,7 @@ func Reset() { } // InstrumentRouteFunc works like Prometheus' InstrumentHandlerFunc but wraps -// the go-restful RouteFunction instead of a HandlerFunc +// the go-restful RouteFunction instead of a HandlerFunc plus some Kubernetes endpoint specific information. func InstrumentRouteFunc(verb, resource, subresource, scope string, routeFunc restful.RouteFunction) restful.RouteFunction { return restful.RouteFunction(func(request *restful.Request, response *restful.Response) { now := time.Now() @@ -171,7 +202,30 @@ func InstrumentRouteFunc(verb, resource, subresource, scope string, routeFunc re }) } -func cleanScope(requestInfo *request.RequestInfo) string { +// InstrumentHandlerFunc works like Prometheus' InstrumentHandlerFunc but adds some Kubernetes endpoint specific information. +func InstrumentHandlerFunc(verb, resource, subresource, scope string, handler http.HandlerFunc) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + now := time.Now() + + delegate := &ResponseWriterDelegator{ResponseWriter: w} + + _, cn := w.(http.CloseNotifier) + _, fl := w.(http.Flusher) + _, hj := w.(http.Hijacker) + if cn && fl && hj { + w = &fancyResponseWriterDelegator{delegate} + } else { + w = delegate + } + + handler(w, req) + + MonitorRequest(req, verb, resource, subresource, scope, delegate.Header().Get("Content-Type"), delegate.Status(), delegate.ContentLength(), time.Now().Sub(now)) + } +} + +// CleanScope returns the scope of the request. +func CleanScope(requestInfo *request.RequestInfo) string { if requestInfo.Namespace != "" { return "namespace" } diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/openapi/BUILD b/vendor/k8s.io/apiserver/pkg/endpoints/openapi/BUILD index 0e972d7f9..875531c3d 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/openapi/BUILD +++ b/vendor/k8s.io/apiserver/pkg/endpoints/openapi/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["openapi_test.go"], - importpath = "k8s.io/apiserver/pkg/endpoints/openapi", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/go-openapi/spec:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/openapi/testing/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/endpoints/openapi/testing/zz_generated.deepcopy.go index bd7fed915..fbc7e0d9d 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/openapi/testing/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/openapi/testing/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package testing @@ -44,7 +44,6 @@ func (in *TestType) DeepCopy() *TestType { func (in *TestType) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/proxy_test.go b/vendor/k8s.io/apiserver/pkg/endpoints/proxy_test.go deleted file mode 100644 index 84c3e4f84..000000000 --- a/vendor/k8s.io/apiserver/pkg/endpoints/proxy_test.go +++ /dev/null @@ -1,570 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package endpoints - -import ( - "bytes" - "compress/gzip" - "crypto/tls" - "crypto/x509" - "fmt" - "io" - "io/ioutil" - "net" - "net/http" - "net/http/httptest" - "net/http/httputil" - "net/url" - "reflect" - "strconv" - "strings" - "testing" - - "golang.org/x/net/websocket" - utilnet "k8s.io/apimachinery/pkg/util/net" - "k8s.io/apiserver/pkg/registry/rest" -) - -func TestProxyRequestContentLengthAndTransferEncoding(t *testing.T) { - chunk := func(data []byte) []byte { - out := &bytes.Buffer{} - chunker := httputil.NewChunkedWriter(out) - for _, b := range data { - if _, err := chunker.Write([]byte{b}); err != nil { - panic(err) - } - } - chunker.Close() - out.Write([]byte("\r\n")) - return out.Bytes() - } - - zip := func(data []byte) []byte { - out := &bytes.Buffer{} - zipper := gzip.NewWriter(out) - if _, err := zipper.Write(data); err != nil { - panic(err) - } - zipper.Close() - return out.Bytes() - } - - sampleData := []byte("abcde") - - table := map[string]struct { - reqHeaders http.Header - reqBody []byte - - expectedHeaders http.Header - expectedBody []byte - }{ - "content-length": { - reqHeaders: http.Header{ - "Content-Length": []string{"5"}, - }, - reqBody: sampleData, - - expectedHeaders: http.Header{ - "Content-Length": []string{"5"}, - "Content-Encoding": nil, // none set - "Transfer-Encoding": nil, // none set - }, - expectedBody: sampleData, - }, - - "content-length + identity transfer-encoding": { - reqHeaders: http.Header{ - "Content-Length": []string{"5"}, - "Transfer-Encoding": []string{"identity"}, - }, - reqBody: sampleData, - - expectedHeaders: http.Header{ - "Content-Length": []string{"5"}, - "Content-Encoding": nil, // none set - "Transfer-Encoding": nil, // gets removed - }, - expectedBody: sampleData, - }, - - "content-length + gzip content-encoding": { - reqHeaders: http.Header{ - "Content-Length": []string{strconv.Itoa(len(zip(sampleData)))}, - "Content-Encoding": []string{"gzip"}, - }, - reqBody: zip(sampleData), - - expectedHeaders: http.Header{ - "Content-Length": []string{strconv.Itoa(len(zip(sampleData)))}, - "Content-Encoding": []string{"gzip"}, - "Transfer-Encoding": nil, // none set - }, - expectedBody: zip(sampleData), - }, - - "chunked transfer-encoding": { - reqHeaders: http.Header{ - "Transfer-Encoding": []string{"chunked"}, - }, - reqBody: chunk(sampleData), - - expectedHeaders: http.Header{ - "Content-Length": nil, // none set - "Content-Encoding": nil, // none set - "Transfer-Encoding": nil, // Transfer-Encoding gets removed - }, - expectedBody: sampleData, // sample data is unchunked - }, - - "chunked transfer-encoding + gzip content-encoding": { - reqHeaders: http.Header{ - "Content-Encoding": []string{"gzip"}, - "Transfer-Encoding": []string{"chunked"}, - }, - reqBody: chunk(zip(sampleData)), - - expectedHeaders: http.Header{ - "Content-Length": nil, // none set - "Content-Encoding": []string{"gzip"}, - "Transfer-Encoding": nil, // gets removed - }, - expectedBody: zip(sampleData), // sample data is unchunked, but content-encoding is preserved - }, - - // "Transfer-Encoding: gzip" is not supported by go - // See http/transfer.go#fixTransferEncoding (https://golang.org/src/net/http/transfer.go#L427) - // Once it is supported, this test case should succeed - // - // "gzip+chunked transfer-encoding": { - // reqHeaders: http.Header{ - // "Transfer-Encoding": []string{"chunked,gzip"}, - // }, - // reqBody: chunk(zip(sampleData)), - // - // expectedHeaders: http.Header{ - // "Content-Length": nil, // no content-length headers - // "Transfer-Encoding": nil, // Transfer-Encoding gets removed - // }, - // expectedBody: sampleData, - // }, - } - - successfulResponse := "backend passed tests" - for k, item := range table { - // Start the downstream server - downstreamServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - // Verify headers - for header, v := range item.expectedHeaders { - if !reflect.DeepEqual(v, req.Header[header]) { - t.Errorf("%s: Expected headers for %s to be %v, got %v", k, header, v, req.Header[header]) - } - } - - // Read body - body, err := ioutil.ReadAll(req.Body) - if err != nil { - t.Errorf("%s: unexpected error %v", k, err) - } - req.Body.Close() - - // Verify length - if req.ContentLength > 0 && req.ContentLength != int64(len(body)) { - t.Errorf("%s: ContentLength was %d, len(data) was %d", k, req.ContentLength, len(body)) - } - - // Verify content - if !bytes.Equal(item.expectedBody, body) { - t.Errorf("%s: Expected %q, got %q", k, string(item.expectedBody), string(body)) - } - - // Write successful response - w.Write([]byte(successfulResponse)) - })) - defer downstreamServer.Close() - - // Start the proxy server - serverURL, _ := url.Parse(downstreamServer.URL) - simpleStorage := &SimpleRESTStorage{ - errors: map[string]error{}, - resourceLocation: serverURL, - expectedResourceNamespace: "default", - } - namespaceHandler := handleNamespaced(map[string]rest.Storage{"foo": simpleStorage}) - server := newTestServer(namespaceHandler) - defer server.Close() - - // Dial the proxy server - conn, err := net.Dial(server.Listener.Addr().Network(), server.Listener.Addr().String()) - if err != nil { - t.Errorf("%s: unexpected error %v", k, err) - continue - } - defer conn.Close() - - // Add standard http 1.1 headers - if item.reqHeaders == nil { - item.reqHeaders = http.Header{} - } - item.reqHeaders.Add("Connection", "close") - item.reqHeaders.Add("Host", server.Listener.Addr().String()) - - // We directly write to the connection to bypass the Go library's manipulation of the Request.Header. - // Write the request headers - post := fmt.Sprintf("POST /%s/%s/%s/proxy/namespaces/default/foo/id/some/dir HTTP/1.1\r\n", prefix, newGroupVersion.Group, newGroupVersion.Version) - if _, err := fmt.Fprint(conn, post); err != nil { - t.Fatalf("%s: unexpected error %v", k, err) - } - for header, values := range item.reqHeaders { - for _, value := range values { - if _, err := fmt.Fprintf(conn, "%s: %s\r\n", header, value); err != nil { - t.Fatalf("%s: unexpected error %v", k, err) - } - } - } - // Header separator - if _, err := fmt.Fprint(conn, "\r\n"); err != nil { - t.Fatalf("%s: unexpected error %v", k, err) - } - // Body - if _, err := conn.Write(item.reqBody); err != nil { - t.Fatalf("%s: unexpected error %v", k, err) - } - - // Read response - response, err := ioutil.ReadAll(conn) - if err != nil { - t.Errorf("%s: unexpected error %v", k, err) - continue - } - if !strings.HasSuffix(string(response), successfulResponse) { - t.Errorf("%s: Did not get successful response: %s", k, string(response)) - continue - } - } -} - -func TestProxy(t *testing.T) { - table := []struct { - method string - path string - reqBody string - respBody string - respContentType string - reqNamespace string - }{ - {"GET", "/some/dir", "", "answer", "text/css", "default"}, - {"GET", "/some/dir", "", "answer", "text/html", "default"}, - {"POST", "/some/other/dir", "question", "answer", "text/css", "default"}, - {"PUT", "/some/dir/id", "different question", "answer", "text/css", "default"}, - {"DELETE", "/some/dir/id", "", "ok", "text/css", "default"}, - {"GET", "/some/dir/id", "", "answer", "text/css", "other"}, - {"GET", "/trailing/slash/", "", "answer", "text/css", "default"}, - {"GET", "/", "", "answer", "text/css", "default"}, - } - - for _, item := range table { - downstreamServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - gotBody, err := ioutil.ReadAll(req.Body) - if err != nil { - t.Errorf("%v - unexpected error %v", item.method, err) - } - if e, a := item.reqBody, string(gotBody); e != a { - t.Errorf("%v - expected %v, got %v", item.method, e, a) - } - if e, a := item.path, req.URL.Path; e != a { - t.Errorf("%v - expected %v, got %v", item.method, e, a) - } - w.Header().Set("Content-Type", item.respContentType) - var out io.Writer = w - if strings.Contains(req.Header.Get("Accept-Encoding"), "gzip") { - // The proxier can ask for gzip'd data; we need to provide it with that - // in order to test our processing of that data. - w.Header().Set("Content-Encoding", "gzip") - gzw := gzip.NewWriter(w) - out = gzw - defer gzw.Close() - } - fmt.Fprint(out, item.respBody) - })) - defer downstreamServer.Close() - - serverURL, _ := url.Parse(downstreamServer.URL) - simpleStorage := &SimpleRESTStorage{ - errors: map[string]error{}, - resourceLocation: serverURL, - expectedResourceNamespace: item.reqNamespace, - } - - namespaceHandler := handleNamespaced(map[string]rest.Storage{"foo": simpleStorage}) - namespaceServer := newTestServer(namespaceHandler) - defer namespaceServer.Close() - - // test each supported URL pattern for finding the redirection resource in the proxy in a particular namespace - serverPatterns := []struct { - server *httptest.Server - proxyTestPattern string - }{ - {namespaceServer, "/" + prefix + "/" + newGroupVersion.Group + "/" + newGroupVersion.Version + "/proxy/namespaces/" + item.reqNamespace + "/foo/id" + item.path}, - } - - for _, serverPattern := range serverPatterns { - server := serverPattern.server - proxyTestPattern := serverPattern.proxyTestPattern - req, err := http.NewRequest( - item.method, - server.URL+proxyTestPattern, - strings.NewReader(item.reqBody), - ) - if err != nil { - t.Errorf("%v - unexpected error %v", item.method, err) - continue - } - resp, err := http.DefaultClient.Do(req) - if err != nil { - t.Errorf("%v - unexpected error %v", item.method, err) - continue - } - gotResp, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Errorf("%v - unexpected error %v", item.method, err) - } - resp.Body.Close() - if e, a := item.respBody, string(gotResp); e != a { - t.Errorf("%v - expected %v, got %v. url: %#v", item.method, e, a, req.URL) - } - } - } -} - -func TestProxyUpgrade(t *testing.T) { - - localhostPool := x509.NewCertPool() - if !localhostPool.AppendCertsFromPEM(localhostCert) { - t.Errorf("error setting up localhostCert pool") - } - - testcases := map[string]struct { - ServerFunc func(http.Handler) *httptest.Server - ProxyTransport http.RoundTripper - }{ - "http": { - ServerFunc: httptest.NewServer, - ProxyTransport: nil, - }, - "https (invalid hostname + InsecureSkipVerify)": { - ServerFunc: func(h http.Handler) *httptest.Server { - cert, err := tls.X509KeyPair(exampleCert, exampleKey) - if err != nil { - t.Errorf("https (invalid hostname): proxy_test: %v", err) - } - ts := httptest.NewUnstartedServer(h) - ts.TLS = &tls.Config{ - Certificates: []tls.Certificate{cert}, - } - ts.StartTLS() - return ts - }, - ProxyTransport: utilnet.SetTransportDefaults(&http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}), - }, - "https (valid hostname + RootCAs)": { - ServerFunc: func(h http.Handler) *httptest.Server { - cert, err := tls.X509KeyPair(localhostCert, localhostKey) - if err != nil { - t.Errorf("https (valid hostname): proxy_test: %v", err) - } - ts := httptest.NewUnstartedServer(h) - ts.TLS = &tls.Config{ - Certificates: []tls.Certificate{cert}, - } - ts.StartTLS() - return ts - }, - ProxyTransport: utilnet.SetTransportDefaults(&http.Transport{TLSClientConfig: &tls.Config{RootCAs: localhostPool}}), - }, - "https (valid hostname + RootCAs + custom dialer)": { - ServerFunc: func(h http.Handler) *httptest.Server { - cert, err := tls.X509KeyPair(localhostCert, localhostKey) - if err != nil { - t.Errorf("https (valid hostname): proxy_test: %v", err) - } - ts := httptest.NewUnstartedServer(h) - ts.TLS = &tls.Config{ - Certificates: []tls.Certificate{cert}, - } - ts.StartTLS() - return ts - }, - ProxyTransport: utilnet.SetTransportDefaults(&http.Transport{Dial: net.Dial, TLSClientConfig: &tls.Config{RootCAs: localhostPool}}), - }, - } - - for k, tc := range testcases { - - backendServer := tc.ServerFunc(websocket.Handler(func(ws *websocket.Conn) { - defer ws.Close() - body := make([]byte, 5) - ws.Read(body) - ws.Write([]byte("hello " + string(body))) - })) - defer backendServer.Close() - - serverURL, _ := url.Parse(backendServer.URL) - simpleStorage := &SimpleRESTStorage{ - errors: map[string]error{}, - resourceLocation: serverURL, - resourceLocationTransport: tc.ProxyTransport, - expectedResourceNamespace: "myns", - } - - namespaceHandler := handleNamespaced(map[string]rest.Storage{"foo": simpleStorage}) - - server := newTestServer(namespaceHandler) - defer server.Close() - - ws, err := websocket.Dial("ws://"+server.Listener.Addr().String()+"/"+prefix+"/"+newGroupVersion.Group+"/"+newGroupVersion.Version+"/proxy/namespaces/myns/foo/123", "", "http://127.0.0.1/") - if err != nil { - t.Errorf("%s: websocket dial err: %s", k, err) - continue - } - defer ws.Close() - - if _, err := ws.Write([]byte("world")); err != nil { - t.Errorf("%s: write err: %s", k, err) - continue - } - - response := make([]byte, 20) - n, err := ws.Read(response) - if err != nil { - t.Errorf("%s: read err: %s", k, err) - continue - } - if e, a := "hello world", string(response[0:n]); e != a { - t.Errorf("%s: expected '%#v', got '%#v'", k, e, a) - continue - } - } -} - -func TestRedirectOnMissingTrailingSlash(t *testing.T) { - table := []struct { - // The requested path - path string - // The path requested on the proxy server. - proxyServerPath string - // query string - query string - }{ - {"/trailing/slash/", "/trailing/slash/", ""}, - {"/", "/", "test1=value1&test2=value2"}, - // "/" should be added at the end. - {"", "/", "test1=value1&test2=value2"}, - // "/" should not be added at a non-root path. - {"/some/path", "/some/path", ""}, - } - - for _, item := range table { - downstreamServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - if req.URL.Path != item.proxyServerPath { - t.Errorf("Unexpected request on path: %s, expected path: %s, item: %v", req.URL.Path, item.proxyServerPath, item) - } - if req.URL.RawQuery != item.query { - t.Errorf("Unexpected query on url: %s, expected: %s", req.URL.RawQuery, item.query) - } - })) - defer downstreamServer.Close() - - serverURL, _ := url.Parse(downstreamServer.URL) - simpleStorage := &SimpleRESTStorage{ - errors: map[string]error{}, - resourceLocation: serverURL, - expectedResourceNamespace: "ns", - } - - handler := handleNamespaced(map[string]rest.Storage{"foo": simpleStorage}) - server := newTestServer(handler) - defer server.Close() - - proxyTestPattern := "/" + prefix + "/" + newGroupVersion.Group + "/" + newGroupVersion.Version + "/proxy/namespaces/ns/foo/id" + item.path - req, err := http.NewRequest( - "GET", - server.URL+proxyTestPattern+"?"+item.query, - strings.NewReader(""), - ) - if err != nil { - t.Errorf("unexpected error %v", err) - continue - } - // Note: We are using a default client here, that follows redirects. - resp, err := http.DefaultClient.Do(req) - if err != nil { - t.Errorf("unexpected error %v", err) - continue - } - if resp.StatusCode != http.StatusOK { - t.Errorf("Unexpected errorCode: %v, expected: 200. Response: %v, item: %v", resp.StatusCode, resp, item) - } - } -} - -// exampleCert was generated from crypto/tls/generate_cert.go with the following command: -// go run generate_cert.go --rsa-bits 512 --host example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h -var exampleCert = []byte(`-----BEGIN CERTIFICATE----- -MIIBdzCCASGgAwIBAgIRAOVTAdPnfbS5V85mfS90TfIwDQYJKoZIhvcNAQELBQAw -EjEQMA4GA1UEChMHQWNtZSBDbzAgFw03MDAxMDEwMDAwMDBaGA8yMDg0MDEyOTE2 -MDAwMFowEjEQMA4GA1UEChMHQWNtZSBDbzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgC -QQCoVSqeu8TBvF+70T7Jm4340YQNhds6IxjRoifenYodAO1dnKGrcbF266DJGunh -nIjQH7B12tduhl0fLK4Ezf7/AgMBAAGjUDBOMA4GA1UdDwEB/wQEAwICpDATBgNV -HSUEDDAKBggrBgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MBYGA1UdEQQPMA2CC2V4 -YW1wbGUuY29tMA0GCSqGSIb3DQEBCwUAA0EAk1kVa5uZ/AzwYDVcS9bpM/czwjjV -xq3VeSCfmNa2uNjbFvodmCRwZOHUvipAMGCUCV6j5vMrJ8eMj8tCQ36W9A== ------END CERTIFICATE-----`) - -var exampleKey = []byte(`-----BEGIN RSA PRIVATE KEY----- -MIIBOgIBAAJBAKhVKp67xMG8X7vRPsmbjfjRhA2F2zojGNGiJ96dih0A7V2coatx -sXbroMka6eGciNAfsHXa126GXR8srgTN/v8CAwEAAQJASdzdD7vKsUwMIejGCUb1 -fAnLTPfAY3lFCa+CmR89nE22dAoRDv+5RbnBsZ58BazPNJHrsVPRlfXB3OQmSQr0 -SQIhANoJhs+xOJE/i8nJv0uAbzKyiD1YkvRkta0GpUOULyAVAiEAxaQus3E/SuqD -P7y5NeJnE7X6XkyC35zrsJRkz7orE8MCIHdDjsI8pjyNDeGqwUCDWE/a6DrmIDwe -emHSqMN2YvChAiEAnxLCM9NWaenOsaIoP+J1rDuvw+4499nJKVqGuVrSCRkCIEqK -4KSchPMc3x8M/uhw9oWTtKFmjA/PPh0FsWCdKrEy ------END RSA PRIVATE KEY-----`) - -// localhostCert was generated from crypto/tls/generate_cert.go with the following command: -// go run generate_cert.go --rsa-bits 512 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h -var localhostCert = []byte(`-----BEGIN CERTIFICATE----- -MIIBjzCCATmgAwIBAgIRAKpi2WmTcFrVjxrl5n5YDUEwDQYJKoZIhvcNAQELBQAw -EjEQMA4GA1UEChMHQWNtZSBDbzAgFw03MDAxMDEwMDAwMDBaGA8yMDg0MDEyOTE2 -MDAwMFowEjEQMA4GA1UEChMHQWNtZSBDbzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgC -QQC9fEbRszP3t14Gr4oahV7zFObBI4TfA5i7YnlMXeLinb7MnvT4bkfOJzE6zktn -59zP7UiHs3l4YOuqrjiwM413AgMBAAGjaDBmMA4GA1UdDwEB/wQEAwICpDATBgNV -HSUEDDAKBggrBgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MC4GA1UdEQQnMCWCC2V4 -YW1wbGUuY29thwR/AAABhxAAAAAAAAAAAAAAAAAAAAABMA0GCSqGSIb3DQEBCwUA -A0EAUsVE6KMnza/ZbodLlyeMzdo7EM/5nb5ywyOxgIOCf0OOLHsPS9ueGLQX9HEG -//yjTXuhNcUugExIjM/AIwAZPQ== ------END CERTIFICATE-----`) - -// localhostKey is the private key for localhostCert. -var localhostKey = []byte(`-----BEGIN RSA PRIVATE KEY----- -MIIBOwIBAAJBAL18RtGzM/e3XgavihqFXvMU5sEjhN8DmLtieUxd4uKdvsye9Phu -R84nMTrOS2fn3M/tSIezeXhg66quOLAzjXcCAwEAAQJBAKcRxH9wuglYLBdI/0OT -BLzfWPZCEw1vZmMR2FF1Fm8nkNOVDPleeVGTWoOEcYYlQbpTmkGSxJ6ya+hqRi6x -goECIQDx3+X49fwpL6B5qpJIJMyZBSCuMhH4B7JevhGGFENi3wIhAMiNJN5Q3UkL -IuSvv03kaPR5XVQ99/UeEetUgGvBcABpAiBJSBzVITIVCGkGc7d+RCf49KTCIklv -bGWObufAR8Ni4QIgWpILjW8dkGg8GOUZ0zaNA6Nvt6TIv2UWGJ4v5PoV98kCIQDx -rIiZs5QbKdycsv9gQJzwQAogC8o04X3Zz3dsoX+h4A== ------END RSA PRIVATE KEY-----`) diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/request/BUILD b/vendor/k8s.io/apiserver/pkg/endpoints/request/BUILD index ca759c1b6..bda772f4e 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/request/BUILD +++ b/vendor/k8s.io/apiserver/pkg/endpoints/request/BUILD @@ -9,9 +9,11 @@ load( go_test( name = "go_default_test", srcs = ["requestinfo_test.go"], - importpath = "k8s.io/apiserver/pkg/endpoints/request", - library = ":go_default_library", - deps = ["//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library"], + embed = [":go_default_library"], + deps = [ + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", + ], ) go_library( @@ -26,6 +28,7 @@ go_library( deps = [ "//vendor/github.com/golang/glog:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/audit:go_default_library", @@ -36,7 +39,6 @@ go_library( go_test( name = "go_default_xtest", srcs = ["context_test.go"], - importpath = "k8s.io/apiserver/pkg/endpoints/request_test", deps = [ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/request/context.go b/vendor/k8s.io/apiserver/pkg/endpoints/request/context.go index b63b84dc7..e64facc5c 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/request/context.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/request/context.go @@ -21,6 +21,7 @@ import ( "time" "golang.org/x/net/context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apiserver/pkg/apis/audit" "k8s.io/apiserver/pkg/authentication/user" @@ -66,8 +67,6 @@ const ( // auditKey is the context key for the audit event. auditKey - - namespaceDefault = "default" // TODO(sttts): solve import cycle when using metav1.NamespaceDefault ) // NewContext instantiates a base context object for request flows. @@ -77,7 +76,7 @@ func NewContext() Context { // NewDefaultContext instantiates a base context object for request flows in the default namespace func NewDefaultContext() Context { - return WithNamespace(NewContext(), namespaceDefault) + return WithNamespace(NewContext(), metav1.NamespaceDefault) } // WithValue returns a copy of parent in which the value associated with key is val. @@ -110,7 +109,7 @@ func NamespaceValue(ctx Context) string { func WithNamespaceDefaultIfNone(parent Context) Context { namespace, ok := NamespaceFrom(parent) if !ok || len(namespace) == 0 { - return WithNamespace(parent, namespaceDefault) + return WithNamespace(parent, metav1.NamespaceDefault) } return parent } diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo.go b/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo.go index bb0f0604d..ddbbde399 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo.go @@ -21,6 +21,7 @@ import ( "net/http" "strings" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" ) @@ -178,7 +179,7 @@ func (r *RequestInfoFactory) NewRequestInfo(req *http.Request) (*RequestInfo, er } } } else { - requestInfo.Namespace = "" // TODO(sttts): solve import cycle when using metav1.NamespaceNone + requestInfo.Namespace = metav1.NamespaceNone } // parsing successful, so we now know the proper value for .Parts diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo_test.go b/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo_test.go index 8354cca06..9d5a4dbf9 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo_test.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/request/requestinfo_test.go @@ -21,6 +21,7 @@ import ( "reflect" "testing" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" ) @@ -31,7 +32,7 @@ func (f fakeRL) TryAccept() bool { return bool(f) } func (f fakeRL) Accept() {} func TestGetAPIRequestInfo(t *testing.T) { - namespaceAll := "" // TODO(sttts): solve import cycle when using metav1.NamespaceAll + namespaceAll := metav1.NamespaceAll successCases := []struct { method string url string diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/testing/OWNERS b/vendor/k8s.io/apiserver/pkg/endpoints/testing/OWNERS index af6baf08b..8ee0deffd 100755 --- a/vendor/k8s.io/apiserver/pkg/endpoints/testing/OWNERS +++ b/vendor/k8s.io/apiserver/pkg/endpoints/testing/OWNERS @@ -4,7 +4,6 @@ reviewers: - caesarxuchao - liggitt - erictune -- timothysc - soltysh - mml - mbohlool diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/testing/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/endpoints/testing/zz_generated.deepcopy.go index bccd43c92..e5e497716 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/testing/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/endpoints/testing/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package testing @@ -53,9 +53,8 @@ func (in *Simple) DeepCopy() *Simple { func (in *Simple) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -79,9 +78,8 @@ func (in *SimpleGetOptions) DeepCopy() *SimpleGetOptions { func (in *SimpleGetOptions) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -113,9 +111,8 @@ func (in *SimpleList) DeepCopy() *SimpleList { func (in *SimpleList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -147,9 +144,8 @@ func (in *SimpleRoot) DeepCopy() *SimpleRoot { func (in *SimpleRoot) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -181,7 +177,6 @@ func (in *SimpleXGSubresource) DeepCopy() *SimpleXGSubresource { func (in *SimpleXGSubresource) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } diff --git a/vendor/k8s.io/apiserver/pkg/registry/generic/OWNERS b/vendor/k8s.io/apiserver/pkg/registry/generic/OWNERS index 429b15e49..75e139342 100755 --- a/vendor/k8s.io/apiserver/pkg/registry/generic/OWNERS +++ b/vendor/k8s.io/apiserver/pkg/registry/generic/OWNERS @@ -18,7 +18,6 @@ reviewers: - roberthbailey - ncdc - eparis -- timothysc - jlowdermilk - piosz - dims diff --git a/vendor/k8s.io/apiserver/pkg/registry/generic/options.go b/vendor/k8s.io/apiserver/pkg/registry/generic/options.go index 2f5c850ff..af651371f 100644 --- a/vendor/k8s.io/apiserver/pkg/registry/generic/options.go +++ b/vendor/k8s.io/apiserver/pkg/registry/generic/options.go @@ -17,6 +17,8 @@ limitations under the License. package generic import ( + "time" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/storage" "k8s.io/apiserver/pkg/storage/storagebackend" @@ -30,6 +32,7 @@ type RESTOptions struct { EnableGarbageCollection bool DeleteCollectionWorkers int ResourcePrefix string + CountMetricPollPeriod time.Duration } // Implement RESTOptionsGetter so that RESTOptions can directly be used when available (i.e. tests) diff --git a/vendor/k8s.io/apiserver/pkg/registry/generic/registry/BUILD b/vendor/k8s.io/apiserver/pkg/registry/generic/registry/BUILD index 02c6becc7..f6f70d86c 100644 --- a/vendor/k8s.io/apiserver/pkg/registry/generic/registry/BUILD +++ b/vendor/k8s.io/apiserver/pkg/registry/generic/registry/BUILD @@ -12,8 +12,7 @@ go_test( "decorated_watcher_test.go", "store_test.go", ], - importpath = "k8s.io/apiserver/pkg/registry/generic/registry", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", @@ -64,7 +63,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/api/validation/path:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1alpha1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/fields:go_default_library", "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", @@ -72,6 +71,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library", "//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library", @@ -79,6 +79,7 @@ go_library( "//vendor/k8s.io/apiserver/pkg/storage:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/errors:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/etcd:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/etcd/metrics:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/storagebackend:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory:go_default_library", ], diff --git a/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go b/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go index db77f4efe..d7e449c25 100644 --- a/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go +++ b/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/api/validation/path" metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1alpha1 "k8s.io/apimachinery/pkg/apis/meta/v1alpha1" + metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -36,13 +36,14 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" - "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/registry/generic" "k8s.io/apiserver/pkg/registry/rest" "k8s.io/apiserver/pkg/storage" storeerr "k8s.io/apiserver/pkg/storage/errors" + "k8s.io/apiserver/pkg/storage/etcd/metrics" "github.com/golang/glog" ) @@ -182,7 +183,10 @@ var _ rest.Exporter = &Store{} var _ rest.TableConvertor = &Store{} var _ GenericStore = &Store{} -const OptimisticLockErrorMsg = "the object has been modified; please apply your changes to the latest version and try again" +const ( + OptimisticLockErrorMsg = "the object has been modified; please apply your changes to the latest version and try again" + resourceCountPollPeriodJitter = 1.2 +) // NamespaceKeyRootFunc is the default function for constructing storage paths // to resource directories enforcing namespace rules. @@ -681,7 +685,7 @@ func (e *Store) Get(ctx genericapirequest.Context, name string, options *metav1. // qualifiedResourceFromContext attempts to retrieve a GroupResource from the context's request info. // If the context has no request info, DefaultQualifiedResource is used. func (e *Store) qualifiedResourceFromContext(ctx genericapirequest.Context) schema.GroupResource { - if info, ok := request.RequestInfoFrom(ctx); ok { + if info, ok := genericapirequest.RequestInfoFrom(ctx); ok { return schema.GroupResource{Group: info.APIGroup, Resource: info.Resource} } // some implementations access storage directly and thus the context has no RequestInfo @@ -1364,12 +1368,41 @@ func (e *Store) CompleteWithOptions(options *generic.StoreOptions) error { attrFunc, triggerFunc, ) + + if opts.CountMetricPollPeriod > 0 { + stopFunc := e.startObservingCount(opts.CountMetricPollPeriod) + previousDestroy := e.DestroyFunc + e.DestroyFunc = func() { + stopFunc() + if previousDestroy != nil { + previousDestroy() + } + } + } } return nil } -func (e *Store) ConvertToTable(ctx genericapirequest.Context, object runtime.Object, tableOptions runtime.Object) (*metav1alpha1.Table, error) { +// startObservingCount starts monitoring given prefix and periodically updating metrics. It returns a function to stop collection. +func (e *Store) startObservingCount(period time.Duration) func() { + prefix := e.KeyRootFunc(genericapirequest.NewContext()) + resourceName := e.DefaultQualifiedResource.String() + glog.V(2).Infof("Monitoring %v count at /%v", resourceName, prefix) + stopCh := make(chan struct{}) + go wait.JitterUntil(func() { + count, err := e.Storage.Count(prefix) + if err != nil { + glog.V(5).Infof("Failed to update storage count metric: %v", err) + metrics.UpdateObjectCount(resourceName, -1) + } else { + metrics.UpdateObjectCount(resourceName, count) + } + }, period, resourceCountPollPeriodJitter, true, stopCh) + return func() { close(stopCh) } +} + +func (e *Store) ConvertToTable(ctx genericapirequest.Context, object runtime.Object, tableOptions runtime.Object) (*metav1beta1.Table, error) { if e.TableConvertor != nil { return e.TableConvertor.ConvertToTable(ctx, object, tableOptions) } diff --git a/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store_test.go b/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store_test.go index 14d8fa6a3..1e0a96b55 100644 --- a/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store_test.go +++ b/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store_test.go @@ -43,7 +43,6 @@ import ( "k8s.io/apimachinery/pkg/watch" "k8s.io/apiserver/pkg/apis/example" examplev1 "k8s.io/apiserver/pkg/apis/example/v1" - "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/features" "k8s.io/apiserver/pkg/registry/generic" @@ -1920,8 +1919,8 @@ func TestFinalizeDelete(t *testing.T) { } } -func fakeRequestInfo(resource, apiGroup string) *request.RequestInfo { - return &request.RequestInfo{ +func fakeRequestInfo(resource, apiGroup string) *genericapirequest.RequestInfo { + return &genericapirequest.RequestInfo{ IsResourceRequest: true, Path: "/api/v1/test", Verb: "test", diff --git a/vendor/k8s.io/apiserver/pkg/registry/generic/rest/BUILD b/vendor/k8s.io/apiserver/pkg/registry/generic/rest/BUILD index 2bf06aae7..98cb77572 100644 --- a/vendor/k8s.io/apiserver/pkg/registry/generic/rest/BUILD +++ b/vendor/k8s.io/apiserver/pkg/registry/generic/rest/BUILD @@ -12,8 +12,7 @@ go_test( "response_checker_test.go", "streamer_test.go", ], - importpath = "k8s.io/apiserver/pkg/registry/generic/rest", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/registry/generic/rest/response_checker_test.go b/vendor/k8s.io/apiserver/pkg/registry/generic/rest/response_checker_test.go index 0f5c1cddf..50df0cc93 100644 --- a/vendor/k8s.io/apiserver/pkg/registry/generic/rest/response_checker_test.go +++ b/vendor/k8s.io/apiserver/pkg/registry/generic/rest/response_checker_test.go @@ -90,6 +90,6 @@ func TestGenericHttpResponseCheckerLimitReader(t *testing.T) { t.Error("unexpected non-error") } if len(err.Error()) != maxReadLength { - t.Errorf("expected lenth of error message: %d, saw: %d", maxReadLength, len(err.Error())) + t.Errorf("expected length of error message: %d, saw: %d", maxReadLength, len(err.Error())) } } diff --git a/vendor/k8s.io/apiserver/pkg/registry/rest/BUILD b/vendor/k8s.io/apiserver/pkg/registry/rest/BUILD index e662a4ee7..e638251d1 100644 --- a/vendor/k8s.io/apiserver/pkg/registry/rest/BUILD +++ b/vendor/k8s.io/apiserver/pkg/registry/rest/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["meta_test.go"], - importpath = "k8s.io/apiserver/pkg/registry/rest", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -42,7 +41,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1alpha1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/registry/rest/OWNERS b/vendor/k8s.io/apiserver/pkg/registry/rest/OWNERS index 9d8627ad1..6427750a9 100755 --- a/vendor/k8s.io/apiserver/pkg/registry/rest/OWNERS +++ b/vendor/k8s.io/apiserver/pkg/registry/rest/OWNERS @@ -14,7 +14,6 @@ reviewers: - roberthbailey - ncdc - eparis -- timothysc - dims - hongchaodeng - krousey diff --git a/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go b/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go index 1155c8ade..a2b0930f3 100644 --- a/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go +++ b/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go @@ -23,7 +23,7 @@ import ( metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1alpha1 "k8s.io/apimachinery/pkg/apis/meta/v1alpha1" + metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/watch" @@ -134,17 +134,7 @@ type GetterWithOptions interface { } type TableConvertor interface { - ConvertToTable(ctx genericapirequest.Context, object runtime.Object, tableOptions runtime.Object) (*metav1alpha1.Table, error) -} - -// Deleter is an object that can delete a named RESTful resource. -type Deleter interface { - // Delete finds a resource in the storage and deletes it. - // Although it can return an arbitrary error value, IsNotFound(err) is true for the - // returned error value err when the specified resource is not found. - // Delete *may* return the object that was deleted, or a status object indicating additional - // information about deletion. - Delete(ctx genericapirequest.Context, name string) (runtime.Object, error) + ConvertToTable(ctx genericapirequest.Context, object runtime.Object, tableOptions runtime.Object) (*metav1beta1.Table, error) } // GracefulDeleter knows how to pass deletion options to allow delayed deletion of a @@ -162,17 +152,6 @@ type GracefulDeleter interface { Delete(ctx genericapirequest.Context, name string, options *metav1.DeleteOptions) (runtime.Object, bool, error) } -// GracefulDeleteAdapter adapts the Deleter interface to GracefulDeleter -type GracefulDeleteAdapter struct { - Deleter -} - -// Delete implements RESTGracefulDeleter in terms of Deleter -func (w GracefulDeleteAdapter) Delete(ctx genericapirequest.Context, name string, options *metav1.DeleteOptions) (runtime.Object, bool, error) { - obj, err := w.Deleter.Delete(ctx, name) - return obj, true, err -} - // CollectionDeleter is an object that can delete a collection // of RESTful resources. type CollectionDeleter interface { diff --git a/vendor/k8s.io/apiserver/pkg/registry/rest/resttest/resttest.go b/vendor/k8s.io/apiserver/pkg/registry/rest/resttest/resttest.go index 083ac1dea..f7244e2b7 100644 --- a/vendor/k8s.io/apiserver/pkg/registry/rest/resttest/resttest.go +++ b/vendor/k8s.io/apiserver/pkg/registry/rest/resttest/resttest.go @@ -1330,7 +1330,7 @@ func (t *Tester) testListTableConversion(obj runtime.Object, assignFn AssignFunc t.Errorf("column %d has unexpected format: %q with type %q", j, column.Format, column.Type) } if column.Priority < 0 || column.Priority > 2 { - t.Errorf("column %d has unexpected priority", j, column.Priority) + t.Errorf("column %d has unexpected priority: %q", j, column.Priority) } if len(column.Description) == 0 { t.Errorf("column %d has no description", j) @@ -1341,7 +1341,7 @@ func (t *Tester) testListTableConversion(obj runtime.Object, assignFn AssignFunc } for i, row := range table.Rows { if len(row.Cells) != len(table.ColumnDefinitions) { - t.Errorf("row %d did not have the correct number of cells: %d in %v", len(table.ColumnDefinitions), row.Cells) + t.Errorf("row %d did not have the correct number of cells: %d in %v", i, len(table.ColumnDefinitions), row.Cells) } for j, cell := range row.Cells { // do not add to this test without discussion - may break clients diff --git a/vendor/k8s.io/apiserver/pkg/registry/rest/table.go b/vendor/k8s.io/apiserver/pkg/registry/rest/table.go index 4bc1b3668..2f0d1df3b 100644 --- a/vendor/k8s.io/apiserver/pkg/registry/rest/table.go +++ b/vendor/k8s.io/apiserver/pkg/registry/rest/table.go @@ -23,7 +23,7 @@ import ( "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1alpha1 "k8s.io/apimachinery/pkg/apis/meta/v1alpha1" + metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" genericapirequest "k8s.io/apiserver/pkg/endpoints/request" @@ -40,14 +40,14 @@ func NewDefaultTableConvertor(resource schema.GroupResource) TableConvertor { var swaggerMetadataDescriptions = metav1.ObjectMeta{}.SwaggerDoc() -func (c defaultTableConvertor) ConvertToTable(ctx genericapirequest.Context, object runtime.Object, tableOptions runtime.Object) (*metav1alpha1.Table, error) { - var table metav1alpha1.Table +func (c defaultTableConvertor) ConvertToTable(ctx genericapirequest.Context, object runtime.Object, tableOptions runtime.Object) (*metav1beta1.Table, error) { + var table metav1beta1.Table fn := func(obj runtime.Object) error { m, err := meta.Accessor(obj) if err != nil { return errNotAcceptable{resource: c.qualifiedResource} } - table.Rows = append(table.Rows, metav1alpha1.TableRow{ + table.Rows = append(table.Rows, metav1beta1.TableRow{ Cells: []interface{}{m.GetName(), m.GetCreationTimestamp().Time.UTC().Format(time.RFC3339)}, Object: runtime.RawExtension{Object: obj}, }) @@ -73,7 +73,7 @@ func (c defaultTableConvertor) ConvertToTable(ctx genericapirequest.Context, obj table.SelfLink = m.GetSelfLink() } } - table.ColumnDefinitions = []metav1alpha1.TableColumnDefinition{ + table.ColumnDefinitions = []metav1beta1.TableColumnDefinition{ {Name: "Name", Type: "string", Format: "name", Description: swaggerMetadataDescriptions["name"]}, {Name: "Created At", Type: "date", Description: swaggerMetadataDescriptions["creationTimestamp"]}, } diff --git a/vendor/k8s.io/apiserver/pkg/registry/rest/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/registry/rest/zz_generated.deepcopy.go index b4e3fd822..f7250379c 100644 --- a/vendor/k8s.io/apiserver/pkg/registry/rest/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/registry/rest/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package rest @@ -49,7 +49,6 @@ func (in *ConnectRequest) DeepCopy() *ConnectRequest { func (in *ConnectRequest) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } diff --git a/vendor/k8s.io/apiserver/pkg/server/BUILD b/vendor/k8s.io/apiserver/pkg/server/BUILD index 40bc126b1..c1073fc1d 100644 --- a/vendor/k8s.io/apiserver/pkg/server/BUILD +++ b/vendor/k8s.io/apiserver/pkg/server/BUILD @@ -13,8 +13,7 @@ go_test( "config_test.go", "genericapiserver_test.go", ], - importpath = "k8s.io/apiserver/pkg/server", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", @@ -35,11 +34,9 @@ go_test( "//vendor/k8s.io/apiserver/pkg/registry/rest:go_default_library", "//vendor/k8s.io/apiserver/pkg/server/filters:go_default_library", "//vendor/k8s.io/apiserver/pkg/server/healthz:go_default_library", - "//vendor/k8s.io/apiserver/pkg/storage/etcd/testing:go_default_library", "//vendor/k8s.io/client-go/informers:go_default_library", "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/kube-openapi/pkg/common:go_default_library", ], ) @@ -56,9 +53,38 @@ go_library( "plugins.go", "serve.go", "signal.go", - "signal_posix.go", ] + select({ - "@io_bazel_rules_go//go/platform:windows_amd64": [ + "@io_bazel_rules_go//go/platform:android": [ + "signal_posix.go", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "signal_posix.go", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "signal_posix.go", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "signal_posix.go", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "signal_posix.go", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "signal_posix.go", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "signal_posix.go", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "signal_posix.go", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "signal_posix.go", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "signal_posix.go", + ], + "@io_bazel_rules_go//go/platform:windows": [ "signal_windows.go", ], "//conditions:default": [], @@ -71,6 +97,7 @@ go_library( "//vendor/github.com/go-openapi/spec:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/pborman/uuid:go_default_library", + "//vendor/golang.org/x/net/http2:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apimachinery:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library", @@ -112,6 +139,7 @@ go_library( "//vendor/k8s.io/apiserver/pkg/server/healthz:go_default_library", "//vendor/k8s.io/apiserver/pkg/server/mux:go_default_library", "//vendor/k8s.io/apiserver/pkg/server/routes:go_default_library", + "//vendor/k8s.io/apiserver/pkg/server/storage:go_default_library", "//vendor/k8s.io/apiserver/pkg/util/feature:go_default_library", "//vendor/k8s.io/client-go/informers:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", @@ -136,6 +164,7 @@ filegroup( "//staging/src/k8s.io/apiserver/pkg/server/httplog:all-srcs", "//staging/src/k8s.io/apiserver/pkg/server/mux:all-srcs", "//staging/src/k8s.io/apiserver/pkg/server/options:all-srcs", + "//staging/src/k8s.io/apiserver/pkg/server/resourceconfig:all-srcs", "//staging/src/k8s.io/apiserver/pkg/server/routes:all-srcs", "//staging/src/k8s.io/apiserver/pkg/server/storage:all-srcs", ], diff --git a/vendor/k8s.io/apiserver/pkg/server/config.go b/vendor/k8s.io/apiserver/pkg/server/config.go index 877071ad3..2f4c48b45 100644 --- a/vendor/k8s.io/apiserver/pkg/server/config.go +++ b/vendor/k8s.io/apiserver/pkg/server/config.go @@ -57,6 +57,7 @@ import ( genericfilters "k8s.io/apiserver/pkg/server/filters" "k8s.io/apiserver/pkg/server/healthz" "k8s.io/apiserver/pkg/server/routes" + serverstore "k8s.io/apiserver/pkg/server/storage" utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/informers" restclient "k8s.io/client-go/rest" @@ -78,17 +79,19 @@ const ( // Config is a structure used to configure a GenericAPIServer. // Its members are sorted roughly in order of importance for composers. type Config struct { - // SecureServingInfo is required to serve https - SecureServingInfo *SecureServingInfo + // SecureServing is required to serve https + SecureServing *SecureServingInfo + + // Authentication is the configuration for authentication + Authentication AuthenticationInfo + + // Authorization is the configuration for authorization + Authorization AuthorizationInfo // LoopbackClientConfig is a config for a privileged loopback connection to the API server // This is required for proper functioning of the PostStartHooks on a GenericAPIServer + // TODO: move into SecureServing(WithLoopback) as soon as insecure serving is gone LoopbackClientConfig *restclient.Config - // Authenticator determines which subject is making the request - Authenticator authenticator.Request - // Authorizer determines whether the subject is allowed to make the request based only - // on the RequestURI - Authorizer authorizer.Authorizer // RuleResolver is required to get the list of rules that apply to a given user // in a given namespace RuleResolver authorizer.RuleResolver @@ -115,10 +118,6 @@ type Config struct { AuditBackend audit.Backend // AuditPolicyChecker makes the decision of whether and how to audit log a request. AuditPolicyChecker auditpolicy.Checker - // SupportsBasicAuth indicates that's at least one Authenticator supports basic auth - // If this is true, a basic auth challenge is returned on authentication failure - // TODO(roberthbailey): Remove once the server no longer supports http basic auth. - SupportsBasicAuth bool // ExternalAddress is the host name to use for external (public internet) facing URLs (e.g. Swagger) // Will default to a value based on secure serving info and available ipv4 IPs. ExternalAddress string @@ -175,6 +174,11 @@ type Config struct { // if the client requests it via Accept-Encoding EnableAPIResponseCompression bool + // MergedResourceConfig indicates which groupVersion enabled and its resources enabled/disabled. + // This is composed of genericapiserver defaultAPIResourceConfig and those parsed from flags. + // If not specify any in flags, then genericapiserver will only enable defaultAPIResourceConfig. + MergedResourceConfig *serverstore.ResourceConfig + //=========================================================================== // values below here are targets for removal //=========================================================================== @@ -210,10 +214,6 @@ type SecureServingInfo struct { // allowed to be in SNICerts. Cert *tls.Certificate - // CACert is an optional certificate authority used for the loopback connection of the Admission controllers. - // If this is nil, the certificate authority is extracted from Cert or a matching SNI certificate. - CACert *tls.Certificate - // SNICerts are the TLS certificates by name used for SNI. SNICerts map[string]*tls.Certificate @@ -227,6 +227,25 @@ type SecureServingInfo struct { // CipherSuites optionally overrides the list of allowed cipher suites for the server. // Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants). CipherSuites []uint16 + + // HTTP2MaxStreamsPerConnection is the limit that the api server imposes on each client. + // A value of zero means to use the default provided by golang's HTTP/2 support. + HTTP2MaxStreamsPerConnection int +} + +type AuthenticationInfo struct { + // Authenticator determines which subject is making the request + Authenticator authenticator.Request + // SupportsBasicAuth indicates that's at least one Authenticator supports basic auth + // If this is true, a basic auth challenge is returned on authentication failure + // TODO(roberthbailey): Remove once the server no longer supports http basic auth. + SupportsBasicAuth bool +} + +type AuthorizationInfo struct { + // Authorizer determines whether the subject is allowed to make the request based only + // on the RequestURI + Authorizer authorizer.Authorizer } // NewConfig returns a Config struct with the default values @@ -300,23 +319,23 @@ func DefaultSwaggerConfig() *swagger.Config { } } -func (c *Config) ApplyClientCert(clientCAFile string) (*Config, error) { - if c.SecureServingInfo != nil { +func (c *AuthenticationInfo) ApplyClientCert(clientCAFile string, servingInfo *SecureServingInfo) error { + if servingInfo != nil { if len(clientCAFile) > 0 { clientCAs, err := certutil.CertsFromFile(clientCAFile) if err != nil { - return nil, fmt.Errorf("unable to load client CA file: %v", err) + return fmt.Errorf("unable to load client CA file: %v", err) } - if c.SecureServingInfo.ClientCA == nil { - c.SecureServingInfo.ClientCA = x509.NewCertPool() + if servingInfo.ClientCA == nil { + servingInfo.ClientCA = x509.NewCertPool() } for _, cert := range clientCAs { - c.SecureServingInfo.ClientCA.AddCert(cert) + servingInfo.ClientCA.AddCert(cert) } } } - return c, nil + return nil } type completedConfig struct { @@ -338,13 +357,17 @@ type CompletedConfig struct { // Complete fills in any fields not set that are required to have valid data and can be derived // from other fields. If you're going to `ApplyOptions`, do that first. It's mutating the receiver. func (c *Config) Complete(informers informers.SharedInformerFactory) CompletedConfig { - if len(c.ExternalAddress) == 0 && c.PublicAddress != nil { - hostAndPort := c.PublicAddress.String() - if c.ReadWritePort != 0 { - hostAndPort = net.JoinHostPort(hostAndPort, strconv.Itoa(c.ReadWritePort)) - } - c.ExternalAddress = hostAndPort + host := c.ExternalAddress + if host == "" && c.PublicAddress != nil { + host = c.PublicAddress.String() } + + // if there is no port, and we have a ReadWritePort, use that + if _, _, err := net.SplitHostPort(host); err != nil && c.ReadWritePort != 0 { + host = net.JoinHostPort(host, strconv.Itoa(c.ReadWritePort)) + } + c.ExternalAddress = host + if c.OpenAPIConfig != nil && c.OpenAPIConfig.SecurityDefinitions != nil { // Setup OpenAPI security: all APIs will have the same authentication for now. c.OpenAPIConfig.DefaultSecurity = []map[string][]string{} @@ -379,7 +402,7 @@ func (c *Config) Complete(informers informers.SharedInformerFactory) CompletedCo } } if c.SwaggerConfig != nil && len(c.SwaggerConfig.WebServicesUrl) == 0 { - if c.SecureServingInfo != nil { + if c.SecureServing != nil { c.SwaggerConfig.WebServicesUrl = "https://" + c.ExternalAddress } else { c.SwaggerConfig.WebServicesUrl = "http://" + c.ExternalAddress @@ -391,7 +414,7 @@ func (c *Config) Complete(informers informers.SharedInformerFactory) CompletedCo // If the loopbackclientconfig is specified AND it has a token for use against the API server // wrap the authenticator and authorizer in loopback authentication logic - if c.Authenticator != nil && c.Authorizer != nil && c.LoopbackClientConfig != nil && len(c.LoopbackClientConfig.BearerToken) > 0 { + if c.Authentication.Authenticator != nil && c.Authorization.Authorizer != nil && c.LoopbackClientConfig != nil && len(c.LoopbackClientConfig.BearerToken) > 0 { privilegedLoopbackToken := c.LoopbackClientConfig.BearerToken var uid = uuid.NewRandom().String() tokens := make(map[string]*user.DefaultInfo) @@ -402,10 +425,10 @@ func (c *Config) Complete(informers informers.SharedInformerFactory) CompletedCo } tokenAuthenticator := authenticatorfactory.NewFromTokens(tokens) - c.Authenticator = authenticatorunion.New(tokenAuthenticator, c.Authenticator) + c.Authentication.Authenticator = authenticatorunion.New(tokenAuthenticator, c.Authentication.Authenticator) tokenAuthorizer := authorizerfactory.NewPrivilegedGroups(user.SystemPrivilegedGroup) - c.Authorizer = authorizerunion.New(tokenAuthorizer, c.Authorizer) + c.Authorization.Authorizer = authorizerunion.New(tokenAuthorizer, c.Authorization.Authorizer) } if c.RequestInfoResolver == nil { @@ -452,7 +475,7 @@ func (c completedConfig) New(name string, delegationTarget DelegationTarget) (*G minRequestTimeout: time.Duration(c.MinRequestTimeout) * time.Second, ShutdownTimeout: c.RequestTimeout, - SecureServingInfo: c.SecureServingInfo, + SecureServingInfo: c.SecureServing, ExternalAddress: c.ExternalAddress, Handler: apiServerHandler, @@ -524,19 +547,19 @@ func (c completedConfig) New(name string, delegationTarget DelegationTarget) (*G } func DefaultBuildHandlerChain(apiHandler http.Handler, c *Config) http.Handler { - handler := genericapifilters.WithAuthorization(apiHandler, c.RequestContextMapper, c.Authorizer, c.Serializer) + handler := genericapifilters.WithAuthorization(apiHandler, c.RequestContextMapper, c.Authorization.Authorizer, c.Serializer) handler = genericfilters.WithMaxInFlightLimit(handler, c.MaxRequestsInFlight, c.MaxMutatingRequestsInFlight, c.RequestContextMapper, c.LongRunningFunc) - handler = genericapifilters.WithImpersonation(handler, c.RequestContextMapper, c.Authorizer, c.Serializer) + handler = genericapifilters.WithImpersonation(handler, c.RequestContextMapper, c.Authorization.Authorizer, c.Serializer) if utilfeature.DefaultFeatureGate.Enabled(features.AdvancedAuditing) { handler = genericapifilters.WithAudit(handler, c.RequestContextMapper, c.AuditBackend, c.AuditPolicyChecker, c.LongRunningFunc) } else { handler = genericapifilters.WithLegacyAudit(handler, c.RequestContextMapper, c.LegacyAuditWriter) } - failedHandler := genericapifilters.Unauthorized(c.RequestContextMapper, c.Serializer, c.SupportsBasicAuth) + failedHandler := genericapifilters.Unauthorized(c.RequestContextMapper, c.Serializer, c.Authentication.SupportsBasicAuth) if utilfeature.DefaultFeatureGate.Enabled(features.AdvancedAuditing) { failedHandler = genericapifilters.WithFailedAuthenticationAudit(failedHandler, c.RequestContextMapper, c.AuditBackend, c.AuditPolicyChecker) } - handler = genericapifilters.WithAuthentication(handler, c.RequestContextMapper, c.Authenticator, failedHandler) + handler = genericapifilters.WithAuthentication(handler, c.RequestContextMapper, c.Authentication.Authenticator, failedHandler) handler = genericfilters.WithCORS(handler, c.CorsAllowedOriginList, nil, nil, nil, "true") handler = genericfilters.WithTimeoutForNonLongRunningRequests(handler, c.RequestContextMapper, c.LongRunningFunc, c.RequestTimeout) handler = genericfilters.WithWaitGroup(handler, c.RequestContextMapper, c.LongRunningFunc, c.HandlerChainWaitGroup) diff --git a/vendor/k8s.io/apiserver/pkg/server/config_test.go b/vendor/k8s.io/apiserver/pkg/server/config_test.go index 9f0ac45c5..381318c8d 100644 --- a/vendor/k8s.io/apiserver/pkg/server/config_test.go +++ b/vendor/k8s.io/apiserver/pkg/server/config_test.go @@ -45,9 +45,7 @@ func TestNewWithDelegate(t *testing.T) { t.Fatal("unable to create fake client set") } - delegateHealthzCalled := false delegateConfig.HealthzChecks = append(delegateConfig.HealthzChecks, healthz.NamedCheck("delegate-health", func(r *http.Request) error { - delegateHealthzCalled = true return fmt.Errorf("delegate failed healthcheck") })) @@ -74,9 +72,7 @@ func TestNewWithDelegate(t *testing.T) { wrappingConfig.LoopbackClientConfig = &rest.Config{} wrappingConfig.SwaggerConfig = DefaultSwaggerConfig() - wrappingHealthzCalled := false wrappingConfig.HealthzChecks = append(wrappingConfig.HealthzChecks, healthz.NamedCheck("wrapping-health", func(r *http.Request) error { - wrappingHealthzCalled = true return fmt.Errorf("wrapping failed healthcheck") })) diff --git a/vendor/k8s.io/apiserver/pkg/server/filters/BUILD b/vendor/k8s.io/apiserver/pkg/server/filters/BUILD index bf72edc37..6404a3953 100644 --- a/vendor/k8s.io/apiserver/pkg/server/filters/BUILD +++ b/vendor/k8s.io/apiserver/pkg/server/filters/BUILD @@ -14,8 +14,7 @@ go_test( "maxinflight_test.go", "timeout_test.go", ], - importpath = "k8s.io/apiserver/pkg/server/filters", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -47,6 +46,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/waitgroup:go_default_library", "//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library", "//vendor/k8s.io/apiserver/pkg/endpoints/metrics:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/server/filters/compression.go b/vendor/k8s.io/apiserver/pkg/server/filters/compression.go index 6303ab54a..6bedfadea 100644 --- a/vendor/k8s.io/apiserver/pkg/server/filters/compression.go +++ b/vendor/k8s.io/apiserver/pkg/server/filters/compression.go @@ -136,6 +136,7 @@ func (c *compressionResponseWriter) Write(p []byte) (int, error) { return -1, errors.New("compressing error: tried to write data using closed compressor") } c.Header().Set(headerContentEncoding, c.encoding) + defer c.compressor.Flush() return c.compressor.Write(p) } diff --git a/vendor/k8s.io/apiserver/pkg/server/filters/compression_test.go b/vendor/k8s.io/apiserver/pkg/server/filters/compression_test.go index 931c90515..07d46d5bf 100644 --- a/vendor/k8s.io/apiserver/pkg/server/filters/compression_test.go +++ b/vendor/k8s.io/apiserver/pkg/server/filters/compression_test.go @@ -94,7 +94,7 @@ func TestCompression(t *testing.T) { } body, err := ioutil.ReadAll(reader) if err != nil { - t.Fatal("unexpected error: %v", err) + t.Fatalf("unexpected error: %v", err) } if !bytes.Equal(body, responseData) { t.Fatalf("Expected response body %s to equal %s", body, responseData) diff --git a/vendor/k8s.io/apiserver/pkg/server/filters/cors_test.go b/vendor/k8s.io/apiserver/pkg/server/filters/cors_test.go index 6e8b46236..8b39c9497 100644 --- a/vendor/k8s.io/apiserver/pkg/server/filters/cors_test.go +++ b/vendor/k8s.io/apiserver/pkg/server/filters/cors_test.go @@ -42,21 +42,22 @@ func TestCORSAllowedOrigins(t *testing.T) { http.HandlerFunc(func(http.ResponseWriter, *http.Request) {}), item.allowedOrigins, nil, nil, nil, "true", ) - server := httptest.NewServer(handler) - defer server.Close() - client := http.Client{} - - request, err := http.NewRequest("GET", server.URL+"/version", nil) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - request.Header.Set("Origin", item.origin) - - response, err := client.Do(request) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - + var response *http.Response + func() { + server := httptest.NewServer(handler) + defer server.Close() + + request, err := http.NewRequest("GET", server.URL+"/version", nil) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + request.Header.Set("Origin", item.origin) + client := http.Client{} + response, err = client.Do(request) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + }() if item.allowed { if !reflect.DeepEqual(item.origin, response.Header.Get("Access-Control-Allow-Origin")) { t.Errorf("Expected %#v, Got %#v", item.origin, response.Header.Get("Access-Control-Allow-Origin")) @@ -131,20 +132,22 @@ func TestCORSAllowedMethods(t *testing.T) { http.HandlerFunc(func(http.ResponseWriter, *http.Request) {}), []string{".*"}, test.allowedMethods, nil, nil, "true", ) - server := httptest.NewServer(handler) - defer server.Close() - client := http.Client{} - - request, err := http.NewRequest(test.method, server.URL+"/version", nil) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - request.Header.Set("Origin", "allowed.com") - - response, err := client.Do(request) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + var response *http.Response + func() { + server := httptest.NewServer(handler) + defer server.Close() + + request, err := http.NewRequest(test.method, server.URL+"/version", nil) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + request.Header.Set("Origin", "allowed.com") + client := http.Client{} + response, err = client.Do(request) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + }() methodAllowed := allowsMethod(response, test.method) switch { diff --git a/vendor/k8s.io/apiserver/pkg/server/filters/longrunning.go b/vendor/k8s.io/apiserver/pkg/server/filters/longrunning.go index 21c4562aa..1b58f1638 100644 --- a/vendor/k8s.io/apiserver/pkg/server/filters/longrunning.go +++ b/vendor/k8s.io/apiserver/pkg/server/filters/longrunning.go @@ -18,12 +18,13 @@ package filters import ( "net/http" + "strings" "k8s.io/apimachinery/pkg/util/sets" apirequest "k8s.io/apiserver/pkg/endpoints/request" ) -// BasicLongRunningRequestCheck returns true if the given request has one of the specified verbs or one of the specified subresources +// BasicLongRunningRequestCheck returns true if the given request has one of the specified verbs or one of the specified subresources, or is a profiler request. func BasicLongRunningRequestCheck(longRunningVerbs, longRunningSubresources sets.String) apirequest.LongRunningRequestCheck { return func(r *http.Request, requestInfo *apirequest.RequestInfo) bool { if longRunningVerbs.Has(requestInfo.Verb) { @@ -32,6 +33,9 @@ func BasicLongRunningRequestCheck(longRunningVerbs, longRunningSubresources sets if requestInfo.IsResourceRequest && longRunningSubresources.Has(requestInfo.Subresource) { return true } + if !requestInfo.IsResourceRequest && strings.HasPrefix(requestInfo.Path, "/debug/pprof/") { + return true + } return false } } diff --git a/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go b/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go index 47ed94913..84fa31c72 100644 --- a/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go +++ b/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go @@ -19,8 +19,11 @@ package filters import ( "fmt" "net/http" + "sync" + "time" "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apiserver/pkg/authentication/user" "k8s.io/apiserver/pkg/endpoints/metrics" apirequest "k8s.io/apiserver/pkg/endpoints/request" @@ -28,9 +31,16 @@ import ( "github.com/golang/glog" ) -// Constant for the retry-after interval on rate limiting. -// TODO: maybe make this dynamic? or user-adjustable? -const retryAfter = "1" +const ( + // Constant for the retry-after interval on rate limiting. + // TODO: maybe make this dynamic? or user-adjustable? + retryAfter = "1" + + // How often inflight usage metric should be updated. Because + // the metrics tracks maximal value over period making this + // longer will increase the metric value. + inflightUsageMetricUpdatePeriod = time.Second +) var nonMutatingRequestVerbs = sets.NewString("get", "list", "watch") @@ -40,6 +50,49 @@ func handleError(w http.ResponseWriter, r *http.Request, err error) { glog.Errorf(err.Error()) } +// requestWatermark is used to trak maximal usage of inflight requests. +type requestWatermark struct { + lock sync.Mutex + readOnlyWatermark, mutatingWatermark int +} + +func (w *requestWatermark) recordMutating(mutatingVal int) { + w.lock.Lock() + defer w.lock.Unlock() + + if w.mutatingWatermark < mutatingVal { + w.mutatingWatermark = mutatingVal + } +} + +func (w *requestWatermark) recordReadOnly(readOnlyVal int) { + w.lock.Lock() + defer w.lock.Unlock() + + if w.readOnlyWatermark < readOnlyVal { + w.readOnlyWatermark = readOnlyVal + } +} + +var watermark = &requestWatermark{} + +func startRecordingUsage() { + go func() { + wait.Forever(func() { + watermark.lock.Lock() + readOnlyWatermark := watermark.readOnlyWatermark + mutatingWatermark := watermark.mutatingWatermark + watermark.readOnlyWatermark = 0 + watermark.mutatingWatermark = 0 + watermark.lock.Unlock() + + metrics.UpdateInflightRequestMetrics(readOnlyWatermark, mutatingWatermark) + }, inflightUsageMetricUpdatePeriod) + }() +} + +var startOnce sync.Once + // WithMaxInFlightLimit limits the number of in-flight requests to buffer size of the passed in channel. func WithMaxInFlightLimit( handler http.Handler, @@ -48,6 +101,7 @@ func WithMaxInFlightLimit( requestContextMapper apirequest.RequestContextMapper, longRunningRequestCheck apirequest.LongRunningRequestCheck, ) http.Handler { + startOnce.Do(startRecordingUsage) if nonMutatingLimit == 0 && mutatingLimit == 0 { return handler } @@ -79,7 +133,8 @@ func WithMaxInFlightLimit( } var c chan bool - if !nonMutatingRequestVerbs.Has(requestInfo.Verb) { + isMutatingRequest := !nonMutatingRequestVerbs.Has(requestInfo.Verb) + if isMutatingRequest { c = mutatingChan } else { c = nonMutatingChan @@ -91,10 +146,31 @@ func WithMaxInFlightLimit( select { case c <- true: - defer func() { <-c }() + var mutatingLen, readOnlyLen int + if isMutatingRequest { + mutatingLen = len(mutatingChan) + } else { + readOnlyLen = len(nonMutatingChan) + } + + defer func() { + <-c + if isMutatingRequest { + watermark.recordMutating(mutatingLen) + } else { + watermark.recordReadOnly(readOnlyLen) + } + + }() handler.ServeHTTP(w, r) default: + // We need to split this data between buckets used for throttling. + if isMutatingRequest { + metrics.DroppedRequests.WithLabelValues(metrics.MutatingKind).Inc() + } else { + metrics.DroppedRequests.WithLabelValues(metrics.ReadOnlyKind).Inc() + } // at this point we're about to return a 429, BUT not all actors should be rate limited. A system:master is so powerful // that he should always get an answer. It's a super-admin or a loopback connection. if currUser, ok := apirequest.UserFrom(ctx); ok { diff --git a/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go b/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go index 0e67da252..a1582627f 100644 --- a/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go +++ b/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go @@ -30,7 +30,7 @@ import ( apirequest "k8s.io/apiserver/pkg/endpoints/request" ) -var errConnKilled = fmt.Errorf("kill connection/stream") +var errConnKilled = fmt.Errorf("killing connection/stream because serving request timed out and response had been started") // WithTimeoutForNonLongRunningRequests times out non-long-running requests after the time given by timeout. func WithTimeoutForNonLongRunningRequests(handler http.Handler, requestContextMapper apirequest.RequestContextMapper, longRunning apirequest.LongRunningRequestCheck, timeout time.Duration) http.Handler { @@ -129,7 +129,7 @@ type baseTimeoutWriter struct { w http.ResponseWriter mu sync.Mutex - // if the timeout handler has timedout + // if the timeout handler has timeout timedOut bool // if this timeout writer has wrote header wroteHeader bool diff --git a/vendor/k8s.io/apiserver/pkg/server/filters/waitgroup.go b/vendor/k8s.io/apiserver/pkg/server/filters/waitgroup.go index be73a2c9d..c73978e20 100644 --- a/vendor/k8s.io/apiserver/pkg/server/filters/waitgroup.go +++ b/vendor/k8s.io/apiserver/pkg/server/filters/waitgroup.go @@ -42,7 +42,7 @@ func WithWaitGroup(handler http.Handler, requestContextMapper apirequest.Request if !longRunning(req, requestInfo) { if err := wg.Add(1); err != nil { - http.Error(w, "Apisever is shutting down.", http.StatusInternalServerError) + http.Error(w, "apiserver is shutting down.", http.StatusInternalServerError) return } defer wg.Done() diff --git a/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go b/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go index f252fedd8..38742ffd9 100644 --- a/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go +++ b/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go @@ -30,8 +30,8 @@ import ( func WithPanicRecovery(handler http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { defer runtime.HandleCrash(func(err interface{}) { - http.Error(w, "This request caused apisever to panic. Look in log for details.", http.StatusInternalServerError) - glog.Errorf("APIServer panic'd on %v %v: %v\n%s\n", req.Method, req.RequestURI, err, debug.Stack()) + http.Error(w, "This request caused apiserver to panic. Look in the logs for details.", http.StatusInternalServerError) + glog.Errorf("apiserver panic'd on %v %v: %v\n%s\n", req.Method, req.RequestURI, err, debug.Stack()) }) logger := httplog.NewLogged(req, &w) diff --git a/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go b/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go index 8235b2654..38cd2e981 100644 --- a/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go +++ b/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go @@ -310,7 +310,7 @@ func (s preparedGenericAPIServer) NonBlockingRun(stopCh <-chan struct{}) error { internalStopCh := make(chan struct{}) if s.SecureServingInfo != nil && s.Handler != nil { - if err := s.serveSecurely(internalStopCh); err != nil { + if err := s.SecureServingInfo.Serve(s.Handler, s.ShutdownTimeout, internalStopCh); err != nil { close(internalStopCh) return err } diff --git a/vendor/k8s.io/apiserver/pkg/server/genericapiserver_test.go b/vendor/k8s.io/apiserver/pkg/server/genericapiserver_test.go index cf8c1a79a..18761881b 100644 --- a/vendor/k8s.io/apiserver/pkg/server/genericapiserver_test.go +++ b/vendor/k8s.io/apiserver/pkg/server/genericapiserver_test.go @@ -50,11 +50,9 @@ import ( apirequest "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/registry/rest" genericfilters "k8s.io/apiserver/pkg/server/filters" - etcdtesting "k8s.io/apiserver/pkg/storage/etcd/testing" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" restclient "k8s.io/client-go/rest" - openapi "k8s.io/kube-openapi/pkg/common" ) const ( @@ -82,14 +80,8 @@ func init() { examplev1.AddToScheme(scheme) } -func testGetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.OpenAPIDefinition { - return map[string]openapi.OpenAPIDefinition{} -} - // setUp is a convience function for setting up for (most) tests. -func setUp(t *testing.T) (*etcdtesting.EtcdTestServer, Config, *assert.Assertions) { - etcdServer, _ := etcdtesting.NewUnsecuredEtcd3TestClientServer(t) - +func setUp(t *testing.T) (Config, *assert.Assertions) { config := NewConfig(codecs) config.PublicAddress = net.ParseIP("192.168.10.4") config.RequestContextMapper = apirequest.NewRequestContextMapper() @@ -113,24 +105,23 @@ func setUp(t *testing.T) (*etcdtesting.EtcdTestServer, Config, *assert.Assertion sharedInformers := informers.NewSharedInformerFactory(clientset, config.LoopbackClientConfig.Timeout) config.Complete(sharedInformers) - return etcdServer, *config, assert.New(t) + return *config, assert.New(t) } -func newMaster(t *testing.T) (*GenericAPIServer, *etcdtesting.EtcdTestServer, Config, *assert.Assertions) { - etcdserver, config, assert := setUp(t) +func newMaster(t *testing.T) (*GenericAPIServer, Config, *assert.Assertions) { + config, assert := setUp(t) s, err := config.Complete(nil).New("test", EmptyDelegate) if err != nil { t.Fatalf("Error in bringing up the server: %v", err) } - return s, etcdserver, config, assert + return s, config, assert } // TestNew verifies that the New function returns a GenericAPIServer // using the configuration properly. func TestNew(t *testing.T) { - s, etcdserver, config, assert := newMaster(t) - defer etcdserver.Terminate(t) + s, config, assert := newMaster(t) // Verify many of the variables match their config counterparts assert.Equal(s.legacyAPIGroupPrefixes, config.LegacyAPIGroupPrefixes) @@ -145,8 +136,7 @@ func TestNew(t *testing.T) { // Verifies that AddGroupVersions works as expected. func TestInstallAPIGroups(t *testing.T) { - etcdserver, config, assert := setUp(t) - defer etcdserver.Terminate(t) + config, assert := setUp(t) config.LegacyAPIGroupPrefixes = sets.NewString("/apiPrefix") config.DiscoveryAddresses = discovery.DefaultAddresses{DefaultAddress: "ExternalAddress"} @@ -312,8 +302,7 @@ func TestInstallAPIGroups(t *testing.T) { } func TestPrepareRun(t *testing.T) { - s, etcdserver, config, assert := newMaster(t) - defer etcdserver.Terminate(t) + s, config, assert := newMaster(t) assert.NotNil(config.SwaggerConfig) @@ -340,8 +329,7 @@ func TestPrepareRun(t *testing.T) { // TestCustomHandlerChain verifies the handler chain with custom handler chain builder functions. func TestCustomHandlerChain(t *testing.T) { - etcdserver, config, _ := setUp(t) - defer etcdserver.Terminate(t) + config, _ := setUp(t) var protected, called bool @@ -394,13 +382,12 @@ func TestCustomHandlerChain(t *testing.T) { // TestNotRestRoutesHaveAuth checks that special non-routes are behind authz/authn. func TestNotRestRoutesHaveAuth(t *testing.T) { - etcdserver, config, _ := setUp(t) - defer etcdserver.Terminate(t) + config, _ := setUp(t) authz := mockAuthorizer{} config.LegacyAPIGroupPrefixes = sets.NewString("/apiPrefix") - config.Authorizer = &authz + config.Authorization.Authorizer = &authz config.EnableSwaggerUI = true config.EnableIndex = true @@ -516,8 +503,7 @@ func fakeVersion() version.Info { // TestGracefulShutdown verifies server shutdown after request handler finish. func TestGracefulShutdown(t *testing.T) { - etcdserver, config, _ := setUp(t) - defer etcdserver.Terminate(t) + config, _ := setUp(t) var graceShutdown bool wg := sync.WaitGroup{} diff --git a/vendor/k8s.io/apiserver/pkg/server/handler.go b/vendor/k8s.io/apiserver/pkg/server/handler.go index 5368e2e0f..a92196cba 100644 --- a/vendor/k8s.io/apiserver/pkg/server/handler.go +++ b/vendor/k8s.io/apiserver/pkg/server/handler.go @@ -34,7 +34,6 @@ import ( "k8s.io/apiserver/pkg/endpoints/handlers/responsewriters" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/server/mux" - genericmux "k8s.io/apiserver/pkg/server/mux" ) // APIServerHandlers holds the different http.Handlers used by the API server. @@ -74,7 +73,7 @@ type APIServerHandler struct { type HandlerChainBuilderFn func(apiHandler http.Handler) http.Handler func NewAPIServerHandler(name string, contextMapper request.RequestContextMapper, s runtime.NegotiatedSerializer, handlerChainBuilder HandlerChainBuilderFn, notFoundHandler http.Handler) *APIServerHandler { - nonGoRestfulMux := genericmux.NewPathRecorderMux(name) + nonGoRestfulMux := mux.NewPathRecorderMux(name) if notFoundHandler != nil { nonGoRestfulMux.NotFoundHandler(notFoundHandler) } diff --git a/vendor/k8s.io/apiserver/pkg/server/healthz/BUILD b/vendor/k8s.io/apiserver/pkg/server/healthz/BUILD index 8b3901bb8..f4ccb4965 100644 --- a/vendor/k8s.io/apiserver/pkg/server/healthz/BUILD +++ b/vendor/k8s.io/apiserver/pkg/server/healthz/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["healthz_test.go"], - importpath = "k8s.io/apiserver/pkg/server/healthz", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/apiserver/pkg/server/httplog/BUILD b/vendor/k8s.io/apiserver/pkg/server/httplog/BUILD index 16ea0eb73..3a620708a 100644 --- a/vendor/k8s.io/apiserver/pkg/server/httplog/BUILD +++ b/vendor/k8s.io/apiserver/pkg/server/httplog/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["httplog_test.go"], - importpath = "k8s.io/apiserver/pkg/server/httplog", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/apiserver/pkg/server/mux/BUILD b/vendor/k8s.io/apiserver/pkg/server/mux/BUILD index fecbbe7b7..5cc9e13d2 100644 --- a/vendor/k8s.io/apiserver/pkg/server/mux/BUILD +++ b/vendor/k8s.io/apiserver/pkg/server/mux/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["pathrecorder_test.go"], - importpath = "k8s.io/apiserver/pkg/server/mux", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/github.com/stretchr/testify/assert:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/pkg/server/options/BUILD b/vendor/k8s.io/apiserver/pkg/server/options/BUILD index 7a9196f14..506e3eef8 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/BUILD +++ b/vendor/k8s.io/apiserver/pkg/server/options/BUILD @@ -4,6 +4,7 @@ go_library( name = "go_default_library", srcs = [ "admission.go", + "api_enablement.go", "audit.go", "authentication.go", "authorization.go", @@ -14,6 +15,7 @@ go_library( "recommended.go", "server_run_options.go", "serving.go", + "serving_with_loopback.go", ], importpath = "k8s.io/apiserver/pkg/server/options", visibility = ["//visibility:public"], @@ -47,11 +49,13 @@ go_library( "//vendor/k8s.io/apiserver/pkg/registry/generic/registry:go_default_library", "//vendor/k8s.io/apiserver/pkg/server:go_default_library", "//vendor/k8s.io/apiserver/pkg/server/healthz:go_default_library", + "//vendor/k8s.io/apiserver/pkg/server/resourceconfig:go_default_library", "//vendor/k8s.io/apiserver/pkg/server/storage:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/etcd3/preflight:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/storagebackend:go_default_library", "//vendor/k8s.io/apiserver/pkg/util/feature:go_default_library", "//vendor/k8s.io/apiserver/pkg/util/flag:go_default_library", + "//vendor/k8s.io/apiserver/plugin/pkg/audit/buffered:go_default_library", "//vendor/k8s.io/apiserver/plugin/pkg/audit/log:go_default_library", "//vendor/k8s.io/apiserver/plugin/pkg/audit/webhook:go_default_library", "//vendor/k8s.io/client-go/informers:go_default_library", @@ -62,6 +66,7 @@ go_library( "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", "//vendor/k8s.io/client-go/util/cert:go_default_library", + "//vendor/k8s.io/kube-openapi/pkg/common:go_default_library", ], ) @@ -69,21 +74,26 @@ go_test( name = "go_default_test", srcs = [ "admission_test.go", + "audit_test.go", "serving_test.go", ], data = glob(["testdata/**"]), - importpath = "k8s.io/apiserver/pkg/server/options", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ + "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", + "//vendor/github.com/stretchr/testify/require:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apimachinery/pkg/version:go_default_library", + "//vendor/k8s.io/apiserver/pkg/admission:go_default_library", "//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library", "//vendor/k8s.io/apiserver/pkg/server:go_default_library", "//vendor/k8s.io/apiserver/pkg/util/flag:go_default_library", "//vendor/k8s.io/client-go/discovery:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", + "//vendor/k8s.io/client-go/tools/clientcmd/api/v1:go_default_library", ], ) diff --git a/vendor/k8s.io/apiserver/pkg/server/options/admission.go b/vendor/k8s.io/apiserver/pkg/server/options/admission.go index 6232567f7..80c2204f8 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/admission.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/admission.go @@ -21,7 +21,9 @@ import ( "strings" "github.com/spf13/pflag" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/admission/initializer" admissionmetrics "k8s.io/apiserver/pkg/admission/metrics" @@ -37,15 +39,27 @@ import ( "k8s.io/client-go/rest" ) +var configScheme = runtime.NewScheme() + +func init() { + apiserverapi.AddToScheme(configScheme) + apiserverapiv1alpha1.AddToScheme(configScheme) +} + // AdmissionOptions holds the admission options type AdmissionOptions struct { // RecommendedPluginOrder holds an ordered list of plugin names we recommend to use by default RecommendedPluginOrder []string - // DefaultOffPlugins a list of plugin names that should be disabled by default - DefaultOffPlugins []string - PluginNames []string - ConfigFile string - + // DefaultOffPlugins is a set of plugin names that is disabled by default + DefaultOffPlugins sets.String + + // EnablePlugins indicates plugins to be enabled passed through `--enable-admission-plugins`. + EnablePlugins []string + // DisablePlugins indicates plugins to be disabled passed through `--disable-admission-plugins`. + DisablePlugins []string + // ConfigFile is the file path with admission control configuration. + ConfigFile string + // Plugins contains all registered plugins. Plugins *admission.Plugins } @@ -59,31 +73,28 @@ type AdmissionOptions struct { // Servers that do care can overwrite/append that field after creation. func NewAdmissionOptions() *AdmissionOptions { options := &AdmissionOptions{ - Plugins: admission.NewPlugins(), - PluginNames: []string{}, + Plugins: admission.NewPlugins(), // This list is mix of mutating admission plugins and validating // admission plugins. The apiserver always runs the validating ones // after all the mutating ones, so their relative order in this list // doesn't matter. RecommendedPluginOrder: []string{lifecycle.PluginName, initialization.PluginName, mutatingwebhook.PluginName, validatingwebhook.PluginName}, - DefaultOffPlugins: []string{initialization.PluginName, mutatingwebhook.PluginName, validatingwebhook.PluginName}, + DefaultOffPlugins: sets.NewString(initialization.PluginName), } - apiserverapi.AddToScheme(options.Plugins.ConfigScheme) - apiserverapiv1alpha1.AddToScheme(options.Plugins.ConfigScheme) server.RegisterAllAdmissionPlugins(options.Plugins) return options } // AddFlags adds flags related to admission for a specific APIServer to the specified FlagSet func (a *AdmissionOptions) AddFlags(fs *pflag.FlagSet) { - fs.StringSliceVar(&a.PluginNames, "admission-control", a.PluginNames, ""+ - "Admission is divided into two phases. "+ - "In the first phase, only mutating admission plugins run. "+ - "In the second phase, only validating admission plugins run. "+ - "The names in the below list may represent a validating plugin, a mutating plugin, or both. "+ - "Within each phase, the plugins will run in the order in which they are passed to this flag. "+ - "Comma-delimited list of: "+strings.Join(a.Plugins.Registered(), ", ")+".") - + fs.StringSliceVar(&a.EnablePlugins, "enable-admission-plugins", a.EnablePlugins, ""+ + "admission plugins that should be enabled in addition to default enabled ones. "+ + "Comma-delimited list of admission plugins: "+strings.Join(a.Plugins.Registered(), ", ")+". "+ + "The order of plugins in this flag does not matter.") + fs.StringSliceVar(&a.DisablePlugins, "disable-admission-plugins", a.DisablePlugins, ""+ + "admission plugins that should be disabled although they are in the default enabled plugins list. "+ + "Comma-delimited list of admission plugins: "+strings.Join(a.Plugins.Registered(), ", ")+". "+ + "The order of plugins in this flag does not matter.") fs.StringVar(&a.ConfigFile, "admission-control-config-file", a.ConfigFile, "File with admission control configuration.") } @@ -100,12 +111,23 @@ func (a *AdmissionOptions) ApplyTo( scheme *runtime.Scheme, pluginInitializers ...admission.PluginInitializer, ) error { - pluginNames := a.PluginNames - if len(a.PluginNames) == 0 { - pluginNames = a.enabledPluginNames() + if a == nil { + return nil + } + + // Admission need scheme to construct admission initializer. + if scheme == nil { + return fmt.Errorf("admission depends on a scheme, it cannot be nil") + } + + // Admission depends on CoreAPI to set SharedInformerFactory and ClientConfig. + if informers == nil { + return fmt.Errorf("admission depends on a Kubernetes core API shared informer, it cannot be nil") } - pluginsConfigProvider, err := admission.ReadAdmissionConfiguration(pluginNames, a.ConfigFile, a.Plugins.ConfigScheme) + pluginNames := a.enabledPluginNames() + + pluginsConfigProvider, err := admission.ReadAdmissionConfiguration(pluginNames, a.ConfigFile, configScheme) if err != nil { return fmt.Errorf("failed to read plugin config: %v", err) } @@ -114,12 +136,12 @@ func (a *AdmissionOptions) ApplyTo( if err != nil { return err } - genericInitializer := initializer.New(clientset, informers, c.Authorizer, scheme) + genericInitializer := initializer.New(clientset, informers, c.Authorization.Authorizer, scheme) initializersChain := admission.PluginInitializers{} pluginInitializers = append(pluginInitializers, genericInitializer) initializersChain = append(initializersChain, pluginInitializers...) - admissionChain, err := a.Plugins.NewFromPlugins(pluginNames, pluginsConfigProvider, initializersChain, admissionmetrics.WithControllerMetrics) + admissionChain, err := a.Plugins.NewFromPlugins(pluginNames, pluginsConfigProvider, initializersChain, admission.DecoratorFunc(admissionmetrics.WithControllerMetrics)) if err != nil { return err } @@ -128,37 +150,66 @@ func (a *AdmissionOptions) ApplyTo( return nil } +// Validate verifies flags passed to AdmissionOptions. func (a *AdmissionOptions) Validate() []error { + if a == nil { + return nil + } + errs := []error{} + + registeredPlugins := sets.NewString(a.Plugins.Registered()...) + for _, name := range a.EnablePlugins { + if !registeredPlugins.Has(name) { + errs = append(errs, fmt.Errorf("enable-admission-plugins plugin %q is unknown", name)) + } + } + + for _, name := range a.DisablePlugins { + if !registeredPlugins.Has(name) { + errs = append(errs, fmt.Errorf("disable-admission-plugins plugin %q is unknown", name)) + } + } + + enablePlugins := sets.NewString(a.EnablePlugins...) + disablePlugins := sets.NewString(a.DisablePlugins...) + if len(enablePlugins.Intersection(disablePlugins).List()) > 0 { + errs = append(errs, fmt.Errorf("%v in enable-admission-plugins and disable-admission-plugins "+ + "overlapped", enablePlugins.Intersection(disablePlugins).List())) + } + + // Verify RecommendedPluginOrder. + recommendPlugins := sets.NewString(a.RecommendedPluginOrder...) + intersections := registeredPlugins.Intersection(recommendPlugins) + if !intersections.Equal(recommendPlugins) { + // Developer error, this should never run in. + errs = append(errs, fmt.Errorf("plugins %v in RecommendedPluginOrder are not registered", + recommendPlugins.Difference(intersections).List())) + } + if !intersections.Equal(registeredPlugins) { + // Developer error, this should never run in. + errs = append(errs, fmt.Errorf("plugins %v registered are not in RecommendedPluginOrder", + registeredPlugins.Difference(intersections).List())) + } + return errs } -// enabledPluginNames makes use of RecommendedPluginOrder and DefaultOffPlugins fields -// to prepare a list of plugin names that are enabled. -// -// TODO(p0lyn0mial): In the end we will introduce two new flags: -// --disable-admission-plugin this would be a list of admission plugins that a cluster-admin wants to explicitly disable. -// --enable-admission-plugin this would be a list of admission plugins that a cluster-admin wants to explicitly enable. -// both flags are going to be handled by this method +// enabledPluginNames makes use of RecommendedPluginOrder, DefaultOffPlugins, +// EnablePlugins, DisablePlugins fields +// to prepare a list of ordered plugin names that are enabled. func (a *AdmissionOptions) enabledPluginNames() []string { - //TODO(p0lyn0mial): first subtract plugins that a user wants to explicitly enable from allOffPlugins (DefaultOffPlugins) - //TODO(p0lyn0miial): then add/append plugins that a user wants to explicitly disable to allOffPlugins - //TODO(p0lyn0mial): so that --off=three --on=one,three default-off=one,two results in "one" being enabled. - allOffPlugins := a.DefaultOffPlugins - onlyEnabledPluginNames := []string{} - for _, pluginName := range a.RecommendedPluginOrder { - disablePlugin := false - for _, disabledPluginName := range allOffPlugins { - if pluginName == disabledPluginName { - disablePlugin = true - break - } - } - if disablePlugin { - continue + allOffPlugins := append(a.DefaultOffPlugins.List(), a.DisablePlugins...) + disabledPlugins := sets.NewString(allOffPlugins...) + enabledPlugins := sets.NewString(a.EnablePlugins...) + disabledPlugins = disabledPlugins.Difference(enabledPlugins) + + orderedPlugins := []string{} + for _, plugin := range a.RecommendedPluginOrder { + if !disabledPlugins.Has(plugin) { + orderedPlugins = append(orderedPlugins, plugin) } - onlyEnabledPluginNames = append(onlyEnabledPluginNames, pluginName) } - return onlyEnabledPluginNames + return orderedPlugins } diff --git a/vendor/k8s.io/apiserver/pkg/server/options/admission_test.go b/vendor/k8s.io/apiserver/pkg/server/options/admission_test.go index 37d824eb6..71961a8ff 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/admission_test.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/admission_test.go @@ -18,26 +18,80 @@ package options import ( "fmt" + "io" "testing" + + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apiserver/pkg/admission" ) -func TestEnabledPluginNamesMethod(t *testing.T) { +func TestEnabledPluginNames(t *testing.T) { scenarios := []struct { expectedPluginNames []string - setDefaultOffPluginNames []string + setDefaultOffPlugins sets.String setRecommendedPluginOrder []string + setEnablePlugins []string + setDisablePlugins []string + setAdmissionControl []string }{ - // scenario 1: check if a call to enabledPluginNames sets expected values. + // scenario 0: check if a call to enabledPluginNames sets expected values. + { + expectedPluginNames: []string{"NamespaceLifecycle", "MutatingAdmissionWebhook", "ValidatingAdmissionWebhook"}, + }, + + // scenario 1: use default off plugins if no specified + { + expectedPluginNames: []string{"pluginB"}, + setRecommendedPluginOrder: []string{"pluginA", "pluginB", "pluginC", "pluginD"}, + setDefaultOffPlugins: sets.NewString("pluginA", "pluginC", "pluginD"), + }, + + // scenario 2: use default off plugins and with RecommendedPluginOrder + { + expectedPluginNames: []string{"pluginA", "pluginB", "pluginC", "pluginD"}, + setRecommendedPluginOrder: []string{"pluginA", "pluginB", "pluginC", "pluginD"}, + setDefaultOffPlugins: sets.NewString(), + }, + + // scenario 3: use default off plugins and specified by enable-admission-plugin with RecommendedPluginOrder + { + expectedPluginNames: []string{"pluginA", "pluginB", "pluginC", "pluginD"}, + setRecommendedPluginOrder: []string{"pluginA", "pluginB", "pluginC", "pluginD"}, + setDefaultOffPlugins: sets.NewString("pluginC", "pluginD"), + setEnablePlugins: []string{"pluginD", "pluginC"}, + }, + + // scenario 4: use default off plugins and specified by disable-admission-plugin with RecommendedPluginOrder + { + expectedPluginNames: []string{"pluginB"}, + setRecommendedPluginOrder: []string{"pluginA", "pluginB", "pluginC", "pluginD"}, + setDefaultOffPlugins: sets.NewString("pluginC", "pluginD"), + setDisablePlugins: []string{"pluginA"}, + }, + + // scenario 5: use default off plugins and specified by enable-admission-plugin and disable-admission-plugin with RecommendedPluginOrder + { + expectedPluginNames: []string{"pluginA", "pluginC"}, + setRecommendedPluginOrder: []string{"pluginA", "pluginB", "pluginC", "pluginD"}, + setDefaultOffPlugins: sets.NewString("pluginC", "pluginD"), + setEnablePlugins: []string{"pluginC"}, + setDisablePlugins: []string{"pluginB"}, + }, + + // scenario 6: use default off plugins and specified by admission-control with RecommendedPluginOrder { - expectedPluginNames: []string{"NamespaceLifecycle"}, + expectedPluginNames: []string{"pluginA", "pluginB", "pluginC"}, + setRecommendedPluginOrder: []string{"pluginA", "pluginB", "pluginC", "pluginD"}, + setDefaultOffPlugins: sets.NewString("pluginD"), + setAdmissionControl: []string{"pluginA", "pluginB"}, }, - // scenario 2: overwrite RecommendedPluginOrder and set DefaultOffPluginNames - // make sure that plugins which are on DefaultOffPluginNames list do not get to PluginNames list. + // scenario 7: use default off plugins and specified by admission-control with RecommendedPluginOrder { - expectedPluginNames: []string{"pluginA"}, - setRecommendedPluginOrder: []string{"pluginA", "pluginB"}, - setDefaultOffPluginNames: []string{"pluginB"}, + expectedPluginNames: []string{"pluginA", "pluginB", "pluginC"}, + setRecommendedPluginOrder: []string{"pluginA", "pluginB", "pluginC", "pluginD"}, + setDefaultOffPlugins: sets.NewString("pluginC", "pluginD"), + setAdmissionControl: []string{"pluginA", "pluginB", "pluginC"}, }, } @@ -46,12 +100,21 @@ func TestEnabledPluginNamesMethod(t *testing.T) { t.Run(fmt.Sprintf("scenario %d", index), func(t *testing.T) { target := NewAdmissionOptions() - if len(scenario.setDefaultOffPluginNames) > 0 { - target.DefaultOffPlugins = scenario.setDefaultOffPluginNames + if scenario.setDefaultOffPlugins != nil { + target.DefaultOffPlugins = scenario.setDefaultOffPlugins } - if len(scenario.setRecommendedPluginOrder) > 0 { + if scenario.setRecommendedPluginOrder != nil { target.RecommendedPluginOrder = scenario.setRecommendedPluginOrder } + if scenario.setEnablePlugins != nil { + target.EnablePlugins = scenario.setEnablePlugins + } + if scenario.setDisablePlugins != nil { + target.DisablePlugins = scenario.setDisablePlugins + } + if scenario.setAdmissionControl != nil { + target.EnablePlugins = scenario.setAdmissionControl + } actualPluginNames := target.enabledPluginNames() @@ -66,3 +129,111 @@ func TestEnabledPluginNamesMethod(t *testing.T) { }) } } + +func TestValidate(t *testing.T) { + scenarios := []struct { + setEnablePlugins []string + setDisablePlugins []string + setRecommendedPluginsOrder []string + expectedResult bool + }{ + // scenario 0: not set any flag + { + expectedResult: true, + }, + + // scenario 1: set both `--enable-admission-plugin` `--disable-admission-plugin` + { + setEnablePlugins: []string{"pluginA", "pluginB"}, + setDisablePlugins: []string{"pluginC"}, + expectedResult: true, + }, + + // scenario 2: set invalid `--enable-admission-plugin` `--disable-admission-plugin` + { + setEnablePlugins: []string{"pluginA", "pluginB"}, + setDisablePlugins: []string{"pluginB"}, + expectedResult: false, + }, + + // scenario 3: set only invalid `--enable-admission-plugin` + { + setEnablePlugins: []string{"pluginA", "pluginE"}, + expectedResult: false, + }, + + // scenario 4: set only invalid `--disable-admission-plugin` + { + setDisablePlugins: []string{"pluginA", "pluginE"}, + expectedResult: false, + }, + + // scenario 5: set valid `--enable-admission-plugin` + { + setEnablePlugins: []string{"pluginA", "pluginB"}, + expectedResult: true, + }, + + // scenario 6: set valid `--disable-admission-plugin` + { + setDisablePlugins: []string{"pluginA"}, + expectedResult: true, + }, + + // scenario 7: RecommendedPluginOrder has duplicated plugin + { + setRecommendedPluginsOrder: []string{"pluginA", "pluginB", "pluginB", "pluginC"}, + expectedResult: false, + }, + + // scenario 8: RecommendedPluginOrder not equal to registered + { + setRecommendedPluginsOrder: []string{"pluginA", "pluginB", "pluginC"}, + expectedResult: false, + }, + + // scenario 9: RecommendedPluginOrder equal to registered + { + setRecommendedPluginsOrder: []string{"pluginA", "pluginB", "pluginC", "pluginD"}, + expectedResult: true, + }, + + // scenario 10: RecommendedPluginOrder not equal to registered + { + setRecommendedPluginsOrder: []string{"pluginA", "pluginB", "pluginC", "pluginE"}, + expectedResult: false, + }, + } + + for index, scenario := range scenarios { + t.Run(fmt.Sprintf("scenario %d", index), func(t *testing.T) { + options := NewAdmissionOptions() + options.DefaultOffPlugins = sets.NewString("pluginC", "pluginD") + options.RecommendedPluginOrder = []string{"pluginA", "pluginB", "pluginC", "pluginD"} + options.Plugins = &admission.Plugins{} + for _, plugin := range options.RecommendedPluginOrder { + options.Plugins.Register(plugin, func(config io.Reader) (admission.Interface, error) { + return nil, nil + }) + } + + if scenario.setEnablePlugins != nil { + options.EnablePlugins = scenario.setEnablePlugins + } + if scenario.setDisablePlugins != nil { + options.DisablePlugins = scenario.setDisablePlugins + } + if scenario.setRecommendedPluginsOrder != nil { + options.RecommendedPluginOrder = scenario.setRecommendedPluginsOrder + } + + err := options.Validate() + if len(err) > 0 && scenario.expectedResult { + t.Errorf("Unexpected err: %v", err) + } + if len(err) == 0 && !scenario.expectedResult { + t.Errorf("Expect error, but got none") + } + }) + } +} diff --git a/vendor/k8s.io/apiserver/pkg/server/options/api_enablement.go b/vendor/k8s.io/apiserver/pkg/server/options/api_enablement.go new file mode 100644 index 000000000..3901511f6 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/server/options/api_enablement.go @@ -0,0 +1,111 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package options + +import ( + "fmt" + "strings" + + "github.com/spf13/pflag" + + "k8s.io/apiserver/pkg/server" + "k8s.io/apiserver/pkg/server/resourceconfig" + serverstore "k8s.io/apiserver/pkg/server/storage" + utilflag "k8s.io/apiserver/pkg/util/flag" +) + +// APIEnablementOptions contains the options for which resources to turn on and off. +// Given small aggregated API servers, this option isn't required for "normal" API servers +type APIEnablementOptions struct { + RuntimeConfig utilflag.ConfigurationMap +} + +func NewAPIEnablementOptions() *APIEnablementOptions { + return &APIEnablementOptions{ + RuntimeConfig: make(utilflag.ConfigurationMap), + } +} + +// AddFlags adds flags for a specific APIServer to the specified FlagSet +func (s *APIEnablementOptions) AddFlags(fs *pflag.FlagSet) { + fs.Var(&s.RuntimeConfig, "runtime-config", ""+ + "A set of key=value pairs that describe runtime configuration that may be passed "+ + "to apiserver. / (or for the core group) key can be used to "+ + "turn on/off specific api versions. api/all is special key to control all api versions, "+ + "be careful setting it false, unless you know what you do. api/legacy is deprecated, "+ + "we will remove it in the future, so stop using it.") +} + +// Validate validates RuntimeConfig with a list of registries. +// Usually this list only has one element, the apiserver registry of the process. +// But in the advanced (and usually not recommended) case of delegated apiservers there can be more. +// Validate will filter out the known groups of each registry. +// If anything is left over after that, an error is returned. +func (s *APIEnablementOptions) Validate(registries ...GroupRegisty) []error { + if s == nil { + return nil + } + + errors := []error{} + if s.RuntimeConfig["api/all"] == "false" && len(s.RuntimeConfig) == 1 { + // Do not allow only set api/all=false, in such case apiserver startup has no meaning. + return append(errors, fmt.Errorf("invliad key with only api/all=false")) + } + + groups, err := resourceconfig.ParseGroups(s.RuntimeConfig) + if err != nil { + return append(errors, err) + } + + for _, registry := range registries { + // filter out known groups + groups = unknownGroups(groups, registry) + } + if len(groups) != 0 { + errors = append(errors, fmt.Errorf("unknown api groups %s", strings.Join(groups, ","))) + } + + return errors +} + +// ApplyTo override MergedResourceConfig with defaults and registry +func (s *APIEnablementOptions) ApplyTo(c *server.Config, defaultResourceConfig *serverstore.ResourceConfig, registry resourceconfig.GroupVersionRegistry) error { + if s == nil { + return nil + } + + mergedResourceConfig, err := resourceconfig.MergeAPIResourceConfigs(defaultResourceConfig, s.RuntimeConfig, registry) + c.MergedResourceConfig = mergedResourceConfig + + return err +} + +func unknownGroups(groups []string, registry GroupRegisty) []string { + unknownGroups := []string{} + for _, group := range groups { + if !registry.IsRegistered(group) { + unknownGroups = append(unknownGroups, group) + } + } + return unknownGroups +} + +// GroupRegisty provides a method to check whether given group is registered. +type GroupRegisty interface { + // IsRegistered returns true if given group is registered. + IsRegistered(group string) bool +} diff --git a/vendor/k8s.io/apiserver/pkg/server/options/audit.go b/vendor/k8s.io/apiserver/pkg/server/options/audit.go index e43ebb12b..887b52281 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/audit.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/audit.go @@ -21,6 +21,7 @@ import ( "io" "os" "strings" + "time" "github.com/golang/glog" "github.com/spf13/pflag" @@ -32,6 +33,7 @@ import ( "k8s.io/apiserver/pkg/features" "k8s.io/apiserver/pkg/server" utilfeature "k8s.io/apiserver/pkg/util/feature" + pluginbuffered "k8s.io/apiserver/plugin/pkg/audit/buffered" pluginlog "k8s.io/apiserver/plugin/pkg/audit/log" pluginwebhook "k8s.io/apiserver/plugin/pkg/audit/webhook" ) @@ -58,6 +60,33 @@ type AuditOptions struct { WebhookOptions AuditWebhookOptions } +const ( + // ModeBatch indicates that the audit backend should buffer audit events + // internally, sending batch updates either once a certain number of + // events have been received or a certain amount of time has passed. + ModeBatch = "batch" + // ModeBlocking causes the audit backend to block on every attempt to process + // a set of events. This causes requests to the API server to wait for the + // flush before sending a response. + ModeBlocking = "blocking" +) + +// AllowedModes is the modes known for audit backends. +var AllowedModes = []string{ + ModeBatch, + ModeBlocking, +} + +type AuditBatchOptions struct { + // Should the backend asynchronous batch events to the webhook backend or + // should the backend block responses? + // + // Defaults to asynchronous batch events. + Mode string + // Configuration for batching backend. Only used in batch mode. + BatchConfig pluginbuffered.BatchConfig +} + // AuditLogOptions determines the output of the structured audit log by default. // If the AdvancedAuditing feature is set to false, AuditLogOptions holds the legacy // audit log writer. @@ -67,27 +96,37 @@ type AuditLogOptions struct { MaxBackups int MaxSize int Format string + + BatchOptions AuditBatchOptions } // AuditWebhookOptions control the webhook configuration for audit events. type AuditWebhookOptions struct { - ConfigFile string - // Should the webhook asynchronous batch events to the webhook backend or - // should the webhook block responses? - // - // Defaults to asynchronous batch events. - Mode string - // Configuration for batching webhook. Only used in batch mode. - BatchConfig pluginwebhook.BatchBackendConfig + ConfigFile string + InitialBackoff time.Duration + + BatchOptions AuditBatchOptions } func NewAuditOptions() *AuditOptions { + defaultLogBatchConfig := pluginbuffered.NewDefaultBatchConfig() + defaultLogBatchConfig.ThrottleEnable = false + return &AuditOptions{ WebhookOptions: AuditWebhookOptions{ - Mode: pluginwebhook.ModeBatch, - BatchConfig: pluginwebhook.NewDefaultBatchBackendConfig(), + BatchOptions: AuditBatchOptions{ + Mode: ModeBatch, + BatchConfig: pluginbuffered.NewDefaultBatchConfig(), + }, + InitialBackoff: pluginwebhook.DefaultInitialBackoff, + }, + LogOptions: AuditLogOptions{ + Format: pluginlog.FormatJson, + BatchOptions: AuditBatchOptions{ + Mode: ModeBlocking, + BatchConfig: defaultLogBatchConfig, + }, }, - LogOptions: AuditLogOptions{Format: pluginlog.FormatJson}, } } @@ -106,58 +145,45 @@ func (o *AuditOptions) Validate() []error { if len(o.WebhookOptions.ConfigFile) > 0 { allErrors = append(allErrors, fmt.Errorf("feature '%s' must be enabled to set option --audit-webhook-config-file", features.AdvancedAuditing)) } - } else { - // Check webhook mode - validMode := false - for _, m := range pluginwebhook.AllowedModes { - if m == o.WebhookOptions.Mode { - validMode = true - break - } - } - if !validMode { - allErrors = append(allErrors, fmt.Errorf("invalid audit webhook mode %s, allowed modes are %q", o.WebhookOptions.Mode, strings.Join(pluginwebhook.AllowedModes, ","))) - } + } - // Check webhook batch configuration - if o.WebhookOptions.BatchConfig.BufferSize <= 0 { - allErrors = append(allErrors, fmt.Errorf("invalid audit batch webhook buffer size %v, must be a positive number", o.WebhookOptions.BatchConfig.BufferSize)) - } - if o.WebhookOptions.BatchConfig.MaxBatchSize <= 0 { - allErrors = append(allErrors, fmt.Errorf("invalid audit batch webhook max batch size %v, must be a positive number", o.WebhookOptions.BatchConfig.MaxBatchSize)) - } - if o.WebhookOptions.BatchConfig.ThrottleQPS <= 0 { - allErrors = append(allErrors, fmt.Errorf("invalid audit batch webhook throttle QPS %v, must be a positive number", o.WebhookOptions.BatchConfig.ThrottleQPS)) - } - if o.WebhookOptions.BatchConfig.ThrottleBurst <= 0 { - allErrors = append(allErrors, fmt.Errorf("invalid audit batch webhook throttle burst %v, must be a positive number", o.WebhookOptions.BatchConfig.ThrottleBurst)) - } + allErrors = append(allErrors, o.LogOptions.Validate()...) + allErrors = append(allErrors, o.WebhookOptions.Validate()...) - // Check log format - validFormat := false - for _, f := range pluginlog.AllowedFormats { - if f == o.LogOptions.Format { - validFormat = true - break - } - } - if !validFormat { - allErrors = append(allErrors, fmt.Errorf("invalid audit log format %s, allowed formats are %q", o.LogOptions.Format, strings.Join(pluginlog.AllowedFormats, ","))) + return allErrors +} + +func validateBackendMode(pluginName string, mode string) error { + for _, m := range AllowedModes { + if m == mode { + return nil } } + return fmt.Errorf("invalid audit %s mode %s, allowed modes are %q", pluginName, mode, strings.Join(AllowedModes, ",")) +} - // Check validities of MaxAge, MaxBackups and MaxSize of log options - if o.LogOptions.MaxAge < 0 { - allErrors = append(allErrors, fmt.Errorf("--audit-log-maxage %v can't be a negative number", o.LogOptions.MaxAge)) +func validateBackendBatchOptions(pluginName string, options AuditBatchOptions) error { + if err := validateBackendMode(pluginName, options.Mode); err != nil { + return err } - if o.LogOptions.MaxBackups < 0 { - allErrors = append(allErrors, fmt.Errorf("--audit-log-maxbackup %v can't be a negative number", o.LogOptions.MaxBackups)) + if options.Mode != ModeBatch { + // Don't validate the unused options. + return nil } - if o.LogOptions.MaxSize < 0 { - allErrors = append(allErrors, fmt.Errorf("--audit-log-maxsize %v can't be a negative number", o.LogOptions.MaxSize)) + config := options.BatchConfig + if config.BufferSize <= 0 { + return fmt.Errorf("invalid audit batch %s buffer size %v, must be a positive number", pluginName, config.BufferSize) } - - return allErrors + if config.MaxBatchSize <= 0 { + return fmt.Errorf("invalid audit batch %s max batch size %v, must be a positive number", pluginName, config.MaxBatchSize) + } + if config.ThrottleQPS <= 0 { + return fmt.Errorf("invalid audit batch %s throttle QPS %v, must be a positive number", pluginName, config.ThrottleQPS) + } + if config.ThrottleBurst <= 0 { + return fmt.Errorf("invalid audit batch %s throttle burst %v, must be a positive number", pluginName, config.ThrottleBurst) + } + return nil } func (o *AuditOptions) AddFlags(fs *pflag.FlagSet) { @@ -170,7 +196,9 @@ func (o *AuditOptions) AddFlags(fs *pflag.FlagSet) { " With AdvancedAuditing, a profile is required to enable auditing.") o.LogOptions.AddFlags(fs) + o.LogOptions.BatchOptions.AddFlags(pluginlog.PluginName, fs) o.WebhookOptions.AddFlags(fs) + o.WebhookOptions.BatchOptions.AddFlags(pluginwebhook.PluginName, fs) } func (o *AuditOptions) ApplyTo(c *server.Config) error { @@ -216,6 +244,36 @@ func (o *AuditOptions) applyTo(c *server.Config) error { return nil } +func (o *AuditBatchOptions) AddFlags(pluginName string, fs *pflag.FlagSet) { + fs.StringVar(&o.Mode, fmt.Sprintf("audit-%s-mode", pluginName), o.Mode, + "Strategy for sending audit events. Blocking indicates sending events should block"+ + " server responses. Batch causes the backend to buffer and write events"+ + " asynchronously. Known modes are "+strings.Join(AllowedModes, ",")+".") + fs.IntVar(&o.BatchConfig.BufferSize, fmt.Sprintf("audit-%s-batch-buffer-size", pluginName), + o.BatchConfig.BufferSize, "The size of the buffer to store events before "+ + "batching and writing. Only used in batch mode.") + fs.IntVar(&o.BatchConfig.MaxBatchSize, fmt.Sprintf("audit-%s-batch-max-size", pluginName), + o.BatchConfig.MaxBatchSize, "The maximum size of a batch. Only used in batch mode.") + fs.DurationVar(&o.BatchConfig.MaxBatchWait, fmt.Sprintf("audit-%s-batch-max-wait", pluginName), + o.BatchConfig.MaxBatchWait, "The amount of time to wait before force writing the "+ + "batch that hadn't reached the max size. Only used in batch mode.") + fs.BoolVar(&o.BatchConfig.ThrottleEnable, fmt.Sprintf("audit-%s-batch-throttle-enable", pluginName), + o.BatchConfig.ThrottleEnable, "Whether batching throttling is enabled. Only used in batch mode.") + fs.Float32Var(&o.BatchConfig.ThrottleQPS, fmt.Sprintf("audit-%s-batch-throttle-qps", pluginName), + o.BatchConfig.ThrottleQPS, "Maximum average number of batches per second. "+ + "Only used in batch mode.") + fs.IntVar(&o.BatchConfig.ThrottleBurst, fmt.Sprintf("audit-%s-batch-throttle-burst", pluginName), + o.BatchConfig.ThrottleBurst, "Maximum number of requests sent at the same "+ + "moment if ThrottleQPS was not utilized before. Only used in batch mode.") +} + +func (o *AuditBatchOptions) wrapBackend(delegate audit.Backend) audit.Backend { + if o.Mode == ModeBlocking { + return delegate + } + return pluginbuffered.NewBackend(delegate, o.BatchConfig) +} + func (o *AuditLogOptions) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&o.Path, "audit-log-path", o.Path, "If set, all requests coming to the apiserver will be logged to this file. '-' means standard out.") @@ -231,8 +289,52 @@ func (o *AuditLogOptions) AddFlags(fs *pflag.FlagSet) { " gate. Known formats are "+strings.Join(pluginlog.AllowedFormats, ",")+".") } +func (o *AuditLogOptions) Validate() []error { + // Check whether the log backend is enabled based on the options. + if !o.enabled() { + return nil + } + + var allErrors []error + if advancedAuditingEnabled() { + if err := validateBackendBatchOptions(pluginlog.PluginName, o.BatchOptions); err != nil { + allErrors = append(allErrors, err) + } + + // Check log format + validFormat := false + for _, f := range pluginlog.AllowedFormats { + if f == o.Format { + validFormat = true + break + } + } + if !validFormat { + allErrors = append(allErrors, fmt.Errorf("invalid audit log format %s, allowed formats are %q", o.Format, strings.Join(pluginlog.AllowedFormats, ","))) + } + } + + // Check validities of MaxAge, MaxBackups and MaxSize of log options, if file log backend is enabled. + if o.MaxAge < 0 { + allErrors = append(allErrors, fmt.Errorf("--audit-log-maxage %v can't be a negative number", o.MaxAge)) + } + if o.MaxBackups < 0 { + allErrors = append(allErrors, fmt.Errorf("--audit-log-maxbackup %v can't be a negative number", o.MaxBackups)) + } + if o.MaxSize < 0 { + allErrors = append(allErrors, fmt.Errorf("--audit-log-maxsize %v can't be a negative number", o.MaxSize)) + } + + return allErrors +} + +// Check whether the log backend is enabled based on the options. +func (o *AuditLogOptions) enabled() bool { + return o != nil && o.Path != "" +} + func (o *AuditLogOptions) getWriter() io.Writer { - if o.Path == "" { + if !o.enabled() { return nil } @@ -250,7 +352,8 @@ func (o *AuditLogOptions) getWriter() io.Writer { func (o *AuditLogOptions) advancedApplyTo(c *server.Config) error { if w := o.getWriter(); w != nil { - c.AuditBackend = appendBackend(c.AuditBackend, pluginlog.NewBackend(w, o.Format, auditv1beta1.SchemeGroupVersion)) + log := pluginlog.NewBackend(w, o.Format, auditv1beta1.SchemeGroupVersion) + c.AuditBackend = appendBackend(c.AuditBackend, o.BatchOptions.wrapBackend(log)) } return nil } @@ -264,39 +367,41 @@ func (o *AuditWebhookOptions) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&o.ConfigFile, "audit-webhook-config-file", o.ConfigFile, "Path to a kubeconfig formatted file that defines the audit webhook configuration."+ " Requires the 'AdvancedAuditing' feature gate.") - fs.StringVar(&o.Mode, "audit-webhook-mode", o.Mode, - "Strategy for sending audit events. Blocking indicates sending events should block"+ - " server responses. Batch causes the webhook to buffer and send events"+ - " asynchronously. Known modes are "+strings.Join(pluginwebhook.AllowedModes, ",")+".") - fs.IntVar(&o.BatchConfig.BufferSize, "audit-webhook-batch-buffer-size", - o.BatchConfig.BufferSize, "The size of the buffer to store events before "+ - "batching and sending to the webhook. Only used in batch mode.") - fs.IntVar(&o.BatchConfig.MaxBatchSize, "audit-webhook-batch-max-size", - o.BatchConfig.MaxBatchSize, "The maximum size of a batch sent to the webhook. "+ - "Only used in batch mode.") - fs.DurationVar(&o.BatchConfig.MaxBatchWait, "audit-webhook-batch-max-wait", - o.BatchConfig.MaxBatchWait, "The amount of time to wait before force sending the "+ - "batch that hadn't reached the max size. Only used in batch mode.") - fs.Float32Var(&o.BatchConfig.ThrottleQPS, "audit-webhook-batch-throttle-qps", - o.BatchConfig.ThrottleQPS, "Maximum average number of requests per second. "+ - "Only used in batch mode.") - fs.IntVar(&o.BatchConfig.ThrottleBurst, "audit-webhook-batch-throttle-burst", - o.BatchConfig.ThrottleBurst, "Maximum number of requests sent at the same "+ - "moment if ThrottleQPS was not utilized before. Only used in batch mode.") - fs.DurationVar(&o.BatchConfig.InitialBackoff, "audit-webhook-batch-initial-backoff", - o.BatchConfig.InitialBackoff, "The amount of time to wait before retrying the "+ - "first failed requests. Only used in batch mode.") + fs.DurationVar(&o.InitialBackoff, "audit-webhook-initial-backoff", + o.InitialBackoff, "The amount of time to wait before retrying the first failed request.") + fs.DurationVar(&o.InitialBackoff, "audit-webhook-batch-initial-backoff", + o.InitialBackoff, "The amount of time to wait before retrying the first failed request.") + fs.MarkDeprecated("audit-webhook-batch-initial-backoff", + "Deprecated, use --audit-webhook-initial-backoff instead.") +} + +func (o *AuditWebhookOptions) Validate() []error { + if !o.enabled() { + return nil + } + + var allErrors []error + if advancedAuditingEnabled() { + if err := validateBackendBatchOptions(pluginwebhook.PluginName, o.BatchOptions); err != nil { + allErrors = append(allErrors, err) + } + } + return allErrors +} + +func (o *AuditWebhookOptions) enabled() bool { + return o != nil && o.ConfigFile != "" } func (o *AuditWebhookOptions) applyTo(c *server.Config) error { - if o.ConfigFile == "" { + if !o.enabled() { return nil } - webhook, err := pluginwebhook.NewBackend(o.ConfigFile, o.Mode, auditv1beta1.SchemeGroupVersion, o.BatchConfig) + webhook, err := pluginwebhook.NewBackend(o.ConfigFile, auditv1beta1.SchemeGroupVersion, o.InitialBackoff) if err != nil { return fmt.Errorf("initializing audit webhook: %v", err) } - c.AuditBackend = appendBackend(c.AuditBackend, webhook) + c.AuditBackend = appendBackend(c.AuditBackend, o.BatchOptions.wrapBackend(webhook)) return nil } diff --git a/vendor/k8s.io/apiserver/pkg/server/options/audit_test.go b/vendor/k8s.io/apiserver/pkg/server/options/audit_test.go new file mode 100644 index 000000000..e125f6b08 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/server/options/audit_test.go @@ -0,0 +1,172 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package options + +import ( + stdjson "encoding/json" + "fmt" + "io/ioutil" + "os" + "testing" + + "k8s.io/apiserver/pkg/server" + "k8s.io/client-go/tools/clientcmd/api/v1" + + "github.com/spf13/pflag" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestAuditValidOptions(t *testing.T) { + webhookConfig := makeTmpWebhookConfig(t) + defer os.Remove(webhookConfig) + + testCases := []struct { + name string + options func() *AuditOptions + expected string + }{{ + name: "default", + options: NewAuditOptions, + }, { + name: "default log", + options: func() *AuditOptions { + o := NewAuditOptions() + o.LogOptions.Path = "/audit" + return o + }, + expected: "log", + }, { + name: "default webhook", + options: func() *AuditOptions { + o := NewAuditOptions() + o.WebhookOptions.ConfigFile = webhookConfig + return o + }, + expected: "buffered", + }, { + name: "default union", + options: func() *AuditOptions { + o := NewAuditOptions() + o.LogOptions.Path = "/audit" + o.WebhookOptions.ConfigFile = webhookConfig + return o + }, + expected: "union[log,buffered]", + }, { + name: "custom", + options: func() *AuditOptions { + o := NewAuditOptions() + o.LogOptions.BatchOptions.Mode = ModeBatch + o.LogOptions.Path = "/audit" + o.WebhookOptions.BatchOptions.Mode = ModeBlocking + o.WebhookOptions.ConfigFile = webhookConfig + return o + }, + expected: "union[buffered,webhook]", + }} + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + options := tc.options() + require.NotNil(t, options) + + // Verify flags don't change defaults. + fs := pflag.NewFlagSet("Test", pflag.PanicOnError) + options.AddFlags(fs) + require.NoError(t, fs.Parse(nil)) + assert.Equal(t, tc.options(), options, "Flag defaults should match default options.") + + assert.Empty(t, options.Validate(), "Options should be valid.") + config := &server.Config{} + require.NoError(t, options.ApplyTo(config)) + if tc.expected == "" { + assert.Nil(t, config.AuditBackend) + } else { + assert.Equal(t, tc.expected, fmt.Sprintf("%s", config.AuditBackend)) + } + }) + } +} + +func TestAuditInvalidOptions(t *testing.T) { + testCases := []struct { + name string + options func() *AuditOptions + }{{ + name: "invalid log format", + options: func() *AuditOptions { + o := NewAuditOptions() + o.LogOptions.Path = "/audit" + o.LogOptions.Format = "foo" + return o + }, + }, { + name: "invalid log mode", + options: func() *AuditOptions { + o := NewAuditOptions() + o.LogOptions.Path = "/audit" + o.LogOptions.BatchOptions.Mode = "foo" + return o + }, + }, { + name: "invalid log buffer size", + options: func() *AuditOptions { + o := NewAuditOptions() + o.LogOptions.Path = "/audit" + o.LogOptions.BatchOptions.Mode = "batch" + o.LogOptions.BatchOptions.BatchConfig.BufferSize = -3 + return o + }, + }, { + name: "invalid webhook mode", + options: func() *AuditOptions { + o := NewAuditOptions() + o.WebhookOptions.ConfigFile = "/audit" + o.WebhookOptions.BatchOptions.Mode = "foo" + return o + }, + }, { + name: "invalid webhook buffer throttle qps", + options: func() *AuditOptions { + o := NewAuditOptions() + o.WebhookOptions.ConfigFile = "/audit" + o.WebhookOptions.BatchOptions.Mode = "batch" + o.WebhookOptions.BatchOptions.BatchConfig.ThrottleQPS = -1 + return o + }, + }} + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + options := tc.options() + require.NotNil(t, options) + assert.NotEmpty(t, options.Validate(), "Options should be invalid.") + }) + } +} + +func makeTmpWebhookConfig(t *testing.T) string { + config := v1.Config{ + Clusters: []v1.NamedCluster{ + {Cluster: v1.Cluster{Server: "localhost", InsecureSkipTLSVerify: true}}, + }, + } + f, err := ioutil.TempFile("", "k8s_audit_webhook_test_") + require.NoError(t, err, "creating temp file") + require.NoError(t, stdjson.NewEncoder(f).Encode(config), "writing webhook kubeconfig") + require.NoError(t, f.Close()) + return f.Name() +} diff --git a/vendor/k8s.io/apiserver/pkg/server/options/authentication.go b/vendor/k8s.io/apiserver/pkg/server/options/authentication.go index 28c933bea..04e1ea815 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/authentication.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/authentication.go @@ -32,6 +32,7 @@ import ( coreclient "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + openapicommon "k8s.io/kube-openapi/pkg/common" ) type RequestHeaderAuthenticationOptions struct { @@ -130,6 +131,10 @@ func (s *DelegatingAuthenticationOptions) Validate() []error { } func (s *DelegatingAuthenticationOptions) AddFlags(fs *pflag.FlagSet) { + if s == nil { + return + } + fs.StringVar(&s.RemoteKubeConfigFile, "authentication-kubeconfig", s.RemoteKubeConfigFile, ""+ "kubeconfig file pointing at the 'core' kubernetes server with enough rights to create "+ "tokenaccessreviews.authentication.k8s.io.") @@ -146,7 +151,7 @@ func (s *DelegatingAuthenticationOptions) AddFlags(fs *pflag.FlagSet) { } -func (s *DelegatingAuthenticationOptions) ApplyTo(c *server.Config) error { +func (s *DelegatingAuthenticationOptions) ApplyTo(c *server.AuthenticationInfo, servingInfo *server.SecureServingInfo, openAPIConfig *openapicommon.Config) error { if s == nil { c.Authenticator = nil return nil @@ -156,8 +161,7 @@ func (s *DelegatingAuthenticationOptions) ApplyTo(c *server.Config) error { if err != nil { return err } - c, err = c.ApplyClientCert(clientCA.ClientCA) - if err != nil { + if err = c.ApplyClientCert(clientCA.ClientCA, servingInfo); err != nil { return fmt.Errorf("unable to load client CA file: %v", err) } @@ -165,8 +169,7 @@ func (s *DelegatingAuthenticationOptions) ApplyTo(c *server.Config) error { if err != nil { return err } - c, err = c.ApplyClientCert(requestHeader.ClientCAFile) - if err != nil { + if err = c.ApplyClientCert(requestHeader.ClientCAFile, servingInfo); err != nil { return fmt.Errorf("unable to load client CA file: %v", err) } @@ -180,8 +183,8 @@ func (s *DelegatingAuthenticationOptions) ApplyTo(c *server.Config) error { } c.Authenticator = authenticator - if c.OpenAPIConfig != nil { - c.OpenAPIConfig.SecurityDefinitions = securityDefinitions + if openAPIConfig != nil { + openAPIConfig.SecurityDefinitions = securityDefinitions } c.SupportsBasicAuth = false diff --git a/vendor/k8s.io/apiserver/pkg/server/options/authorization.go b/vendor/k8s.io/apiserver/pkg/server/options/authorization.go index 9a452d11e..fb8899bff 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/authorization.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/authorization.go @@ -74,7 +74,7 @@ func (s *DelegatingAuthorizationOptions) AddFlags(fs *pflag.FlagSet) { "The duration to cache 'unauthorized' responses from the webhook authorizer.") } -func (s *DelegatingAuthorizationOptions) ApplyTo(c *server.Config) error { +func (s *DelegatingAuthorizationOptions) ApplyTo(c *server.AuthorizationInfo) error { if s == nil { c.Authorizer = authorizerfactory.NewAlwaysAllowAuthorizer() return nil diff --git a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/BUILD b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/BUILD index bfea74f88..471306cba 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/BUILD +++ b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/BUILD @@ -10,13 +10,11 @@ go_library( name = "go_default_library", srcs = [ "config.go", - "plugins.go", "types.go", ], importpath = "k8s.io/apiserver/pkg/server/options/encryptionconfig", deps = [ "//vendor/github.com/ghodss/yaml:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/value:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes:go_default_library", @@ -29,8 +27,7 @@ go_library( go_test( name = "go_default_test", srcs = ["config_test.go"], - importpath = "k8s.io/apiserver/pkg/server/options/encryptionconfig", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/value:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go index ad2f0927c..4c6fd5a39 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go @@ -102,6 +102,9 @@ func ParseEncryptionConfiguration(f io.Reader) (map[schema.GroupResource]value.T return result, nil } +// The factory to create kms service. This is to make writing test easier. +var envelopeServiceFactory = envelope.NewGRPCService + // GetPrefixTransformers constructs and returns the appropriate prefix transformers for the passed resource using its configuration func GetPrefixTransformers(config *ResourceConfig) ([]value.PrefixTransformer, error) { var result []value.PrefixTransformer @@ -150,18 +153,18 @@ func GetPrefixTransformers(config *ResourceConfig) ([]value.PrefixTransformer, e if found == true { return nil, fmt.Errorf("more than one provider specified in a single element, should split into different list elements") } - f, err := os.Open(provider.KMS.ConfigFile) - if err != nil { - return nil, fmt.Errorf("error opening KMS provider configuration file %q: %v", provider.KMS.ConfigFile, err) + + // Ensure the endpoint is provided. + if len(provider.KMS.Endpoint) == 0 { + return nil, fmt.Errorf("remote KMS provider can't use empty string as endpoint") } - defer f.Close() - envelopeService, pluginFound, err := KMSPluginRegistry.getPlugin(provider.KMS.Name, f) + + // Get gRPC client service with endpoint. + envelopeService, err := envelopeServiceFactory(provider.KMS.Endpoint) if err != nil { - return nil, fmt.Errorf("could not configure KMS plugin %q, %v", provider.KMS.Name, err) - } - if pluginFound == false { - return nil, fmt.Errorf("KMS plugin %q not found", provider.KMS.Name) + return nil, fmt.Errorf("could not configure KMS plugin %q, error: %v", provider.KMS.Name, err) } + transformer, err = getEnvelopePrefixTransformer(provider.KMS, envelopeService, kmsTransformerPrefixV1) found = true } diff --git a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config_test.go b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config_test.go index 8233bb7ee..957d7dede 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config_test.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config_test.go @@ -19,9 +19,6 @@ package encryptionconfig import ( "bytes" "encoding/base64" - "fmt" - "io" - "os" "strings" "testing" @@ -35,10 +32,6 @@ const ( sampleContextText = "0123456789" - // Modify these in all configurations if changed - testEnvelopeServiceConfigPath = "testproviderconfig" - testEnvelopeServiceProviderName = "testprovider" - correctConfigWithIdentityFirst = ` kind: EncryptionConfig apiVersion: v1 @@ -56,7 +49,7 @@ resources: secret: dGhpcyBpcyBwYXNzd29yZA== - kms: name: testprovider - configfile: testproviderconfig + endpoint: unix:///tmp/testprovider.sock cachesize: 10 - aescbc: keys: @@ -89,7 +82,7 @@ resources: secret: YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY= - kms: name: testprovider - configfile: testproviderconfig + endpoint: unix:///tmp/testprovider.sock cachesize: 10 - aescbc: keys: @@ -115,7 +108,7 @@ resources: secret: dGhpcyBpcyBwYXNzd29yZA== - kms: name: testprovider - configfile: testproviderconfig + endpoint: unix:///tmp/testprovider.sock cachesize: 10 - identity: {} - secretbox: @@ -149,7 +142,7 @@ resources: secret: dGhpcyBpcyBwYXNzd29yZA== - kms: name: testprovider - configfile: testproviderconfig + endpoint: unix:///tmp/testprovider.sock cachesize: 10 - identity: {} - aesgcm: @@ -169,7 +162,7 @@ resources: providers: - kms: name: testprovider - configfile: testproviderconfig + endpoint: unix:///tmp/testprovider.sock cachesize: 10 - secretbox: keys: @@ -218,40 +211,45 @@ resources: - name: key2 secret: YSBzZWNyZXQgYSBzZWNyZXQ= ` + + incorrectConfigNoEndpointForKMS = ` +kind: EncryptionConfig +apiVersion: v1 +resources: + - resources: + - secrets + providers: + - kms: + name: testprovider + cachesize: 10 +` ) // testEnvelopeService is a mock envelope service which can be used to simulate remote Envelope services // for testing of the envelope transformer with other transformers. type testEnvelopeService struct { - disabled bool } -func (t *testEnvelopeService) Decrypt(data string) ([]byte, error) { - if t.disabled { - return nil, fmt.Errorf("Envelope service was disabled") - } - return base64.StdEncoding.DecodeString(data) +func (t *testEnvelopeService) Decrypt(data []byte) ([]byte, error) { + return base64.StdEncoding.DecodeString(string(data)) } -func (t *testEnvelopeService) Encrypt(data []byte) (string, error) { - if t.disabled { - return "", fmt.Errorf("Envelope service was disabled") - } - return base64.StdEncoding.EncodeToString(data), nil +func (t *testEnvelopeService) Encrypt(data []byte) ([]byte, error) { + return []byte(base64.StdEncoding.EncodeToString(data)), nil } -func (t *testEnvelopeService) SetDisabledStatus(status bool) { - t.disabled = status +// The factory method to create mock envelope service. +func newMockEnvelopeService(endpoint string) (envelope.Service, error) { + return &testEnvelopeService{}, nil } -var _ envelope.Service = &testEnvelopeService{} - func TestEncryptionProviderConfigCorrect(t *testing.T) { - os.OpenFile(testEnvelopeServiceConfigPath, os.O_CREATE, 0666) - defer os.Remove(testEnvelopeServiceConfigPath) - KMSPluginRegistry.Register(testEnvelopeServiceProviderName, func(_ io.Reader) (envelope.Service, error) { - return &testEnvelopeService{}, nil - }) + // Set factory for mock envelope service + factory := envelopeServiceFactory + envelopeServiceFactory = newMockEnvelopeService + defer func() { + envelopeServiceFactory = factory + }() // Creates compound/prefix transformers with different ordering of available transformers. // Transforms data using one of them, and tries to untransform using the others. @@ -337,3 +335,10 @@ func TestEncryptionProviderConfigInvalidKey(t *testing.T) { t.Fatalf("invalid configuration file (bad AES key) got parsed:\n%s", incorrectConfigInvalidKey) } } + +// Throw error if kms has no endpoint +func TestEncryptionProviderConfigNoEndpointForKMS(t *testing.T) { + if _, err := ParseEncryptionConfiguration(strings.NewReader(incorrectConfigNoEndpointForKMS)); err == nil { + t.Fatalf("invalid configuration file (kms has no endpoint) got parsed:\n%s", incorrectConfigNoEndpointForKMS) + } +} diff --git a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/plugins.go b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/plugins.go deleted file mode 100644 index 310c7238f..000000000 --- a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/plugins.go +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package encryptionconfig - -import ( - "bytes" - "io" - "io/ioutil" - "reflect" - "sync" - - "github.com/golang/glog" - - "k8s.io/apiserver/pkg/storage/value/encrypt/envelope" -) - -// Factory is a function that returns an envelope Service for encryption providers. -// The config parameter provides an io.Reader handler to the factory in -// order to load specific configurations. If no configuration is provided -// the parameter is nil. -type Factory func(config io.Reader) (envelope.Service, error) - -// KMSPlugins contains all registered KMS options. -type KMSPlugins struct { - lock sync.RWMutex - registry map[string]Factory -} - -var ( - // PluginEnabledFn checks whether a plugin is enabled. By default, if you ask about it, it's enabled. - PluginEnabledFn = func(name string, config io.Reader) bool { - return true - } - - // KMSPluginRegistry contains the registered KMS plugins which can be used for configuring - // encryption providers. - KMSPluginRegistry = KMSPlugins{} -) - -// PluginEnabledFunc is a function type that can provide an external check on whether an admission plugin may be enabled -type PluginEnabledFunc func(name string, config io.Reader) bool - -// Register registers a plugin Factory by name. This -// is expected to happen during app startup. It does not allow -// registering a plugin by the same name twice. -func (ps *KMSPlugins) Register(name string, plugin Factory) { - ps.lock.Lock() - defer ps.lock.Unlock() - _, found := ps.registry[name] - if ps.registry == nil { - ps.registry = map[string]Factory{} - } - if found { - glog.Fatalf("KMS plugin %q was registered twice", name) - } else { - ps.registry[name] = plugin - glog.V(1).Infof("Registered KMS plugin %q", name) - } -} - -// getPlugin creates an instance of the named plugin. It returns `false` if the -// the name is not known. The error is returned only when the named provider was -// known but failed to initialize. The config parameter specifies the io.Reader -// handler of the configuration file for the cloud provider, or nil for no configuration. -func (ps *KMSPlugins) getPlugin(name string, config io.Reader) (envelope.Service, bool, error) { - f, found := ps.fetchPluginFromRegistry(name) - if !found { - return nil, false, nil - } - - config1, config2, err := splitStream(config) - if err != nil { - return nil, true, err - } - if !PluginEnabledFn(name, config1) { - return nil, true, nil - } - - ret, err := f(config2) - return ret, true, err -} - -// fetchPluginFromRegistry tries to get a registered plugin with the requested name. -func (ps *KMSPlugins) fetchPluginFromRegistry(name string) (Factory, bool) { - ps.lock.RLock() - defer ps.lock.RUnlock() - // Map lookup defaults to single value context - f, found := ps.registry[name] - return f, found -} - -// splitStream reads the stream bytes and constructs two copies of it. -func splitStream(config io.Reader) (io.Reader, io.Reader, error) { - if config == nil || reflect.ValueOf(config).IsNil() { - return nil, nil, nil - } - - configBytes, err := ioutil.ReadAll(config) - if err != nil { - return nil, nil, err - } - - return bytes.NewBuffer(configBytes), bytes.NewBuffer(configBytes), nil -} diff --git a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/types.go b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/types.go index 1603e044a..67dfa6c9f 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/types.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/types.go @@ -81,6 +81,6 @@ type KMSConfig struct { // cacheSize is the maximum number of secrets which are cached in memory. The default value is 1000. // +optional CacheSize int `json:"cachesize,omitempty"` - // configfile is the path to the configuration file for the named KMS provider. - ConfigFile string `json:"configfile"` + // the gRPC server listening address, for example "unix:///var/run/kms-provider.sock". + Endpoint string `json:"endpoint"` } diff --git a/vendor/k8s.io/apiserver/pkg/server/options/etcd.go b/vendor/k8s.io/apiserver/pkg/server/options/etcd.go index d522cde9b..5b8f1b9bb 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/etcd.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/etcd.go @@ -21,6 +21,7 @@ import ( "net/http" "strconv" "strings" + "time" "github.com/spf13/pflag" @@ -36,7 +37,7 @@ import ( ) type EtcdOptions struct { - // The value of Paging on StorageConfig will be overriden by the + // The value of Paging on StorageConfig will be overridden by the // calculated feature gate value. StorageConfig storagebackend.Config EncryptionProviderConfigFilepath string @@ -64,7 +65,7 @@ var storageTypes = sets.NewString( ) func NewEtcdOptions(backendConfig *storagebackend.Config) *EtcdOptions { - return &EtcdOptions{ + options := &EtcdOptions{ StorageConfig: *backendConfig, DefaultStorageMediaType: "application/json", DeleteCollectionWorkers: 1, @@ -72,6 +73,8 @@ func NewEtcdOptions(backendConfig *storagebackend.Config) *EtcdOptions { EnableWatchCache: true, DefaultWatchCacheSize: 100, } + options.StorageConfig.CountMetricPollPeriod = time.Minute + return options } func (s *EtcdOptions) Validate() []error { @@ -119,8 +122,10 @@ func (s *EtcdOptions) AddFlags(fs *pflag.FlagSet) { fs.StringSliceVar(&s.WatchCacheSizes, "watch-cache-sizes", s.WatchCacheSizes, ""+ "List of watch cache sizes for every resource (pods, nodes, etc.), comma separated. "+ - "The individual override format: resource#size, where size is a number. It takes effect "+ - "when watch-cache is enabled.") + "The individual override format: resource[.group]#size, where resource is lowercase plural (no version), "+ + "group is optional, and size is a number. It takes effect when watch-cache is enabled. "+ + "Some resources (replicationcontrollers, endpoints, nodes, pods, services, apiservices.apiregistration.k8s.io) "+ + "have system defaults set by heuristics, others default to default-watch-cache-size") fs.StringVar(&s.StorageConfig.Type, "storage-backend", s.StorageConfig.Type, "The storage backend for persistence. Options: 'etcd3' (default), 'etcd2'.") @@ -153,6 +158,8 @@ func (s *EtcdOptions) AddFlags(fs *pflag.FlagSet) { fs.DurationVar(&s.StorageConfig.CompactionInterval, "etcd-compaction-interval", s.StorageConfig.CompactionInterval, "The interval of compaction requests. If 0, the compaction request from apiserver is disabled.") + fs.DurationVar(&s.StorageConfig.CountMetricPollPeriod, "etcd-count-metric-poll-period", s.StorageConfig.CountMetricPollPeriod, ""+ + "Frequency of polling etcd for number of resources per type. 0 disables the metric collection.") } func (s *EtcdOptions) ApplyTo(c *server.Config) error { @@ -195,6 +202,7 @@ func (f *SimpleRestOptionsFactory) GetRESTOptions(resource schema.GroupResource) EnableGarbageCollection: f.Options.EnableGarbageCollection, DeleteCollectionWorkers: f.Options.DeleteCollectionWorkers, ResourcePrefix: resource.Group + "/" + resource.Resource, + CountMetricPollPeriod: f.Options.StorageConfig.CountMetricPollPeriod, } if f.Options.EnableWatchCache { sizes, err := ParseWatchCacheSizes(f.Options.WatchCacheSizes) @@ -227,6 +235,7 @@ func (f *storageFactoryRestOptionsFactory) GetRESTOptions(resource schema.GroupR DeleteCollectionWorkers: f.Options.DeleteCollectionWorkers, EnableGarbageCollection: f.Options.EnableGarbageCollection, ResourcePrefix: f.StorageFactory.ResourcePrefix(resource), + CountMetricPollPeriod: f.Options.StorageConfig.CountMetricPollPeriod, } if f.Options.EnableWatchCache { sizes, err := ParseWatchCacheSizes(f.Options.WatchCacheSizes) diff --git a/vendor/k8s.io/apiserver/pkg/server/options/recommended.go b/vendor/k8s.io/apiserver/pkg/server/options/recommended.go index 21c3dd761..ebd750c2b 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/recommended.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/recommended.go @@ -20,6 +20,7 @@ import ( "github.com/spf13/pflag" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/server" "k8s.io/apiserver/pkg/storage/storagebackend" ) @@ -29,23 +30,38 @@ import ( // Each of them can be nil to leave the feature unconfigured on ApplyTo. type RecommendedOptions struct { Etcd *EtcdOptions - SecureServing *SecureServingOptions + SecureServing *SecureServingOptionsWithLoopback Authentication *DelegatingAuthenticationOptions Authorization *DelegatingAuthorizationOptions Audit *AuditOptions Features *FeatureOptions CoreAPI *CoreAPIOptions + + // ExtraAdmissionInitializers is called once after all ApplyTo from the options above, to pass the returned + // admission plugin initializers to Admission.ApplyTo. + ExtraAdmissionInitializers func(c *server.RecommendedConfig) ([]admission.PluginInitializer, error) + Admission *AdmissionOptions } func NewRecommendedOptions(prefix string, codec runtime.Codec) *RecommendedOptions { + sso := NewSecureServingOptions() + + // We are composing recommended options for an aggregated api-server, + // whose client is typically a proxy multiplexing many operations --- + // notably including long-running ones --- into one HTTP/2 connection + // into this server. So allow many concurrent operations. + sso.HTTP2MaxStreamsPerConnection = 1000 + return &RecommendedOptions{ - Etcd: NewEtcdOptions(storagebackend.NewDefaultConfig(prefix, codec)), - SecureServing: NewSecureServingOptions(), - Authentication: NewDelegatingAuthenticationOptions(), - Authorization: NewDelegatingAuthorizationOptions(), - Audit: NewAuditOptions(), - Features: NewFeatureOptions(), - CoreAPI: NewCoreAPIOptions(), + Etcd: NewEtcdOptions(storagebackend.NewDefaultConfig(prefix, codec)), + SecureServing: WithLoopback(sso), + Authentication: NewDelegatingAuthenticationOptions(), + Authorization: NewDelegatingAuthorizationOptions(), + Audit: NewAuditOptions(), + Features: NewFeatureOptions(), + CoreAPI: NewCoreAPIOptions(), + ExtraAdmissionInitializers: func(c *server.RecommendedConfig) ([]admission.PluginInitializer, error) { return nil, nil }, + Admission: NewAdmissionOptions(), } } @@ -57,19 +73,23 @@ func (o *RecommendedOptions) AddFlags(fs *pflag.FlagSet) { o.Audit.AddFlags(fs) o.Features.AddFlags(fs) o.CoreAPI.AddFlags(fs) + o.Admission.AddFlags(fs) } -func (o *RecommendedOptions) ApplyTo(config *server.RecommendedConfig) error { +// ApplyTo adds RecommendedOptions to the server configuration. +// scheme is the scheme of the apiserver types that are sent to the admission chain. +// pluginInitializers can be empty, it is only need for additional initializers. +func (o *RecommendedOptions) ApplyTo(config *server.RecommendedConfig, scheme *runtime.Scheme) error { if err := o.Etcd.ApplyTo(&config.Config); err != nil { return err } if err := o.SecureServing.ApplyTo(&config.Config); err != nil { return err } - if err := o.Authentication.ApplyTo(&config.Config); err != nil { + if err := o.Authentication.ApplyTo(&config.Config.Authentication, config.SecureServing, config.OpenAPIConfig); err != nil { return err } - if err := o.Authorization.ApplyTo(&config.Config); err != nil { + if err := o.Authorization.ApplyTo(&config.Config.Authorization); err != nil { return err } if err := o.Audit.ApplyTo(&config.Config); err != nil { @@ -81,6 +101,12 @@ func (o *RecommendedOptions) ApplyTo(config *server.RecommendedConfig) error { if err := o.CoreAPI.ApplyTo(config); err != nil { return err } + if initializers, err := o.ExtraAdmissionInitializers(config); err != nil { + return err + } else if err := o.Admission.ApplyTo(&config.Config, config.SharedInformerFactory, config.ClientConfig, scheme, initializers...); err != nil { + return err + } + return nil } @@ -93,6 +119,7 @@ func (o *RecommendedOptions) Validate() []error { errors = append(errors, o.Audit.Validate()...) errors = append(errors, o.Features.Validate()...) errors = append(errors, o.CoreAPI.Validate()...) + errors = append(errors, o.Admission.Validate()...) return errors } diff --git a/vendor/k8s.io/apiserver/pkg/server/options/serving.go b/vendor/k8s.io/apiserver/pkg/server/options/serving.go index 43042fde9..c4c2bf986 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/serving.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/serving.go @@ -18,15 +18,12 @@ package options import ( "crypto/tls" - "encoding/pem" "fmt" - "io/ioutil" "net" "path" "strconv" "github.com/golang/glog" - "github.com/pborman/uuid" "github.com/spf13/pflag" utilnet "k8s.io/apimachinery/pkg/util/net" @@ -37,7 +34,8 @@ import ( type SecureServingOptions struct { BindAddress net.IP - BindPort int + // BindPort is ignored when Listener is set, will serve https even with 0. + BindPort int // BindNetwork is the type of network to bind to - defaults to "tcp", accepts "tcp", // "tcp4", and "tcp6". BindNetwork string @@ -51,6 +49,16 @@ type SecureServingOptions struct { ServerCert GeneratableKeyCert // SNICertKeys are named CertKeys for serving secure traffic with SNI support. SNICertKeys []utilflag.NamedCertKey + // CipherSuites is the list of allowed cipher suites for the server. + // Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants). + CipherSuites []string + // MinTLSVersion is the minimum TLS version supported. + // Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants). + MinTLSVersion string + + // HTTP2MaxStreamsPerConnection is the limit that the api server imposes on each client. + // A value of zero means to use the default provided by golang's HTTP/2 support. + HTTP2MaxStreamsPerConnection int } type CertKey struct { @@ -63,8 +71,6 @@ type CertKey struct { type GeneratableKeyCert struct { CertKey CertKey - // CACertFile is an optional file containing the certificate chain for CertKey.CertFile - CACertFile string // CertDirectory is a directory that will contain the certificates. If the cert and key aren't specifically set // this will be used to derive a match with the "pair-name" CertDirectory string @@ -96,7 +102,7 @@ func (s *SecureServingOptions) Validate() []error { errors := []error{} if s.BindPort < 0 || s.BindPort > 65535 { - errors = append(errors, fmt.Errorf("--secure-port %v must be between 0 and 65535, inclusive. 0 for turning off secure port.", s.BindPort)) + errors = append(errors, fmt.Errorf("--secure-port %v must be between 0 and 65535, inclusive. 0 for turning off secure port", s.BindPort)) } return errors @@ -110,8 +116,7 @@ func (s *SecureServingOptions) AddFlags(fs *pflag.FlagSet) { fs.IPVar(&s.BindAddress, "bind-address", s.BindAddress, ""+ "The IP address on which to listen for the --secure-port port. The "+ "associated interface(s) must be reachable by the rest of the cluster, and by CLI/web "+ - "clients. If blank, all interfaces will be used (0.0.0.0).") - + "clients. If blank, all interfaces will be used (0.0.0.0 for all IPv4 interfaces and :: for all IPv6 interfaces).") fs.IntVar(&s.BindPort, "secure-port", s.BindPort, ""+ "The port on which to serve HTTPS with authentication and authorization. If 0, "+ "don't serve HTTPS at all.") @@ -129,10 +134,14 @@ func (s *SecureServingOptions) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&s.ServerCert.CertKey.KeyFile, "tls-private-key-file", s.ServerCert.CertKey.KeyFile, "File containing the default x509 private key matching --tls-cert-file.") - fs.StringVar(&s.ServerCert.CACertFile, "tls-ca-file", s.ServerCert.CACertFile, "If set, this "+ - "certificate authority will used for secure access from Admission "+ - "Controllers. This must be a valid PEM-encoded CA bundle. Altneratively, the certificate authority "+ - "can be appended to the certificate provided by --tls-cert-file.") + fs.StringSliceVar(&s.CipherSuites, "tls-cipher-suites", s.CipherSuites, + "Comma-separated list of cipher suites for the server. "+ + "Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants). "+ + "If omitted, the default Go cipher suites will be used") + + fs.StringVar(&s.MinTLSVersion, "tls-min-version", s.MinTLSVersion, + "Minimum TLS version supported. "+ + "Value must match version names from https://golang.org/pkg/crypto/tls/#pkg-constants.") fs.Var(utilflag.NewNamedCertKeyArray(&s.SNICertKeys), "tls-sni-cert-key", ""+ "A pair of x509 certificate and private key file paths, optionally suffixed with a list of "+ @@ -142,20 +151,24 @@ func (s *SecureServingOptions) AddFlags(fs *pflag.FlagSet) { "trump over extracted names. For multiple key/certificate pairs, use the "+ "--tls-sni-cert-key multiple times. "+ "Examples: \"example.crt,example.key\" or \"foo.crt,foo.key:*.foo.com,foo.com\".") -} -func (s *SecureServingOptions) AddDeprecatedFlags(fs *pflag.FlagSet) { - fs.IPVar(&s.BindAddress, "public-address-override", s.BindAddress, - "DEPRECATED: see --bind-address instead.") - fs.MarkDeprecated("public-address-override", "see --bind-address instead.") + fs.IntVar(&s.HTTP2MaxStreamsPerConnection, "http2-max-streams-per-connection", s.HTTP2MaxStreamsPerConnection, ""+ + "The limit that the server gives to clients for "+ + "the maximum number of streams in an HTTP/2 connection. "+ + "Zero means to use golang's default.") + + // TODO remove this flag in 1.11. The flag had no effect before this will prevent scripts from immediately failing on upgrade. + fs.String("tls-ca-file", "", "This flag has no effect.") + fs.MarkDeprecated("tls-ca-file", "This flag has no effect.") + } // ApplyTo fills up serving information in the server configuration. -func (s *SecureServingOptions) ApplyTo(c *server.Config) error { +func (s *SecureServingOptions) ApplyTo(config **server.SecureServingInfo) error { if s == nil { return nil } - if s.BindPort <= 0 { + if s.BindPort <= 0 && s.Listener == nil { return nil } @@ -166,44 +179,19 @@ func (s *SecureServingOptions) ApplyTo(c *server.Config) error { if err != nil { return fmt.Errorf("failed to create listener: %v", err) } + } else { + if _, ok := s.Listener.Addr().(*net.TCPAddr); !ok { + return fmt.Errorf("failed to parse ip and port from listener") + } + s.BindPort = s.Listener.Addr().(*net.TCPAddr).Port + s.BindAddress = s.Listener.Addr().(*net.TCPAddr).IP } - if err := s.applyServingInfoTo(c); err != nil { - return err - } - - c.SecureServingInfo.Listener = s.Listener - - // create self-signed cert+key with the fake server.LoopbackClientServerNameOverride and - // let the server return it when the loopback client connects. - certPem, keyPem, err := certutil.GenerateSelfSignedCertKey(server.LoopbackClientServerNameOverride, nil, nil) - if err != nil { - return fmt.Errorf("failed to generate self-signed certificate for loopback connection: %v", err) - } - tlsCert, err := tls.X509KeyPair(certPem, keyPem) - if err != nil { - return fmt.Errorf("failed to generate self-signed certificate for loopback connection: %v", err) - } - - secureLoopbackClientConfig, err := c.SecureServingInfo.NewLoopbackClientConfig(uuid.NewRandom().String(), certPem) - switch { - // if we failed and there's no fallback loopback client config, we need to fail - case err != nil && c.LoopbackClientConfig == nil: - return err - - // if we failed, but we already have a fallback loopback client config (usually insecure), allow it - case err != nil && c.LoopbackClientConfig != nil: - - default: - c.LoopbackClientConfig = secureLoopbackClientConfig - c.SecureServingInfo.SNICerts[server.LoopbackClientServerNameOverride] = &tlsCert + *config = &server.SecureServingInfo{ + Listener: s.Listener, + HTTP2MaxStreamsPerConnection: s.HTTP2MaxStreamsPerConnection, } - - return nil -} - -func (s *SecureServingOptions) applyServingInfoTo(c *server.Config) error { - secureServingInfo := &server.SecureServingInfo{} + c := *config serverCertFile, serverKeyFile := s.ServerCert.CertKey.CertFile, s.ServerCert.CertKey.KeyFile // load main cert @@ -212,25 +200,21 @@ func (s *SecureServingOptions) applyServingInfoTo(c *server.Config) error { if err != nil { return fmt.Errorf("unable to load server certificate: %v", err) } - secureServingInfo.Cert = &tlsCert + c.Cert = &tlsCert } - // optionally load CA cert - if len(s.ServerCert.CACertFile) != 0 { - pemData, err := ioutil.ReadFile(s.ServerCert.CACertFile) + if len(s.CipherSuites) != 0 { + cipherSuites, err := utilflag.TLSCipherSuites(s.CipherSuites) if err != nil { - return fmt.Errorf("failed to read certificate authority from %q: %v", s.ServerCert.CACertFile, err) - } - block, pemData := pem.Decode(pemData) - if block == nil { - return fmt.Errorf("no certificate found in certificate authority file %q", s.ServerCert.CACertFile) - } - if block.Type != "CERTIFICATE" { - return fmt.Errorf("expected CERTIFICATE block in certiticate authority file %q, found: %s", s.ServerCert.CACertFile, block.Type) - } - secureServingInfo.CACert = &tls.Certificate{ - Certificate: [][]byte{block.Bytes}, + return err } + c.CipherSuites = cipherSuites + } + + var err error + c.MinTLSVersion, err = utilflag.TLSVersion(s.MinTLSVersion) + if err != nil { + return err } // load SNI certs @@ -245,15 +229,11 @@ func (s *SecureServingOptions) applyServingInfoTo(c *server.Config) error { return fmt.Errorf("failed to load SNI cert and key: %v", err) } } - var err error - secureServingInfo.SNICerts, err = server.GetNamedCertificateMap(namedTLSCerts) + c.SNICerts, err = server.GetNamedCertificateMap(namedTLSCerts) if err != nil { return err } - c.SecureServingInfo = secureServingInfo - c.ReadWritePort = s.BindPort - return nil } diff --git a/vendor/k8s.io/apiserver/pkg/server/options/serving_test.go b/vendor/k8s.io/apiserver/pkg/server/options/serving_test.go index 86d384745..01a443a33 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/serving_test.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/serving_test.go @@ -32,6 +32,7 @@ import ( "os" "path/filepath" "reflect" + "strconv" "strings" "testing" "time" @@ -47,7 +48,6 @@ import ( utilflag "k8s.io/apiserver/pkg/util/flag" "k8s.io/client-go/discovery" restclient "k8s.io/client-go/rest" - "strconv" ) func setUp(t *testing.T) Config { @@ -471,7 +471,7 @@ NextTest: config.Version = &v config.EnableIndex = true - secureOptions := &SecureServingOptions{ + secureOptions := WithLoopback(&SecureServingOptions{ BindAddress: net.ParseIP("127.0.0.1"), BindPort: 6443, ServerCert: GeneratableKeyCert{ @@ -481,7 +481,7 @@ NextTest: }, }, SNICertKeys: namedCertKeys, - } + }) // use a random free port ln, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { diff --git a/vendor/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go b/vendor/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go new file mode 100644 index 000000000..8d249cb54 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go @@ -0,0 +1,79 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package options + +import ( + "crypto/tls" + "fmt" + + "github.com/pborman/uuid" + + "k8s.io/apiserver/pkg/server" + certutil "k8s.io/client-go/util/cert" +) + +type SecureServingOptionsWithLoopback struct { + *SecureServingOptions +} + +func WithLoopback(o *SecureServingOptions) *SecureServingOptionsWithLoopback { + return &SecureServingOptionsWithLoopback{o} +} + +// ApplyTo fills up serving information in the server configuration. +func (s *SecureServingOptionsWithLoopback) ApplyTo(c *server.Config) error { + if s == nil || s.SecureServingOptions == nil { + return nil + } + + if err := s.SecureServingOptions.ApplyTo(&c.SecureServing); err != nil { + return err + } + + if c.SecureServing == nil { + return nil + } + + c.ReadWritePort = s.BindPort + + // create self-signed cert+key with the fake server.LoopbackClientServerNameOverride and + // let the server return it when the loopback client connects. + certPem, keyPem, err := certutil.GenerateSelfSignedCertKey(server.LoopbackClientServerNameOverride, nil, nil) + if err != nil { + return fmt.Errorf("failed to generate self-signed certificate for loopback connection: %v", err) + } + tlsCert, err := tls.X509KeyPair(certPem, keyPem) + if err != nil { + return fmt.Errorf("failed to generate self-signed certificate for loopback connection: %v", err) + } + + secureLoopbackClientConfig, err := c.SecureServing.NewLoopbackClientConfig(uuid.NewRandom().String(), certPem) + switch { + // if we failed and there's no fallback loopback client config, we need to fail + case err != nil && c.LoopbackClientConfig == nil: + return err + + // if we failed, but we already have a fallback loopback client config (usually insecure), allow it + case err != nil && c.LoopbackClientConfig != nil: + + default: + c.LoopbackClientConfig = secureLoopbackClientConfig + c.SecureServing.SNICerts[server.LoopbackClientServerNameOverride] = &tlsCert + } + + return nil +} diff --git a/vendor/k8s.io/apiserver/pkg/server/resourceconfig/BUILD b/vendor/k8s.io/apiserver/pkg/server/resourceconfig/BUILD new file mode 100644 index 000000000..5036ae75b --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/server/resourceconfig/BUILD @@ -0,0 +1,45 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "helpers.go", + ], + importpath = "k8s.io/apiserver/pkg/server/resourceconfig", + visibility = ["//visibility:public"], + deps = [ + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//vendor/k8s.io/apiserver/pkg/server/storage:go_default_library", + "//vendor/k8s.io/apiserver/pkg/util/flag:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = ["helpers_test.go"], + embed = [":go_default_library"], + deps = [ + "//vendor/k8s.io/api/core/v1:go_default_library", + "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apimachinery:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//vendor/k8s.io/apiserver/pkg/server/storage:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/apiserver/pkg/endpoints/apiserver.go b/vendor/k8s.io/apiserver/pkg/server/resourceconfig/doc.go similarity index 72% rename from vendor/k8s.io/apiserver/pkg/endpoints/apiserver.go rename to vendor/k8s.io/apiserver/pkg/server/resourceconfig/doc.go index 933363bff..0dae21535 100644 --- a/vendor/k8s.io/apiserver/pkg/endpoints/apiserver.go +++ b/vendor/k8s.io/apiserver/pkg/server/resourceconfig/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors. +Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,12 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ -package endpoints - -import ( - "k8s.io/apiserver/pkg/endpoints/metrics" -) - -func init() { - metrics.Register() -} +// Package resourceconfig contains the resource config related helper functions. +package resourceconfig // import "k8s.io/apiserver/pkg/server/resourceconfig" diff --git a/vendor/k8s.io/apiserver/pkg/server/resourceconfig/helpers.go b/vendor/k8s.io/apiserver/pkg/server/resourceconfig/helpers.go new file mode 100644 index 000000000..3ac79b74a --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/server/resourceconfig/helpers.go @@ -0,0 +1,164 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resourceconfig + +import ( + "fmt" + "strconv" + "strings" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + serverstore "k8s.io/apiserver/pkg/server/storage" + utilflag "k8s.io/apiserver/pkg/util/flag" +) + +// GroupVersionRegistry provides access to registered group versions. +type GroupVersionRegistry interface { + // IsRegistered returns true if given group is registered. + IsRegistered(group string) bool + // IsRegisteredVersion returns true if given version is registered. + IsRegisteredVersion(v schema.GroupVersion) bool + // RegisteredGroupVersions returns all registered group versions. + RegisteredGroupVersions() []schema.GroupVersion +} + +// MergeResourceEncodingConfigs merges the given defaultResourceConfig with specific GroupVersionResource overrides. +func MergeResourceEncodingConfigs( + defaultResourceEncoding *serverstore.DefaultResourceEncodingConfig, + resourceEncodingOverrides []schema.GroupVersionResource, +) *serverstore.DefaultResourceEncodingConfig { + resourceEncodingConfig := defaultResourceEncoding + for _, gvr := range resourceEncodingOverrides { + resourceEncodingConfig.SetResourceEncoding(gvr.GroupResource(), gvr.GroupVersion(), + schema.GroupVersion{Group: gvr.Group, Version: runtime.APIVersionInternal}) + } + return resourceEncodingConfig +} + +// MergeGroupEncodingConfigs merges the given defaultResourceConfig with specific GroupVersion overrides. +func MergeGroupEncodingConfigs( + defaultResourceEncoding *serverstore.DefaultResourceEncodingConfig, + storageEncodingOverrides map[string]schema.GroupVersion, +) *serverstore.DefaultResourceEncodingConfig { + resourceEncodingConfig := defaultResourceEncoding + for group, storageEncodingVersion := range storageEncodingOverrides { + resourceEncodingConfig.SetVersionEncoding(group, storageEncodingVersion, schema.GroupVersion{Group: group, Version: runtime.APIVersionInternal}) + } + return resourceEncodingConfig +} + +// MergeAPIResourceConfigs merges the given defaultAPIResourceConfig with the given resourceConfigOverrides. +// Exclude the groups not registered in registry, and check if version is +// not registered in group, then it will fail. +func MergeAPIResourceConfigs( + defaultAPIResourceConfig *serverstore.ResourceConfig, + resourceConfigOverrides utilflag.ConfigurationMap, + registry GroupVersionRegistry, +) (*serverstore.ResourceConfig, error) { + resourceConfig := defaultAPIResourceConfig + overrides := resourceConfigOverrides + + // "api/all=false" allows users to selectively enable specific api versions. + allAPIFlagValue, ok := overrides["api/all"] + if ok { + if allAPIFlagValue == "false" { + // Disable all group versions. + resourceConfig.DisableVersions(registry.RegisteredGroupVersions()...) + } else if allAPIFlagValue == "true" { + resourceConfig.EnableVersions(registry.RegisteredGroupVersions()...) + } + } + + // "={true|false} allows users to enable/disable API. + // This takes preference over api/all, if specified. + // Iterate through all group/version overrides specified in runtimeConfig. + for key := range overrides { + // Have already handled them above. Can skip them here. + if key == "api/all" { + continue + } + + tokens := strings.Split(key, "/") + if len(tokens) != 2 { + continue + } + groupVersionString := tokens[0] + "/" + tokens[1] + groupVersion, err := schema.ParseGroupVersion(groupVersionString) + if err != nil { + return nil, fmt.Errorf("invalid key %s", key) + } + + // Exclude group not registered into the registry. + if !registry.IsRegistered(groupVersion.Group) { + continue + } + + // Verify that the groupVersion is registered into registry. + if !registry.IsRegisteredVersion(groupVersion) { + return nil, fmt.Errorf("group version %s that has not been registered", groupVersion.String()) + } + enabled, err := getRuntimeConfigValue(overrides, key, false) + if err != nil { + return nil, err + } + if enabled { + resourceConfig.EnableVersions(groupVersion) + } else { + resourceConfig.DisableVersions(groupVersion) + } + } + + return resourceConfig, nil +} + +func getRuntimeConfigValue(overrides utilflag.ConfigurationMap, apiKey string, defaultValue bool) (bool, error) { + flagValue, ok := overrides[apiKey] + if ok { + if flagValue == "" { + return true, nil + } + boolValue, err := strconv.ParseBool(flagValue) + if err != nil { + return false, fmt.Errorf("invalid value of %s: %s, err: %v", apiKey, flagValue, err) + } + return boolValue, nil + } + return defaultValue, nil +} + +// ParseGroups takes in resourceConfig and returns parsed groups. +func ParseGroups(resourceConfig utilflag.ConfigurationMap) ([]string, error) { + groups := []string{} + for key := range resourceConfig { + if key == "api/all" { + continue + } + tokens := strings.Split(key, "/") + if len(tokens) != 2 && len(tokens) != 3 { + return groups, fmt.Errorf("runtime-config invalid key %s", key) + } + groupVersionString := tokens[0] + "/" + tokens[1] + groupVersion, err := schema.ParseGroupVersion(groupVersionString) + if err != nil { + return nil, fmt.Errorf("runtime-config invalid key %s", key) + } + groups = append(groups, groupVersion.Group) + } + + return groups, nil +} diff --git a/vendor/k8s.io/apiserver/pkg/server/resourceconfig/helpers_test.go b/vendor/k8s.io/apiserver/pkg/server/resourceconfig/helpers_test.go new file mode 100644 index 000000000..801d78414 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/server/resourceconfig/helpers_test.go @@ -0,0 +1,178 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resourceconfig + +import ( + "reflect" + "testing" + + apiv1 "k8s.io/api/core/v1" + extensionsapiv1beta1 "k8s.io/api/extensions/v1beta1" + "k8s.io/apimachinery/pkg/apimachinery" + "k8s.io/apimachinery/pkg/apimachinery/registered" + "k8s.io/apimachinery/pkg/runtime/schema" + serverstore "k8s.io/apiserver/pkg/server/storage" +) + +func TestParseRuntimeConfig(t *testing.T) { + registry := newFakeRegistry() + apiv1GroupVersion := apiv1.SchemeGroupVersion + testCases := []struct { + runtimeConfig map[string]string + defaultResourceConfig func() *serverstore.ResourceConfig + expectedAPIConfig func() *serverstore.ResourceConfig + err bool + }{ + { + // everything default value. + runtimeConfig: map[string]string{}, + defaultResourceConfig: func() *serverstore.ResourceConfig { + return newFakeAPIResourceConfigSource() + }, + expectedAPIConfig: func() *serverstore.ResourceConfig { + return newFakeAPIResourceConfigSource() + }, + err: false, + }, + { + // no runtimeConfig override. + runtimeConfig: map[string]string{}, + defaultResourceConfig: func() *serverstore.ResourceConfig { + config := newFakeAPIResourceConfigSource() + config.DisableVersions(extensionsapiv1beta1.SchemeGroupVersion) + return config + }, + expectedAPIConfig: func() *serverstore.ResourceConfig { + config := newFakeAPIResourceConfigSource() + config.DisableVersions(extensionsapiv1beta1.SchemeGroupVersion) + return config + }, + err: false, + }, + { + // version enabled by runtimeConfig override. + runtimeConfig: map[string]string{ + "extensions/v1beta1": "", + }, + defaultResourceConfig: func() *serverstore.ResourceConfig { + config := newFakeAPIResourceConfigSource() + return config + }, + expectedAPIConfig: func() *serverstore.ResourceConfig { + config := newFakeAPIResourceConfigSource() + return config + }, + err: false, + }, + { + // Disable v1. + runtimeConfig: map[string]string{ + "/v1": "false", + }, + defaultResourceConfig: func() *serverstore.ResourceConfig { + return newFakeAPIResourceConfigSource() + }, + expectedAPIConfig: func() *serverstore.ResourceConfig { + config := newFakeAPIResourceConfigSource() + config.DisableVersions(apiv1GroupVersion) + return config + }, + err: false, + }, + { + // invalid runtime config + runtimeConfig: map[string]string{ + "invalidgroup/version": "false", + }, + defaultResourceConfig: func() *serverstore.ResourceConfig { + return newFakeAPIResourceConfigSource() + }, + expectedAPIConfig: func() *serverstore.ResourceConfig { + return newFakeAPIResourceConfigSource() + }, + err: false, + }, + { + // enable all + runtimeConfig: map[string]string{ + "api/all": "true", + }, + defaultResourceConfig: func() *serverstore.ResourceConfig { + return newFakeAPIResourceConfigSource() + }, + expectedAPIConfig: func() *serverstore.ResourceConfig { + config := newFakeAPIResourceConfigSource() + config.EnableVersions(registry.RegisteredGroupVersions()...) + return config + }, + err: false, + }, + { + // only enable v1 + runtimeConfig: map[string]string{ + "api/all": "false", + "/v1": "true", + }, + defaultResourceConfig: func() *serverstore.ResourceConfig { + return newFakeAPIResourceConfigSource() + }, + expectedAPIConfig: func() *serverstore.ResourceConfig { + config := newFakeAPIResourceConfigSource() + config.DisableVersions(extensionsapiv1beta1.SchemeGroupVersion) + return config + }, + err: false, + }, + } + for index, test := range testCases { + actualDisablers, err := MergeAPIResourceConfigs(test.defaultResourceConfig(), test.runtimeConfig, registry) + if err == nil && test.err { + t.Fatalf("expected error for test case: %v", index) + } else if err != nil && !test.err { + t.Fatalf("unexpected error: %s, for test: %v", err, test) + } + + expectedConfig := test.expectedAPIConfig() + if err == nil && !reflect.DeepEqual(actualDisablers, expectedConfig) { + t.Fatalf("%v: unexpected apiResourceDisablers. Actual: %v\n expected: %v", test.runtimeConfig, actualDisablers, expectedConfig) + } + } +} + +func newFakeAPIResourceConfigSource() *serverstore.ResourceConfig { + ret := serverstore.NewResourceConfig() + // NOTE: GroupVersions listed here will be enabled by default. Don't put alpha versions in the list. + ret.EnableVersions( + apiv1.SchemeGroupVersion, + extensionsapiv1beta1.SchemeGroupVersion, + ) + + return ret +} + +func newFakeRegistry() *registered.APIRegistrationManager { + registry := registered.NewOrDie("") + + registry.RegisterGroup(apimachinery.GroupMeta{ + GroupVersion: apiv1.SchemeGroupVersion, + }) + registry.RegisterGroup(apimachinery.GroupMeta{ + GroupVersion: extensionsapiv1beta1.SchemeGroupVersion, + }) + registry.RegisterVersions([]schema.GroupVersion{apiv1.SchemeGroupVersion, extensionsapiv1beta1.SchemeGroupVersion}) + return registry +} diff --git a/vendor/k8s.io/apiserver/pkg/server/routes/data/swagger/datafile.go b/vendor/k8s.io/apiserver/pkg/server/routes/data/swagger/datafile.go index a8ae83ddb..4accb69ce 100644 --- a/vendor/k8s.io/apiserver/pkg/server/routes/data/swagger/datafile.go +++ b/vendor/k8s.io/apiserver/pkg/server/routes/data/swagger/datafile.go @@ -6498,7 +6498,7 @@ function marked(src, opt, callback) { } catch (e) { e.message += '\nPlease report this to https://github.com/chjj/marked.'; if ((opt || marked.defaults).silent) { - return '

An error occured:

'
+      return '

An error occurred:

'
         + escape(e.message + '', true)
         + '
'; } @@ -7152,7 +7152,7 @@ var Shred = function(options) { this.logCurl = options.logCurl || false; }; -// Most of the real work is done in the request and reponse classes. +// Most of the real work is done in the request and response classes. Shred.Request = require("./shred/request"); Shred.Response = require("./shred/response"); @@ -8351,7 +8351,7 @@ Changelog: a regress. I appologize for that. 2010.05.09 - 0.5: - - bug fix: 0 is now preceeded with a + sign + - bug fix: 0 is now preceded with a + sign - bug fix: the sign was not at the right position on padded results (Kamal Abdali) - switched from GPL to BSD license diff --git a/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go b/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go index 1bbfacf43..06c723d37 100644 --- a/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go +++ b/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go @@ -17,7 +17,7 @@ limitations under the License. package routes import ( - "github.com/emicklei/go-restful" + restful "github.com/emicklei/go-restful" "github.com/golang/glog" "k8s.io/apiserver/pkg/server/mux" @@ -32,8 +32,15 @@ type OpenAPI struct { // Install adds the SwaggerUI webservice to the given mux. func (oa OpenAPI) Install(c *restful.Container, mux *mux.PathRecorderMux) { + // NOTE: [DEPRECATION] We will announce deprecation for format-separated endpoints for OpenAPI spec, + // and switch to a single /openapi/v2 endpoint in Kubernetes 1.10. The design doc and deprecation process + // are tracked at: https://docs.google.com/document/d/19lEqE9lc4yHJ3WJAJxS_G7TcORIJXGHyq3wpwcH28nU. _, err := handler.BuildAndRegisterOpenAPIService("/swagger.json", c.RegisteredWebServices(), oa.Config, mux) if err != nil { glog.Fatalf("Failed to register open api spec for root: %v", err) } + _, err = handler.BuildAndRegisterOpenAPIVersionedService("/openapi/v2", c.RegisteredWebServices(), oa.Config, mux) + if err != nil { + glog.Fatalf("Failed to register versioned open api spec for root: %v", err) + } } diff --git a/vendor/k8s.io/apiserver/pkg/server/serve.go b/vendor/k8s.io/apiserver/pkg/server/serve.go index dcb4de1e5..7cfc10382 100644 --- a/vendor/k8s.io/apiserver/pkg/server/serve.go +++ b/vendor/k8s.io/apiserver/pkg/server/serve.go @@ -27,6 +27,7 @@ import ( "time" "github.com/golang/glog" + "golang.org/x/net/http2" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/validation" @@ -39,17 +40,17 @@ const ( // serveSecurely runs the secure http server. It fails only if certificates cannot // be loaded or the initial listen call fails. The actual server loop (stoppable by closing // stopCh) runs in a go routine, i.e. serveSecurely does not block. -func (s *GenericAPIServer) serveSecurely(stopCh <-chan struct{}) error { - if s.SecureServingInfo.Listener == nil { +func (s *SecureServingInfo) Serve(handler http.Handler, shutdownTimeout time.Duration, stopCh <-chan struct{}) error { + if s.Listener == nil { return fmt.Errorf("listener must not be nil") } secureServer := &http.Server{ - Addr: s.SecureServingInfo.Listener.Addr().String(), - Handler: s.Handler, + Addr: s.Listener.Addr().String(), + Handler: handler, MaxHeaderBytes: 1 << 20, TLSConfig: &tls.Config{ - NameToCertificate: s.SecureServingInfo.SNICerts, + NameToCertificate: s.SNICerts, // Can't use SSLv3 because of POODLE and BEAST // Can't use TLSv1.0 because of POODLE and BEAST using CBC cipher // Can't use TLSv1.1 because of RC4 cipher usage @@ -59,41 +60,47 @@ func (s *GenericAPIServer) serveSecurely(stopCh <-chan struct{}) error { }, } - if s.SecureServingInfo.MinTLSVersion > 0 { - secureServer.TLSConfig.MinVersion = s.SecureServingInfo.MinTLSVersion + if s.MinTLSVersion > 0 { + secureServer.TLSConfig.MinVersion = s.MinTLSVersion } - if len(s.SecureServingInfo.CipherSuites) > 0 { - secureServer.TLSConfig.CipherSuites = s.SecureServingInfo.CipherSuites + if len(s.CipherSuites) > 0 { + secureServer.TLSConfig.CipherSuites = s.CipherSuites } - if s.SecureServingInfo.Cert != nil { - secureServer.TLSConfig.Certificates = []tls.Certificate{*s.SecureServingInfo.Cert} + if s.Cert != nil { + secureServer.TLSConfig.Certificates = []tls.Certificate{*s.Cert} } // append all named certs. Otherwise, the go tls stack will think no SNI processing // is necessary because there is only one cert anyway. // Moreover, if ServerCert.CertFile/ServerCert.KeyFile are not set, the first SNI // cert will become the default cert. That's what we expect anyway. - for _, c := range s.SecureServingInfo.SNICerts { + for _, c := range s.SNICerts { secureServer.TLSConfig.Certificates = append(secureServer.TLSConfig.Certificates, *c) } - if s.SecureServingInfo.ClientCA != nil { + if s.ClientCA != nil { // Populate PeerCertificates in requests, but don't reject connections without certificates // This allows certificates to be validated by authenticators, while still allowing other auth types secureServer.TLSConfig.ClientAuth = tls.RequestClientCert // Specify allowed CAs for client certificates - secureServer.TLSConfig.ClientCAs = s.SecureServingInfo.ClientCA + secureServer.TLSConfig.ClientCAs = s.ClientCA + } + + if s.HTTP2MaxStreamsPerConnection > 0 { + http2.ConfigureServer(secureServer, &http2.Server{ + MaxConcurrentStreams: uint32(s.HTTP2MaxStreamsPerConnection), + }) } glog.Infof("Serving securely on %s", secureServer.Addr) - err := RunServer(secureServer, s.SecureServingInfo.Listener, s.ShutdownTimeout, stopCh) - return err + return RunServer(secureServer, s.Listener, shutdownTimeout, stopCh) } // RunServer listens on the given port if listener is not given, // then spawns a go-routine continuously serving // until the stopCh is closed. This function does not block. +// TODO: make private when insecure serving is gone from the kube-apiserver func RunServer( server *http.Server, ln net.Listener, diff --git a/vendor/k8s.io/apiserver/pkg/server/storage/BUILD b/vendor/k8s.io/apiserver/pkg/server/storage/BUILD index 186764721..d79f70527 100644 --- a/vendor/k8s.io/apiserver/pkg/server/storage/BUILD +++ b/vendor/k8s.io/apiserver/pkg/server/storage/BUILD @@ -12,8 +12,7 @@ go_test( "resource_config_test.go", "storage_factory_test.go", ], - importpath = "k8s.io/apiserver/pkg/server/storage", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/server/storage/resource_config.go b/vendor/k8s.io/apiserver/pkg/server/storage/resource_config.go index da232569a..0a4470605 100644 --- a/vendor/k8s.io/apiserver/pkg/server/storage/resource_config.go +++ b/vendor/k8s.io/apiserver/pkg/server/storage/resource_config.go @@ -18,164 +18,50 @@ package storage import ( "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/sets" ) -// APIResourceConfigSource is the interface to determine which versions and resources are enabled +// APIResourceConfigSource is the interface to determine which groups and versions are enabled type APIResourceConfigSource interface { - AnyVersionOfResourceEnabled(resource schema.GroupResource) bool - ResourceEnabled(resource schema.GroupVersionResource) bool - AllResourcesForVersionEnabled(version schema.GroupVersion) bool - AnyResourcesForVersionEnabled(version schema.GroupVersion) bool - AnyResourcesForGroupEnabled(group string) bool -} - -// Specifies the overrides for various API group versions. -// This can be used to enable/disable entire group versions or specific resources. -type GroupVersionResourceConfig struct { - // Whether to enable or disable this entire group version. This dominates any enablement check. - // Enable=true means the group version is enabled, and EnabledResources/DisabledResources are considered. - // Enable=false means the group version is disabled, and EnabledResources/DisabledResources are not considered. - Enable bool - - // DisabledResources lists the resources that are specifically disabled for a group/version - // DisabledResources trumps EnabledResources - DisabledResources sets.String - - // EnabledResources lists the resources that should be enabled by default. This is a little - // unusual, but we need it for compatibility with old code for now. An empty set means - // enable all, a non-empty set means that all other resources are disabled. - EnabledResources sets.String + VersionEnabled(version schema.GroupVersion) bool + AnyVersionForGroupEnabled(group string) bool } var _ APIResourceConfigSource = &ResourceConfig{} type ResourceConfig struct { - GroupVersionResourceConfigs map[schema.GroupVersion]*GroupVersionResourceConfig + GroupVersionConfigs map[schema.GroupVersion]bool } func NewResourceConfig() *ResourceConfig { - return &ResourceConfig{GroupVersionResourceConfigs: map[schema.GroupVersion]*GroupVersionResourceConfig{}} -} - -func NewGroupVersionResourceConfig() *GroupVersionResourceConfig { - return &GroupVersionResourceConfig{Enable: true, DisabledResources: sets.String{}, EnabledResources: sets.String{}} + return &ResourceConfig{GroupVersionConfigs: map[schema.GroupVersion]bool{}} } -// DisableVersions disables the versions entirely. No resources (even those whitelisted in EnabledResources) will be enabled +// DisableVersions disables the versions entirely. func (o *ResourceConfig) DisableVersions(versions ...schema.GroupVersion) { for _, version := range versions { - _, versionExists := o.GroupVersionResourceConfigs[version] - if !versionExists { - o.GroupVersionResourceConfigs[version] = NewGroupVersionResourceConfig() - } - - o.GroupVersionResourceConfigs[version].Enable = false + o.GroupVersionConfigs[version] = false } } func (o *ResourceConfig) EnableVersions(versions ...schema.GroupVersion) { for _, version := range versions { - _, versionExists := o.GroupVersionResourceConfigs[version] - if !versionExists { - o.GroupVersionResourceConfigs[version] = NewGroupVersionResourceConfig() - } - - o.GroupVersionResourceConfigs[version].Enable = true - } -} - -func (o *ResourceConfig) DisableResources(resources ...schema.GroupVersionResource) { - for _, resource := range resources { - version := resource.GroupVersion() - _, versionExists := o.GroupVersionResourceConfigs[version] - if !versionExists { - o.GroupVersionResourceConfigs[version] = NewGroupVersionResourceConfig() - } - - o.GroupVersionResourceConfigs[version].DisabledResources.Insert(resource.Resource) - } -} - -func (o *ResourceConfig) EnableResources(resources ...schema.GroupVersionResource) { - for _, resource := range resources { - version := resource.GroupVersion() - _, versionExists := o.GroupVersionResourceConfigs[version] - if !versionExists { - o.GroupVersionResourceConfigs[version] = NewGroupVersionResourceConfig() - } - - o.GroupVersionResourceConfigs[version].EnabledResources.Insert(resource.Resource) - o.GroupVersionResourceConfigs[version].DisabledResources.Delete(resource.Resource) - } -} - -// AnyResourcesForVersionEnabled only considers matches based on exactly group/resource lexical matching. This means that -// resource renames across versions are NOT considered to be the same resource by this method. You'll need to manually check -// using the ResourceEnabled function. -func (o *ResourceConfig) AnyVersionOfResourceEnabled(resource schema.GroupResource) bool { - for version := range o.GroupVersionResourceConfigs { - if version.Group != resource.Group { - continue - } - - if o.ResourceEnabled(version.WithResource(resource.Resource)) { - return true - } - } - - return false -} - -func (o *ResourceConfig) ResourceEnabled(resource schema.GroupVersionResource) bool { - versionOverride, versionExists := o.GroupVersionResourceConfigs[resource.GroupVersion()] - if !versionExists { - return false - } - if !versionOverride.Enable { - return false - } - - if versionOverride.DisabledResources.Has(resource.Resource) { - return false - } - - if len(versionOverride.EnabledResources) > 0 { - return versionOverride.EnabledResources.Has(resource.Resource) + o.GroupVersionConfigs[version] = true } - - return true } -func (o *ResourceConfig) AllResourcesForVersionEnabled(version schema.GroupVersion) bool { - versionOverride, versionExists := o.GroupVersionResourceConfigs[version] - if !versionExists { - return false - } - if !versionOverride.Enable { - return false - } - - if len(versionOverride.EnabledResources) == 0 && len(versionOverride.DisabledResources) == 0 { +func (o *ResourceConfig) VersionEnabled(version schema.GroupVersion) bool { + enabled, _ := o.GroupVersionConfigs[version] + if enabled { return true } return false } -func (o *ResourceConfig) AnyResourcesForVersionEnabled(version schema.GroupVersion) bool { - versionOverride, versionExists := o.GroupVersionResourceConfigs[version] - if !versionExists { - return false - } - - return versionOverride.Enable -} - -func (o *ResourceConfig) AnyResourcesForGroupEnabled(group string) bool { - for version := range o.GroupVersionResourceConfigs { +func (o *ResourceConfig) AnyVersionForGroupEnabled(group string) bool { + for version := range o.GroupVersionConfigs { if version.Group == group { - if o.AnyResourcesForVersionEnabled(version) { + if o.VersionEnabled(version) { return true } } diff --git a/vendor/k8s.io/apiserver/pkg/server/storage/resource_config_test.go b/vendor/k8s.io/apiserver/pkg/server/storage/resource_config_test.go index 4eb9b544c..a22d6227d 100644 --- a/vendor/k8s.io/apiserver/pkg/server/storage/resource_config_test.go +++ b/vendor/k8s.io/apiserver/pkg/server/storage/resource_config_test.go @@ -26,79 +26,24 @@ func TestDisabledVersion(t *testing.T) { g1v1 := schema.GroupVersion{Group: "group1", Version: "version1"} g1v2 := schema.GroupVersion{Group: "group1", Version: "version2"} g2v1 := schema.GroupVersion{Group: "group2", Version: "version1"} - g3v1 := schema.GroupVersion{Group: "group3", Version: "version1"} - - resourceType := "the-resource" - disabledResourceType := "the-disabled-resource" config := NewResourceConfig() config.DisableVersions(g1v1) - config.EnableVersions(g1v2, g3v1) - config.EnableResources(g1v1.WithResource(resourceType), g2v1.WithResource(resourceType)) - config.DisableResources(g1v2.WithResource(disabledResourceType)) - - expectedEnabledResources := []schema.GroupVersionResource{ - g1v2.WithResource(resourceType), - g2v1.WithResource(resourceType), - } - expectedDisabledResources := []schema.GroupVersionResource{ - g1v1.WithResource(resourceType), g1v1.WithResource(disabledResourceType), - g1v2.WithResource(disabledResourceType), - g2v1.WithResource(disabledResourceType), - } - - for _, expectedResource := range expectedEnabledResources { - if !config.ResourceEnabled(expectedResource) { - t.Errorf("expected enabled for %v, from %v", expectedResource, config) - } - } - for _, expectedResource := range expectedDisabledResources { - if config.ResourceEnabled(expectedResource) { - t.Errorf("expected disabled for %v, from %v", expectedResource, config) - } - } + config.EnableVersions(g1v2, g2v1) - if e, a := false, config.AnyResourcesForVersionEnabled(g1v1); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := false, config.AllResourcesForVersionEnabled(g1v1); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := true, config.AnyResourcesForVersionEnabled(g1v2); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := false, config.AllResourcesForVersionEnabled(g1v2); e != a { - t.Errorf("expected %v, got %v", e, a) + if config.VersionEnabled(g1v1) { + t.Errorf("expected disabled for %v, from %v", g1v1, config) } - if e, a := true, config.AnyResourcesForVersionEnabled(g3v1); e != a { - t.Errorf("expected %v, got %v", e, a) + if !config.VersionEnabled(g1v2) { + t.Errorf("expected enabled for %v, from %v", g1v1, config) } - if e, a := true, config.AllResourcesForVersionEnabled(g3v1); e != a { - t.Errorf("expected %v, got %v", e, a) + if !config.VersionEnabled(g2v1) { + t.Errorf("expected enabled for %v, from %v", g1v1, config) } - - expectedEnabledAnyVersionResources := []schema.GroupResource{ - {Group: "group1", Resource: resourceType}, - } - expectedDisabledAnyResources := []schema.GroupResource{ - {Group: "group1", Resource: disabledResourceType}, - } - - for _, expectedResource := range expectedEnabledAnyVersionResources { - if !config.AnyVersionOfResourceEnabled(expectedResource) { - t.Errorf("expected enabled for %v, from %v", expectedResource, config) - } - } - for _, expectedResource := range expectedDisabledAnyResources { - if config.AnyVersionOfResourceEnabled(expectedResource) { - t.Errorf("expected disabled for %v, from %v", expectedResource, config) - } - } - } -func TestAnyResourcesForGroupEnabled(t *testing.T) { +func TestAnyVersionForGroupEnabled(t *testing.T) { tests := []struct { name string creator func() APIResourceConfigSource @@ -136,24 +81,12 @@ func TestAnyResourcesForGroupEnabled(t *testing.T) { }, testGroup: "one", - expectedResult: true, - }, - { - name: "present, and one resource", - creator: func() APIResourceConfigSource { - ret := NewResourceConfig() - ret.DisableVersions(schema.GroupVersion{Group: "one", Version: "version1"}) - ret.EnableResources(schema.GroupVersionResource{Group: "one", Version: "version2", Resource: "foo"}) - return ret - }, - testGroup: "one", - expectedResult: true, }, } for _, tc := range tests { - if e, a := tc.expectedResult, tc.creator().AnyResourcesForGroupEnabled(tc.testGroup); e != a { + if e, a := tc.expectedResult, tc.creator().AnyVersionForGroupEnabled(tc.testGroup); e != a { t.Errorf("%s: expected %v, got %v", tc.name, e, a) } } diff --git a/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go b/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go index 429e14d5c..50c068254 100644 --- a/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go +++ b/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go @@ -151,7 +151,14 @@ var _ StorageFactory = &DefaultStorageFactory{} const AllResources = "*" -func NewDefaultStorageFactory(config storagebackend.Config, defaultMediaType string, defaultSerializer runtime.StorageSerializer, resourceEncodingConfig ResourceEncodingConfig, resourceConfig APIResourceConfigSource, specialDefaultResourcePrefixes map[schema.GroupResource]string) *DefaultStorageFactory { +func NewDefaultStorageFactory( + config storagebackend.Config, + defaultMediaType string, + defaultSerializer runtime.StorageSerializer, + resourceEncodingConfig ResourceEncodingConfig, + resourceConfig APIResourceConfigSource, + specialDefaultResourcePrefixes map[schema.GroupResource]string, +) *DefaultStorageFactory { config.Paging = utilfeature.DefaultFeatureGate.Enabled(features.APIListChunking) if len(defaultMediaType) == 0 { defaultMediaType = runtime.ContentTypeJSON @@ -182,7 +189,7 @@ func (s *DefaultStorageFactory) SetEtcdPrefix(groupResource schema.GroupResource } // SetDisableAPIListChunking allows a specific resource to disable paging at the storage layer, to prevent -// exposure of key names in continuations. This may be overriden by feature gates. +// exposure of key names in continuations. This may be overridden by feature gates. func (s *DefaultStorageFactory) SetDisableAPIListChunking(groupResource schema.GroupResource) { overrides := s.Overrides[groupResource] overrides.disablePaging = true @@ -233,7 +240,7 @@ func getAllResourcesAlias(resource schema.GroupResource) schema.GroupResource { func (s *DefaultStorageFactory) getStorageGroupResource(groupResource schema.GroupResource) schema.GroupResource { for _, potentialStorageResource := range s.Overrides[groupResource].cohabitatingResources { - if s.APIResourceConfigSource.AnyVersionOfResourceEnabled(potentialStorageResource) { + if s.APIResourceConfigSource.AnyVersionForGroupEnabled(potentialStorageResource.Group) { return potentialStorageResource } } @@ -314,8 +321,10 @@ func (s *DefaultStorageFactory) Backends() []Backend { backends := []Backend{} for server := range servers { backends = append(backends, Backend{ - Server: server, - TLSConfig: tlsConfig, + Server: server, + // We can't share TLSConfig across different backends to avoid races. + // For more details see: http://pr.k8s.io/59338 + TLSConfig: tlsConfig.Clone(), }) } return backends diff --git a/vendor/k8s.io/apiserver/pkg/storage/BUILD b/vendor/k8s.io/apiserver/pkg/storage/BUILD index 1838e84d8..712544e2d 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/BUILD @@ -15,12 +15,12 @@ go_test( "util_test.go", "watch_cache_test.go", ], - importpath = "k8s.io/apiserver/pkg/storage", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/fields:go_default_library", "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", @@ -28,7 +28,6 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/clock:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/diff:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/storage/cacher.go b/vendor/k8s.io/apiserver/pkg/storage/cacher.go index e3c787d08..9ffbbc5e9 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/cacher.go +++ b/vendor/k8s.io/apiserver/pkg/storage/cacher.go @@ -20,7 +20,6 @@ import ( "fmt" "net/http" "reflect" - "strconv" "sync" "time" @@ -131,7 +130,7 @@ func (i *indexedWatchers) terminateAll(objectType reflect.Type) { } } -type watchFilterFunc func(key string, l labels.Set, f fields.Set, uninitialized bool) bool +type filterWithAttrsFunc func(key string, l labels.Set, f fields.Set, uninitialized bool) bool // Cacher is responsible for serving WATCH and LIST requests for a given // resource from its internal cache and updating its cache in the background @@ -290,7 +289,7 @@ func (c *Cacher) Delete(ctx context.Context, key string, out runtime.Object, pre // Implements storage.Interface. func (c *Cacher) Watch(ctx context.Context, key string, resourceVersion string, pred SelectionPredicate) (watch.Interface, error) { - watchRV, err := ParseWatchResourceVersion(resourceVersion) + watchRV, err := c.versioner.ParseWatchResourceVersion(resourceVersion) if err != nil { return nil, err } @@ -338,7 +337,7 @@ func (c *Cacher) Watch(ctx context.Context, key string, resourceVersion string, c.Lock() defer c.Unlock() forget := forgetWatcher(c, c.watcherIdx, triggerValue, triggerSupported) - watcher := newCacheWatcher(watchRV, chanSize, initEvents, watchFilterFunction(key, pred), forget) + watcher := newCacheWatcher(watchRV, chanSize, initEvents, filterWithAttrsFunction(key, pred), forget, c.versioner) c.watchers.addWatcher(watcher, c.watcherIdx, triggerValue, triggerSupported) c.watcherIdx++ @@ -361,7 +360,7 @@ func (c *Cacher) Get(ctx context.Context, key string, resourceVersion string, ob // If resourceVersion is specified, serve it from cache. // It's guaranteed that the returned value is at least that // fresh as the given resourceVersion. - getRV, err := ParseListResourceVersion(resourceVersion) + getRV, err := c.versioner.ParseListResourceVersion(resourceVersion) if err != nil { return err } @@ -414,7 +413,7 @@ func (c *Cacher) GetToList(ctx context.Context, key string, resourceVersion stri // If resourceVersion is specified, serve it from cache. // It's guaranteed that the returned value is at least that // fresh as the given resourceVersion. - listRV, err := ParseListResourceVersion(resourceVersion) + listRV, err := c.versioner.ParseListResourceVersion(resourceVersion) if err != nil { return err } @@ -440,7 +439,7 @@ func (c *Cacher) GetToList(ctx context.Context, key string, resourceVersion stri if err != nil || listVal.Kind() != reflect.Slice { return fmt.Errorf("need a pointer to slice, got %v", listVal.Kind()) } - filter := filterFunction(key, pred) + filter := filterWithAttrsFunction(key, pred) obj, exists, readResourceVersion, err := c.watchCache.WaitUntilFreshAndGet(listRV, key, trace) if err != nil { @@ -453,7 +452,7 @@ func (c *Cacher) GetToList(ctx context.Context, key string, resourceVersion stri if !ok { return fmt.Errorf("non *storeElement returned from storage: %v", obj) } - if filter(elem.Key, elem.Object) { + if filter(elem.Key, elem.Labels, elem.Fields, elem.Uninitialized) { listVal.Set(reflect.Append(listVal, reflect.ValueOf(elem.Object).Elem())) } } @@ -483,7 +482,7 @@ func (c *Cacher) List(ctx context.Context, key string, resourceVersion string, p // If resourceVersion is specified, serve it from cache. // It's guaranteed that the returned value is at least that // fresh as the given resourceVersion. - listRV, err := ParseListResourceVersion(resourceVersion) + listRV, err := c.versioner.ParseListResourceVersion(resourceVersion) if err != nil { return err } @@ -509,7 +508,7 @@ func (c *Cacher) List(ctx context.Context, key string, resourceVersion string, p if err != nil || listVal.Kind() != reflect.Slice { return fmt.Errorf("need a pointer to slice, got %v", listVal.Kind()) } - filter := filterFunction(key, pred) + filter := filterWithAttrsFunction(key, pred) objs, readResourceVersion, err := c.watchCache.WaitUntilFreshAndList(listRV, trace) if err != nil { @@ -527,7 +526,7 @@ func (c *Cacher) List(ctx context.Context, key string, resourceVersion string, p if !ok { return fmt.Errorf("non *storeElement returned from storage: %v", obj) } - if filter(elem.Key, elem.Object) { + if filter(elem.Key, elem.Labels, elem.Fields, elem.Uninitialized) { listVal.Set(reflect.Append(listVal, reflect.ValueOf(elem.Object).Elem())) } } @@ -556,6 +555,10 @@ func (c *Cacher) GuaranteedUpdate( return c.storage.GuaranteedUpdate(ctx, key, ptrToType, ignoreNotFound, preconditions, tryUpdate) } +func (c *Cacher) Count(pathPrefix string) (int64, error) { + return c.storage.Count(pathPrefix) +} + func (c *Cacher) triggerValues(event *watchCacheEvent) ([]string, bool) { // TODO: Currently we assume that in a given Cacher object, its // is aware of exactly the same trigger (at most one). Thus calling: @@ -655,7 +658,7 @@ func (c *Cacher) Stop() { } c.stopLock.Lock() if c.stopped { - // avoid that it was locked meanwhile as isStopped only read-locks + c.stopLock.Unlock() return } c.stopped = true @@ -676,23 +679,12 @@ func forgetWatcher(c *Cacher, index int, triggerValue string, triggerSupported b glog.V(1).Infof("Forcing watcher close due to unresponsiveness: %v", c.objectType.String()) } // It's possible that the watcher is already not in the structure (e.g. in case of - // simulaneous Stop() and terminateAllWatchers(), but it doesn't break anything. + // simultaneous Stop() and terminateAllWatchers(), but it doesn't break anything. c.watchers.deleteWatcher(index, triggerValue, triggerSupported) } } -func filterFunction(key string, p SelectionPredicate) func(string, runtime.Object) bool { - f := SimpleFilter(p) - filterFunc := func(objKey string, obj runtime.Object) bool { - if !hasPathPrefix(objKey, key) { - return false - } - return f(obj) - } - return filterFunc -} - -func watchFilterFunction(key string, p SelectionPredicate) watchFilterFunc { +func filterWithAttrsFunction(key string, p SelectionPredicate) filterWithAttrsFunc { filterFunc := func(objKey string, label labels.Set, field fields.Set, uninitialized bool) bool { if !hasPathPrefix(objKey, key) { return false @@ -707,11 +699,7 @@ func (c *Cacher) LastSyncResourceVersion() (uint64, error) { c.ready.wait() resourceVersion := c.reflector.LastSyncResourceVersion() - if resourceVersion == "" { - return 0, nil - } - - return strconv.ParseUint(resourceVersion, 10, 64) + return c.versioner.ParseListResourceVersion(resourceVersion) } // cacherListerWatcher opaques storage.Interface to expose cache.ListerWatcher. @@ -743,7 +731,7 @@ func (lw *cacherListerWatcher) Watch(options metav1.ListOptions) (watch.Interfac return lw.storage.WatchList(context.TODO(), lw.resourcePrefix, options.ResourceVersion, Everything) } -// cacherWatch implements watch.Interface to return a single error +// errWatcher implements watch.Interface to return a single error type errWatcher struct { result chan watch.Event } @@ -783,25 +771,27 @@ func (c *errWatcher) Stop() { // no-op } -// cacherWatch implements watch.Interface +// cachWatcher implements watch.Interface type cacheWatcher struct { sync.Mutex - input chan *watchCacheEvent - result chan watch.Event - done chan struct{} - filter watchFilterFunc - stopped bool - forget func(bool) + input chan *watchCacheEvent + result chan watch.Event + done chan struct{} + filter filterWithAttrsFunc + stopped bool + forget func(bool) + versioner Versioner } -func newCacheWatcher(resourceVersion uint64, chanSize int, initEvents []*watchCacheEvent, filter watchFilterFunc, forget func(bool)) *cacheWatcher { +func newCacheWatcher(resourceVersion uint64, chanSize int, initEvents []*watchCacheEvent, filter filterWithAttrsFunc, forget func(bool), versioner Versioner) *cacheWatcher { watcher := &cacheWatcher{ - input: make(chan *watchCacheEvent, chanSize), - result: make(chan watch.Event, chanSize), - done: make(chan struct{}), - filter: filter, - stopped: false, - forget: forget, + input: make(chan *watchCacheEvent, chanSize), + result: make(chan watch.Event, chanSize), + done: make(chan struct{}), + filter: filter, + stopped: false, + forget: forget, + versioner: versioner, } go watcher.process(initEvents, resourceVersion) return watcher @@ -890,7 +880,12 @@ func (c *cacheWatcher) sendWatchCacheEvent(event *watchCacheEvent) { case curObjPasses && oldObjPasses: watchEvent = watch.Event{Type: watch.Modified, Object: event.Object.DeepCopyObject()} case !curObjPasses && oldObjPasses: - watchEvent = watch.Event{Type: watch.Deleted, Object: event.PrevObject.DeepCopyObject()} + // return a delete event with the previous object content, but with the event's resource version + oldObj := event.PrevObject.DeepCopyObject() + if err := c.versioner.UpdateObject(oldObj, event.ResourceVersion); err != nil { + utilruntime.HandleError(fmt.Errorf("failure to version api object (%d) %#v: %v", event.ResourceVersion, oldObj, err)) + } + watchEvent = watch.Event{Type: watch.Deleted, Object: oldObj} } // We need to ensure that if we put event X to the c.result, all diff --git a/vendor/k8s.io/apiserver/pkg/storage/cacher_whitebox_test.go b/vendor/k8s.io/apiserver/pkg/storage/cacher_whitebox_test.go index 3ef62e3fd..905933b28 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/cacher_whitebox_test.go +++ b/vendor/k8s.io/apiserver/pkg/storage/cacher_whitebox_test.go @@ -17,15 +17,19 @@ limitations under the License. package storage import ( + "fmt" "reflect" + "strconv" "sync" "testing" "time" "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/diff" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" @@ -48,7 +52,7 @@ func TestCacheWatcherCleanupNotBlockedByResult(t *testing.T) { } // set the size of the buffer of w.result to 0, so that the writes to // w.result is blocked. - w := newCacheWatcher(0, 0, initEvents, filter, forget) + w := newCacheWatcher(0, 0, initEvents, filter, forget, testVersioner{}) w.Stop() if err := wait.PollImmediate(1*time.Second, 5*time.Second, func() (bool, error) { lock.RLock() @@ -73,28 +77,31 @@ func TestCacheWatcherHandlesFiltering(t *testing.T) { { events: []*watchCacheEvent{ { - Type: watch.Added, - Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "1"}}, - ObjFields: fields.Set{"spec.nodeName": "host"}, + Type: watch.Added, + Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "1"}}, + ObjFields: fields.Set{"spec.nodeName": "host"}, + ResourceVersion: 1, }, { - Type: watch.Modified, - PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "1"}}, - PrevObjFields: fields.Set{"spec.nodeName": "host"}, - Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "2"}}, - ObjFields: fields.Set{"spec.nodeName": ""}, + Type: watch.Modified, + PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "1"}}, + PrevObjFields: fields.Set{"spec.nodeName": "host"}, + Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "2"}}, + ObjFields: fields.Set{"spec.nodeName": ""}, + ResourceVersion: 2, }, { - Type: watch.Modified, - PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "2"}}, - PrevObjFields: fields.Set{"spec.nodeName": ""}, - Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "3"}}, - ObjFields: fields.Set{"spec.nodeName": "host"}, + Type: watch.Modified, + PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "2"}}, + PrevObjFields: fields.Set{"spec.nodeName": ""}, + Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "3"}}, + ObjFields: fields.Set{"spec.nodeName": "host"}, + ResourceVersion: 3, }, }, expected: []watch.Event{ {Type: watch.Added, Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "1"}}}, - {Type: watch.Deleted, Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "1"}}}, + {Type: watch.Deleted, Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "2"}}}, {Type: watch.Added, Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "3"}}}, }, }, @@ -102,50 +109,56 @@ func TestCacheWatcherHandlesFiltering(t *testing.T) { { events: []*watchCacheEvent{ { - Type: watch.Added, - Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "1"}}, - ObjFields: fields.Set{"spec.nodeName": ""}, + Type: watch.Added, + Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "1"}}, + ObjFields: fields.Set{"spec.nodeName": ""}, + ResourceVersion: 1, }, { - Type: watch.Modified, - PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "1"}}, - PrevObjFields: fields.Set{"spec.nodeName": ""}, - Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "2"}}, - ObjFields: fields.Set{"spec.nodeName": ""}, + Type: watch.Modified, + PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "1"}}, + PrevObjFields: fields.Set{"spec.nodeName": ""}, + Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "2"}}, + ObjFields: fields.Set{"spec.nodeName": ""}, + ResourceVersion: 2, }, { - Type: watch.Modified, - PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "2"}}, - PrevObjFields: fields.Set{"spec.nodeName": ""}, - Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "3"}}, - ObjFields: fields.Set{"spec.nodeName": "host"}, + Type: watch.Modified, + PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "2"}}, + PrevObjFields: fields.Set{"spec.nodeName": ""}, + Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "3"}}, + ObjFields: fields.Set{"spec.nodeName": "host"}, + ResourceVersion: 3, }, { - Type: watch.Modified, - PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "3"}}, - PrevObjFields: fields.Set{"spec.nodeName": "host"}, - Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "4"}}, - ObjFields: fields.Set{"spec.nodeName": "host"}, + Type: watch.Modified, + PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "3"}}, + PrevObjFields: fields.Set{"spec.nodeName": "host"}, + Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "4"}}, + ObjFields: fields.Set{"spec.nodeName": "host"}, + ResourceVersion: 4, }, { - Type: watch.Modified, - PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "4"}}, - PrevObjFields: fields.Set{"spec.nodeName": "host"}, - Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "5"}}, - ObjFields: fields.Set{"spec.nodeName": ""}, + Type: watch.Modified, + PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "4"}}, + PrevObjFields: fields.Set{"spec.nodeName": "host"}, + Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "5"}}, + ObjFields: fields.Set{"spec.nodeName": ""}, + ResourceVersion: 5, }, { - Type: watch.Modified, - PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "5"}}, - PrevObjFields: fields.Set{"spec.nodeName": ""}, - Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "6"}}, - ObjFields: fields.Set{"spec.nodeName": ""}, + Type: watch.Modified, + PrevObject: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "5"}}, + PrevObjFields: fields.Set{"spec.nodeName": ""}, + Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "6"}}, + ObjFields: fields.Set{"spec.nodeName": ""}, + ResourceVersion: 6, }, }, expected: []watch.Event{ {Type: watch.Added, Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "3"}}}, {Type: watch.Modified, Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "4"}}}, - {Type: watch.Deleted, Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "4"}}}, + {Type: watch.Deleted, Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "5"}}}, }, }, } @@ -157,7 +170,7 @@ TestCase: for j := range testCase.events { testCase.events[j].ResourceVersion = uint64(j) + 1 } - w := newCacheWatcher(0, 0, testCase.events, filter, forget) + w := newCacheWatcher(0, 0, testCase.events, filter, forget, testVersioner{}) ch := w.ResultChan() for j, event := range testCase.expected { e := <-ch @@ -175,3 +188,24 @@ TestCase: w.Stop() } } + +type testVersioner struct{} + +func (testVersioner) UpdateObject(obj runtime.Object, resourceVersion uint64) error { + return meta.NewAccessor().SetResourceVersion(obj, strconv.FormatUint(resourceVersion, 10)) +} +func (testVersioner) UpdateList(obj runtime.Object, resourceVersion uint64, continueValue string) error { + return fmt.Errorf("unimplemented") +} +func (testVersioner) PrepareObjectForStorage(obj runtime.Object) error { + return fmt.Errorf("unimplemented") +} +func (testVersioner) ObjectResourceVersion(obj runtime.Object) (uint64, error) { + return 0, fmt.Errorf("unimplemented") +} +func (testVersioner) ParseWatchResourceVersion(resourceVersion string) (uint64, error) { + return strconv.ParseUint(resourceVersion, 10, 64) +} +func (testVersioner) ParseListResourceVersion(resourceVersion string) (uint64, error) { + return strconv.ParseUint(resourceVersion, 10, 64) +} diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd/BUILD b/vendor/k8s.io/apiserver/pkg/storage/etcd/BUILD index 7ac2e7102..0269e4e1d 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd/BUILD @@ -13,8 +13,7 @@ go_test( "etcd_helper_test.go", "etcd_watcher_test.go", ], - importpath = "k8s.io/apiserver/pkg/storage/etcd", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/coreos/etcd/client:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", @@ -58,6 +57,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/cache:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/etcd/metrics:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd/api_object_versioner.go b/vendor/k8s.io/apiserver/pkg/storage/etcd/api_object_versioner.go index 71fd85b0b..5534f9fa2 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd/api_object_versioner.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd/api_object_versioner.go @@ -21,6 +21,7 @@ import ( "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apiserver/pkg/storage" ) @@ -81,6 +82,44 @@ func (a APIObjectVersioner) ObjectResourceVersion(obj runtime.Object) (uint64, e return strconv.ParseUint(version, 10, 64) } +// ParseWatchResourceVersion takes a resource version argument and converts it to +// the etcd version we should pass to helper.Watch(). Because resourceVersion is +// an opaque value, the default watch behavior for non-zero watch is to watch +// the next value (if you pass "1", you will see updates from "2" onwards). +func (a APIObjectVersioner) ParseWatchResourceVersion(resourceVersion string) (uint64, error) { + if resourceVersion == "" || resourceVersion == "0" { + return 0, nil + } + version, err := strconv.ParseUint(resourceVersion, 10, 64) + if err != nil { + return 0, storage.NewInvalidError(field.ErrorList{ + // Validation errors are supposed to return version-specific field + // paths, but this is probably close enough. + field.Invalid(field.NewPath("resourceVersion"), resourceVersion, err.Error()), + }) + } + return version, nil +} + +// ParseListResourceVersion takes a resource version argument and converts it to +// the etcd version. +// TODO: reevaluate whether it is really clearer to have both this and the +// Watch version of this function, since they perform the same logic. +func (a APIObjectVersioner) ParseListResourceVersion(resourceVersion string) (uint64, error) { + if resourceVersion == "" { + return 0, nil + } + version, err := strconv.ParseUint(resourceVersion, 10, 64) + if err != nil { + return 0, storage.NewInvalidError(field.ErrorList{ + // Validation errors are supposed to return version-specific field + // paths, but this is probably close enough. + field.Invalid(field.NewPath("resourceVersion"), resourceVersion, err.Error()), + }) + } + return version, nil +} + // APIObjectVersioner implements Versioner var Versioner storage.Versioner = APIObjectVersioner{} diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd/api_object_versioner_test.go b/vendor/k8s.io/apiserver/pkg/storage/etcd/api_object_versioner_test.go index 6ed59dfc3..33e3a7f1f 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd/api_object_versioner_test.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd/api_object_versioner_test.go @@ -20,6 +20,7 @@ import ( "testing" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apiserver/pkg/storage" storagetesting "k8s.io/apiserver/pkg/storage/testing" ) @@ -40,6 +41,43 @@ func TestObjectVersioner(t *testing.T) { } } +func TestEtcdParseResourceVersion(t *testing.T) { + testCases := []struct { + Version string + ExpectVersion uint64 + Err bool + }{ + {Version: "", ExpectVersion: 0}, + {Version: "a", Err: true}, + {Version: " ", Err: true}, + {Version: "1", ExpectVersion: 1}, + {Version: "10", ExpectVersion: 10}, + } + + v := APIObjectVersioner{} + testFuncs := []func(string) (uint64, error){ + v.ParseListResourceVersion, + v.ParseWatchResourceVersion, + } + + for _, testCase := range testCases { + for i, f := range testFuncs { + version, err := f(testCase.Version) + switch { + case testCase.Err && err == nil: + t.Errorf("%s[%v]: unexpected non-error", testCase.Version, i) + case testCase.Err && !storage.IsInvalidError(err): + t.Errorf("%s[%v]: unexpected error: %v", testCase.Version, i, err) + case !testCase.Err && err != nil: + t.Errorf("%s[%v]: unexpected error: %v", testCase.Version, i, err) + } + if version != testCase.ExpectVersion { + t.Errorf("%s[%v]: expected version %d but was %d", testCase.Version, i, testCase.ExpectVersion, version) + } + } + } +} + func TestCompareResourceVersion(t *testing.T) { five := &storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "5"}} six := &storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "6"}} diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_helper.go b/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_helper.go index 322ccefab..510b293c7 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_helper.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_helper.go @@ -235,12 +235,12 @@ func (h *etcdHelper) Watch(ctx context.Context, key string, resourceVersion stri if ctx == nil { glog.Errorf("Context is nil") } - watchRV, err := storage.ParseWatchResourceVersion(resourceVersion) + watchRV, err := h.versioner.ParseWatchResourceVersion(resourceVersion) if err != nil { return nil, err } key = path.Join(h.pathPrefix, key) - w := newEtcdWatcher(false, h.quorum, nil, storage.SimpleFilter(pred), h.codec, h.versioner, nil, h.transformer, h) + w := newEtcdWatcher(false, h.quorum, nil, pred, h.codec, h.versioner, nil, h.transformer, h) go w.etcdWatch(ctx, h.etcdKeysAPI, key, watchRV) return w, nil } @@ -250,12 +250,12 @@ func (h *etcdHelper) WatchList(ctx context.Context, key string, resourceVersion if ctx == nil { glog.Errorf("Context is nil") } - watchRV, err := storage.ParseWatchResourceVersion(resourceVersion) + watchRV, err := h.versioner.ParseWatchResourceVersion(resourceVersion) if err != nil { return nil, err } key = path.Join(h.pathPrefix, key) - w := newEtcdWatcher(true, h.quorum, exceptKey(key), storage.SimpleFilter(pred), h.codec, h.versioner, nil, h.transformer, h) + w := newEtcdWatcher(true, h.quorum, exceptKey(key), pred, h.codec, h.versioner, nil, h.transformer, h) go w.etcdWatch(ctx, h.etcdKeysAPI, key, watchRV) return w, nil } @@ -359,7 +359,7 @@ func (h *etcdHelper) GetToList(ctx context.Context, key string, resourceVersion nodes := make([]*etcd.Node, 0) nodes = append(nodes, response.Node) - if err := h.decodeNodeList(nodes, storage.SimpleFilter(pred), listPtr); err != nil { + if err := h.decodeNodeList(nodes, pred, listPtr); err != nil { return err } trace.Step("Object decoded") @@ -370,7 +370,7 @@ func (h *etcdHelper) GetToList(ctx context.Context, key string, resourceVersion } // decodeNodeList walks the tree of each node in the list and decodes into the specified object -func (h *etcdHelper) decodeNodeList(nodes []*etcd.Node, filter storage.FilterFunc, slicePtr interface{}) error { +func (h *etcdHelper) decodeNodeList(nodes []*etcd.Node, pred storage.SelectionPredicate, slicePtr interface{}) error { trace := utiltrace.New("decodeNodeList " + getTypeName(slicePtr)) defer trace.LogIfLong(400 * time.Millisecond) v, err := conversion.EnforcePtr(slicePtr) @@ -383,13 +383,13 @@ func (h *etcdHelper) decodeNodeList(nodes []*etcd.Node, filter storage.FilterFun // IMPORTANT: do not log each key as a discrete step in the trace log // as it produces an immense amount of log spam when there is a large // amount of content in the list. - if err := h.decodeNodeList(node.Nodes, filter, slicePtr); err != nil { + if err := h.decodeNodeList(node.Nodes, pred, slicePtr); err != nil { return err } continue } - if obj, found := h.getFromCache(node.ModifiedIndex, filter); found { - // obj != nil iff it matches the filter function. + if obj, found := h.getFromCache(node.ModifiedIndex, pred); found { + // obj != nil iff it matches the pred function. if obj != nil { v.Set(reflect.Append(v, reflect.ValueOf(obj).Elem())) } @@ -407,7 +407,7 @@ func (h *etcdHelper) decodeNodeList(nodes []*etcd.Node, filter storage.FilterFun } // being unable to set the version does not prevent the object from being extracted _ = h.versioner.UpdateObject(obj, node.ModifiedIndex) - if filter(obj) { + if matched, err := pred.Matches(obj); err == nil && matched { v.Set(reflect.Append(v, reflect.ValueOf(obj).Elem())) } if node.ModifiedIndex != 0 { @@ -439,7 +439,7 @@ func (h *etcdHelper) List(ctx context.Context, key string, resourceVersion strin if err != nil { return err } - if err := h.decodeNodeList(nodes, storage.SimpleFilter(pred), listPtr); err != nil { + if err := h.decodeNodeList(nodes, pred, listPtr); err != nil { return err } trace.Step("Node list decoded") @@ -586,11 +586,15 @@ func (h *etcdHelper) GuaranteedUpdate( } } +func (*etcdHelper) Count(pathPerfix string) (int64, error) { + return 0, fmt.Errorf("Count is unimplemented for etcd2!") +} + // etcdCache defines interface used for caching objects stored in etcd. Objects are keyed by // their Node.ModifiedIndex, which is unique across all types. // All implementations must be thread-safe. type etcdCache interface { - getFromCache(index uint64, filter storage.FilterFunc) (runtime.Object, bool) + getFromCache(index uint64, pred storage.SelectionPredicate) (runtime.Object, bool) addToCache(index uint64, obj runtime.Object) } @@ -598,14 +602,14 @@ func getTypeName(obj interface{}) string { return reflect.TypeOf(obj).String() } -func (h *etcdHelper) getFromCache(index uint64, filter storage.FilterFunc) (runtime.Object, bool) { +func (h *etcdHelper) getFromCache(index uint64, pred storage.SelectionPredicate) (runtime.Object, bool) { startTime := time.Now() defer func() { metrics.ObserveGetCache(startTime) }() obj, found := h.cache.Get(index) if found { - if !filter(obj.(runtime.Object)) { + if matched, err := pred.Matches(obj.(runtime.Object)); err != nil || !matched { return nil, true } // We should not return the object itself to avoid polluting the cache if someone diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_helper_test.go b/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_helper_test.go index dd33c8466..5ba57e487 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_helper_test.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_helper_test.go @@ -348,7 +348,7 @@ func TestGetNotFoundErr(t *testing.T) { var got example.Pod err := helper.Get(context.TODO(), boguskey, "", &got, false) if !storage.IsNotFound(err) { - t.Errorf("Unexpected reponse on key=%v, err=%v", boguskey, err) + t.Errorf("Unexpected response on key=%v, err=%v", boguskey, err) } } diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_watcher.go b/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_watcher.go index 1cd368bd8..7c300b430 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_watcher.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_watcher.go @@ -76,9 +76,9 @@ type etcdWatcher struct { valueTransformer ValueTransformer list bool // If we're doing a recursive watch, should be true. - quorum bool // If we enable quorum, shoule be true + quorum bool // If we enable quorum, should be true include includeFunc - filter storage.FilterFunc + pred storage.SelectionPredicate etcdIncoming chan *etcd.Response etcdError chan error @@ -105,11 +105,9 @@ const watchWaitDuration = 100 * time.Millisecond // newEtcdWatcher returns a new etcdWatcher; if list is true, watch sub-nodes. // The versioner must be able to handle the objects that transform creates. -func newEtcdWatcher( - list bool, quorum bool, include includeFunc, filter storage.FilterFunc, +func newEtcdWatcher(list bool, quorum bool, include includeFunc, pred storage.SelectionPredicate, encoding runtime.Codec, versioner storage.Versioner, transform TransformFunc, - valueTransformer ValueTransformer, - cache etcdCache) *etcdWatcher { + valueTransformer ValueTransformer, cache etcdCache) *etcdWatcher { w := &etcdWatcher{ encoding: encoding, versioner: versioner, @@ -119,7 +117,7 @@ func newEtcdWatcher( list: list, quorum: quorum, include: include, - filter: filter, + pred: pred, // Buffer this channel, so that the etcd client is not forced // to context switch with every object it gets, and so that a // long time spent decoding an object won't block the *next* @@ -315,7 +313,7 @@ func (w *etcdWatcher) translate() { // decodeObject extracts an object from the provided etcd node or returns an error. func (w *etcdWatcher) decodeObject(node *etcd.Node) (runtime.Object, error) { - if obj, found := w.cache.getFromCache(node.ModifiedIndex, storage.SimpleFilter(storage.Everything)); found { + if obj, found := w.cache.getFromCache(node.ModifiedIndex, storage.Everything); found { return obj, nil } @@ -365,7 +363,7 @@ func (w *etcdWatcher) sendAdd(res *etcd.Response) { // the resourceVersion to resume will never be able to get past a bad value. return } - if !w.filter(obj) { + if matched, err := w.pred.Matches(obj); err != nil || !matched { return } action := watch.Added @@ -391,7 +389,10 @@ func (w *etcdWatcher) sendModify(res *etcd.Response) { // the resourceVersion to resume will never be able to get past a bad value. return } - curObjPasses := w.filter(curObj) + curObjPasses := false + if matched, err := w.pred.Matches(curObj); err == nil && matched { + curObjPasses = true + } oldObjPasses := false var oldObj runtime.Object if res.PrevNode != nil && res.PrevNode.Value != "" { @@ -400,10 +401,12 @@ func (w *etcdWatcher) sendModify(res *etcd.Response) { if err := w.versioner.UpdateObject(oldObj, res.Node.ModifiedIndex); err != nil { utilruntime.HandleError(fmt.Errorf("failure to version api object (%d) %#v: %v", res.Node.ModifiedIndex, oldObj, err)) } - oldObjPasses = w.filter(oldObj) + if matched, err := w.pred.Matches(oldObj); err == nil && matched { + oldObjPasses = true + } } } - // Some changes to an object may cause it to start or stop matching a filter. + // Some changes to an object may cause it to start or stop matching a pred. // We need to report those as adds/deletes. So we have to check both the previous // and current value of the object. switch { @@ -423,7 +426,7 @@ func (w *etcdWatcher) sendModify(res *etcd.Response) { Object: oldObj, }) } - // Do nothing if neither new nor old object passed the filter. + // Do nothing if neither new nor old object passed the pred. } func (w *etcdWatcher) sendDelete(res *etcd.Response) { @@ -449,7 +452,7 @@ func (w *etcdWatcher) sendDelete(res *etcd.Response) { // the resourceVersion to resume will never be able to get past a bad value. return } - if !w.filter(obj) { + if matched, err := w.pred.Matches(obj); err != nil || !matched { return } w.emit(watch.Event{ diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_watcher_test.go b/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_watcher_test.go index aae3813a0..4c4d038dc 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_watcher_test.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd/etcd_watcher_test.go @@ -23,6 +23,8 @@ import ( apiequality "k8s.io/apimachinery/pkg/api/equality" apitesting "k8s.io/apimachinery/pkg/api/testing" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/watch" @@ -41,7 +43,7 @@ var versioner = APIObjectVersioner{} // Implements etcdCache interface as empty methods (i.e. does not cache any objects) type fakeEtcdCache struct{} -func (f *fakeEtcdCache) getFromCache(index uint64, filter storage.FilterFunc) (runtime.Object, bool) { +func (f *fakeEtcdCache) getFromCache(index uint64, pred storage.SelectionPredicate) (runtime.Object, bool) { return nil, false } @@ -58,7 +60,7 @@ func TestWatchInterpretations(t *testing.T) { podBar := &example.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}} podBaz := &example.Pod{ObjectMeta: metav1.ObjectMeta{Name: "baz"}} - // All of these test cases will be run with the firstLetterIsB Filter. + // All of these test cases will be run with the firstLetterIsB SelectionPredicate. table := map[string]struct { actions []string // Run this test item for every action here. prevNodeValue string @@ -128,8 +130,21 @@ func TestWatchInterpretations(t *testing.T) { expectEmit: false, }, } - firstLetterIsB := func(obj runtime.Object) bool { - return obj.(*example.Pod).Name[0] == 'b' + + // Should use fieldSelector here. + // But for the sake of tests (simplifying the codes), use labelSelector to support set-based requirements + selector, err := labels.Parse("metadata.name in (bar, baz)") + if err != nil { + t.Fatal(err) + } + firstLetterIsB := storage.SelectionPredicate{ + Label: selector, + Field: fields.Everything(), + IncludeUninitialized: true, + GetAttrs: func(obj runtime.Object) (labels.Set, fields.Set, bool, error) { + pod := obj.(*example.Pod) + return labels.Set{"metadata.name": pod.Name}, nil, pod.Initializers != nil, nil + }, } for name, item := range table { for _, action := range item.actions { @@ -173,7 +188,7 @@ func TestWatchInterpretations(t *testing.T) { func TestWatchInterpretation_ResponseNotSet(t *testing.T) { _, codecs := testScheme(t) codec := codecs.LegacyCodec(schema.GroupVersion{Version: "v1"}) - w := newEtcdWatcher(false, false, nil, storage.SimpleFilter(storage.Everything), codec, versioner, nil, prefixTransformer{prefix: "test!"}, &fakeEtcdCache{}) + w := newEtcdWatcher(false, false, nil, storage.Everything, codec, versioner, nil, prefixTransformer{prefix: "test!"}, &fakeEtcdCache{}) w.emit = func(e watch.Event) { t.Errorf("Unexpected emit: %v", e) } @@ -189,7 +204,7 @@ func TestWatchInterpretation_ResponseNoNode(t *testing.T) { codec := codecs.LegacyCodec(schema.GroupVersion{Version: "v1"}) actions := []string{"create", "set", "compareAndSwap", "delete"} for _, action := range actions { - w := newEtcdWatcher(false, false, nil, storage.SimpleFilter(storage.Everything), codec, versioner, nil, prefixTransformer{prefix: "test!"}, &fakeEtcdCache{}) + w := newEtcdWatcher(false, false, nil, storage.Everything, codec, versioner, nil, prefixTransformer{prefix: "test!"}, &fakeEtcdCache{}) w.emit = func(e watch.Event) { t.Errorf("Unexpected emit: %v", e) } @@ -205,7 +220,7 @@ func TestWatchInterpretation_ResponseBadData(t *testing.T) { codec := codecs.LegacyCodec(schema.GroupVersion{Version: "v1"}) actions := []string{"create", "set", "compareAndSwap", "delete"} for _, action := range actions { - w := newEtcdWatcher(false, false, nil, storage.SimpleFilter(storage.Everything), codec, versioner, nil, prefixTransformer{prefix: "test!"}, &fakeEtcdCache{}) + w := newEtcdWatcher(false, false, nil, storage.Everything, codec, versioner, nil, prefixTransformer{prefix: "test!"}, &fakeEtcdCache{}) w.emit = func(e watch.Event) { t.Errorf("Unexpected emit: %v", e) } @@ -228,10 +243,17 @@ func TestWatchInterpretation_ResponseBadData(t *testing.T) { func TestSendResultDeleteEventHaveLatestIndex(t *testing.T) { _, codecs := testScheme(t) codec := apitesting.TestCodec(codecs, examplev1.SchemeGroupVersion) - filter := func(obj runtime.Object) bool { - return obj.(*example.Pod).Name != "bar" + selector, _ := fields.ParseSelector("metadata.name!=bar") + pred := storage.SelectionPredicate{ + Label: labels.Everything(), + Field: selector, + IncludeUninitialized: true, + GetAttrs: func(obj runtime.Object) (labels.Set, fields.Set, bool, error) { + pod := obj.(*example.Pod) + return nil, fields.Set{"metadata.name": pod.Name}, pod.Initializers != nil, nil + }, } - w := newEtcdWatcher(false, false, nil, filter, codec, versioner, nil, prefixTransformer{prefix: "test!"}, &fakeEtcdCache{}) + w := newEtcdWatcher(false, false, nil, pred, codec, versioner, nil, prefixTransformer{prefix: "test!"}, &fakeEtcdCache{}) eventChan := make(chan watch.Event, 1) w.emit = func(e watch.Event) { diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd/metrics/metrics.go b/vendor/k8s.io/apiserver/pkg/storage/etcd/metrics/metrics.go index 12c11eaf9..96385f6e6 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd/metrics/metrics.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd/metrics/metrics.go @@ -59,6 +59,13 @@ var ( }, []string{"operation", "type"}, ) + objectCounts = prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Name: "etcd_object_counts", + Help: "Number of stored objects at the time of last check split by kind.", + }, + []string{"resource"}, + ) ) var registerMetrics sync.Once @@ -73,9 +80,14 @@ func Register() { prometheus.MustRegister(cacheAddLatency) prometheus.MustRegister(cacheGetLatency) prometheus.MustRegister(etcdRequestLatenciesSummary) + prometheus.MustRegister(objectCounts) }) } +func UpdateObjectCount(resourcePrefix string, count int64) { + objectCounts.WithLabelValues(resourcePrefix).Set(float64(count)) +} + func RecordEtcdRequestLatency(verb, resource string, startTime time.Time) { etcdRequestLatenciesSummary.WithLabelValues(verb, resource).Observe(float64(time.Since(startTime) / time.Microsecond)) } diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd/testing/BUILD b/vendor/k8s.io/apiserver/pkg/storage/etcd/testing/BUILD index ac48442e5..5d495404c 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd/testing/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd/testing/BUILD @@ -13,6 +13,7 @@ go_library( "//vendor/github.com/coreos/etcd/client:go_default_library", "//vendor/github.com/coreos/etcd/clientv3:go_default_library", "//vendor/github.com/coreos/etcd/etcdserver:go_default_library", + "//vendor/github.com/coreos/etcd/etcdserver/api/etcdhttp:go_default_library", "//vendor/github.com/coreos/etcd/etcdserver/api/v2http:go_default_library", "//vendor/github.com/coreos/etcd/integration:go_default_library", "//vendor/github.com/coreos/etcd/pkg/testutil:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd/testing/utils.go b/vendor/k8s.io/apiserver/pkg/storage/etcd/testing/utils.go index 6ab310b60..665662aaf 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd/testing/utils.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd/testing/utils.go @@ -35,6 +35,7 @@ import ( etcd "github.com/coreos/etcd/client" "github.com/coreos/etcd/clientv3" "github.com/coreos/etcd/etcdserver" + "github.com/coreos/etcd/etcdserver/api/etcdhttp" "github.com/coreos/etcd/etcdserver/api/v2http" "github.com/coreos/etcd/integration" "github.com/coreos/etcd/pkg/testutil" @@ -163,6 +164,7 @@ func configureTestCluster(t *testing.T, name string, https bool) *EtcdTestServer } } + m.AuthToken = "simple" m.Name = name m.DataDir, err = ioutil.TempDir(baseDir, "etcd") if err != nil { @@ -189,9 +191,9 @@ func (m *EtcdTestServer) launch(t *testing.T) error { if m.s, err = etcdserver.NewServer(&m.ServerConfig); err != nil { return fmt.Errorf("failed to initialize the etcd server: %v", err) } - m.s.SyncTicker = time.Tick(500 * time.Millisecond) + m.s.SyncTicker = time.NewTicker(500 * time.Millisecond) m.s.Start() - m.raftHandler = &testutil.PauseableHandler{Next: v2http.NewPeerHandler(m.s)} + m.raftHandler = &testutil.PauseableHandler{Next: etcdhttp.NewPeerHandler(m.s)} for _, ln := range m.PeerListeners { hs := &httptest.Server{ Listener: ln, @@ -283,32 +285,6 @@ func NewEtcdTestClientServer(t *testing.T) *EtcdTestServer { return server } -// NewUnsecuredEtcdTestClientServer DEPRECATED creates a new client and server for testing -func NewUnsecuredEtcdTestClientServer(t *testing.T) *EtcdTestServer { - server := configureTestCluster(t, "foo", false) - err := server.launch(t) - if err != nil { - t.Fatalf("Failed to start etcd server error=%v", err) - return nil - } - cfg := etcd.Config{ - Endpoints: server.ClientURLs.StringSlice(), - Transport: newHttpTransport(t, server.CertFile, server.KeyFile, server.CAFile), - } - server.Client, err = etcd.New(cfg) - if err != nil { - t.Errorf("Unexpected error in NewUnsecuredEtcdTestClientServer (%v)", err) - server.Terminate(t) - return nil - } - if err := server.waitUntilUp(); err != nil { - t.Errorf("Unexpected error in waitUntilUp (%v)", err) - server.Terminate(t) - return nil - } - return server -} - // NewEtcd3TestClientServer creates a new client and server for testing func NewUnsecuredEtcd3TestClientServer(t *testing.T) (*EtcdTestServer, *storagebackend.Config) { server := &EtcdTestServer{ diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd/util/BUILD b/vendor/k8s.io/apiserver/pkg/storage/etcd/util/BUILD index f1405e872..a0ad4fc56 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd/util/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd/util/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["etcd_util_test.go"], - importpath = "k8s.io/apiserver/pkg/storage/etcd/util", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/coreos/etcd/client:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/BUILD b/vendor/k8s.io/apiserver/pkg/storage/etcd3/BUILD index 0b7c4311f..29f789950 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/BUILD @@ -13,8 +13,7 @@ go_test( "store_test.go", "watcher_test.go", ], - importpath = "k8s.io/apiserver/pkg/storage/etcd3", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/coreos/etcd/clientv3:go_default_library", "//vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/preflight/BUILD b/vendor/k8s.io/apiserver/pkg/storage/etcd3/preflight/BUILD index 864a1141d..7b8cb68dd 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/preflight/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/preflight/BUILD @@ -15,8 +15,7 @@ go_library( go_test( name = "go_default_test", srcs = ["checks_test.go"], - importpath = "k8s.io/apiserver/pkg/storage/etcd3/preflight", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go b/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go index 2350a5526..c83965b09 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go @@ -24,7 +24,6 @@ import ( "fmt" "path" "reflect" - "strconv" "strings" "time" @@ -332,13 +331,16 @@ func (s *store) GuaranteedUpdate( if err != nil { return err } + mustCheckData = false if !bytes.Equal(data, origState.data) { // original data changed, restart loop - mustCheckData = false continue } } - return decode(s.codec, s.versioner, origState.data, out, origState.rev) + // recheck that the data from etcd is not stale before short-circuiting a write + if !origState.stale { + return decode(s.codec, s.versioner, origState.data, out, origState.rev) + } } newData, err := s.transformer.TransformToStorage(data, transformContext) @@ -403,13 +405,22 @@ func (s *store) GetToList(ctx context.Context, key string, resourceVersion strin if err != nil || v.Kind() != reflect.Slice { panic("need ptr to slice") } - if err := appendListItem(v, data, uint64(getResp.Kvs[0].ModRevision), storage.SimpleFilter(pred), s.codec, s.versioner); err != nil { + if err := appendListItem(v, data, uint64(getResp.Kvs[0].ModRevision), pred, s.codec, s.versioner); err != nil { return err } // update version with cluster level revision return s.versioner.UpdateList(listObj, uint64(getResp.Header.Revision), "") } +func (s *store) Count(key string) (int64, error) { + key = path.Join(s.pathPrefix, key) + getResp, err := s.client.KV.Get(context.Background(), key, clientv3.WithRange(clientv3.GetPrefixRangeEnd(key)), clientv3.WithCountOnly()) + if err != nil { + return 0, err + } + return getResp.Count, nil +} + // continueToken is a simple structured object for encoding the state of a continue token. // TODO: if we change the version of the encoded from, we can't start encoding the new version // until all other servers are upgraded (i.e. we need to support rolling schema) @@ -492,8 +503,6 @@ func (s *store) List(ctx context.Context, key, resourceVersion string, pred stor } keyPrefix := key - filter := storage.SimpleFilter(pred) - // set the appropriate clientv3 options to filter the returned data set var paging bool options := make([]clientv3.OpOption, 0, 4) @@ -523,14 +532,14 @@ func (s *store) List(ctx context.Context, key, resourceVersion string, pred stor case s.pagingEnabled && pred.Limit > 0: if len(resourceVersion) > 0 { - fromRV, err := strconv.ParseInt(resourceVersion, 10, 64) + fromRV, err := s.versioner.ParseListResourceVersion(resourceVersion) if err != nil { return apierrors.NewBadRequest(fmt.Sprintf("invalid resource version: %v", err)) } if fromRV > 0 { - options = append(options, clientv3.WithRev(fromRV)) + options = append(options, clientv3.WithRev(int64(fromRV))) } - returnedRV = fromRV + returnedRV = int64(fromRV) } rangeEnd := clientv3.GetPrefixRangeEnd(keyPrefix) @@ -538,14 +547,14 @@ func (s *store) List(ctx context.Context, key, resourceVersion string, pred stor default: if len(resourceVersion) > 0 { - fromRV, err := strconv.ParseInt(resourceVersion, 10, 64) + fromRV, err := s.versioner.ParseListResourceVersion(resourceVersion) if err != nil { return apierrors.NewBadRequest(fmt.Sprintf("invalid resource version: %v", err)) } if fromRV > 0 { - options = append(options, clientv3.WithRev(fromRV)) + options = append(options, clientv3.WithRev(int64(fromRV))) } - returnedRV = fromRV + returnedRV = int64(fromRV) } options = append(options, clientv3.WithPrefix()) @@ -587,7 +596,7 @@ func (s *store) List(ctx context.Context, key, resourceVersion string, pred stor continue } - if err := appendListItem(v, data, uint64(kv.ModRevision), filter, s.codec, s.versioner); err != nil { + if err := appendListItem(v, data, uint64(kv.ModRevision), pred, s.codec, s.versioner); err != nil { return err } } @@ -665,7 +674,7 @@ func (s *store) WatchList(ctx context.Context, key string, resourceVersion strin } func (s *store) watch(ctx context.Context, key string, rv string, pred storage.SelectionPredicate, recursive bool) (watch.Interface, error) { - rev, err := storage.ParseWatchResourceVersion(rv) + rev, err := s.versioner.ParseWatchResourceVersion(rv) if err != nil { return nil, err } @@ -774,14 +783,14 @@ func decode(codec runtime.Codec, versioner storage.Versioner, value []byte, objP } // appendListItem decodes and appends the object (if it passes filter) to v, which must be a slice. -func appendListItem(v reflect.Value, data []byte, rev uint64, filter storage.FilterFunc, codec runtime.Codec, versioner storage.Versioner) error { +func appendListItem(v reflect.Value, data []byte, rev uint64, pred storage.SelectionPredicate, codec runtime.Codec, versioner storage.Versioner) error { obj, _, err := codec.Decode(data, nil, reflect.New(v.Type().Elem()).Interface().(runtime.Object)) if err != nil { return err } // being unable to set the version does not prevent the object from being extracted versioner.UpdateObject(obj, rev) - if filter(obj) { + if matched, err := pred.Matches(obj); err == nil && matched { v.Set(reflect.Append(v, reflect.ValueOf(obj).Elem())) } return nil diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/store_test.go b/vendor/k8s.io/apiserver/pkg/storage/etcd3/store_test.go index d7c7f0f10..d5937a9dc 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/store_test.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/store_test.go @@ -526,6 +526,8 @@ func TestGuaranteedUpdateChecksStoredData(t *testing.T) { t.Fatal(err) } + store.transformer = prefixTransformer{prefix: []byte(defaultTestPrefix)} + // this update should write the canonical value to etcd because the new serialization differs // from the stored serialization input.ResourceVersion = strconv.FormatInt(resp.Header.Revision, 10) @@ -540,6 +542,36 @@ func TestGuaranteedUpdateChecksStoredData(t *testing.T) { if out.ResourceVersion == strconv.FormatInt(resp.Header.Revision, 10) { t.Errorf("guaranteed update should have updated the serialized data, got %#v", out) } + + lastVersion := out.ResourceVersion + + // this update should not write to etcd because the input matches the stored data + input = out + out = &example.Pod{} + err = store.GuaranteedUpdate(ctx, key, out, true, nil, + func(_ runtime.Object, _ storage.ResponseMeta) (runtime.Object, *uint64, error) { + return input, nil, nil + }, input) + if err != nil { + t.Fatalf("Update failed: %v", err) + } + if out.ResourceVersion != lastVersion { + t.Errorf("guaranteed update should have short-circuited write, got %#v", out) + } + + store.transformer = prefixTransformer{prefix: []byte(defaultTestPrefix), stale: true} + + // this update should write to etcd because the transformer reported stale + err = store.GuaranteedUpdate(ctx, key, out, true, nil, + func(_ runtime.Object, _ storage.ResponseMeta) (runtime.Object, *uint64, error) { + return input, nil, nil + }, input) + if err != nil { + t.Fatalf("Update failed: %v", err) + } + if out.ResourceVersion == lastVersion { + t.Errorf("guaranteed update should have written to etcd when transformer reported stale, got %#v", out) + } } func TestGuaranteedUpdateWithConflict(t *testing.T) { @@ -1154,14 +1186,14 @@ func testSetup(t *testing.T) (context.Context, *store, *integration.ClusterV3) { return ctx, store, cluster } -// testPropogateStore helps propogates store with objects, automates key generation, and returns +// testPropogateStore helps propagates store with objects, automates key generation, and returns // keys and stored objects. func testPropogateStore(ctx context.Context, t *testing.T, store *store, obj *example.Pod) (string, *example.Pod) { // Setup store with a key and grab the output for returning. key := "/testkey" err := store.unconditionalDelete(ctx, key, &example.Pod{}) if err != nil && !storage.IsNotFound(err) { - t.Fatal("Cleanup failed: %v", err) + t.Fatalf("Cleanup failed: %v", err) } setOutput := &example.Pod{} if err := store.Create(ctx, key, obj, setOutput, 0); err != nil { diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go b/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go index 366e161cf..38aae2f1f 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go @@ -72,7 +72,7 @@ type watchChan struct { key string initialRev int64 recursive bool - internalFilter storage.FilterFunc + internalPred storage.SelectionPredicate ctx context.Context cancel context.CancelFunc incomingEventChan chan *event @@ -111,14 +111,14 @@ func (w *watcher) createWatchChan(ctx context.Context, key string, rev int64, re key: key, initialRev: rev, recursive: recursive, - internalFilter: storage.SimpleFilter(pred), + internalPred: pred, incomingEventChan: make(chan *event, incomingBufSize), resultChan: make(chan watch.Event, outgoingBufSize), errChan: make(chan error, 1), } if pred.Empty() { // The filter doesn't filter out any object. - wc.internalFilter = nil + wc.internalPred = storage.Everything } wc.ctx, wc.cancel = context.WithCancel(ctx) return wc @@ -250,14 +250,15 @@ func (wc *watchChan) processEvent(wg *sync.WaitGroup) { } func (wc *watchChan) filter(obj runtime.Object) bool { - if wc.internalFilter == nil { + if wc.internalPred.Empty() { return true } - return wc.internalFilter(obj) + matched, err := wc.internalPred.Matches(obj) + return err == nil && matched } func (wc *watchChan) acceptAll() bool { - return wc.internalFilter == nil + return wc.internalPred.Empty() } // transform transforms an event into a result for user if not filtered. diff --git a/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher_test.go b/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher_test.go index 8c885c60f..6f01c4bd7 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher_test.go +++ b/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher_test.go @@ -19,7 +19,6 @@ package etcd3 import ( "fmt" "reflect" - "strconv" "sync" "testing" "time" @@ -186,7 +185,7 @@ func TestWatchFromZero(t *testing.T) { } // Compact previous versions - revToCompact, err := strconv.Atoi(out.ResourceVersion) + revToCompact, err := store.versioner.ParseListResourceVersion(out.ResourceVersion) if err != nil { t.Fatalf("Error converting %q to an int: %v", storedObj.ResourceVersion, err) } @@ -305,7 +304,7 @@ func TestWatchDeleteEventObjectHaveLatestRV(t *testing.T) { var wres clientv3.WatchResponse wres = <-etcdW - watchedDeleteRev, err := storage.ParseWatchResourceVersion(watchedDeleteObj.ResourceVersion) + watchedDeleteRev, err := store.versioner.ParseWatchResourceVersion(watchedDeleteObj.ResourceVersion) if err != nil { t.Fatalf("ParseWatchResourceVersion failed: %v", err) } diff --git a/vendor/k8s.io/apiserver/pkg/storage/interfaces.go b/vendor/k8s.io/apiserver/pkg/storage/interfaces.go index 0d81f05c3..6241533be 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/interfaces.go +++ b/vendor/k8s.io/apiserver/pkg/storage/interfaces.go @@ -28,7 +28,9 @@ import ( // Versioner abstracts setting and retrieving metadata fields from database response // onto the object ot list. It is required to maintain storage invariants - updating an // object twice with the same data except for the ResourceVersion and SelfLink must be -// a no-op. +// a no-op. A resourceVersion of type uint64 is a 'raw' resourceVersion, +// intended to be sent directly to or from the backend. A resourceVersion of +// type string is a 'safe' resourceVersion, intended for consumption by users. type Versioner interface { // UpdateObject sets storage metadata into an API object. Returns an error if the object // cannot be updated correctly. May return nil if the requested object does not need metadata @@ -45,6 +47,17 @@ type Versioner interface { // ObjectResourceVersion returns the resource version (for persistence) of the specified object. // Should return an error if the specified object does not have a persistable version. ObjectResourceVersion(obj runtime.Object) (uint64, error) + + // ParseWatchResourceVersion takes a resource version argument and + // converts it to the storage backend we should pass to helper.Watch(). + // Because resourceVersion is an opaque value, the default watch + // behavior for non-zero watch is to watch the next value (if you pass + // "1", you will see updates from "2" onwards). + ParseWatchResourceVersion(resourceVersion string) (uint64, error) + // ParseListResourceVersion takes a resource version argument and + // converts it to the storage backend version. Appropriate for + // everything that's not intended as an argument for watch. + ParseListResourceVersion(resourceVersion string) (uint64, error) } // ResponseMeta contains information about the database metadata that is associated with @@ -70,10 +83,6 @@ type MatchValue struct { // to that function. type TriggerPublisherFunc func(obj runtime.Object) []MatchValue -// FilterFunc takes an API object and returns true if the object satisfies some requirements. -// TODO: We will remove this type and use SelectionPredicate everywhere. -type FilterFunc func(obj runtime.Object) bool - // Everything accepts all objects. var Everything = SelectionPredicate{ Label: labels.Everything(), @@ -186,4 +195,7 @@ type Interface interface { GuaranteedUpdate( ctx context.Context, key string, ptrToType runtime.Object, ignoreNotFound bool, precondtions *Preconditions, tryUpdate UpdateFunc, suggestion ...runtime.Object) error + + // Count returns number of different entries under the key (generally being path prefix). + Count(key string) (int64, error) } diff --git a/vendor/k8s.io/apiserver/pkg/storage/names/BUILD b/vendor/k8s.io/apiserver/pkg/storage/names/BUILD index 4e7511282..0accf5b7b 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/names/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/names/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["generate_test.go"], - importpath = "k8s.io/apiserver/pkg/storage/names", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/apiserver/pkg/storage/selection_predicate.go b/vendor/k8s.io/apiserver/pkg/storage/selection_predicate.go index 83e423a97..9c8c3d599 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/selection_predicate.go +++ b/vendor/k8s.io/apiserver/pkg/storage/selection_predicate.go @@ -96,7 +96,7 @@ func (s *SelectionPredicate) Matches(obj runtime.Object) (bool, error) { } matched := s.Label.Matches(labels) if matched && s.Field != nil { - matched = (matched && s.Field.Matches(fields)) + matched = matched && s.Field.Matches(fields) } return matched, nil } diff --git a/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go b/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go index b725985f6..8d7ecf37c 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go +++ b/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go @@ -62,6 +62,9 @@ type Config struct { // CompactionInterval is an interval of requesting compaction from apiserver. // If the value is 0, no compaction will be issued. CompactionInterval time.Duration + + // CountMetricPollPeriod specifies how often should count metric be updated + CountMetricPollPeriod time.Duration } func NewDefaultConfig(prefix string, codec runtime.Codec) *Config { diff --git a/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/BUILD b/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/BUILD index 474d89903..9b6666c8c 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["tls_test.go"], - importpath = "k8s.io/apiserver/pkg/storage/storagebackend/factory", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/coreos/etcd/integration:go_default_library", "//vendor/github.com/coreos/etcd/pkg/transport:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go b/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go index a5ccbf2fd..48bba7311 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go +++ b/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go @@ -17,6 +17,8 @@ limitations under the License. package factory import ( + "time" + "github.com/coreos/etcd/clientv3" "github.com/coreos/etcd/pkg/transport" "golang.org/x/net/context" @@ -27,6 +29,13 @@ import ( "k8s.io/apiserver/pkg/storage/value" ) +// The short keepalive timeout and interval have been chosen to aggressively +// detect a failed etcd server without introducing much overhead. +var ( + keepaliveTime = 30 * time.Second + keepaliveTimeout = 10 * time.Second +) + func newETCD3Storage(c storagebackend.Config) (storage.Interface, DestroyFunc, error) { tlsInfo := transport.TLSInfo{ CertFile: c.CertFile, @@ -43,8 +52,10 @@ func newETCD3Storage(c storagebackend.Config) (storage.Interface, DestroyFunc, e tlsConfig = nil } cfg := clientv3.Config{ - Endpoints: c.ServerList, - TLS: tlsConfig, + DialKeepAliveTime: keepaliveTime, + DialKeepAliveTimeout: keepaliveTimeout, + Endpoints: c.ServerList, + TLS: tlsConfig, } client, err := clientv3.New(cfg) if err != nil { diff --git a/vendor/k8s.io/apiserver/pkg/storage/testing/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/storage/testing/zz_generated.deepcopy.go index 464b48c60..6ee90a90b 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/testing/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/storage/testing/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package testing @@ -46,7 +46,6 @@ func (in *TestResource) DeepCopy() *TestResource { func (in *TestResource) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } diff --git a/vendor/k8s.io/apiserver/pkg/storage/tests/BUILD b/vendor/k8s.io/apiserver/pkg/storage/tests/BUILD index d1ac96083..856068439 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/tests/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/tests/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["cacher_test.go"], - importpath = "k8s.io/apiserver/pkg/storage/tests", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/storage/tests/cacher_test.go b/vendor/k8s.io/apiserver/pkg/storage/tests/cacher_test.go index b900babf1..ed16f5b51 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/tests/cacher_test.go +++ b/vendor/k8s.io/apiserver/pkg/storage/tests/cacher_test.go @@ -97,12 +97,13 @@ func newEtcdTestStorage(t *testing.T, prefix string) (*etcdtesting.EtcdTestServe return server, storage } -func newTestCacher(s storage.Interface, cap int) *storage.Cacher { +func newTestCacher(s storage.Interface, cap int) (*storage.Cacher, storage.Versioner) { prefix := "pods" + v := etcdstorage.APIObjectVersioner{} config := storage.CacherConfig{ CacheCapacity: cap, Storage: s, - Versioner: etcdstorage.APIObjectVersioner{}, + Versioner: v, Type: &example.Pod{}, ResourcePrefix: prefix, KeyFunc: func(obj runtime.Object) (string, error) { return storage.NamespaceKeyFunc(prefix, obj) }, @@ -110,7 +111,7 @@ func newTestCacher(s storage.Interface, cap int) *storage.Cacher { NewListFunc: func() runtime.Object { return &example.PodList{} }, Codec: codecs.LegacyCodec(examplev1.SchemeGroupVersion), } - return storage.NewCacherFromConfig(config) + return storage.NewCacherFromConfig(config), v } func makeTestPod(name string) *example.Pod { @@ -139,7 +140,7 @@ func updatePod(t *testing.T, s storage.Interface, obj, old *example.Pod) *exampl func TestGet(t *testing.T) { server, etcdStorage := newEtcdTestStorage(t, etcdtest.PathPrefix()) defer server.Terminate(t) - cacher := newTestCacher(etcdStorage, 10) + cacher, _ := newTestCacher(etcdStorage, 10) defer cacher.Stop() podFoo := makeTestPod("foo") @@ -170,7 +171,7 @@ func TestGet(t *testing.T) { func TestList(t *testing.T) { server, etcdStorage := newEtcdTestStorage(t, etcdtest.PathPrefix()) defer server.Terminate(t) - cacher := newTestCacher(etcdStorage, 10) + cacher, _ := newTestCacher(etcdStorage, 10) defer cacher.Stop() podFoo := makeTestPod("foo") @@ -251,14 +252,14 @@ func TestList(t *testing.T) { func TestInfiniteList(t *testing.T) { server, etcdStorage := newEtcdTestStorage(t, etcdtest.PathPrefix()) defer server.Terminate(t) - cacher := newTestCacher(etcdStorage, 10) + cacher, v := newTestCacher(etcdStorage, 10) defer cacher.Stop() podFoo := makeTestPod("foo") fooCreated := updatePod(t, etcdStorage, podFoo, nil) // Set up List at fooCreated.ResourceVersion + 10 - rv, err := storage.ParseWatchResourceVersion(fooCreated.ResourceVersion) + rv, err := v.ParseWatchResourceVersion(fooCreated.ResourceVersion) if err != nil { t.Fatalf("Unexpected error: %v", err) } @@ -307,7 +308,7 @@ func TestWatch(t *testing.T) { // Inject one list error to make sure we test the relist case. etcdStorage = &injectListError{errors: 1, Interface: etcdStorage} defer server.Terminate(t) - cacher := newTestCacher(etcdStorage, 3) // small capacity to trigger "too old version" error + cacher, _ := newTestCacher(etcdStorage, 3) // small capacity to trigger "too old version" error defer cacher.Stop() podFoo := makeTestPod("foo") @@ -382,7 +383,7 @@ func TestWatch(t *testing.T) { func TestWatcherTimeout(t *testing.T) { server, etcdStorage := newEtcdTestStorage(t, etcdtest.PathPrefix()) defer server.Terminate(t) - cacher := newTestCacher(etcdStorage, 10) + cacher, _ := newTestCacher(etcdStorage, 10) defer cacher.Stop() // initialVersion is used to initate the watcher at the beginning of the world, @@ -424,7 +425,7 @@ func TestWatcherTimeout(t *testing.T) { func TestFiltering(t *testing.T) { server, etcdStorage := newEtcdTestStorage(t, etcdtest.PathPrefix()) defer server.Terminate(t) - cacher := newTestCacher(etcdStorage, 10) + cacher, _ := newTestCacher(etcdStorage, 10) defer cacher.Stop() // Ensure that the cacher is initialized, before creating any pods, @@ -486,7 +487,7 @@ func TestFiltering(t *testing.T) { func TestStartingResourceVersion(t *testing.T) { server, etcdStorage := newEtcdTestStorage(t, etcdtest.PathPrefix()) defer server.Terminate(t) - cacher := newTestCacher(etcdStorage, 10) + cacher, v := newTestCacher(etcdStorage, 10) defer cacher.Stop() // add 1 object @@ -494,7 +495,7 @@ func TestStartingResourceVersion(t *testing.T) { fooCreated := updatePod(t, etcdStorage, podFoo, nil) // Set up Watch starting at fooCreated.ResourceVersion + 10 - rv, err := storage.ParseWatchResourceVersion(fooCreated.ResourceVersion) + rv, err := v.ParseWatchResourceVersion(fooCreated.ResourceVersion) if err != nil { t.Fatalf("Unexpected error: %v", err) } @@ -517,7 +518,7 @@ func TestStartingResourceVersion(t *testing.T) { select { case e := <-watcher.ResultChan(): pod := e.Object.(*example.Pod) - podRV, err := storage.ParseWatchResourceVersion(pod.ResourceVersion) + podRV, err := v.ParseWatchResourceVersion(pod.ResourceVersion) if err != nil { t.Fatalf("unexpected error: %v", err) } @@ -544,15 +545,15 @@ func TestEmptyWatchEventCache(t *testing.T) { fooCreated := updatePod(t, etcdStorage, makeTestPod("foo"), nil) + cacher, v := newTestCacher(etcdStorage, 10) + defer cacher.Stop() + // get rv of last pod created - rv, err := storage.ParseWatchResourceVersion(fooCreated.ResourceVersion) + rv, err := v.ParseWatchResourceVersion(fooCreated.ResourceVersion) if err != nil { t.Fatalf("Unexpected error: %v", err) } - cacher := newTestCacher(etcdStorage, 10) - defer cacher.Stop() - // We now have a cacher with an empty cache of watch events and a resourceVersion of rv. // It should support establishing watches from rv and higher, but not older. @@ -598,11 +599,11 @@ func TestEmptyWatchEventCache(t *testing.T) { func TestRandomWatchDeliver(t *testing.T) { server, etcdStorage := newEtcdTestStorage(t, etcdtest.PathPrefix()) defer server.Terminate(t) - cacher := newTestCacher(etcdStorage, 10) + cacher, v := newTestCacher(etcdStorage, 10) defer cacher.Stop() fooCreated := updatePod(t, etcdStorage, makeTestPod("foo"), nil) - rv, err := storage.ParseWatchResourceVersion(fooCreated.ResourceVersion) + rv, err := v.ParseWatchResourceVersion(fooCreated.ResourceVersion) if err != nil { t.Fatalf("Unexpected error: %v", err) } diff --git a/vendor/k8s.io/apiserver/pkg/storage/util.go b/vendor/k8s.io/apiserver/pkg/storage/util.go index 3e0b7211b..9d437d062 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/util.go +++ b/vendor/k8s.io/apiserver/pkg/storage/util.go @@ -18,16 +18,12 @@ package storage import ( "fmt" - "strconv" "strings" "sync/atomic" - "github.com/golang/glog" - "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/validation/path" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" ) type SimpleUpdateFunc func(runtime.Object) (runtime.Object, error) @@ -40,19 +36,6 @@ func SimpleUpdate(fn SimpleUpdateFunc) UpdateFunc { } } -// SimpleFilter converts a selection predicate into a FilterFunc. -// It ignores any error from Matches(). -func SimpleFilter(p SelectionPredicate) FilterFunc { - return func(obj runtime.Object) bool { - matches, err := p.Matches(obj) - if err != nil { - glog.Errorf("invalid object for matching. Obj: %v. Err: %v", obj, err) - return false - } - return matches - } -} - func EverythingFunc(runtime.Object) bool { return true } @@ -65,35 +48,6 @@ func NoTriggerPublisher(runtime.Object) []MatchValue { return nil } -// ParseWatchResourceVersion takes a resource version argument and converts it to -// the etcd version we should pass to helper.Watch(). Because resourceVersion is -// an opaque value, the default watch behavior for non-zero watch is to watch -// the next value (if you pass "1", you will see updates from "2" onwards). -func ParseWatchResourceVersion(resourceVersion string) (uint64, error) { - if resourceVersion == "" || resourceVersion == "0" { - return 0, nil - } - version, err := strconv.ParseUint(resourceVersion, 10, 64) - if err != nil { - return 0, NewInvalidError(field.ErrorList{ - // Validation errors are supposed to return version-specific field - // paths, but this is probably close enough. - field.Invalid(field.NewPath("resourceVersion"), resourceVersion, err.Error()), - }) - } - return version, nil -} - -// ParseListResourceVersion takes a resource version argument and converts it to -// the etcd version. -func ParseListResourceVersion(resourceVersion string) (uint64, error) { - if resourceVersion == "" { - return 0, nil - } - version, err := strconv.ParseUint(resourceVersion, 10, 64) - return version, err -} - func NamespaceKeyFunc(prefix string, obj runtime.Object) (string, error) { meta, err := meta.Accessor(obj) if err != nil { diff --git a/vendor/k8s.io/apiserver/pkg/storage/util_test.go b/vendor/k8s.io/apiserver/pkg/storage/util_test.go index 6eba9b499..c2eef2e5a 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/util_test.go +++ b/vendor/k8s.io/apiserver/pkg/storage/util_test.go @@ -22,40 +22,6 @@ import ( "testing" ) -func TestEtcdParseWatchResourceVersion(t *testing.T) { - testCases := []struct { - Version string - ExpectVersion uint64 - Err bool - }{ - {Version: "", ExpectVersion: 0}, - {Version: "a", Err: true}, - {Version: " ", Err: true}, - {Version: "1", ExpectVersion: 1}, - {Version: "10", ExpectVersion: 10}, - } - for _, testCase := range testCases { - version, err := ParseWatchResourceVersion(testCase.Version) - switch { - case testCase.Err: - if err == nil { - t.Errorf("%s: unexpected non-error", testCase.Version) - continue - } - if !IsInvalidError(err) { - t.Errorf("%s: unexpected error: %v", testCase.Version, err) - continue - } - case !testCase.Err && err != nil: - t.Errorf("%s: unexpected error: %v", testCase.Version, err) - continue - } - if version != testCase.ExpectVersion { - t.Errorf("%s: expected version %d but was %d", testCase.Version, testCase.ExpectVersion, version) - } - } -} - func TestHasPathPrefix(t *testing.T) { validTestcases := []struct { s string diff --git a/vendor/k8s.io/apiserver/pkg/storage/value/BUILD b/vendor/k8s.io/apiserver/pkg/storage/value/BUILD index 22d5ec176..2e132c760 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/value/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/value/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["transformer_test.go"], - importpath = "k8s.io/apiserver/pkg/storage/value", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/BUILD b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/BUILD index 4c3bc7a87..920e6fa2b 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["aes_test.go"], - importpath = "k8s.io/apiserver/pkg/storage/value/encrypt/aes", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apiserver/pkg/storage/value:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/BUILD b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/BUILD index 3ceb65a02..32456390b 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/BUILD @@ -8,23 +8,115 @@ load( go_library( name = "go_default_library", - srcs = ["envelope.go"], + srcs = [ + "envelope.go", + "grpc_service.go", + ], importpath = "k8s.io/apiserver/pkg/storage/value/encrypt/envelope", deps = [ + "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/hashicorp/golang-lru:go_default_library", + "//vendor/golang.org/x/net/context:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/value:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", ], ) go_test( name = "go_default_test", - srcs = ["envelope_test.go"], - importpath = "k8s.io/apiserver/pkg/storage/value/encrypt/envelope", - library = ":go_default_library", + srcs = [ + "envelope_test.go", + ] + select({ + "@io_bazel_rules_go//go/platform:android": [ + "grpc_service_unix_test.go", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "grpc_service_unix_test.go", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "grpc_service_unix_test.go", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "grpc_service_unix_test.go", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "grpc_service_unix_test.go", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "grpc_service_unix_test.go", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "grpc_service_unix_test.go", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "grpc_service_unix_test.go", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "grpc_service_unix_test.go", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "grpc_service_unix_test.go", + ], + "//conditions:default": [], + }), + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apiserver/pkg/storage/value:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes:go_default_library", - ], + ] + select({ + "@io_bazel_rules_go//go/platform:android": [ + "//vendor/golang.org/x/sys/unix:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//vendor/golang.org/x/sys/unix:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//vendor/golang.org/x/sys/unix:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//vendor/golang.org/x/sys/unix:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//vendor/golang.org/x/sys/unix:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//vendor/golang.org/x/sys/unix:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//vendor/golang.org/x/sys/unix:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//vendor/golang.org/x/sys/unix:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//vendor/golang.org/x/sys/unix:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//vendor/golang.org/x/sys/unix:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", + "//vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", + ], + "//conditions:default": [], + }), ) filegroup( @@ -36,6 +128,9 @@ filegroup( filegroup( name = "all-srcs", - srcs = [":package-srcs"], + srcs = [ + ":package-srcs", + "//staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:all-srcs", + ], tags = ["automanaged"], ) diff --git a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go index 9782e44b6..90f1dca42 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go +++ b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go @@ -21,6 +21,7 @@ import ( "crypto/aes" "crypto/cipher" "crypto/rand" + "encoding/base64" "encoding/binary" "fmt" @@ -34,10 +35,10 @@ const defaultCacheSize = 1000 // Service allows encrypting and decrypting data using an external Key Management Service. type Service interface { - // Decrypt a given data string to obtain the original byte data. - Decrypt(data string) ([]byte, error) - // Encrypt bytes to a string ciphertext. - Encrypt(data []byte) (string, error) + // Decrypt a given bytearray to obtain the original data as bytes. + Decrypt(data []byte) ([]byte, error) + // Encrypt bytes to a ciphertext. + Encrypt(data []byte) ([]byte, error) } type envelopeTransformer struct { @@ -78,15 +79,12 @@ func (t *envelopeTransformer) TransformFromStorage(data []byte, context value.Co if keyLen+2 > len(data) { return nil, false, fmt.Errorf("invalid data encountered by genvelope transformer, length longer than available bytes: %q", data) } - encKey := string(data[2 : keyLen+2]) + encKey := data[2 : keyLen+2] encData := data[2+keyLen:] - var transformer value.Transformer // Look up the decrypted DEK from cache or Envelope. - _transformer, found := t.transformers.Get(encKey) - if found { - transformer = _transformer.(value.Transformer) - } else { + transformer := t.getTransformer(encKey) + if transformer == nil { key, err := t.envelopeService.Decrypt(encKey) if err != nil { return nil, false, fmt.Errorf("error while decrypting key: %q", err) @@ -136,16 +134,27 @@ func (t *envelopeTransformer) TransformToStorage(data []byte, context value.Cont var _ value.Transformer = &envelopeTransformer{} // addTransformer inserts a new transformer to the Envelope cache of DEKs for future reads. -func (t *envelopeTransformer) addTransformer(encKey string, key []byte) (value.Transformer, error) { +func (t *envelopeTransformer) addTransformer(encKey []byte, key []byte) (value.Transformer, error) { block, err := aes.NewCipher(key) if err != nil { return nil, err } transformer := t.baseTransformerFunc(block) - t.transformers.Add(encKey, transformer) + // Use base64 of encKey as the key into the cache because hashicorp/golang-lru + // cannot hash []uint8. + t.transformers.Add(base64.StdEncoding.EncodeToString(encKey), transformer) return transformer, nil } +// getTransformer fetches the transformer corresponding to encKey from cache, if it exists. +func (t *envelopeTransformer) getTransformer(encKey []byte) value.Transformer { + _transformer, found := t.transformers.Get(base64.StdEncoding.EncodeToString(encKey)) + if found { + return _transformer.(value.Transformer) + } + return nil +} + // generateKey generates a random key using system randomness. func generateKey(length int) ([]byte, error) { key := make([]byte, length) diff --git a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope_test.go b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope_test.go index 0ba68afc6..3215a22f3 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope_test.go +++ b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope_test.go @@ -42,22 +42,22 @@ type testEnvelopeService struct { keyVersion string } -func (t *testEnvelopeService) Decrypt(data string) ([]byte, error) { +func (t *testEnvelopeService) Decrypt(data []byte) ([]byte, error) { if t.disabled { return nil, fmt.Errorf("Envelope service was disabled") } - dataChunks := strings.SplitN(data, ":", 2) + dataChunks := strings.SplitN(string(data), ":", 2) if len(dataChunks) != 2 { return nil, fmt.Errorf("invalid data encountered for decryption: %s. Missing key version", data) } return base64.StdEncoding.DecodeString(dataChunks[1]) } -func (t *testEnvelopeService) Encrypt(data []byte) (string, error) { +func (t *testEnvelopeService) Encrypt(data []byte) ([]byte, error) { if t.disabled { - return "", fmt.Errorf("Envelope service was disabled") + return nil, fmt.Errorf("Envelope service was disabled") } - return t.keyVersion + ":" + base64.StdEncoding.EncodeToString(data), nil + return []byte(t.keyVersion + ":" + base64.StdEncoding.EncodeToString(data)), nil } func (t *testEnvelopeService) SetDisabledStatus(status bool) { diff --git a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go new file mode 100644 index 000000000..ce910f856 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go @@ -0,0 +1,144 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package envelope transforms values for storage at rest using a Envelope provider +package envelope + +import ( + "fmt" + "net" + "net/url" + "time" + + "github.com/golang/glog" + + "google.golang.org/grpc" + + "golang.org/x/net/context" + + kmsapi "k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1" +) + +const ( + // Now only supported unix domain socket. + unixProtocol = "unix" + + // Current version for the protocol interface definition. + kmsapiVersion = "v1beta1" + + // The timeout that communicate with KMS server. + timeout = 30 * time.Second +) + +// The gRPC implementation for envelope.Service. +type gRPCService struct { + // gRPC client instance + kmsClient kmsapi.KeyManagementServiceClient + connection *grpc.ClientConn +} + +// NewGRPCService returns an envelope.Service which use gRPC to communicate the remote KMS provider. +func NewGRPCService(endpoint string) (Service, error) { + glog.V(4).Infof("Configure KMS provider with endpoint: %s", endpoint) + + addr, err := parseEndpoint(endpoint) + if err != nil { + return nil, err + } + + connection, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithTimeout(timeout), grpc.WithDialer(unixDial)) + if err != nil { + return nil, fmt.Errorf("connect remote KMS provider %q failed, error: %v", addr, err) + } + + kmsClient := kmsapi.NewKeyManagementServiceClient(connection) + + err = checkAPIVersion(kmsClient) + if err != nil { + connection.Close() + return nil, fmt.Errorf("failed check version for %q, error: %v", addr, err) + } + + return &gRPCService{kmsClient: kmsClient, connection: connection}, nil +} + +// This dialer explicitly ask gRPC to use unix socket as network. +func unixDial(addr string, timeout time.Duration) (net.Conn, error) { + return net.DialTimeout(unixProtocol, addr, timeout) +} + +// Parse the endpoint to extract schema, host or path. +func parseEndpoint(endpoint string) (string, error) { + if len(endpoint) == 0 { + return "", fmt.Errorf("remote KMS provider can't use empty string as endpoint") + } + + u, err := url.Parse(endpoint) + if err != nil { + return "", fmt.Errorf("invalid endpoint %q for remote KMS provider, error: %v", endpoint, err) + } + + if u.Scheme != unixProtocol { + return "", fmt.Errorf("unsupported scheme %q for remote KMS provider", u.Scheme) + } + return u.Path, nil +} + +// Check the KMS provider API version. +// Only matching kmsapiVersion is supported now. +func checkAPIVersion(kmsClient kmsapi.KeyManagementServiceClient) error { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + request := &kmsapi.VersionRequest{Version: kmsapiVersion} + response, err := kmsClient.Version(ctx, request) + if err != nil { + return fmt.Errorf("failed get version from remote KMS provider: %v", err) + } + if response.Version != kmsapiVersion { + return fmt.Errorf("KMS provider api version %s is not supported, only %s is supported now", + response.Version, kmsapiVersion) + } + + glog.V(4).Infof("KMS provider %s initialized, version: %s", response.RuntimeName, response.RuntimeVersion) + return nil +} + +// Decrypt a given data string to obtain the original byte data. +func (g *gRPCService) Decrypt(cipher []byte) ([]byte, error) { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + request := &kmsapi.DecryptRequest{Cipher: cipher, Version: kmsapiVersion} + response, err := g.kmsClient.Decrypt(ctx, request) + if err != nil { + return nil, err + } + return response.Plain, nil +} + +// Encrypt bytes to a string ciphertext. +func (g *gRPCService) Encrypt(plain []byte) ([]byte, error) { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + request := &kmsapi.EncryptRequest{Plain: plain, Version: kmsapiVersion} + response, err := g.kmsClient.Encrypt(ctx, request) + if err != nil { + return nil, err + } + return response.Cipher, nil +} diff --git a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service_unix_test.go b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service_unix_test.go new file mode 100644 index 000000000..f1b1cdef1 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service_unix_test.go @@ -0,0 +1,173 @@ +// +build !windows + +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package envelope transforms values for storage at rest using a Envelope provider +package envelope + +import ( + "context" + "encoding/base64" + "fmt" + "net" + "os" + "reflect" + "testing" + + "google.golang.org/grpc" + + "golang.org/x/sys/unix" + + kmsapi "k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1" +) + +const ( + sockFile = "/tmp/kms-provider.sock" +) + +// Normal encryption and decryption operation. +func TestGRPCService(t *testing.T) { + // Start a test gRPC server. + server, err := startTestKMSProvider() + if err != nil { + t.Fatalf("failed to start test KMS provider server, error: %v", err) + } + defer stopTestKMSProvider(server) + + // Create the gRPC client service. + endpoint := unixProtocol + "://" + sockFile + service, err := NewGRPCService(endpoint) + if err != nil { + t.Fatalf("failed to create envelope service, error: %v", err) + } + defer destroyService(service) + + // Call service to encrypt data. + data := []byte("test data") + cipher, err := service.Encrypt(data) + if err != nil { + t.Fatalf("failed when execute encrypt, error: %v", err) + } + + // Call service to decrypt data. + result, err := service.Decrypt(cipher) + if err != nil { + t.Fatalf("failed when execute decrypt, error: %v", err) + } + + if !reflect.DeepEqual(data, result) { + t.Errorf("expect: %v, but: %v", data, result) + } +} + +func destroyService(service Service) { + s := service.(*gRPCService) + s.connection.Close() +} + +// Test all those invalid configuration for KMS provider. +func TestInvalidConfiguration(t *testing.T) { + // Start a test gRPC server. + server, err := startTestKMSProvider() + if err != nil { + t.Fatalf("failed to start test KMS provider server, error: %v", err) + } + defer stopTestKMSProvider(server) + + invalidConfigs := []struct { + name string + apiVersion string + endpoint string + }{ + {"emptyConfiguration", kmsapiVersion, ""}, + {"invalidScheme", kmsapiVersion, "tcp://localhost:6060"}, + {"unavailableEndpoint", kmsapiVersion, unixProtocol + "://" + sockFile + ".nonexist"}, + {"invalidAPIVersion", "invalidVersion", unixProtocol + "://" + sockFile}, + } + + for _, testCase := range invalidConfigs { + t.Run(testCase.name, func(t *testing.T) { + setAPIVersion(testCase.apiVersion) + defer setAPIVersion(kmsapiVersion) + + _, err := NewGRPCService(testCase.endpoint) + if err == nil { + t.Fatalf("should fail to create envelope service for %s.", testCase.name) + } + }) + } +} + +// Start the gRPC server that listens on unix socket. +func startTestKMSProvider() (*grpc.Server, error) { + if err := cleanSockFile(); err != nil { + return nil, err + } + + listener, err := net.Listen(unixProtocol, sockFile) + if err != nil { + return nil, fmt.Errorf("failed to listen on the unix socket, error: %v", err) + } + + server := grpc.NewServer() + kmsapi.RegisterKeyManagementServiceServer(server, &base64Server{}) + go server.Serve(listener) + return server, nil +} + +func stopTestKMSProvider(server *grpc.Server) { + server.Stop() + cleanSockFile() +} + +func cleanSockFile() error { + err := unix.Unlink(sockFile) + if err != nil && !os.IsNotExist(err) { + return fmt.Errorf("failed to delete the socket file, error: %v", err) + } + return nil +} + +// Fake gRPC sever for remote KMS provider. +// Use base64 to simulate encrypt and decrypt. +type base64Server struct{} + +var testProviderAPIVersion = kmsapiVersion + +func setAPIVersion(apiVersion string) { + testProviderAPIVersion = apiVersion +} + +func (s *base64Server) Version(ctx context.Context, request *kmsapi.VersionRequest) (*kmsapi.VersionResponse, error) { + return &kmsapi.VersionResponse{Version: testProviderAPIVersion, RuntimeName: "testKMS", RuntimeVersion: "0.0.1"}, nil +} + +func (s *base64Server) Decrypt(ctx context.Context, request *kmsapi.DecryptRequest) (*kmsapi.DecryptResponse, error) { + buf := make([]byte, base64.StdEncoding.DecodedLen(len(request.Cipher))) + n, err := base64.StdEncoding.Decode(buf, request.Cipher) + if err != nil { + return nil, err + } + + return &kmsapi.DecryptResponse{Plain: buf[:n]}, nil +} + +func (s *base64Server) Encrypt(ctx context.Context, request *kmsapi.EncryptRequest) (*kmsapi.EncryptResponse, error) { + buf := make([]byte, base64.StdEncoding.EncodedLen(len(request.Plain))) + base64.StdEncoding.Encode(buf, request.Plain) + return &kmsapi.EncryptResponse{Cipher: buf}, nil +} diff --git a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/BUILD b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/BUILD new file mode 100644 index 000000000..5fafc66b1 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/BUILD @@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +filegroup( + name = "go_default_library_protos", + srcs = ["service.proto"], + visibility = ["//visibility:public"], +) + +go_library( + name = "go_default_library", + srcs = ["service.pb.go"], + importpath = "k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/gogo/protobuf/proto:go_default_library", + "//vendor/golang.org/x/net/context:go_default_library", + "//vendor/google.golang.org/grpc:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.pb.go b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.pb.go new file mode 100644 index 000000000..52525fffc --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.pb.go @@ -0,0 +1,370 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. +// source: service.proto +// DO NOT EDIT! + +/* +Package v1beta1 is a generated protocol buffer package. + +It is generated from these files: + service.proto + +It has these top-level messages: + VersionRequest + VersionResponse + DecryptRequest + DecryptResponse + EncryptRequest + EncryptResponse +*/ +package v1beta1 + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +type VersionRequest struct { + // Version of the KMS plugin API. + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` +} + +func (m *VersionRequest) Reset() { *m = VersionRequest{} } +func (m *VersionRequest) String() string { return proto.CompactTextString(m) } +func (*VersionRequest) ProtoMessage() {} +func (*VersionRequest) Descriptor() ([]byte, []int) { return fileDescriptorService, []int{0} } + +func (m *VersionRequest) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +type VersionResponse struct { + // Version of the KMS plugin API. + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Name of the KMS provider. + RuntimeName string `protobuf:"bytes,2,opt,name=runtime_name,json=runtimeName,proto3" json:"runtime_name,omitempty"` + // Version of the KMS provider. The string must be semver-compatible. + RuntimeVersion string `protobuf:"bytes,3,opt,name=runtime_version,json=runtimeVersion,proto3" json:"runtime_version,omitempty"` +} + +func (m *VersionResponse) Reset() { *m = VersionResponse{} } +func (m *VersionResponse) String() string { return proto.CompactTextString(m) } +func (*VersionResponse) ProtoMessage() {} +func (*VersionResponse) Descriptor() ([]byte, []int) { return fileDescriptorService, []int{1} } + +func (m *VersionResponse) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *VersionResponse) GetRuntimeName() string { + if m != nil { + return m.RuntimeName + } + return "" +} + +func (m *VersionResponse) GetRuntimeVersion() string { + if m != nil { + return m.RuntimeVersion + } + return "" +} + +type DecryptRequest struct { + // Version of the KMS plugin API. + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // The data to be decrypted. + Cipher []byte `protobuf:"bytes,2,opt,name=cipher,proto3" json:"cipher,omitempty"` +} + +func (m *DecryptRequest) Reset() { *m = DecryptRequest{} } +func (m *DecryptRequest) String() string { return proto.CompactTextString(m) } +func (*DecryptRequest) ProtoMessage() {} +func (*DecryptRequest) Descriptor() ([]byte, []int) { return fileDescriptorService, []int{2} } + +func (m *DecryptRequest) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *DecryptRequest) GetCipher() []byte { + if m != nil { + return m.Cipher + } + return nil +} + +type DecryptResponse struct { + // The decrypted data. + Plain []byte `protobuf:"bytes,1,opt,name=plain,proto3" json:"plain,omitempty"` +} + +func (m *DecryptResponse) Reset() { *m = DecryptResponse{} } +func (m *DecryptResponse) String() string { return proto.CompactTextString(m) } +func (*DecryptResponse) ProtoMessage() {} +func (*DecryptResponse) Descriptor() ([]byte, []int) { return fileDescriptorService, []int{3} } + +func (m *DecryptResponse) GetPlain() []byte { + if m != nil { + return m.Plain + } + return nil +} + +type EncryptRequest struct { + // Version of the KMS plugin API. + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // The data to be encrypted. + Plain []byte `protobuf:"bytes,2,opt,name=plain,proto3" json:"plain,omitempty"` +} + +func (m *EncryptRequest) Reset() { *m = EncryptRequest{} } +func (m *EncryptRequest) String() string { return proto.CompactTextString(m) } +func (*EncryptRequest) ProtoMessage() {} +func (*EncryptRequest) Descriptor() ([]byte, []int) { return fileDescriptorService, []int{4} } + +func (m *EncryptRequest) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *EncryptRequest) GetPlain() []byte { + if m != nil { + return m.Plain + } + return nil +} + +type EncryptResponse struct { + // The encrypted data. + Cipher []byte `protobuf:"bytes,1,opt,name=cipher,proto3" json:"cipher,omitempty"` +} + +func (m *EncryptResponse) Reset() { *m = EncryptResponse{} } +func (m *EncryptResponse) String() string { return proto.CompactTextString(m) } +func (*EncryptResponse) ProtoMessage() {} +func (*EncryptResponse) Descriptor() ([]byte, []int) { return fileDescriptorService, []int{5} } + +func (m *EncryptResponse) GetCipher() []byte { + if m != nil { + return m.Cipher + } + return nil +} + +func init() { + proto.RegisterType((*VersionRequest)(nil), "v1beta1.VersionRequest") + proto.RegisterType((*VersionResponse)(nil), "v1beta1.VersionResponse") + proto.RegisterType((*DecryptRequest)(nil), "v1beta1.DecryptRequest") + proto.RegisterType((*DecryptResponse)(nil), "v1beta1.DecryptResponse") + proto.RegisterType((*EncryptRequest)(nil), "v1beta1.EncryptRequest") + proto.RegisterType((*EncryptResponse)(nil), "v1beta1.EncryptResponse") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for KeyManagementService service + +type KeyManagementServiceClient interface { + // Version returns the runtime name and runtime version of the KMS provider. + Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) + // Execute decryption operation in KMS provider. + Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) + // Execute encryption operation in KMS provider. + Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) +} + +type keyManagementServiceClient struct { + cc *grpc.ClientConn +} + +func NewKeyManagementServiceClient(cc *grpc.ClientConn) KeyManagementServiceClient { + return &keyManagementServiceClient{cc} +} + +func (c *keyManagementServiceClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) { + out := new(VersionResponse) + err := grpc.Invoke(ctx, "/v1beta1.KeyManagementService/Version", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) { + out := new(DecryptResponse) + err := grpc.Invoke(ctx, "/v1beta1.KeyManagementService/Decrypt", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) { + out := new(EncryptResponse) + err := grpc.Invoke(ctx, "/v1beta1.KeyManagementService/Encrypt", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for KeyManagementService service + +type KeyManagementServiceServer interface { + // Version returns the runtime name and runtime version of the KMS provider. + Version(context.Context, *VersionRequest) (*VersionResponse, error) + // Execute decryption operation in KMS provider. + Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error) + // Execute encryption operation in KMS provider. + Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error) +} + +func RegisterKeyManagementServiceServer(s *grpc.Server, srv KeyManagementServiceServer) { + s.RegisterService(&_KeyManagementService_serviceDesc, srv) +} + +func _KeyManagementService_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).Version(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1beta1.KeyManagementService/Version", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).Version(ctx, req.(*VersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DecryptRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).Decrypt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1beta1.KeyManagementService/Decrypt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).Decrypt(ctx, req.(*DecryptRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_Encrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EncryptRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).Encrypt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1beta1.KeyManagementService/Encrypt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).Encrypt(ctx, req.(*EncryptRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _KeyManagementService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "v1beta1.KeyManagementService", + HandlerType: (*KeyManagementServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Version", + Handler: _KeyManagementService_Version_Handler, + }, + { + MethodName: "Decrypt", + Handler: _KeyManagementService_Decrypt_Handler, + }, + { + MethodName: "Encrypt", + Handler: _KeyManagementService_Encrypt_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service.proto", +} + +func init() { proto.RegisterFile("service.proto", fileDescriptorService) } + +var fileDescriptorService = []byte{ + // 287 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcd, 0x4a, 0xc4, 0x30, + 0x10, 0xde, 0xae, 0xb8, 0xc5, 0xb1, 0xb6, 0x10, 0x16, 0x2d, 0x9e, 0x34, 0x97, 0x55, 0x0f, 0x85, + 0xd5, 0xbb, 0x88, 0xe8, 0x49, 0xf4, 0x50, 0xc1, 0xab, 0x64, 0xcb, 0xa0, 0x05, 0x9b, 0xc6, 0x24, + 0x5b, 0xd9, 0x17, 0xf5, 0x79, 0xc4, 0x66, 0x5a, 0xd3, 0x15, 0x71, 0x8f, 0x33, 0x99, 0xef, 0x6f, + 0x26, 0xb0, 0x67, 0x50, 0x37, 0x65, 0x81, 0x99, 0xd2, 0xb5, 0xad, 0x59, 0xd8, 0xcc, 0x17, 0x68, + 0xc5, 0x9c, 0x9f, 0x41, 0xfc, 0x84, 0xda, 0x94, 0xb5, 0xcc, 0xf1, 0x7d, 0x89, 0xc6, 0xb2, 0x14, + 0xc2, 0xc6, 0x75, 0xd2, 0xe0, 0x28, 0x38, 0xd9, 0xc9, 0xbb, 0x92, 0x7f, 0x40, 0xd2, 0xcf, 0x1a, + 0x55, 0x4b, 0x83, 0x7f, 0x0f, 0xb3, 0x63, 0x88, 0xf4, 0x52, 0xda, 0xb2, 0xc2, 0x67, 0x29, 0x2a, + 0x4c, 0xc7, 0xed, 0xf3, 0x2e, 0xf5, 0x1e, 0x44, 0x85, 0x6c, 0x06, 0x49, 0x37, 0xd2, 0x91, 0x6c, + 0xb5, 0x53, 0x31, 0xb5, 0x49, 0x8d, 0x5f, 0x43, 0x7c, 0x83, 0x85, 0x5e, 0x29, 0xfb, 0xaf, 0x49, + 0xb6, 0x0f, 0x93, 0xa2, 0x54, 0xaf, 0xa8, 0x5b, 0xc5, 0x28, 0xa7, 0x8a, 0xcf, 0x20, 0xe9, 0x39, + 0xc8, 0xfc, 0x14, 0xb6, 0xd5, 0x9b, 0x28, 0x1d, 0x45, 0x94, 0xbb, 0x82, 0x5f, 0x41, 0x7c, 0x2b, + 0x37, 0x14, 0xeb, 0x19, 0xc6, 0x3e, 0xc3, 0x29, 0x24, 0x3d, 0x03, 0x49, 0xfd, 0xb8, 0x0a, 0x7c, + 0x57, 0xe7, 0x9f, 0x01, 0x4c, 0xef, 0x70, 0x75, 0x2f, 0xa4, 0x78, 0xc1, 0x0a, 0xa5, 0x7d, 0x74, + 0x67, 0x62, 0x97, 0x10, 0x52, 0x7a, 0x76, 0x90, 0xd1, 0xb1, 0xb2, 0xe1, 0xa5, 0x0e, 0xd3, 0xdf, + 0x0f, 0x4e, 0x8e, 0x8f, 0xbe, 0xf1, 0x14, 0xd7, 0xc3, 0x0f, 0x97, 0xe8, 0xe1, 0xd7, 0x36, 0xe3, + 0xf0, 0x94, 0xc1, 0xc3, 0x0f, 0xf7, 0xe2, 0xe1, 0xd7, 0xe2, 0xf2, 0xd1, 0x62, 0xd2, 0xfe, 0xb3, + 0x8b, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x33, 0x8d, 0x09, 0xe1, 0x78, 0x02, 0x00, 0x00, +} diff --git a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.proto b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.proto new file mode 100644 index 000000000..dbde9080e --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.proto @@ -0,0 +1,54 @@ +// To regenerate service.pb.go run hack/update-generated-kms.sh +syntax = "proto3"; + +package v1beta1; + +// This service defines the public APIs for remote KMS provider. +service KeyManagementService { + // Version returns the runtime name and runtime version of the KMS provider. + rpc Version(VersionRequest) returns (VersionResponse) {} + + // Execute decryption operation in KMS provider. + rpc Decrypt(DecryptRequest) returns (DecryptResponse) {} + // Execute encryption operation in KMS provider. + rpc Encrypt(EncryptRequest) returns (EncryptResponse) {} +} + +message VersionRequest { + // Version of the KMS plugin API. + string version = 1; +} + +message VersionResponse { + // Version of the KMS plugin API. + string version = 1; + // Name of the KMS provider. + string runtime_name = 2; + // Version of the KMS provider. The string must be semver-compatible. + string runtime_version = 3; +} + +message DecryptRequest { + // Version of the KMS plugin API. + string version = 1; + // The data to be decrypted. + bytes cipher = 2; +} + +message DecryptResponse { + // The decrypted data. + bytes plain = 1; +} + +message EncryptRequest { + // Version of the KMS plugin API. + string version = 1; + // The data to be encrypted. + bytes plain = 2; +} + +message EncryptResponse { + // The encrypted data. + bytes cipher = 1; +} + diff --git a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/secretbox/BUILD b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/secretbox/BUILD index 7c26c0808..252b721a9 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/secretbox/BUILD +++ b/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/secretbox/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["secretbox_test.go"], - importpath = "k8s.io/apiserver/pkg/storage/value/encrypt/secretbox", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apiserver/pkg/storage/value:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/pkg/storage/watch_cache.go b/vendor/k8s.io/apiserver/pkg/storage/watch_cache.go index 602312b60..373e74eed 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/watch_cache.go +++ b/vendor/k8s.io/apiserver/pkg/storage/watch_cache.go @@ -61,12 +61,16 @@ type watchCacheEvent struct { } // Computing a key of an object is generally non-trivial (it performs -// e.g. validation underneath). To avoid computing it multiple times -// (to serve the event in different List/Watch requests), in the -// underlying store we are keeping pair (key, object). +// e.g. validation underneath). Similarly computing object fields and +// labels. To avoid computing them multiple times (to serve the event +// in different List/Watch requests), in the underlying store we are +// keeping structs (key, object, labels, fields, uninitialized). type storeElement struct { - Key string - Object runtime.Object + Key string + Object runtime.Object + Labels labels.Set + Fields fields.Set + Uninitialized bool } func storeElementKey(obj interface{}) (string, error) { @@ -220,6 +224,20 @@ func (w *watchCache) processEvent(event watch.Event, resourceVersion uint64, upd return fmt.Errorf("couldn't compute key: %v", err) } elem := &storeElement{Key: key, Object: event.Object} + elem.Labels, elem.Fields, elem.Uninitialized, err = w.getAttrsFunc(event.Object) + if err != nil { + return err + } + + watchCacheEvent := &watchCacheEvent{ + Type: event.Type, + Object: elem.Object, + ObjLabels: elem.Labels, + ObjFields: elem.Fields, + ObjUninitialized: elem.Uninitialized, + Key: key, + ResourceVersion: resourceVersion, + } // TODO: We should consider moving this lock below after the watchCacheEvent // is created. In such situation, the only problematic scenario is Replace( @@ -231,34 +249,14 @@ func (w *watchCache) processEvent(event watch.Event, resourceVersion uint64, upd if err != nil { return err } - objLabels, objFields, objUninitialized, err := w.getAttrsFunc(event.Object) - if err != nil { - return err - } - var prevObject runtime.Object - var prevObjLabels labels.Set - var prevObjFields fields.Set - var prevObjUninitialized bool if exists { - prevObject = previous.(*storeElement).Object - prevObjLabels, prevObjFields, prevObjUninitialized, err = w.getAttrsFunc(prevObject) - if err != nil { - return err - } - } - watchCacheEvent := &watchCacheEvent{ - Type: event.Type, - Object: event.Object, - ObjLabels: objLabels, - ObjFields: objFields, - ObjUninitialized: objUninitialized, - PrevObject: prevObject, - PrevObjLabels: prevObjLabels, - PrevObjFields: prevObjFields, - PrevObjUninitialized: prevObjUninitialized, - Key: key, - ResourceVersion: resourceVersion, + previousElem := previous.(*storeElement) + watchCacheEvent.PrevObject = previousElem.Object + watchCacheEvent.PrevObjLabels = previousElem.Labels + watchCacheEvent.PrevObjFields = previousElem.Fields + watchCacheEvent.PrevObjUninitialized = previousElem.Uninitialized } + if w.onEvent != nil { w.onEvent(watchCacheEvent) } @@ -362,7 +360,7 @@ func (w *watchCache) GetByKey(key string) (interface{}, bool, error) { return w.store.GetByKey(key) } -// Replace takes slice of runtime.Object as a paramater. +// Replace takes slice of runtime.Object as a parameter. func (w *watchCache) Replace(objs []interface{}, resourceVersion string) error { version, err := parseResourceVersion(resourceVersion) if err != nil { @@ -379,7 +377,17 @@ func (w *watchCache) Replace(objs []interface{}, resourceVersion string) error { if err != nil { return fmt.Errorf("couldn't compute key: %v", err) } - toReplace = append(toReplace, &storeElement{Key: key, Object: object}) + objLabels, objFields, objUninitialized, err := w.getAttrsFunc(object) + if err != nil { + return err + } + toReplace = append(toReplace, &storeElement{ + Key: key, + Object: object, + Labels: objLabels, + Fields: objFields, + Uninitialized: objUninitialized, + }) } w.Lock() diff --git a/vendor/k8s.io/apiserver/pkg/storage/watch_cache_test.go b/vendor/k8s.io/apiserver/pkg/storage/watch_cache_test.go index b695f3a81..f7b353e63 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/watch_cache_test.go +++ b/vendor/k8s.io/apiserver/pkg/storage/watch_cache_test.go @@ -17,6 +17,7 @@ limitations under the License. package storage import ( + "fmt" "strconv" "testing" "time" @@ -29,7 +30,6 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/clock" - "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" @@ -41,17 +41,37 @@ func makeTestPod(name string, resourceVersion uint64) *v1.Pod { Namespace: "ns", Name: name, ResourceVersion: strconv.FormatUint(resourceVersion, 10), + Labels: map[string]string{ + "k8s-app": "my-app", + }, + }, + Spec: v1.PodSpec{ + NodeName: "some-node", }, } } +func makeTestStoreElement(pod *v1.Pod) *storeElement { + return &storeElement{ + Key: "prefix/ns/" + pod.Name, + Object: pod, + Labels: labels.Set(pod.Labels), + Fields: fields.Set{"spec.nodeName": pod.Spec.NodeName}, + Uninitialized: false, + } +} + // newTestWatchCache just adds a fake clock. func newTestWatchCache(capacity int) *watchCache { keyFunc := func(obj runtime.Object) (string, error) { return NamespaceKeyFunc("prefix", obj) } getAttrsFunc := func(obj runtime.Object) (labels.Set, fields.Set, bool, error) { - return nil, nil, false, nil + pod, ok := obj.(*v1.Pod) + if !ok { + return nil, nil, false, fmt.Errorf("not a pod!") + } + return labels.Set(pod.Labels), fields.Set{"spec.nodeName": pod.Spec.NodeName}, false, nil } wc := newWatchCache(capacity, keyFunc, getAttrsFunc) wc.clock = clock.NewFakeClock(time.Now()) @@ -69,8 +89,9 @@ func TestWatchCacheBasic(t *testing.T) { if item, ok, _ := store.Get(pod1); !ok { t.Errorf("didn't find pod") } else { - if !apiequality.Semantic.DeepEqual(&storeElement{Key: "prefix/ns/pod", Object: pod1}, item) { - t.Errorf("expected %v, got %v", pod1, item) + expected := makeTestStoreElement(makeTestPod("pod", 1)) + if !apiequality.Semantic.DeepEqual(expected, item) { + t.Errorf("expected %v, got %v", expected, item) } } pod2 := makeTestPod("pod", 2) @@ -80,8 +101,9 @@ func TestWatchCacheBasic(t *testing.T) { if item, ok, _ := store.Get(pod2); !ok { t.Errorf("didn't find pod") } else { - if !apiequality.Semantic.DeepEqual(&storeElement{Key: "prefix/ns/pod", Object: pod2}, item) { - t.Errorf("expected %v, got %v", pod1, item) + expected := makeTestStoreElement(makeTestPod("pod", 2)) + if !apiequality.Semantic.DeepEqual(expected, item) { + t.Errorf("expected %v, got %v", expected, item) } } pod3 := makeTestPod("pod", 3) @@ -97,15 +119,18 @@ func TestWatchCacheBasic(t *testing.T) { store.Add(makeTestPod("pod2", 5)) store.Add(makeTestPod("pod3", 6)) { - podNames := sets.String{} - for _, item := range store.List() { - podNames.Insert(item.(*storeElement).Object.(*v1.Pod).ObjectMeta.Name) + expected := map[string]storeElement{ + "prefix/ns/pod1": *makeTestStoreElement(makeTestPod("pod1", 4)), + "prefix/ns/pod2": *makeTestStoreElement(makeTestPod("pod2", 5)), + "prefix/ns/pod3": *makeTestStoreElement(makeTestPod("pod3", 6)), } - if !podNames.HasAll("pod1", "pod2", "pod3") { - t.Errorf("missing pods, found %v", podNames) + items := make(map[string]storeElement, 0) + for _, item := range store.List() { + elem := item.(*storeElement) + items[elem.Key] = *elem } - if len(podNames) != 3 { - t.Errorf("found missing/extra items") + if !apiequality.Semantic.DeepEqual(expected, items) { + t.Errorf("expected %v, got %v", expected, items) } } @@ -115,15 +140,17 @@ func TestWatchCacheBasic(t *testing.T) { makeTestPod("pod5", 8), }, "8") { - podNames := sets.String{} - for _, item := range store.List() { - podNames.Insert(item.(*storeElement).Object.(*v1.Pod).ObjectMeta.Name) + expected := map[string]storeElement{ + "prefix/ns/pod4": *makeTestStoreElement(makeTestPod("pod4", 7)), + "prefix/ns/pod5": *makeTestStoreElement(makeTestPod("pod5", 8)), } - if !podNames.HasAll("pod4", "pod5") { - t.Errorf("missing pods, found %v", podNames) + items := make(map[string]storeElement) + for _, item := range store.List() { + elem := item.(*storeElement) + items[elem.Key] = *elem } - if len(podNames) != 2 { - t.Errorf("found missing/extra items") + if !apiequality.Semantic.DeepEqual(expected, items) { + t.Errorf("expected %v, got %v", expected, items) } } } @@ -288,8 +315,9 @@ func TestWaitUntilFreshAndGet(t *testing.T) { if !exists { t.Fatalf("no results returned: %#v", obj) } - if !apiequality.Semantic.DeepEqual(&storeElement{Key: "prefix/ns/bar", Object: makeTestPod("bar", 5)}, obj) { - t.Errorf("unexpected element returned: %#v", obj) + expected := makeTestStoreElement(makeTestPod("bar", 5)) + if !apiequality.Semantic.DeepEqual(expected, obj) { + t.Errorf("expected %v, got %v", expected, obj) } } diff --git a/vendor/k8s.io/apiserver/pkg/util/feature/BUILD b/vendor/k8s.io/apiserver/pkg/util/feature/BUILD index 60a1a866d..157aa49e6 100644 --- a/vendor/k8s.io/apiserver/pkg/util/feature/BUILD +++ b/vendor/k8s.io/apiserver/pkg/util/feature/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["feature_gate_test.go"], - importpath = "k8s.io/apiserver/pkg/util/feature", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/github.com/spf13/pflag:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/pkg/util/feature/feature_gate.go b/vendor/k8s.io/apiserver/pkg/util/feature/feature_gate.go index 95ca0e77a..306877124 100644 --- a/vendor/k8s.io/apiserver/pkg/util/feature/feature_gate.go +++ b/vendor/k8s.io/apiserver/pkg/util/feature/feature_gate.go @@ -67,6 +67,9 @@ const ( Alpha = prerelease("ALPHA") Beta = prerelease("BETA") GA = prerelease("") + + // Deprecated + Deprecated = prerelease("DEPRECATED") ) // FeatureGate parses and stores flag gates for known features from @@ -157,7 +160,7 @@ func (f *featureGate) Set(value string) error { } arr := strings.SplitN(s, "=", 2) k := Feature(strings.TrimSpace(arr[0])) - _, ok := known[k] + featureSpec, ok := known[k] if !ok { return fmt.Errorf("unrecognized key: %s", k) } @@ -170,6 +173,9 @@ func (f *featureGate) Set(value string) error { return fmt.Errorf("invalid value of %s: %s, err: %v", k, v, err) } enabled[k] = boolValue + if boolValue && featureSpec.PreRelease == Deprecated { + glog.Warningf("enabling deprecated feature gate %s", k) + } // Handle "special" features like "all alpha gates" if fn, found := f.special[k]; found { diff --git a/vendor/k8s.io/apiserver/pkg/util/flag/BUILD b/vendor/k8s.io/apiserver/pkg/util/flag/BUILD index 57ab4058d..7a73ad0d5 100644 --- a/vendor/k8s.io/apiserver/pkg/util/flag/BUILD +++ b/vendor/k8s.io/apiserver/pkg/util/flag/BUILD @@ -9,20 +9,21 @@ load( go_test( name = "go_default_test", srcs = [ + "ciphersuites_flag_test.go", "colon_separated_multimap_string_string_test.go", "langle_separated_map_string_string_test.go", "map_string_bool_test.go", "map_string_string_test.go", "namedcertkey_flag_test.go", ], - importpath = "k8s.io/apiserver/pkg/util/flag", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/github.com/spf13/pflag:go_default_library"], ) go_library( name = "go_default_library", srcs = [ + "ciphersuites_flag.go", "colon_separated_multimap_string_string.go", "configuration_map.go", "flags.go", @@ -30,6 +31,7 @@ go_library( "map_string_bool.go", "map_string_string.go", "namedcertkey_flag.go", + "noop.go", "omitempty.go", "string_flag.go", "tristate.go", diff --git a/vendor/k8s.io/apiserver/pkg/util/flag/ciphersuites_flag.go b/vendor/k8s.io/apiserver/pkg/util/flag/ciphersuites_flag.go new file mode 100644 index 000000000..73fd62c10 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/util/flag/ciphersuites_flag.go @@ -0,0 +1,87 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +import ( + "crypto/tls" + "fmt" +) + +// ciphers maps strings into tls package cipher constants in +// https://golang.org/pkg/crypto/tls/#pkg-constants +var ciphers = map[string]uint16{ + "TLS_RSA_WITH_RC4_128_SHA": tls.TLS_RSA_WITH_RC4_128_SHA, + "TLS_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA, + "TLS_RSA_WITH_AES_128_CBC_SHA": tls.TLS_RSA_WITH_AES_128_CBC_SHA, + "TLS_RSA_WITH_AES_256_CBC_SHA": tls.TLS_RSA_WITH_AES_256_CBC_SHA, + "TLS_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_RSA_WITH_AES_128_CBC_SHA256, + "TLS_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_RSA_WITH_AES_128_GCM_SHA256, + "TLS_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_RSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_RSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, + "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, +} + +func TLSCipherSuites(cipherNames []string) ([]uint16, error) { + if len(cipherNames) == 0 { + return nil, nil + } + ciphersIntSlice := make([]uint16, 0) + for _, cipher := range cipherNames { + intValue, ok := ciphers[cipher] + if !ok { + return nil, fmt.Errorf("Cipher suite %s not supported or doesn't exist", cipher) + } + ciphersIntSlice = append(ciphersIntSlice, intValue) + } + return ciphersIntSlice, nil +} + +var versions = map[string]uint16{ + "VersionTLS10": tls.VersionTLS10, + "VersionTLS11": tls.VersionTLS11, + "VersionTLS12": tls.VersionTLS12, +} + +func TLSVersion(versionName string) (uint16, error) { + if len(versionName) == 0 { + return DefaultTLSVersion(), nil + } + if version, ok := versions[versionName]; ok { + return version, nil + } + return 0, fmt.Errorf("unknown tls version %q", versionName) +} + +func DefaultTLSVersion() uint16 { + // Can't use SSLv3 because of POODLE and BEAST + // Can't use TLSv1.0 because of POODLE and BEAST using CBC cipher + // Can't use TLSv1.1 because of RC4 cipher usage + return tls.VersionTLS12 +} diff --git a/vendor/k8s.io/apiserver/pkg/util/flag/ciphersuites_flag_test.go b/vendor/k8s.io/apiserver/pkg/util/flag/ciphersuites_flag_test.go new file mode 100644 index 000000000..4a8c4efeb --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/util/flag/ciphersuites_flag_test.go @@ -0,0 +1,114 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +import ( + "crypto/tls" + "fmt" + "go/importer" + "reflect" + "strings" + "testing" +) + +func TestStrToUInt16(t *testing.T) { + tests := []struct { + flag []string + expected []uint16 + expected_error bool + }{ + { + // Happy case + flag: []string{"TLS_RSA_WITH_RC4_128_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_ECDHE_RSA_WITH_RC4_128_SHA", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"}, + expected: []uint16{tls.TLS_RSA_WITH_RC4_128_SHA, tls.TLS_RSA_WITH_AES_128_CBC_SHA, tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA}, + expected_error: false, + }, + { + // One flag only + flag: []string{"TLS_RSA_WITH_RC4_128_SHA"}, + expected: []uint16{tls.TLS_RSA_WITH_RC4_128_SHA}, + expected_error: false, + }, + { + // Empty flag + flag: []string{}, + expected: nil, + expected_error: false, + }, + { + // Duplicated flag + flag: []string{"TLS_RSA_WITH_RC4_128_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_ECDHE_RSA_WITH_RC4_128_SHA", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_RC4_128_SHA"}, + expected: []uint16{tls.TLS_RSA_WITH_RC4_128_SHA, tls.TLS_RSA_WITH_AES_128_CBC_SHA, tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, tls.TLS_RSA_WITH_RC4_128_SHA}, + expected_error: false, + }, + { + // Invalid flag + flag: []string{"foo"}, + expected: nil, + expected_error: true, + }, + } + + for i, test := range tests { + uIntFlags, err := TLSCipherSuites(test.flag) + if reflect.DeepEqual(uIntFlags, test.expected) == false { + t.Errorf("%d: expected %+v, got %+v", i, test.expected, uIntFlags) + } + if test.expected_error && err == nil { + t.Errorf("%d: expecting error, got %+v", i, err) + } + } +} + +func TestConstantMaps(t *testing.T) { + pkg, err := importer.Default().Import("crypto/tls") + if err != nil { + fmt.Printf("error: %s\n", err.Error()) + return + } + discoveredVersions := map[string]bool{} + discoveredCiphers := map[string]bool{} + for _, declName := range pkg.Scope().Names() { + if strings.HasPrefix(declName, "VersionTLS") { + discoveredVersions[declName] = true + } + if strings.HasPrefix(declName, "TLS_RSA_") || strings.HasPrefix(declName, "TLS_ECDHE_") { + discoveredCiphers[declName] = true + } + } + + for k := range discoveredCiphers { + if _, ok := ciphers[k]; !ok { + t.Errorf("discovered cipher tls.%s not in ciphers map", k) + } + } + for k := range ciphers { + if _, ok := discoveredCiphers[k]; !ok { + t.Errorf("ciphers map has %s not in tls package", k) + } + } + for k := range discoveredVersions { + if _, ok := versions[k]; !ok { + t.Errorf("discovered version tls.%s not in version map", k) + } + } + for k := range versions { + if _, ok := discoveredVersions[k]; !ok { + t.Errorf("versions map has %s not in tls package", k) + } + } +} diff --git a/vendor/k8s.io/apiserver/pkg/util/flag/noop.go b/vendor/k8s.io/apiserver/pkg/util/flag/noop.go new file mode 100644 index 000000000..03f7f14c0 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/util/flag/noop.go @@ -0,0 +1,41 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +import ( + goflag "flag" + "github.com/spf13/pflag" +) + +// NoOp implements goflag.Value and plfag.Value, +// but has a noop Set implementation +type NoOp struct{} + +var _ goflag.Value = NoOp{} +var _ pflag.Value = NoOp{} + +func (NoOp) String() string { + return "" +} + +func (NoOp) Set(val string) error { + return nil +} + +func (NoOp) Type() string { + return "NoOp" +} diff --git a/vendor/k8s.io/apiserver/pkg/util/flushwriter/BUILD b/vendor/k8s.io/apiserver/pkg/util/flushwriter/BUILD index 707628ae1..2ca558aac 100644 --- a/vendor/k8s.io/apiserver/pkg/util/flushwriter/BUILD +++ b/vendor/k8s.io/apiserver/pkg/util/flushwriter/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["writer_test.go"], - importpath = "k8s.io/apiserver/pkg/util/flushwriter", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/apiserver/pkg/util/logs/logs.go b/vendor/k8s.io/apiserver/pkg/util/logs/logs.go index 392bbc0fb..c5ba084a5 100644 --- a/vendor/k8s.io/apiserver/pkg/util/logs/logs.go +++ b/vendor/k8s.io/apiserver/pkg/util/logs/logs.go @@ -26,13 +26,21 @@ import ( "k8s.io/apimachinery/pkg/util/wait" ) -var logFlushFreq = pflag.Duration("log-flush-frequency", 5*time.Second, "Maximum number of seconds between log flushes") +const logFlushFreqFlagName = "log-flush-frequency" + +var logFlushFreq = pflag.Duration(logFlushFreqFlagName, 5*time.Second, "Maximum number of seconds between log flushes") // TODO(thockin): This is temporary until we agree on log dirs and put those into each cmd. func init() { flag.Set("logtostderr", "true") } +// AddFlags registers this package's flags on arbitrary FlagSets, such that they point to the +// same value as the global flags. +func AddFlags(fs *pflag.FlagSet) { + fs.AddFlag(pflag.Lookup(logFlushFreqFlagName)) +} + // GlogWriter serves as a bridge between the standard log package and the glog package. type GlogWriter struct{} @@ -46,8 +54,8 @@ func (writer GlogWriter) Write(data []byte) (n int, err error) { func InitLogs() { log.SetOutput(GlogWriter{}) log.SetFlags(0) - // The default glog flush interval is 30 seconds, which is frighteningly long. - go wait.Until(glog.Flush, *logFlushFreq, wait.NeverStop) + // The default glog flush interval is 5 seconds. + go wait.Forever(glog.Flush, *logFlushFreq) } // FlushLogs flushes logs immediately. diff --git a/vendor/k8s.io/apiserver/pkg/util/proxy/BUILD b/vendor/k8s.io/apiserver/pkg/util/proxy/BUILD index ca57a14dc..43caff5f0 100644 --- a/vendor/k8s.io/apiserver/pkg/util/proxy/BUILD +++ b/vendor/k8s.io/apiserver/pkg/util/proxy/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["proxy_test.go"], - importpath = "k8s.io/apiserver/pkg/util/proxy", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/util/webhook/BUILD b/vendor/k8s.io/apiserver/pkg/util/webhook/BUILD index e3624b96b..4cacaf511 100644 --- a/vendor/k8s.io/apiserver/pkg/util/webhook/BUILD +++ b/vendor/k8s.io/apiserver/pkg/util/webhook/BUILD @@ -29,8 +29,7 @@ go_test( "certs_test.go", "webhook_test.go", ], - importpath = "k8s.io/apiserver/pkg/util/webhook", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library", diff --git a/vendor/k8s.io/apiserver/pkg/util/webhook/webhook.go b/vendor/k8s.io/apiserver/pkg/util/webhook/webhook.go index 563a6eced..6893e834e 100755 --- a/vendor/k8s.io/apiserver/pkg/util/webhook/webhook.go +++ b/vendor/k8s.io/apiserver/pkg/util/webhook/webhook.go @@ -26,7 +26,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" - runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" @@ -71,7 +70,7 @@ func newGenericWebhook(registry *registered.APIRegistrationManager, codecFactory clientConfig.Timeout = requestTimeout codec := codecFactory.LegacyCodec(groupVersions...) - clientConfig.ContentConfig.NegotiatedSerializer = runtimeserializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{Serializer: codec}) + clientConfig.ContentConfig.NegotiatedSerializer = serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{Serializer: codec}) restClient, err := rest.UnversionedRESTClientFor(clientConfig) if err != nil { diff --git a/vendor/k8s.io/apiserver/pkg/util/webhook/webhook_test.go b/vendor/k8s.io/apiserver/pkg/util/webhook/webhook_test.go index f47e088be..8485e4f89 100644 --- a/vendor/k8s.io/apiserver/pkg/util/webhook/webhook_test.go +++ b/vendor/k8s.io/apiserver/pkg/util/webhook/webhook_test.go @@ -114,15 +114,15 @@ func TestKubeConfigFile(t *testing.T) { errRegex: errNoConfiguration, }, { - test: "missing context (specified context is missing)", - cluster: &namedCluster, - currentContext: "missing-context", - errRegex: errNoConfiguration, + test: "missing context (specified context is missing)", + cluster: &namedCluster, + errRegex: errNoConfiguration, }, { test: "context without cluster", context: &v1.NamedContext{ Context: v1.Context{}, + Name: "testing-context", }, currentContext: "testing-context", errRegex: errNoConfiguration, @@ -134,6 +134,7 @@ func TestKubeConfigFile(t *testing.T) { Context: v1.Context{ Cluster: namedCluster.Name, }, + Name: "testing-context", }, currentContext: "testing-context", errRegex: "", // Not an error at parse time, only when using the webhook @@ -145,6 +146,7 @@ func TestKubeConfigFile(t *testing.T) { Context: v1.Context{ Cluster: "missing-cluster", }, + Name: "fake", }, errRegex: errNoConfiguration, }, @@ -156,6 +158,7 @@ func TestKubeConfigFile(t *testing.T) { Cluster: namedCluster.Name, AuthInfo: "missing-user", }, + Name: "testing-context", }, currentContext: "testing-context", errRegex: "", // Not an error at parse time, only when using the webhook @@ -227,7 +230,7 @@ func TestKubeConfigFile(t *testing.T) { errRegex: "tls: found a certificate rather than a key in the PEM for the private key", }, { - test: "valid configuration (certificate data embeded in config)", + test: "valid configuration (certificate data embedded in config)", cluster: &defaultCluster, user: &defaultUser, errRegex: "", @@ -267,6 +270,8 @@ func TestKubeConfigFile(t *testing.T) { kubeConfig.AuthInfos = []v1.NamedAuthInfo{*tt.user} } + kubeConfig.CurrentContext = tt.currentContext + kubeConfigFile, err := newKubeConfigFile(kubeConfig) if err == nil { diff --git a/vendor/k8s.io/apiserver/pkg/util/wsstream/BUILD b/vendor/k8s.io/apiserver/pkg/util/wsstream/BUILD index 3dfab49fd..3d1c90f61 100644 --- a/vendor/k8s.io/apiserver/pkg/util/wsstream/BUILD +++ b/vendor/k8s.io/apiserver/pkg/util/wsstream/BUILD @@ -12,8 +12,7 @@ go_test( "conn_test.go", "stream_test.go", ], - importpath = "k8s.io/apiserver/pkg/util/wsstream", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/golang.org/x/net/websocket:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/plugin/pkg/audit/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/audit/BUILD index 34d23d7a1..fe8f7ce4f 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/audit/BUILD +++ b/vendor/k8s.io/apiserver/plugin/pkg/audit/BUILD @@ -22,6 +22,7 @@ filegroup( name = "all-srcs", srcs = [ ":package-srcs", + "//staging/src/k8s.io/apiserver/plugin/pkg/audit/buffered:all-srcs", "//staging/src/k8s.io/apiserver/plugin/pkg/audit/log:all-srcs", "//staging/src/k8s.io/apiserver/plugin/pkg/audit/webhook:all-srcs", ], diff --git a/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/BUILD new file mode 100644 index 000000000..7c461c4b4 --- /dev/null +++ b/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/BUILD @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = [ + "buffered.go", + "doc.go", + ], + importpath = "k8s.io/apiserver/plugin/pkg/audit/buffered", + visibility = ["//visibility:public"], + deps = [ + "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", + "//vendor/k8s.io/apiserver/pkg/apis/audit:go_default_library", + "//vendor/k8s.io/apiserver/pkg/audit:go_default_library", + "//vendor/k8s.io/client-go/util/flowcontrol:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = ["buffered_test.go"], + embed = [":go_default_library"], + deps = [ + "//vendor/github.com/stretchr/testify/require:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", + "//vendor/k8s.io/apiserver/pkg/apis/audit:go_default_library", + "//vendor/k8s.io/apiserver/pkg/audit:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/buffered.go b/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/buffered.go new file mode 100644 index 000000000..c4a08f3b2 --- /dev/null +++ b/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/buffered.go @@ -0,0 +1,283 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package buffered + +import ( + "fmt" + "sync" + "time" + + "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/util/wait" + auditinternal "k8s.io/apiserver/pkg/apis/audit" + "k8s.io/apiserver/pkg/audit" + "k8s.io/client-go/util/flowcontrol" +) + +// PluginName is the name reported in error metrics. +const PluginName = "buffered" + +const ( + // Default configuration values for ModeBatch. + defaultBatchBufferSize = 10000 // Buffer up to 10000 events before starting discarding. + defaultBatchMaxSize = 400 // Only send up to 400 events at a time. + defaultBatchMaxWait = 30 * time.Second // Send events at least twice a minute. + + defaultBatchThrottleQPS = 10 // Limit the send rate by 10 QPS. + defaultBatchThrottleBurst = 15 // Allow up to 15 QPS burst. +) + +// BatchConfig represents batching delegate audit backend configuration. +type BatchConfig struct { + // BufferSize defines a size of the buffering queue. + BufferSize int + // MaxBatchSize defines maximum size of a batch. + MaxBatchSize int + // MaxBatchWait indicates the maximum interval between two batches. + MaxBatchWait time.Duration + + // ThrottleEnable defines whether throttling will be applied to the batching process. + ThrottleEnable bool + // ThrottleQPS defines the allowed rate of batches per second sent to the delegate backend. + ThrottleQPS float32 + // ThrottleBurst defines the maximum rate of batches per second sent to the delegate backend in case + // the capacity defined by ThrottleQPS was not utilized. + ThrottleBurst int +} + +// NewDefaultBatchConfig returns new Config objects populated by default values. +func NewDefaultBatchConfig() BatchConfig { + return BatchConfig{ + BufferSize: defaultBatchBufferSize, + MaxBatchSize: defaultBatchMaxSize, + MaxBatchWait: defaultBatchMaxWait, + + ThrottleEnable: true, + ThrottleQPS: defaultBatchThrottleQPS, + ThrottleBurst: defaultBatchThrottleBurst, + } +} + +type bufferedBackend struct { + // The delegate backend that actually exports events. + delegateBackend audit.Backend + + // Channel to buffer events before sending to the delegate backend. + buffer chan *auditinternal.Event + // Maximum number of events in a batch sent to the delegate backend. + maxBatchSize int + // Amount of time to wait after sending a batch to the delegate backend before sending another one. + // + // Receiving maxBatchSize events will always trigger sending a batch, regardless of the amount of time passed. + maxBatchWait time.Duration + + // Channel to signal that the batching routine has processed all remaining events and exited. + // Once `shutdownCh` is closed no new events will be sent to the delegate backend. + shutdownCh chan struct{} + + // WaitGroup to control the concurrency of sending batches to the delegate backend. + // Worker routine calls Add before sending a batch and + // then spawns a routine that calls Done after batch was processed by the delegate backend. + // This WaitGroup is used to wait for all sending routines to finish before shutting down audit backend. + wg sync.WaitGroup + + // Limits the number of batches sent to the delegate backend per second. + throttle flowcontrol.RateLimiter +} + +var _ audit.Backend = &bufferedBackend{} + +// NewBackend returns a buffered audit backend that wraps delegate backend. +func NewBackend(delegate audit.Backend, config BatchConfig) audit.Backend { + var throttle flowcontrol.RateLimiter + if config.ThrottleEnable { + throttle = flowcontrol.NewTokenBucketRateLimiter(config.ThrottleQPS, config.ThrottleBurst) + } + return &bufferedBackend{ + delegateBackend: delegate, + buffer: make(chan *auditinternal.Event, config.BufferSize), + maxBatchSize: config.MaxBatchSize, + maxBatchWait: config.MaxBatchWait, + shutdownCh: make(chan struct{}), + wg: sync.WaitGroup{}, + throttle: throttle, + } +} + +func (b *bufferedBackend) Run(stopCh <-chan struct{}) error { + go func() { + // Signal that the working routine has exited. + defer close(b.shutdownCh) + + b.processIncomingEvents(stopCh) + + // Handle the events that were received after the last buffer + // scraping and before this line. Since the buffer is closed, no new + // events will come through. + allEventsProcessed := false + timer := make(chan time.Time) + for !allEventsProcessed { + allEventsProcessed = func() bool { + // Recover from any panic in order to try to process all remaining events. + // Note, that in case of a panic, the return value will be false and + // the loop execution will continue. + defer runtime.HandleCrash() + + events := b.collectEvents(timer, wait.NeverStop) + b.processEvents(events) + return len(events) == 0 + }() + } + }() + return b.delegateBackend.Run(stopCh) +} + +// Shutdown blocks until stopCh passed to the Run method is closed and all +// events added prior to that moment are batched and sent to the delegate backend. +func (b *bufferedBackend) Shutdown() { + // Wait until the routine spawned in Run method exits. + <-b.shutdownCh + + // Wait until all sending routines exit. + // + // - When b.shutdownCh is closed, we know that the goroutine in Run has terminated. + // - This means that processIncomingEvents has terminated. + // - Which means that b.buffer is closed and cannot accept any new events anymore. + // - Because processEvents is called synchronously from the Run goroutine, the waitgroup has its final value. + // Hence wg.Wait will not miss any more outgoing batches. + b.wg.Wait() + + b.delegateBackend.Shutdown() +} + +// processIncomingEvents runs a loop that collects events from the buffer. When +// b.stopCh is closed, processIncomingEvents stops and closes the buffer. +func (b *bufferedBackend) processIncomingEvents(stopCh <-chan struct{}) { + defer close(b.buffer) + t := time.NewTimer(b.maxBatchWait) + defer t.Stop() + + for { + func() { + // Recover from any panics caused by this function so a panic in the + // goroutine can't bring down the main routine. + defer runtime.HandleCrash() + + t.Reset(b.maxBatchWait) + b.processEvents(b.collectEvents(t.C, stopCh)) + }() + + select { + case <-stopCh: + return + default: + } + } +} + +// collectEvents attempts to collect some number of events in a batch. +// +// The following things can cause collectEvents to stop and return the list +// of events: +// +// * Maximum number of events for a batch. +// * Timer has passed. +// * Buffer channel is closed and empty. +// * stopCh is closed. +func (b *bufferedBackend) collectEvents(timer <-chan time.Time, stopCh <-chan struct{}) []*auditinternal.Event { + var events []*auditinternal.Event + +L: + for i := 0; i < b.maxBatchSize; i++ { + select { + case ev, ok := <-b.buffer: + // Buffer channel was closed and no new events will follow. + if !ok { + break L + } + events = append(events, ev) + case <-timer: + // Timer has expired. Send currently accumulated batch. + break L + case <-stopCh: + // Backend has been stopped. Send currently accumulated batch. + break L + } + } + + return events +} + +// processEvents process the batch events in a goroutine using delegateBackend's ProcessEvents. +func (b *bufferedBackend) processEvents(events []*auditinternal.Event) { + if len(events) == 0 { + return + } + + // TODO(audit): Should control the number of active goroutines + // if one goroutine takes 5 seconds to finish, the number of goroutines can be 5 * defaultBatchThrottleQPS + if b.throttle != nil { + b.throttle.Accept() + } + + b.wg.Add(1) + go func() { + defer b.wg.Done() + defer runtime.HandleCrash() + + // Execute the real processing in a goroutine to keep it from blocking. + // This lets the batching routine continue draining the queue immediately. + b.delegateBackend.ProcessEvents(events...) + }() +} + +func (b *bufferedBackend) ProcessEvents(ev ...*auditinternal.Event) { + // The following mechanism is in place to support the situation when audit + // events are still coming after the backend was stopped. + var sendErr error + var evIndex int + + // If the delegateBackend was shutdown and the buffer channel was closed, an + // attempt to add an event to it will result in panic that we should + // recover from. + defer func() { + if err := recover(); err != nil { + sendErr = fmt.Errorf("audit backend shut down") + } + if sendErr != nil { + audit.HandlePluginError(PluginName, sendErr, ev[evIndex:]...) + } + }() + + for i, e := range ev { + evIndex = i + // Per the audit.Backend interface these events are reused after being + // sent to the Sink. Deep copy and send the copy to the queue. + event := e.DeepCopy() + + select { + case b.buffer <- event: + default: + sendErr = fmt.Errorf("audit buffer queue blocked") + return + } + } +} + +func (b *bufferedBackend) String() string { + return fmt.Sprintf("%s<%s>", PluginName, b.delegateBackend) +} diff --git a/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/buffered_test.go b/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/buffered_test.go new file mode 100644 index 000000000..b70996468 --- /dev/null +++ b/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/buffered_test.go @@ -0,0 +1,181 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package buffered + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "k8s.io/apimachinery/pkg/util/wait" + auditinternal "k8s.io/apiserver/pkg/apis/audit" + "k8s.io/apiserver/pkg/audit" +) + +var ( + closedStopCh = func() <-chan struct{} { + ch := make(chan struct{}) + close(ch) + return ch + }() + infiniteTimeCh <-chan time.Time = make(chan time.Time) + closedTimeCh = func() <-chan time.Time { + ch := make(chan time.Time) + close(ch) + return ch + }() +) + +func newEvents(number int) []*auditinternal.Event { + events := make([]*auditinternal.Event, number) + for i := range events { + events[i] = &auditinternal.Event{} + } + + return events +} + +func TestBufferedBackendCollectEvents(t *testing.T) { + config := NewDefaultBatchConfig() + + testCases := []struct { + desc string + timer <-chan time.Time + stopCh <-chan struct{} + numEvents int + wantBatchSize int + }{ + { + desc: "max batch size encountered", + timer: infiniteTimeCh, + stopCh: wait.NeverStop, + numEvents: config.MaxBatchSize + 1, + wantBatchSize: config.MaxBatchSize, + }, + { + desc: "timer expired", + timer: closedTimeCh, + stopCh: wait.NeverStop, + }, + { + desc: "chanel closed", + timer: infiniteTimeCh, + stopCh: closedStopCh, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + t.Parallel() + + backend := NewBackend(&fakeBackend{}, config).(*bufferedBackend) + + backend.ProcessEvents(newEvents(tc.numEvents)...) + batch := backend.collectEvents(tc.timer, tc.stopCh) + + require.Equal(t, tc.wantBatchSize, len(batch), "unexpected batch size") + }) + } +} + +func TestBufferedBackendProcessEventsAfterStop(t *testing.T) { + t.Parallel() + + backend := NewBackend(&fakeBackend{}, NewDefaultBatchConfig()).(*bufferedBackend) + + backend.Run(closedStopCh) + backend.Shutdown() + backend.ProcessEvents(newEvents(1)...) + batch := backend.collectEvents(infiniteTimeCh, wait.NeverStop) + + require.Equal(t, 0, len(batch), "processed events after the backed has been stopped") +} + +func TestBufferedBackendProcessEventsBufferFull(t *testing.T) { + t.Parallel() + + config := NewDefaultBatchConfig() + config.BufferSize = 1 + backend := NewBackend(&fakeBackend{}, config).(*bufferedBackend) + + backend.ProcessEvents(newEvents(2)...) + + require.Equal(t, 1, len(backend.buffer), "buffed contains more elements than it should") +} + +func TestBufferedBackendShutdownWaitsForDelegatedCalls(t *testing.T) { + t.Parallel() + + delegatedCallStartCh := make(chan struct{}) + delegatedCallEndCh := make(chan struct{}) + delegateBackend := &fakeBackend{ + onRequest: func(_ []*auditinternal.Event) { + close(delegatedCallStartCh) + <-delegatedCallEndCh + }, + } + config := NewDefaultBatchConfig() + backend := NewBackend(delegateBackend, config) + + // Run backend, process events, wait for them to be batched and for delegated call to start. + stopCh := make(chan struct{}) + backend.Run(stopCh) + backend.ProcessEvents(newEvents(config.MaxBatchSize)...) + <-delegatedCallStartCh + + // Start shutdown procedure. + shutdownEndCh := make(chan struct{}) + go func() { + close(stopCh) + backend.Shutdown() + close(shutdownEndCh) + }() + + // Wait for some time and then check whether Shutdown has exited. Can give false positive, + // but never false negative. + time.Sleep(100 * time.Millisecond) + select { + case <-shutdownEndCh: + t.Fatalf("Shutdown exited before delegated call ended") + default: + } + + // Wait for Shutdown to exit after delegated call has exited. + close(delegatedCallEndCh) + <-shutdownEndCh +} + +type fakeBackend struct { + onRequest func(events []*auditinternal.Event) +} + +var _ audit.Backend = &fakeBackend{} + +func (b *fakeBackend) Run(stopCh <-chan struct{}) error { + return nil +} + +func (b *fakeBackend) Shutdown() { + return +} + +func (b *fakeBackend) ProcessEvents(ev ...*auditinternal.Event) { + if b.onRequest != nil { + b.onRequest(ev) + } +} diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone/doc.go b/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/doc.go similarity index 60% rename from vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone/doc.go rename to vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/doc.go index f61b6f7f7..a82599e42 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone/doc.go +++ b/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package keystone provides authentication via keystone. -// For details about keystone and how to use the plugin, refer to -// https://github.com/kubernetes/kubernetes.github.io/blob/master/docs/admin/authentication.md -package keystone // import "k8s.io/apiserver/plugin/pkg/authenticator/password/keystone" +// Package buffered provides an implementation for the audit.Backend interface +// that batches incoming audit events and sends batches to the delegate audit.Backend. +package buffered // import "k8s.io/apiserver/plugin/pkg/audit/buffered" diff --git a/vendor/k8s.io/apiserver/plugin/pkg/audit/log/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/audit/log/BUILD index a9011fc56..13f4422db 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/audit/log/BUILD +++ b/vendor/k8s.io/apiserver/plugin/pkg/audit/log/BUILD @@ -34,8 +34,7 @@ filegroup( go_test( name = "go_default_test", srcs = ["backend_test.go"], - importpath = "k8s.io/apiserver/plugin/pkg/audit/log", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/pborman/uuid:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library", diff --git a/vendor/k8s.io/apiserver/plugin/pkg/audit/log/backend.go b/vendor/k8s.io/apiserver/plugin/pkg/audit/log/backend.go index 7feb8f130..293cdd3c9 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/audit/log/backend.go +++ b/vendor/k8s.io/apiserver/plugin/pkg/audit/log/backend.go @@ -32,6 +32,9 @@ const ( FormatLegacy = "legacy" // FormatJson saves event in structured json format. FormatJson = "json" + + // PluginName is the name of this plugin, to be used in help and logs. + PluginName = "log" ) // AllowedFormats are the formats known by log backend. @@ -70,17 +73,17 @@ func (b *backend) logEvent(ev *auditinternal.Event) { case FormatJson: bs, err := runtime.Encode(audit.Codecs.LegacyCodec(b.groupVersion), ev) if err != nil { - audit.HandlePluginError("log", err, ev) + audit.HandlePluginError(PluginName, err, ev) return } line = string(bs[:]) default: - audit.HandlePluginError("log", fmt.Errorf("log format %q is not in list of known formats (%s)", + audit.HandlePluginError(PluginName, fmt.Errorf("log format %q is not in list of known formats (%s)", b.format, strings.Join(AllowedFormats, ",")), ev) return } if _, err := fmt.Fprint(b.out, line); err != nil { - audit.HandlePluginError("log", err, ev) + audit.HandlePluginError(PluginName, err, ev) } } @@ -91,3 +94,7 @@ func (b *backend) Run(stopCh <-chan struct{}) error { func (b *backend) Shutdown() { // Nothing to do here. } + +func (b *backend) String() string { + return PluginName +} diff --git a/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/BUILD index c233394a8..1fd9312ff 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/BUILD +++ b/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/BUILD @@ -8,12 +8,8 @@ load( go_test( name = "go_default_test", - srcs = [ - "webhook_test.go", - "webhook_v1alpha1_test.go", - ], - importpath = "k8s.io/apiserver/plugin/pkg/audit/webhook", - library = ":go_default_library", + srcs = ["webhook_test.go"], + embed = [":go_default_library"], deps = [ "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/github.com/stretchr/testify/require:go_default_library", @@ -21,7 +17,6 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/serializer/json:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/audit:go_default_library", - "//vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1:go_default_library", "//vendor/k8s.io/apiserver/pkg/audit:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd/api/v1:go_default_library", @@ -36,7 +31,6 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/audit:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/audit/install:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1:go_default_library", @@ -44,7 +38,6 @@ go_library( "//vendor/k8s.io/apiserver/pkg/audit:go_default_library", "//vendor/k8s.io/apiserver/pkg/util/webhook:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/util/flowcontrol:go_default_library", ], ) diff --git a/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go b/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go index 7f390ac57..eb2abada9 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go +++ b/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go @@ -18,16 +18,12 @@ limitations under the License. package webhook import ( - "errors" "fmt" - "strings" - "sync" "time" "k8s.io/apimachinery/pkg/apimachinery/announced" "k8s.io/apimachinery/pkg/apimachinery/registered" "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/runtime" auditinternal "k8s.io/apiserver/pkg/apis/audit" "k8s.io/apiserver/pkg/apis/audit/install" auditv1alpha1 "k8s.io/apiserver/pkg/apis/audit/v1alpha1" @@ -35,91 +31,17 @@ import ( "k8s.io/apiserver/pkg/audit" "k8s.io/apiserver/pkg/util/webhook" "k8s.io/client-go/rest" - "k8s.io/client-go/util/flowcontrol" ) const ( - // ModeBatch indicates that the webhook should buffer audit events - // internally, sending batch updates either once a certain number of - // events have been received or a certain amount of time has passed. - ModeBatch = "batch" - // ModeBlocking causes the webhook to block on every attempt to process - // a set of events. This causes requests to the API server to wait for a - // round trip to the external audit service before sending a response. - ModeBlocking = "blocking" -) - -// AllowedModes is the modes known by this webhook. -var AllowedModes = []string{ - ModeBatch, - ModeBlocking, -} - -const ( - // Default configuration values for ModeBatch. - defaultBatchBufferSize = 10000 // Buffer up to 10000 events before starting discarding. - defaultBatchMaxSize = 400 // Only send up to 400 events at a time. - defaultBatchMaxWait = 30 * time.Second // Send events at least twice a minute. - defaultInitialBackoff = 10 * time.Second // Wait at least 10 seconds before retrying. + // PluginName is the name of this plugin, to be used in help and logs. + PluginName = "webhook" - defaultBatchThrottleQPS = 10 // Limit the send rate by 10 QPS. - defaultBatchThrottleBurst = 15 // Allow up to 15 QPS burst. + // DefaultInitialBackoff is the default amount of time to wait before + // retrying sending audit events through a webhook. + DefaultInitialBackoff = 10 * time.Second ) -// The plugin name reported in error metrics. -const pluginName = "webhook" - -// BatchBackendConfig represents batching webhook audit backend configuration. -type BatchBackendConfig struct { - // BufferSize defines a size of the buffering queue. - BufferSize int - // MaxBatchSize defines maximum size of a batch. - MaxBatchSize int - // MaxBatchWait defines maximum amount of time to wait for MaxBatchSize - // events to be accumulated in the buffer before forcibly sending what's - // being accumulated. - MaxBatchWait time.Duration - - // ThrottleQPS defines the allowed rate of batches per second sent to the webhook. - ThrottleQPS float32 - // ThrottleBurst defines the maximum rate of batches per second sent to the webhook in case - // the capacity defined by ThrottleQPS was not utilized. - ThrottleBurst int - - // InitialBackoff defines the amount of time to wait before retrying the requests - // to the webhook for the first time. - InitialBackoff time.Duration -} - -// NewDefaultBatchBackendConfig returns new BatchBackendConfig objects populated by default values. -func NewDefaultBatchBackendConfig() BatchBackendConfig { - return BatchBackendConfig{ - BufferSize: defaultBatchBufferSize, - MaxBatchSize: defaultBatchMaxSize, - MaxBatchWait: defaultBatchMaxWait, - - ThrottleQPS: defaultBatchThrottleQPS, - ThrottleBurst: defaultBatchThrottleBurst, - - InitialBackoff: defaultInitialBackoff, - } -} - -// NewBackend returns an audit backend that sends events over HTTP to an external service. -// The mode indicates the caching behavior of the webhook. Either blocking (ModeBlocking) -// or buffered with batch POSTs (ModeBatch). -func NewBackend(kubeConfigFile string, mode string, groupVersion schema.GroupVersion, config BatchBackendConfig) (audit.Backend, error) { - switch mode { - case ModeBatch: - return newBatchWebhook(kubeConfigFile, groupVersion, config) - case ModeBlocking: - return newBlockingWebhook(kubeConfigFile, groupVersion) - default: - return nil, fmt.Errorf("webhook mode %q is not in list of known modes (%s)", - mode, strings.Join(AllowedModes, ",")) - } -} - var ( // NOTE: Copied from other webhook implementations // @@ -143,267 +65,43 @@ func loadWebhook(configFile string, groupVersion schema.GroupVersion, initialBac []schema.GroupVersion{groupVersion}, initialBackoff) } -func newBlockingWebhook(configFile string, groupVersion schema.GroupVersion) (*blockingBackend, error) { - w, err := loadWebhook(configFile, groupVersion, defaultInitialBackoff) +type backend struct { + w *webhook.GenericWebhook +} + +// NewBackend returns an audit backend that sends events over HTTP to an external service. +func NewBackend(kubeConfigFile string, groupVersion schema.GroupVersion, initialBackoff time.Duration) (audit.Backend, error) { + w, err := loadWebhook(kubeConfigFile, groupVersion, initialBackoff) if err != nil { return nil, err } - return &blockingBackend{w}, nil -} - -type blockingBackend struct { - w *webhook.GenericWebhook + return &backend{w}, nil } -func (b *blockingBackend) Run(stopCh <-chan struct{}) error { +func (b *backend) Run(stopCh <-chan struct{}) error { return nil } -func (b *blockingBackend) Shutdown() { +func (b *backend) Shutdown() { // nothing to do here } -func (b *blockingBackend) ProcessEvents(ev ...*auditinternal.Event) { +func (b *backend) ProcessEvents(ev ...*auditinternal.Event) { if err := b.processEvents(ev...); err != nil { - audit.HandlePluginError(pluginName, err, ev...) + audit.HandlePluginError(PluginName, err, ev...) } } -func (b *blockingBackend) processEvents(ev ...*auditinternal.Event) error { +func (b *backend) processEvents(ev ...*auditinternal.Event) error { var list auditinternal.EventList for _, e := range ev { list.Items = append(list.Items, *e) } - // NOTE: No exponential backoff because this is the blocking webhook - // mode. Any attempts to retry will block API server requests. - return b.w.RestClient.Post().Body(&list).Do().Error() -} - -func newBatchWebhook(configFile string, groupVersion schema.GroupVersion, config BatchBackendConfig) (*batchBackend, error) { - w, err := loadWebhook(configFile, groupVersion, config.InitialBackoff) - if err != nil { - return nil, err - } - - return &batchBackend{ - w: w, - buffer: make(chan *auditinternal.Event, config.BufferSize), - maxBatchSize: config.MaxBatchSize, - maxBatchWait: config.MaxBatchWait, - shutdownCh: make(chan struct{}), - throttle: flowcontrol.NewTokenBucketRateLimiter(config.ThrottleQPS, config.ThrottleBurst), - }, nil -} - -type batchBackend struct { - w *webhook.GenericWebhook - - // Channel to buffer events in memory before sending them on the webhook. - buffer chan *auditinternal.Event - // Maximum number of events that can be sent at once. - maxBatchSize int - // Amount of time to wait after sending events before force sending another set. - // - // Receiving maxBatchSize events will always trigger a send, regardless of - // if this amount of time has been reached. - maxBatchWait time.Duration - - // Channel to signal that the sending routine has stopped and therefore - // it's safe to assume that no new requests will be initiated. - shutdownCh chan struct{} - - // The sending routine locks reqMutex for reading before initiating a new - // goroutine to send a request. This goroutine then unlocks reqMutex for - // reading when completed. The Shutdown method locks reqMutex for writing - // after the sending routine has exited. When reqMutex is locked for writing, - // all requests have been completed and no new will be spawned, since the - // sending routine is not running anymore. - reqMutex sync.RWMutex - - // Limits the number of requests sent to the backend per second. - throttle flowcontrol.RateLimiter -} - -func (b *batchBackend) Run(stopCh <-chan struct{}) error { - go func() { - // Signal that the sending routine has exited. - defer close(b.shutdownCh) - - b.runSendingRoutine(stopCh) - - // Handle the events that were received after the last buffer - // scraping and before this line. Since the buffer is closed, no new - // events will come through. - for { - if last := func() bool { - // Recover from any panic in order to try to send all remaining events. - // Note, that in case of a panic, the return value will be false and - // the loop execution will continue. - defer runtime.HandleCrash() - - events := b.collectLastEvents() - b.sendBatchEvents(events) - return len(events) == 0 - }(); last { - break - } - } - }() - return nil -} - -func (b *batchBackend) Shutdown() { - <-b.shutdownCh - - // Write locking reqMutex will guarantee that all requests will be completed - // by the time the goroutine continues the execution. Since this line is - // executed after shutdownCh was closed, no new requests will follow this - // lock, because read lock is called in the same goroutine that closes - // shutdownCh before exiting. - b.reqMutex.Lock() - b.reqMutex.Unlock() -} - -// runSendingRoutine runs a loop that collects events from the buffer. When -// stopCh is closed, runSendingRoutine stops and closes the buffer. -func (b *batchBackend) runSendingRoutine(stopCh <-chan struct{}) { - defer close(b.buffer) - - for { - func() { - // Recover from any panics caused by this function so a panic in the - // goroutine can't bring down the main routine. - defer runtime.HandleCrash() - - t := time.NewTimer(b.maxBatchWait) - defer t.Stop() // Release ticker resources - - b.sendBatchEvents(b.collectEvents(stopCh, t.C)) - }() - - select { - case <-stopCh: - return - default: - } - } + return b.w.WithExponentialBackoff(func() rest.Result { + return b.w.RestClient.Post().Body(&list).Do() + }).Error() } -// collectEvents attempts to collect some number of events in a batch. -// -// The following things can cause collectEvents to stop and return the list -// of events: -// -// * Some maximum number of events are received. -// * Timer has passed, all queued events are sent. -// * StopCh is closed, all queued events are sent. -// -func (b *batchBackend) collectEvents(stopCh <-chan struct{}, timer <-chan time.Time) []auditinternal.Event { - var events []auditinternal.Event - -L: - for i := 0; i < b.maxBatchSize; i++ { - select { - case ev, ok := <-b.buffer: - // Buffer channel was closed and no new events will follow. - if !ok { - break L - } - events = append(events, *ev) - case <-timer: - // Timer has expired. Send whatever events are in the queue. - break L - case <-stopCh: - // Webhook has shut down. Send the last events. - break L - } - } - - return events -} - -// collectLastEvents assumes that the buffer was closed. It collects the first -// maxBatchSize events from the closed buffer into a batch and returns them. -func (b *batchBackend) collectLastEvents() []auditinternal.Event { - var events []auditinternal.Event - - for i := 0; i < b.maxBatchSize; i++ { - ev, ok := <-b.buffer - if !ok { - break - } - events = append(events, *ev) - } - - return events -} - -// sendBatchEvents sends a POST requests with the event list in a goroutine -// and logs any error encountered. -func (b *batchBackend) sendBatchEvents(events []auditinternal.Event) { - if len(events) == 0 { - return - } - - list := auditinternal.EventList{Items: events} - - if b.throttle != nil { - b.throttle.Accept() - } - - // Locking reqMutex for read will guarantee that the shutdown process will - // block until the goroutine started below is finished. At the same time, it - // will not prevent other batches from being proceed further this point. - b.reqMutex.RLock() - go func() { - // Execute the webhook POST in a goroutine to keep it from blocking. - // This lets the webhook continue to drain the queue immediatly. - - defer b.reqMutex.RUnlock() - defer runtime.HandleCrash() - - err := b.w.WithExponentialBackoff(func() rest.Result { - return b.w.RestClient.Post().Body(&list).Do() - }).Error() - if err != nil { - impacted := make([]*auditinternal.Event, len(events)) - for i := range events { - impacted[i] = &events[i] - } - audit.HandlePluginError(pluginName, err, impacted...) - } - }() - return -} - -func (b *batchBackend) ProcessEvents(ev ...*auditinternal.Event) { - for i, e := range ev { - // Per the audit.Backend interface these events are reused after being - // sent to the Sink. Deep copy and send the copy to the queue. - event := e.DeepCopy() - - // The following mechanism is in place to support the situation when audit - // events are still coming after the backend was shut down. - var sendErr error - func() { - // If the backend was shut down and the buffer channel was closed, an - // attempt to add an event to it will result in panic that we should - // recover from. - defer func() { - if err := recover(); err != nil { - sendErr = errors.New("audit webhook shut down") - } - }() - - select { - case b.buffer <- event: - default: - sendErr = errors.New("audit webhook queue blocked") - } - }() - if sendErr != nil { - audit.HandlePluginError(pluginName, sendErr, ev[i:]...) - return - } - } +func (b *backend) String() string { + return PluginName } diff --git a/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook_test.go b/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook_test.go index 62c09fb35..909c2b85d 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook_test.go +++ b/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook_test.go @@ -25,10 +25,7 @@ import ( "net/http/httptest" "os" "reflect" - "sync" - "sync/atomic" "testing" - "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -42,7 +39,7 @@ import ( "k8s.io/client-go/tools/clientcmd/api/v1" ) -// newWebhookHandler returns a handler which recieves webhook events and decodes the +// newWebhookHandler returns a handler which receives webhook events and decodes the // request body. The caller passes a callback which is called on each webhook POST. // The object passed to cb is of the same type as list. func newWebhookHandler(t *testing.T, list runtime.Object, cb func(events runtime.Object)) http.Handler { @@ -91,15 +88,7 @@ func (t *testWebhookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), http.StatusInternalServerError) } -func newTestBlockingWebhook(t *testing.T, endpoint string, groupVersion schema.GroupVersion) *blockingBackend { - return newWebhook(t, endpoint, ModeBlocking, groupVersion).(*blockingBackend) -} - -func newTestBatchWebhook(t *testing.T, endpoint string, groupVersion schema.GroupVersion) *batchBackend { - return newWebhook(t, endpoint, ModeBatch, groupVersion).(*batchBackend) -} - -func newWebhook(t *testing.T, endpoint string, mode string, groupVersion schema.GroupVersion) audit.Backend { +func newWebhook(t *testing.T, endpoint string, groupVersion schema.GroupVersion) *backend { config := v1.Config{ Clusters: []v1.NamedCluster{ {Cluster: v1.Cluster{Server: endpoint, InsecureSkipTLSVerify: true}}, @@ -116,10 +105,10 @@ func newWebhook(t *testing.T, endpoint string, mode string, groupVersion schema. // NOTE(ericchiang): Do we need to use a proper serializer? require.NoError(t, stdjson.NewEncoder(f).Encode(config), "writing kubeconfig") - backend, err := NewBackend(f.Name(), mode, groupVersion, NewDefaultBatchBackendConfig()) + b, err := NewBackend(f.Name(), groupVersion, DefaultInitialBackoff) require.NoError(t, err, "initializing backend") - return backend + return b.(*backend) } func TestWebhook(t *testing.T) { @@ -131,275 +120,9 @@ func TestWebhook(t *testing.T) { })) defer s.Close() - backend := newTestBlockingWebhook(t, s.URL, auditv1beta1.SchemeGroupVersion) + backend := newWebhook(t, s.URL, auditv1beta1.SchemeGroupVersion) // Ensure this doesn't return a serialization error. event := &auditinternal.Event{} require.NoError(t, backend.processEvents(event), "failed to send events") } - -// waitForEmptyBuffer indicates when the sendBatchEvents method has read from the -// existing buffer. This lets test coordinate closing a timer and stop channel -// until the for loop has read from the buffer. -func waitForEmptyBuffer(b *batchBackend) { - for len(b.buffer) != 0 { - time.Sleep(time.Millisecond) - } -} - -func TestBatchWebhookMaxEvents(t *testing.T) { - nRest := 10 - events := make([]*auditinternal.Event, defaultBatchMaxSize+nRest) // greater than max size. - for i := range events { - events[i] = &auditinternal.Event{} - } - - got := make(chan int, 2) - s := httptest.NewServer(newWebhookHandler(t, &auditv1beta1.EventList{}, func(events runtime.Object) { - got <- len(events.(*auditv1beta1.EventList).Items) - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1beta1.SchemeGroupVersion) - - backend.ProcessEvents(events...) - - stopCh := make(chan struct{}) - timer := make(chan time.Time, 1) - - backend.sendBatchEvents(backend.collectEvents(stopCh, timer)) - require.Equal(t, defaultBatchMaxSize, <-got, "did not get batch max size") - - go func() { - waitForEmptyBuffer(backend) // wait for the buffer to empty - timer <- time.Now() // Trigger the wait timeout - }() - - backend.sendBatchEvents(backend.collectEvents(stopCh, timer)) - require.Equal(t, nRest, <-got, "failed to get the rest of the events") -} - -func TestBatchWebhookStopCh(t *testing.T) { - events := make([]*auditinternal.Event, 1) // less than max size. - for i := range events { - events[i] = &auditinternal.Event{} - } - - expected := len(events) - got := make(chan int, 2) - s := httptest.NewServer(newWebhookHandler(t, &auditv1beta1.EventList{}, func(events runtime.Object) { - got <- len(events.(*auditv1beta1.EventList).Items) - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1beta1.SchemeGroupVersion) - backend.ProcessEvents(events...) - - stopCh := make(chan struct{}) - timer := make(chan time.Time) - - go func() { - waitForEmptyBuffer(backend) - close(stopCh) // stop channel has stopped - }() - backend.sendBatchEvents(backend.collectEvents(stopCh, timer)) - require.Equal(t, expected, <-got, "get queued events after timer expires") -} - -func TestBatchWebhookProcessEventsAfterStop(t *testing.T) { - events := make([]*auditinternal.Event, 1) // less than max size. - for i := range events { - events[i] = &auditinternal.Event{} - } - - got := make(chan struct{}) - s := httptest.NewServer(newWebhookHandler(t, &auditv1beta1.EventList{}, func(events runtime.Object) { - close(got) - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1beta1.SchemeGroupVersion) - stopCh := make(chan struct{}) - - backend.Run(stopCh) - close(stopCh) - <-backend.shutdownCh - backend.ProcessEvents(events...) - assert.Equal(t, 0, len(backend.buffer), "processed events after the backed has been stopped") -} - -func TestBatchWebhookShutdown(t *testing.T) { - events := make([]*auditinternal.Event, 1) - for i := range events { - events[i] = &auditinternal.Event{} - } - - got := make(chan struct{}) - contReqCh := make(chan struct{}) - shutdownCh := make(chan struct{}) - s := httptest.NewServer(newWebhookHandler(t, &auditv1beta1.EventList{}, func(events runtime.Object) { - close(got) - <-contReqCh - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1beta1.SchemeGroupVersion) - backend.ProcessEvents(events...) - - go func() { - // Assume stopCh was closed. - close(backend.buffer) - backend.sendBatchEvents(backend.collectLastEvents()) - }() - - <-got - - go func() { - close(backend.shutdownCh) - backend.Shutdown() - close(shutdownCh) - }() - - // Wait for some time in case there's a bug that allows for the Shutdown - // method to exit before all requests has been completed. - time.Sleep(1 * time.Second) - select { - case <-shutdownCh: - t.Fatal("Backend shut down before all requests finished") - default: - // Continue. - } - - close(contReqCh) - <-shutdownCh -} - -func TestBatchWebhookEmptyBuffer(t *testing.T) { - events := make([]*auditinternal.Event, 1) // less than max size. - for i := range events { - events[i] = &auditinternal.Event{} - } - - expected := len(events) - got := make(chan int, 2) - s := httptest.NewServer(newWebhookHandler(t, &auditv1beta1.EventList{}, func(events runtime.Object) { - got <- len(events.(*auditv1beta1.EventList).Items) - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1beta1.SchemeGroupVersion) - - stopCh := make(chan struct{}) - timer := make(chan time.Time, 1) - - timer <- time.Now() // Timer is done. - - // Buffer is empty, no events have been queued. This should exit but send no events. - backend.sendBatchEvents(backend.collectEvents(stopCh, timer)) - - // Send additional events after the sendBatchEvents has been called. - backend.ProcessEvents(events...) - go func() { - waitForEmptyBuffer(backend) - timer <- time.Now() - }() - - backend.sendBatchEvents(backend.collectEvents(stopCh, timer)) - - // Make sure we didn't get a POST with zero events. - require.Equal(t, expected, <-got, "expected one event") -} - -func TestBatchBufferFull(t *testing.T) { - events := make([]*auditinternal.Event, defaultBatchBufferSize+1) // More than buffered size - for i := range events { - events[i] = &auditinternal.Event{} - } - s := httptest.NewServer(newWebhookHandler(t, &auditv1beta1.EventList{}, func(events runtime.Object) { - // Do nothing. - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1beta1.SchemeGroupVersion) - - // Make sure this doesn't block. - backend.ProcessEvents(events...) -} - -func TestBatchRun(t *testing.T) { - - // Divisable by max batch size so we don't have to wait for a minute for - // the test to finish. - events := make([]*auditinternal.Event, defaultBatchMaxSize*3) - for i := range events { - events[i] = &auditinternal.Event{} - } - - got := new(int64) - want := len(events) - - wg := new(sync.WaitGroup) - wg.Add(want) - done := make(chan struct{}) - - go func() { - wg.Wait() - // When the expected number of events have been received, close the channel. - close(done) - }() - - s := httptest.NewServer(newWebhookHandler(t, &auditv1beta1.EventList{}, func(obj runtime.Object) { - events := obj.(*auditv1beta1.EventList) - atomic.AddInt64(got, int64(len(events.Items))) - wg.Add(-len(events.Items)) - })) - defer s.Close() - - stopCh := make(chan struct{}) - defer close(stopCh) - - backend := newTestBatchWebhook(t, s.URL, auditv1beta1.SchemeGroupVersion) - - // Test the Run codepath. E.g. that the spawned goroutines behave correctly. - backend.Run(stopCh) - - backend.ProcessEvents(events...) - - select { - case <-done: - // Received all the events. - case <-time.After(2 * time.Minute): - t.Errorf("expected %d events got %d", want, atomic.LoadInt64(got)) - } -} - -func TestBatchConcurrentRequests(t *testing.T) { - events := make([]*auditinternal.Event, defaultBatchBufferSize) // Don't drop events - for i := range events { - events[i] = &auditinternal.Event{} - } - - wg := new(sync.WaitGroup) - wg.Add(len(events)) - - s := httptest.NewServer(newWebhookHandler(t, &auditv1beta1.EventList{}, func(events runtime.Object) { - wg.Add(-len(events.(*auditv1beta1.EventList).Items)) - - // Since the webhook makes concurrent requests, blocking on the webhook response - // shouldn't block the webhook from sending more events. - // - // Wait for all responses to be received before sending the response. - wg.Wait() - })) - defer s.Close() - - stopCh := make(chan struct{}) - defer close(stopCh) - - backend := newTestBatchWebhook(t, s.URL, auditv1beta1.SchemeGroupVersion) - backend.Run(stopCh) - - backend.ProcessEvents(events...) - // Wait for the webhook to receive all events. - wg.Wait() -} diff --git a/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook_v1alpha1_test.go b/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook_v1alpha1_test.go deleted file mode 100644 index 6b6a1a895..000000000 --- a/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook_v1alpha1_test.go +++ /dev/null @@ -1,289 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package webhook - -import ( - "net/http/httptest" - "sync" - "sync/atomic" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "k8s.io/apimachinery/pkg/runtime" - auditinternal "k8s.io/apiserver/pkg/apis/audit" - auditv1alpha1 "k8s.io/apiserver/pkg/apis/audit/v1alpha1" -) - -func TestBatchWebhookMaxEventsV1Alpha1(t *testing.T) { - nRest := 10 - events := make([]*auditinternal.Event, defaultBatchMaxSize+nRest) // greater than max size. - for i := range events { - events[i] = &auditinternal.Event{} - } - - got := make(chan int, 2) - s := httptest.NewServer(newWebhookHandler(t, &auditv1alpha1.EventList{}, func(events runtime.Object) { - got <- len(events.(*auditv1alpha1.EventList).Items) - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1alpha1.SchemeGroupVersion) - - backend.ProcessEvents(events...) - - stopCh := make(chan struct{}) - timer := make(chan time.Time, 1) - - backend.sendBatchEvents(backend.collectEvents(stopCh, timer)) - require.Equal(t, defaultBatchMaxSize, <-got, "did not get batch max size") - - go func() { - waitForEmptyBuffer(backend) // wait for the buffer to empty - timer <- time.Now() // Trigger the wait timeout - }() - - backend.sendBatchEvents(backend.collectEvents(stopCh, timer)) - require.Equal(t, nRest, <-got, "failed to get the rest of the events") -} - -func TestBatchWebhookStopChV1Alpha1(t *testing.T) { - events := make([]*auditinternal.Event, 1) // less than max size. - for i := range events { - events[i] = &auditinternal.Event{} - } - - expected := len(events) - got := make(chan int, 2) - s := httptest.NewServer(newWebhookHandler(t, &auditv1alpha1.EventList{}, func(events runtime.Object) { - got <- len(events.(*auditv1alpha1.EventList).Items) - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1alpha1.SchemeGroupVersion) - backend.ProcessEvents(events...) - - stopCh := make(chan struct{}) - timer := make(chan time.Time) - - go func() { - waitForEmptyBuffer(backend) - close(stopCh) // stop channel has stopped - }() - backend.sendBatchEvents(backend.collectEvents(stopCh, timer)) - require.Equal(t, expected, <-got, "get queued events after timer expires") -} - -func TestBatchWebhookProcessEventsAfterStopV1Alpha1(t *testing.T) { - events := make([]*auditinternal.Event, 1) // less than max size. - for i := range events { - events[i] = &auditinternal.Event{} - } - - got := make(chan struct{}) - s := httptest.NewServer(newWebhookHandler(t, &auditv1alpha1.EventList{}, func(events runtime.Object) { - close(got) - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1alpha1.SchemeGroupVersion) - stopCh := make(chan struct{}) - - backend.Run(stopCh) - close(stopCh) - <-backend.shutdownCh - backend.ProcessEvents(events...) - assert.Equal(t, 0, len(backend.buffer), "processed events after the backed has been stopped") -} - -func TestBatchWebhookShutdownV1Alpha1(t *testing.T) { - events := make([]*auditinternal.Event, 1) - for i := range events { - events[i] = &auditinternal.Event{} - } - - got := make(chan struct{}) - contReqCh := make(chan struct{}) - shutdownCh := make(chan struct{}) - s := httptest.NewServer(newWebhookHandler(t, &auditv1alpha1.EventList{}, func(events runtime.Object) { - close(got) - <-contReqCh - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1alpha1.SchemeGroupVersion) - backend.ProcessEvents(events...) - - go func() { - // Assume stopCh was closed. - close(backend.buffer) - backend.sendBatchEvents(backend.collectLastEvents()) - }() - - <-got - - go func() { - close(backend.shutdownCh) - backend.Shutdown() - close(shutdownCh) - }() - - // Wait for some time in case there's a bug that allows for the Shutdown - // method to exit before all requests has been completed. - time.Sleep(1 * time.Second) - select { - case <-shutdownCh: - t.Fatal("Backend shut down before all requests finished") - default: - // Continue. - } - - close(contReqCh) - <-shutdownCh -} - -func TestBatchWebhookEmptyBufferV1Alpha1(t *testing.T) { - events := make([]*auditinternal.Event, 1) // less than max size. - for i := range events { - events[i] = &auditinternal.Event{} - } - - expected := len(events) - got := make(chan int, 2) - s := httptest.NewServer(newWebhookHandler(t, &auditv1alpha1.EventList{}, func(events runtime.Object) { - got <- len(events.(*auditv1alpha1.EventList).Items) - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1alpha1.SchemeGroupVersion) - - stopCh := make(chan struct{}) - timer := make(chan time.Time, 1) - - timer <- time.Now() // Timer is done. - - // Buffer is empty, no events have been queued. This should exit but send no events. - backend.sendBatchEvents(backend.collectEvents(stopCh, timer)) - - // Send additional events after the sendBatchEvents has been called. - backend.ProcessEvents(events...) - go func() { - waitForEmptyBuffer(backend) - timer <- time.Now() - }() - - backend.sendBatchEvents(backend.collectEvents(stopCh, timer)) - - // Make sure we didn't get a POST with zero events. - require.Equal(t, expected, <-got, "expected one event") -} - -func TestBatchBufferFullV1Alpha1(t *testing.T) { - events := make([]*auditinternal.Event, defaultBatchBufferSize+1) // More than buffered size - for i := range events { - events[i] = &auditinternal.Event{} - } - s := httptest.NewServer(newWebhookHandler(t, &auditv1alpha1.EventList{}, func(events runtime.Object) { - // Do nothing. - })) - defer s.Close() - - backend := newTestBatchWebhook(t, s.URL, auditv1alpha1.SchemeGroupVersion) - - // Make sure this doesn't block. - backend.ProcessEvents(events...) -} - -func TestBatchRunV1Alpha1(t *testing.T) { - - // Divisable by max batch size so we don't have to wait for a minute for - // the test to finish. - events := make([]*auditinternal.Event, defaultBatchMaxSize*3) - for i := range events { - events[i] = &auditinternal.Event{} - } - - got := new(int64) - want := len(events) - - wg := new(sync.WaitGroup) - wg.Add(want) - done := make(chan struct{}) - - go func() { - wg.Wait() - // When the expected number of events have been received, close the channel. - close(done) - }() - - s := httptest.NewServer(newWebhookHandler(t, &auditv1alpha1.EventList{}, func(obj runtime.Object) { - events := obj.(*auditv1alpha1.EventList) - atomic.AddInt64(got, int64(len(events.Items))) - wg.Add(-len(events.Items)) - })) - defer s.Close() - - stopCh := make(chan struct{}) - defer close(stopCh) - - backend := newTestBatchWebhook(t, s.URL, auditv1alpha1.SchemeGroupVersion) - - // Test the Run codepath. E.g. that the spawned goroutines behave correctly. - backend.Run(stopCh) - - backend.ProcessEvents(events...) - - select { - case <-done: - // Received all the events. - case <-time.After(2 * time.Minute): - t.Errorf("expected %d events got %d", want, atomic.LoadInt64(got)) - } -} - -func TestBatchConcurrentRequestsV1Alpha1(t *testing.T) { - events := make([]*auditinternal.Event, defaultBatchBufferSize) // Don't drop events - for i := range events { - events[i] = &auditinternal.Event{} - } - - wg := new(sync.WaitGroup) - wg.Add(len(events)) - - s := httptest.NewServer(newWebhookHandler(t, &auditv1alpha1.EventList{}, func(events runtime.Object) { - wg.Add(-len(events.(*auditv1alpha1.EventList).Items)) - - // Since the webhook makes concurrent requests, blocking on the webhook response - // shouldn't block the webhook from sending more events. - // - // Wait for all responses to be received before sending the response. - wg.Wait() - })) - defer s.Close() - - stopCh := make(chan struct{}) - defer close(stopCh) - - backend := newTestBatchWebhook(t, s.URL, auditv1alpha1.SchemeGroupVersion) - backend.Run(stopCh) - - backend.ProcessEvents(events...) - // Wait for the webhook to receive all events. - wg.Wait() -} diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/BUILD index ca23ee175..ed1d41513 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/BUILD +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/BUILD @@ -23,7 +23,6 @@ filegroup( srcs = [ ":package-srcs", "//staging/src/k8s.io/apiserver/plugin/pkg/authenticator/password/allow:all-srcs", - "//staging/src/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone:all-srcs", "//staging/src/k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile:all-srcs", ], tags = ["automanaged"], diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/allow/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/allow/BUILD index 780baffe0..ee53216ee 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/allow/BUILD +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/allow/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["allow_test.go"], - importpath = "k8s.io/apiserver/plugin/pkg/authenticator/password/allow", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone/BUILD deleted file mode 100644 index 52dfa3f61..000000000 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone/BUILD +++ /dev/null @@ -1,36 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "keystone.go", - ], - importpath = "k8s.io/apiserver/plugin/pkg/authenticator/password/keystone", - deps = [ - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/gophercloud/gophercloud:go_default_library", - "//vendor/github.com/gophercloud/gophercloud/openstack:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", - "//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library", - "//vendor/k8s.io/client-go/util/cert:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone/keystone.go b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone/keystone.go deleted file mode 100644 index fb035d4c9..000000000 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/keystone/keystone.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package keystone - -import ( - "crypto/tls" - "errors" - "net/http" - "strings" - - "github.com/golang/glog" - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack" - - netutil "k8s.io/apimachinery/pkg/util/net" - "k8s.io/apiserver/pkg/authentication/user" - certutil "k8s.io/client-go/util/cert" -) - -// KeystoneAuthenticator contacts openstack keystone to validate user's credentials passed in the request. -// The keystone endpoint is passed during apiserver startup -type KeystoneAuthenticator struct { - authURL string - transport http.RoundTripper -} - -// AuthenticatePassword checks the username, password via keystone call -func (keystoneAuthenticator *KeystoneAuthenticator) AuthenticatePassword(username string, password string) (user.Info, bool, error) { - opts := gophercloud.AuthOptions{ - IdentityEndpoint: keystoneAuthenticator.authURL, - Username: username, - Password: password, - } - - _, err := keystoneAuthenticator.AuthenticatedClient(opts) - if err != nil { - glog.Info("Failed: Starting openstack authenticate client:" + err.Error()) - return nil, false, errors.New("Failed to authenticate") - } - - return &user.DefaultInfo{Name: username}, true, nil -} - -// AuthenticatedClient logs in to an OpenStack cloud found at the identity endpoint specified by options, acquires a -// token, and returns a Client instance that's ready to operate. -func (keystoneAuthenticator *KeystoneAuthenticator) AuthenticatedClient(options gophercloud.AuthOptions) (*gophercloud.ProviderClient, error) { - client, err := openstack.NewClient(options.IdentityEndpoint) - if err != nil { - return nil, err - } - - if keystoneAuthenticator.transport != nil { - client.HTTPClient.Transport = keystoneAuthenticator.transport - } - - err = openstack.Authenticate(client, options) - return client, err -} - -// NewKeystoneAuthenticator returns a password authenticator that validates credentials using openstack keystone -func NewKeystoneAuthenticator(authURL string, caFile string) (*KeystoneAuthenticator, error) { - if !strings.HasPrefix(authURL, "https") { - return nil, errors.New("Auth URL should be secure and start with https") - } - if authURL == "" { - return nil, errors.New("Auth URL is empty") - } - if caFile != "" { - roots, err := certutil.NewPool(caFile) - if err != nil { - return nil, err - } - config := &tls.Config{} - config.RootCAs = roots - transport := netutil.SetOldTransportDefaults(&http.Transport{TLSClientConfig: config}) - return &KeystoneAuthenticator{authURL, transport}, nil - } - - return &KeystoneAuthenticator{authURL: authURL}, nil -} diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile/BUILD index e06ad49b9..bbb163a9b 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile/BUILD +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["passwordfile_test.go"], - importpath = "k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library"], ) diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/request/basicauth/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/request/basicauth/BUILD index 219a41d2d..dfab4b400 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/request/basicauth/BUILD +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/request/basicauth/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["basicauth_test.go"], - importpath = "k8s.io/apiserver/plugin/pkg/authenticator/request/basicauth", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library", "//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library", diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/BUILD index 0d75a2598..e62aba93a 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/BUILD +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/BUILD @@ -9,13 +9,12 @@ load( go_test( name = "go_default_test", srcs = ["oidc_test.go"], - importpath = "k8s.io/apiserver/plugin/pkg/authenticator/token/oidc", - library = ":go_default_library", + data = glob(["testdata/**"]), + embed = [":go_default_library"], deps = [ - "//vendor/github.com/coreos/go-oidc/jose:go_default_library", - "//vendor/github.com/coreos/go-oidc/oidc:go_default_library", + "//vendor/github.com/coreos/go-oidc:go_default_library", + "//vendor/gopkg.in/square/go-jose.v2:go_default_library", "//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library", - "//vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testing:go_default_library", ], ) @@ -24,11 +23,10 @@ go_library( srcs = ["oidc.go"], importpath = "k8s.io/apiserver/plugin/pkg/authenticator/token/oidc", deps = [ - "//vendor/github.com/coreos/go-oidc/jose:go_default_library", - "//vendor/github.com/coreos/go-oidc/oidc:go_default_library", + "//vendor/github.com/coreos/go-oidc:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library", "//vendor/k8s.io/client-go/util/cert:go_default_library", ], @@ -43,9 +41,6 @@ filegroup( filegroup( name = "all-srcs", - srcs = [ - ":package-srcs", - "//staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testing:all-srcs", - ], + srcs = [":package-srcs"], tags = ["automanaged"], ) diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/OWNERS b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/OWNERS index d2210cb89..e0f3c6ca9 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/OWNERS +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/OWNERS @@ -2,3 +2,4 @@ approvers: - ericchiang reviewers: - ericchiang +- rithujohn191 diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc.go b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc.go index a8c95ecb8..c33c540c0 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc.go +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc.go @@ -17,7 +17,7 @@ limitations under the License. /* oidc implements the authenticator.Token interface using the OpenID Connect protocol. - config := oidc.OIDCOptions{ + config := oidc.Options{ IssuerURL: "https://accounts.google.com", ClientID: os.Getenv("GOOGLE_CLIENT_ID"), UsernameClaim: "email", @@ -27,25 +27,28 @@ oidc implements the authenticator.Token interface using the OpenID Connect proto package oidc import ( + "context" "crypto/tls" "crypto/x509" + "encoding/base64" + "encoding/json" "errors" "fmt" "net/http" "net/url" - "sync" + "strings" "sync/atomic" + "time" - "github.com/coreos/go-oidc/jose" - "github.com/coreos/go-oidc/oidc" + oidc "github.com/coreos/go-oidc" "github.com/golang/glog" "k8s.io/apimachinery/pkg/util/net" - "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apiserver/pkg/authentication/user" certutil "k8s.io/client-go/util/cert" ) -type OIDCOptions struct { +type Options struct { // IssuerURL is the URL the provider signs ID Tokens as. This will be the "iss" // field of all tokens produced by the provider and is used for configuration // discovery. @@ -83,30 +86,85 @@ type OIDCOptions struct { // GroupsPrefix, if specified, causes claims mapping to group names to be prefixed with the // value. A value "oidc:" would result in groups like "oidc:engineering" and "oidc:marketing". GroupsPrefix string + + // SupportedSigningAlgs sets the accepted set of JOSE signing algorithms that + // can be used by the provider to sign tokens. + // + // https://tools.ietf.org/html/rfc7518#section-3.1 + // + // This value defaults to RS256, the value recommended by the OpenID Connect + // spec: + // + // https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation + SupportedSigningAlgs []string + + // now is used for testing. It defaults to time.Now. + now func() time.Time } -type OIDCAuthenticator struct { +type Authenticator struct { issuerURL string - trustedClientID string - usernameClaim string usernamePrefix string groupsClaim string groupsPrefix string - httpClient *http.Client + // Contains an *oidc.IDTokenVerifier. Do not access directly use the + // idTokenVerifier method. + verifier atomic.Value - // Contains an *oidc.Client. Do not access directly. Use client() method. - oidcClient atomic.Value + cancel context.CancelFunc +} - // Guards the close method and is used to lock during initialization and closing. - mu sync.Mutex - close func() // May be nil +func (a *Authenticator) setVerifier(v *oidc.IDTokenVerifier) { + a.verifier.Store(v) } -// New creates a token authenticator which validates OpenID Connect ID Tokens. -func New(opts OIDCOptions) (*OIDCAuthenticator, error) { +func (a *Authenticator) idTokenVerifier() (*oidc.IDTokenVerifier, bool) { + if v := a.verifier.Load(); v != nil { + return v.(*oidc.IDTokenVerifier), true + } + return nil, false +} + +func (a *Authenticator) Close() { + a.cancel() +} + +func New(opts Options) (*Authenticator, error) { + return newAuthenticator(opts, func(ctx context.Context, a *Authenticator, config *oidc.Config) { + // Asynchronously attempt to initialize the authenticator. This enables + // self-hosted providers, providers that run on top of Kubernetes itself. + go wait.PollUntil(time.Second*10, func() (done bool, err error) { + provider, err := oidc.NewProvider(ctx, a.issuerURL) + if err != nil { + glog.Errorf("oidc authenticator: initializing plugin: %v", err) + return false, nil + } + + verifier := provider.Verifier(config) + a.setVerifier(verifier) + return true, nil + }, ctx.Done()) + }) +} + +// whitelist of signing algorithms to ensure users don't mistakenly pass something +// goofy. +var allowedSigningAlgs = map[string]bool{ + oidc.RS256: true, + oidc.RS384: true, + oidc.RS512: true, + oidc.ES256: true, + oidc.ES384: true, + oidc.ES512: true, + oidc.PS256: true, + oidc.PS384: true, + oidc.PS512: true, +} + +func newAuthenticator(opts Options, initVerifier func(ctx context.Context, a *Authenticator, config *oidc.Config)) (*Authenticator, error) { url, err := url.Parse(opts.IssuerURL) if err != nil { return nil, err @@ -120,6 +178,18 @@ func New(opts OIDCOptions) (*OIDCAuthenticator, error) { return nil, errors.New("no username claim provided") } + supportedSigningAlgs := opts.SupportedSigningAlgs + if len(supportedSigningAlgs) == 0 { + // RS256 is the default recommended by OpenID Connect and an 'alg' value + // providers are required to implement. + supportedSigningAlgs = []string{oidc.RS256} + } + for _, alg := range supportedSigningAlgs { + if !allowedSigningAlgs[alg] { + return nil, fmt.Errorf("oidc: unsupported signing alg: %q", alg) + } + } + var roots *x509.CertPool if opts.CAFile != "" { roots, err = certutil.NewPool(opts.CAFile) @@ -137,137 +207,91 @@ func New(opts OIDCOptions) (*OIDCAuthenticator, error) { TLSClientConfig: &tls.Config{RootCAs: roots}, }) - authenticator := &OIDCAuthenticator{ - issuerURL: opts.IssuerURL, - trustedClientID: opts.ClientID, - usernameClaim: opts.UsernameClaim, - usernamePrefix: opts.UsernamePrefix, - groupsClaim: opts.GroupsClaim, - groupsPrefix: opts.GroupsPrefix, - httpClient: &http.Client{Transport: tr}, - } - - // Attempt to initialize the authenticator asynchronously. - // - // Ignore errors instead of returning it since the OpenID Connect provider might not be - // available yet, for instance if it's running on the cluster and needs the API server - // to come up first. Errors will be logged within the client() method. - go func() { - defer runtime.HandleCrash() - authenticator.client() - }() - - return authenticator, nil -} + client := &http.Client{Transport: tr, Timeout: 30 * time.Second} -// Close stops all goroutines used by the authenticator. -func (a *OIDCAuthenticator) Close() { - a.mu.Lock() - defer a.mu.Unlock() + ctx, cancel := context.WithCancel(context.Background()) + ctx = oidc.ClientContext(ctx, client) - if a.close != nil { - a.close() + authenticator := &Authenticator{ + issuerURL: opts.IssuerURL, + usernameClaim: opts.UsernameClaim, + usernamePrefix: opts.UsernamePrefix, + groupsClaim: opts.GroupsClaim, + groupsPrefix: opts.GroupsPrefix, + cancel: cancel, } - return -} -func (a *OIDCAuthenticator) client() (*oidc.Client, error) { - // Fast check to see if client has already been initialized. - if client := a.oidcClient.Load(); client != nil { - return client.(*oidc.Client), nil + now := opts.now + if now == nil { + now = time.Now } - // Acquire lock, then recheck initialization. - a.mu.Lock() - defer a.mu.Unlock() - if client := a.oidcClient.Load(); client != nil { - return client.(*oidc.Client), nil + verifierConfig := &oidc.Config{ + ClientID: opts.ClientID, + SupportedSigningAlgs: supportedSigningAlgs, + Now: now, } - // Try to initialize client. - providerConfig, err := oidc.FetchProviderConfig(a.httpClient, a.issuerURL) - if err != nil { - glog.Errorf("oidc authenticator: failed to fetch provider discovery data: %v", err) - return nil, fmt.Errorf("fetch provider config: %v", err) - } + initVerifier(ctx, authenticator, verifierConfig) + return authenticator, nil +} - clientConfig := oidc.ClientConfig{ - HTTPClient: a.httpClient, - Credentials: oidc.ClientCredentials{ID: a.trustedClientID}, - ProviderConfig: providerConfig, +func hasCorrectIssuer(iss, tokenData string) bool { + parts := strings.Split(tokenData, ".") + if len(parts) != 3 { + return false } - - client, err := oidc.NewClient(clientConfig) + payload, err := base64.RawURLEncoding.DecodeString(parts[1]) if err != nil { - glog.Errorf("oidc authenticator: failed to create client: %v", err) - return nil, fmt.Errorf("create client: %v", err) + return false } - - // SyncProviderConfig will start a goroutine to periodically synchronize the provider config. - // The synchronization interval is set by the expiration length of the config, and has a minimum - // and maximum threshold. - stop := client.SyncProviderConfig(a.issuerURL) - a.oidcClient.Store(client) - a.close = func() { - // This assumes the stop is an unbuffered channel. - // So instead of closing the channel, we send am empty struct here. - // This guarantees that when this function returns, there is no flying requests, - // because a send to an unbuffered channel happens after the receive from the channel. - stop <- struct{}{} + claims := struct { + // WARNING: this JWT is not verified. Do not trust these claims. + Issuer string `json:"iss"` + }{} + if err := json.Unmarshal(payload, &claims); err != nil { + return false } - return client, nil + if claims.Issuer != iss { + return false + } + return true } -// AuthenticateToken decodes and verifies an ID Token using the OIDC client, if the verification succeeds, -// then it will extract the user info from the JWT claims. -func (a *OIDCAuthenticator) AuthenticateToken(value string) (user.Info, bool, error) { - jwt, err := jose.ParseJWT(value) - if err != nil { - return nil, false, err +func (a *Authenticator) AuthenticateToken(token string) (user.Info, bool, error) { + if !hasCorrectIssuer(a.issuerURL, token) { + return nil, false, nil } - client, err := a.client() - if err != nil { - return nil, false, err - } - if err := client.VerifyJWT(jwt); err != nil { - return nil, false, err + ctx := context.Background() + verifier, ok := a.idTokenVerifier() + if !ok { + return nil, false, fmt.Errorf("oidc: authenticator not initialized") } - claims, err := jwt.Claims() + + idToken, err := verifier.Verify(ctx, token) if err != nil { - return nil, false, err + return nil, false, fmt.Errorf("oidc: verify token: %v", err) } - return a.parseTokenClaims(claims) -} -// parseTokenClaims maps a set of claims to a user. It performs basic validation such as -// ensuring the email is verified. -func (a *OIDCAuthenticator) parseTokenClaims(claims jose.Claims) (user.Info, bool, error) { - username, ok, err := claims.StringClaim(a.usernameClaim) - if err != nil { - return nil, false, err + var c claims + if err := idToken.Claims(&c); err != nil { + return nil, false, fmt.Errorf("oidc: parse claims: %v", err) } - if !ok { - return nil, false, fmt.Errorf("cannot find %q in JWT claims", a.usernameClaim) + var username string + if err := c.unmarshalClaim(a.usernameClaim, &username); err != nil { + return nil, false, fmt.Errorf("oidc: parse username claims %q: %v", a.usernameClaim, err) } if a.usernameClaim == "email" { - verified, ok := claims["email_verified"] - if !ok { - return nil, false, errors.New("'email_verified' claim not present") - } - - emailVerified, ok := verified.(bool) - if !ok { - // OpenID Connect spec defines 'email_verified' as a boolean. For now, be a pain and error if - // it's a different type. If there are enough misbehaving providers we can relax this latter. - // - // See: https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims - return nil, false, fmt.Errorf("malformed claim 'email_verified', expected boolean got %T", verified) + // Check the email_verified claim to ensure the email is valid. + // https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims + var emailVerified bool + if err := c.unmarshalClaim("email_verified", &emailVerified); err != nil { + return nil, false, fmt.Errorf("oidc: parse 'email_verified' claim: %v", err) } - if !emailVerified { - return nil, false, errors.New("email not verified") + return nil, false, fmt.Errorf("oidc: email not verified") } } @@ -275,21 +299,18 @@ func (a *OIDCAuthenticator) parseTokenClaims(claims jose.Claims) (user.Info, boo username = a.usernamePrefix + username } - // TODO(yifan): Add UID, also populate the issuer to upper layer. info := &user.DefaultInfo{Name: username} - if a.groupsClaim != "" { - groups, found, err := claims.StringsClaim(a.groupsClaim) - if err != nil { - // Groups type is present but is not an array of strings, try to decode as a string. - group, _, err := claims.StringClaim(a.groupsClaim) - if err != nil { - // Custom claim is present, but isn't an array of strings or a string. - return nil, false, fmt.Errorf("custom group claim contains invalid type: %T", claims[a.groupsClaim]) + if _, ok := c[a.groupsClaim]; ok { + // Some admins want to use string claims like "role" as the group value. + // Allow the group claim to be a single string instead of an array. + // + // See: https://github.com/kubernetes/kubernetes/issues/33290 + var groups stringOrArray + if err := c.unmarshalClaim(a.groupsClaim, &groups); err != nil { + return nil, false, fmt.Errorf("oidc: parse groups claim %q: %v", a.groupsClaim, err) } - info.Groups = []string{group} - } else if found { - info.Groups = groups + info.Groups = []string(groups) } } @@ -298,6 +319,31 @@ func (a *OIDCAuthenticator) parseTokenClaims(claims jose.Claims) (user.Info, boo info.Groups[i] = a.groupsPrefix + group } } - return info, true, nil } + +type stringOrArray []string + +func (s *stringOrArray) UnmarshalJSON(b []byte) error { + var a []string + if err := json.Unmarshal(b, &a); err == nil { + *s = a + return nil + } + var str string + if err := json.Unmarshal(b, &str); err != nil { + return err + } + *s = []string{str} + return nil +} + +type claims map[string]json.RawMessage + +func (c claims) unmarshalClaim(name string, v interface{}) error { + val, ok := c[name] + if !ok { + return fmt.Errorf("claim not present") + } + return json.Unmarshal([]byte(val), v) +} diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc_test.go b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc_test.go index f94d91b1a..412c32a6f 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc_test.go +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc_test.go @@ -17,518 +17,754 @@ limitations under the License. package oidc import ( - "os" - "path" + "context" + "crypto" + "crypto/x509" + "encoding/hex" + "encoding/json" + "encoding/pem" + "fmt" + "io/ioutil" "reflect" - "sort" "strings" "testing" "time" - "github.com/coreos/go-oidc/jose" - "github.com/coreos/go-oidc/oidc" - + oidc "github.com/coreos/go-oidc" + jose "gopkg.in/square/go-jose.v2" "k8s.io/apiserver/pkg/authentication/user" - oidctesting "k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testing" ) -func generateToken(t *testing.T, op *oidctesting.OIDCProvider, iss, sub, aud string, usernameClaim, value, groupsClaim string, groups interface{}, iat, exp time.Time, emailVerified bool) string { - claims := oidc.NewClaims(iss, sub, aud, iat, exp) - claims.Add(usernameClaim, value) - if groups != nil && groupsClaim != "" { - claims.Add(groupsClaim, groups) - } - claims.Add("email_verified", emailVerified) +// utilities for loading JOSE keys. - signer := op.PrivKey.Signer() - jwt, err := jose.NewSignedJWT(claims, signer) - if err != nil { - t.Fatalf("Cannot generate token: %v", err) - return "" - } - return jwt.Encode() +func loadRSAKey(t *testing.T, filepath string, alg jose.SignatureAlgorithm) *jose.JSONWebKey { + return loadKey(t, filepath, alg, func(b []byte) (interface{}, error) { + key, err := x509.ParsePKCS1PrivateKey(b) + if err != nil { + return nil, err + } + return key.Public(), nil + }) } -func generateTokenWithUnverifiedEmail(t *testing.T, op *oidctesting.OIDCProvider, iss, sub, aud string, email string) string { - return generateToken(t, op, iss, sub, aud, "email", email, "", nil, time.Now(), time.Now().Add(time.Hour), false) +func loadRSAPrivKey(t *testing.T, filepath string, alg jose.SignatureAlgorithm) *jose.JSONWebKey { + return loadKey(t, filepath, alg, func(b []byte) (interface{}, error) { + return x509.ParsePKCS1PrivateKey(b) + }) } -func generateGoodToken(t *testing.T, op *oidctesting.OIDCProvider, iss, sub, aud string, usernameClaim, value, groupsClaim string, groups interface{}) string { - return generateToken(t, op, iss, sub, aud, usernameClaim, value, groupsClaim, groups, time.Now(), time.Now().Add(time.Hour), true) +func loadECDSAKey(t *testing.T, filepath string, alg jose.SignatureAlgorithm) *jose.JSONWebKey { + return loadKey(t, filepath, alg, func(b []byte) (interface{}, error) { + key, err := x509.ParseECPrivateKey(b) + if err != nil { + return nil, err + } + return key.Public(), nil + }) } -func generateMalformedToken(t *testing.T, op *oidctesting.OIDCProvider, iss, sub, aud string, usernameClaim, value, groupsClaim string, groups interface{}) string { - return generateToken(t, op, iss, sub, aud, usernameClaim, value, groupsClaim, groups, time.Now(), time.Now().Add(time.Hour), true) + "randombits" +func loadECDSAPrivKey(t *testing.T, filepath string, alg jose.SignatureAlgorithm) *jose.JSONWebKey { + return loadKey(t, filepath, alg, func(b []byte) (interface{}, error) { + return x509.ParseECPrivateKey(b) + }) } -func generateExpiredToken(t *testing.T, op *oidctesting.OIDCProvider, iss, sub, aud string, usernameClaim, value, groupsClaim string, groups interface{}) string { - return generateToken(t, op, iss, sub, aud, usernameClaim, value, groupsClaim, groups, time.Now().Add(-2*time.Hour), time.Now().Add(-1*time.Hour), true) +func loadKey(t *testing.T, filepath string, alg jose.SignatureAlgorithm, unmarshal func([]byte) (interface{}, error)) *jose.JSONWebKey { + data, err := ioutil.ReadFile(filepath) + if err != nil { + t.Fatalf("load file: %v", err) + } + block, _ := pem.Decode(data) + if block == nil { + t.Fatalf("file contained no PEM encoded data: %s", filepath) + } + priv, err := unmarshal(block.Bytes) + if err != nil { + t.Fatalf("unmarshal key: %v", err) + } + key := &jose.JSONWebKey{Key: priv, Use: "sig", Algorithm: string(alg)} + thumbprint, err := key.Thumbprint(crypto.SHA256) + if err != nil { + t.Fatalf("computing thumbprint: %v", err) + } + key.KeyID = hex.EncodeToString(thumbprint) + return key } -func TestTLSConfig(t *testing.T) { - // Verify the cert/key pair works. - cert1 := path.Join(os.TempDir(), "oidc-cert-1") - key1 := path.Join(os.TempDir(), "oidc-key-1") - cert2 := path.Join(os.TempDir(), "oidc-cert-2") - key2 := path.Join(os.TempDir(), "oidc-key-2") - - defer os.Remove(cert1) - defer os.Remove(key1) - defer os.Remove(cert2) - defer os.Remove(key2) - - oidctesting.GenerateSelfSignedCert(t, "127.0.0.1", cert1, key1) - oidctesting.GenerateSelfSignedCert(t, "127.0.0.1", cert2, key2) - - tests := []struct { - testCase string - - serverCertFile string - serverKeyFile string - - trustedCertFile string +// staticKeySet implements oidc.KeySet. +type staticKeySet struct { + keys []*jose.JSONWebKey +} - wantErr bool - }{ - { - testCase: "provider using untrusted custom cert", - serverCertFile: cert1, - serverKeyFile: key1, - wantErr: true, - }, - { - testCase: "provider using untrusted cert", - serverCertFile: cert1, - serverKeyFile: key1, - trustedCertFile: cert2, - wantErr: true, - }, - { - testCase: "provider using trusted cert", - serverCertFile: cert1, - serverKeyFile: key1, - trustedCertFile: cert1, - wantErr: false, - }, +func (s *staticKeySet) VerifySignature(ctx context.Context, jwt string) (payload []byte, err error) { + jws, err := jose.ParseSigned(jwt) + if err != nil { + return nil, err } + if len(jws.Signatures) == 0 { + return nil, fmt.Errorf("jwt contained no signatures") + } + kid := jws.Signatures[0].Header.KeyID - for _, tc := range tests { - func() { - op := oidctesting.NewOIDCProvider(t, "") - srv, err := op.ServeTLSWithKeyPair(tc.serverCertFile, tc.serverKeyFile) - if err != nil { - t.Errorf("%s: %v", tc.testCase, err) - return - } - defer srv.Close() - - issuer := srv.URL - clientID := "client-foo" - - options := OIDCOptions{ - IssuerURL: srv.URL, - ClientID: clientID, - CAFile: tc.trustedCertFile, - UsernameClaim: "email", - GroupsClaim: "groups", - } - - authenticator, err := New(options) - if err != nil { - t.Errorf("%s: failed to initialize authenticator: %v", tc.testCase, err) - return - } - defer authenticator.Close() - - email := "user-1@example.com" - groups := []string{"group1", "group2"} - sort.Strings(groups) - - token := generateGoodToken(t, op, issuer, "user-1", clientID, "email", email, "groups", groups) - - // Because this authenticator behaves differently for subsequent requests, run these - // tests multiple times (but expect the same result). - for i := 1; i < 4; i++ { - - user, ok, err := authenticator.AuthenticateToken(token) - if err != nil { - if !tc.wantErr { - t.Errorf("%s (req #%d): failed to authenticate token: %v", tc.testCase, i, err) - } - continue - } - - if tc.wantErr { - t.Errorf("%s (req #%d): expected error authenticating", tc.testCase, i) - continue - } - if !ok { - t.Errorf("%s (req #%d): did not get user or error", tc.testCase, i) - continue - } - - if gotUsername := user.GetName(); email != gotUsername { - t.Errorf("%s (req #%d): GetName() expected=%q got %q", tc.testCase, i, email, gotUsername) - } - gotGroups := user.GetGroups() - sort.Strings(gotGroups) - if !reflect.DeepEqual(gotGroups, groups) { - t.Errorf("%s (req #%d): GetGroups() expected=%q got %q", tc.testCase, i, groups, gotGroups) - } - } - }() + for _, key := range s.keys { + if key.KeyID == kid { + return jws.Verify(key) + } } + + return nil, fmt.Errorf("no keys matches jwk keyid") } -func TestOIDCAuthentication(t *testing.T) { - cert := path.Join(os.TempDir(), "oidc-cert") - key := path.Join(os.TempDir(), "oidc-key") +var ( + expired, _ = time.Parse(time.RFC3339Nano, "2009-11-10T22:00:00Z") + now, _ = time.Parse(time.RFC3339Nano, "2009-11-10T23:00:00Z") + valid, _ = time.Parse(time.RFC3339Nano, "2009-11-11T00:00:00Z") +) - defer os.Remove(cert) - defer os.Remove(key) +type claimsTest struct { + name string + options Options + now time.Time + signingKey *jose.JSONWebKey + pubKeys []*jose.JSONWebKey + claims string + want *user.DefaultInfo + wantSkip bool + wantErr bool + wantInitErr bool +} - oidctesting.GenerateSelfSignedCert(t, "127.0.0.1", cert, key) +func (c *claimsTest) run(t *testing.T) { + a, err := newAuthenticator(c.options, func(ctx context.Context, a *Authenticator, config *oidc.Config) { + // Set the verifier to use the public key set instead of reading + // from a remote. + a.setVerifier(oidc.NewVerifier( + c.options.IssuerURL, + &staticKeySet{keys: c.pubKeys}, + config, + )) + }) + if err != nil { + if !c.wantInitErr { + t.Fatalf("initialize authenticator: %v", err) + } + return + } + if c.wantInitErr { + t.Fatalf("wanted initialization error") + } - // Ensure all tests pass when the issuer is not at a base URL. - for _, path := range []string{"", "/path/with/trailing/slash/"} { + // Sign and serialize the claims in a JWT. + signer, err := jose.NewSigner(jose.SigningKey{ + Algorithm: jose.SignatureAlgorithm(c.signingKey.Algorithm), + Key: c.signingKey, + }, nil) + if err != nil { + t.Fatalf("initialize signer: %v", err) + } + jws, err := signer.Sign([]byte(c.claims)) + if err != nil { + t.Fatalf("sign claims: %v", err) + } + token, err := jws.CompactSerialize() + if err != nil { + t.Fatalf("serialize token: %v", err) + } - // Create a TLS server and a client. - op := oidctesting.NewOIDCProvider(t, path) - srv, err := op.ServeTLSWithKeyPair(cert, key) - if err != nil { - t.Fatalf("Cannot start server: %v", err) - } - defer srv.Close() - - tests := []struct { - userClaim string - groupsClaim string - token string - userInfo user.Info - verified bool - err string - }{ - { - "sub", - "", - generateGoodToken(t, op, srv.URL, "client-foo", "client-foo", "sub", "user-foo", "", nil), - &user.DefaultInfo{Name: "user-foo"}, - true, - "", - }, - { - // Use user defined claim (email here). - "email", - "", - generateGoodToken(t, op, srv.URL, "client-foo", "client-foo", "email", "foo@example.com", "", nil), - &user.DefaultInfo{Name: "foo@example.com"}, - true, - "", - }, - { - // Use user defined claim (email here). - "email", - "", - generateGoodToken(t, op, srv.URL, "client-foo", "client-foo", "email", "foo@example.com", "groups", []string{"group1", "group2"}), - &user.DefaultInfo{Name: "foo@example.com"}, - true, - "", - }, - { - // Use user defined claim (email here). - "email", - "groups", - generateGoodToken(t, op, srv.URL, "client-foo", "client-foo", "email", "foo@example.com", "groups", []string{"group1", "group2"}), - &user.DefaultInfo{Name: "foo@example.com", Groups: []string{"group1", "group2"}}, - true, - "", - }, - { - // Group claim is a string rather than an array. Map that string to a single group. - "email", - "groups", - generateGoodToken(t, op, srv.URL, "client-foo", "client-foo", "email", "foo@example.com", "groups", "group1"), - &user.DefaultInfo{Name: "foo@example.com", Groups: []string{"group1"}}, - true, - "", - }, - { - // Group claim is not a string or array of strings. Throw out this as invalid. - "email", - "groups", - generateGoodToken(t, op, srv.URL, "client-foo", "client-foo", "email", "foo@example.com", "groups", 1), - nil, - false, - "custom group claim contains invalid type: float64", - }, - { - // Email not verified - "email", - "", - generateTokenWithUnverifiedEmail(t, op, srv.URL, "client-foo", "client-foo", "foo@example.com"), - nil, - false, - "email not verified", - }, - { - "sub", - "", - generateMalformedToken(t, op, srv.URL, "client-foo", "client-foo", "sub", "user-foo", "", nil), - nil, - false, - "oidc: unable to verify JWT signature: no matching keys", - }, - { - // Invalid 'aud'. - "sub", - "", - generateGoodToken(t, op, srv.URL, "client-foo", "client-bar", "sub", "user-foo", "", nil), - nil, - false, - "oidc: JWT claims invalid: invalid claims, 'aud' claim and 'client_id' do not match", - }, - { - // Invalid issuer. - "sub", - "", - generateGoodToken(t, op, "http://foo-bar.com", "client-foo", "client-foo", "sub", "user-foo", "", nil), - nil, - false, - "oidc: JWT claims invalid: invalid claim value: 'iss'.", - }, - { - "sub", - "", - generateExpiredToken(t, op, srv.URL, "client-foo", "client-foo", "sub", "user-foo", "", nil), - nil, - false, - "oidc: JWT claims invalid: token is expired", - }, + got, ok, err := a.AuthenticateToken(token) + if err != nil { + if !c.wantErr { + t.Fatalf("authenticate token: %v", err) } + return + } - for i, tt := range tests { - client, err := New(OIDCOptions{srv.URL, "client-foo", cert, tt.userClaim, "", tt.groupsClaim, ""}) - if err != nil { - t.Errorf("Unexpected error: %v", err) - continue - } - - user, result, err := client.AuthenticateToken(tt.token) - if tt.err != "" { - if !strings.HasPrefix(err.Error(), tt.err) { - t.Errorf("#%d: Expecting: %v..., but got: %v", i, tt.err, err) - } - } else { - if err != nil { - t.Errorf("#%d: Unexpected error: %v", i, err) - } - } - if !reflect.DeepEqual(tt.verified, result) { - t.Errorf("#%d: Expecting: %v, but got: %v", i, tt.verified, result) - } - if !reflect.DeepEqual(tt.userInfo, user) { - t.Errorf("#%d: Expecting: %v, but got: %v", i, tt.userInfo, user) - } - client.Close() + if c.wantErr { + t.Fatalf("expected error authenticating token") + } + if !ok { + if !c.wantSkip { + // We don't have any cases where we return (nil, false, nil) + t.Fatalf("no error but token not authenticated") } + return + } + if c.wantSkip { + t.Fatalf("expected authenticator to skip token") + } + + gotUser := got.(*user.DefaultInfo) + if !reflect.DeepEqual(gotUser, c.want) { + t.Fatalf("wanted user=%#v, got=%#v", c.want, gotUser) } } -func TestParseTokenClaims(t *testing.T) { - tests := []struct { - name string - - // Note this is missing a lot of configuration options because - // parseTokenClaim doesn't handle: - // - // - 'iss' claim matching issuer URL - // - 'exp' claim having not expired - // - 'sub' claim matching a trusted client id - // - // That logic has coverage in other tests. - - issuerURL string - usernameClaim string - usernamePrefix string - groupsClaim string - groupsPrefix string - - claims jose.Claims - - wantUser *user.DefaultInfo - wantErr bool - }{ +func TestToken(t *testing.T) { + tests := []claimsTest{ { - name: "email username", - issuerURL: "https://foo.com/", - usernameClaim: "email", - claims: jose.Claims{ - "email": "jane.doe@example.com", - "email_verified": true, + name: "token", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + now: func() time.Time { return now }, }, - wantUser: &user.DefaultInfo{ - Name: "jane.doe@example.com", + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "exp": %d + }`, valid.Unix()), + want: &user.DefaultInfo{ + Name: "jane", }, }, { - name: "no email_verified claim", - issuerURL: "https://foo.com/", - usernameClaim: "email", - claims: jose.Claims{ - "email": "jane.doe@example.com", + name: "no-username", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "exp": %d + }`, valid.Unix()), wantErr: true, }, { - name: "email unverified", - issuerURL: "https://foo.com/", - usernameClaim: "email", - claims: jose.Claims{ - "email": "jane.doe@example.com", + name: "email", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "email", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "email": "jane@example.com", + "email_verified": true, + "exp": %d + }`, valid.Unix()), + want: &user.DefaultInfo{ + Name: "jane@example.com", + }, + }, + { + name: "email-not-verified", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "email", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "email": "jane@example.com", "email_verified": false, + "exp": %d + }`, valid.Unix()), + wantErr: true, + }, + { + // If "email_verified" isn't present, assume false + name: "no-email-verified-claim", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "email", + now: func() time.Time { return now }, }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "email": "jane@example.com", + "exp": %d + }`, valid.Unix()), wantErr: true, }, { - name: "non-email user claim", - issuerURL: "https://foo.com/", - usernameClaim: "name", - claims: jose.Claims{ - "name": "janedoe", + name: "groups", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + GroupsClaim: "groups", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), }, - wantUser: &user.DefaultInfo{ - Name: "janedoe", + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "groups": ["team1", "team2"], + "exp": %d + }`, valid.Unix()), + want: &user.DefaultInfo{ + Name: "jane", + Groups: []string{"team1", "team2"}, }, }, { - name: "groups claim", - issuerURL: "https://foo.com/", - usernameClaim: "name", - groupsClaim: "groups", - claims: jose.Claims{ - "name": "janedoe", - "groups": []string{"foo", "bar"}, - }, - wantUser: &user.DefaultInfo{ - Name: "janedoe", - Groups: []string{"foo", "bar"}, + // Groups should be able to be a single string, not just a slice. + name: "group-string-claim", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + GroupsClaim: "groups", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "groups": "team1", + "exp": %d + }`, valid.Unix()), + want: &user.DefaultInfo{ + Name: "jane", + Groups: []string{"team1"}, }, }, { - name: "groups claim string", - issuerURL: "https://foo.com/", - usernameClaim: "name", - groupsClaim: "groups", - claims: jose.Claims{ - "name": "janedoe", - "groups": "foo", - }, - wantUser: &user.DefaultInfo{ - Name: "janedoe", - Groups: []string{"foo"}, + // if the groups claim isn't provided, this shouldn't error out + name: "no-groups-claim", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + GroupsClaim: "groups", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "exp": %d + }`, valid.Unix()), + want: &user.DefaultInfo{ + Name: "jane", }, }, { - name: "username prefix", - issuerURL: "https://foo.com/", - usernameClaim: "name", - groupsClaim: "groups", - usernamePrefix: "oidc:", - claims: jose.Claims{ - "name": "janedoe", - "groups": []string{"foo", "bar"}, - }, - wantUser: &user.DefaultInfo{ - Name: "oidc:janedoe", - Groups: []string{"foo", "bar"}, + name: "invalid-groups-claim", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + GroupsClaim: "groups", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "groups": 42, + "exp": %d + }`, valid.Unix()), + wantErr: true, }, { - name: "username prefix with email", - issuerURL: "https://foo.com/", - usernameClaim: "email", - groupsClaim: "groups", - usernamePrefix: "oidc:", - claims: jose.Claims{ - "email": "jane.doe@example.com", - "email_verified": true, - "groups": []string{"foo", "bar"}, + name: "invalid-signature", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_2.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "exp": %d + }`, valid.Unix()), + wantErr: true, + }, + { + name: "expired", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "exp": %d + }`, expired.Unix()), + wantErr: true, + }, + { + name: "invalid-aud", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "not-my-client", + "username": "jane", + "exp": %d + }`, valid.Unix()), + wantErr: true, + }, + { + // ID tokens may contain multiple audiences: + // https://openid.net/specs/openid-connect-core-1_0.html#IDToken + name: "multiple-audiences", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": ["not-my-client", "my-client"], + "azp": "not-my-client", + "username": "jane", + "exp": %d + }`, valid.Unix()), + want: &user.DefaultInfo{ + Name: "jane", + }, + }, + { + name: "invalid-issuer", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://example.com", + "aud": "my-client", + "username": "jane", + "exp": %d + }`, valid.Unix()), + wantSkip: true, + }, + { + name: "username-prefix", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + UsernamePrefix: "oidc:", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "exp": %d + }`, valid.Unix()), + want: &user.DefaultInfo{ + Name: "oidc:jane", + }, + }, + { + name: "groups-prefix", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + UsernamePrefix: "oidc:", + GroupsClaim: "groups", + GroupsPrefix: "groups:", + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "groups": ["team1", "team2"], + "exp": %d + }`, valid.Unix()), + want: &user.DefaultInfo{ + Name: "oidc:jane", + Groups: []string{"groups:team1", "groups:team2"}, + }, + }, + { + name: "invalid-signing-alg", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + now: func() time.Time { return now }, + }, + // Correct key but invalid signature algorithm "PS256" + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.PS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "exp": %d + }`, valid.Unix()), + wantErr: true, + }, + { + name: "ps256", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + SupportedSigningAlgs: []string{"PS256"}, + now: func() time.Time { return now }, + }, + signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.PS256), + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.PS256), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "exp": %d + }`, valid.Unix()), + want: &user.DefaultInfo{ + Name: "jane", + }, + }, + { + name: "es512", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + SupportedSigningAlgs: []string{"ES512"}, + now: func() time.Time { return now }, + }, + signingKey: loadECDSAPrivKey(t, "testdata/ecdsa_2.pem", jose.ES512), + pubKeys: []*jose.JSONWebKey{ + loadECDSAKey(t, "testdata/ecdsa_1.pem", jose.ES512), + loadECDSAKey(t, "testdata/ecdsa_2.pem", jose.ES512), + }, + claims: fmt.Sprintf(`{ + "iss": "https://auth.example.com", + "aud": "my-client", + "username": "jane", + "exp": %d + }`, valid.Unix()), + want: &user.DefaultInfo{ + Name: "jane", + }, + }, + { + name: "not-https", + options: Options{ + IssuerURL: "http://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + now: func() time.Time { return now }, + }, + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + wantInitErr: true, + }, + { + name: "no-username-claim", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + now: func() time.Time { return now }, + }, + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), + }, + wantInitErr: true, + }, + { + name: "invalid-sig-alg", + options: Options{ + IssuerURL: "https://auth.example.com", + ClientID: "my-client", + UsernameClaim: "username", + SupportedSigningAlgs: []string{"HS256"}, + now: func() time.Time { return now }, + }, + pubKeys: []*jose.JSONWebKey{ + loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), }, - wantUser: &user.DefaultInfo{ - Name: "oidc:jane.doe@example.com", - Groups: []string{"foo", "bar"}, + wantInitErr: true, + }, + } + for _, test := range tests { + t.Run(test.name, test.run) + } +} + +func TestUnmarshalClaimError(t *testing.T) { + // Ensure error strings returned by unmarshaling claims don't include the claim. + const token = "96bb299a-02e9-11e8-8673-54ee7553240e" + payload := fmt.Sprintf(`{ + "token": "%s" + }`, token) + + var c claims + if err := json.Unmarshal([]byte(payload), &c); err != nil { + t.Fatal(err) + } + var n int + err := c.unmarshalClaim("token", &n) + if err == nil { + t.Fatal("expected error") + } + + if strings.Contains(err.Error(), token) { + t.Fatalf("unmarshal error included token") + } +} + +func TestUnmarshalClaim(t *testing.T) { + tests := []struct { + name string + claims string + do func(claims) (interface{}, error) + want interface{} + wantErr bool + }{ + { + name: "string claim", + claims: `{"aud":"foo"}`, + do: func(c claims) (interface{}, error) { + var s string + err := c.unmarshalClaim("aud", &s) + return s, err + }, + want: "foo", + }, + { + name: "mismatched types", + claims: `{"aud":"foo"}`, + do: func(c claims) (interface{}, error) { + var n int + err := c.unmarshalClaim("aud", &n) + return n, err + }, + wantErr: true, }, { - name: "groups prefix", - issuerURL: "https://foo.com/", - usernameClaim: "name", - groupsClaim: "groups", - groupsPrefix: "oidc:", - claims: jose.Claims{ - "name": "janedoe", - "groups": []string{"foo", "bar"}, - }, - wantUser: &user.DefaultInfo{ - Name: "janedoe", - Groups: []string{"oidc:foo", "oidc:bar"}, + name: "bool claim", + claims: `{"email":"foo@coreos.com","email_verified":true}`, + do: func(c claims) (interface{}, error) { + var verified bool + err := c.unmarshalClaim("email_verified", &verified) + return verified, err }, + want: true, }, { - name: "username and groups prefix", - issuerURL: "https://foo.com/", - usernameClaim: "name", - groupsClaim: "groups", - usernamePrefix: "oidc-user:", - groupsPrefix: "oidc:", - claims: jose.Claims{ - "name": "janedoe", - "groups": []string{"foo", "bar"}, - }, - wantUser: &user.DefaultInfo{ - Name: "oidc-user:janedoe", - Groups: []string{"oidc:foo", "oidc:bar"}, + name: "strings claim", + claims: `{"groups":["a","b","c"]}`, + do: func(c claims) (interface{}, error) { + var groups []string + err := c.unmarshalClaim("groups", &groups) + return groups, err }, + want: []string{"a", "b", "c"}, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { - o := OIDCAuthenticator{ - issuerURL: test.issuerURL, - usernameClaim: test.usernameClaim, - usernamePrefix: test.usernamePrefix, - groupsClaim: test.groupsClaim, - groupsPrefix: test.groupsPrefix, + var c claims + if err := json.Unmarshal([]byte(test.claims), &c); err != nil { + t.Fatal(err) } - u, ok, err := o.parseTokenClaims(test.claims) + got, err := test.do(c) if err != nil { - if !test.wantErr { - t.Errorf("failed to authenticate user: %v", err) + if test.wantErr { + return } - return + t.Fatalf("unexpected error: %v", err) } if test.wantErr { - t.Fatalf("expected authentication to fail") + t.Fatalf("expected error") } - if !ok { - // We don't have any cases today when the claims can return - // no error with an unauthenticated signal. - // - // In the future we might. - t.Fatalf("user wasn't authenticated") - } - - got := &user.DefaultInfo{ - Name: u.GetName(), - UID: u.GetUID(), - Groups: u.GetGroups(), - Extra: u.GetExtra(), - } - if !reflect.DeepEqual(got, test.wantUser) { - t.Errorf("wanted user=%#v, got=%#v", test.wantUser, got) + if !reflect.DeepEqual(got, test.want) { + t.Errorf("wanted=%#v, got=%#v", test.want, got) } }) } diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/ecdsa_1.pem b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/ecdsa_1.pem new file mode 100644 index 000000000..c56852dca --- /dev/null +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/ecdsa_1.pem @@ -0,0 +1,7 @@ +-----BEGIN EC PRIVATE KEY----- +MIHcAgEBBEIAvxtZy9aI/lEt6LVLIhVrWLSwmlMFThU/nZUPr88nA5yKzJMyKbW/ +QA+umam9YtO78WwzriTGC9qwW6+t+liXrcCgBwYFK4EEACOhgYkDgYYABAGzIO9n +tdTx6oVg1O59ljYP4FHY9RNUy+wHeXFnB6fo9asGg9jwLMg/iX0F+whFkllQjNLf +kKp/9ATWQHrzSbzuqwB9UU5zfQ3ulhMwEBpxbM6aSi1HyYtc5pQn7KB6h1VXiuQK +CIj4kVYHClZuKz0om/XAJL4vWVDwJqDBN6m9Yi9ZLQ== +-----END EC PRIVATE KEY----- diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/ecdsa_2.pem b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/ecdsa_2.pem new file mode 100644 index 000000000..611a4ba3b --- /dev/null +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/ecdsa_2.pem @@ -0,0 +1,7 @@ +-----BEGIN EC PRIVATE KEY----- +MIHcAgEBBEIBtxiwrrDmi1U+NxClUKIr2cvmL6PPLxjAULjPuORt0AWbqKakphSJ +43VmIbPBBCuLnN2PuVS9N8jLDlR1KUnnFSGgBwYFK4EEACOhgYkDgYYABAEgshGY +Oflwnz2SQOWIkvSPmijMhS4nWmLYedR2H/Dg9c9nuiyQqL3XpqkPnQQwqOgcXjMT +hTec2tiLcRS3Gj02yQEpe/6Do6if4K4cQ9KsNtVHsn0bibsqLtRuvI7xUu9JJAs7 +vSLNUtmxVzFo4s4spnIjLT71uz1Vag/NrKwot7cz4g== +-----END EC PRIVATE KEY----- diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/ecdsa_3.pem b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/ecdsa_3.pem new file mode 100644 index 000000000..1bd6e0a34 --- /dev/null +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/ecdsa_3.pem @@ -0,0 +1,7 @@ +-----BEGIN EC PRIVATE KEY----- +MIHcAgEBBEIAQTHP4V93rz1w1D+jF1Jvx5QHzkQQIYxbN1LPuvQjEoplQrjZ4Qiu +h9mKK6DBCaDlfSos+wnTOlZH1z1tpa9soPOgBwYFK4EEACOhgYkDgYYABAFn+QOY +a937Lp+WO1S+zJU9ITnzdvjqQtD/TjtJPQsllV8rD0QNXZb/pLFQFZtDEehiZKEu +WA0REGNs+rVMO63YZAAyDMwZTz87ulH23OR6EaoyDp9qEPx7kpxgaJqeIztla2t8 +SLVpv/FPR92E/OmguT6sFI5mP0AhV8UVlLYuHaovnw== +-----END EC PRIVATE KEY----- diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/gen.sh b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/gen.sh new file mode 100755 index 000000000..a3daa0fc4 --- /dev/null +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/gen.sh @@ -0,0 +1,27 @@ +#!/bin/bash -e + +# Copyright 2018 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +rm *.pem + +for N in `seq 1 3`; do + ssh-keygen -t rsa -b 2048 -f rsa_$N.pem -N '' +done + +for N in `seq 1 3`; do + ssh-keygen -t ecdsa -b 521 -f ecdsa_$N.pem -N '' +done + +rm *.pub diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/rsa_1.pem b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/rsa_1.pem new file mode 100644 index 000000000..2c4a9238c --- /dev/null +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/rsa_1.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA0pXWMYjWRjBEds/fKj/u9r2E6SIDx0J+TAg+eyVeR20Ky9jZ +mIXW5zSxE/EKpNQpiBWm1e6G9kmhMuqjr7g455S7E+3rD3OVkdTT6SU5AKBNSFoR +XUd+G/YJEtRzrpEYNtEJHkxUxWuyfCHblHSt+wsrE6t0DccCqC87lKQiGb/QfC8u +P6ZS99SCjKBEFp1fZvyNkYwStFc2OH5fBGPXXb6SNsquvDeKX9NeWjXkmxDkbOg2 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B7dL9ZExoNZvv7f6y6OelLaLuXQcWnR6u+E3AOIU +5+Y3RgtoBV+/GUh1PzQ1qrviGa77SDfQ54an9hGd4F27fHkQ4XzkBmqM+FQg+J/G +X1uPomkCgYBo4ZBEA20Wvf1k2iWOVdfsxZNeOLxwcN5x89dAvm0v6RHg2NMy+XKw +Rj+YRuudFdxfg39J/V/Md9qsvjW+4FthD8GhgPs22dksV+7j6ApWkYTmIKG4rmh3 +RhHOr6uLg9BeShnlvMMaMJKf2eA7SaVtmuS6uBGgEUNaa3qEBq0R+Q== +-----END RSA PRIVATE KEY----- diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/rsa_2.pem b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/rsa_2.pem new file mode 100644 index 000000000..e89fdb868 --- /dev/null +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/rsa_2.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAxmLv1fqjacxZu5jyfQzytwjdt9/BBDzPM6G+R92YvsB7o2FH +ISiySbT8pyj7wGUgDvBdc9+GT3thf2pKGl/THaYJCLbh90GXVMTTak8Najqp2Qod +kxIpjSOBgukmd0LUtUVGKJg7YTEqsxAUmn9mfFiUZ6ixHr0U2NAXu7TF4dw7C9bt +ORi9DKDfUhEiV3Vcyrc5d/9VdmWG6fs/kq0B/6AboiSIIGAKSugNi4BgV7rNZYwZ +37UT72CW28TQQuuAtmTgXWMkfeWZiQKD1P8Nl1byORpgivp2A+2pMNlcLuogVhGY +TIZstbeMqoPyLW57GitWDg1tbakwJdCR23gCKQIDAQABAoIBACZmDf//1FNtD01F +TGIx+GS/HZMyhvyX/I8E1ny4gpEhVo0IDil35BJqKqD8SMYzjKH3mk8MS8Xknrl3 +zEIQnB9X/NWn+FLQakcpFba0+GbAVhHBaHoIAOzlm3LIR/67e8peTzcaSBwG1Tn1 +eddxo1ecGZV6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ZCr5qhLUVs +-----END RSA PRIVATE KEY----- diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/rsa_3.pem b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/rsa_3.pem new file mode 100644 index 000000000..3c660ed19 --- /dev/null +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testdata/rsa_3.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpgIBAAKCAQEA1uO3LV0wHadHjQb8U8KGUpzlZTyBHlinL7lF5yKk2hXOyssT +Z0UVF6ofPq/L+ZN5VkTb1FJWMEBiX1BgXlboDdYKAYTl1QaeEQrfrAM4gp2FdWS4 +fMUuagFdVXs8T2J4GGPEE83ybwz/YEM3p83Qojifvx/IjVtuHCMkUpcj92scjsCY +EeSKRjJicVBmJ1RK0ShEorHhnYmokKYsPl41mV5VdmWZOtmPK4jV05cBfg7eC7yI +cwwYhowLkYvd9d9H74otK5tD7KTxFG6JJ0N5zwf6XBRcXBWKstfOOZ5Qgo9z0Tkm +n3Klp9vwun25aaA1MlSSByByiCb7qvS8jhqMkQIDAQABAoIBAQCjN58AU9GiFFai +ZXXuYMgJo6YRON2RoSCLfRv9LTEtfHbvTUPVooEc0lidEoXJcRwuTGr0X/2a9KxD +XRd1UGk9aR98e+bd4QLaSvoM+v1HKEIgInqGOnbAiXzM2qe6XD5/t/dMW5cShjrK +cQOq7wbS0FN1pbx8sb92m7KREL9+wnXuOCHYtublRf7arsMkaZcpSBBaI+raMaZR +dUC+LmalIvR8+dNegducwWsdE8/Vh+xq97ZbNFlyut3JOvfuHmaAOvUsX/4touj2 +dDkJmvzvmpTBG888t+6hv9eKWaacsTAKuPLThRBD53coTEvHK8iic9fOok65y5Bn +nFP/irUpAoGBAPUsPoAPwcNajZX/E4XeG/2eV+IHMxYR9gJwBzpoUfwHr5mR54HK +POia/z7/M2KVV9kMWBlbTumIHSEylEEDCCKNNIe1gHBxQ7uGuaf+vVXpVgjBigUz +7oiCjb5RdjevfiyudX/z0B9IQSI9djCXebifEHKpUxAOmU3oP0SEMULLAoGBAOBh +G+fDouMU7QN93NG0hssu44yc7xQhb7VLB+isrEQASVG2xWkd3iDrdRxwHAHZqxFd +4DRzDTFC7yeR+FEbVVkWQRaeDwFJM1zmRTXsYjBkK49GNzB4QEtHvPouuxMAQ4UD +zJ9a3LEDSs867R7XEbNF8j9NC9z0vk7w9bHTA1aTAoGBAODUUQBY8sQ1zy8lOf8B +/sMmKMti9Mshb2su1sIOFli7p6F5tkZEcnSQZs+bccDO2T92XXfrTsNDigr+egvg +Pt6IhQqKPB1hEM7wLmLLbU9Sag4fhXVd+TmAF4HW7EUGjvtkhOXwbQOy2+ANYswO +rJXMcGXltwE7kgRqnVI0s4PfAoGBALUrM5Dq0bZwyv6qvYVFMiEUdv6uKAwlA0Fq +l7Qy19UANjMYVEUPrK7/7stLahHEYu/e0I0I6HoCBX/5yHoUi9Emut88N/ld1W8J +LpDfkFhqSRGiLCWisqcWAWwwFzS8XcgkzS9N+iui8OBqP9NK7CvIKlUaLJ33r0Gm +JXuzWVqpAoGBAIQ8+YuvFfyhwXuWwQbzxVpWRURH0FRu8KfFIkFFbdyht6leYXuj +uxcrcHWzkEPSLO22BoJX8ECHq4LadAIjkkpr5GCikKCF+r/bq50RnECqvfoJ629J +gA87C8cLU3dXmSYd+vSg6icZyncTmXyyEV0dqoUGJ2M33kE6hYAbc/ic +-----END RSA PRIVATE KEY----- diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testing/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testing/BUILD deleted file mode 100644 index 6dcb14f70..000000000 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testing/BUILD +++ /dev/null @@ -1,30 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["provider.go"], - importpath = "k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testing", - deps = [ - "//vendor/github.com/coreos/go-oidc/jose:go_default_library", - "//vendor/github.com/coreos/go-oidc/key:go_default_library", - "//vendor/github.com/coreos/go-oidc/oidc:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testing/provider.go b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testing/provider.go deleted file mode 100644 index ae7353ff2..000000000 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/testing/provider.go +++ /dev/null @@ -1,200 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package testing - -import ( - "bytes" - "crypto/rand" - "crypto/rsa" - "crypto/tls" - "crypto/x509" - "crypto/x509/pkix" - "encoding/json" - "encoding/pem" - "fmt" - "io/ioutil" - "math/big" - "net" - "net/http" - "net/http/httptest" - "net/url" - "os" - "path" - "path/filepath" - "testing" - "time" - - "github.com/coreos/go-oidc/jose" - "github.com/coreos/go-oidc/key" - "github.com/coreos/go-oidc/oidc" -) - -// NewOIDCProvider provides a bare minimum OIDC IdP Server useful for testing. -func NewOIDCProvider(t *testing.T, issuerPath string) *OIDCProvider { - privKey, err := key.GeneratePrivateKey() - if err != nil { - t.Fatalf("Cannot create OIDC Provider: %v", err) - return nil - } - - op := &OIDCProvider{ - Mux: http.NewServeMux(), - PrivKey: privKey, - issuerPath: issuerPath, - } - - op.Mux.HandleFunc(path.Join(issuerPath, "/.well-known/openid-configuration"), op.handleConfig) - op.Mux.HandleFunc(path.Join(issuerPath, "/keys"), op.handleKeys) - - return op -} - -type OIDCProvider struct { - Mux *http.ServeMux - PCFG oidc.ProviderConfig - PrivKey *key.PrivateKey - issuerPath string -} - -func (op *OIDCProvider) ServeTLSWithKeyPair(cert, key string) (*httptest.Server, error) { - srv := httptest.NewUnstartedServer(op.Mux) - - srv.TLS = &tls.Config{Certificates: make([]tls.Certificate, 1)} - var err error - srv.TLS.Certificates[0], err = tls.LoadX509KeyPair(cert, key) - if err != nil { - return nil, fmt.Errorf("Cannot load cert/key pair: %v", err) - } - srv.StartTLS() - - // The issuer's URL is extended by an optional path. This ensures that the plugin can - // handle issuers that use a non-root path for discovery (see kubernetes/kubernetes#29749). - srv.URL = srv.URL + op.issuerPath - - u, err := url.Parse(srv.URL) - if err != nil { - return nil, err - } - pathFor := func(p string) *url.URL { - u2 := *u // Shallow copy. - u2.Path = path.Join(u2.Path, p) - return &u2 - } - - op.PCFG = oidc.ProviderConfig{ - Issuer: u, - AuthEndpoint: pathFor("/auth"), - TokenEndpoint: pathFor("/token"), - KeysEndpoint: pathFor("/keys"), - ResponseTypesSupported: []string{"code"}, - SubjectTypesSupported: []string{"public"}, - IDTokenSigningAlgValues: []string{"RS256"}, - } - return srv, nil -} - -func (op *OIDCProvider) handleConfig(w http.ResponseWriter, req *http.Request) { - b, err := json.Marshal(&op.PCFG) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/json") - w.Write(b) -} - -func (op *OIDCProvider) handleKeys(w http.ResponseWriter, req *http.Request) { - keys := struct { - Keys []jose.JWK `json:"keys"` - }{ - Keys: []jose.JWK{op.PrivKey.JWK()}, - } - - b, err := json.Marshal(keys) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age=%d", int(time.Hour.Seconds()))) - w.Header().Set("Expires", time.Now().Add(time.Hour).Format(time.RFC1123)) - w.Header().Set("Content-Type", "application/json") - w.Write(b) -} - -// generateSelfSignedCert generates a self-signed cert/key pairs and writes to the certPath/keyPath. -// This method is mostly identical to crypto.GenerateSelfSignedCert except for the 'IsCA' and 'KeyUsage' -// in the certificate template. (Maybe we can merge these two methods). -func GenerateSelfSignedCert(t *testing.T, host, certPath, keyPath string) { - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - t.Fatal(err) - } - - template := x509.Certificate{ - SerialNumber: big.NewInt(1), - Subject: pkix.Name{ - CommonName: fmt.Sprintf("%s@%d", host, time.Now().Unix()), - }, - NotBefore: time.Now(), - NotAfter: time.Now().Add(time.Hour * 24 * 365), - - KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, - ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, - BasicConstraintsValid: true, - IsCA: true, - } - - if ip := net.ParseIP(host); ip != nil { - template.IPAddresses = append(template.IPAddresses, ip) - } else { - template.DNSNames = append(template.DNSNames, host) - } - - derBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv) - if err != nil { - t.Fatal(err) - } - - // Generate cert - certBuffer := bytes.Buffer{} - if err := pem.Encode(&certBuffer, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}); err != nil { - t.Fatal(err) - } - - // Generate key - keyBuffer := bytes.Buffer{} - if err := pem.Encode(&keyBuffer, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)}); err != nil { - t.Fatal(err) - } - - // Write cert - if err := os.MkdirAll(filepath.Dir(certPath), os.FileMode(0755)); err != nil { - t.Fatal(err) - } - if err := ioutil.WriteFile(certPath, certBuffer.Bytes(), os.FileMode(0644)); err != nil { - t.Fatal(err) - } - - // Write key - if err := os.MkdirAll(filepath.Dir(keyPath), os.FileMode(0755)); err != nil { - t.Fatal(err) - } - if err := ioutil.WriteFile(keyPath, keyBuffer.Bytes(), os.FileMode(0600)); err != nil { - t.Fatal(err) - } -} diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/BUILD index f064d07c5..5da907a97 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/BUILD +++ b/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/BUILD @@ -12,8 +12,7 @@ go_test( "certs_test.go", "webhook_test.go", ], - importpath = "k8s.io/apiserver/plugin/pkg/authenticator/token/webhook", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/authentication/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/BUILD b/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/BUILD index 662b710d8..08acf7b84 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/BUILD +++ b/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/BUILD @@ -12,8 +12,7 @@ go_test( "certs_test.go", "webhook_test.go", ], - importpath = "k8s.io/apiserver/plugin/pkg/authorizer/webhook", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/authorization/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go b/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go index e9efac307..d00e65be5 100644 --- a/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go +++ b/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go @@ -100,7 +100,7 @@ func newWithBackoff(subjectAccessReview authorizationclient.SubjectAccessReviewI // Authorize makes a REST request to the remote service describing the attempted action as a JSON // serialized api.authorization.v1beta1.SubjectAccessReview object. An example request body is -// provided bellow. +// provided below. // // { // "apiVersion": "authorization.k8s.io/v1beta1", diff --git a/vendor/k8s.io/client-go/.github/PULL_REQUEST_TEMPLATE.md b/vendor/k8s.io/client-go/.github/PULL_REQUEST_TEMPLATE.md index ad11b57a8..e559c074b 100644 --- a/vendor/k8s.io/client-go/.github/PULL_REQUEST_TEMPLATE.md +++ b/vendor/k8s.io/client-go/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,2 @@ -Sorry, client-go does not accept changes via pull requests at this time. Please -submit your pull request to the main repository: -https://github.com/kubernetes/kubernetes. See the guidance here: -https://github.com/kubernetes/client-go#contributing-code. +Sorry, we do not accept changes directly against this repository. Please see +CONTRIBUTING.md for information on where and how to contribute instead. diff --git a/vendor/k8s.io/client-go/CHANGELOG.md b/vendor/k8s.io/client-go/CHANGELOG.md index 88ffb2201..bfa8a453d 100644 --- a/vendor/k8s.io/client-go/CHANGELOG.md +++ b/vendor/k8s.io/client-go/CHANGELOG.md @@ -2,6 +2,111 @@ TODO: This document was manually maintained so might be incomplete. The automation effort is tracked in https://github.com/kubernetes/client-go/issues/234. +Changes in `k8s.io/api` and `k8s.io/apimachinery` are mentioned here +because `k8s.io/client-go` depends on them. + +# v6.0.0 + +**Breaking Changes:** + +* If you upgrade your client-go libs and use the `AppsV1() or Apps()` interface, please note that the default garbage collection behavior is changed. + + * [https://github.com/kubernetes/kubernetes/pull/55148](https://github.com/kubernetes/kubernetes/pull/55148) + +* Swagger 1.2 retriever `DiscoveryClient.SwaggerSchema` was removed from the discovery client + + * [https://github.com/kubernetes/kubernetes/pull/53441](https://github.com/kubernetes/kubernetes/pull/53441) + +* Informers got a NewFilteredSharedInformerFactory to e.g. filter by namespace + + * [https://github.com/kubernetes/kubernetes/pull/54660](https://github.com/kubernetes/kubernetes/pull/54660) + +* [k8s.io/api] The dynamic admission webhook is split into two kinds, mutating and validating. +The kinds have changed completely and old code must be ported to `admissionregistration.k8s.io/v1beta1` - +`MutatingWebhookConfiguration` and `ValidatingWebhookConfiguration` + + * [https://github.com/kubernetes/kubernetes/pull/55282](https://github.com/kubernetes/kubernetes/pull/55282) + +* [k8s.io/api] Renamed `core/v1.ScaleIOVolumeSource` to `ScaleIOPersistentVolumeSource` + + * [https://github.com/kubernetes/kubernetes/pull/54013](https://github.com/kubernetes/kubernetes/pull/54013) + +* [k8s.io/api] Renamed `core/v1.RBDVolumeSource` to `RBDPersistentVolumeSource` + + * [https://github.com/kubernetes/kubernetes/pull/54302](https://github.com/kubernetes/kubernetes/pull/54302) + +* [k8s.io/api] Removed `core/v1.CreatedByAnnotation` + + * [https://github.com/kubernetes/kubernetes/pull/54445](https://github.com/kubernetes/kubernetes/pull/54445) + +* [k8s.io/api] Renamed `core/v1.StorageMediumHugepages` to `StorageMediumHugePages` + + * [https://github.com/kubernetes/kubernetes/pull/54748](https://github.com/kubernetes/kubernetes/pull/54748) + +* [k8s.io/api] `core/v1.Taint.TimeAdded` became a pointer + + * [https://github.com/kubernetes/kubernetes/pull/43016](https://github.com/kubernetes/kubernetes/pull/43016) + +* [k8s.io/api] `core/v1.DefaultHardPodAffinitySymmetricWeight` type changed from int to int32 + + * [https://github.com/kubernetes/kubernetes/pull/53850](https://github.com/kubernetes/kubernetes/pull/53850) + +* [k8s.io/apimachinery] `ObjectCopier` interface was removed (requires switch to new generators with DeepCopy methods) + + * [https://github.com/kubernetes/kubernetes/pull/53525](https://github.com/kubernetes/kubernetes/pull/53525) + +**New Features:** + +* Certificate manager was moved from kubelet to `k8s.io/client-go/util/certificates` + + * [https://github.com/kubernetes/kubernetes/pull/49654](https://github.com/kubernetes/kubernetes/pull/49654) + +* [k8s.io/api] Workloads api types are promoted to `apps/v1` version + + * [https://github.com/kubernetes/kubernetes/pull/53679](https://github.com/kubernetes/kubernetes/pull/53679) + +* [k8s.io/api] Added `storage.k8s.io/v1alpha1` API group + + * [https://github.com/kubernetes/kubernetes/pull/54463](https://github.com/kubernetes/kubernetes/pull/54463) + +* [k8s.io/api] Added support for conditions in StatefulSet status + + * [https://github.com/kubernetes/kubernetes/pull/55268](https://github.com/kubernetes/kubernetes/pull/55268) + +* [k8s.io/api] Added support for conditions in DaemonSet status + + * [https://github.com/kubernetes/kubernetes/pull/55272](https://github.com/kubernetes/kubernetes/pull/55272) + +* [k8s.io/apimachinery] Added polymorphic scale client in `k8s.io/client-go/scale`, which supports scaling of resources in arbitrary API groups + + * [https://github.com/kubernetes/kubernetes/pull/53743](https://github.com/kubernetes/kubernetes/pull/53743) + +* [k8s.io/apimachinery] `meta.MetadataAccessor` got API chunking support + + * [https://github.com/kubernetes/kubernetes/pull/53768](https://github.com/kubernetes/kubernetes/pull/53768) + +* [k8s.io/apimachinery] `unstructured.Unstructured` got getters and setters + + * [https://github.com/kubernetes/kubernetes/pull/51940](https://github.com/kubernetes/kubernetes/pull/51940) + +**Bug fixes and Improvements:** + +* The body in glog output is not truncated with log level 10 + + * [https://github.com/kubernetes/kubernetes/pull/54801](https://github.com/kubernetes/kubernetes/pull/54801) + +* [k8s.io/api] Unset `creationTimestamp` field is output as null if encoded from an unstructured object + + * [https://github.com/kubernetes/kubernetes/pull/53464](https://github.com/kubernetes/kubernetes/pull/53464) + +* [k8s.io/apimachinery] Redirect behavior is restored for proxy subresources + + * [https://github.com/kubernetes/kubernetes/pull/52933](https://github.com/kubernetes/kubernetes/pull/52933) + +* [k8s.io/apimachinery] Random string generation functions are optimized + + * [https://github.com/kubernetes/kubernetes/pull/53720](https://github.com/kubernetes/kubernetes/pull/53720) + # v5.0.1 Bug fix: picked up a security fix [kubernetes/kubernetes#53443](https://github.com/kubernetes/kubernetes/pull/53443) for `PodSecurityPolicy`. diff --git a/vendor/k8s.io/client-go/CONTRIBUTING.md b/vendor/k8s.io/client-go/CONTRIBUTING.md new file mode 100644 index 000000000..b01f8abb0 --- /dev/null +++ b/vendor/k8s.io/client-go/CONTRIBUTING.md @@ -0,0 +1,7 @@ +# Contributing guidelines + +Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. + +This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/client-go](https://git.k8s.io/kubernetes/staging/src/k8s.io/client-go) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). + +Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/staging.md) for more information diff --git a/vendor/k8s.io/client-go/Godeps/Godeps.json b/vendor/k8s.io/client-go/Godeps/Godeps.json index a70d2abb0..3598fddc7 100644 --- a/vendor/k8s.io/client-go/Godeps/Godeps.json +++ b/vendor/k8s.io/client-go/Godeps/Godeps.json @@ -16,59 +16,19 @@ }, { "ImportPath": "github.com/Azure/go-autorest/autorest", - "Rev": "e14a70c556c8e0db173358d1a903dca345a8e75e" + "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" }, { "ImportPath": "github.com/Azure/go-autorest/autorest/adal", - "Rev": "e14a70c556c8e0db173358d1a903dca345a8e75e" + "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" }, { "ImportPath": "github.com/Azure/go-autorest/autorest/azure", - "Rev": "e14a70c556c8e0db173358d1a903dca345a8e75e" + "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" }, { "ImportPath": "github.com/Azure/go-autorest/autorest/date", - "Rev": "e14a70c556c8e0db173358d1a903dca345a8e75e" - }, - { - "ImportPath": "github.com/PuerkitoBio/purell", - "Rev": "8a290539e2e8629dbc4e6bad948158f790ec31f4" - }, - { - "ImportPath": "github.com/PuerkitoBio/urlesc", - "Rev": "5bd2802263f21d8788851d5305584c82a5c75d7e" - }, - { - "ImportPath": "github.com/coreos/go-oidc/http", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/jose", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/key", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/oauth2", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/oidc", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/pkg/health", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" - }, - { - "ImportPath": "github.com/coreos/pkg/httputil", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" - }, - { - "ImportPath": "github.com/coreos/pkg/timeutil", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" + "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" }, { "ImportPath": "github.com/davecgh/go-spew/spew", @@ -86,34 +46,10 @@ "ImportPath": "github.com/docker/spdystream/spdy", "Rev": "449fdfce4d962303d702fec724ef0ad181c92528" }, - { - "ImportPath": "github.com/emicklei/go-restful", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, - { - "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, { "ImportPath": "github.com/ghodss/yaml", "Rev": "73d445a93680fa1a78ae23a5839bad48f32ba1ee" }, - { - "ImportPath": "github.com/go-openapi/jsonpointer", - "Rev": "46af16f9f7b149af66e5d1bd010e3574dc06de98" - }, - { - "ImportPath": "github.com/go-openapi/jsonreference", - "Rev": "13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272" - }, - { - "ImportPath": "github.com/go-openapi/spec", - "Rev": "7abd5745472fff5eb3685386d5fb8bf38683154d" - }, - { - "ImportPath": "github.com/go-openapi/swag", - "Rev": "f3f9494671f93fcff853e3c6e9e948b3eb71e590" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" @@ -150,10 +86,6 @@ "ImportPath": "github.com/golang/protobuf/ptypes/timestamp", "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" }, - { - "ImportPath": "github.com/google/btree", - "Rev": "7d79101e329e5a3adf994758c578dab82b90c017" - }, { "ImportPath": "github.com/google/gofuzz", "Rev": "44d81051d367757e1c7c6a5a86423ece9afcf63c" @@ -172,39 +104,31 @@ }, { "ImportPath": "github.com/gophercloud/gophercloud", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/openstack", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/openstack/utils", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/pagination", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" - }, - { - "ImportPath": "github.com/gregjones/httpcache", - "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" - }, - { - "ImportPath": "github.com/gregjones/httpcache/diskcache", - "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/hashicorp/golang-lru", @@ -222,33 +146,9 @@ "ImportPath": "github.com/imdario/mergo", "Rev": "6633656539c1639d9d78127b7d47c622b5d7b6dc" }, - { - "ImportPath": "github.com/jonboulle/clockwork", - "Rev": "72f9bd7c4e0c2a40055ab3d0f09654f730cce982" - }, { "ImportPath": "github.com/json-iterator/go", - "Rev": "36b14963da70d11297d313183d7e6388c8510e1e" - }, - { - "ImportPath": "github.com/juju/ratelimit", - "Rev": "5b9ff866471762aa2ab2dced63c9fb6f53921342" - }, - { - "ImportPath": "github.com/mailru/easyjson/buffer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jlexer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jwriter", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/peterbourgon/diskv", - "Rev": "5f041e8faa004a95c88a202771f4cc3e991971e6" + "Rev": "13f86432b882000a51c6e610c620974462691a97" }, { "ImportPath": "github.com/pmezard/go-difflib/difflib", @@ -256,7 +156,7 @@ }, { "ImportPath": "github.com/spf13/pflag", - "Rev": "9ff6c6923cfffbcd502984b8e0c80539a94968b7" + "Rev": "4c012f6dcd9546820e378d0bdda4d8fc772cdfea" }, { "ImportPath": "github.com/stretchr/testify/assert", @@ -318,34 +218,10 @@ "ImportPath": "golang.org/x/sys/windows", "Rev": "95c6576299259db960f6c5b9b69ea52422860fce" }, - { - "ImportPath": "golang.org/x/text/cases", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal/tag", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/language", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/runes", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, { "ImportPath": "golang.org/x/text/secure/bidirule", "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" }, - { - "ImportPath": "golang.org/x/text/secure/precis", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, { "ImportPath": "golang.org/x/text/transform", "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" @@ -359,8 +235,8 @@ "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" }, { - "ImportPath": "golang.org/x/text/width", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + "ImportPath": "golang.org/x/time/rate", + "Rev": "f51c12702a4d776e4c1fa9b0fabab841babae631" }, { "ImportPath": "gopkg.in/inf.v0", @@ -368,343 +244,339 @@ }, { "ImportPath": "gopkg.in/yaml.v2", - "Rev": "53feefa2559fb8dfa8d81baad31be332c97d6c77" + "Rev": "670d4cfef0544295bc27a114dbac37980d83185a" }, { "ImportPath": "k8s.io/api/admissionregistration/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/admissionregistration/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/apps/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/apps/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/apps/v1beta2", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authentication/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authentication/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authorization/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authorization/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/autoscaling/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/autoscaling/v2beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/batch/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/batch/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/batch/v2alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/certificates/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/core/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/events/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/extensions/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/imagepolicy/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/networking/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/policy/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/rbac/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/rbac/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/rbac/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/scheduling/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/settings/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/storage/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/storage/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/storage/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/equality", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/errors", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/testing", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/cache", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/clock", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/version", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" + "Rev": "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" } ] } diff --git a/vendor/k8s.io/client-go/Godeps/OWNERS b/vendor/k8s.io/client-go/Godeps/OWNERS new file mode 100644 index 000000000..3d49f3060 --- /dev/null +++ b/vendor/k8s.io/client-go/Godeps/OWNERS @@ -0,0 +1,2 @@ +approvers: +- dep-approvers diff --git a/vendor/k8s.io/client-go/INSTALL.md b/vendor/k8s.io/client-go/INSTALL.md index 3417e0cd7..42656284f 100644 --- a/vendor/k8s.io/client-go/INSTALL.md +++ b/vendor/k8s.io/client-go/INSTALL.md @@ -63,7 +63,7 @@ To install `client-go` and place its dependencies in your `$GOPATH`: ```sh go get k8s.io/client-go/... cd $GOPATH/src/k8s.io/client-go -git checkout v2.0.0 +git checkout v6.0.0 # cd 1.5 # only necessary with 1.5 and 1.4 clients. godep restore ./... ``` @@ -99,7 +99,7 @@ your project: package: ( your project's import path ) # e.g. github.com/foo/bar import: - package: k8s.io/client-go - version: v2.0.0 + version: v6.0.0 ``` Second, add a Go file that imports `client-go` somewhere in your project, @@ -132,7 +132,7 @@ requests can override the version manually in `glide.yaml`. For example: package: ( your project's import path ) # e.g. github.com/foo/bar import: - package: k8s.io/client-go - version: v2.0.0 + version: v6.0.0 # Use a newer version of go-spew even though client-go wants an old one. - package: github.com/davecgh/go-spew version: v1.1.0 diff --git a/vendor/k8s.io/client-go/README.md b/vendor/k8s.io/client-go/README.md index ed1b887fc..82f41d738 100644 --- a/vendor/k8s.io/client-go/README.md +++ b/vendor/k8s.io/client-go/README.md @@ -2,12 +2,22 @@ Go clients for talking to a [kubernetes](http://kubernetes.io/) cluster. -We currently recommend using the v4.0.0 tag. See [INSTALL.md](/INSTALL.md) for +We currently recommend using the v6.0.0 tag. See [INSTALL.md](/INSTALL.md) for detailed installation instructions. `go get k8s.io/client-go/...` works, but will give you head and doesn't handle the dependencies well. -[![Build Status](https://travis-ci.org/kubernetes/client-go.svg?branch=master)](https://travis-ci.org/kubernetes/client-go) -[![GoDoc](https://godoc.org/k8s.io/client-go?status.svg)](https://godoc.org/k8s.io/client-go) +[![BuildStatus Widget]][BuildStatus Result] +[![GoReport Widget]][GoReport Status] +[![GoDocWidget]][GoDocReference] + +[BuildStatus Result]: https://travis-ci.org/kubernetes/client-go +[BuildStatus Widget]: https://travis-ci.org/kubernetes/client-go.svg?branch=master + +[GoReport Status]: https://goreportcard.com/report/github.com/kubernetes/client-go +[GoReport Widget]: https://goreportcard.com/badge/github.com/kubernetes/client-go + +[GoDocWidget]: https://godoc.org/k8s.io/client-go?status.svg +[GoDocReference]:https://godoc.org/k8s.io/client-go ## Table of Contents @@ -17,7 +27,7 @@ will give you head and doesn't handle the dependencies well. - [Compatibility: client-go <-> Kubernetes clusters](#compatibility-client-go---kubernetes-clusters) - [Compatibility matrix](#compatibility-matrix) - [Why do the 1.4 and 1.5 branch contain top-level folder named after the version?](#why-do-the-14-and-15-branch-contain-top-level-folder-named-after-the-version) -- [Kuberentes tags](#kubernetes-tags) +- [Kubernetes tags](#kubernetes-tags) - [How to get it](#how-to-get-it) - [How to use it](#how-to-use-it) - [Dependency management](#dependency-management) @@ -81,15 +91,16 @@ We will backport bugfixes--but not new features--into older versions of #### Compatibility matrix -| | Kubernetes 1.4 | Kubernetes 1.5 | Kubernetes 1.6 | Kubernetes 1.7 | Kubernetes 1.8 | -|---------------------|----------------|----------------|----------------|----------------|----------------| -| client-go 1.4 | ✓ | - | - | - | - | -| client-go 1.5 | + | - | - | - | - | -| client-go 2.0 | +- | ✓ | +- | +- | +- | -| client-go 3.0 | +- | +- | ✓ | - | +- | -| client-go 4.0 | +- | +- | +- | ✓ | +- | -| client-go 5.0 | +- | +- | +- | +- | ✓ | -| client-go HEAD | +- | +- | +- | +- | + | +| | Kubernetes 1.4 | Kubernetes 1.5 | Kubernetes 1.6 | Kubernetes 1.7 | Kubernetes 1.8 | Kubernetes 1.9 | +|---------------------|----------------|----------------|----------------|----------------|----------------|----------------| +| client-go 1.4 | ✓ | - | - | - | - | - | +| client-go 1.5 | + | - | - | - | - | - | +| client-go 2.0 | +- | ✓ | +- | +- | +- | +- | +| client-go 3.0 | +- | +- | ✓ | - | +- | +- | +| client-go 4.0 | +- | +- | +- | ✓ | +- | +- | +| client-go 5.0 | +- | +- | +- | +- | ✓ | +- | +| client-go 6.0 | +- | +- | +- | +- | +- | ✓ | +| client-go HEAD | +- | +- | +- | +- | +- | + | Key: @@ -112,10 +123,11 @@ between client-go versions. |----------------|--------------------------------------|-------------------------------| | client-go 1.4 | Kubernetes main repo, 1.4 branch | = - | | client-go 1.5 | Kubernetes main repo, 1.5 branch | = - | -| client-go 2.0 | Kubernetes main repo, 1.5 branch | ✓ | -| client-go 3.0 | Kubernetes main repo, 1.6 branch | ✓ | +| client-go 2.0 | Kubernetes main repo, 1.5 branch | = - | +| client-go 3.0 | Kubernetes main repo, 1.6 branch | = - | | client-go 4.0 | Kubernetes main repo, 1.7 branch | ✓ | | client-go 5.0 | Kubernetes main repo, 1.8 branch | ✓ | +| client-go 6.0 | Kubernetes main repo, 1.9 branch | ✓ | | client-go HEAD | Kubernetes main repo, master branch | ✓ | Key: diff --git a/vendor/k8s.io/client-go/code-of-conduct.md b/vendor/k8s.io/client-go/code-of-conduct.md new file mode 100644 index 000000000..0d15c00cf --- /dev/null +++ b/vendor/k8s.io/client-go/code-of-conduct.md @@ -0,0 +1,3 @@ +# Kubernetes Community Code of Conduct + +Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/k8s.io/client-go/discovery/BUILD b/vendor/k8s.io/client-go/discovery/BUILD index e47b05276..19523ba53 100644 --- a/vendor/k8s.io/client-go/discovery/BUILD +++ b/vendor/k8s.io/client-go/discovery/BUILD @@ -39,7 +39,6 @@ go_test( "helper_blackbox_test.go", "restmapper_test.go", ], - importpath = "k8s.io/client-go/discovery_test", deps = [ "//vendor/github.com/gogo/protobuf/proto:go_default_library", "//vendor/github.com/googleapis/gnostic/OpenAPIv2:go_default_library", diff --git a/vendor/k8s.io/client-go/discovery/cached/BUILD b/vendor/k8s.io/client-go/discovery/cached/BUILD index 7f95f83e4..279e0ff9a 100644 --- a/vendor/k8s.io/client-go/discovery/cached/BUILD +++ b/vendor/k8s.io/client-go/discovery/cached/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["memcache_test.go"], - importpath = "k8s.io/client-go/discovery/cached", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/discovery/fake:go_default_library", diff --git a/vendor/k8s.io/client-go/discovery/discovery_client.go b/vendor/k8s.io/client-go/discovery/discovery_client.go index 26319f494..3c685a955 100644 --- a/vendor/k8s.io/client-go/discovery/discovery_client.go +++ b/vendor/k8s.io/client-go/discovery/discovery_client.go @@ -36,8 +36,12 @@ import ( restclient "k8s.io/client-go/rest" ) -// defaultRetries is the number of times a resource discovery is repeated if an api group disappears on the fly (e.g. ThirdPartyResources). -const defaultRetries = 2 +const ( + // defaultRetries is the number of times a resource discovery is repeated if an api group disappears on the fly (e.g. ThirdPartyResources). + defaultRetries = 2 + // protobuf mime type + mimePb = "application/com.github.proto-openapi.spec.v2@v1.0+protobuf" +) // DiscoveryInterface holds the methods that discover server-supported API groups, // versions and resources. @@ -145,9 +149,9 @@ func (d *DiscoveryClient) ServerGroups() (apiGroupList *metav1.APIGroupList, err apiGroupList = &metav1.APIGroupList{} } - // append the group retrieved from /api to the list if not empty + // prepend the group retrieved from /api to the list if not empty if len(v.Versions) != 0 { - apiGroupList.Groups = append(apiGroupList.Groups, apiGroup) + apiGroupList.Groups = append([]metav1.APIGroup{apiGroup}, apiGroupList.Groups...) } return apiGroupList, nil } @@ -329,9 +333,18 @@ func (d *DiscoveryClient) ServerVersion() (*version.Info, error) { // OpenAPISchema fetches the open api schema using a rest client and parses the proto. func (d *DiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { - data, err := d.restClient.Get().AbsPath("/swagger-2.0.0.pb-v1").Do().Raw() + data, err := d.restClient.Get().AbsPath("/openapi/v2").SetHeader("Accept", mimePb).Do().Raw() if err != nil { - return nil, err + if errors.IsForbidden(err) || errors.IsNotFound(err) { + // single endpoint not found/registered in old server, try to fetch old endpoint + // TODO(roycaihw): remove this in 1.11 + data, err = d.restClient.Get().AbsPath("/swagger-2.0.0.pb-v1").Do().Raw() + if err != nil { + return nil, err + } + } else { + return nil, err + } } document := &openapi_v2.Document{} err = proto.Unmarshal(data, document) @@ -395,15 +408,6 @@ func NewDiscoveryClient(c restclient.Interface) *DiscoveryClient { return &DiscoveryClient{restClient: c, LegacyPrefix: "/api"} } -func stringDoesntExistIn(str string, slice []string) bool { - for _, s := range slice { - if s == str { - return false - } - } - return true -} - // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *DiscoveryClient) RESTClient() restclient.Interface { diff --git a/vendor/k8s.io/client-go/discovery/discovery_client_test.go b/vendor/k8s.io/client-go/discovery/discovery_client_test.go index 409add2bf..ad855139a 100644 --- a/vendor/k8s.io/client-go/discovery/discovery_client_test.go +++ b/vendor/k8s.io/client-go/discovery/discovery_client_test.go @@ -74,6 +74,17 @@ func TestGetServerGroupsWithV1Server(t *testing.T) { "v1", }, } + case "/apis": + obj = &metav1.APIGroupList{ + Groups: []metav1.APIGroup{ + { + Name: "extensions", + Versions: []metav1.GroupVersionForDiscovery{ + {GroupVersion: "extensions/v1beta1"}, + }, + }, + }, + } default: w.WriteHeader(http.StatusNotFound) return @@ -95,8 +106,8 @@ func TestGetServerGroupsWithV1Server(t *testing.T) { t.Fatalf("unexpected error: %v", err) } groupVersions := metav1.ExtractGroupVersions(apiGroupList) - if !reflect.DeepEqual(groupVersions, []string{"v1"}) { - t.Errorf("expected: %q, got: %q", []string{"v1"}, groupVersions) + if !reflect.DeepEqual(groupVersions, []string{"v1", "extensions/v1beta1"}) { + t.Errorf("expected: %q, got: %q", []string{"v1", "extensions/v1beta1"}, groupVersions) } } @@ -315,9 +326,14 @@ var returnedOpenAPI = openapi_v2.Document{ }, } -func openapiSchemaFakeServer() (*httptest.Server, error) { +func openapiSchemaDeprecatedFakeServer() (*httptest.Server, error) { var sErr error server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + // old server returns 403 on new endpoint request + if req.URL.Path == "/openapi/v2" { + w.WriteHeader(http.StatusForbidden) + return + } if req.URL.Path != "/swagger-2.0.0.pb-v1" { sErr = fmt.Errorf("Unexpected url %v", req.URL) } @@ -338,6 +354,33 @@ func openapiSchemaFakeServer() (*httptest.Server, error) { return server, sErr } +func openapiSchemaFakeServer() (*httptest.Server, error) { + var sErr error + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + if req.URL.Path != "/openapi/v2" { + sErr = fmt.Errorf("Unexpected url %v", req.URL) + } + if req.Method != "GET" { + sErr = fmt.Errorf("Unexpected method %v", req.Method) + } + decipherableFormat := req.Header.Get("Accept") + if decipherableFormat != "application/com.github.proto-openapi.spec.v2@v1.0+protobuf" { + sErr = fmt.Errorf("Unexpected accept mime type %v", decipherableFormat) + } + + mime.AddExtensionType(".pb-v1", "application/com.github.googleapis.gnostic.OpenAPIv2@68f4ded+protobuf") + + output, err := proto.Marshal(&returnedOpenAPI) + if err != nil { + sErr = err + return + } + w.WriteHeader(http.StatusOK) + w.Write(output) + })) + return server, sErr +} + func TestGetOpenAPISchema(t *testing.T) { server, err := openapiSchemaFakeServer() if err != nil { @@ -355,6 +398,23 @@ func TestGetOpenAPISchema(t *testing.T) { } } +func TestGetOpenAPISchemaFallback(t *testing.T) { + server, err := openapiSchemaDeprecatedFakeServer() + if err != nil { + t.Errorf("unexpected error starting fake server: %v", err) + } + defer server.Close() + + client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) + got, err := client.OpenAPISchema() + if err != nil { + t.Fatalf("unexpected error getting openapi: %v", err) + } + if e, a := returnedOpenAPI, *got; !reflect.DeepEqual(e, a) { + t.Errorf("expected %v, got %v", e, a) + } +} + func TestServerPreferredResources(t *testing.T) { stable := metav1.APIResourceList{ GroupVersion: "v1", diff --git a/vendor/k8s.io/client-go/discovery/fake/BUILD b/vendor/k8s.io/client-go/discovery/fake/BUILD index 1477088da..5b50832a8 100644 --- a/vendor/k8s.io/client-go/discovery/fake/BUILD +++ b/vendor/k8s.io/client-go/discovery/fake/BUILD @@ -37,7 +37,6 @@ filegroup( go_test( name = "go_default_xtest", srcs = ["discovery_test.go"], - importpath = "k8s.io/client-go/discovery/fake_test", deps = [ "//vendor/k8s.io/apimachinery/pkg/version:go_default_library", "//vendor/k8s.io/client-go/discovery/fake:go_default_library", diff --git a/vendor/k8s.io/client-go/discovery/restmapper.go b/vendor/k8s.io/client-go/discovery/restmapper.go index 6d1de8c1b..df5ab0358 100644 --- a/vendor/k8s.io/client-go/discovery/restmapper.go +++ b/vendor/k8s.io/client-go/discovery/restmapper.go @@ -18,6 +18,7 @@ package discovery import ( "fmt" + "strings" "sync" "k8s.io/apimachinery/pkg/api/meta" @@ -108,6 +109,7 @@ func NewRESTMapper(groupResources []*APIGroupResources, versionInterfaces meta.V plural := gv.WithResource(resource.Name) singular := gv.WithResource(resource.SingularName) versionMapper.AddSpecific(gv.WithKind(resource.Kind), plural, singular, scope) + versionMapper.AddSpecific(gv.WithKind(strings.ToLower(resource.Kind)), plural, singular, scope) // TODO this is producing unsafe guesses that don't actually work, but it matches previous behavior versionMapper.Add(gv.WithKind(resource.Kind+"List"), scope) } diff --git a/vendor/k8s.io/client-go/dynamic/BUILD b/vendor/k8s.io/client-go/dynamic/BUILD index a0271859e..3642f6a0f 100644 --- a/vendor/k8s.io/client-go/dynamic/BUILD +++ b/vendor/k8s.io/client-go/dynamic/BUILD @@ -12,8 +12,7 @@ go_test( "client_test.go", "dynamic_util_test.go", ], - importpath = "k8s.io/client-go/dynamic", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library", diff --git a/vendor/k8s.io/client-go/dynamic/client.go b/vendor/k8s.io/client-go/dynamic/client.go index a941189d7..833e43537 100644 --- a/vendor/k8s.io/client-go/dynamic/client.go +++ b/vendor/k8s.io/client-go/dynamic/client.go @@ -47,7 +47,7 @@ type Interface interface { GetRateLimiter() flowcontrol.RateLimiter // Resource returns an API interface to the specified resource for this client's // group and version. If resource is not a namespaced resource, then namespace - // is ignored. The ResourceInterface inherits the paramater codec of this client. + // is ignored. The ResourceInterface inherits the parameter codec of this client. Resource(resource *metav1.APIResource, namespace string) ResourceInterface // ParameterCodec returns a client with the provided parameter codec. ParameterCodec(parameterCodec runtime.ParameterCodec) Interface @@ -145,6 +145,19 @@ type ResourceClient struct { parameterCodec runtime.ParameterCodec } +func (rc *ResourceClient) parseResourceSubresourceName() (string, []string) { + var resourceName string + var subresourceName []string + if strings.Contains(rc.resource.Name, "/") { + resourceName = strings.Split(rc.resource.Name, "/")[0] + subresourceName = strings.Split(rc.resource.Name, "/")[1:] + } else { + resourceName = rc.resource.Name + } + + return resourceName, subresourceName +} + // List returns a list of objects for this resource. func (rc *ResourceClient) List(opts metav1.ListOptions) (runtime.Object, error) { parameterEncoder := rc.parameterCodec @@ -166,9 +179,11 @@ func (rc *ResourceClient) Get(name string, opts metav1.GetOptions) (*unstructure parameterEncoder = defaultParameterEncoder } result := new(unstructured.Unstructured) + resourceName, subresourceName := rc.parseResourceSubresourceName() err := rc.cl.Get(). NamespaceIfScoped(rc.ns, rc.resource.Namespaced). - Resource(rc.resource.Name). + Resource(resourceName). + SubResource(subresourceName...). VersionedParams(&opts, parameterEncoder). Name(name). Do(). @@ -205,11 +220,26 @@ func (rc *ResourceClient) DeleteCollection(deleteOptions *metav1.DeleteOptions, // Create creates the provided resource. func (rc *ResourceClient) Create(obj *unstructured.Unstructured) (*unstructured.Unstructured, error) { result := new(unstructured.Unstructured) - err := rc.cl.Post(). + resourceName, subresourceName := rc.parseResourceSubresourceName() + req := rc.cl.Post(). NamespaceIfScoped(rc.ns, rc.resource.Namespaced). - Resource(rc.resource.Name). - Body(obj). - Do(). + Resource(resourceName). + Body(obj) + if len(subresourceName) > 0 { + // If the provided resource is a subresource, the POST request should contain + // object name. Examples of subresources that support Create operation: + // core/v1/pods/{name}/binding + // core/v1/pods/{name}/eviction + // extensions/v1beta1/deployments/{name}/rollback + // apps/v1beta1/deployments/{name}/rollback + // NOTE: Currently our system assumes every subresource object has the same + // name as the parent resource object. E.g. a pods/binding object having + // metadada.name "foo" means pod "foo" is being bound. We may need to + // change this if we break the assumption in the future. + req = req.SubResource(subresourceName...). + Name(obj.GetName()) + } + err := req.Do(). Into(result) return result, err } @@ -220,9 +250,15 @@ func (rc *ResourceClient) Update(obj *unstructured.Unstructured) (*unstructured. if len(obj.GetName()) == 0 { return result, errors.New("object missing name") } + resourceName, subresourceName := rc.parseResourceSubresourceName() err := rc.cl.Put(). NamespaceIfScoped(rc.ns, rc.resource.Namespaced). - Resource(rc.resource.Name). + Resource(resourceName). + SubResource(subresourceName...). + // NOTE: Currently our system assumes every subresource object has the same + // name as the parent resource object. E.g. a pods/binding object having + // metadada.name "foo" means pod "foo" is being bound. We may need to + // change this if we break the assumption in the future. Name(obj.GetName()). Body(obj). Do(). @@ -244,11 +280,14 @@ func (rc *ResourceClient) Watch(opts metav1.ListOptions) (watch.Interface, error Watch() } +// Patch applies the patch and returns the patched resource. func (rc *ResourceClient) Patch(name string, pt types.PatchType, data []byte) (*unstructured.Unstructured, error) { result := new(unstructured.Unstructured) + resourceName, subresourceName := rc.parseResourceSubresourceName() err := rc.cl.Patch(pt). NamespaceIfScoped(rc.ns, rc.resource.Namespaced). - Resource(rc.resource.Name). + Resource(resourceName). + SubResource(subresourceName...). Name(name). Body(data). Do(). diff --git a/vendor/k8s.io/client-go/dynamic/client_test.go b/vendor/k8s.io/client-go/dynamic/client_test.go index 1459429c0..ffa550ed5 100644 --- a/vendor/k8s.io/client-go/dynamic/client_test.go +++ b/vendor/k8s.io/client-go/dynamic/client_test.go @@ -150,6 +150,7 @@ func TestList(t *testing.T) { func TestGet(t *testing.T) { tcs := []struct { + resource string namespace string name string path string @@ -157,22 +158,39 @@ func TestGet(t *testing.T) { want *unstructured.Unstructured }{ { - name: "normal_get", - path: "/api/gtest/vtest/rtest/normal_get", - resp: getJSON("vTest", "rTest", "normal_get"), - want: getObject("vTest", "rTest", "normal_get"), + resource: "rtest", + name: "normal_get", + path: "/api/gtest/vtest/rtest/normal_get", + resp: getJSON("vTest", "rTest", "normal_get"), + want: getObject("vTest", "rTest", "normal_get"), }, { + resource: "rtest", namespace: "nstest", name: "namespaced_get", path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_get", resp: getJSON("vTest", "rTest", "namespaced_get"), want: getObject("vTest", "rTest", "namespaced_get"), }, + { + resource: "rtest/srtest", + name: "normal_subresource_get", + path: "/api/gtest/vtest/rtest/normal_subresource_get/srtest", + resp: getJSON("vTest", "srTest", "normal_subresource_get"), + want: getObject("vTest", "srTest", "normal_subresource_get"), + }, + { + resource: "rtest/srtest", + namespace: "nstest", + name: "namespaced_subresource_get", + path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_subresource_get/srtest", + resp: getJSON("vTest", "srTest", "namespaced_subresource_get"), + want: getObject("vTest", "srTest", "namespaced_subresource_get"), + }, } for _, tc := range tcs { gv := &schema.GroupVersion{Group: "gtest", Version: "vtest"} - resource := &metav1.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0} + resource := &metav1.APIResource{Name: tc.resource, Namespaced: len(tc.namespace) != 0} cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) { if r.Method != "GET" { t.Errorf("Get(%q) got HTTP method %s. wanted GET", tc.name, r.Method) @@ -303,26 +321,42 @@ func TestDeleteCollection(t *testing.T) { func TestCreate(t *testing.T) { tcs := []struct { + resource string name string namespace string obj *unstructured.Unstructured path string }{ { - name: "normal_create", - path: "/api/gtest/vtest/rtest", - obj: getObject("vTest", "rTest", "normal_create"), + resource: "rtest", + name: "normal_create", + path: "/api/gtest/vtest/rtest", + obj: getObject("vTest", "rTest", "normal_create"), }, { + resource: "rtest", name: "namespaced_create", namespace: "nstest", path: "/api/gtest/vtest/namespaces/nstest/rtest", obj: getObject("vTest", "rTest", "namespaced_create"), }, + { + resource: "rtest/srtest", + name: "normal_subresource_create", + path: "/api/gtest/vtest/rtest/normal_subresource_create/srtest", + obj: getObject("vTest", "srTest", "normal_subresource_create"), + }, + { + resource: "rtest/srtest", + name: "namespaced_subresource_create", + namespace: "nstest", + path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_subresource_create/srtest", + obj: getObject("vTest", "srTest", "namespaced_subresource_create"), + }, } for _, tc := range tcs { gv := &schema.GroupVersion{Group: "gtest", Version: "vtest"} - resource := &metav1.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0} + resource := &metav1.APIResource{Name: tc.resource, Namespaced: len(tc.namespace) != 0} cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) { if r.Method != "POST" { t.Errorf("Create(%q) got HTTP method %s. wanted POST", tc.name, r.Method) @@ -362,26 +396,42 @@ func TestCreate(t *testing.T) { func TestUpdate(t *testing.T) { tcs := []struct { + resource string name string namespace string obj *unstructured.Unstructured path string }{ { - name: "normal_update", - path: "/api/gtest/vtest/rtest/normal_update", - obj: getObject("vTest", "rTest", "normal_update"), + resource: "rtest", + name: "normal_update", + path: "/api/gtest/vtest/rtest/normal_update", + obj: getObject("vTest", "rTest", "normal_update"), }, { + resource: "rtest", name: "namespaced_update", namespace: "nstest", path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_update", obj: getObject("vTest", "rTest", "namespaced_update"), }, + { + resource: "rtest/srtest", + name: "normal_subresource_update", + path: "/api/gtest/vtest/rtest/normal_update/srtest", + obj: getObject("vTest", "srTest", "normal_update"), + }, + { + resource: "rtest/srtest", + name: "namespaced_subresource_update", + namespace: "nstest", + path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_update/srtest", + obj: getObject("vTest", "srTest", "namespaced_update"), + }, } for _, tc := range tcs { gv := &schema.GroupVersion{Group: "gtest", Version: "vtest"} - resource := &metav1.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0} + resource := &metav1.APIResource{Name: tc.resource, Namespaced: len(tc.namespace) != 0} cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) { if r.Method != "PUT" { t.Errorf("Update(%q) got HTTP method %s. wanted PUT", tc.name, r.Method) @@ -492,6 +542,7 @@ func TestWatch(t *testing.T) { func TestPatch(t *testing.T) { tcs := []struct { + resource string name string namespace string patch []byte @@ -499,22 +550,39 @@ func TestPatch(t *testing.T) { path string }{ { - name: "normal_patch", - path: "/api/gtest/vtest/rtest/normal_patch", - patch: getJSON("vTest", "rTest", "normal_patch"), - want: getObject("vTest", "rTest", "normal_patch"), + resource: "rtest", + name: "normal_patch", + path: "/api/gtest/vtest/rtest/normal_patch", + patch: getJSON("vTest", "rTest", "normal_patch"), + want: getObject("vTest", "rTest", "normal_patch"), }, { + resource: "rtest", name: "namespaced_patch", namespace: "nstest", path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_patch", patch: getJSON("vTest", "rTest", "namespaced_patch"), want: getObject("vTest", "rTest", "namespaced_patch"), }, + { + resource: "rtest/srtest", + name: "normal_subresource_patch", + path: "/api/gtest/vtest/rtest/normal_subresource_patch/srtest", + patch: getJSON("vTest", "srTest", "normal_subresource_patch"), + want: getObject("vTest", "srTest", "normal_subresource_patch"), + }, + { + resource: "rtest/srtest", + name: "namespaced_subresource_patch", + namespace: "nstest", + path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_subresource_patch/srtest", + patch: getJSON("vTest", "srTest", "namespaced_subresource_patch"), + want: getObject("vTest", "srTest", "namespaced_subresource_patch"), + }, } for _, tc := range tcs { gv := &schema.GroupVersion{Group: "gtest", Version: "vtest"} - resource := &metav1.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0} + resource := &metav1.APIResource{Name: tc.resource, Namespaced: len(tc.namespace) != 0} cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) { if r.Method != "PATCH" { t.Errorf("Patch(%q) got HTTP method %s. wanted PATCH", tc.name, r.Method) diff --git a/vendor/k8s.io/client-go/dynamic/fake/client.go b/vendor/k8s.io/client-go/dynamic/fake/client.go index 6c11d4227..8399076c2 100644 --- a/vendor/k8s.io/client-go/dynamic/fake/client.go +++ b/vendor/k8s.io/client-go/dynamic/fake/client.go @@ -46,7 +46,7 @@ func (c *FakeClient) GetRateLimiter() flowcontrol.RateLimiter { // Resource returns an API interface to the specified resource for this client's // group and version. If resource is not a namespaced resource, then namespace -// is ignored. The ResourceClient inherits the paramater codec of this client +// is ignored. The ResourceClient inherits the parameter codec of this client func (c *FakeClient) Resource(resource *metav1.APIResource, namespace string) dynamic.ResourceInterface { return &FakeResourceClient{ Resource: c.GroupVersion.WithResource(resource.Name), diff --git a/vendor/k8s.io/client-go/examples/create-update-delete-deployment/BUILD b/vendor/k8s.io/client-go/examples/create-update-delete-deployment/BUILD index 741403b31..2da72ec9f 100644 --- a/vendor/k8s.io/client-go/examples/create-update-delete-deployment/BUILD +++ b/vendor/k8s.io/client-go/examples/create-update-delete-deployment/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "create-update-delete-deployment", - importpath = "k8s.io/client-go/examples/create-update-delete-deployment", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/examples/create-update-delete-deployment/README.md b/vendor/k8s.io/client-go/examples/create-update-delete-deployment/README.md index e9c11a935..47d8dd1ee 100644 --- a/vendor/k8s.io/client-go/examples/create-update-delete-deployment/README.md +++ b/vendor/k8s.io/client-go/examples/create-update-delete-deployment/README.md @@ -48,7 +48,7 @@ Running this command will execute the following operations on your cluster: dependent ReplicaSet resource. Verify with `kubectl get deployments`. Each step is separated by an interactive prompt. You must hit the -Return key to proceeed to the next step. You can use these prompts as +Return key to proceed to the next step. You can use these prompts as a break to take time to run `kubectl` and inspect the result of the operations executed. diff --git a/vendor/k8s.io/client-go/examples/in-cluster-client-configuration/BUILD b/vendor/k8s.io/client-go/examples/in-cluster-client-configuration/BUILD index d6c8dacc1..f4146ae37 100644 --- a/vendor/k8s.io/client-go/examples/in-cluster-client-configuration/BUILD +++ b/vendor/k8s.io/client-go/examples/in-cluster-client-configuration/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "in-cluster-client-configuration", - importpath = "k8s.io/client-go/examples/in-cluster-client-configuration", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/BUILD b/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/BUILD index cf8f05e2b..2fda9686f 100644 --- a/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/BUILD +++ b/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "out-of-cluster-client-configuration", - importpath = "k8s.io/client-go/examples/out-of-cluster-client-configuration", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go b/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go index 252307b18..9d79b9776 100644 --- a/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go +++ b/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go @@ -62,15 +62,18 @@ func main() { // Examples for error handling: // - Use helper functions like e.g. errors.IsNotFound() // - And/or cast to StatusError and use its properties like e.g. ErrStatus.Message - _, err = clientset.CoreV1().Pods("default").Get("example-xxxxx", metav1.GetOptions{}) + namespace := "default" + pod := "example-xxxxx" + _, err = clientset.CoreV1().Pods(namespace).Get(pod, metav1.GetOptions{}) if errors.IsNotFound(err) { - fmt.Printf("Pod not found\n") + fmt.Printf("Pod %s in namespace %s not found\n", pod, namespace) } else if statusError, isStatus := err.(*errors.StatusError); isStatus { - fmt.Printf("Error getting pod %v\n", statusError.ErrStatus.Message) + fmt.Printf("Error getting pod %s in namespace %s: %v\n", + pod, namespace, statusError.ErrStatus.Message) } else if err != nil { panic(err.Error()) } else { - fmt.Printf("Found pod\n") + fmt.Printf("Found pod %s in namespace %s\n", pod, namespace) } time.Sleep(10 * time.Second) diff --git a/vendor/k8s.io/client-go/examples/workqueue/BUILD b/vendor/k8s.io/client-go/examples/workqueue/BUILD index b0890ae79..8c3c7cb51 100644 --- a/vendor/k8s.io/client-go/examples/workqueue/BUILD +++ b/vendor/k8s.io/client-go/examples/workqueue/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "workqueue", - importpath = "k8s.io/client-go/examples/workqueue", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/interface.go b/vendor/k8s.io/client-go/informers/admissionregistration/interface.go index 74bfb6019..138dccc26 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/interface.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package admissionregistration diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/initializerconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/initializerconfiguration.go index 0f55c737f..659a04caf 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/initializerconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/initializerconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + admissionregistration_v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/admissionregistration/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // InitializerConfigurationInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go index 44da04796..54df1caf3 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go index 4f08d69a0..5364c1ae1 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 31a2a865c..6e65a86c3 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + admissionregistration_v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/admissionregistration/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // MutatingWebhookConfigurationInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go index d87ab9002..42d16177c 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + admissionregistration_v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/admissionregistration/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ValidatingWebhookConfigurationInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/interface.go b/vendor/k8s.io/client-go/informers/apps/interface.go index fdd32de0f..7013d4d6f 100644 --- a/vendor/k8s.io/client-go/informers/apps/interface.go +++ b/vendor/k8s.io/client-go/informers/apps/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package apps diff --git a/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go index a69be9c70..3fe6630ff 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + apps_v1 "k8s.io/api/apps/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ControllerRevisionInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go b/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go index 1c7abf7d0..4e10d6f6f 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + apps_v1 "k8s.io/api/apps/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // DaemonSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1/deployment.go index 9f6beed6e..e08f42ddb 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + apps_v1 "k8s.io/api/apps/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // DeploymentInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1/interface.go b/vendor/k8s.io/client-go/informers/apps/v1/interface.go index 6145fd6cc..f3abfa9aa 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go b/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go index 1ac50607f..2a17836cb 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + apps_v1 "k8s.io/api/apps/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ReplicaSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go index 535790df9..e7084af58 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + apps_v1 "k8s.io/api/apps/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // StatefulSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go index 1e2de416b..b4878e724 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + apps_v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/apps/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ControllerRevisionInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go index 4d2dea575..589ec39a5 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + apps_v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/apps/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // DeploymentInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go index 3a51a1f5b..c0a487ca2 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go index 779ae2c60..f12364c51 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + apps_v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/apps/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // StatefulSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go index a7d55ab4c..a2f3ceaac 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( + time "time" + apps_v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" - time "time" ) // ControllerRevisionInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go index 5d3288026..700895e61 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( + time "time" + apps_v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" - time "time" ) // DaemonSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go index 6b6cd6035..ba1a3cf9b 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( + time "time" + apps_v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" - time "time" ) // DeploymentInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go index 59a6e73d4..93a1940d9 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go index 988a3e4fb..6a46b810b 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( + time "time" + apps_v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" - time "time" ) // ReplicaSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go index dff9c2408..841cbd8ab 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( + time "time" + apps_v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" - time "time" ) // StatefulSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/autoscaling/interface.go b/vendor/k8s.io/client-go/informers/autoscaling/interface.go index 63a5c0ccd..347d6f628 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/interface.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package autoscaling diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go index 7d875e735..1215c7f3b 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + autoscaling_v1 "k8s.io/api/autoscaling/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/autoscaling/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // HorizontalPodAutoscalerInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go b/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go index 5ba907012..ffa7a168e 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go index 9865f8e13..208757de3 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v2beta1 import ( + time "time" + autoscaling_v2beta1 "k8s.io/api/autoscaling/v2beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v2beta1 "k8s.io/client-go/listers/autoscaling/v2beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // HorizontalPodAutoscalerInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/interface.go b/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/interface.go index 4c9ea8499..37ce2bc5f 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v2beta1 diff --git a/vendor/k8s.io/client-go/informers/batch/interface.go b/vendor/k8s.io/client-go/informers/batch/interface.go index bbaec7964..f08227ba4 100644 --- a/vendor/k8s.io/client-go/informers/batch/interface.go +++ b/vendor/k8s.io/client-go/informers/batch/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package batch diff --git a/vendor/k8s.io/client-go/informers/batch/v1/interface.go b/vendor/k8s.io/client-go/informers/batch/v1/interface.go index 41c08ea2d..5a09dc7ce 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/batch/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/batch/v1/job.go b/vendor/k8s.io/client-go/informers/batch/v1/job.go index 8a2e5f0d8..36d3cef42 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1/job.go +++ b/vendor/k8s.io/client-go/informers/batch/v1/job.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + batch_v1 "k8s.io/api/batch/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/batch/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // JobInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go b/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go index 4edfd4153..9dfaed490 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go +++ b/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + batch_v1beta1 "k8s.io/api/batch/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/batch/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // CronJobInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go index 0ba1935dc..3ba8401ac 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go b/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go index 03a6e6f88..82bc9422f 100644 --- a/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go +++ b/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v2alpha1 import ( + time "time" + batch_v2alpha1 "k8s.io/api/batch/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v2alpha1 "k8s.io/client-go/listers/batch/v2alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // CronJobInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/batch/v2alpha1/interface.go b/vendor/k8s.io/client-go/informers/batch/v2alpha1/interface.go index 39b6f33f0..3c2780fd2 100644 --- a/vendor/k8s.io/client-go/informers/batch/v2alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/batch/v2alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v2alpha1 diff --git a/vendor/k8s.io/client-go/informers/certificates/interface.go b/vendor/k8s.io/client-go/informers/certificates/interface.go index 1eefe4797..9b3121186 100644 --- a/vendor/k8s.io/client-go/informers/certificates/interface.go +++ b/vendor/k8s.io/client-go/informers/certificates/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package certificates diff --git a/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go b/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go index 44aac5c72..a3d6c2d6a 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + certificates_v1beta1 "k8s.io/api/certificates/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/certificates/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // CertificateSigningRequestInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go index 8578023c7..718f370ee 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/core/interface.go b/vendor/k8s.io/client-go/informers/core/interface.go index 7fc2a5cd5..aba68f349 100644 --- a/vendor/k8s.io/client-go/informers/core/interface.go +++ b/vendor/k8s.io/client-go/informers/core/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package core diff --git a/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go b/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go index 77b17fd3e..33fc65a52 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go +++ b/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ComponentStatusInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/configmap.go b/vendor/k8s.io/client-go/informers/core/v1/configmap.go index ed0f4c2d9..618e74994 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/configmap.go +++ b/vendor/k8s.io/client-go/informers/core/v1/configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ConfigMapInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/endpoints.go b/vendor/k8s.io/client-go/informers/core/v1/endpoints.go index 8a7228baf..fa56fbc25 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/endpoints.go +++ b/vendor/k8s.io/client-go/informers/core/v1/endpoints.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // EndpointsInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/event.go b/vendor/k8s.io/client-go/informers/core/v1/event.go index 23f5ead66..515784175 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/event.go +++ b/vendor/k8s.io/client-go/informers/core/v1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // EventInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/interface.go b/vendor/k8s.io/client-go/informers/core/v1/interface.go index e560b12f8..9580dd9e0 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/core/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/core/v1/limitrange.go b/vendor/k8s.io/client-go/informers/core/v1/limitrange.go index 9588b9402..8edffdfb7 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/limitrange.go +++ b/vendor/k8s.io/client-go/informers/core/v1/limitrange.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // LimitRangeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/namespace.go b/vendor/k8s.io/client-go/informers/core/v1/namespace.go index eb841b157..e1925fed1 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/namespace.go +++ b/vendor/k8s.io/client-go/informers/core/v1/namespace.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // NamespaceInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/node.go b/vendor/k8s.io/client-go/informers/core/v1/node.go index 3c70e52b0..dc829bcd6 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/node.go +++ b/vendor/k8s.io/client-go/informers/core/v1/node.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // NodeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go b/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go index e944560f7..b3ed3c0d0 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go +++ b/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PersistentVolumeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go b/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go index 136884d4c..9b4fde573 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PersistentVolumeClaimInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/pod.go b/vendor/k8s.io/client-go/informers/core/v1/pod.go index b97208290..18e61b225 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/pod.go +++ b/vendor/k8s.io/client-go/informers/core/v1/pod.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PodInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go b/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go index c05753850..a7de79b18 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go +++ b/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PodTemplateInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go b/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go index e04cd1469..df0a1d604 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go +++ b/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ReplicationControllerInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go b/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go index 3ef4f4c12..89a56acb8 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go +++ b/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ResourceQuotaInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/secret.go b/vendor/k8s.io/client-go/informers/core/v1/secret.go index 7bc6395a4..05939c861 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/secret.go +++ b/vendor/k8s.io/client-go/informers/core/v1/secret.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // SecretInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/service.go b/vendor/k8s.io/client-go/informers/core/v1/service.go index d1b5ed02f..0e8aa0f7a 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/service.go +++ b/vendor/k8s.io/client-go/informers/core/v1/service.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ServiceInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go b/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go index fb9c50aa3..bf3b5a7bb 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go +++ b/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ServiceAccountInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/events/interface.go b/vendor/k8s.io/client-go/informers/events/interface.go index 81f6646f7..e8ad97c3c 100644 --- a/vendor/k8s.io/client-go/informers/events/interface.go +++ b/vendor/k8s.io/client-go/informers/events/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package events diff --git a/vendor/k8s.io/client-go/informers/events/v1beta1/event.go b/vendor/k8s.io/client-go/informers/events/v1beta1/event.go index d604b4cf0..8f2b27cf5 100644 --- a/vendor/k8s.io/client-go/informers/events/v1beta1/event.go +++ b/vendor/k8s.io/client-go/informers/events/v1beta1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + events_v1beta1 "k8s.io/api/events/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/events/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // EventInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go index d079afed5..0c67badb2 100644 --- a/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/extensions/interface.go b/vendor/k8s.io/client-go/informers/extensions/interface.go index a6bfc3b44..93d912ca5 100644 --- a/vendor/k8s.io/client-go/informers/extensions/interface.go +++ b/vendor/k8s.io/client-go/informers/extensions/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package extensions diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go index c64b14c3d..0f24af5ca 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + extensions_v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // DaemonSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go index 4bcfc5c25..980eecb0f 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + extensions_v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // DeploymentInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go index 22dac92b9..b250d22a3 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + extensions_v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // IngressInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go index ce060e0d9..10aa1b704 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go index 18ef2735b..76b83b823 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + extensions_v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PodSecurityPolicyInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go index 856cb30ba..31c6a1b86 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + extensions_v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ReplicaSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/factory.go b/vendor/k8s.io/client-go/informers/factory.go index e922c1276..455afc2b9 100644 --- a/vendor/k8s.io/client-go/informers/factory.go +++ b/vendor/k8s.io/client-go/informers/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package informers import ( + reflect "reflect" + sync "sync" + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -39,9 +43,6 @@ import ( storage "k8s.io/client-go/informers/storage" kubernetes "k8s.io/client-go/kubernetes" cache "k8s.io/client-go/tools/cache" - reflect "reflect" - sync "sync" - time "time" ) type sharedInformerFactory struct { diff --git a/vendor/k8s.io/client-go/informers/generic.go b/vendor/k8s.io/client-go/informers/generic.go index 70ed43317..801267edf 100644 --- a/vendor/k8s.io/client-go/informers/generic.go +++ b/vendor/k8s.io/client-go/informers/generic.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package informers import ( "fmt" + v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/api/apps/v1" @@ -197,6 +198,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=policy, Version=v1beta1 case policy_v1beta1.SchemeGroupVersion.WithResource("poddisruptionbudgets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodDisruptionBudgets().Informer()}, nil + case policy_v1beta1.SchemeGroupVersion.WithResource("podsecuritypolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodSecurityPolicies().Informer()}, nil // Group=rbac.authorization.k8s.io, Version=v1 case rbac_v1.SchemeGroupVersion.WithResource("clusterroles"): @@ -247,6 +250,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=storage.k8s.io, Version=v1beta1 case storage_v1beta1.SchemeGroupVersion.WithResource("storageclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().StorageClasses().Informer()}, nil + case storage_v1beta1.SchemeGroupVersion.WithResource("volumeattachments"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().VolumeAttachments().Informer()}, nil } diff --git a/vendor/k8s.io/client-go/informers/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/client-go/informers/internalinterfaces/factory_interfaces.go index 61155f740..4e2a28fc7 100644 --- a/vendor/k8s.io/client-go/informers/internalinterfaces/factory_interfaces.go +++ b/vendor/k8s.io/client-go/informers/internalinterfaces/factory_interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,16 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalinterfaces import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" kubernetes "k8s.io/client-go/kubernetes" cache "k8s.io/client-go/tools/cache" - time "time" ) type NewInformerFunc func(kubernetes.Interface, time.Duration) cache.SharedIndexInformer diff --git a/vendor/k8s.io/client-go/informers/networking/interface.go b/vendor/k8s.io/client-go/informers/networking/interface.go index 79e0d0c15..0f6c45649 100644 --- a/vendor/k8s.io/client-go/informers/networking/interface.go +++ b/vendor/k8s.io/client-go/informers/networking/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package networking diff --git a/vendor/k8s.io/client-go/informers/networking/v1/interface.go b/vendor/k8s.io/client-go/informers/networking/v1/interface.go index 980a7be99..819a86146 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/networking/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go b/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go index b712ba030..20ac9909d 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go +++ b/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + networking_v1 "k8s.io/api/networking/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/networking/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // NetworkPolicyInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/policy/interface.go b/vendor/k8s.io/client-go/informers/policy/interface.go index f893c3d5b..e77ab2b24 100644 --- a/vendor/k8s.io/client-go/informers/policy/interface.go +++ b/vendor/k8s.io/client-go/informers/policy/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package policy diff --git a/vendor/k8s.io/client-go/informers/policy/v1beta1/BUILD b/vendor/k8s.io/client-go/informers/policy/v1beta1/BUILD index 39a7a9d34..547a0a397 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/informers/policy/v1beta1/BUILD @@ -10,6 +10,7 @@ go_library( srcs = [ "interface.go", "poddisruptionbudget.go", + "podsecuritypolicy.go", ], importpath = "k8s.io/client-go/informers/policy/v1beta1", deps = [ diff --git a/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go index f235ee1d0..b368f068f 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 @@ -26,6 +26,8 @@ import ( type Interface interface { // PodDisruptionBudgets returns a PodDisruptionBudgetInformer. PodDisruptionBudgets() PodDisruptionBudgetInformer + // PodSecurityPolicies returns a PodSecurityPolicyInformer. + PodSecurityPolicies() PodSecurityPolicyInformer } type version struct { @@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (v *version) PodDisruptionBudgets() PodDisruptionBudgetInformer { return &podDisruptionBudgetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } + +// PodSecurityPolicies returns a PodSecurityPolicyInformer. +func (v *version) PodSecurityPolicies() PodSecurityPolicyInformer { + return &podSecurityPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go b/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go index ba0da35b1..d5178652a 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + policy_v1beta1 "k8s.io/api/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/policy/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PodDisruptionBudgetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/policy/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/informers/policy/v1beta1/podsecuritypolicy.go new file mode 100644 index 000000000..c9bcc8bab --- /dev/null +++ b/vendor/k8s.io/client-go/informers/policy/v1beta1/podsecuritypolicy.go @@ -0,0 +1,88 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + time "time" + + policy_v1beta1 "k8s.io/api/policy/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1beta1 "k8s.io/client-go/listers/policy/v1beta1" + cache "k8s.io/client-go/tools/cache" +) + +// PodSecurityPolicyInformer provides access to a shared informer and lister for +// PodSecurityPolicies. +type PodSecurityPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.PodSecurityPolicyLister +} + +type podSecurityPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewPodSecurityPolicyInformer constructs a new informer for PodSecurityPolicy 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 NewPodSecurityPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPodSecurityPolicyInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredPodSecurityPolicyInformer constructs a new informer for PodSecurityPolicy 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 NewFilteredPodSecurityPolicyInformer(client kubernetes.Interface, 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.PolicyV1beta1().PodSecurityPolicies().List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PolicyV1beta1().PodSecurityPolicies().Watch(options) + }, + }, + &policy_v1beta1.PodSecurityPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *podSecurityPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPodSecurityPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *podSecurityPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&policy_v1beta1.PodSecurityPolicy{}, f.defaultInformer) +} + +func (f *podSecurityPolicyInformer) Lister() v1beta1.PodSecurityPolicyLister { + return v1beta1.NewPodSecurityPolicyLister(f.Informer().GetIndexer()) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/interface.go b/vendor/k8s.io/client-go/informers/rbac/interface.go index df7adfcd3..ac491ee42 100644 --- a/vendor/k8s.io/client-go/informers/rbac/interface.go +++ b/vendor/k8s.io/client-go/informers/rbac/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package rbac diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go index ac75abbc8..f541957a2 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + rbac_v1 "k8s.io/api/rbac/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go index a3c73e586..bf1d7bdc1 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + rbac_v1 "k8s.io/api/rbac/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/interface.go b/vendor/k8s.io/client-go/informers/rbac/v1/interface.go index 1e46b039b..fca0e807b 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1/role.go index fb1de4614..f08e1fde3 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + rbac_v1 "k8s.io/api/rbac/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go index 78c78fa1a..f91c2ef03 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + rbac_v1 "k8s.io/api/rbac/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go index ec257965b..9293439f4 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + rbac_v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go index a2d0c3960..d13561274 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + rbac_v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go index 586283d4a..1c972ec82 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go index 4564b3361..5b4148fa9 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + rbac_v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go index 556f966a8..54bae16e7 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + rbac_v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go index 821746b90..f429eeca1 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + rbac_v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go index c517ac456..5900eae9a 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + rbac_v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go index 9d375d947..c36d644e1 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go index 0f13d3aaf..479044b42 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + rbac_v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go index c951d97d5..34feed183 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + rbac_v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/scheduling/interface.go b/vendor/k8s.io/client-go/informers/scheduling/interface.go index 60b63e8e5..89aaac195 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/interface.go +++ b/vendor/k8s.io/client-go/informers/scheduling/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package scheduling diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/interface.go index 1cceef7b2..091dd90b6 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go b/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go index 5c90f43df..8a27631be 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + scheduling_v1alpha1 "k8s.io/api/scheduling/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/scheduling/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PriorityClassInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/settings/interface.go b/vendor/k8s.io/client-go/informers/settings/interface.go index 53bc66217..cc134f706 100644 --- a/vendor/k8s.io/client-go/informers/settings/interface.go +++ b/vendor/k8s.io/client-go/informers/settings/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package settings diff --git a/vendor/k8s.io/client-go/informers/settings/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/settings/v1alpha1/interface.go index 39007ebe2..d2964352a 100644 --- a/vendor/k8s.io/client-go/informers/settings/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/settings/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go b/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go index 2e630c73d..7e241b2be 100644 --- a/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go +++ b/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + settings_v1alpha1 "k8s.io/api/settings/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/settings/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PodPresetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/storage/interface.go b/vendor/k8s.io/client-go/informers/storage/interface.go index b91613a92..6581a2a8d 100644 --- a/vendor/k8s.io/client-go/informers/storage/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package storage diff --git a/vendor/k8s.io/client-go/informers/storage/v1/interface.go b/vendor/k8s.io/client-go/informers/storage/v1/interface.go index fadb1a073..ebdb1d98a 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go b/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go index 341549f0f..5ef571eb4 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + storage_v1 "k8s.io/api/storage/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/storage/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // StorageClassInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go index d84eb5fd2..f1b1a9bbd 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go b/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go index cab9ffc46..506517acd 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go +++ b/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + storage_v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/storage/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // VolumeAttachmentInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/BUILD b/vendor/k8s.io/client-go/informers/storage/v1beta1/BUILD index 0a7ad316b..64aae5165 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/BUILD @@ -10,6 +10,7 @@ go_library( srcs = [ "interface.go", "storageclass.go", + "volumeattachment.go", ], importpath = "k8s.io/client-go/informers/storage/v1beta1", deps = [ diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go index 7fa1abf5f..5a63728f1 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 @@ -26,6 +26,8 @@ import ( type Interface interface { // StorageClasses returns a StorageClassInformer. StorageClasses() StorageClassInformer + // VolumeAttachments returns a VolumeAttachmentInformer. + VolumeAttachments() VolumeAttachmentInformer } type version struct { @@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (v *version) StorageClasses() StorageClassInformer { return &storageClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// VolumeAttachments returns a VolumeAttachmentInformer. +func (v *version) VolumeAttachments() VolumeAttachmentInformer { + return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go index 3e96b2820..0b4edbf52 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + storage_v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/storage/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // StorageClassInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go new file mode 100644 index 000000000..ae3c2fd71 --- /dev/null +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go @@ -0,0 +1,88 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + time "time" + + storage_v1beta1 "k8s.io/api/storage/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1beta1 "k8s.io/client-go/listers/storage/v1beta1" + cache "k8s.io/client-go/tools/cache" +) + +// VolumeAttachmentInformer provides access to a shared informer and lister for +// VolumeAttachments. +type VolumeAttachmentInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.VolumeAttachmentLister +} + +type volumeAttachmentInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewVolumeAttachmentInformer constructs a new informer for VolumeAttachment 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 NewVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVolumeAttachmentInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment 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 NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, 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.StorageV1beta1().VolumeAttachments().List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().VolumeAttachments().Watch(options) + }, + }, + &storage_v1beta1.VolumeAttachment{}, + resyncPeriod, + indexers, + ) +} + +func (f *volumeAttachmentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVolumeAttachmentInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *volumeAttachmentInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&storage_v1beta1.VolumeAttachment{}, f.defaultInformer) +} + +func (f *volumeAttachmentInformer) Lister() v1beta1.VolumeAttachmentLister { + return v1beta1.NewVolumeAttachmentLister(f.Informer().GetIndexer()) +} diff --git a/vendor/k8s.io/client-go/kubernetes/clientset.go b/vendor/k8s.io/client-go/kubernetes/clientset.go index 7dcf86a70..d867a58b2 100644 --- a/vendor/k8s.io/client-go/kubernetes/clientset.go +++ b/vendor/k8s.io/client-go/kubernetes/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package kubernetes import ( diff --git a/vendor/k8s.io/client-go/kubernetes/doc.go b/vendor/k8s.io/client-go/kubernetes/doc.go index d8e920a5c..c5870c01a 100644 --- a/vendor/k8s.io/client-go/kubernetes/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated clientset. package kubernetes diff --git a/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go b/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go index 12cfac0a8..0eb5ac9e5 100644 --- a/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go +++ b/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( @@ -95,7 +97,15 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { fakePtr := testing.Fake{} fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) - fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil)) + fakePtr.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} } diff --git a/vendor/k8s.io/client-go/kubernetes/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/fake/doc.go index 3fd8e1e2c..0bc260bca 100644 --- a/vendor/k8s.io/client-go/kubernetes/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated fake clientset. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/fake/register.go b/vendor/k8s.io/client-go/kubernetes/fake/register.go index 7c78f5670..45fdf124c 100644 --- a/vendor/k8s.io/client-go/kubernetes/fake/register.go +++ b/vendor/k8s.io/client-go/kubernetes/fake/register.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( @@ -65,7 +67,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -103,5 +105,4 @@ func AddToScheme(scheme *runtime.Scheme) { storagev1beta1.AddToScheme(scheme) storagev1.AddToScheme(scheme) storagev1alpha1.AddToScheme(scheme) - } diff --git a/vendor/k8s.io/client-go/kubernetes/scheme/doc.go b/vendor/k8s.io/client-go/kubernetes/scheme/doc.go index 3ec2200d0..5c5c8debb 100644 --- a/vendor/k8s.io/client-go/kubernetes/scheme/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package contains the scheme of the automatically generated clientset. package scheme diff --git a/vendor/k8s.io/client-go/kubernetes/scheme/register.go b/vendor/k8s.io/client-go/kubernetes/scheme/register.go index 7bfd33618..66e2dcd18 100644 --- a/vendor/k8s.io/client-go/kubernetes/scheme/register.go +++ b/vendor/k8s.io/client-go/kubernetes/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package scheme import ( @@ -65,7 +67,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -103,5 +105,4 @@ func AddToScheme(scheme *runtime.Scheme) { storagev1beta1.AddToScheme(scheme) storagev1.AddToScheme(scheme) storagev1alpha1.AddToScheme(scheme) - } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go index 5150fee3c..8137129fc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/doc.go index cdaaf6207..69ca30111 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go index d73267ee6..2917c0ae4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_initializerconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_initializerconfiguration.go index a06b59f63..699261cd4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_initializerconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_initializerconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go index ccdfb43f6..710bc4ea4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 type InitializerConfigurationExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go index 757a1c1d9..77c6b8fcc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go index 8d3774b4e..44b20b577 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/doc.go index 1b50aa199..11ae7049d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go index 148eaf9f8..3255acb47 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go index a02bf7b7c..044636ead 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go index 422a0a241..f06582d4e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/generated_expansion.go index 012a8da7e..293697555 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type MutatingWebhookConfigurationExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 36711a500..d37f68448 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go index d66849225..30dcfddbc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go index 07936304e..b0af79806 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go index 1d9f83134..26d020747 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go index fd38c53c5..73fd1e9bd 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go index 34c06c8de..1a3e8f730 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/doc.go index b6a2a4672..d007a2903 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go index d4e34411b..11accc235 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go index ae9d4f3ff..fb43bea4c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go index 3f32ed1f3..0ee4cd33d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go index b0e8f82d7..852b628ad 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go index ba8539578..03f7558d4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go index 39d3c59fb..af0a90720 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/generated_expansion.go index 500d67dd3..0f603bb8c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type ControllerRevisionExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go index 5047b0c5f..f2f9c7256 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go index 2c927ac0c..78fe23f84 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go index 7d1fd9e6a..1aebc2176 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go index 348c955a0..312ba3c47 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go index 8a72cefbc..2ff58aeac 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go index 1b50aa199..11ae7049d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go index f1280bc3f..5cc316882 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go index f75db1bad..2360bb07a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go index 2907c2a8c..5282d8cd9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_scale.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_scale.go index 8abb429ac..72615c803 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeScales implements ScaleInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go index 1ae9c6a58..6e1d7a560 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go index a091b902a..a44a94b63 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type ControllerRevisionExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/scale.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/scale.go index d3bf9e103..e8c507326 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go index 8e5b9f570..6f89ca73a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go index 771c7447e..8d5a78c44 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go index d28240339..28b30e8be 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go index 4657c1b2c..c21fc50a8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go index 7da8d2696..270be527e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/doc.go index e8d65fa24..01d0ed2c2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta2 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go index 20bd67d24..7223cd24e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go index 62b89e209..720972e7d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go index dfd1c4abe..3576b8427 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go index 3b204f2a7..1f654a3cc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go index 338f92c11..f8e69a3a3 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_scale.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_scale.go index a6ad9f1e7..fb5eb5c59 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeScales implements ScaleInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go index bdff83300..0413428eb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/generated_expansion.go index b0fe7ef70..a88e1721f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 type ControllerRevisionExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go index dc6ce1052..298ec26a2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/scale.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/scale.go index 2c2aa185f..84f27a797 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go index 516587faa..64b7c8c8f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go index dcc31d654..25b86152d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/doc.go index b6a2a4672..d007a2903 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go index 85eb00ddf..93a0633e8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go index b1c527a71..d98aa03d8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeTokenReviews implements TokenReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go index 42e76d5e4..7c92b9147 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go index 9cfef4e6a..88f759f2b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go index 6004b0e30..744c26c9e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go index 1b50aa199..11ae7049d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go index 8f66d8c5b..abc1fedd1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go index e8c57210b..c7c3e5631 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeTokenReviews implements TokenReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go index 2b7e8ca0b..7fd68c803 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go index 7f9f1e9fa..fa611825e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go index 385dffcd1..852720f34 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/doc.go index b6a2a4672..d007a2903 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go index 7ee26250b..5db9b9f34 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go index a49fc9b72..5f1aab8a4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go index 26d9011b4..7e466e1ec 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go index dfe947b90..82c1ac9cf 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSelfSubjectRulesReviews implements SelfSubjectRulesReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go index 778d06e59..cbc440e71 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSubjectAccessReviews implements SubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go index 42e76d5e4..7c92b9147 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go index b2085bceb..20461f132 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go index cfb019eaa..202e7c90d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go index fbd374a13..5fb1cab5c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go index 08f6d6095..881641494 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go index 7c0534123..cbe5bdcee 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go index 1b50aa199..11ae7049d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go index 33d5746a5..7c3fc1746 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go index 11987f125..c7949a7df 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go index aeba43895..20904d179 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go index 4e221c282..2acd5f279 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSelfSubjectRulesReviews implements SelfSubjectRulesReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go index 4413c6d34..218ed3d8f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSubjectAccessReviews implements SubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go index 2b7e8ca0b..7fd68c803 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go index 9b8e10341..8029837f9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go index 1ef3e49af..36feb1530 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go index 7f640d91b..57079c8d9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go index cd60e9df6..d91fa87ec 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go index 5464ab59d..b336bbd39 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go index b6a2a4672..d007a2903 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go index c3e0d3734..540eb5f5c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go index e7e660bdd..532e6f51c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/generated_expansion.go index effefbd50..a5c694ffb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type HorizontalPodAutoscalerExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go index 4191c920f..9245e41a2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go index 753e5dc77..25446452f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/doc.go index de272bd12..1f70aedf8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v2beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go index e997033c4..6d3437a23 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go index 6b70822ad..549196c5e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/generated_expansion.go index eddac4a78..561fbb0e6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2beta1 type HorizontalPodAutoscalerExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go index 9ff497c10..1be9b80ca 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go index 5cf75f9c3..c092a3ca1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go index b6a2a4672..d007a2903 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go index 4e2d361e8..27d54c4c4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go index b51c8f5cd..4d9ba490f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/generated_expansion.go index 68d7741fa..04a37a49d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type JobExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go index d80205ddf..dc0c79997 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go index 88baefe3b..5ee39b5be 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go index 48b68988b..32ac52fac 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/doc.go index 1b50aa199..11ae7049d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go index fe95cd4c9..9de70f8fe 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go index 5bcb84e8a..756585d7d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/generated_expansion.go index 22939f58d..a093bbad4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type CronJobExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go index 1dd5b82c7..ff26a76d5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go index a8aaa9474..e5b135314 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go index 7f1ef91b1..ba60ac54b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v2alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go index c8f5a40de..52ad499cc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go index 9ea0d3459..f80e94cae 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go index 078027ef4..ed2c942b0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2alpha1 type CronJobExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go index 7226d92d7..7d69ce9f6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go index 769f71c67..ecca7aedc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/doc.go index 1b50aa199..11ae7049d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go index 550c5bba1..455ac56b5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go index 7b515240f..f3ea4c464 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go index 2b7e8ca0b..7fd68c803 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/BUILD index dd86cfecd..4c9f03aa4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/BUILD @@ -32,9 +32,11 @@ go_library( "service.go", "service_expansion.go", "serviceaccount.go", + "serviceaccount_expansion.go", ], importpath = "k8s.io/client-go/kubernetes/typed/core/v1", deps = [ + "//vendor/k8s.io/api/authentication/v1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", "//vendor/k8s.io/api/policy/v1beta1:go_default_library", diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go index 89c645a0e..1717e7c19 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go index 899e492ad..6e7a12e5d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go index e5b901e5c..1c86c47d4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/doc.go index b6a2a4672..d007a2903 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go index 3c463daaa..03b2a6919 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go index 857c885ad..b9570e689 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/BUILD index f62201d87..7403a4997 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/BUILD @@ -31,9 +31,11 @@ go_library( "fake_service.go", "fake_service_expansion.go", "fake_serviceaccount.go", + "fake_serviceaccount_expansion.go", ], importpath = "k8s.io/client-go/kubernetes/typed/core/v1/fake", deps = [ + "//vendor/k8s.io/api/authentication/v1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", "//vendor/k8s.io/api/policy/v1beta1:go_default_library", diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go index 1f358b7e3..42039aea9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go index 262a4c5e8..8de1cde17 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go index 0956b4c63..b30c02de1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go index d1fad00dd..7b54929f6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go index 60d6b45a5..5ba47f419 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go index dc58c335c..bd736980e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go index 8c03925a7..84743469a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go index 76d2ac1e5..c7e042fc8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go index 65b76e95e..1be38a89e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go index cb55df14b..ea189bb9c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go index ed35ed7cb..6f5faef99 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go index fa6233850..1dd272e78 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go index 2fe0a6cf3..047831a31 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go index 36a64903d..afdc8c88a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go index 58c6dc9c6..abf7db090 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go index c734ff5b5..7ce885ae8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go index 4c5f67b49..635b2c32b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount_expansion.go new file mode 100644 index 000000000..a0efbcc2f --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount_expansion.go @@ -0,0 +1,31 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fake + +import ( + authenticationv1 "k8s.io/api/authentication/v1" + core "k8s.io/client-go/testing" +) + +func (c *FakeServiceAccounts) CreateToken(name string, tr *authenticationv1.TokenRequest) (*authenticationv1.TokenRequest, error) { + obj, err := c.Fake.Invokes(core.NewCreateSubresourceAction(serviceaccountsResource, name, "token", c.ns, tr), &authenticationv1.TokenRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*authenticationv1.TokenRequest), err +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go index 5fe0585b4..430bd6c5a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type ComponentStatusExpansion interface{} @@ -35,5 +37,3 @@ type ReplicationControllerExpansion interface{} type ResourceQuotaExpansion interface{} type SecretExpansion interface{} - -type ServiceAccountExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go index 63ac612b4..b67997d70 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go index 0effd3e09..a298d7c02 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go index 202a91df3..b16f92f00 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go index 175f38821..f23b95f30 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go index a6159f125..f168a985a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go index 267cd7f60..423d81ad8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go index c286e2964..730b54330 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go index 196c8d05a..a0f36a1fa 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go index 311d0e8cc..011e72a91 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go index db4a70d95..931afb5db 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go index ff9560201..156bcc235 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go index 9e3b126b6..0a87feb5b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount_expansion.go new file mode 100644 index 000000000..eaf643f15 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount_expansion.go @@ -0,0 +1,41 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + authenticationv1 "k8s.io/api/authentication/v1" +) + +// The ServiceAccountExpansion interface allows manually adding extra methods +// to the ServiceAccountInterface. +type ServiceAccountExpansion interface { + CreateToken(name string, tr *authenticationv1.TokenRequest) (*authenticationv1.TokenRequest, error) +} + +// CreateToken creates a new token for a serviceaccount. +func (c *serviceAccounts) CreateToken(name string, tr *authenticationv1.TokenRequest) (*authenticationv1.TokenRequest, error) { + result := &authenticationv1.TokenRequest{} + err := c.client.Post(). + Namespace(c.ns). + Resource("serviceaccounts"). + SubResource("token"). + Name(name). + Body(tr). + Do(). + Into(result) + return result, err +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/doc.go index 1b50aa199..11ae7049d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go index 3473e99c4..e8737cf9e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go index 05cee7fb2..7225d90d8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go index 4b9ebd6e5..02fa70fbd 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go index 54b28b6ee..c6eb06623 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/generated_expansion.go index 82b2fb4a1..871411abb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type EventExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go index 95ca28afb..20cd58728 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go index 65f3820b9..91ada9e54 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go index 1b50aa199..11ae7049d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go index b4f8886ad..c359a58f2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go index 3a3220a05..083bed820 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go index d5abace97..1ce8fb34b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go index 8ec490c50..d8b6741e6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go index 5a6f93e0e..60efe17c8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go index 28bbbbb7f..c381e62f1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go index e8d22c6b4..20e8f76f6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go index 77f8c61a7..0bbcbd15f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeScales implements ScaleInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/generated_expansion.go index e693fe68c..eef05e765 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type DaemonSetExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go index 0bef3972a..26b21baa5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go index 071f78eac..19475a5c0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go index 8daa1cc01..b307ac70e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go index 733012ade..e654d9537 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/doc.go index b6a2a4672..d007a2903 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go index d9733a0bf..8bce64250 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go index 6fc226e18..fbab3ca16 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go index cdd70ae35..c6dd5c323 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type NetworkPolicyExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go index 1b9099eeb..ac8200f82 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go index 96487885c..b0a85c5c5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/BUILD index 2abeb549d..92606b3c4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/BUILD @@ -13,6 +13,7 @@ go_library( "eviction_expansion.go", "generated_expansion.go", "poddisruptionbudget.go", + "podsecuritypolicy.go", "policy_client.go", ], importpath = "k8s.io/client-go/kubernetes/typed/policy/v1beta1", diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go index 1b50aa199..11ae7049d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction.go index 9c4133e36..b0abf6563 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/BUILD index 5fc7afdc9..9b6941ce9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/BUILD @@ -12,6 +12,7 @@ go_library( "fake_eviction.go", "fake_eviction_expansion.go", "fake_poddisruptionbudget.go", + "fake_podsecuritypolicy.go", "fake_policy_client.go", ], importpath = "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake", diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go index a091d8de3..06aba37b4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeEvictions implements EvictionInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go index b00af7188..d85a67e4f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_podsecuritypolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_podsecuritypolicy.go new file mode 100644 index 000000000..068515a36 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_podsecuritypolicy.go @@ -0,0 +1,120 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1beta1 "k8s.io/api/policy/v1beta1" + 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" +) + +// FakePodSecurityPolicies implements PodSecurityPolicyInterface +type FakePodSecurityPolicies struct { + Fake *FakePolicyV1beta1 +} + +var podsecuritypoliciesResource = schema.GroupVersionResource{Group: "policy", Version: "v1beta1", Resource: "podsecuritypolicies"} + +var podsecuritypoliciesKind = schema.GroupVersionKind{Group: "policy", Version: "v1beta1", Kind: "PodSecurityPolicy"} + +// Get takes name of the podSecurityPolicy, and returns the corresponding podSecurityPolicy object, and an error if there is any. +func (c *FakePodSecurityPolicies) Get(name string, options v1.GetOptions) (result *v1beta1.PodSecurityPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(podsecuritypoliciesResource, name), &v1beta1.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodSecurityPolicy), err +} + +// List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors. +func (c *FakePodSecurityPolicies) List(opts v1.ListOptions) (result *v1beta1.PodSecurityPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(podsecuritypoliciesResource, podsecuritypoliciesKind, opts), &v1beta1.PodSecurityPolicyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.PodSecurityPolicyList{} + for _, item := range obj.(*v1beta1.PodSecurityPolicyList).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 podSecurityPolicies. +func (c *FakePodSecurityPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(podsecuritypoliciesResource, opts)) +} + +// Create takes the representation of a podSecurityPolicy and creates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. +func (c *FakePodSecurityPolicies) Create(podSecurityPolicy *v1beta1.PodSecurityPolicy) (result *v1beta1.PodSecurityPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(podsecuritypoliciesResource, podSecurityPolicy), &v1beta1.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodSecurityPolicy), err +} + +// Update takes the representation of a podSecurityPolicy and updates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. +func (c *FakePodSecurityPolicies) Update(podSecurityPolicy *v1beta1.PodSecurityPolicy) (result *v1beta1.PodSecurityPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(podsecuritypoliciesResource, podSecurityPolicy), &v1beta1.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodSecurityPolicy), err +} + +// Delete takes name of the podSecurityPolicy and deletes it. Returns an error if one occurs. +func (c *FakePodSecurityPolicies) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(podsecuritypoliciesResource, name), &v1beta1.PodSecurityPolicy{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePodSecurityPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(podsecuritypoliciesResource, listOptions) + + _, err := c.Fake.Invokes(action, &v1beta1.PodSecurityPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched podSecurityPolicy. +func (c *FakePodSecurityPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(podsecuritypoliciesResource, name, data, subresources...), &v1beta1.PodSecurityPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodSecurityPolicy), err +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go index c9039b519..3b7e5415e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( @@ -34,6 +36,10 @@ func (c *FakePolicyV1beta1) PodDisruptionBudgets(namespace string) v1beta1.PodDi return &FakePodDisruptionBudgets{c, namespace} } +func (c *FakePolicyV1beta1) PodSecurityPolicies() v1beta1.PodSecurityPolicyInterface { + return &FakePodSecurityPolicies{c} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakePolicyV1beta1) RESTClient() rest.Interface { diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go index 511adc6ef..d39f527be 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type PodDisruptionBudgetExpansion interface{} + +type PodSecurityPolicyExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go index 47b391d80..d154dfcf8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go new file mode 100644 index 000000000..de6760b14 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go @@ -0,0 +1,147 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/policy/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// PodSecurityPoliciesGetter has a method to return a PodSecurityPolicyInterface. +// A group's client should implement this interface. +type PodSecurityPoliciesGetter interface { + PodSecurityPolicies() PodSecurityPolicyInterface +} + +// PodSecurityPolicyInterface has methods to work with PodSecurityPolicy resources. +type PodSecurityPolicyInterface interface { + Create(*v1beta1.PodSecurityPolicy) (*v1beta1.PodSecurityPolicy, error) + Update(*v1beta1.PodSecurityPolicy) (*v1beta1.PodSecurityPolicy, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1beta1.PodSecurityPolicy, error) + List(opts v1.ListOptions) (*v1beta1.PodSecurityPolicyList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) + PodSecurityPolicyExpansion +} + +// podSecurityPolicies implements PodSecurityPolicyInterface +type podSecurityPolicies struct { + client rest.Interface +} + +// newPodSecurityPolicies returns a PodSecurityPolicies +func newPodSecurityPolicies(c *PolicyV1beta1Client) *podSecurityPolicies { + return &podSecurityPolicies{ + client: c.RESTClient(), + } +} + +// Get takes name of the podSecurityPolicy, and returns the corresponding podSecurityPolicy object, and an error if there is any. +func (c *podSecurityPolicies) Get(name string, options v1.GetOptions) (result *v1beta1.PodSecurityPolicy, err error) { + result = &v1beta1.PodSecurityPolicy{} + err = c.client.Get(). + Resource("podsecuritypolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors. +func (c *podSecurityPolicies) List(opts v1.ListOptions) (result *v1beta1.PodSecurityPolicyList, err error) { + result = &v1beta1.PodSecurityPolicyList{} + err = c.client.Get(). + Resource("podsecuritypolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested podSecurityPolicies. +func (c *podSecurityPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("podsecuritypolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a podSecurityPolicy and creates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. +func (c *podSecurityPolicies) Create(podSecurityPolicy *v1beta1.PodSecurityPolicy) (result *v1beta1.PodSecurityPolicy, err error) { + result = &v1beta1.PodSecurityPolicy{} + err = c.client.Post(). + Resource("podsecuritypolicies"). + Body(podSecurityPolicy). + Do(). + Into(result) + return +} + +// Update takes the representation of a podSecurityPolicy and updates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. +func (c *podSecurityPolicies) Update(podSecurityPolicy *v1beta1.PodSecurityPolicy) (result *v1beta1.PodSecurityPolicy, err error) { + result = &v1beta1.PodSecurityPolicy{} + err = c.client.Put(). + Resource("podsecuritypolicies"). + Name(podSecurityPolicy.Name). + Body(podSecurityPolicy). + Do(). + Into(result) + return +} + +// Delete takes name of the podSecurityPolicy and deletes it. Returns an error if one occurs. +func (c *podSecurityPolicies) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Resource("podsecuritypolicies"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *podSecurityPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Resource("podsecuritypolicies"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched podSecurityPolicy. +func (c *podSecurityPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { + result = &v1beta1.PodSecurityPolicy{} + err = c.client.Patch(pt). + Resource("podsecuritypolicies"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go index 40588ce97..f45cfdf37 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( @@ -27,6 +29,7 @@ type PolicyV1beta1Interface interface { RESTClient() rest.Interface EvictionsGetter PodDisruptionBudgetsGetter + PodSecurityPoliciesGetter } // PolicyV1beta1Client is used to interact with features provided by the policy group. @@ -42,6 +45,10 @@ func (c *PolicyV1beta1Client) PodDisruptionBudgets(namespace string) PodDisrupti return newPodDisruptionBudgets(c, namespace) } +func (c *PolicyV1beta1Client) PodSecurityPolicies() PodSecurityPolicyInterface { + return newPodSecurityPolicies(c) +} + // NewForConfig creates a new PolicyV1beta1Client for the given config. func NewForConfig(c *rest.Config) (*PolicyV1beta1Client, error) { config := *c diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go index e0ea45148..e1af3a99b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go index 11b2e2165..c49ac6dd2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/doc.go index b6a2a4672..d007a2903 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go index 645126f2c..b07323c50 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go index a9c0bb089..5e960c8ca 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go index cddaf6d50..5311f0618 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go index f64ede638..733760de2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go index e499cf95b..11a75f939 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/generated_expansion.go index aa3df0df2..0977cc00c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type ClusterRoleExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go index dd0a0cb0d..e5b7b561d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go index d83e722b7..678e284b7 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go index a42436580..7fd9e29fa 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go index e6c65ba99..901ef7f46 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go index a7156214a..c5c5360b9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go index cdaaf6207..69ca30111 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go index 1b6bfc311..1b3eec014 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go index 0aadc16b4..d54eb6f25 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go index 11470696d..12a96c5b6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go index 42de54874..8c365efcb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go index 958da4a92..4346589a8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/generated_expansion.go index f506fc346..aebf50655 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 type ClusterRoleExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go index 936008d4a..06b5f5cab 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go index 8591128af..8af1d7784 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go index 0616691bb..43888d066 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go index 6fdb04379..fd6effd46 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go index 1aedea6ea..469307000 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/doc.go index 1b50aa199..11ae7049d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go index 643988bb8..738ca1ea9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go index 461b54665..144bf70d3 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go index 929d03529..0856ee084 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go index 7038bcf0d..2e9d46b51 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go index a04a2f89a..bb363d874 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/generated_expansion.go index d7f80c004..538b09833 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type ClusterRoleExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go index 87932b58d..eecdd45a8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go index 95e252937..363b2c6cd 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go index e8e611a95..8d9f1f617 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/doc.go index cdaaf6207..69ca30111 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go index 8c82c186a..9946411e2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go index cd0d80d43..6e0a9659e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/generated_expansion.go index 3eb42e018..682f0f3bf 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 type PriorityClassExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go index 2b77c44eb..055a0e3f3 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go index 030e9db32..f030b319e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/doc.go index cdaaf6207..69ca30111 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go index 292458ee4..512b38f54 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_settings_client.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_settings_client.go index 6feb9b218..fb07a8248 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_settings_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_settings_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/generated_expansion.go index d599b2935..f0dbcc607 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 type PodPresetExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go index ce3868083..25ed8f543 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/settings_client.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/settings_client.go index 595b23f04..77fa64040 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/settings_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/settings_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/doc.go index b6a2a4672..d007a2903 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go index 97972f0f7..9ba1f5104 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go index 7e3378ad7..147ad8028 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go index 39df9fb87..08fedd7ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type StorageClassExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go index 1102653ae..36a189c46 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go index 4e7c5b71b..24133cd62 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/doc.go index cdaaf6207..69ca30111 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go index 1d06eba6b..5a9ed0964 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go index 5213d10be..c5db88531 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go index afa636a2f..e3fc3f399 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 type VolumeAttachmentExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go index 3e8c70bf1..63834e462 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go index 08bdfb259..7bf79a6c1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/BUILD index 08cb7f6d1..79d13929c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/BUILD @@ -12,6 +12,7 @@ go_library( "generated_expansion.go", "storage_client.go", "storageclass.go", + "volumeattachment.go", ], importpath = "k8s.io/client-go/kubernetes/typed/storage/v1beta1", deps = [ diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go index 1b50aa199..11ae7049d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/BUILD index a7457e7d2..743008884 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/BUILD @@ -11,6 +11,7 @@ go_library( "doc.go", "fake_storage_client.go", "fake_storageclass.go", + "fake_volumeattachment.go", ], importpath = "k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake", deps = [ diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go index c58fac35e..87a1873ed 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go index a178091d9..a81d90542 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( @@ -30,6 +32,10 @@ func (c *FakeStorageV1beta1) StorageClasses() v1beta1.StorageClassInterface { return &FakeStorageClasses{c} } +func (c *FakeStorageV1beta1) VolumeAttachments() v1beta1.VolumeAttachmentInterface { + return &FakeVolumeAttachments{c} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeStorageV1beta1) RESTClient() rest.Interface { diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go index 9a830881a..ce1e72d53 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go new file mode 100644 index 000000000..8bbf197dd --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go @@ -0,0 +1,131 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1beta1 "k8s.io/api/storage/v1beta1" + 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" +) + +// FakeVolumeAttachments implements VolumeAttachmentInterface +type FakeVolumeAttachments struct { + Fake *FakeStorageV1beta1 +} + +var volumeattachmentsResource = schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1beta1", Resource: "volumeattachments"} + +var volumeattachmentsKind = schema.GroupVersionKind{Group: "storage.k8s.io", Version: "v1beta1", Kind: "VolumeAttachment"} + +// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. +func (c *FakeVolumeAttachments) Get(name string, options v1.GetOptions) (result *v1beta1.VolumeAttachment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(volumeattachmentsResource, name), &v1beta1.VolumeAttachment{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeAttachment), err +} + +// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. +func (c *FakeVolumeAttachments) List(opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(volumeattachmentsResource, volumeattachmentsKind, opts), &v1beta1.VolumeAttachmentList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeAttachmentList{} + for _, item := range obj.(*v1beta1.VolumeAttachmentList).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 volumeAttachments. +func (c *FakeVolumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(volumeattachmentsResource, opts)) +} + +// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. +func (c *FakeVolumeAttachments) Create(volumeAttachment *v1beta1.VolumeAttachment) (result *v1beta1.VolumeAttachment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(volumeattachmentsResource, volumeAttachment), &v1beta1.VolumeAttachment{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeAttachment), err +} + +// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. +func (c *FakeVolumeAttachments) Update(volumeAttachment *v1beta1.VolumeAttachment) (result *v1beta1.VolumeAttachment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(volumeattachmentsResource, volumeAttachment), &v1beta1.VolumeAttachment{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeAttachment), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVolumeAttachments) UpdateStatus(volumeAttachment *v1beta1.VolumeAttachment) (*v1beta1.VolumeAttachment, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(volumeattachmentsResource, "status", volumeAttachment), &v1beta1.VolumeAttachment{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeAttachment), err +} + +// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. +func (c *FakeVolumeAttachments) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(volumeattachmentsResource, name), &v1beta1.VolumeAttachment{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeAttachments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(volumeattachmentsResource, listOptions) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeAttachmentList{}) + return err +} + +// Patch applies the patch and returns the patched volumeAttachment. +func (c *FakeVolumeAttachments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VolumeAttachment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, name, data, subresources...), &v1beta1.VolumeAttachment{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeAttachment), err +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/generated_expansion.go index 6f3f0c55e..5bb931f05 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type StorageClassExpansion interface{} + +type VolumeAttachmentExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go index 4db3d137e..4ca05be6f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( @@ -26,6 +28,7 @@ import ( type StorageV1beta1Interface interface { RESTClient() rest.Interface StorageClassesGetter + VolumeAttachmentsGetter } // StorageV1beta1Client is used to interact with features provided by the storage.k8s.io group. @@ -37,6 +40,10 @@ func (c *StorageV1beta1Client) StorageClasses() StorageClassInterface { return newStorageClasses(c) } +func (c *StorageV1beta1Client) VolumeAttachments() VolumeAttachmentInterface { + return newVolumeAttachments(c) +} + // NewForConfig creates a new StorageV1beta1Client for the given config. func NewForConfig(c *rest.Config) (*StorageV1beta1Client, error) { config := *c diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go index 7c900b3e3..63047a7fb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go new file mode 100644 index 000000000..fab0801b0 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go @@ -0,0 +1,163 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/storage/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. +// A group's client should implement this interface. +type VolumeAttachmentsGetter interface { + VolumeAttachments() VolumeAttachmentInterface +} + +// VolumeAttachmentInterface has methods to work with VolumeAttachment resources. +type VolumeAttachmentInterface interface { + Create(*v1beta1.VolumeAttachment) (*v1beta1.VolumeAttachment, error) + Update(*v1beta1.VolumeAttachment) (*v1beta1.VolumeAttachment, error) + UpdateStatus(*v1beta1.VolumeAttachment) (*v1beta1.VolumeAttachment, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1beta1.VolumeAttachment, error) + List(opts v1.ListOptions) (*v1beta1.VolumeAttachmentList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VolumeAttachment, err error) + VolumeAttachmentExpansion +} + +// volumeAttachments implements VolumeAttachmentInterface +type volumeAttachments struct { + client rest.Interface +} + +// newVolumeAttachments returns a VolumeAttachments +func newVolumeAttachments(c *StorageV1beta1Client) *volumeAttachments { + return &volumeAttachments{ + client: c.RESTClient(), + } +} + +// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. +func (c *volumeAttachments) Get(name string, options v1.GetOptions) (result *v1beta1.VolumeAttachment, err error) { + result = &v1beta1.VolumeAttachment{} + err = c.client.Get(). + Resource("volumeattachments"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. +func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { + result = &v1beta1.VolumeAttachmentList{} + err = c.client.Get(). + Resource("volumeattachments"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested volumeAttachments. +func (c *volumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("volumeattachments"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. +func (c *volumeAttachments) Create(volumeAttachment *v1beta1.VolumeAttachment) (result *v1beta1.VolumeAttachment, err error) { + result = &v1beta1.VolumeAttachment{} + err = c.client.Post(). + Resource("volumeattachments"). + Body(volumeAttachment). + Do(). + Into(result) + return +} + +// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. +func (c *volumeAttachments) Update(volumeAttachment *v1beta1.VolumeAttachment) (result *v1beta1.VolumeAttachment, err error) { + result = &v1beta1.VolumeAttachment{} + err = c.client.Put(). + Resource("volumeattachments"). + Name(volumeAttachment.Name). + Body(volumeAttachment). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *volumeAttachments) UpdateStatus(volumeAttachment *v1beta1.VolumeAttachment) (result *v1beta1.VolumeAttachment, err error) { + result = &v1beta1.VolumeAttachment{} + err = c.client.Put(). + Resource("volumeattachments"). + Name(volumeAttachment.Name). + SubResource("status"). + Body(volumeAttachment). + Do(). + Into(result) + return +} + +// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. +func (c *volumeAttachments) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Resource("volumeattachments"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *volumeAttachments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Resource("volumeattachments"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched volumeAttachment. +func (c *volumeAttachments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VolumeAttachment, err error) { + result = &v1beta1.VolumeAttachment{} + err = c.client.Patch(pt). + Resource("volumeattachments"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/expansion_generated.go index fb3b00987..868ee66cf 100644 --- a/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/initializerconfiguration.go b/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/initializerconfiguration.go index 60b004ef9..a2cc796dc 100644 --- a/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/initializerconfiguration.go +++ b/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/initializerconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/expansion_generated.go index c9bf0fa5d..93dddb5ff 100644 --- a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 753dd1856..015587e80 100644 --- a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 6cb6067a1..243589b2f 100644 --- a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/controllerrevision.go b/vendor/k8s.io/client-go/listers/apps/v1/controllerrevision.go index c05d14c25..19f567e82 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/controllerrevision.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/daemonset.go b/vendor/k8s.io/client-go/listers/apps/v1/daemonset.go index 307f8bc7c..7fcd1e063 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/daemonset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/deployment.go b/vendor/k8s.io/client-go/listers/apps/v1/deployment.go index 36af90094..2d2ecf0cf 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/deployment.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go index 48917c2c0..1e8bf6fec 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/replicaset.go b/vendor/k8s.io/client-go/listers/apps/v1/replicaset.go index 7e316d6b4..99fb92ff4 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/replicaset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/statefulset.go b/vendor/k8s.io/client-go/listers/apps/v1/statefulset.go index fe584038e..6ad54b71f 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/statefulset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta1/controllerrevision.go b/vendor/k8s.io/client-go/listers/apps/v1beta1/controllerrevision.go index f3c85bfa7..95aeb0236 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta1/controllerrevision.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta1/deployment.go b/vendor/k8s.io/client-go/listers/apps/v1beta1/deployment.go index f59f3a962..4f6e883ba 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/apps/v1beta1/expansion_generated.go index 441ceecdd..4f3813a94 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta1/scale.go b/vendor/k8s.io/client-go/listers/apps/v1beta1/scale.go index ec9a419a0..85bf3a6f4 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta1/scale.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta1/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta1/statefulset.go b/vendor/k8s.io/client-go/listers/apps/v1beta1/statefulset.go index f10ef7318..a967e8492 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta1/statefulset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/controllerrevision.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/controllerrevision.go index f9f1ef06a..3d5274dc3 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/controllerrevision.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/daemonset.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/daemonset.go index cbdb13ef5..0ea4dc83f 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/daemonset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/deployment.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/deployment.go index 0778a9fdd..8855bb20c 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/deployment.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go index 6db63d4b0..48cbedb8f 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/replicaset.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/replicaset.go index f76e2eeb5..0fd8dbaa4 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/replicaset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/scale.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/scale.go index 11cb3e195..f53e42ce8 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/scale.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/statefulset.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/statefulset.go index 13ef28f85..2e095ace4 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/statefulset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/authentication/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/authentication/v1/expansion_generated.go index 3dcc80289..77b284d8d 100644 --- a/vendor/k8s.io/client-go/listers/authentication/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/authentication/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authentication/v1/tokenreview.go b/vendor/k8s.io/client-go/listers/authentication/v1/tokenreview.go index cfae0476f..5f2c6c3e6 100644 --- a/vendor/k8s.io/client-go/listers/authentication/v1/tokenreview.go +++ b/vendor/k8s.io/client-go/listers/authentication/v1/tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authentication/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/authentication/v1beta1/expansion_generated.go index 2ce7f7f92..3b2b18860 100644 --- a/vendor/k8s.io/client-go/listers/authentication/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/authentication/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authentication/v1beta1/tokenreview.go b/vendor/k8s.io/client-go/listers/authentication/v1beta1/tokenreview.go index 035ad62da..9db014e9b 100644 --- a/vendor/k8s.io/client-go/listers/authentication/v1beta1/tokenreview.go +++ b/vendor/k8s.io/client-go/listers/authentication/v1beta1/tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/authorization/v1/expansion_generated.go index 0c91dd0c1..9a0f2e212 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1/localsubjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1/localsubjectaccessreview.go index d0729f112..99055b348 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1/localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1/localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectaccessreview.go index 64ff1744b..627e4dd74 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectrulesreview.go b/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectrulesreview.go index 63ad0f1ff..6b2f06352 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1/subjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1/subjectaccessreview.go index f389e07b1..ca7b47b46 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1/subjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1/subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/authorization/v1beta1/expansion_generated.go index 771d77400..d140d6563 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1beta1/localsubjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1beta1/localsubjectaccessreview.go index b2478381b..534e39aa9 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1beta1/localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1beta1/localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectaccessreview.go index 4936b9b6c..c2e82dbb9 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectrulesreview.go b/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectrulesreview.go index 8eb7a21b5..5ce83f217 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1beta1/subjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1beta1/subjectaccessreview.go index 4b155de15..b1853fc3c 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1beta1/subjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1beta1/subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/autoscaling/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/autoscaling/v1/expansion_generated.go index f7b00603f..a20ab75da 100644 --- a/vendor/k8s.io/client-go/listers/autoscaling/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/autoscaling/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/autoscaling/v1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/listers/autoscaling/v1/horizontalpodautoscaler.go index 48012203e..27ade7ddb 100644 --- a/vendor/k8s.io/client-go/listers/autoscaling/v1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/listers/autoscaling/v1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/expansion_generated.go index 9e84ef13e..c026b65d5 100644 --- a/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v2beta1 diff --git a/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/horizontalpodautoscaler.go index c8fbdecd7..4c29df910 100644 --- a/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v2beta1 diff --git a/vendor/k8s.io/client-go/listers/batch/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/batch/v1/expansion_generated.go index 38b7e2720..63091e84a 100644 --- a/vendor/k8s.io/client-go/listers/batch/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/batch/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/batch/v1/job.go b/vendor/k8s.io/client-go/listers/batch/v1/job.go index 89280d9fa..e29e0271c 100644 --- a/vendor/k8s.io/client-go/listers/batch/v1/job.go +++ b/vendor/k8s.io/client-go/listers/batch/v1/job.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/batch/v1beta1/cronjob.go b/vendor/k8s.io/client-go/listers/batch/v1beta1/cronjob.go index a8fa51ecf..93f197986 100644 --- a/vendor/k8s.io/client-go/listers/batch/v1beta1/cronjob.go +++ b/vendor/k8s.io/client-go/listers/batch/v1beta1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/batch/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/batch/v1beta1/expansion_generated.go index 3d84d249a..1d6cc198a 100644 --- a/vendor/k8s.io/client-go/listers/batch/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/batch/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/batch/v2alpha1/cronjob.go b/vendor/k8s.io/client-go/listers/batch/v2alpha1/cronjob.go index 51f5eef55..6af5f1457 100644 --- a/vendor/k8s.io/client-go/listers/batch/v2alpha1/cronjob.go +++ b/vendor/k8s.io/client-go/listers/batch/v2alpha1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v2alpha1 diff --git a/vendor/k8s.io/client-go/listers/batch/v2alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/batch/v2alpha1/expansion_generated.go index 38ac70cdf..11f6c3471 100644 --- a/vendor/k8s.io/client-go/listers/batch/v2alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/batch/v2alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v2alpha1 diff --git a/vendor/k8s.io/client-go/listers/certificates/v1beta1/certificatesigningrequest.go b/vendor/k8s.io/client-go/listers/certificates/v1beta1/certificatesigningrequest.go index 425dc6b4d..a122c3660 100644 --- a/vendor/k8s.io/client-go/listers/certificates/v1beta1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/listers/certificates/v1beta1/certificatesigningrequest.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go index c240be44f..6815de7ad 100644 --- a/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/componentstatus.go b/vendor/k8s.io/client-go/listers/core/v1/componentstatus.go index 6ba67d0bd..82fbedac2 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/componentstatus.go +++ b/vendor/k8s.io/client-go/listers/core/v1/componentstatus.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/configmap.go b/vendor/k8s.io/client-go/listers/core/v1/configmap.go index e976928d9..fc927ab2c 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/configmap.go +++ b/vendor/k8s.io/client-go/listers/core/v1/configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/endpoints.go b/vendor/k8s.io/client-go/listers/core/v1/endpoints.go index 6f5a1133c..7799562d7 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/endpoints.go +++ b/vendor/k8s.io/client-go/listers/core/v1/endpoints.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/event.go b/vendor/k8s.io/client-go/listers/core/v1/event.go index b087cd8bd..738e333db 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/event.go +++ b/vendor/k8s.io/client-go/listers/core/v1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go index a96db8dc9..b8b985ce0 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/limitrange.go b/vendor/k8s.io/client-go/listers/core/v1/limitrange.go index f19943751..4ee02634d 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/limitrange.go +++ b/vendor/k8s.io/client-go/listers/core/v1/limitrange.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/namespace.go b/vendor/k8s.io/client-go/listers/core/v1/namespace.go index 21be6878a..b819d741e 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/namespace.go +++ b/vendor/k8s.io/client-go/listers/core/v1/namespace.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/node.go b/vendor/k8s.io/client-go/listers/core/v1/node.go index d43a682c9..21a8a0675 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/node.go +++ b/vendor/k8s.io/client-go/listers/core/v1/node.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/persistentvolume.go b/vendor/k8s.io/client-go/listers/core/v1/persistentvolume.go index 593ba14ed..a88dbd0c0 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/persistentvolume.go +++ b/vendor/k8s.io/client-go/listers/core/v1/persistentvolume.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/persistentvolumeclaim.go b/vendor/k8s.io/client-go/listers/core/v1/persistentvolumeclaim.go index 72ddac93e..8c3d5f566 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/listers/core/v1/persistentvolumeclaim.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/pod.go b/vendor/k8s.io/client-go/listers/core/v1/pod.go index 6cf4a8424..d3ce8ab32 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/pod.go +++ b/vendor/k8s.io/client-go/listers/core/v1/pod.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/podtemplate.go b/vendor/k8s.io/client-go/listers/core/v1/podtemplate.go index d825c7475..91c2a4661 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/podtemplate.go +++ b/vendor/k8s.io/client-go/listers/core/v1/podtemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/replicationcontroller.go b/vendor/k8s.io/client-go/listers/core/v1/replicationcontroller.go index 6670a9d92..ee00a465c 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/replicationcontroller.go +++ b/vendor/k8s.io/client-go/listers/core/v1/replicationcontroller.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/resourcequota.go b/vendor/k8s.io/client-go/listers/core/v1/resourcequota.go index 713a41511..fd3119d45 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/resourcequota.go +++ b/vendor/k8s.io/client-go/listers/core/v1/resourcequota.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/secret.go b/vendor/k8s.io/client-go/listers/core/v1/secret.go index 26ef13d9e..f8c2b11e1 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/secret.go +++ b/vendor/k8s.io/client-go/listers/core/v1/secret.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/service.go b/vendor/k8s.io/client-go/listers/core/v1/service.go index 895a69223..d872540b3 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/service.go +++ b/vendor/k8s.io/client-go/listers/core/v1/service.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/serviceaccount.go b/vendor/k8s.io/client-go/listers/core/v1/serviceaccount.go index 2245d5d43..9973af66b 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/serviceaccount.go +++ b/vendor/k8s.io/client-go/listers/core/v1/serviceaccount.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/events/v1beta1/event.go b/vendor/k8s.io/client-go/listers/events/v1beta1/event.go index bca3c452a..c52afd091 100644 --- a/vendor/k8s.io/client-go/listers/events/v1beta1/event.go +++ b/vendor/k8s.io/client-go/listers/events/v1beta1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/events/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/events/v1beta1/expansion_generated.go index 7e8fb62b1..9971dd5dd 100644 --- a/vendor/k8s.io/client-go/listers/events/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/events/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/BUILD b/vendor/k8s.io/client-go/listers/extensions/v1beta1/BUILD index 9bab4a64f..49b895c3e 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/BUILD @@ -35,8 +35,7 @@ go_library( go_test( name = "go_default_test", srcs = ["daemonset_expansion_test.go"], - importpath = "k8s.io/client-go/listers/extensions/v1beta1", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/daemonset.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/daemonset.go index 4672a5cb9..b63c32b97 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/daemonset.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment.go index 4c17085dd..ea5168fef 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go index 060c7a35a..87c3cbe3b 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/ingress.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/ingress.go index 5615dfccc..1f9e34d17 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/ingress.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/podsecuritypolicy.go index 3189ff7c9..fadd212f1 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/podsecuritypolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/replicaset.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/replicaset.go index 44de996e4..930db4480 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/replicaset.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/scale.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/scale.go index a027af828..67d45e328 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/scale.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/expansion_generated.go index 6f635d704..1529fcf3f 100644 --- a/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/imagereview.go b/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/imagereview.go index 8ffd9d05f..cdb046cf9 100644 --- a/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/imagereview.go +++ b/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/imagereview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go index 91fe5e772..458a1d249 100644 --- a/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/networking/v1/networkpolicy.go b/vendor/k8s.io/client-go/listers/networking/v1/networkpolicy.go index 59e17eecb..b70adedf1 100644 --- a/vendor/k8s.io/client-go/listers/networking/v1/networkpolicy.go +++ b/vendor/k8s.io/client-go/listers/networking/v1/networkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/policy/v1beta1/BUILD b/vendor/k8s.io/client-go/listers/policy/v1beta1/BUILD index c678177ae..2c5f33df4 100644 --- a/vendor/k8s.io/client-go/listers/policy/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/listers/policy/v1beta1/BUILD @@ -12,6 +12,7 @@ go_library( "expansion_generated.go", "poddisruptionbudget.go", "poddisruptionbudget_expansion.go", + "podsecuritypolicy.go", ], importpath = "k8s.io/client-go/listers/policy/v1beta1", deps = [ diff --git a/vendor/k8s.io/client-go/listers/policy/v1beta1/eviction.go b/vendor/k8s.io/client-go/listers/policy/v1beta1/eviction.go index 742775f64..29c454e2a 100644 --- a/vendor/k8s.io/client-go/listers/policy/v1beta1/eviction.go +++ b/vendor/k8s.io/client-go/listers/policy/v1beta1/eviction.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go index 4785fbc06..3e63c2c9c 100644 --- a/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 @@ -25,3 +25,7 @@ type EvictionListerExpansion interface{} // EvictionNamespaceListerExpansion allows custom methods to be added to // EvictionNamespaceLister. type EvictionNamespaceListerExpansion interface{} + +// PodSecurityPolicyListerExpansion allows custom methods to be added to +// PodSecurityPolicyLister. +type PodSecurityPolicyListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget.go b/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget.go index 6512f29f1..7304f36b2 100644 --- a/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/policy/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/listers/policy/v1beta1/podsecuritypolicy.go new file mode 100644 index 000000000..d80f5c56e --- /dev/null +++ b/vendor/k8s.io/client-go/listers/policy/v1beta1/podsecuritypolicy.go @@ -0,0 +1,65 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/policy/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PodSecurityPolicyLister helps list PodSecurityPolicies. +type PodSecurityPolicyLister interface { + // List lists all PodSecurityPolicies in the indexer. + List(selector labels.Selector) (ret []*v1beta1.PodSecurityPolicy, err error) + // Get retrieves the PodSecurityPolicy from the index for a given name. + Get(name string) (*v1beta1.PodSecurityPolicy, error) + PodSecurityPolicyListerExpansion +} + +// podSecurityPolicyLister implements the PodSecurityPolicyLister interface. +type podSecurityPolicyLister struct { + indexer cache.Indexer +} + +// NewPodSecurityPolicyLister returns a new PodSecurityPolicyLister. +func NewPodSecurityPolicyLister(indexer cache.Indexer) PodSecurityPolicyLister { + return &podSecurityPolicyLister{indexer: indexer} +} + +// List lists all PodSecurityPolicies in the indexer. +func (s *podSecurityPolicyLister) List(selector labels.Selector) (ret []*v1beta1.PodSecurityPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.PodSecurityPolicy)) + }) + return ret, err +} + +// Get retrieves the PodSecurityPolicy from the index for a given name. +func (s *podSecurityPolicyLister) Get(name string) (*v1beta1.PodSecurityPolicy, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("podsecuritypolicy"), name) + } + return obj.(*v1beta1.PodSecurityPolicy), nil +} diff --git a/vendor/k8s.io/client-go/listers/rbac/v1/clusterrole.go b/vendor/k8s.io/client-go/listers/rbac/v1/clusterrole.go index 5dc9a225e..eb1d87006 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1/clusterrole.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1/clusterrolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1/clusterrolebinding.go index bb3186a06..a22d6025e 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/rbac/v1/expansion_generated.go index 4d9872d3e..967ebdd84 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1/role.go b/vendor/k8s.io/client-go/listers/rbac/v1/role.go index 8d7625dbe..b4649c2c3 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1/role.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1/rolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1/rolebinding.go index b8209d851..8dc0968bb 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1/rolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrole.go b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrole.go index 9e20a6d16..302ca29d8 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrole.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrolebinding.go index 155666aba..91ba54c23 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/expansion_generated.go index 0ab4fb991..737ba6637 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/role.go b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/role.go index 72ab79c94..cf874f56c 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/role.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/rolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/rolebinding.go index 7f9cfd458..5e76ab42f 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/rolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrole.go b/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrole.go index 65ec3eb97..be7f2df6a 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrole.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrolebinding.go index 146f2d7f2..09d65be76 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/rbac/v1beta1/expansion_generated.go index b6eeae833..8da573661 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1beta1/role.go b/vendor/k8s.io/client-go/listers/rbac/v1beta1/role.go index b795e98b0..e12039dbf 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1beta1/role.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1beta1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1beta1/rolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1beta1/rolebinding.go index d27ea2eb5..10cb23cd3 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1beta1/rolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1beta1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/expansion_generated.go index 8a644c804..00b662888 100644 --- a/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/priorityclass.go b/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/priorityclass.go index 9ed04fd2a..fb7f6007c 100644 --- a/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/priorityclass.go +++ b/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/priorityclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/settings/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/settings/v1alpha1/expansion_generated.go index 7a5ce38e9..72558897b 100644 --- a/vendor/k8s.io/client-go/listers/settings/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/settings/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/settings/v1alpha1/podpreset.go b/vendor/k8s.io/client-go/listers/settings/v1alpha1/podpreset.go index 18f622493..d30036962 100644 --- a/vendor/k8s.io/client-go/listers/settings/v1alpha1/podpreset.go +++ b/vendor/k8s.io/client-go/listers/settings/v1alpha1/podpreset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go index 2353b59d3..49e290f4c 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/storage/v1/storageclass.go b/vendor/k8s.io/client-go/listers/storage/v1/storageclass.go index 7c37321fd..5b20f6ab5 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1/storageclass.go +++ b/vendor/k8s.io/client-go/listers/storage/v1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go index 63abe94ab..2fc6add1d 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattachment.go b/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattachment.go index 02004629a..f8d1bdb2d 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattachment.go +++ b/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/storage/v1beta1/BUILD b/vendor/k8s.io/client-go/listers/storage/v1beta1/BUILD index d4b82cbc8..49d992e47 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/listers/storage/v1beta1/BUILD @@ -10,6 +10,7 @@ go_library( srcs = [ "expansion_generated.go", "storageclass.go", + "volumeattachment.go", ], importpath = "k8s.io/client-go/listers/storage/v1beta1", deps = [ diff --git a/vendor/k8s.io/client-go/listers/storage/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/storage/v1beta1/expansion_generated.go index 84e0f9c44..8c2dc9055 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/storage/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,10 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 // StorageClassListerExpansion allows custom methods to be added to // StorageClassLister. type StorageClassListerExpansion interface{} + +// VolumeAttachmentListerExpansion allows custom methods to be added to +// VolumeAttachmentLister. +type VolumeAttachmentListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/storage/v1beta1/storageclass.go b/vendor/k8s.io/client-go/listers/storage/v1beta1/storageclass.go index 9253319be..45afe0e77 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1beta1/storageclass.go +++ b/vendor/k8s.io/client-go/listers/storage/v1beta1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/storage/v1beta1/volumeattachment.go b/vendor/k8s.io/client-go/listers/storage/v1beta1/volumeattachment.go new file mode 100644 index 000000000..c9cc3984e --- /dev/null +++ b/vendor/k8s.io/client-go/listers/storage/v1beta1/volumeattachment.go @@ -0,0 +1,65 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/storage/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// VolumeAttachmentLister helps list VolumeAttachments. +type VolumeAttachmentLister interface { + // List lists all VolumeAttachments in the indexer. + List(selector labels.Selector) (ret []*v1beta1.VolumeAttachment, err error) + // Get retrieves the VolumeAttachment from the index for a given name. + Get(name string) (*v1beta1.VolumeAttachment, error) + VolumeAttachmentListerExpansion +} + +// volumeAttachmentLister implements the VolumeAttachmentLister interface. +type volumeAttachmentLister struct { + indexer cache.Indexer +} + +// NewVolumeAttachmentLister returns a new VolumeAttachmentLister. +func NewVolumeAttachmentLister(indexer cache.Indexer) VolumeAttachmentLister { + return &volumeAttachmentLister{indexer: indexer} +} + +// List lists all VolumeAttachments in the indexer. +func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*v1beta1.VolumeAttachment, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.VolumeAttachment)) + }) + return ret, err +} + +// Get retrieves the VolumeAttachment from the index for a given name. +func (s *volumeAttachmentLister) Get(name string) (*v1beta1.VolumeAttachment, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("volumeattachment"), name) + } + return obj.(*v1beta1.VolumeAttachment), nil +} diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/BUILD b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/BUILD new file mode 100644 index 000000000..64cdd678d --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/BUILD @@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "register.go", + "types.go", + "zz_generated.deepcopy.go", + ], + importpath = "k8s.io/client-go/pkg/apis/clientauthentication", + visibility = ["//visibility:public"], + deps = [ + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [ + ":package-srcs", + "//staging/src/k8s.io/client-go/pkg/apis/clientauthentication/install:all-srcs", + "//staging/src/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1:all-srcs", + ], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/apiserver/pkg/apis/example/v1/types_swagger_doc_generated.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/doc.go similarity index 72% rename from vendor/k8s.io/apiserver/pkg/apis/example/v1/types_swagger_doc_generated.go rename to vendor/k8s.io/client-go/pkg/apis/clientauthentication/doc.go index c7be42d5a..d06482d55 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1 +// +k8s:deepcopy-gen=package +// +groupName=client.authentication.k8s.io +package clientauthentication // import "k8s.io/client-go/pkg/apis/clientauthentication" diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/install/BUILD b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/install/BUILD new file mode 100644 index 000000000..de371ab22 --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/install/BUILD @@ -0,0 +1,32 @@ +package(default_visibility = ["//visibility:public"]) + +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) + +go_library( + name = "go_default_library", + srcs = ["install.go"], + importpath = "k8s.io/client-go/pkg/apis/clientauthentication/install", + deps = [ + "//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/client-go/pkg/apis/clientauthentication:go_default_library", + "//vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], +) diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/install/install.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/install/install.go new file mode 100644 index 000000000..40093e97f --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/install/install.go @@ -0,0 +1,43 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package install installs the experimental API group, making it available as +// an option to all of the API encoding/decoding machinery. +package install + +import ( + "k8s.io/apimachinery/pkg/apimachinery/announced" + "k8s.io/apimachinery/pkg/apimachinery/registered" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/pkg/apis/clientauthentication" + "k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1" +) + +// Install registers the API group and adds types to a scheme +func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) { + if err := announced.NewGroupMetaFactory( + &announced.GroupMetaFactoryArgs{ + GroupName: clientauthentication.GroupName, + VersionPreferenceOrder: []string{v1alpha1.SchemeGroupVersion.Version}, + AddInternalObjectsToScheme: clientauthentication.AddToScheme, + }, + announced.VersionToSchemeFunc{ + v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme, + }, + ).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil { + panic(err) + } +} diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/register.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/register.go new file mode 100644 index 000000000..e4fbc3ea9 --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/register.go @@ -0,0 +1,50 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package clientauthentication + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name use in this package +const GroupName = "client.authentication.k8s.io" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} + +// Kind takes an unqualified kind and returns a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &ExecCredential{}, + ) + return nil +} diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/types.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/types.go new file mode 100644 index 000000000..5c05825f6 --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/types.go @@ -0,0 +1,70 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package clientauthentication + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ExecCredentials is used by exec-based plugins to communicate credentials to +// HTTP transports. +type ExecCredential struct { + metav1.TypeMeta + + // Spec holds information passed to the plugin by the transport. This contains + // request and runtime specific information, such as if the session is interactive. + Spec ExecCredentialSpec + + // Status is filled in by the plugin and holds the credentials that the transport + // should use to contact the API. + // +optional + Status *ExecCredentialStatus +} + +// ExecCredenitalSpec holds request and runtime specific information provided by +// the transport. +type ExecCredentialSpec struct { + // Response is populated when the transport encounters HTTP status codes, such as 401, + // suggesting previous credentials were invalid. + // +optional + Response *Response + + // Interactive is true when the transport detects the command is being called from an + // interactive prompt. + // +optional + Interactive bool +} + +// ExecCredentialStatus holds credentials for the transport to use. +type ExecCredentialStatus struct { + // ExpirationTimestamp indicates a time when the provided credentials expire. + // +optional + ExpirationTimestamp *metav1.Time + // Token is a bearer token used by the client for request authentication. + Token string +} + +// Response defines metadata about a failed request, including HTTP status code and +// response headers. +type Response struct { + // Headers holds HTTP headers returned by the server. + Header map[string][]string + // Code is the HTTP status code returned by the server. + Code int32 +} diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/BUILD b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/BUILD new file mode 100644 index 000000000..1a3bc15f6 --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/BUILD @@ -0,0 +1,39 @@ +package(default_visibility = ["//visibility:public"]) + +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "register.go", + "types.go", + "zz_generated.conversion.go", + "zz_generated.deepcopy.go", + "zz_generated.defaults.go", + ], + importpath = "k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1", + deps = [ + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//vendor/k8s.io/client-go/pkg/apis/clientauthentication:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], +) diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/doc.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/doc.go new file mode 100644 index 000000000..016adb28a --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/doc.go @@ -0,0 +1,23 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +k8s:conversion-gen=k8s.io/client-go/pkg/apis/clientauthentication +// +k8s:openapi-gen=true +// +k8s:defaulter-gen=TypeMeta + +// +groupName=client.authentication.k8s.io +package v1alpha1 // import "k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1" diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/register.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/register.go new file mode 100644 index 000000000..2acd13dea --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/register.go @@ -0,0 +1,55 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name use in this package +const GroupName = "client.authentication.k8s.io" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &ExecCredential{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/types.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/types.go new file mode 100644 index 000000000..8920d3187 --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/types.go @@ -0,0 +1,70 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ExecCredentials is used by exec-based plugins to communicate credentials to +// HTTP transports. +type ExecCredential struct { + metav1.TypeMeta `json:",inline"` + + // Spec holds information passed to the plugin by the transport. This contains + // request and runtime specific information, such as if the session is interactive. + Spec ExecCredentialSpec `json:"spec,omitempty"` + + // Status is filled in by the plugin and holds the credentials that the transport + // should use to contact the API. + // +optional + Status *ExecCredentialStatus `json:"status,omitempty"` +} + +// ExecCredenitalSpec holds request and runtime specific information provided by +// the transport. +type ExecCredentialSpec struct { + // Response is populated when the transport encounters HTTP status codes, such as 401, + // suggesting previous credentials were invalid. + // +optional + Response *Response `json:"response,omitempty"` + + // Interactive is true when the transport detects the command is being called from an + // interactive prompt. + // +optional + Interactive bool `json:"interactive,omitempty"` +} + +// ExecCredentialStatus holds credentials for the transport to use. +type ExecCredentialStatus struct { + // ExpirationTimestamp indicates a time when the provided credentials expire. + // +optional + ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"` + // Token is a bearer token used by the client for request authentication. + Token string `json:"token,omitempty"` +} + +// Response defines metadata about a failed request, including HTTP status code and +// response headers. +type Response struct { + // Header holds HTTP headers returned by the server. + Header map[string][]string `json:"header,omitempty"` + // Code is the HTTP status code returned by the server. + Code int32 `json:"code,omitempty"` +} diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/zz_generated.conversion.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/zz_generated.conversion.go new file mode 100644 index 000000000..bf28baef2 --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/zz_generated.conversion.go @@ -0,0 +1,141 @@ +// +build !ignore_autogenerated + +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + unsafe "unsafe" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + clientauthentication "k8s.io/client-go/pkg/apis/clientauthentication" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(scheme *runtime.Scheme) error { + return scheme.AddGeneratedConversionFuncs( + Convert_v1alpha1_ExecCredential_To_clientauthentication_ExecCredential, + Convert_clientauthentication_ExecCredential_To_v1alpha1_ExecCredential, + Convert_v1alpha1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec, + Convert_clientauthentication_ExecCredentialSpec_To_v1alpha1_ExecCredentialSpec, + Convert_v1alpha1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus, + Convert_clientauthentication_ExecCredentialStatus_To_v1alpha1_ExecCredentialStatus, + Convert_v1alpha1_Response_To_clientauthentication_Response, + Convert_clientauthentication_Response_To_v1alpha1_Response, + ) +} + +func autoConvert_v1alpha1_ExecCredential_To_clientauthentication_ExecCredential(in *ExecCredential, out *clientauthentication.ExecCredential, s conversion.Scope) error { + if err := Convert_v1alpha1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + out.Status = (*clientauthentication.ExecCredentialStatus)(unsafe.Pointer(in.Status)) + return nil +} + +// Convert_v1alpha1_ExecCredential_To_clientauthentication_ExecCredential is an autogenerated conversion function. +func Convert_v1alpha1_ExecCredential_To_clientauthentication_ExecCredential(in *ExecCredential, out *clientauthentication.ExecCredential, s conversion.Scope) error { + return autoConvert_v1alpha1_ExecCredential_To_clientauthentication_ExecCredential(in, out, s) +} + +func autoConvert_clientauthentication_ExecCredential_To_v1alpha1_ExecCredential(in *clientauthentication.ExecCredential, out *ExecCredential, s conversion.Scope) error { + if err := Convert_clientauthentication_ExecCredentialSpec_To_v1alpha1_ExecCredentialSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + out.Status = (*ExecCredentialStatus)(unsafe.Pointer(in.Status)) + return nil +} + +// Convert_clientauthentication_ExecCredential_To_v1alpha1_ExecCredential is an autogenerated conversion function. +func Convert_clientauthentication_ExecCredential_To_v1alpha1_ExecCredential(in *clientauthentication.ExecCredential, out *ExecCredential, s conversion.Scope) error { + return autoConvert_clientauthentication_ExecCredential_To_v1alpha1_ExecCredential(in, out, s) +} + +func autoConvert_v1alpha1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(in *ExecCredentialSpec, out *clientauthentication.ExecCredentialSpec, s conversion.Scope) error { + out.Response = (*clientauthentication.Response)(unsafe.Pointer(in.Response)) + out.Interactive = in.Interactive + return nil +} + +// Convert_v1alpha1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec is an autogenerated conversion function. +func Convert_v1alpha1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(in *ExecCredentialSpec, out *clientauthentication.ExecCredentialSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(in, out, s) +} + +func autoConvert_clientauthentication_ExecCredentialSpec_To_v1alpha1_ExecCredentialSpec(in *clientauthentication.ExecCredentialSpec, out *ExecCredentialSpec, s conversion.Scope) error { + out.Response = (*Response)(unsafe.Pointer(in.Response)) + out.Interactive = in.Interactive + return nil +} + +// Convert_clientauthentication_ExecCredentialSpec_To_v1alpha1_ExecCredentialSpec is an autogenerated conversion function. +func Convert_clientauthentication_ExecCredentialSpec_To_v1alpha1_ExecCredentialSpec(in *clientauthentication.ExecCredentialSpec, out *ExecCredentialSpec, s conversion.Scope) error { + return autoConvert_clientauthentication_ExecCredentialSpec_To_v1alpha1_ExecCredentialSpec(in, out, s) +} + +func autoConvert_v1alpha1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(in *ExecCredentialStatus, out *clientauthentication.ExecCredentialStatus, s conversion.Scope) error { + out.ExpirationTimestamp = (*v1.Time)(unsafe.Pointer(in.ExpirationTimestamp)) + out.Token = in.Token + return nil +} + +// Convert_v1alpha1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus is an autogenerated conversion function. +func Convert_v1alpha1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(in *ExecCredentialStatus, out *clientauthentication.ExecCredentialStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(in, out, s) +} + +func autoConvert_clientauthentication_ExecCredentialStatus_To_v1alpha1_ExecCredentialStatus(in *clientauthentication.ExecCredentialStatus, out *ExecCredentialStatus, s conversion.Scope) error { + out.ExpirationTimestamp = (*v1.Time)(unsafe.Pointer(in.ExpirationTimestamp)) + out.Token = in.Token + return nil +} + +// Convert_clientauthentication_ExecCredentialStatus_To_v1alpha1_ExecCredentialStatus is an autogenerated conversion function. +func Convert_clientauthentication_ExecCredentialStatus_To_v1alpha1_ExecCredentialStatus(in *clientauthentication.ExecCredentialStatus, out *ExecCredentialStatus, s conversion.Scope) error { + return autoConvert_clientauthentication_ExecCredentialStatus_To_v1alpha1_ExecCredentialStatus(in, out, s) +} + +func autoConvert_v1alpha1_Response_To_clientauthentication_Response(in *Response, out *clientauthentication.Response, s conversion.Scope) error { + out.Header = *(*map[string][]string)(unsafe.Pointer(&in.Header)) + out.Code = in.Code + return nil +} + +// Convert_v1alpha1_Response_To_clientauthentication_Response is an autogenerated conversion function. +func Convert_v1alpha1_Response_To_clientauthentication_Response(in *Response, out *clientauthentication.Response, s conversion.Scope) error { + return autoConvert_v1alpha1_Response_To_clientauthentication_Response(in, out, s) +} + +func autoConvert_clientauthentication_Response_To_v1alpha1_Response(in *clientauthentication.Response, out *Response, s conversion.Scope) error { + out.Header = *(*map[string][]string)(unsafe.Pointer(&in.Header)) + out.Code = in.Code + return nil +} + +// Convert_clientauthentication_Response_To_v1alpha1_Response is an autogenerated conversion function. +func Convert_clientauthentication_Response_To_v1alpha1_Response(in *clientauthentication.Response, out *Response, s conversion.Scope) error { + return autoConvert_clientauthentication_Response_To_v1alpha1_Response(in, out, s) +} diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000..c6dbbce4d --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,137 @@ +// +build !ignore_autogenerated + +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecCredential) DeepCopyInto(out *ExecCredential) { + *out = *in + out.TypeMeta = in.TypeMeta + in.Spec.DeepCopyInto(&out.Spec) + if in.Status != nil { + in, out := &in.Status, &out.Status + if *in == nil { + *out = nil + } else { + *out = new(ExecCredentialStatus) + (*in).DeepCopyInto(*out) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredential. +func (in *ExecCredential) DeepCopy() *ExecCredential { + if in == nil { + return nil + } + out := new(ExecCredential) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExecCredential) 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 *ExecCredentialSpec) DeepCopyInto(out *ExecCredentialSpec) { + *out = *in + if in.Response != nil { + in, out := &in.Response, &out.Response + if *in == nil { + *out = nil + } else { + *out = new(Response) + (*in).DeepCopyInto(*out) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredentialSpec. +func (in *ExecCredentialSpec) DeepCopy() *ExecCredentialSpec { + if in == nil { + return nil + } + out := new(ExecCredentialSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecCredentialStatus) DeepCopyInto(out *ExecCredentialStatus) { + *out = *in + if in.ExpirationTimestamp != nil { + in, out := &in.ExpirationTimestamp, &out.ExpirationTimestamp + if *in == nil { + *out = nil + } else { + *out = (*in).DeepCopy() + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredentialStatus. +func (in *ExecCredentialStatus) DeepCopy() *ExecCredentialStatus { + if in == nil { + return nil + } + out := new(ExecCredentialStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Response) DeepCopyInto(out *Response) { + *out = *in + if in.Header != nil { + in, out := &in.Header, &out.Header + *out = make(map[string][]string, len(*in)) + for key, val := range *in { + if val == nil { + (*out)[key] = nil + } else { + (*out)[key] = make([]string, len(val)) + copy((*out)[key], val) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Response. +func (in *Response) DeepCopy() *Response { + if in == nil { + return nil + } + out := new(Response) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/zz_generated.defaults.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/zz_generated.defaults.go new file mode 100644 index 000000000..2bd0078a3 --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/zz_generated.deepcopy.go new file mode 100644 index 000000000..f8b15d848 --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/zz_generated.deepcopy.go @@ -0,0 +1,137 @@ +// +build !ignore_autogenerated + +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package clientauthentication + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecCredential) DeepCopyInto(out *ExecCredential) { + *out = *in + out.TypeMeta = in.TypeMeta + in.Spec.DeepCopyInto(&out.Spec) + if in.Status != nil { + in, out := &in.Status, &out.Status + if *in == nil { + *out = nil + } else { + *out = new(ExecCredentialStatus) + (*in).DeepCopyInto(*out) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredential. +func (in *ExecCredential) DeepCopy() *ExecCredential { + if in == nil { + return nil + } + out := new(ExecCredential) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExecCredential) 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 *ExecCredentialSpec) DeepCopyInto(out *ExecCredentialSpec) { + *out = *in + if in.Response != nil { + in, out := &in.Response, &out.Response + if *in == nil { + *out = nil + } else { + *out = new(Response) + (*in).DeepCopyInto(*out) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredentialSpec. +func (in *ExecCredentialSpec) DeepCopy() *ExecCredentialSpec { + if in == nil { + return nil + } + out := new(ExecCredentialSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecCredentialStatus) DeepCopyInto(out *ExecCredentialStatus) { + *out = *in + if in.ExpirationTimestamp != nil { + in, out := &in.ExpirationTimestamp, &out.ExpirationTimestamp + if *in == nil { + *out = nil + } else { + *out = (*in).DeepCopy() + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredentialStatus. +func (in *ExecCredentialStatus) DeepCopy() *ExecCredentialStatus { + if in == nil { + return nil + } + out := new(ExecCredentialStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Response) DeepCopyInto(out *Response) { + *out = *in + if in.Header != nil { + in, out := &in.Header, &out.Header + *out = make(map[string][]string, len(*in)) + for key, val := range *in { + if val == nil { + (*out)[key] = nil + } else { + (*out)[key] = make([]string, len(val)) + copy((*out)[key], val) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Response. +func (in *Response) DeepCopy() *Response { + if in == nil { + return nil + } + out := new(Response) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/client-go/pkg/version/def.bzl b/vendor/k8s.io/client-go/pkg/version/def.bzl index bca85ab4b..9c018a4ef 100644 --- a/vendor/k8s.io/client-go/pkg/version/def.bzl +++ b/vendor/k8s.io/client-go/pkg/version/def.bzl @@ -1,3 +1,17 @@ +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Implements hack/lib/version.sh's kube::version::ldflags() for Bazel. def version_x_defs(): # This should match the list of packages in kube::version::ldflag diff --git a/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/BUILD b/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/BUILD deleted file mode 100644 index 4100f394e..000000000 --- a/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/BUILD +++ /dev/null @@ -1,30 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["provider.go"], - importpath = "k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing", - deps = [ - "//vendor/github.com/coreos/go-oidc/jose:go_default_library", - "//vendor/github.com/coreos/go-oidc/key:go_default_library", - "//vendor/github.com/coreos/go-oidc/oidc:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/provider.go b/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/provider.go deleted file mode 100644 index ae7353ff2..000000000 --- a/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/provider.go +++ /dev/null @@ -1,200 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package testing - -import ( - "bytes" - "crypto/rand" - "crypto/rsa" - "crypto/tls" - "crypto/x509" - "crypto/x509/pkix" - "encoding/json" - "encoding/pem" - "fmt" - "io/ioutil" - "math/big" - "net" - "net/http" - "net/http/httptest" - "net/url" - "os" - "path" - "path/filepath" - "testing" - "time" - - "github.com/coreos/go-oidc/jose" - "github.com/coreos/go-oidc/key" - "github.com/coreos/go-oidc/oidc" -) - -// NewOIDCProvider provides a bare minimum OIDC IdP Server useful for testing. -func NewOIDCProvider(t *testing.T, issuerPath string) *OIDCProvider { - privKey, err := key.GeneratePrivateKey() - if err != nil { - t.Fatalf("Cannot create OIDC Provider: %v", err) - return nil - } - - op := &OIDCProvider{ - Mux: http.NewServeMux(), - PrivKey: privKey, - issuerPath: issuerPath, - } - - op.Mux.HandleFunc(path.Join(issuerPath, "/.well-known/openid-configuration"), op.handleConfig) - op.Mux.HandleFunc(path.Join(issuerPath, "/keys"), op.handleKeys) - - return op -} - -type OIDCProvider struct { - Mux *http.ServeMux - PCFG oidc.ProviderConfig - PrivKey *key.PrivateKey - issuerPath string -} - -func (op *OIDCProvider) ServeTLSWithKeyPair(cert, key string) (*httptest.Server, error) { - srv := httptest.NewUnstartedServer(op.Mux) - - srv.TLS = &tls.Config{Certificates: make([]tls.Certificate, 1)} - var err error - srv.TLS.Certificates[0], err = tls.LoadX509KeyPair(cert, key) - if err != nil { - return nil, fmt.Errorf("Cannot load cert/key pair: %v", err) - } - srv.StartTLS() - - // The issuer's URL is extended by an optional path. This ensures that the plugin can - // handle issuers that use a non-root path for discovery (see kubernetes/kubernetes#29749). - srv.URL = srv.URL + op.issuerPath - - u, err := url.Parse(srv.URL) - if err != nil { - return nil, err - } - pathFor := func(p string) *url.URL { - u2 := *u // Shallow copy. - u2.Path = path.Join(u2.Path, p) - return &u2 - } - - op.PCFG = oidc.ProviderConfig{ - Issuer: u, - AuthEndpoint: pathFor("/auth"), - TokenEndpoint: pathFor("/token"), - KeysEndpoint: pathFor("/keys"), - ResponseTypesSupported: []string{"code"}, - SubjectTypesSupported: []string{"public"}, - IDTokenSigningAlgValues: []string{"RS256"}, - } - return srv, nil -} - -func (op *OIDCProvider) handleConfig(w http.ResponseWriter, req *http.Request) { - b, err := json.Marshal(&op.PCFG) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/json") - w.Write(b) -} - -func (op *OIDCProvider) handleKeys(w http.ResponseWriter, req *http.Request) { - keys := struct { - Keys []jose.JWK `json:"keys"` - }{ - Keys: []jose.JWK{op.PrivKey.JWK()}, - } - - b, err := json.Marshal(keys) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age=%d", int(time.Hour.Seconds()))) - w.Header().Set("Expires", time.Now().Add(time.Hour).Format(time.RFC1123)) - w.Header().Set("Content-Type", "application/json") - w.Write(b) -} - -// generateSelfSignedCert generates a self-signed cert/key pairs and writes to the certPath/keyPath. -// This method is mostly identical to crypto.GenerateSelfSignedCert except for the 'IsCA' and 'KeyUsage' -// in the certificate template. (Maybe we can merge these two methods). -func GenerateSelfSignedCert(t *testing.T, host, certPath, keyPath string) { - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - t.Fatal(err) - } - - template := x509.Certificate{ - SerialNumber: big.NewInt(1), - Subject: pkix.Name{ - CommonName: fmt.Sprintf("%s@%d", host, time.Now().Unix()), - }, - NotBefore: time.Now(), - NotAfter: time.Now().Add(time.Hour * 24 * 365), - - KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, - ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, - BasicConstraintsValid: true, - IsCA: true, - } - - if ip := net.ParseIP(host); ip != nil { - template.IPAddresses = append(template.IPAddresses, ip) - } else { - template.DNSNames = append(template.DNSNames, host) - } - - derBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv) - if err != nil { - t.Fatal(err) - } - - // Generate cert - certBuffer := bytes.Buffer{} - if err := pem.Encode(&certBuffer, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}); err != nil { - t.Fatal(err) - } - - // Generate key - keyBuffer := bytes.Buffer{} - if err := pem.Encode(&keyBuffer, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)}); err != nil { - t.Fatal(err) - } - - // Write cert - if err := os.MkdirAll(filepath.Dir(certPath), os.FileMode(0755)); err != nil { - t.Fatal(err) - } - if err := ioutil.WriteFile(certPath, certBuffer.Bytes(), os.FileMode(0644)); err != nil { - t.Fatal(err) - } - - // Write key - if err := os.MkdirAll(filepath.Dir(keyPath), os.FileMode(0755)); err != nil { - t.Fatal(err) - } - if err := ioutil.WriteFile(keyPath, keyBuffer.Bytes(), os.FileMode(0600)); err != nil { - t.Fatal(err) - } -} diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/BUILD b/vendor/k8s.io/client-go/plugin/pkg/client/auth/BUILD index 8ab2d7452..367e897fd 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/BUILD +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/BUILD @@ -29,6 +29,7 @@ filegroup( srcs = [ ":package-srcs", "//staging/src/k8s.io/client-go/plugin/pkg/client/auth/azure:all-srcs", + "//staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec:all-srcs", "//staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp:all-srcs", "//staging/src/k8s.io/client-go/plugin/pkg/client/auth/oidc:all-srcs", "//staging/src/k8s.io/client-go/plugin/pkg/client/auth/openstack:all-srcs", diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/BUILD b/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/BUILD index 135ba355f..682776db5 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/BUILD +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["azure_test.go"], - importpath = "k8s.io/client-go/plugin/pkg/client/auth/azure", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/github.com/Azure/go-autorest/autorest/adal:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/BUILD b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/BUILD new file mode 100644 index 000000000..38cf9bdc2 --- /dev/null +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/BUILD @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = ["exec.go"], + importpath = "k8s.io/client-go/plugin/pkg/client/auth/exec", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/golang/glog:go_default_library", + "//vendor/golang.org/x/crypto/ssh/terminal:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", + "//vendor/k8s.io/client-go/pkg/apis/clientauthentication:go_default_library", + "//vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1:go_default_library", + "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = ["exec_test.go"], + data = glob(["testdata/**"]), + embed = [":go_default_library"], + deps = [ + "//vendor/k8s.io/client-go/pkg/apis/clientauthentication:go_default_library", + "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go new file mode 100644 index 000000000..dfd434d0c --- /dev/null +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go @@ -0,0 +1,280 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package exec + +import ( + "bytes" + "fmt" + "io" + "net/http" + "os" + "os/exec" + "sync" + "time" + + "github.com/golang/glog" + "golang.org/x/crypto/ssh/terminal" + "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/client-go/pkg/apis/clientauthentication" + "k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1" + "k8s.io/client-go/tools/clientcmd/api" +) + +const execInfoEnv = "KUBERNETES_EXEC_INFO" + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + v1alpha1.AddToScheme(scheme) + clientauthentication.AddToScheme(scheme) +} + +var ( + // Since transports can be constantly re-initialized by programs like kubectl, + // keep a cache of initialized authenticators keyed by a hash of their config. + globalCache = newCache() + // The list of API versions we accept. + apiVersions = map[string]schema.GroupVersion{ + v1alpha1.SchemeGroupVersion.String(): v1alpha1.SchemeGroupVersion, + } +) + +func newCache() *cache { + return &cache{m: make(map[string]*Authenticator)} +} + +func cacheKey(c *api.ExecConfig) string { + return fmt.Sprintf("%#v", c) +} + +type cache struct { + mu sync.Mutex + m map[string]*Authenticator +} + +func (c *cache) get(s string) (*Authenticator, bool) { + c.mu.Lock() + defer c.mu.Unlock() + a, ok := c.m[s] + return a, ok +} + +// put inserts an authenticator into the cache. If an authenticator is already +// associated with the key, the first one is returned instead. +func (c *cache) put(s string, a *Authenticator) *Authenticator { + c.mu.Lock() + defer c.mu.Unlock() + existing, ok := c.m[s] + if ok { + return existing + } + c.m[s] = a + return a +} + +// GetAuthenticator returns an exec-based plugin for providing client credentials. +func GetAuthenticator(config *api.ExecConfig) (*Authenticator, error) { + return newAuthenticator(globalCache, config) +} + +func newAuthenticator(c *cache, config *api.ExecConfig) (*Authenticator, error) { + key := cacheKey(config) + if a, ok := c.get(key); ok { + return a, nil + } + + gv, ok := apiVersions[config.APIVersion] + if !ok { + return nil, fmt.Errorf("exec plugin: invalid apiVersion %q", config.APIVersion) + } + + a := &Authenticator{ + cmd: config.Command, + args: config.Args, + group: gv, + + stdin: os.Stdin, + stderr: os.Stderr, + interactive: terminal.IsTerminal(int(os.Stdout.Fd())), + now: time.Now, + environ: os.Environ, + } + + for _, env := range config.Env { + a.env = append(a.env, env.Name+"="+env.Value) + } + + return c.put(key, a), nil +} + +// Authenticator is a client credential provider that rotates credentials by executing a plugin. +// The plugin input and output are defined by the API group client.authentication.k8s.io. +type Authenticator struct { + // Set by the config + cmd string + args []string + group schema.GroupVersion + env []string + + // Stubbable for testing + stdin io.Reader + stderr io.Writer + interactive bool + now func() time.Time + environ func() []string + + // Cached results. + // + // The mutex also guards calling the plugin. Since the plugin could be + // interactive we want to make sure it's only called once. + mu sync.Mutex + cachedToken string + exp time.Time +} + +// WrapTransport instruments an existing http.RoundTripper with credentials returned +// by the plugin. +func (a *Authenticator) WrapTransport(rt http.RoundTripper) http.RoundTripper { + return &roundTripper{a, rt} +} + +type roundTripper struct { + a *Authenticator + base http.RoundTripper +} + +func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + // If a user has already set credentials, use that. This makes commands like + // "kubectl get --token (token) pods" work. + if req.Header.Get("Authorization") != "" { + return r.base.RoundTrip(req) + } + + token, err := r.a.token() + if err != nil { + return nil, fmt.Errorf("getting token: %v", err) + } + req.Header.Set("Authorization", "Bearer "+token) + + res, err := r.base.RoundTrip(req) + if err != nil { + return nil, err + } + if res.StatusCode == http.StatusUnauthorized { + resp := &clientauthentication.Response{ + Header: res.Header, + Code: int32(res.StatusCode), + } + if err := r.a.refresh(token, resp); err != nil { + glog.Errorf("refreshing token: %v", err) + } + } + return res, nil +} + +func (a *Authenticator) tokenExpired() bool { + if a.exp.IsZero() { + return false + } + return a.now().After(a.exp) +} + +func (a *Authenticator) token() (string, error) { + a.mu.Lock() + defer a.mu.Unlock() + if a.cachedToken != "" && !a.tokenExpired() { + return a.cachedToken, nil + } + + return a.getToken(nil) +} + +// refresh executes the plugin to force a rotation of the token. +func (a *Authenticator) refresh(token string, r *clientauthentication.Response) error { + a.mu.Lock() + defer a.mu.Unlock() + + if token != a.cachedToken { + // Token already rotated. + return nil + } + + _, err := a.getToken(r) + return err +} + +// getToken executes the plugin and reads the credentials from stdout. It must be +// called while holding the Authenticator's mutex. +func (a *Authenticator) getToken(r *clientauthentication.Response) (string, error) { + cred := &clientauthentication.ExecCredential{ + Spec: clientauthentication.ExecCredentialSpec{ + Response: r, + Interactive: a.interactive, + }, + } + + data, err := runtime.Encode(codecs.LegacyCodec(a.group), cred) + if err != nil { + return "", fmt.Errorf("encode ExecCredentials: %v", err) + } + + env := append(a.environ(), a.env...) + env = append(env, fmt.Sprintf("%s=%s", execInfoEnv, data)) + + stdout := &bytes.Buffer{} + cmd := exec.Command(a.cmd, a.args...) + cmd.Env = env + cmd.Stderr = a.stderr + cmd.Stdout = stdout + if a.interactive { + cmd.Stdin = a.stdin + } + + if err := cmd.Run(); err != nil { + return "", fmt.Errorf("exec: %v", err) + } + + _, gvk, err := codecs.UniversalDecoder(a.group).Decode(stdout.Bytes(), nil, cred) + if err != nil { + return "", fmt.Errorf("decode stdout: %v", err) + } + if gvk.Group != a.group.Group || gvk.Version != a.group.Version { + return "", fmt.Errorf("exec plugin is configured to use API version %s, plugin returned version %s", + a.group, schema.GroupVersion{Group: gvk.Group, Version: gvk.Version}) + } + + if cred.Status == nil { + return "", fmt.Errorf("exec plugin didn't return a status field") + } + if cred.Status.Token == "" { + return "", fmt.Errorf("exec plugin didn't return a token") + } + + if cred.Status.ExpirationTimestamp != nil { + a.exp = cred.Status.ExpirationTimestamp.Time + } else { + a.exp = time.Time{} + } + a.cachedToken = cred.Status.Token + + return a.cachedToken, nil +} diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec_test.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec_test.go new file mode 100644 index 000000000..28137eb84 --- /dev/null +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec_test.go @@ -0,0 +1,413 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package exec + +import ( + "bytes" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "k8s.io/client-go/pkg/apis/clientauthentication" + "k8s.io/client-go/tools/clientcmd/api" +) + +func TestCacheKey(t *testing.T) { + c1 := &api.ExecConfig{ + Command: "foo-bar", + Args: []string{"1", "2"}, + Env: []api.ExecEnvVar{ + {Name: "3", Value: "4"}, + {Name: "5", Value: "6"}, + {Name: "7", Value: "8"}, + }, + APIVersion: "client.authentication.k8s.io/v1alpha1", + } + c2 := &api.ExecConfig{ + Command: "foo-bar", + Args: []string{"1", "2"}, + Env: []api.ExecEnvVar{ + {Name: "3", Value: "4"}, + {Name: "5", Value: "6"}, + {Name: "7", Value: "8"}, + }, + APIVersion: "client.authentication.k8s.io/v1alpha1", + } + c3 := &api.ExecConfig{ + Command: "foo-bar", + Args: []string{"1", "2"}, + Env: []api.ExecEnvVar{ + {Name: "3", Value: "4"}, + {Name: "5", Value: "6"}, + }, + APIVersion: "client.authentication.k8s.io/v1alpha1", + } + key1 := cacheKey(c1) + key2 := cacheKey(c2) + key3 := cacheKey(c3) + if key1 != key2 { + t.Error("key1 and key2 didn't match") + } + if key1 == key3 { + t.Error("key1 and key3 matched") + } + if key2 == key3 { + t.Error("key2 and key3 matched") + } +} + +func compJSON(t *testing.T, got, want []byte) { + t.Helper() + gotJSON := &bytes.Buffer{} + wantJSON := &bytes.Buffer{} + + if err := json.Indent(gotJSON, got, "", " "); err != nil { + t.Errorf("got invalid JSON: %v", err) + } + if err := json.Indent(wantJSON, want, "", " "); err != nil { + t.Errorf("want invalid JSON: %v", err) + } + g := strings.TrimSpace(gotJSON.String()) + w := strings.TrimSpace(wantJSON.String()) + if g != w { + t.Errorf("wanted %q, got %q", w, g) + } +} + +func TestGetToken(t *testing.T) { + tests := []struct { + name string + config api.ExecConfig + output string + interactive bool + response *clientauthentication.Response + wantInput string + wantToken string + wantExpiry time.Time + wantErr bool + }{ + { + name: "basic-request", + config: api.ExecConfig{ + APIVersion: "client.authentication.k8s.io/v1alpha1", + }, + wantInput: `{ + "kind":"ExecCredential", + "apiVersion":"client.authentication.k8s.io/v1alpha1", + "spec": {} + }`, + output: `{ + "kind": "ExecCredential", + "apiVersion": "client.authentication.k8s.io/v1alpha1", + "status": { + "token": "foo-bar" + } + }`, + wantToken: "foo-bar", + }, + { + name: "interactive", + config: api.ExecConfig{ + APIVersion: "client.authentication.k8s.io/v1alpha1", + }, + interactive: true, + wantInput: `{ + "kind":"ExecCredential", + "apiVersion":"client.authentication.k8s.io/v1alpha1", + "spec": { + "interactive": true + } + }`, + output: `{ + "kind": "ExecCredential", + "apiVersion": "client.authentication.k8s.io/v1alpha1", + "status": { + "token": "foo-bar" + } + }`, + wantToken: "foo-bar", + }, + { + name: "response", + config: api.ExecConfig{ + APIVersion: "client.authentication.k8s.io/v1alpha1", + }, + response: &clientauthentication.Response{ + Header: map[string][]string{ + "WWW-Authenticate": {`Basic realm="Access to the staging site", charset="UTF-8"`}, + }, + Code: 401, + }, + wantInput: `{ + "kind":"ExecCredential", + "apiVersion":"client.authentication.k8s.io/v1alpha1", + "spec": { + "response": { + "header": { + "WWW-Authenticate": [ + "Basic realm=\"Access to the staging site\", charset=\"UTF-8\"" + ] + }, + "code": 401 + } + } + }`, + output: `{ + "kind": "ExecCredential", + "apiVersion": "client.authentication.k8s.io/v1alpha1", + "status": { + "token": "foo-bar" + } + }`, + wantToken: "foo-bar", + }, + { + name: "expiry", + config: api.ExecConfig{ + APIVersion: "client.authentication.k8s.io/v1alpha1", + }, + wantInput: `{ + "kind":"ExecCredential", + "apiVersion":"client.authentication.k8s.io/v1alpha1", + "spec": {} + }`, + output: `{ + "kind": "ExecCredential", + "apiVersion": "client.authentication.k8s.io/v1alpha1", + "status": { + "token": "foo-bar", + "expirationTimestamp": "2006-01-02T15:04:05Z" + } + }`, + wantExpiry: time.Date(2006, 01, 02, 15, 04, 05, 0, time.UTC), + wantToken: "foo-bar", + }, + { + name: "no-group-version", + config: api.ExecConfig{ + APIVersion: "client.authentication.k8s.io/v1alpha1", + }, + wantInput: `{ + "kind":"ExecCredential", + "apiVersion":"client.authentication.k8s.io/v1alpha1", + "spec": {} + }`, + output: `{ + "kind": "ExecCredential", + "status": { + "token": "foo-bar" + } + }`, + wantErr: true, + }, + { + name: "no-status", + config: api.ExecConfig{ + APIVersion: "client.authentication.k8s.io/v1alpha1", + }, + wantInput: `{ + "kind":"ExecCredential", + "apiVersion":"client.authentication.k8s.io/v1alpha1", + "spec": {} + }`, + output: `{ + "kind": "ExecCredential", + "apiVersion":"client.authentication.k8s.io/v1alpha1" + }`, + wantErr: true, + }, + { + name: "no-token", + config: api.ExecConfig{ + APIVersion: "client.authentication.k8s.io/v1alpha1", + }, + wantInput: `{ + "kind":"ExecCredential", + "apiVersion":"client.authentication.k8s.io/v1alpha1", + "spec": {} + }`, + output: `{ + "kind": "ExecCredential", + "apiVersion":"client.authentication.k8s.io/v1alpha1", + "status": {} + }`, + wantErr: true, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + c := test.config + + c.Command = "./testdata/test-plugin.sh" + c.Env = append(c.Env, api.ExecEnvVar{ + Name: "TEST_OUTPUT", + Value: test.output, + }) + + a, err := newAuthenticator(newCache(), &c) + if err != nil { + t.Fatal(err) + } + + stderr := &bytes.Buffer{} + a.stderr = stderr + a.interactive = test.interactive + a.environ = func() []string { return nil } + + token, err := a.getToken(test.response) + if err != nil { + if !test.wantErr { + t.Errorf("get token %v", err) + } + return + } + if test.wantErr { + t.Fatal("expected error getting token") + } + + if token != test.wantToken { + t.Errorf("expected token %q got %q", test.wantToken, token) + } + + if !a.exp.Equal(test.wantExpiry) { + t.Errorf("expected expiry %v got %v", test.wantExpiry, a.exp) + } + + compJSON(t, stderr.Bytes(), []byte(test.wantInput)) + }) + } +} + +func TestRoundTripper(t *testing.T) { + wantToken := "" + + n := time.Now() + now := func() time.Time { return n } + + env := []string{""} + environ := func() []string { + s := make([]string, len(env)) + copy(s, env) + return s + } + + setOutput := func(s string) { + env[0] = "TEST_OUTPUT=" + s + } + + handler := func(w http.ResponseWriter, r *http.Request) { + gotToken := "" + parts := strings.Split(r.Header.Get("Authorization"), " ") + if len(parts) > 1 && strings.EqualFold(parts[0], "bearer") { + gotToken = parts[1] + } + + if wantToken != gotToken { + http.Error(w, "Unauthorized", http.StatusUnauthorized) + return + } + fmt.Fprintln(w, "ok") + } + server := httptest.NewServer(http.HandlerFunc(handler)) + + c := api.ExecConfig{ + Command: "./testdata/test-plugin.sh", + APIVersion: "client.authentication.k8s.io/v1alpha1", + } + a, err := newAuthenticator(newCache(), &c) + if err != nil { + t.Fatal(err) + } + a.environ = environ + a.now = now + a.stderr = ioutil.Discard + + client := http.Client{ + Transport: a.WrapTransport(http.DefaultTransport), + } + + get := func(t *testing.T, statusCode int) { + t.Helper() + resp, err := client.Get(server.URL) + if err != nil { + t.Fatal(err) + } + defer resp.Body.Close() + if resp.StatusCode != statusCode { + t.Errorf("wanted status %d got %d", statusCode, resp.StatusCode) + } + } + + setOutput(`{ + "kind": "ExecCredential", + "apiVersion": "client.authentication.k8s.io/v1alpha1", + "status": { + "token": "token1" + } + }`) + wantToken = "token1" + get(t, http.StatusOK) + + setOutput(`{ + "kind": "ExecCredential", + "apiVersion": "client.authentication.k8s.io/v1alpha1", + "status": { + "token": "token2" + } + }`) + // Previous token should be cached + get(t, http.StatusOK) + + wantToken = "token2" + // Token is still cached, hits unauthorized but causes token to rotate. + get(t, http.StatusUnauthorized) + // Follow up request uses the rotated token. + get(t, http.StatusOK) + + setOutput(`{ + "kind": "ExecCredential", + "apiVersion": "client.authentication.k8s.io/v1alpha1", + "status": { + "token": "token3", + "expirationTimestamp": "` + now().Add(time.Hour).Format(time.RFC3339Nano) + `" + } + }`) + wantToken = "token3" + // Token is still cached, hit's unauthorized but causes rotation to token with an expiry. + get(t, http.StatusUnauthorized) + get(t, http.StatusOK) + + // Move time forward 2 hours, "token3" is now expired. + n = n.Add(time.Hour * 2) + setOutput(`{ + "kind": "ExecCredential", + "apiVersion": "client.authentication.k8s.io/v1alpha1", + "status": { + "token": "token4", + "expirationTimestamp": "` + now().Add(time.Hour).Format(time.RFC3339Nano) + `" + } + }`) + wantToken = "token4" + // Old token is expired, should refresh automatically without hitting a 401. + get(t, http.StatusOK) +} diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/testdata/test-plugin.sh b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/testdata/test-plugin.sh new file mode 100755 index 000000000..6b9bb100c --- /dev/null +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/testdata/test-plugin.sh @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# Copyright 2018 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +>&2 echo "$KUBERNETES_EXEC_INFO" +echo "$TEST_OUTPUT" diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/BUILD b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/BUILD index d9ef7bded..e57e896ae 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/BUILD +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["gcp_test.go"], - importpath = "k8s.io/client-go/plugin/pkg/client/auth/gcp", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/golang.org/x/oauth2:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go index 5ed1203b2..3a4f86777 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go @@ -42,8 +42,18 @@ func init() { } } -// Stubbable for testing -var execCommand = exec.Command +var ( + // Stubbable for testing + execCommand = exec.Command + + // defaultScopes: + // - cloud-platform is the base scope to authenticate to GCP. + // - userinfo.email is used to authenticate to GKE APIs with gserviceaccount + // email instead of numeric uniqueID. + defaultScopes = []string{ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"} +) // gcpAuthProvider is an auth provider plugin that uses GCP credentials to provide // tokens for kubectl to authenticate itself to the apiserver. A sample json config @@ -55,6 +65,14 @@ var execCommand = exec.Command // "name": "gcp", // // 'config': { +// # Authentication options +// # These options are used while getting a token. +// +// # comma-separated list of GCP API scopes. default value of this field +// # is "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/userinfo.email". +// # to override the API scopes, specify this field explicitly. +// "scopes": "https://www.googleapis.com/auth/cloud-platform" +// // # Caching options // // # Raw string data representing cached access token. @@ -96,12 +114,32 @@ type gcpAuthProvider struct { } func newGCPAuthProvider(_ string, gcpConfig map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) { - var ts oauth2.TokenSource - var err error - if cmd, useCmd := gcpConfig["cmd-path"]; useCmd { + ts, err := tokenSource(isCmdTokenSource(gcpConfig), gcpConfig) + if err != nil { + return nil, err + } + cts, err := newCachedTokenSource(gcpConfig["access-token"], gcpConfig["expiry"], persister, ts, gcpConfig) + if err != nil { + return nil, err + } + return &gcpAuthProvider{cts, persister}, nil +} + +func isCmdTokenSource(gcpConfig map[string]string) bool { + _, ok := gcpConfig["cmd-path"] + return ok +} + +func tokenSource(isCmd bool, gcpConfig map[string]string) (oauth2.TokenSource, error) { + // Command-based token source + if isCmd { + cmd := gcpConfig["cmd-path"] if len(cmd) == 0 { return nil, fmt.Errorf("missing access token cmd") } + if gcpConfig["scopes"] != "" { + return nil, fmt.Errorf("scopes can only be used when kubectl is using a gcp service account key") + } var args []string if cmdArgs, ok := gcpConfig["cmd-args"]; ok { args = strings.Fields(cmdArgs) @@ -110,18 +148,29 @@ func newGCPAuthProvider(_ string, gcpConfig map[string]string, persister restcli cmd = fields[0] args = fields[1:] } - ts = newCmdTokenSource(cmd, args, gcpConfig["token-key"], gcpConfig["expiry-key"], gcpConfig["time-fmt"]) - } else { - ts, err = google.DefaultTokenSource(context.Background(), "https://www.googleapis.com/auth/cloud-platform") + return newCmdTokenSource(cmd, args, gcpConfig["token-key"], gcpConfig["expiry-key"], gcpConfig["time-fmt"]), nil } + + // Google Application Credentials-based token source + scopes := parseScopes(gcpConfig) + ts, err := google.DefaultTokenSource(context.Background(), scopes...) if err != nil { - return nil, err + return nil, fmt.Errorf("cannot construct google default token source: %v", err) } - cts, err := newCachedTokenSource(gcpConfig["access-token"], gcpConfig["expiry"], persister, ts, gcpConfig) - if err != nil { - return nil, err + return ts, nil +} + +// parseScopes constructs a list of scopes that should be included in token source +// from the config map. +func parseScopes(gcpConfig map[string]string) []string { + scopes, ok := gcpConfig["scopes"] + if !ok { + return defaultScopes } - return &gcpAuthProvider{cts, persister}, nil + if scopes == "" { + return []string{} + } + return strings.Split(gcpConfig["scopes"], ",") } func (g *gcpAuthProvider) WrapTransport(rt http.RoundTripper) http.RoundTripper { diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_test.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_test.go index 662d38b8f..32271b252 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_test.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_test.go @@ -18,6 +18,7 @@ package gcp import ( "fmt" + "io/ioutil" "net/http" "os" "os/exec" @@ -116,6 +117,114 @@ func TestHelperProcess(t *testing.T) { os.Exit(0) } +func Test_isCmdTokenSource(t *testing.T) { + c1 := map[string]string{"cmd-path": "foo"} + if v := isCmdTokenSource(c1); !v { + t.Fatalf("cmd-path present in config (%+v), but got %v", c1, v) + } + + c2 := map[string]string{"cmd-args": "foo bar"} + if v := isCmdTokenSource(c2); v { + t.Fatalf("cmd-path not present in config (%+v), but got %v", c2, v) + } +} + +func Test_tokenSource_cmd(t *testing.T) { + if _, err := tokenSource(true, map[string]string{}); err == nil { + t.Fatalf("expected error, cmd-args not present in config") + } + + c := map[string]string{ + "cmd-path": "foo", + "cmd-args": "bar"} + ts, err := tokenSource(true, c) + if err != nil { + t.Fatalf("failed to return cmd token source: %+v", err) + } + if ts == nil { + t.Fatal("returned nil token source") + } + if _, ok := ts.(*commandTokenSource); !ok { + t.Fatalf("returned token source type:(%T) expected:(*commandTokenSource)", ts) + } +} + +func Test_tokenSource_cmdCannotBeUsedWithScopes(t *testing.T) { + c := map[string]string{ + "cmd-path": "foo", + "scopes": "A,B"} + if _, err := tokenSource(true, c); err == nil { + t.Fatal("expected error when scopes is used with cmd-path") + } +} + +func Test_tokenSource_applicationDefaultCredentials_fails(t *testing.T) { + // try to use empty ADC file + fakeTokenFile, err := ioutil.TempFile("", "adctoken") + if err != nil { + t.Fatalf("failed to create fake token file: +%v", err) + } + fakeTokenFile.Close() + defer os.Remove(fakeTokenFile.Name()) + + os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", fakeTokenFile.Name()) + defer os.Unsetenv("GOOGLE_APPLICATION_CREDENTIALS") + if _, err := tokenSource(false, map[string]string{}); err == nil { + t.Fatalf("expected error because specified ADC token file is not a JSON") + } +} + +func Test_tokenSource_applicationDefaultCredentials(t *testing.T) { + fakeTokenFile, err := ioutil.TempFile("", "adctoken") + if err != nil { + t.Fatalf("failed to create fake token file: +%v", err) + } + fakeTokenFile.Close() + defer os.Remove(fakeTokenFile.Name()) + if err := ioutil.WriteFile(fakeTokenFile.Name(), []byte(`{"type":"service_account"}`), 0600); err != nil { + t.Fatalf("failed to write to fake token file: %+v", err) + } + + os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", fakeTokenFile.Name()) + defer os.Unsetenv("GOOGLE_APPLICATION_CREDENTIALS") + ts, err := tokenSource(false, map[string]string{}) + if err != nil { + t.Fatalf("failed to get a token source: %+v", err) + } + if ts == nil { + t.Fatal("returned nil token source") + } +} + +func Test_parseScopes(t *testing.T) { + cases := []struct { + in map[string]string + out []string + }{ + { + map[string]string{}, + []string{ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"}, + }, + { + map[string]string{"scopes": ""}, + []string{}, + }, + { + map[string]string{"scopes": "A,B,C"}, + []string{"A", "B", "C"}, + }, + } + + for _, c := range cases { + got := parseScopes(c.in) + if !reflect.DeepEqual(got, c.out) { + t.Errorf("expected=%v, got=%v", c.out, got) + } + } +} + func errEquiv(got, want error) bool { if got == want { return true diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/BUILD b/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/BUILD index 03ccf499c..ee76fac0d 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/BUILD +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["oidc_test.go"], - importpath = "k8s.io/client-go/plugin/pkg/client/auth/oidc", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/BUILD b/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/BUILD index 6ebaf302d..750ffd6f5 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/BUILD +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["openstack_test.go"], - importpath = "k8s.io/client-go/plugin/pkg/client/auth/openstack", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/rest/BUILD b/vendor/k8s.io/client-go/rest/BUILD index 44958631d..0cb24bcff 100644 --- a/vendor/k8s.io/client-go/rest/BUILD +++ b/vendor/k8s.io/client-go/rest/BUILD @@ -16,8 +16,7 @@ go_test( "url_utils_test.go", "urlbackoff_test.go", ], - importpath = "k8s.io/client-go/rest", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/google/gofuzz:go_default_library", @@ -55,7 +54,6 @@ go_library( "transport.go", "url_utils.go", "urlbackoff.go", - "versions.go", "zz_generated.deepcopy.go", ], importpath = "k8s.io/client-go/rest", @@ -73,6 +71,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/client-go/pkg/version:go_default_library", + "//vendor/k8s.io/client-go/plugin/pkg/client/auth/exec:go_default_library", "//vendor/k8s.io/client-go/rest/watch:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", "//vendor/k8s.io/client-go/tools/metrics:go_default_library", diff --git a/vendor/k8s.io/client-go/rest/client.go b/vendor/k8s.io/client-go/rest/client.go index 524e0d8eb..927403cb2 100644 --- a/vendor/k8s.io/client-go/rest/client.go +++ b/vendor/k8s.io/client-go/rest/client.go @@ -222,9 +222,9 @@ func (c *RESTClient) Verb(verb string) *Request { backoff := c.createBackoffMgr() if c.Client == nil { - return NewRequest(nil, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle) + return NewRequest(nil, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle, 0) } - return NewRequest(c.Client, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle) + return NewRequest(c.Client, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle, c.Client.Timeout) } // Post begins a POST request. Short for c.Verb("POST"). diff --git a/vendor/k8s.io/client-go/rest/client_test.go b/vendor/k8s.io/client-go/rest/client_test.go index 3096cc13a..2eae9be2d 100644 --- a/vendor/k8s.io/client-go/rest/client_test.go +++ b/vendor/k8s.io/client-go/rest/client_test.go @@ -302,7 +302,7 @@ func TestCreateBackoffManager(t *testing.T) { backoff.UpdateBackoff(theUrl, nil, 500) backoff = readExpBackoffConfig() if backoff.CalculateBackoff(theUrl)/time.Second != 0 { - t.Errorf("Zero backoff duration, but backoff still occuring.") + t.Errorf("Zero backoff duration, but backoff still occurring.") } // No env -> No backoff. diff --git a/vendor/k8s.io/client-go/rest/config.go b/vendor/k8s.io/client-go/rest/config.go index 038fee945..72a78bc0a 100644 --- a/vendor/k8s.io/client-go/rest/config.go +++ b/vendor/k8s.io/client-go/rest/config.go @@ -54,9 +54,6 @@ type Config struct { Host string // APIPath is a sub-path that points to an API root. APIPath string - // Prefix is the sub path of the server. If not specified, the client will set - // a default value. Use "/" to indicate the server root should be used - Prefix string // ContentConfig contains settings that affect how objects are transformed when // sent to the server. @@ -71,10 +68,6 @@ type Config struct { // TODO: demonstrate an OAuth2 compatible client. BearerToken string - // CacheDir is the directory where we'll store HTTP cached responses. - // If set to empty string, no caching mechanism will be used. - CacheDir string - // Impersonate is the configuration that RESTClient will use for impersonation. Impersonate ImpersonationConfig @@ -84,6 +77,9 @@ type Config struct { // Callback to persist config for AuthProvider. AuthConfigPersister AuthProviderConfigPersister + // Exec-based authentication provider. + ExecProvider *clientcmdapi.ExecConfig + // TLSClientConfig contains settings to enable transport layer security TLSClientConfig @@ -405,7 +401,6 @@ func AnonymousClientConfig(config *Config) *Config { return &Config{ Host: config.Host, APIPath: config.APIPath, - Prefix: config.Prefix, ContentConfig: config.ContentConfig, TLSClientConfig: TLSClientConfig{ Insecure: config.Insecure, @@ -429,12 +424,10 @@ func CopyConfig(config *Config) *Config { return &Config{ Host: config.Host, APIPath: config.APIPath, - Prefix: config.Prefix, ContentConfig: config.ContentConfig, Username: config.Username, Password: config.Password, BearerToken: config.BearerToken, - CacheDir: config.CacheDir, Impersonate: ImpersonationConfig{ Groups: config.Impersonate.Groups, Extra: config.Impersonate.Extra, @@ -442,6 +435,7 @@ func CopyConfig(config *Config) *Config { }, AuthProvider: config.AuthProvider, AuthConfigPersister: config.AuthConfigPersister, + ExecProvider: config.ExecProvider, TLSClientConfig: TLSClientConfig{ Insecure: config.TLSClientConfig.Insecure, ServerName: config.TLSClientConfig.ServerName, diff --git a/vendor/k8s.io/client-go/rest/config_test.go b/vendor/k8s.io/client-go/rest/config_test.go index 0e86442db..a9495d792 100644 --- a/vendor/k8s.io/client-go/rest/config_test.go +++ b/vendor/k8s.io/client-go/rest/config_test.go @@ -267,9 +267,9 @@ func TestAnonymousConfig(t *testing.T) { expected.BearerToken = "" expected.Username = "" expected.Password = "" - expected.CacheDir = "" expected.AuthProvider = nil expected.AuthConfigPersister = nil + expected.ExecProvider = nil expected.TLSClientConfig.CertData = nil expected.TLSClientConfig.CertFile = "" expected.TLSClientConfig.KeyData = nil diff --git a/vendor/k8s.io/client-go/rest/fake/fake.go b/vendor/k8s.io/client-go/rest/fake/fake.go index db2c01c71..bc43a90ac 100644 --- a/vendor/k8s.io/client-go/rest/fake/fake.go +++ b/vendor/k8s.io/client-go/rest/fake/fake.go @@ -107,7 +107,7 @@ func (c *RESTClient) request(verb string) *restclient.Request { serializers.StreamingSerializer = info.StreamSerializer.Serializer serializers.Framer = info.StreamSerializer.Framer } - return restclient.NewRequest(c, verb, &url.URL{Host: "localhost"}, c.VersionedAPIPath, config, serializers, nil, nil) + return restclient.NewRequest(c, verb, &url.URL{Host: "localhost"}, c.VersionedAPIPath, config, serializers, nil, nil, 0) } func (c *RESTClient) Do(req *http.Request) (*http.Response, error) { diff --git a/vendor/k8s.io/client-go/rest/request.go b/vendor/k8s.io/client-go/rest/request.go index aac126ccc..6ca9e0197 100644 --- a/vendor/k8s.io/client-go/rest/request.go +++ b/vendor/k8s.io/client-go/rest/request.go @@ -112,7 +112,7 @@ type Request struct { } // NewRequest creates a new request helper object for accessing runtime.Objects on a server. -func NewRequest(client HTTPClient, verb string, baseURL *url.URL, versionedAPIPath string, content ContentConfig, serializers Serializers, backoff BackoffManager, throttle flowcontrol.RateLimiter) *Request { +func NewRequest(client HTTPClient, verb string, baseURL *url.URL, versionedAPIPath string, content ContentConfig, serializers Serializers, backoff BackoffManager, throttle flowcontrol.RateLimiter, timeout time.Duration) *Request { if backoff == nil { glog.V(2).Infof("Not implementing request backoff strategy.") backoff = &NoBackoff{} @@ -131,6 +131,7 @@ func NewRequest(client HTTPClient, verb string, baseURL *url.URL, versionedAPIPa serializers: serializers, backoffMgr: backoff, throttle: throttle, + timeout: timeout, } switch { case len(content.AcceptContentTypes) > 0: diff --git a/vendor/k8s.io/client-go/rest/request_test.go b/vendor/k8s.io/client-go/rest/request_test.go index f575350e3..fac690255 100755 --- a/vendor/k8s.io/client-go/rest/request_test.go +++ b/vendor/k8s.io/client-go/rest/request_test.go @@ -57,11 +57,11 @@ import ( ) func TestNewRequestSetsAccept(t *testing.T) { - r := NewRequest(nil, "get", &url.URL{Path: "/path/"}, "", ContentConfig{}, Serializers{}, nil, nil) + r := NewRequest(nil, "get", &url.URL{Path: "/path/"}, "", ContentConfig{}, Serializers{}, nil, nil, 0) if r.headers.Get("Accept") != "" { t.Errorf("unexpected headers: %#v", r.headers) } - r = NewRequest(nil, "get", &url.URL{Path: "/path/"}, "", ContentConfig{ContentType: "application/other"}, Serializers{}, nil, nil) + r = NewRequest(nil, "get", &url.URL{Path: "/path/"}, "", ContentConfig{ContentType: "application/other"}, Serializers{}, nil, nil, 0) if r.headers.Get("Accept") != "application/other, */*" { t.Errorf("unexpected headers: %#v", r.headers) } @@ -86,7 +86,7 @@ func TestRequestSetsHeaders(t *testing.T) { config := defaultContentConfig() config.ContentType = "application/other" serializers := defaultSerializers(t) - r := NewRequest(server, "get", &url.URL{Path: "/path"}, "", config, serializers, nil, nil) + r := NewRequest(server, "get", &url.URL{Path: "/path"}, "", config, serializers, nil, nil, 0) // Check if all "issue" methods are setting headers. _ = r.Do() @@ -341,7 +341,7 @@ func TestResultIntoWithNoBodyReturnsErr(t *testing.T) { func TestURLTemplate(t *testing.T) { uri, _ := url.Parse("http://localhost") - r := NewRequest(nil, "POST", uri, "", ContentConfig{GroupVersion: &schema.GroupVersion{Group: "test"}}, Serializers{}, nil, nil) + r := NewRequest(nil, "POST", uri, "", ContentConfig{GroupVersion: &schema.GroupVersion{Group: "test"}}, Serializers{}, nil, nil, 0) r.Prefix("pre1").Resource("r1").Namespace("ns").Name("nm").Param("p0", "v0") full := r.URL() if full.String() != "http://localhost/pre1/namespaces/ns/r1/nm?p0=v0" { @@ -403,7 +403,7 @@ func TestTransformResponse(t *testing.T) { {Response: &http.Response{StatusCode: 200, Body: ioutil.NopCloser(bytes.NewReader(invalid))}, Data: invalid}, } for i, test := range testCases { - r := NewRequest(nil, "", uri, "", defaultContentConfig(), defaultSerializers(t), nil, nil) + r := NewRequest(nil, "", uri, "", defaultContentConfig(), defaultSerializers(t), nil, nil, 0) if test.Response.Body == nil { test.Response.Body = ioutil.NopCloser(bytes.NewReader([]byte{})) } @@ -554,7 +554,7 @@ func TestTransformResponseNegotiate(t *testing.T) { serializers.RenegotiatedDecoder = negotiator.invoke contentConfig := defaultContentConfig() contentConfig.ContentType = test.ContentType - r := NewRequest(nil, "", uri, "", contentConfig, serializers, nil, nil) + r := NewRequest(nil, "", uri, "", contentConfig, serializers, nil, nil, 0) if test.Response.Body == nil { test.Response.Body = ioutil.NopCloser(bytes.NewReader([]byte{})) } @@ -1480,7 +1480,7 @@ func TestAbsPath(t *testing.T) { {"/p1/api/p2", "/api/r1", "/api/", "/p1/api/p2/api/"}, } { u, _ := url.Parse("http://localhost:123" + tc.configPrefix) - r := NewRequest(nil, "POST", u, "", ContentConfig{GroupVersion: &schema.GroupVersion{Group: "test"}}, Serializers{}, nil, nil).Prefix(tc.resourcePrefix).AbsPath(tc.absPath) + r := NewRequest(nil, "POST", u, "", ContentConfig{GroupVersion: &schema.GroupVersion{Group: "test"}}, Serializers{}, nil, nil, 0).Prefix(tc.resourcePrefix).AbsPath(tc.absPath) if r.pathPrefix != tc.wantsAbsPath { t.Errorf("test case %d failed, unexpected path: %q, expected %q", i, r.pathPrefix, tc.wantsAbsPath) } diff --git a/vendor/k8s.io/client-go/rest/transport.go b/vendor/k8s.io/client-go/rest/transport.go index f59f8dbe2..b6a067632 100644 --- a/vendor/k8s.io/client-go/rest/transport.go +++ b/vendor/k8s.io/client-go/rest/transport.go @@ -20,6 +20,7 @@ import ( "crypto/tls" "net/http" + "k8s.io/client-go/plugin/pkg/client/auth/exec" "k8s.io/client-go/transport" ) @@ -59,6 +60,20 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip // TransportConfig converts a client config to an appropriate transport config. func (c *Config) TransportConfig() (*transport.Config, error) { wt := c.WrapTransport + if c.ExecProvider != nil { + provider, err := exec.GetAuthenticator(c.ExecProvider) + if err != nil { + return nil, err + } + if wt != nil { + previousWT := wt + wt = func(rt http.RoundTripper) http.RoundTripper { + return provider.WrapTransport(previousWT(rt)) + } + } else { + wt = provider.WrapTransport + } + } if c.AuthProvider != nil { provider, err := GetAuthProvider(c.Host, c.AuthProvider, c.AuthConfigPersister) if err != nil { @@ -89,7 +104,6 @@ func (c *Config) TransportConfig() (*transport.Config, error) { }, Username: c.Username, Password: c.Password, - CacheDir: c.CacheDir, BearerToken: c.BearerToken, Impersonate: transport.ImpersonationConfig{ UserName: c.Impersonate.UserName, diff --git a/vendor/k8s.io/client-go/rest/versions.go b/vendor/k8s.io/client-go/rest/versions.go deleted file mode 100644 index 9d41812f2..000000000 --- a/vendor/k8s.io/client-go/rest/versions.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rest - -import ( - "encoding/json" - "fmt" - "net/http" - "path" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - legacyAPIPath = "/api" - defaultAPIPath = "/apis" -) - -// TODO: Is this obsoleted by the discovery client? - -// ServerAPIVersions returns the GroupVersions supported by the API server. -// It creates a RESTClient based on the passed in config, but it doesn't rely -// on the Version and Codec of the config, because it uses AbsPath and -// takes the raw response. -func ServerAPIVersions(c *Config) (groupVersions []string, err error) { - transport, err := TransportFor(c) - if err != nil { - return nil, err - } - client := http.Client{Transport: transport} - - configCopy := *c - configCopy.GroupVersion = nil - configCopy.APIPath = "" - baseURL, _, err := defaultServerUrlFor(&configCopy) - if err != nil { - return nil, err - } - // Get the groupVersions exposed at /api - originalPath := baseURL.Path - baseURL.Path = path.Join(originalPath, legacyAPIPath) - resp, err := client.Get(baseURL.String()) - if err != nil { - return nil, err - } - var v metav1.APIVersions - defer resp.Body.Close() - err = json.NewDecoder(resp.Body).Decode(&v) - if err != nil { - return nil, fmt.Errorf("unexpected error: %v", err) - } - - groupVersions = append(groupVersions, v.Versions...) - // Get the groupVersions exposed at /apis - baseURL.Path = path.Join(originalPath, defaultAPIPath) - resp2, err := client.Get(baseURL.String()) - if err != nil { - return nil, err - } - var apiGroupList metav1.APIGroupList - defer resp2.Body.Close() - err = json.NewDecoder(resp2.Body).Decode(&apiGroupList) - if err != nil { - return nil, fmt.Errorf("unexpected error: %v", err) - } - - for _, g := range apiGroupList.Groups { - for _, gv := range g.Versions { - groupVersions = append(groupVersions, gv.GroupVersion) - } - } - - return groupVersions, nil -} diff --git a/vendor/k8s.io/client-go/rest/watch/BUILD b/vendor/k8s.io/client-go/rest/watch/BUILD index 271832863..30dfadd1f 100644 --- a/vendor/k8s.io/client-go/rest/watch/BUILD +++ b/vendor/k8s.io/client-go/rest/watch/BUILD @@ -27,7 +27,6 @@ go_test( "decoder_test.go", "encoder_test.go", ], - importpath = "k8s.io/client-go/rest/watch_test", deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", diff --git a/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go index 59050fc49..67568bf0b 100644 --- a/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go +++ b/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package rest diff --git a/vendor/k8s.io/client-go/scale/BUILD b/vendor/k8s.io/client-go/scale/BUILD index 4fb0a949e..b82984243 100644 --- a/vendor/k8s.io/client-go/scale/BUILD +++ b/vendor/k8s.io/client-go/scale/BUILD @@ -35,8 +35,7 @@ go_test( "client_test.go", "roundtrip_test.go", ], - importpath = "k8s.io/client-go/scale", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/k8s.io/api/apps/v1beta1:go_default_library", diff --git a/vendor/k8s.io/client-go/scale/client.go b/vendor/k8s.io/client-go/scale/client.go index 3f85197a0..782aca394 100644 --- a/vendor/k8s.io/client-go/scale/client.go +++ b/vendor/k8s.io/client-go/scale/client.go @@ -21,6 +21,7 @@ import ( autoscaling "k8s.io/api/autoscaling/v1" "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/client-go/dynamic" @@ -129,21 +130,29 @@ func (c *namespacedScaleClient) Get(resource schema.GroupResource, name string) return nil, fmt.Errorf("unable to get client for %s: %v", resource.String(), err) } - rawObj, err := c.client.clientBase.Get(). + result := c.client.clientBase.Get(). AbsPath(path). Namespace(c.namespace). Resource(gvr.Resource). Name(name). SubResource("scale"). - Do(). - Get() + Do() + if err := result.Error(); err != nil { + return nil, fmt.Errorf("could not fetch the scale for %s %s: %v", resource.String(), name, err) + } + scaleBytes, err := result.Raw() + if err != nil { + return nil, err + } + decoder := scaleConverter.codecs.UniversalDecoder(scaleConverter.ScaleVersions()...) + rawScaleObj, err := runtime.Decode(decoder, scaleBytes) if err != nil { return nil, err } // convert whatever this is to autoscaling/v1.Scale - scaleObj, err := scaleConverter.ConvertToVersion(rawObj, autoscaling.SchemeGroupVersion) + scaleObj, err := scaleConverter.ConvertToVersion(rawScaleObj, autoscaling.SchemeGroupVersion) if err != nil { return nil, fmt.Errorf("received an object from a /scale endpoint which was not convertible to autoscaling Scale: %v", err) } @@ -158,8 +167,8 @@ func (c *namespacedScaleClient) Update(resource schema.GroupResource, scale *aut } // Currently, a /scale endpoint can receive and return different scale types. - // Until we hvae support for the alternative API representations proposal, - // we need to deal with sending and accepting differnet API versions. + // Until we have support for the alternative API representations proposal, + // we need to deal with sending and accepting different API versions. // figure out what scale we actually need here desiredGVK, err := c.client.scaleKindResolver.ScaleForResource(gvr) @@ -170,25 +179,38 @@ func (c *namespacedScaleClient) Update(resource schema.GroupResource, scale *aut // convert this to whatever this endpoint wants scaleUpdate, err := scaleConverter.ConvertToVersion(scale, desiredGVK.GroupVersion()) if err != nil { - return nil, fmt.Errorf("could not convert scale update to internal Scale: %v", err) + return nil, fmt.Errorf("could not convert scale update to external Scale: %v", err) + } + encoder := scaleConverter.codecs.LegacyCodec(desiredGVK.GroupVersion()) + scaleUpdateBytes, err := runtime.Encode(encoder, scaleUpdate) + if err != nil { + return nil, fmt.Errorf("could not encode scale update to external Scale: %v", err) } - rawObj, err := c.client.clientBase.Put(). + result := c.client.clientBase.Put(). AbsPath(path). Namespace(c.namespace). Resource(gvr.Resource). Name(scale.Name). SubResource("scale"). - Body(scaleUpdate). - Do(). - Get() + Body(scaleUpdateBytes). + Do() + if err := result.Error(); err != nil { + return nil, fmt.Errorf("could not update the scale for %s %s: %v", resource.String(), scale.Name, err) + } + scaleBytes, err := result.Raw() + if err != nil { + return nil, err + } + decoder := scaleConverter.codecs.UniversalDecoder(scaleConverter.ScaleVersions()...) + rawScaleObj, err := runtime.Decode(decoder, scaleBytes) if err != nil { - return nil, fmt.Errorf("could not fetch the scale for %s %s: %v", resource.String(), scale.Name, err) + return nil, err } // convert whatever this is back to autoscaling/v1.Scale - scaleObj, err := scaleConverter.ConvertToVersion(rawObj, autoscaling.SchemeGroupVersion) + scaleObj, err := scaleConverter.ConvertToVersion(rawScaleObj, autoscaling.SchemeGroupVersion) if err != nil { return nil, fmt.Errorf("received an object from a /scale endpoint which was not convertible to autoscaling Scale: %v", err) } diff --git a/vendor/k8s.io/client-go/scale/client_test.go b/vendor/k8s.io/client-go/scale/client_test.go index f4f2af3d6..6301320f3 100644 --- a/vendor/k8s.io/client-go/scale/client_test.go +++ b/vendor/k8s.io/client-go/scale/client_test.go @@ -99,7 +99,7 @@ func fakeScaleClient(t *testing.T) (ScalesGetter, []schema.GroupResource) { restMapperRes, err := discovery.GetAPIGroupResources(fakeDiscoveryClient) if err != nil { - t.Fatalf("unexpected error while constructing resource list from fake discovery client: %v") + t.Fatalf("unexpected error while constructing resource list from fake discovery client: %v", err) } restMapper := discovery.NewRESTMapper(restMapperRes, apimeta.InterfacesForUnstructured) diff --git a/vendor/k8s.io/client-go/scale/roundtrip_test.go b/vendor/k8s.io/client-go/scale/roundtrip_test.go index 2ea288757..2d3b28bf6 100644 --- a/vendor/k8s.io/client-go/scale/roundtrip_test.go +++ b/vendor/k8s.io/client-go/scale/roundtrip_test.go @@ -23,7 +23,7 @@ import ( ) // NB: this can't be in the scheme package, because importing' -// scheme/autoscalingv1 from scheme causes a depedency loop from +// scheme/autoscalingv1 from scheme causes a dependency loop from // conversions func TestRoundTrip(t *testing.T) { diff --git a/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go b/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go index 5b1d6841c..16f29e2af 100644 --- a/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go +++ b/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go @@ -17,6 +17,6 @@ limitations under the License. // Package appsint contains the necessary scaffolding of the // internal version of extensions as required by conversion logic. // It doesn't have any of its own types -- it's just necessary to -// get the expected behavoir out of runtime.Scheme.ConvertToVersion +// get the expected behavior out of runtime.Scheme.ConvertToVersion // and associated methods. package appsint diff --git a/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go index 93e0e6164..bd42e7add 100644 --- a/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package appsv1beta1 diff --git a/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go index 410a0d90c..d6afedb0d 100644 --- a/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package appsv1beta2 diff --git a/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go index 1eaa0d180..2a7a45a47 100644 --- a/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package autoscalingv1 diff --git a/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go b/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go index cc92bf188..9aaac6086 100644 --- a/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go +++ b/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go @@ -17,6 +17,6 @@ limitations under the License. // Package extensionsint contains the necessary scaffolding of the // internal version of extensions as required by conversion logic. // It doesn't have any of its own types -- it's just necessary to -// get the expected behavoir out of runtime.Scheme.ConvertToVersion +// get the expected behavior out of runtime.Scheme.ConvertToVersion // and associated methods. package extensionsint diff --git a/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go index 848cb8d2a..6d0ed7a29 100644 --- a/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package extensionsv1beta1 diff --git a/vendor/k8s.io/client-go/scale/scheme/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/scale/scheme/zz_generated.deepcopy.go index 19b679583..d34399667 100644 --- a/vendor/k8s.io/client-go/scale/scheme/zz_generated.deepcopy.go +++ b/vendor/k8s.io/client-go/scale/scheme/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package scheme @@ -49,9 +49,8 @@ func (in *Scale) DeepCopy() *Scale { func (in *Scale) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/client-go/scale/util.go b/vendor/k8s.io/client-go/scale/util.go index 9eb108536..46b5c4d1e 100644 --- a/vendor/k8s.io/client-go/scale/util.go +++ b/vendor/k8s.io/client-go/scale/util.go @@ -23,6 +23,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/client-go/discovery" scalescheme "k8s.io/client-go/scale/scheme" scaleappsint "k8s.io/client-go/scale/scheme/appsint" @@ -124,6 +125,7 @@ func NewDiscoveryScaleKindResolver(client discovery.ServerResourcesInterface) Sc // ScaleConverter knows how to convert between external scale versions. type ScaleConverter struct { scheme *runtime.Scheme + codecs serializer.CodecFactory internalVersioner runtime.GroupVersioner } @@ -141,6 +143,7 @@ func NewScaleConverter() *ScaleConverter { return &ScaleConverter{ scheme: scheme, + codecs: serializer.NewCodecFactory(scheme), internalVersioner: runtime.NewMultiGroupVersioner( scalescheme.SchemeGroupVersion, schema.GroupKind{Group: scaleext.GroupName, Kind: "Scale"}, @@ -156,6 +159,22 @@ func (c *ScaleConverter) Scheme() *runtime.Scheme { return c.scheme } +func (c *ScaleConverter) Codecs() serializer.CodecFactory { + return c.codecs +} + +func (c *ScaleConverter) ScaleVersions() []schema.GroupVersion { + return []schema.GroupVersion{ + scaleautoscaling.SchemeGroupVersion, + scalescheme.SchemeGroupVersion, + scaleext.SchemeGroupVersion, + scaleextint.SchemeGroupVersion, + scaleappsint.SchemeGroupVersion, + scaleappsv1beta1.SchemeGroupVersion, + scaleappsv1beta2.SchemeGroupVersion, + } +} + // ConvertToVersion converts the given *external* input object to the given output *external* output group-version. func (c *ScaleConverter) ConvertToVersion(in runtime.Object, outVersion schema.GroupVersion) (runtime.Object, error) { scaleInt, err := c.scheme.ConvertToVersion(in, c.internalVersioner) diff --git a/vendor/k8s.io/client-go/testing/BUILD b/vendor/k8s.io/client-go/testing/BUILD index b26e66287..dd8d13397 100644 --- a/vendor/k8s.io/client-go/testing/BUILD +++ b/vendor/k8s.io/client-go/testing/BUILD @@ -3,6 +3,7 @@ package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", "go_library", + "go_test", ) go_library( @@ -28,6 +29,23 @@ go_library( ], ) +go_test( + name = "go_default_test", + srcs = [ + "fixture_test.go", + ], + embed = [":go_default_library"], + deps = [ + "//vendor/github.com/stretchr/testify/assert:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", + ], +) + filegroup( name = "package-srcs", srcs = glob(["**"]), diff --git a/vendor/k8s.io/client-go/testing/fixture.go b/vendor/k8s.io/client-go/testing/fixture.go index 08379fb08..ba8ee508f 100644 --- a/vendor/k8s.io/client-go/testing/fixture.go +++ b/vendor/k8s.io/client-go/testing/fixture.go @@ -29,6 +29,11 @@ import ( restclient "k8s.io/client-go/rest" ) +// FakeWatchBufferSize is the max num of watch event can be buffered in the +// watch channel. Note that when watch event overflows or exceed this buffer +// size, manipulations via fake client may be blocked. +const FakeWatchBufferSize = 128 + // ObjectTracker keeps track of objects. It is intended to be used to // fake calls to a server by returning objects based on their kind, // namespace and name. @@ -54,6 +59,10 @@ type ObjectTracker interface { // didn't exist in the tracker prior to deletion, Delete returns // no error. Delete(gvr schema.GroupVersionResource, ns, name string) error + + // Watch watches objects from the tracker. Watch returns a channel + // which will push added / modified / deleted object. + Watch(gvr schema.GroupVersionResource, ns string) (watch.Interface, error) } // ObjectScheme abstracts the implementation of common operations on objects. @@ -132,6 +141,13 @@ type tracker struct { decoder runtime.Decoder lock sync.RWMutex objects map[schema.GroupVersionResource][]runtime.Object + // The value type of watchers is a map of which the key is either a namespace or + // all/non namespace aka "" and its value is list of fake watchers. Each of + // fake watcher holds a buffered channel of size "FakeWatchBufferSize" which + // is default to 128. Manipulations on resources will broadcast the notification + // events into the watchers' channel and note that too many unhandled event may + // potentially block the tracker. + watchers map[schema.GroupVersionResource]map[string][]*watch.FakeWatcher } var _ ObjectTracker = &tracker{} @@ -140,9 +156,10 @@ var _ ObjectTracker = &tracker{} // of objects for the fake clientset. Mostly useful for unit tests. func NewObjectTracker(scheme ObjectScheme, decoder runtime.Decoder) ObjectTracker { return &tracker{ - scheme: scheme, - decoder: decoder, - objects: make(map[schema.GroupVersionResource][]runtime.Object), + scheme: scheme, + decoder: decoder, + objects: make(map[schema.GroupVersionResource][]runtime.Object), + watchers: make(map[schema.GroupVersionResource]map[string][]*watch.FakeWatcher), } } @@ -185,6 +202,19 @@ func (t *tracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionK return list.DeepCopyObject(), nil } +func (t *tracker) Watch(gvr schema.GroupVersionResource, ns string) (watch.Interface, error) { + t.lock.Lock() + defer t.lock.Unlock() + + fakewatcher := watch.NewFakeWithChanSize(FakeWatchBufferSize, true) + + if _, exists := t.watchers[gvr]; !exists { + t.watchers[gvr] = make(map[string][]*watch.FakeWatcher) + } + t.watchers[gvr][ns] = append(t.watchers[gvr][ns], fakewatcher) + return fakewatcher, nil +} + func (t *tracker) Get(gvr schema.GroupVersionResource, ns, name string) (runtime.Object, error) { errNotFound := errors.NewNotFound(gvr.GroupResource(), name) @@ -263,6 +293,19 @@ func (t *tracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns return t.add(gvr, obj, ns, true) } +func (t *tracker) getWatches(gvr schema.GroupVersionResource, ns string) []*watch.FakeWatcher { + watches := []*watch.FakeWatcher{} + if t.watchers[gvr] != nil { + if w := t.watchers[gvr][ns]; w != nil { + watches = append(watches, w...) + } + if w := t.watchers[gvr][""]; w != nil { + watches = append(watches, w...) + } + } + return watches +} + func (t *tracker) add(gvr schema.GroupVersionResource, obj runtime.Object, ns string, replaceExisting bool) error { t.lock.Lock() defer t.lock.Unlock() @@ -296,6 +339,9 @@ func (t *tracker) add(gvr schema.GroupVersionResource, obj runtime.Object, ns st } if oldMeta.GetNamespace() == newMeta.GetNamespace() && oldMeta.GetName() == newMeta.GetName() { if replaceExisting { + for _, w := range t.getWatches(gvr, ns) { + w.Modify(obj) + } t.objects[gvr][i] = obj return nil } @@ -310,6 +356,10 @@ func (t *tracker) add(gvr schema.GroupVersionResource, obj runtime.Object, ns st t.objects[gvr] = append(t.objects[gvr], obj) + for _, w := range t.getWatches(gvr, ns) { + w.Add(obj) + } + return nil } @@ -342,7 +392,11 @@ func (t *tracker) Delete(gvr schema.GroupVersionResource, ns, name string) error return err } if objMeta.GetNamespace() == ns && objMeta.GetName() == name { + obj := t.objects[gvr][i] t.objects[gvr] = append(t.objects[gvr][:i], t.objects[gvr][i+1:]...) + for _, w := range t.getWatches(gvr, ns) { + w.Delete(obj) + } found = true break } diff --git a/vendor/k8s.io/client-go/testing/fixture_test.go b/vendor/k8s.io/client-go/testing/fixture_test.go new file mode 100644 index 000000000..967e0aefa --- /dev/null +++ b/vendor/k8s.io/client-go/testing/fixture_test.go @@ -0,0 +1,192 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testing + +import ( + "fmt" + "math/rand" + "strconv" + "sync" + "testing" + + "github.com/stretchr/testify/assert" + + "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/apimachinery/pkg/watch" +) + +func getArbitraryResource(s schema.GroupVersionResource, name, namespace string) *unstructured.Unstructured { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "kind": s.Resource, + "apiVersion": s.Version, + "metadata": map[string]interface{}{ + "name": name, + "namespace": namespace, + "generateName": "test_generateName", + "uid": "test_uid", + "resourceVersion": "test_resourceVersion", + "selfLink": "test_selfLink", + }, + "data": strconv.Itoa(rand.Int()), + }, + } +} + +func TestWatchCallNonNamespace(t *testing.T) { + testResource := schema.GroupVersionResource{Group: "", Version: "test_version", Resource: "test_kind"} + testObj := getArbitraryResource(testResource, "test_name", "test_namespace") + accessor, err := meta.Accessor(testObj) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + ns := accessor.GetNamespace() + scheme := runtime.NewScheme() + codecs := serializer.NewCodecFactory(scheme) + o := NewObjectTracker(scheme, codecs.UniversalDecoder()) + watch, err := o.Watch(testResource, ns) + go func() { + err := o.Create(testResource, testObj, ns) + if err != nil { + t.Errorf("test resource creation failed: %v", err) + } + }() + out := <-watch.ResultChan() + assert.Equal(t, testObj, out.Object, "watched object mismatch") +} + +func TestWatchCallAllNamespace(t *testing.T) { + testResource := schema.GroupVersionResource{Group: "", Version: "test_version", Resource: "test_kind"} + testObj := getArbitraryResource(testResource, "test_name", "test_namespace") + accessor, err := meta.Accessor(testObj) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + ns := accessor.GetNamespace() + scheme := runtime.NewScheme() + codecs := serializer.NewCodecFactory(scheme) + o := NewObjectTracker(scheme, codecs.UniversalDecoder()) + w, err := o.Watch(testResource, "test_namespace") + wAll, err := o.Watch(testResource, "") + go func() { + err := o.Create(testResource, testObj, ns) + assert.NoError(t, err, "test resource creation failed") + }() + out := <-w.ResultChan() + outAll := <-wAll.ResultChan() + assert.Equal(t, watch.Added, out.Type, "watch event mismatch") + assert.Equal(t, watch.Added, outAll.Type, "watch event mismatch") + assert.Equal(t, testObj, out.Object, "watched created object mismatch") + assert.Equal(t, testObj, outAll.Object, "watched created object mismatch") + go func() { + err := o.Update(testResource, testObj, ns) + assert.NoError(t, err, "test resource updating failed") + }() + out = <-w.ResultChan() + outAll = <-wAll.ResultChan() + assert.Equal(t, watch.Modified, out.Type, "watch event mismatch") + assert.Equal(t, watch.Modified, outAll.Type, "watch event mismatch") + assert.Equal(t, testObj, out.Object, "watched updated object mismatch") + assert.Equal(t, testObj, outAll.Object, "watched updated object mismatch") + go func() { + err := o.Delete(testResource, "test_namespace", "test_name") + assert.NoError(t, err, "test resource deletion failed") + }() + out = <-w.ResultChan() + outAll = <-wAll.ResultChan() + assert.Equal(t, watch.Deleted, out.Type, "watch event mismatch") + assert.Equal(t, watch.Deleted, outAll.Type, "watch event mismatch") + assert.Equal(t, testObj, out.Object, "watched deleted object mismatch") + assert.Equal(t, testObj, outAll.Object, "watched deleted object mismatch") +} + +func TestWatchCallMultipleInvocation(t *testing.T) { + cases := []struct { + name string + op watch.EventType + }{ + { + "foo", + watch.Added, + }, + { + "bar", + watch.Added, + }, + { + "bar", + watch.Modified, + }, + { + "foo", + watch.Deleted, + }, + { + "bar", + watch.Deleted, + }, + } + + scheme := runtime.NewScheme() + codecs := serializer.NewCodecFactory(scheme) + testResource := schema.GroupVersionResource{Group: "", Version: "test_version", Resource: "test_kind"} + + o := NewObjectTracker(scheme, codecs.UniversalDecoder()) + watchNamespaces := []string{ + "", + "", + "test_namespace", + "test_namespace", + } + var wg sync.WaitGroup + wg.Add(len(watchNamespaces)) + for idx, watchNamespace := range watchNamespaces { + i := idx + w, err := o.Watch(testResource, watchNamespace) + go func() { + assert.NoError(t, err, "watch invocation failed") + for _, c := range cases { + fmt.Printf("%#v %#v\n", c, i) + event := <-w.ResultChan() + accessor, err := meta.Accessor(event.Object) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + assert.Equal(t, c.op, event.Type, "watch event mismatched") + assert.Equal(t, c.name, accessor.GetName(), "watched object mismatch") + } + wg.Done() + }() + } + for _, c := range cases { + switch c.op { + case watch.Added: + obj := getArbitraryResource(testResource, c.name, "test_namespace") + o.Create(testResource, obj, "test_namespace") + case watch.Modified: + obj := getArbitraryResource(testResource, c.name, "test_namespace") + o.Update(testResource, obj, "test_namespace") + case watch.Deleted: + o.Delete(testResource, "test_namespace", c.name) + } + } + wg.Wait() +} diff --git a/vendor/k8s.io/client-go/tools/auth/BUILD b/vendor/k8s.io/client-go/tools/auth/BUILD index b418469ef..5c7718a77 100644 --- a/vendor/k8s.io/client-go/tools/auth/BUILD +++ b/vendor/k8s.io/client-go/tools/auth/BUILD @@ -16,7 +16,6 @@ go_library( go_test( name = "go_default_xtest", srcs = ["clientauth_test.go"], - importpath = "k8s.io/client-go/tools/auth_test", deps = ["//vendor/k8s.io/client-go/tools/auth:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/tools/auth/clientauth.go b/vendor/k8s.io/client-go/tools/auth/clientauth.go index 2213b9878..20339ab9d 100644 --- a/vendor/k8s.io/client-go/tools/auth/clientauth.go +++ b/vendor/k8s.io/client-go/tools/auth/clientauth.go @@ -23,7 +23,7 @@ location within a Container's file tree for Containers that need access to the Kubernetes API. Having a defined format allows: - - clients to be implmented in multiple languages + - clients to be implemented in multiple languages - applications which link clients to be portable across clusters with different authentication styles (e.g. some may use SSL Client certs, others may not, etc) diff --git a/vendor/k8s.io/client-go/tools/bootstrap/token/api/BUILD b/vendor/k8s.io/client-go/tools/bootstrap/token/api/BUILD new file mode 100644 index 000000000..7416adc01 --- /dev/null +++ b/vendor/k8s.io/client-go/tools/bootstrap/token/api/BUILD @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "types.go", + ], + importpath = "k8s.io/client-go/tools/bootstrap/token/api", + visibility = ["//visibility:public"], + deps = ["//vendor/k8s.io/api/core/v1:go_default_library"], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/client-go/tools/bootstrap/token/api/OWNERS b/vendor/k8s.io/client-go/tools/bootstrap/token/api/OWNERS new file mode 100644 index 000000000..8a2f5b591 --- /dev/null +++ b/vendor/k8s.io/client-go/tools/bootstrap/token/api/OWNERS @@ -0,0 +1,5 @@ +approvers: +- jbeda +- luxas +reviewers: +- mattmoyer diff --git a/vendor/k8s.io/client-go/tools/bootstrap/token/api/doc.go b/vendor/k8s.io/client-go/tools/bootstrap/token/api/doc.go new file mode 100644 index 000000000..b9910c35a --- /dev/null +++ b/vendor/k8s.io/client-go/tools/bootstrap/token/api/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package api (pkg/bootstrap/token/api) contains constants and types needed for +// bootstrap tokens as maintained by the BootstrapSigner and TokenCleaner +// controllers (in pkg/controller/bootstrap) +package api // import "k8s.io/client-go/tools/bootstrap/token/api" diff --git a/vendor/k8s.io/client-go/tools/bootstrap/token/api/types.go b/vendor/k8s.io/client-go/tools/bootstrap/token/api/types.go new file mode 100644 index 000000000..c30814c0e --- /dev/null +++ b/vendor/k8s.io/client-go/tools/bootstrap/token/api/types.go @@ -0,0 +1,100 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package api + +import ( + "k8s.io/api/core/v1" +) + +const ( + // BootstrapTokenSecretPrefix is the prefix for bootstrap token names. + // Bootstrap tokens secrets must be named in the form + // `bootstrap-token-`. This is the prefix to be used before the + // token ID. + BootstrapTokenSecretPrefix = "bootstrap-token-" + + // SecretTypeBootstrapToken is used during the automated bootstrap process (first + // implemented by kubeadm). It stores tokens that are used to sign well known + // ConfigMaps. They may also eventually be used for authentication. + SecretTypeBootstrapToken v1.SecretType = "bootstrap.kubernetes.io/token" + + // BootstrapTokenIDKey is the id of this token. This can be transmitted in the + // clear and encoded in the name of the secret. It must be a random 6 character + // string that matches the regexp `^([a-z0-9]{6})$`. Required. + BootstrapTokenIDKey = "token-id" + + // BootstrapTokenSecretKey is the actual secret. It must be a random 16 character + // string that matches the regexp `^([a-z0-9]{16})$`. Required. + BootstrapTokenSecretKey = "token-secret" + + // BootstrapTokenExpirationKey is when this token should be expired and no + // longer used. A controller will delete this resource after this time. This + // is an absolute UTC time using RFC3339. If this cannot be parsed, the token + // should be considered invalid. Optional. + BootstrapTokenExpirationKey = "expiration" + + // BootstrapTokenDescriptionKey is a description in human-readable format that + // describes what the bootstrap token is used for. Optional. + BootstrapTokenDescriptionKey = "description" + + // BootstrapTokenExtraGroupsKey is a comma-separated list of group names. + // The bootstrap token will authenticate as these groups in addition to the + // "system:bootstrappers" group. + BootstrapTokenExtraGroupsKey = "auth-extra-groups" + + // BootstrapTokenUsagePrefix is the prefix for the other usage constants that specifies different + // functions of a bootstrap token + BootstrapTokenUsagePrefix = "usage-bootstrap-" + + // BootstrapTokenUsageSigningKey signals that this token should be used to + // sign configs as part of the bootstrap process. Value must be "true". Any + // other value is assumed to be false. Optional. + BootstrapTokenUsageSigningKey = "usage-bootstrap-signing" + + // BootstrapTokenUsageAuthentication signals that this token should be used + // as a bearer token to authenticate against the Kubernetes API. The bearer + // token takes the form "." and authenticates as the + // user "system:bootstrap:" in the "system:bootstrappers" group + // as well as any groups specified using BootstrapTokenExtraGroupsKey. + // Value must be "true". Any other value is assumed to be false. Optional. + BootstrapTokenUsageAuthentication = "usage-bootstrap-authentication" + + // ConfigMapClusterInfo defines the name for the ConfigMap where the information how to connect and trust the cluster exist + ConfigMapClusterInfo = "cluster-info" + + // KubeConfigKey defines at which key in the Data object of the ConfigMap the KubeConfig object is stored + KubeConfigKey = "kubeconfig" + + // JWSSignatureKeyPrefix defines what key prefix the JWS-signed tokens have + JWSSignatureKeyPrefix = "jws-kubeconfig-" + + // BootstrapUserPrefix is the username prefix bootstrapping bearer tokens + // authenticate as. The full username given is "system:bootstrap:". + BootstrapUserPrefix = "system:bootstrap:" + + // BootstrapGroupPattern is the valid regex pattern that all groups + // assigned to a bootstrap token by BootstrapTokenExtraGroupsKey must match. + // See also ValidateBootstrapGroupName(). + BootstrapGroupPattern = "system:bootstrappers:[a-z0-9:-]{0,255}[a-z0-9]" + + // BootstrapDefaultGroup is the default group for bootstrapping bearer + // tokens (in addition to any groups from BootstrapTokenExtraGroupsKey). + BootstrapDefaultGroup = "system:bootstrappers" +) + +// KnownTokenUsages specifies the known functions a token will get. +var KnownTokenUsages = []string{"signing", "authentication"} diff --git a/vendor/k8s.io/client-go/tools/bootstrap/token/util/BUILD b/vendor/k8s.io/client-go/tools/bootstrap/token/util/BUILD new file mode 100644 index 000000000..1d4d10e99 --- /dev/null +++ b/vendor/k8s.io/client-go/tools/bootstrap/token/util/BUILD @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = ["helpers.go"], + importpath = "k8s.io/client-go/tools/bootstrap/token/util", + visibility = ["//visibility:public"], + deps = [ + "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", + "//vendor/k8s.io/client-go/tools/bootstrap/token/api:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = ["helpers_test.go"], + embed = [":go_default_library"], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/client-go/tools/bootstrap/token/util/helpers.go b/vendor/k8s.io/client-go/tools/bootstrap/token/util/helpers.go new file mode 100644 index 000000000..d28fd28f2 --- /dev/null +++ b/vendor/k8s.io/client-go/tools/bootstrap/token/util/helpers.go @@ -0,0 +1,52 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package util + +import ( + "fmt" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/client-go/tools/bootstrap/token/api" + "regexp" + "strings" +) + +var bootstrapGroupRegexp = regexp.MustCompile(`\A` + api.BootstrapGroupPattern + `\z`) + +// ValidateBootstrapGroupName checks if the provided group name is a valid +// bootstrap group name. Returns nil if valid or a validation error if invalid. +// TODO(mattmoyer): this validation should migrate out to client-go (see https://github.com/kubernetes/client-go/issues/114) +func ValidateBootstrapGroupName(name string) error { + if bootstrapGroupRegexp.Match([]byte(name)) { + return nil + } + return fmt.Errorf("bootstrap group %q is invalid (must match %s)", name, api.BootstrapGroupPattern) +} + +// ValidateUsages validates that the passed in string are valid usage strings for bootstrap tokens. +func ValidateUsages(usages []string) error { + validUsages := sets.NewString(api.KnownTokenUsages...) + invalidUsages := sets.NewString() + for _, usage := range usages { + if !validUsages.Has(usage) { + invalidUsages.Insert(usage) + } + } + if len(invalidUsages) > 0 { + return fmt.Errorf("invalide bootstrap token usage string: %s, valid usage options: %s", strings.Join(invalidUsages.List(), ","), strings.Join(api.KnownTokenUsages, ",")) + } + return nil +} diff --git a/vendor/k8s.io/client-go/tools/bootstrap/token/util/helpers_test.go b/vendor/k8s.io/client-go/tools/bootstrap/token/util/helpers_test.go new file mode 100644 index 000000000..915bf7540 --- /dev/null +++ b/vendor/k8s.io/client-go/tools/bootstrap/token/util/helpers_test.go @@ -0,0 +1,76 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package util + +import ( + "strings" + "testing" +) + +func TestValidateBootstrapGroupName(t *testing.T) { + tests := []struct { + name string + input string + valid bool + }{ + {"valid", "system:bootstrappers:foo", true}, + {"valid nested", "system:bootstrappers:foo:bar:baz", true}, + {"valid with dashes and number", "system:bootstrappers:foo-bar-42", true}, + {"invalid uppercase", "system:bootstrappers:Foo", false}, + {"missing prefix", "foo", false}, + {"prefix with no body", "system:bootstrappers:", false}, + {"invalid spaces", "system:bootstrappers: ", false}, + {"invalid asterisk", "system:bootstrappers:*", false}, + {"trailing colon", "system:bootstrappers:foo:", false}, + {"trailing dash", "system:bootstrappers:foo-", false}, + {"script tags", "system:bootstrappers:", false}, + {"too long", "system:bootstrappers:" + strings.Repeat("x", 300), false}, + } + for _, test := range tests { + err := ValidateBootstrapGroupName(test.input) + if err != nil && test.valid { + t.Errorf("test %q: ValidateBootstrapGroupName(%q) returned unexpected error: %v", test.name, test.input, err) + } + if err == nil && !test.valid { + t.Errorf("test %q: ValidateBootstrapGroupName(%q) was supposed to return an error but didn't", test.name, test.input) + } + } +} + +func TestValidateUsages(t *testing.T) { + tests := []struct { + name string + input []string + valid bool + }{ + {"valid of signing", []string{"signing"}, true}, + {"valid of authentication", []string{"authentication"}, true}, + {"all valid", []string{"authentication", "signing"}, true}, + {"single invalid", []string{"authentication", "foo"}, false}, + {"all invalid", []string{"foo", "bar"}, false}, + } + + for _, test := range tests { + err := ValidateUsages(test.input) + if err != nil && test.valid { + t.Errorf("test %q: ValidateUsages(%v) returned unexpected error: %v", test.name, test.input, err) + } + if err == nil && !test.valid { + t.Errorf("test %q: ValidateUsages(%v) was supposed to return an error but didn't", test.name, test.input) + } + } +} diff --git a/vendor/k8s.io/client-go/tools/cache/BUILD b/vendor/k8s.io/client-go/tools/cache/BUILD index 79e21e1ea..524354e87 100644 --- a/vendor/k8s.io/client-go/tools/cache/BUILD +++ b/vendor/k8s.io/client-go/tools/cache/BUILD @@ -22,9 +22,8 @@ go_test( "store_test.go", "undelta_store_test.go", ], - features = ["-race"], - importpath = "k8s.io/client-go/tools/cache", - library = ":go_default_library", + embed = [":go_default_library"], + race = "off", deps = [ "//vendor/github.com/google/gofuzz:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", @@ -83,6 +82,7 @@ go_library( "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/tools/pager:go_default_library", "//vendor/k8s.io/client-go/util/buffer:go_default_library", + "//vendor/k8s.io/client-go/util/retry:go_default_library", ], ) diff --git a/vendor/k8s.io/client-go/tools/cache/controller.go b/vendor/k8s.io/client-go/tools/cache/controller.go index e7b98befa..028c75e8e 100644 --- a/vendor/k8s.io/client-go/tools/cache/controller.go +++ b/vendor/k8s.io/client-go/tools/cache/controller.go @@ -288,7 +288,7 @@ func NewInformer( // This will hold incoming changes. Note how we pass clientState in as a // KeyLister, that way resync operations will result in the correct set // of update/delete deltas. - fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, nil, clientState) + fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, clientState) cfg := &Config{ Queue: fifo, @@ -355,7 +355,7 @@ func NewIndexerInformer( // This will hold incoming changes. Note how we pass clientState in as a // KeyLister, that way resync operations will result in the correct set // of update/delete deltas. - fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, nil, clientState) + fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, clientState) cfg := &Config{ Queue: fifo, diff --git a/vendor/k8s.io/client-go/tools/cache/controller_test.go b/vendor/k8s.io/client-go/tools/cache/controller_test.go index a7a70533f..64aca8d7d 100644 --- a/vendor/k8s.io/client-go/tools/cache/controller_test.go +++ b/vendor/k8s.io/client-go/tools/cache/controller_test.go @@ -44,7 +44,7 @@ func Example() { // This will hold incoming changes. Note how we pass downstream in as a // KeyLister, that way resync operations will result in the correct set // of update/delete deltas. - fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, nil, downstream) + fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, downstream) // Let's do threadsafe output to get predictable test results. deletionCounter := make(chan string, 1000) diff --git a/vendor/k8s.io/client-go/tools/cache/delta_fifo.go b/vendor/k8s.io/client-go/tools/cache/delta_fifo.go index f06d1c5b1..45c3b500d 100644 --- a/vendor/k8s.io/client-go/tools/cache/delta_fifo.go +++ b/vendor/k8s.io/client-go/tools/cache/delta_fifo.go @@ -31,11 +31,6 @@ import ( // keyFunc is used to figure out what key an object should have. (It's // exposed in the returned DeltaFIFO's KeyOf() method, with bonus features.) // -// 'compressor' may compress as many or as few items as it wants -// (including returning an empty slice), but it should do what it -// does quickly since it is called while the queue is locked. -// 'compressor' may be nil if you don't want any delta compression. -// // 'keyLister' is expected to return a list of keys that the consumer of // this queue "knows about". It is used to decide which items are missing // when Replace() is called; 'Deleted' deltas are produced for these items. @@ -43,18 +38,30 @@ import ( // TODO: consider merging keyLister with this object, tracking a list of // "known" keys when Pop() is called. Have to think about how that // affects error retrying. -// TODO(lavalamp): I believe there is a possible race only when using an -// external known object source that the above TODO would -// fix. +// NOTE: It is possible to misuse this and cause a race when using an +// external known object source. +// Whether there is a potential race depends on how the comsumer +// modifies knownObjects. In Pop(), process function is called under +// lock, so it is safe to update data structures in it that need to be +// in sync with the queue (e.g. knownObjects). +// +// Example: +// In case of sharedIndexInformer being a consumer +// (https://github.com/kubernetes/kubernetes/blob/0cdd940f/staging/ +// src/k8s.io/client-go/tools/cache/shared_informer.go#L192), +// there is no race as knownObjects (s.indexer) is modified safely +// under DeltaFIFO's lock. The only exceptions are GetStore() and +// GetIndexer() methods, which expose ways to modify the underlying +// storage. Currently these two methods are used for creating Lister +// and internal tests. // // Also see the comment on DeltaFIFO. -func NewDeltaFIFO(keyFunc KeyFunc, compressor DeltaCompressor, knownObjects KeyListerGetter) *DeltaFIFO { +func NewDeltaFIFO(keyFunc KeyFunc, knownObjects KeyListerGetter) *DeltaFIFO { f := &DeltaFIFO{ - items: map[string]Deltas{}, - queue: []string{}, - keyFunc: keyFunc, - deltaCompressor: compressor, - knownObjects: knownObjects, + items: map[string]Deltas{}, + queue: []string{}, + keyFunc: keyFunc, + knownObjects: knownObjects, } f.cond.L = &f.lock return f @@ -86,9 +93,6 @@ func NewDeltaFIFO(keyFunc KeyFunc, compressor DeltaCompressor, knownObjects KeyL // items have been deleted when Replace() or Delete() are called. The deleted // object will be included in the DeleteFinalStateUnknown markers. These objects // could be stale. -// -// You may provide a function to compress deltas (e.g., represent a -// series of Updates as a single Update). type DeltaFIFO struct { // lock/cond protects access to 'items' and 'queue'. lock sync.RWMutex @@ -110,10 +114,6 @@ type DeltaFIFO struct { // insertion and retrieval, and should be deterministic. keyFunc KeyFunc - // deltaCompressor tells us how to combine two or more - // deltas. It may be nil. - deltaCompressor DeltaCompressor - // knownObjects list keys that are "known", for the // purpose of figuring out which items have been deleted // when Replace() or Delete() is called. @@ -133,7 +133,6 @@ var ( var ( // ErrZeroLengthDeltasObject is returned in a KeyError if a Deltas // object with zero length is encountered (should be impossible, - // even if such an object is accidentally produced by a DeltaCompressor-- // but included for completeness). ErrZeroLengthDeltasObject = errors.New("0 length Deltas object; can't get key") ) @@ -213,8 +212,6 @@ func (f *DeltaFIFO) Delete(obj interface{}) error { if err == nil && !exists && !itemsExist { // Presumably, this was deleted when a relist happened. // Don't provide a second report of the same deletion. - // TODO(lavalamp): This may be racy-- we aren't properly locked - // with knownObjects. return nil } } @@ -305,8 +302,8 @@ func (f *DeltaFIFO) willObjectBeDeletedLocked(id string) bool { return len(deltas) > 0 && deltas[len(deltas)-1].Type == Deleted } -// queueActionLocked appends to the delta list for the object, calling -// f.deltaCompressor if needed. Caller must lock first. +// queueActionLocked appends to the delta list for the object. +// Caller must lock first. func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) error { id, err := f.KeyOf(obj) if err != nil { @@ -322,9 +319,6 @@ func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) err newDeltas := append(f.items[id], Delta{actionType, obj}) newDeltas = dedupDeltas(newDeltas) - if f.deltaCompressor != nil { - newDeltas = f.deltaCompressor.Compress(newDeltas) - } _, exists := f.items[id] if len(newDeltas) > 0 { @@ -334,8 +328,7 @@ func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) err f.items[id] = newDeltas f.cond.Broadcast() } else if exists { - // The compression step removed all deltas, so - // we need to remove this from our map (extra items + // We need to remove this from our map (extra items // in the queue are ignored if they are not in the // map). delete(f.items, id) @@ -355,8 +348,8 @@ func (f *DeltaFIFO) List() []interface{} { func (f *DeltaFIFO) listLocked() []interface{} { list := make([]interface{}, 0, len(f.items)) for _, item := range f.items { - // Copy item's slice so operations on this slice (delta - // compression) won't interfere with the object we return. + // Copy item's slice so operations on this slice + // won't interfere with the object we return. item = copyDeltas(item) list = append(list, item.Newest().Object) } @@ -394,8 +387,8 @@ func (f *DeltaFIFO) GetByKey(key string) (item interface{}, exists bool, err err defer f.lock.RUnlock() d, exists := f.items[key] if exists { - // Copy item's slice so operations on this slice (delta - // compression) won't interfere with the object we return. + // Copy item's slice so operations on this slice + // won't interfere with the object we return. d = copyDeltas(d) } return d, exists, nil @@ -503,8 +496,6 @@ func (f *DeltaFIFO) Replace(list []interface{}, resourceVersion string) error { } // Detect deletions not already in the queue. - // TODO(lavalamp): This may be racy-- we aren't properly locked - // with knownObjects. Unproven. knownKeys := f.knownObjects.ListKeys() queuedDeletions := 0 for _, k := range knownKeys { @@ -603,23 +594,6 @@ type KeyGetter interface { GetByKey(key string) (interface{}, bool, error) } -// DeltaCompressor is an algorithm that removes redundant changes. -type DeltaCompressor interface { - Compress(Deltas) Deltas -} - -// DeltaCompressorFunc should remove redundant changes; but changes that -// are redundant depend on one's desired semantics, so this is an -// injectable function. -// -// DeltaCompressorFunc adapts a raw function to be a DeltaCompressor. -type DeltaCompressorFunc func(Deltas) Deltas - -// Compress just calls dc. -func (dc DeltaCompressorFunc) Compress(d Deltas) Deltas { - return dc(d) -} - // DeltaType is the type of a change (addition, deletion, etc) type DeltaType string @@ -668,7 +642,7 @@ func (d Deltas) Newest() *Delta { // copyDeltas returns a shallow copy of d; that is, it copies the slice but not // the objects in the slice. This allows Get/List to return an object that we -// know won't be clobbered by a subsequent call to a delta compressor. +// know won't be clobbered by a subsequent modifications. func copyDeltas(d Deltas) Deltas { d2 := make(Deltas, len(d)) copy(d2, d) diff --git a/vendor/k8s.io/client-go/tools/cache/delta_fifo_test.go b/vendor/k8s.io/client-go/tools/cache/delta_fifo_test.go index 87bbdaeab..9f8e57580 100644 --- a/vendor/k8s.io/client-go/tools/cache/delta_fifo_test.go +++ b/vendor/k8s.io/client-go/tools/cache/delta_fifo_test.go @@ -51,7 +51,7 @@ func (kl keyLookupFunc) GetByKey(key string) (interface{}, bool, error) { } func TestDeltaFIFO_basic(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) const amount = 500 go func() { for i := 0; i < amount; i++ { @@ -86,7 +86,7 @@ func TestDeltaFIFO_basic(t *testing.T) { } func TestDeltaFIFO_requeueOnPop(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("foo", 10)) _, err := f.Pop(func(obj interface{}) error { @@ -129,43 +129,8 @@ func TestDeltaFIFO_requeueOnPop(t *testing.T) { } } -func TestDeltaFIFO_compressorWorks(t *testing.T) { - oldestTypes := []DeltaType{} - f := NewDeltaFIFO( - testFifoObjectKeyFunc, - // This function just keeps the most recent delta - // and puts deleted ones in the list. - DeltaCompressorFunc(func(d Deltas) Deltas { - if n := len(d); n > 1 { - oldestTypes = append(oldestTypes, d[0].Type) - d = d[1:] - } - return d - }), - nil, - ) - if f.HasSynced() { - t.Errorf("Expected HasSynced to be false before completion of initial population") - } - f.Add(mkFifoObj("foo", 10)) - f.Update(mkFifoObj("foo", 12)) - f.Replace([]interface{}{mkFifoObj("foo", 20)}, "0") - f.Delete(mkFifoObj("foo", 22)) - f.Add(mkFifoObj("foo", 25)) // flush the last one out - expect := []DeltaType{Added, Updated, Sync, Deleted} - if e, a := expect, oldestTypes; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %#v, got %#v", e, a) - } - if e, a := (Deltas{{Added, mkFifoObj("foo", 25)}}), Pop(f).(Deltas); !reflect.DeepEqual(e, a) { - t.Fatalf("Expected %#v, got %#v", e, a) - } - if !f.HasSynced() { - t.Errorf("Expected HasSynced to be true after completion of initial population") - } -} - func TestDeltaFIFO_addUpdate(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("foo", 10)) f.Update(mkFifoObj("foo", 12)) f.Delete(mkFifoObj("foo", 15)) @@ -203,7 +168,7 @@ func TestDeltaFIFO_addUpdate(t *testing.T) { } func TestDeltaFIFO_enqueueingNoLister(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("foo", 10)) f.Update(mkFifoObj("bar", 15)) f.Add(mkFifoObj("qux", 17)) @@ -226,7 +191,6 @@ func TestDeltaFIFO_enqueueingNoLister(t *testing.T) { func TestDeltaFIFO_enqueueingWithLister(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), @@ -249,7 +213,7 @@ func TestDeltaFIFO_enqueueingWithLister(t *testing.T) { } func TestDeltaFIFO_addReplace(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("foo", 10)) f.Replace([]interface{}{mkFifoObj("foo", 15)}, "0") got := make(chan testFifoObject, 2) @@ -277,7 +241,6 @@ func TestDeltaFIFO_addReplace(t *testing.T) { func TestDeltaFIFO_ResyncNonExisting(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5)} }), @@ -297,7 +260,6 @@ func TestDeltaFIFO_ResyncNonExisting(t *testing.T) { func TestDeltaFIFO_DeleteExistingNonPropagated(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{} }), @@ -317,7 +279,6 @@ func TestDeltaFIFO_DeleteExistingNonPropagated(t *testing.T) { func TestDeltaFIFO_ReplaceMakesDeletions(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), @@ -344,7 +305,6 @@ func TestDeltaFIFO_ReplaceMakesDeletions(t *testing.T) { func TestDeltaFIFO_UpdateResyncRace(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5)} }), @@ -367,7 +327,6 @@ func TestDeltaFIFO_UpdateResyncRace(t *testing.T) { func TestDeltaFIFO_HasSyncedCorrectOnDeletion(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), @@ -396,7 +355,7 @@ func TestDeltaFIFO_HasSyncedCorrectOnDeletion(t *testing.T) { } func TestDeltaFIFO_detectLineJumpers(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("foo", 10)) f.Add(mkFifoObj("bar", 1)) @@ -424,7 +383,7 @@ func TestDeltaFIFO_detectLineJumpers(t *testing.T) { } func TestDeltaFIFO_addIfNotPresent(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("b", 3)) b3 := Pop(f) @@ -521,7 +480,7 @@ func TestDeltaFIFO_HasSynced(t *testing.T) { } for i, test := range tests { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) for _, action := range test.actions { action(f) diff --git a/vendor/k8s.io/client-go/tools/cache/fifo.go b/vendor/k8s.io/client-go/tools/cache/fifo.go index ef70b7aca..e05c01ee2 100644 --- a/vendor/k8s.io/client-go/tools/cache/fifo.go +++ b/vendor/k8s.io/client-go/tools/cache/fifo.go @@ -59,7 +59,7 @@ type Queue interface { // has since been added. AddIfNotPresent(interface{}) error - // Return true if the first batch of items has been popped + // HasSynced returns true if the first batch of items has been popped HasSynced() bool // Close queue diff --git a/vendor/k8s.io/client-go/tools/cache/listwatch.go b/vendor/k8s.io/client-go/tools/cache/listwatch.go index db2329c55..06657a3b0 100644 --- a/vendor/k8s.io/client-go/tools/cache/listwatch.go +++ b/vendor/k8s.io/client-go/tools/cache/listwatch.go @@ -63,8 +63,18 @@ type Getter interface { // NewListWatchFromClient creates a new ListWatch from the specified client, resource, namespace and field selector. func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSelector fields.Selector) *ListWatch { - listFunc := func(options metav1.ListOptions) (runtime.Object, error) { + optionsModifier := func(options *metav1.ListOptions) { options.FieldSelector = fieldSelector.String() + } + return NewFilteredListWatchFromClient(c, resource, namespace, optionsModifier) +} + +// NewFilteredListWatchFromClient creates a new ListWatch from the specified client, resource, namespace, and option modifier. +// Option modifier is a function takes a ListOptions and modifies the consumed ListOptions. Provide customized modifier function +// to apply modification to ListOptions with a field selector, a label selector, or any other desired options. +func NewFilteredListWatchFromClient(c Getter, resource string, namespace string, optionsModifier func(options *metav1.ListOptions)) *ListWatch { + listFunc := func(options metav1.ListOptions) (runtime.Object, error) { + optionsModifier(&options) return c.Get(). Namespace(namespace). Resource(resource). @@ -74,7 +84,7 @@ func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSe } watchFunc := func(options metav1.ListOptions) (watch.Interface, error) { options.Watch = true - options.FieldSelector = fieldSelector.String() + optionsModifier(&options) return c.Get(). Namespace(namespace). Resource(resource). diff --git a/vendor/k8s.io/client-go/tools/cache/reflector.go b/vendor/k8s.io/client-go/tools/cache/reflector.go index a97b5f98a..054a7373c 100644 --- a/vendor/k8s.io/client-go/tools/cache/reflector.go +++ b/vendor/k8s.io/client-go/tools/cache/reflector.go @@ -108,8 +108,8 @@ func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{}, reflectorSuffix := atomic.AddInt64(&reflectorDisambiguator, 1) r := &Reflector{ name: name, - // we need this to be unique per process (some names are still the same)but obvious who it belongs to - metrics: newReflectorMetrics(makeValidPromethusMetricLabel(fmt.Sprintf("reflector_"+name+"_%d", reflectorSuffix))), + // we need this to be unique per process (some names are still the same) but obvious who it belongs to + metrics: newReflectorMetrics(makeValidPrometheusMetricLabel(fmt.Sprintf("reflector_"+name+"_%d", reflectorSuffix))), listerWatcher: lw, store: store, expectedType: reflect.TypeOf(expectedType), @@ -120,7 +120,7 @@ func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{}, return r } -func makeValidPromethusMetricLabel(in string) string { +func makeValidPrometheusMetricLabel(in string) string { // this isn't perfect, but it removes our common characters return strings.NewReplacer("/", "_", ".", "_", "-", "_", ":", "_").Replace(in) } @@ -302,12 +302,12 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { default: } - timemoutseconds := int64(minWatchTimeout.Seconds() * (rand.Float64() + 1.0)) + timeoutSeconds := int64(minWatchTimeout.Seconds() * (rand.Float64() + 1.0)) options = metav1.ListOptions{ ResourceVersion: resourceVersion, // We want to avoid situations of hanging watchers. Stop any wachers that do not // receive any events within the timeout window. - TimeoutSeconds: &timemoutseconds, + TimeoutSeconds: &timeoutSeconds, } r.metrics.numberOfWatches.Inc() diff --git a/vendor/k8s.io/client-go/tools/cache/shared_informer.go b/vendor/k8s.io/client-go/tools/cache/shared_informer.go index b11f0ebdd..5f8c507f9 100644 --- a/vendor/k8s.io/client-go/tools/cache/shared_informer.go +++ b/vendor/k8s.io/client-go/tools/cache/shared_informer.go @@ -26,6 +26,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/util/buffer" + "k8s.io/client-go/util/retry" "github.com/golang/glog" ) @@ -188,7 +189,7 @@ type deleteNotification struct { func (s *sharedIndexInformer) Run(stopCh <-chan struct{}) { defer utilruntime.HandleCrash() - fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, nil, s.indexer) + fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, s.indexer) cfg := &Config{ Queue: fifo, @@ -334,7 +335,7 @@ func (s *sharedIndexInformer) AddEventHandlerWithResyncPeriod(handler ResourceEv s.blockDeltas.Lock() defer s.blockDeltas.Unlock() - s.processor.addAndStartListener(listener) + s.processor.addListener(listener) for _, item := range s.indexer.List() { listener.add(addNotification{newObj: item}) } @@ -372,6 +373,7 @@ func (s *sharedIndexInformer) HandleDeltas(obj interface{}) error { } type sharedProcessor struct { + listenersStarted bool listenersLock sync.RWMutex listeners []*processorListener syncingListeners []*processorListener @@ -379,20 +381,15 @@ type sharedProcessor struct { wg wait.Group } -func (p *sharedProcessor) addAndStartListener(listener *processorListener) { - p.listenersLock.Lock() - defer p.listenersLock.Unlock() - - p.addListenerLocked(listener) - p.wg.Start(listener.run) - p.wg.Start(listener.pop) -} - func (p *sharedProcessor) addListener(listener *processorListener) { p.listenersLock.Lock() defer p.listenersLock.Unlock() p.addListenerLocked(listener) + if p.listenersStarted { + p.wg.Start(listener.run) + p.wg.Start(listener.pop) + } } func (p *sharedProcessor) addListenerLocked(listener *processorListener) { @@ -423,6 +420,7 @@ func (p *sharedProcessor) run(stopCh <-chan struct{}) { p.wg.Start(listener.run) p.wg.Start(listener.pop) } + p.listenersStarted = true }() <-stopCh p.listenersLock.RLock() @@ -540,20 +538,35 @@ func (p *processorListener) pop() { } func (p *processorListener) run() { - defer utilruntime.HandleCrash() + // this call blocks until the channel is closed. When a panic happens during the notification + // we will catch it, **the offending item will be skipped!**, and after a short delay (one second) + // the next notification will be attempted. This is usually better than the alternative of never + // delivering again. + stopCh := make(chan struct{}) + wait.Until(func() { + // this gives us a few quick retries before a long pause and then a few more quick retries + err := wait.ExponentialBackoff(retry.DefaultRetry, func() (bool, error) { + for next := range p.nextCh { + switch notification := next.(type) { + case updateNotification: + p.handler.OnUpdate(notification.oldObj, notification.newObj) + case addNotification: + p.handler.OnAdd(notification.newObj) + case deleteNotification: + p.handler.OnDelete(notification.oldObj) + default: + utilruntime.HandleError(fmt.Errorf("unrecognized notification: %#v", next)) + } + } + // the only way to get here is if the p.nextCh is empty and closed + return true, nil + }) - for next := range p.nextCh { - switch notification := next.(type) { - case updateNotification: - p.handler.OnUpdate(notification.oldObj, notification.newObj) - case addNotification: - p.handler.OnAdd(notification.newObj) - case deleteNotification: - p.handler.OnDelete(notification.oldObj) - default: - utilruntime.HandleError(fmt.Errorf("unrecognized notification: %#v", next)) + // the only way to get here is if the p.nextCh is empty and closed + if err == nil { + close(stopCh) } - } + }, 1*time.Minute, stopCh) } // shouldResync deterimines if the listener needs a resync. If the listener's resyncPeriod is 0, diff --git a/vendor/k8s.io/client-go/tools/cache/shared_informer_test.go b/vendor/k8s.io/client-go/tools/cache/shared_informer_test.go index 6f49d167a..22e4a90dd 100644 --- a/vendor/k8s.io/client-go/tools/cache/shared_informer_test.go +++ b/vendor/k8s.io/client-go/tools/cache/shared_informer_test.go @@ -251,3 +251,15 @@ func TestResyncCheckPeriod(t *testing.T) { t.Errorf("expected %d, got %d", e, a) } } + +// verify that https://github.com/kubernetes/kubernetes/issues/59822 is fixed +func TestSharedInformerInitializationRace(t *testing.T) { + source := fcache.NewFakeControllerSource() + informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) + listener := newTestListener("raceListener", 0) + + stop := make(chan struct{}) + go informer.AddEventHandlerWithResyncPeriod(listener, listener.resyncPeriod) + go informer.Run(stop) + close(stop) +} diff --git a/vendor/k8s.io/client-go/tools/cache/testing/BUILD b/vendor/k8s.io/client-go/tools/cache/testing/BUILD index f19cb7f3c..d1658af4d 100644 --- a/vendor/k8s.io/client-go/tools/cache/testing/BUILD +++ b/vendor/k8s.io/client-go/tools/cache/testing/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["fake_controller_source_test.go"], - importpath = "k8s.io/client-go/tools/cache/testing", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/k8s.io/client-go/tools/clientcmd/BUILD b/vendor/k8s.io/client-go/tools/clientcmd/BUILD index 77a8d2229..c46c76d5d 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/BUILD +++ b/vendor/k8s.io/client-go/tools/clientcmd/BUILD @@ -15,8 +15,7 @@ go_test( "overrides_test.go", "validation_test.go", ], - importpath = "k8s.io/client-go/tools/clientcmd", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/imdario/mergo:go_default_library", diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/BUILD b/vendor/k8s.io/client-go/tools/clientcmd/api/BUILD index d46f4e28f..b2fd13824 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/BUILD +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/BUILD @@ -12,8 +12,7 @@ go_test( "helpers_test.go", "types_test.go", ], - importpath = "k8s.io/client-go/tools/clientcmd/api", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/github.com/ghodss/yaml:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/types.go b/vendor/k8s.io/client-go/tools/clientcmd/api/types.go index 407dec83a..1391df702 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/types.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/types.go @@ -119,6 +119,9 @@ type AuthInfo struct { // AuthProvider specifies a custom authentication plugin for the kubernetes cluster. // +optional AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"` + // Exec specifies a custom exec-based authentication plugin for the kubernetes cluster. + // +optional + Exec *ExecConfig `json:"exec,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]runtime.Object `json:"extensions,omitempty"` @@ -147,6 +150,35 @@ type AuthProviderConfig struct { Config map[string]string `json:"config,omitempty"` } +// ExecConfig specifies a command to provide client credentials. The command is exec'd +// and outputs structured stdout holding credentials. +// +// See the client.authentiction.k8s.io API group for specifications of the exact input +// and output format +type ExecConfig struct { + // Command to execute. + Command string `json:"command"` + // Arguments to pass to the command when executing it. + // +optional + Args []string `json:"args"` + // Env defines additional environment variables to expose to the process. These + // are unioned with the host's environment, as well as variables client-go uses + // to pass argument to the plugin. + // +optional + Env []ExecEnvVar `json:"env"` + + // Preferred input version of the ExecInfo. The returned ExecCredentials MUST use + // the same encoding version as the input. + APIVersion string `json:"apiVersion,omitempty"` +} + +// ExecEnvVar is used for setting environment variables when executing an exec-based +// credential plugin. +type ExecEnvVar struct { + Name string `json:"name"` + Value string `json:"value"` +} + // NewConfig is a convenience function that returns a new Config object with non-nil maps func NewConfig() *Config { return &Config{ diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go index 53568135e..56afb608a 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go @@ -113,6 +113,9 @@ type AuthInfo struct { // AuthProvider specifies a custom authentication plugin for the kubernetes cluster. // +optional AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"` + // Exec specifies a custom exec-based authentication plugin for the kubernetes cluster. + // +optional + Exec *ExecConfig `json:"exec,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions []NamedExtension `json:"extensions,omitempty"` @@ -169,3 +172,32 @@ type AuthProviderConfig struct { Name string `json:"name"` Config map[string]string `json:"config"` } + +// ExecConfig specifies a command to provide client credentials. The command is exec'd +// and outputs structured stdout holding credentials. +// +// See the client.authentiction.k8s.io API group for specifications of the exact input +// and output format +type ExecConfig struct { + // Command to execute. + Command string `json:"command"` + // Arguments to pass to the command when executing it. + // +optional + Args []string `json:"args"` + // Env defines additional environment variables to expose to the process. These + // are unioned with the host's environment, as well as variables client-go uses + // to pass argument to the plugin. + // +optional + Env []ExecEnvVar `json:"env"` + + // Preferred input version of the ExecInfo. The returned ExecCredentials MUST use + // the same encoding version as the input. + APIVersion string `json:"apiVersion,omitempty"` +} + +// ExecEnvVar is used for setting environment variables when executing an exec-based +// credential plugin. +type ExecEnvVar struct { + Name string `json:"name"` + Value string `json:"value"` +} diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.deepcopy.go index 8d634671b..83d05b7c6 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -63,6 +63,15 @@ func (in *AuthInfo) DeepCopyInto(out *AuthInfo) { (*in).DeepCopyInto(*out) } } + if in.Exec != nil { + in, out := &in.Exec, &out.Exec + if *in == nil { + *out = nil + } else { + *out = new(ExecConfig) + (*in).DeepCopyInto(*out) + } + } if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make([]NamedExtension, len(*in)) @@ -183,9 +192,8 @@ func (in *Config) DeepCopy() *Config { func (in *Config) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -211,6 +219,48 @@ func (in *Context) DeepCopy() *Context { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecConfig) DeepCopyInto(out *ExecConfig) { + *out = *in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]ExecEnvVar, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecConfig. +func (in *ExecConfig) DeepCopy() *ExecConfig { + if in == nil { + return nil + } + out := new(ExecConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecEnvVar) DeepCopyInto(out *ExecEnvVar) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecEnvVar. +func (in *ExecEnvVar) DeepCopy() *ExecEnvVar { + if in == nil { + return nil + } + out := new(ExecEnvVar) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamedAuthInfo) DeepCopyInto(out *NamedAuthInfo) { *out = *in diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go index 51668f05b..085c088ee 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package api @@ -63,6 +63,15 @@ func (in *AuthInfo) DeepCopyInto(out *AuthInfo) { (*in).DeepCopyInto(*out) } } + if in.Exec != nil { + in, out := &in.Exec, &out.Exec + if *in == nil { + *out = nil + } else { + *out = new(ExecConfig) + (*in).DeepCopyInto(*out) + } + } if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make(map[string]runtime.Object, len(*in)) @@ -210,9 +219,8 @@ func (in *Config) DeepCopy() *Config { func (in *Config) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -242,6 +250,48 @@ func (in *Context) DeepCopy() *Context { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecConfig) DeepCopyInto(out *ExecConfig) { + *out = *in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]ExecEnvVar, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecConfig. +func (in *ExecConfig) DeepCopy() *ExecConfig { + if in == nil { + return nil + } + out := new(ExecConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecEnvVar) DeepCopyInto(out *ExecEnvVar) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecEnvVar. +func (in *ExecEnvVar) DeepCopy() *ExecEnvVar { + if in == nil { + return nil + } + out := new(ExecEnvVar) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Preferences) DeepCopyInto(out *Preferences) { *out = *in diff --git a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go index a8698af24..c202e6b25 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go @@ -107,7 +107,7 @@ func (config *DirectClientConfig) RawConfig() (clientcmdapi.Config, error) { // ClientConfig implements ClientConfig func (config *DirectClientConfig) ClientConfig() (*restclient.Config, error) { // check that getAuthInfo, getContext, and getCluster do not return an error. - // Do this before checking if the curent config is usable in the event that an + // Do this before checking if the current config is usable in the event that an // AuthInfo, Context, or Cluster config with user-defined names are not found. // This provides a user with the immediate cause for error if one is found configAuthInfo, err := config.getAuthInfo() @@ -202,7 +202,7 @@ func getServerIdentificationPartialConfig(configAuthInfo clientcmdapi.AuthInfo, // clientauth.Info object contain both user identification and server identification. We want different precedence orders for // both, so we have to split the objects and merge them separately -// we want this order of precedence for user identifcation +// we want this order of precedence for user identification // 1. configAuthInfo minus auth-path (the final result of command line flags and merged .kubeconfig files) // 2. configAuthInfo.auth-path (this file can contain information that conflicts with #1, and we want #1 to win the priority) // 3. if there is not enough information to identify the user, load try the ~/.kubernetes_auth file @@ -241,6 +241,9 @@ func (config *DirectClientConfig) getUserIdentificationPartialConfig(configAuthI mergedConfig.AuthProvider = configAuthInfo.AuthProvider mergedConfig.AuthConfigPersister = persistAuthConfig } + if configAuthInfo.Exec != nil { + mergedConfig.ExecProvider = configAuthInfo.Exec + } // if there still isn't enough information to authenticate the user, try prompting if !canIdentifyUser(*mergedConfig) && (fallbackReader != nil) { @@ -291,7 +294,8 @@ func canIdentifyUser(config restclient.Config) bool { return len(config.Username) > 0 || (len(config.CertFile) > 0 || len(config.CertData) > 0) || len(config.BearerToken) > 0 || - config.AuthProvider != nil + config.AuthProvider != nil || + config.ExecProvider != nil } // Namespace implements ClientConfig @@ -474,7 +478,7 @@ func (config *inClusterClientConfig) ClientConfig() (*restclient.Config, error) } // in-cluster configs only takes a host, token, or CA file - // if any of them were individually provided, ovewrite anything else + // if any of them were individually provided, overwrite anything else if config.overrides != nil { if server := config.overrides.ClusterInfo.Server; len(server) > 0 { icc.Host = server diff --git a/vendor/k8s.io/client-go/tools/clientcmd/client_config_test.go b/vendor/k8s.io/client-go/tools/clientcmd/client_config_test.go index 9c08ff89d..0a9288bcf 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/client_config_test.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/client_config_test.go @@ -94,7 +94,7 @@ func TestInsecureOverridesCA(t *testing.T) { } func TestMergeContext(t *testing.T) { - const namespace = "overriden-namespace" + const namespace = "overridden-namespace" config := createValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{}, nil) diff --git a/vendor/k8s.io/client-go/tools/clientcmd/loader.go b/vendor/k8s.io/client-go/tools/clientcmd/loader.go index 6ac83b5c8..95e7b1540 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/loader.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/loader.go @@ -111,7 +111,7 @@ func (g *ClientConfigGetter) IsDefaultConfig(config *restclient.Config) bool { // ClientConfigLoadingRules is an ExplicitPath and string slice of specific locations that are used for merging together a Config // Callers can put the chain together however they want, but we'd recommend: // EnvVarPathFiles if set (a list of files if set) OR the HomeDirectoryPath -// ExplicitPath is special, because if a user specifically requests a certain file be used and error is reported if thie file is not present +// ExplicitPath is special, because if a user specifically requests a certain file be used and error is reported if this file is not present type ClientConfigLoadingRules struct { ExplicitPath string Precedence []string @@ -420,7 +420,7 @@ func WriteToFile(config clientcmdapi.Config, filename string) error { func lockFile(filename string) error { // TODO: find a way to do this with actual file locks. Will - // probably need seperate solution for windows and linux. + // probably need separate solution for windows and Linux. // Make sure the dir exists before we try to create a lock file. dir := filepath.Dir(filename) @@ -557,7 +557,12 @@ func GetClusterFileReferences(cluster *clientcmdapi.Cluster) []*string { } func GetAuthInfoFileReferences(authInfo *clientcmdapi.AuthInfo) []*string { - return []*string{&authInfo.ClientCertificate, &authInfo.ClientKey, &authInfo.TokenFile} + s := []*string{&authInfo.ClientCertificate, &authInfo.ClientKey, &authInfo.TokenFile} + // Only resolve exec command if it isn't PATH based. + if authInfo.Exec != nil && strings.ContainsRune(authInfo.Exec.Command, filepath.Separator) { + s = append(s, &authInfo.Exec.Command) + } + return s } // ResolvePaths updates the given refs to be absolute paths, relative to the given base directory diff --git a/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go b/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go index 74319788a..c2dbd019d 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go @@ -206,6 +206,9 @@ func TestResolveRelativePaths(t *testing.T) { AuthInfos: map[string]*clientcmdapi.AuthInfo{ "relative-user-1": {ClientCertificate: "relative/client/cert", ClientKey: "../relative/client/key"}, "absolute-user-1": {ClientCertificate: "/absolute/client/cert", ClientKey: "/absolute/client/key"}, + "relative-cmd-1": {Exec: &clientcmdapi.ExecConfig{Command: "../relative/client/cmd"}}, + "absolute-cmd-1": {Exec: &clientcmdapi.ExecConfig{Command: "/absolute/client/cmd"}}, + "PATH-cmd-1": {Exec: &clientcmdapi.ExecConfig{Command: "cmd"}}, }, Clusters: map[string]*clientcmdapi.Cluster{ "relative-server-1": {CertificateAuthority: "../relative/ca"}, @@ -291,9 +294,21 @@ func TestResolveRelativePaths(t *testing.T) { matchStringArg(pathResolutionConfig2.AuthInfos["absolute-user-2"].ClientCertificate, authInfo.ClientCertificate, t) matchStringArg(pathResolutionConfig2.AuthInfos["absolute-user-2"].ClientKey, authInfo.ClientKey, t) } + if key == "relative-cmd-1" { + foundAuthInfoCount++ + matchStringArg(path.Join(configDir1, pathResolutionConfig1.AuthInfos[key].Exec.Command), authInfo.Exec.Command, t) + } + if key == "absolute-cmd-1" { + foundAuthInfoCount++ + matchStringArg(pathResolutionConfig1.AuthInfos[key].Exec.Command, authInfo.Exec.Command, t) + } + if key == "PATH-cmd-1" { + foundAuthInfoCount++ + matchStringArg(pathResolutionConfig1.AuthInfos[key].Exec.Command, authInfo.Exec.Command, t) + } } - if foundAuthInfoCount != 4 { - t.Errorf("Expected 4 users, found %v: %v", foundAuthInfoCount, mergedConfig.AuthInfos) + if foundAuthInfoCount != 7 { + t.Errorf("Expected 7 users, found %v: %v", foundAuthInfoCount, mergedConfig.AuthInfos) } } diff --git a/vendor/k8s.io/client-go/tools/clientcmd/validation.go b/vendor/k8s.io/client-go/tools/clientcmd/validation.go index 2bae0c395..629c0b30a 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/validation.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/validation.go @@ -237,6 +237,25 @@ func validateAuthInfo(authInfoName string, authInfo clientcmdapi.AuthInfo) []err } } + if authInfo.Exec != nil { + if authInfo.AuthProvider != nil { + validationErrors = append(validationErrors, fmt.Errorf("authProvider cannot be provided in combination with an exec plugin for %s", authInfoName)) + } + if len(authInfo.Exec.Command) == 0 { + validationErrors = append(validationErrors, fmt.Errorf("command must be specified for %v to use exec authentication plugin", authInfoName)) + } + if len(authInfo.Exec.APIVersion) == 0 { + validationErrors = append(validationErrors, fmt.Errorf("apiVersion must be specified for %v to use exec authentication plugin", authInfoName)) + } + for _, v := range authInfo.Exec.Env { + if len(v.Name) == 0 { + validationErrors = append(validationErrors, fmt.Errorf("env variable name must be specified for %v to use exec authentication plugin", authInfoName)) + } else if len(v.Value) == 0 { + validationErrors = append(validationErrors, fmt.Errorf("env variable %s value must be specified for %v to use exec authentication plugin", v.Name, authInfoName)) + } + } + } + // authPath also provides information for the client to identify the server, so allow multiple auth methods in that case if (len(methods) > 1) && (!usingAuthPath) { validationErrors = append(validationErrors, fmt.Errorf("more than one authentication method found for %v; found %v, only one is allowed", authInfoName, methods)) @@ -253,6 +272,10 @@ func validateAuthInfo(authInfoName string, authInfo clientcmdapi.AuthInfo) []err func validateContext(contextName string, context clientcmdapi.Context, config clientcmdapi.Config) []error { validationErrors := make([]error, 0) + if len(contextName) == 0 { + validationErrors = append(validationErrors, fmt.Errorf("empty context name for %#v is not allowed", context)) + } + if len(context.AuthInfo) == 0 { validationErrors = append(validationErrors, fmt.Errorf("user was not specified for context %q", contextName)) } else if _, exists := config.AuthInfos[context.AuthInfo]; !exists { diff --git a/vendor/k8s.io/client-go/tools/clientcmd/validation_test.go b/vendor/k8s.io/client-go/tools/clientcmd/validation_test.go index 6441f1483..4742b1a14 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/validation_test.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/validation_test.go @@ -62,6 +62,7 @@ func TestConfirmUsableBadInfoButOkConfig(t *testing.T) { okTest.testConfirmUsable("clean", t) badValidation.testConfig(t) } + func TestConfirmUsableBadInfoConfig(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["missing ca"] = &clientcmdapi.Cluster{ @@ -83,6 +84,7 @@ func TestConfirmUsableBadInfoConfig(t *testing.T) { test.testConfirmUsable("first", t) } + func TestConfirmUsableEmptyConfig(t *testing.T) { config := clientcmdapi.NewConfig() test := configValidationTest{ @@ -92,6 +94,7 @@ func TestConfirmUsableEmptyConfig(t *testing.T) { test.testConfirmUsable("", t) } + func TestConfirmUsableMissingConfig(t *testing.T) { config := clientcmdapi.NewConfig() test := configValidationTest{ @@ -101,6 +104,7 @@ func TestConfirmUsableMissingConfig(t *testing.T) { test.testConfirmUsable("not-here", t) } + func TestValidateEmptyConfig(t *testing.T) { config := clientcmdapi.NewConfig() test := configValidationTest{ @@ -110,6 +114,7 @@ func TestValidateEmptyConfig(t *testing.T) { test.testConfig(t) } + func TestValidateMissingCurrentContextConfig(t *testing.T) { config := clientcmdapi.NewConfig() config.CurrentContext = "anything" @@ -120,6 +125,7 @@ func TestValidateMissingCurrentContextConfig(t *testing.T) { test.testConfig(t) } + func TestIsContextNotFound(t *testing.T) { config := clientcmdapi.NewConfig() config.CurrentContext = "anything" @@ -172,6 +178,7 @@ func TestValidateMissingReferencesConfig(t *testing.T) { test.testContext("anything", t) test.testConfig(t) } + func TestValidateEmptyContext(t *testing.T) { config := clientcmdapi.NewConfig() config.CurrentContext = "anything" @@ -185,6 +192,19 @@ func TestValidateEmptyContext(t *testing.T) { test.testConfig(t) } +func TestValidateEmptyContextName(t *testing.T) { + config := clientcmdapi.NewConfig() + config.CurrentContext = "anything" + config.Contexts[""] = &clientcmdapi.Context{Cluster: "missing", AuthInfo: "missing"} + test := configValidationTest{ + config: config, + expectedErrorSubstring: []string{"empty context name", "is not allowed"}, + } + + test.testContext("", t) + test.testConfig(t) +} + func TestValidateEmptyClusterInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["empty"] = clientcmdapi.NewCluster() @@ -223,6 +243,7 @@ func TestValidateMissingCAFileClusterInfo(t *testing.T) { test.testCluster("missing ca", t) test.testConfig(t) } + func TestValidateCleanClusterInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ @@ -235,6 +256,7 @@ func TestValidateCleanClusterInfo(t *testing.T) { test.testCluster("clean", t) test.testConfig(t) } + func TestValidateCleanWithCAClusterInfo(t *testing.T) { tempFile, _ := ioutil.TempFile("", "") defer os.Remove(tempFile.Name()) @@ -262,6 +284,7 @@ func TestValidateEmptyAuthInfo(t *testing.T) { test.testAuthInfo("error", t) test.testConfig(t) } + func TestValidateCertFilesNotFoundAuthInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["error"] = &clientcmdapi.AuthInfo{ @@ -276,6 +299,7 @@ func TestValidateCertFilesNotFoundAuthInfo(t *testing.T) { test.testAuthInfo("error", t) test.testConfig(t) } + func TestValidateCertDataOverridesFiles(t *testing.T) { tempFile, _ := ioutil.TempFile("", "") defer os.Remove(tempFile.Name()) @@ -295,6 +319,7 @@ func TestValidateCertDataOverridesFiles(t *testing.T) { test.testAuthInfo("clean", t) test.testConfig(t) } + func TestValidateCleanCertFilesAuthInfo(t *testing.T) { tempFile, _ := ioutil.TempFile("", "") defer os.Remove(tempFile.Name()) @@ -311,6 +336,7 @@ func TestValidateCleanCertFilesAuthInfo(t *testing.T) { test.testAuthInfo("clean", t) test.testConfig(t) } + func TestValidateCleanTokenAuthInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ @@ -339,6 +365,106 @@ func TestValidateMultipleMethodsAuthInfo(t *testing.T) { test.testConfig(t) } +func TestValidateAuthInfoExec(t *testing.T) { + config := clientcmdapi.NewConfig() + config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ + Exec: &clientcmdapi.ExecConfig{ + Command: "/bin/example", + APIVersion: "clientauthentication.k8s.io/v1alpha1", + Args: []string{"hello", "world"}, + Env: []clientcmdapi.ExecEnvVar{ + {Name: "foo", Value: "bar"}, + }, + }, + } + test := configValidationTest{ + config: config, + } + + test.testAuthInfo("user", t) + test.testConfig(t) +} + +func TestValidateAuthInfoExecNoVersion(t *testing.T) { + config := clientcmdapi.NewConfig() + config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ + Exec: &clientcmdapi.ExecConfig{ + Command: "/bin/example", + }, + } + test := configValidationTest{ + config: config, + expectedErrorSubstring: []string{ + "apiVersion must be specified for user to use exec authentication plugin", + }, + } + + test.testAuthInfo("user", t) + test.testConfig(t) +} + +func TestValidateAuthInfoExecNoCommand(t *testing.T) { + config := clientcmdapi.NewConfig() + config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ + Exec: &clientcmdapi.ExecConfig{ + APIVersion: "clientauthentication.k8s.io/v1alpha1", + }, + } + test := configValidationTest{ + config: config, + expectedErrorSubstring: []string{ + "command must be specified for user to use exec authentication plugin", + }, + } + + test.testAuthInfo("user", t) + test.testConfig(t) +} + +func TestValidateAuthInfoExecWithAuthProvider(t *testing.T) { + config := clientcmdapi.NewConfig() + config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ + AuthProvider: &clientcmdapi.AuthProviderConfig{ + Name: "oidc", + }, + Exec: &clientcmdapi.ExecConfig{ + Command: "/bin/example", + APIVersion: "clientauthentication.k8s.io/v1alpha1", + }, + } + test := configValidationTest{ + config: config, + expectedErrorSubstring: []string{ + "authProvider cannot be provided in combination with an exec plugin for user", + }, + } + + test.testAuthInfo("user", t) + test.testConfig(t) +} + +func TestValidateAuthInfoExecInvalidEnv(t *testing.T) { + config := clientcmdapi.NewConfig() + config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ + Exec: &clientcmdapi.ExecConfig{ + Command: "/bin/example", + APIVersion: "clientauthentication.k8s.io/v1alpha1", + Env: []clientcmdapi.ExecEnvVar{ + {Name: "foo"}, // No value + }, + }, + } + test := configValidationTest{ + config: config, + expectedErrorSubstring: []string{ + "env variable foo value must be specified for user to use exec authentication plugin", + }, + } + + test.testAuthInfo("user", t) + test.testConfig(t) +} + type configValidationTest struct { config *clientcmdapi.Config expectedErrorSubstring []string @@ -363,6 +489,7 @@ func (c configValidationTest) testContext(contextName string, t *testing.T) { } } } + func (c configValidationTest) testConfirmUsable(contextName string, t *testing.T) { err := ConfirmUsable(*c.config, contextName) @@ -382,6 +509,7 @@ func (c configValidationTest) testConfirmUsable(contextName string, t *testing.T } } } + func (c configValidationTest) testConfig(t *testing.T) { err := Validate(*c.config) @@ -404,6 +532,7 @@ func (c configValidationTest) testConfig(t *testing.T) { } } } + func (c configValidationTest) testCluster(clusterName string, t *testing.T) { errs := validateClusterInfo(clusterName, *c.config.Clusters[clusterName]) diff --git a/vendor/k8s.io/client-go/tools/leaderelection/BUILD b/vendor/k8s.io/client-go/tools/leaderelection/BUILD index 5ea32efde..22e020d8c 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/BUILD +++ b/vendor/k8s.io/client-go/tools/leaderelection/BUILD @@ -23,8 +23,7 @@ go_library( go_test( name = "go_default_test", srcs = ["leaderelection_test.go"], - importpath = "k8s.io/client-go/tools/leaderelection", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", diff --git a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go index 2ce546bc4..e41b420c9 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go @@ -171,11 +171,11 @@ func (le *LeaderElector) IsLeader() bool { // acquire loops calling tryAcquireOrRenew and returns immediately when tryAcquireOrRenew succeeds. func (le *LeaderElector) acquire() { stop := make(chan struct{}) - glog.Infof("attempting to acquire leader lease...") + desc := le.config.Lock.Describe() + glog.Infof("attempting to acquire leader lease %v...", desc) wait.JitterUntil(func() { succeeded := le.tryAcquireOrRenew() le.maybeReportTransition() - desc := le.config.Lock.Describe() if !succeeded { glog.V(4).Infof("failed to acquire lease %v", desc) return diff --git a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go index 5e5864631..e99cf57af 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go @@ -260,7 +260,7 @@ func testTryAcquireOrRenew(t *testing.T, objectType string) { } if test.expectSuccess != le.tryAcquireOrRenew() { - t.Errorf("[%v]unexpected result of tryAcquireOrRenew: [succeded=%v]", i, !test.expectSuccess) + t.Errorf("[%v]unexpected result of tryAcquireOrRenew: [succeeded=%v]", i, !test.expectSuccess) } le.observedRecord.AcquireTime = metav1.Time{} diff --git a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go index 69e8c5a7a..4ff595603 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go @@ -32,15 +32,15 @@ import ( // data we will likely move to deprecate the Endpoints lock. type ConfigMapLock struct { - // ConfigMapMeta should contain a Name and a Namespace of an - // ConfigMapMeta object that the Leadercmlector will attempt to lead. + // ConfigMapMeta should contain a Name and a Namespace of a + // ConfigMapMeta object that the LeaderElector will attempt to lead. ConfigMapMeta metav1.ObjectMeta Client corev1client.ConfigMapsGetter LockConfig ResourceLockConfig cm *v1.ConfigMap } -// Get returns the cmlection record from a ConfigMap Annotation +// Get returns the election record from a ConfigMap Annotation func (cml *ConfigMapLock) Get() (*LeaderElectionRecord, error) { var record LeaderElectionRecord var err error @@ -59,7 +59,7 @@ func (cml *ConfigMapLock) Get() (*LeaderElectionRecord, error) { return &record, nil } -// Create attempts to create a LeadercmlectionRecord annotation +// Create attempts to create a LeaderElectionRecord annotation func (cml *ConfigMapLock) Create(ler LeaderElectionRecord) error { recordBytes, err := json.Marshal(ler) if err != nil { @@ -77,7 +77,7 @@ func (cml *ConfigMapLock) Create(ler LeaderElectionRecord) error { return err } -// Update will update and existing annotation on a given resource. +// Update will update an existing annotation on a given resource. func (cml *ConfigMapLock) Update(ler LeaderElectionRecord) error { if cml.cm == nil { return errors.New("endpoint not initialized, call get or create first") @@ -91,7 +91,7 @@ func (cml *ConfigMapLock) Update(ler LeaderElectionRecord) error { return err } -// RecordEvent in leader cmlection while adding meta-data +// RecordEvent in leader election while adding meta-data func (cml *ConfigMapLock) RecordEvent(s string) { events := fmt.Sprintf("%v %v", cml.LockConfig.Identity, s) cml.LockConfig.EventRecorder.Eventf(&v1.ConfigMap{ObjectMeta: cml.cm.ObjectMeta}, v1.EventTypeNormal, "LeaderElection", events) diff --git a/vendor/k8s.io/client-go/tools/pager/BUILD b/vendor/k8s.io/client-go/tools/pager/BUILD index c4a2d4d1c..4d07429af 100644 --- a/vendor/k8s.io/client-go/tools/pager/BUILD +++ b/vendor/k8s.io/client-go/tools/pager/BUILD @@ -37,14 +37,13 @@ filegroup( go_test( name = "go_default_test", srcs = ["pager_test.go"], - importpath = "k8s.io/client-go/tools/pager", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1alpha1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", ], ) diff --git a/vendor/k8s.io/client-go/tools/pager/pager_test.go b/vendor/k8s.io/client-go/tools/pager/pager_test.go index 6e3e9444a..b905fc1fb 100644 --- a/vendor/k8s.io/client-go/tools/pager/pager_test.go +++ b/vendor/k8s.io/client-go/tools/pager/pager_test.go @@ -25,14 +25,14 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1alpha1 "k8s.io/apimachinery/pkg/apis/meta/v1alpha1" + metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/runtime" ) func list(count int, rv string) *metainternalversion.List { var list metainternalversion.List for i := 0; i < count; i++ { - list.Items = append(list.Items, &metav1alpha1.PartialObjectMetadata{ + list.Items = append(list.Items, &metav1beta1.PartialObjectMetadata{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%d", i), }, @@ -80,7 +80,7 @@ func (p *testPager) PagedList(ctx context.Context, options metav1.ListOptions) ( if p.remaining <= 0 { break } - list.Items = append(list.Items, &metav1alpha1.PartialObjectMetadata{ + list.Items = append(list.Items, &metav1beta1.PartialObjectMetadata{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%d", p.index), }, diff --git a/vendor/k8s.io/client-go/tools/portforward/BUILD b/vendor/k8s.io/client-go/tools/portforward/BUILD index 1232b7ebb..e2fb01e73 100644 --- a/vendor/k8s.io/client-go/tools/portforward/BUILD +++ b/vendor/k8s.io/client-go/tools/portforward/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["portforward_test.go"], - importpath = "k8s.io/client-go/tools/portforward", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apimachinery/pkg/util/httpstream:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/tools/portforward/portforward.go b/vendor/k8s.io/client-go/tools/portforward/portforward.go index 24737b9a7..9d7936e7c 100644 --- a/vendor/k8s.io/client-go/tools/portforward/portforward.go +++ b/vendor/k8s.io/client-go/tools/portforward/portforward.go @@ -185,7 +185,7 @@ func (pf *PortForwarder) forward() error { // If both listener creation fail, an error is raised. func (pf *PortForwarder) listenOnPort(port *ForwardedPort) error { errTcp4 := pf.listenOnPortAndAddress(port, "tcp4", "127.0.0.1") - errTcp6 := pf.listenOnPortAndAddress(port, "tcp6", "[::1]") + errTcp6 := pf.listenOnPortAndAddress(port, "tcp6", "::1") if errTcp4 != nil && errTcp6 != nil { return fmt.Errorf("All listeners failed to create with the following errors: %s, %s", errTcp4, errTcp6) } @@ -220,7 +220,7 @@ func (pf *PortForwarder) getListener(protocol string, hostname string, port *For } port.Local = uint16(localPortUInt) if pf.out != nil { - fmt.Fprintf(pf.out, "Forwarding from %s:%d -> %d\n", hostname, localPortUInt, port.Remote) + fmt.Fprintf(pf.out, "Forwarding from %s -> %d\n", net.JoinHostPort(hostname, strconv.Itoa(int(localPortUInt))), port.Remote) } return listener, nil diff --git a/vendor/k8s.io/client-go/tools/portforward/portforward_test.go b/vendor/k8s.io/client-go/tools/portforward/portforward_test.go index ab705849c..2abbf16f2 100644 --- a/vendor/k8s.io/client-go/tools/portforward/portforward_test.go +++ b/vendor/k8s.io/client-go/tools/portforward/portforward_test.go @@ -179,7 +179,7 @@ func TestGetListener(t *testing.T) { t.Errorf("Test case #%d failed: Listener does not listen on expected address: asked '%v' got '%v'", i, testCase.ExpectedListenerAddress, host) } if port != expectedListenerPort { - t.Errorf("Test case #%d failed: Listener does not listen on exepected port: asked %v got %v", i, expectedListenerPort, port) + t.Errorf("Test case #%d failed: Listener does not listen on expected port: asked %v got %v", i, expectedListenerPort, port) } listener.Close() diff --git a/vendor/k8s.io/client-go/tools/record/BUILD b/vendor/k8s.io/client-go/tools/record/BUILD index f89aa3e28..0799afe7e 100644 --- a/vendor/k8s.io/client-go/tools/record/BUILD +++ b/vendor/k8s.io/client-go/tools/record/BUILD @@ -12,8 +12,7 @@ go_test( "event_test.go", "events_cache_test.go", ], - importpath = "k8s.io/client-go/tools/record", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", diff --git a/vendor/k8s.io/client-go/tools/remotecommand/BUILD b/vendor/k8s.io/client-go/tools/remotecommand/BUILD index e665af3f4..b30c122c3 100644 --- a/vendor/k8s.io/client-go/tools/remotecommand/BUILD +++ b/vendor/k8s.io/client-go/tools/remotecommand/BUILD @@ -12,8 +12,7 @@ go_test( "v2_test.go", "v4_test.go", ], - importpath = "k8s.io/client-go/tools/remotecommand", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/httpstream:go_default_library", diff --git a/vendor/k8s.io/client-go/transport/BUILD b/vendor/k8s.io/client-go/transport/BUILD index 91c3831b2..71494544a 100644 --- a/vendor/k8s.io/client-go/transport/BUILD +++ b/vendor/k8s.io/client-go/transport/BUILD @@ -13,8 +13,7 @@ go_test( "round_trippers_test.go", "transport_test.go", ], - importpath = "k8s.io/client-go/transport", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( @@ -28,9 +27,6 @@ go_library( importpath = "k8s.io/client-go/transport", deps = [ "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/gregjones/httpcache:go_default_library", - "//vendor/github.com/gregjones/httpcache/diskcache:go_default_library", - "//vendor/github.com/peterbourgon/diskv:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", ], ) diff --git a/vendor/k8s.io/client-go/transport/cache.go b/vendor/k8s.io/client-go/transport/cache.go index da22cdee5..7c40848c7 100644 --- a/vendor/k8s.io/client-go/transport/cache.go +++ b/vendor/k8s.io/client-go/transport/cache.go @@ -31,12 +31,28 @@ import ( // the config has no custom TLS options, http.DefaultTransport is returned. type tlsTransportCache struct { mu sync.Mutex - transports map[string]*http.Transport + transports map[tlsCacheKey]*http.Transport } const idleConnsPerHost = 25 -var tlsCache = &tlsTransportCache{transports: make(map[string]*http.Transport)} +var tlsCache = &tlsTransportCache{transports: make(map[tlsCacheKey]*http.Transport)} + +type tlsCacheKey struct { + insecure bool + caData string + certData string + keyData string + serverName string +} + +func (t tlsCacheKey) String() string { + keyText := "" + if len(t.keyData) > 0 { + keyText = "" + } + return fmt.Sprintf("insecure:%v, caData:%#v, certData:%#v, keyData:%s, serverName:%s", t.insecure, t.caData, t.certData, keyText, t.serverName) +} func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) { key, err := tlsConfigKey(config) @@ -82,11 +98,16 @@ func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) { } // tlsConfigKey returns a unique key for tls.Config objects returned from TLSConfigFor -func tlsConfigKey(c *Config) (string, error) { +func tlsConfigKey(c *Config) (tlsCacheKey, error) { // Make sure ca/key/cert content is loaded if err := loadTLSFiles(c); err != nil { - return "", err + return tlsCacheKey{}, err } - // Only include the things that actually affect the tls.Config - return fmt.Sprintf("%v/%x/%x/%x/%v", c.TLS.Insecure, c.TLS.CAData, c.TLS.CertData, c.TLS.KeyData, c.TLS.ServerName), nil + return tlsCacheKey{ + insecure: c.TLS.Insecure, + caData: string(c.TLS.CAData), + certData: string(c.TLS.CertData), + keyData: string(c.TLS.KeyData), + serverName: c.TLS.ServerName, + }, nil } diff --git a/vendor/k8s.io/client-go/transport/config.go b/vendor/k8s.io/client-go/transport/config.go index 425f8f87a..af347dafe 100644 --- a/vendor/k8s.io/client-go/transport/config.go +++ b/vendor/k8s.io/client-go/transport/config.go @@ -37,10 +37,6 @@ type Config struct { // Bearer token for authentication BearerToken string - // CacheDir is the directory where we'll store HTTP cached responses. - // If set to empty string, no caching mechanism will be used. - CacheDir string - // Impersonate is the config that this Config will impersonate using Impersonate ImpersonationConfig diff --git a/vendor/k8s.io/client-go/transport/round_trippers.go b/vendor/k8s.io/client-go/transport/round_trippers.go index 2ee605d7b..c728b1877 100644 --- a/vendor/k8s.io/client-go/transport/round_trippers.go +++ b/vendor/k8s.io/client-go/transport/round_trippers.go @@ -19,14 +19,10 @@ package transport import ( "fmt" "net/http" - "path/filepath" "strings" "time" "github.com/golang/glog" - "github.com/gregjones/httpcache" - "github.com/gregjones/httpcache/diskcache" - "github.com/peterbourgon/diskv" utilnet "k8s.io/apimachinery/pkg/util/net" ) @@ -60,9 +56,6 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip len(config.Impersonate.Extra) > 0 { rt = NewImpersonatingRoundTripper(config.Impersonate, rt) } - if len(config.CacheDir) > 0 { - rt = NewCacheRoundTripper(config.CacheDir, rt) - } return rt, nil } @@ -86,30 +79,6 @@ type requestCanceler interface { CancelRequest(*http.Request) } -type cacheRoundTripper struct { - rt *httpcache.Transport -} - -// NewCacheRoundTripper creates a roundtripper that reads the ETag on -// response headers and send the If-None-Match header on subsequent -// corresponding requests. -func NewCacheRoundTripper(cacheDir string, rt http.RoundTripper) http.RoundTripper { - d := diskv.New(diskv.Options{ - BasePath: cacheDir, - TempDir: filepath.Join(cacheDir, ".diskv-temp"), - }) - t := httpcache.NewTransport(diskcache.NewWithDiskv(d)) - t.Transport = rt - - return &cacheRoundTripper{rt: t} -} - -func (rt *cacheRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - return rt.rt.RoundTrip(req) -} - -func (rt *cacheRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt.Transport } - type authProxyRoundTripper struct { username string groups []string diff --git a/vendor/k8s.io/client-go/transport/round_trippers_test.go b/vendor/k8s.io/client-go/transport/round_trippers_test.go index c1e30c3f2..d5ffc6bde 100644 --- a/vendor/k8s.io/client-go/transport/round_trippers_test.go +++ b/vendor/k8s.io/client-go/transport/round_trippers_test.go @@ -17,11 +17,7 @@ limitations under the License. package transport import ( - "bytes" - "io/ioutil" "net/http" - "net/url" - "os" "reflect" "strings" "testing" @@ -220,60 +216,3 @@ func TestAuthProxyRoundTripper(t *testing.T) { } } } - -func TestCacheRoundTripper(t *testing.T) { - rt := &testRoundTripper{} - cacheDir, err := ioutil.TempDir("", "cache-rt") - defer os.RemoveAll(cacheDir) - if err != nil { - t.Fatal(err) - } - cache := NewCacheRoundTripper(cacheDir, rt) - - // First call, caches the response - req := &http.Request{ - Method: http.MethodGet, - URL: &url.URL{Host: "localhost"}, - } - rt.Response = &http.Response{ - Header: http.Header{"ETag": []string{`"123456"`}}, - Body: ioutil.NopCloser(bytes.NewReader([]byte("Content"))), - StatusCode: http.StatusOK, - } - resp, err := cache.RoundTrip(req) - if err != nil { - t.Fatal(err) - } - content, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - if string(content) != "Content" { - t.Errorf(`Expected Body to be "Content", got %q`, string(content)) - } - - // Second call, returns cached response - req = &http.Request{ - Method: http.MethodGet, - URL: &url.URL{Host: "localhost"}, - } - rt.Response = &http.Response{ - StatusCode: http.StatusNotModified, - Body: ioutil.NopCloser(bytes.NewReader([]byte("Other Content"))), - } - - resp, err = cache.RoundTrip(req) - if err != nil { - t.Fatal(err) - } - - // Read body and make sure we have the initial content - content, err = ioutil.ReadAll(resp.Body) - resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if string(content) != "Content" { - t.Errorf("Invalid content read from cache %q", string(content)) - } -} diff --git a/vendor/k8s.io/client-go/util/buffer/BUILD b/vendor/k8s.io/client-go/util/buffer/BUILD index b5629d5cb..d3b2652ce 100644 --- a/vendor/k8s.io/client-go/util/buffer/BUILD +++ b/vendor/k8s.io/client-go/util/buffer/BUILD @@ -10,8 +10,7 @@ go_library( go_test( name = "go_default_test", srcs = ["ring_growing_test.go"], - importpath = "k8s.io/client-go/util/buffer", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/github.com/stretchr/testify/assert:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/util/cert/BUILD b/vendor/k8s.io/client-go/util/cert/BUILD index 93ca7c9c6..799979d46 100644 --- a/vendor/k8s.io/client-go/util/cert/BUILD +++ b/vendor/k8s.io/client-go/util/cert/BUILD @@ -13,8 +13,7 @@ go_test( "pem_test.go", ], data = glob(["testdata/**"]), - importpath = "k8s.io/client-go/util/cert", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/util/cert/cert.go b/vendor/k8s.io/client-go/util/cert/cert.go index 6854d4152..fb7f5facc 100644 --- a/vendor/k8s.io/client-go/util/cert/cert.go +++ b/vendor/k8s.io/client-go/util/cert/cert.go @@ -38,7 +38,7 @@ const ( duration365d = time.Hour * 24 * 365 ) -// Config containes the basic fields required for creating a certificate +// Config contains the basic fields required for creating a certificate type Config struct { CommonName string Organization []string @@ -138,23 +138,50 @@ func MakeEllipticPrivateKeyPEM() ([]byte, error) { // Host may be an IP or a DNS name // You may also specify additional subject alt names (either ip or dns names) for the certificate func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS []string) ([]byte, []byte, error) { + caKey, err := rsa.GenerateKey(cryptorand.Reader, 2048) + if err != nil { + return nil, nil, err + } + + caTemplate := x509.Certificate{ + SerialNumber: big.NewInt(1), + Subject: pkix.Name{ + CommonName: fmt.Sprintf("%s-ca@%d", host, time.Now().Unix()), + }, + NotBefore: time.Now(), + NotAfter: time.Now().Add(time.Hour * 24 * 365), + + KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, + BasicConstraintsValid: true, + IsCA: true, + } + + caDERBytes, err := x509.CreateCertificate(cryptorand.Reader, &caTemplate, &caTemplate, &caKey.PublicKey, caKey) + if err != nil { + return nil, nil, err + } + + caCertificate, err := x509.ParseCertificate(caDERBytes) + if err != nil { + return nil, nil, err + } + priv, err := rsa.GenerateKey(cryptorand.Reader, 2048) if err != nil { return nil, nil, err } template := x509.Certificate{ - SerialNumber: big.NewInt(1), + SerialNumber: big.NewInt(2), Subject: pkix.Name{ CommonName: fmt.Sprintf("%s@%d", host, time.Now().Unix()), }, NotBefore: time.Now(), NotAfter: time.Now().Add(time.Hour * 24 * 365), - KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, + KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, BasicConstraintsValid: true, - IsCA: true, } if ip := net.ParseIP(host); ip != nil { @@ -166,16 +193,19 @@ func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS template.IPAddresses = append(template.IPAddresses, alternateIPs...) template.DNSNames = append(template.DNSNames, alternateDNS...) - derBytes, err := x509.CreateCertificate(cryptorand.Reader, &template, &template, &priv.PublicKey, priv) + derBytes, err := x509.CreateCertificate(cryptorand.Reader, &template, caCertificate, &priv.PublicKey, caKey) if err != nil { return nil, nil, err } - // Generate cert + // Generate cert, followed by ca certBuffer := bytes.Buffer{} if err := pem.Encode(&certBuffer, &pem.Block{Type: CertificateBlockType, Bytes: derBytes}); err != nil { return nil, nil, err } + if err := pem.Encode(&certBuffer, &pem.Block{Type: CertificateBlockType, Bytes: caDERBytes}); err != nil { + return nil, nil, err + } // Generate key keyBuffer := bytes.Buffer{} diff --git a/vendor/k8s.io/client-go/util/certificate/BUILD b/vendor/k8s.io/client-go/util/certificate/BUILD index f10a2d9e2..dfc5c3933 100644 --- a/vendor/k8s.io/client-go/util/certificate/BUILD +++ b/vendor/k8s.io/client-go/util/certificate/BUILD @@ -14,8 +14,7 @@ go_test( "certificate_manager_test.go", "certificate_store_test.go", ], - importpath = "k8s.io/client-go/util/certificate", - library = ":go_default_library", + embed = [":go_default_library"], tags = ["automanaged"], deps = [ "//vendor/k8s.io/api/certificates/v1beta1:go_default_library", diff --git a/vendor/k8s.io/client-go/util/certificate/certificate_manager.go b/vendor/k8s.io/client-go/util/certificate/certificate_manager.go index 7ea05ba79..e189c8479 100644 --- a/vendor/k8s.io/client-go/util/certificate/certificate_manager.go +++ b/vendor/k8s.io/client-go/util/certificate/certificate_manager.go @@ -141,7 +141,6 @@ type manager struct { certStore Store certAccessLock sync.RWMutex cert *tls.Certificate - rotationDeadline time.Time forceRotation bool certificateExpiration Gauge serverHealth bool @@ -208,8 +207,7 @@ func (m *manager) SetCertificateSigningRequestClient(certSigningRequestClient ce func (m *manager) Start() { // Certificate rotation depends on access to the API server certificate // signing API, so don't start the certificate manager if we don't have a - // client. This will happen on the cluster master, where the kubelet is - // responsible for bootstrapping the pods of the master components. + // client. if m.certSigningRequestClient == nil { glog.V(2).Infof("Certificate rotation is not enabled, no connection to the apiserver.") return @@ -217,27 +215,18 @@ func (m *manager) Start() { glog.V(2).Infof("Certificate rotation is enabled.") - m.setRotationDeadline() - - // Synchronously request a certificate before entering the background - // loop to allow bootstrap scenarios, where the certificate manager - // doesn't have a certificate at all yet. - if m.shouldRotate() { - glog.V(1).Infof("shouldRotate() is true, forcing immediate rotation") - if _, err := m.rotateCerts(); err != nil { - utilruntime.HandleError(fmt.Errorf("Could not rotate certificates: %v", err)) - } - } - backoff := wait.Backoff{ - Duration: 2 * time.Second, - Factor: 2, - Jitter: 0.1, - Steps: 5, - } go wait.Forever(func() { - sleepInterval := m.rotationDeadline.Sub(time.Now()) - glog.V(2).Infof("Waiting %v for next certificate rotation", sleepInterval) - time.Sleep(sleepInterval) + deadline := m.nextRotationDeadline() + if sleepInterval := deadline.Sub(time.Now()); sleepInterval > 0 { + glog.V(2).Infof("Waiting %v for next certificate rotation", sleepInterval) + time.Sleep(sleepInterval) + } + backoff := wait.Backoff{ + Duration: 2 * time.Second, + Factor: 2, + Jitter: 0.1, + Steps: 5, + } if err := wait.ExponentialBackoff(backoff, m.rotateCerts); err != nil { utilruntime.HandleError(fmt.Errorf("Reached backoff limit, still unable to rotate certs: %v", err)) wait.PollInfinite(32*time.Second, m.rotateCerts) @@ -252,11 +241,14 @@ func getCurrentCertificateOrBootstrap( currentCert, err := store.Current() if err == nil { - return currentCert, false, nil - } - - if _, ok := err.(*NoCertKeyError); !ok { - return nil, false, err + // if the current cert is expired, fall back to the bootstrap cert + if currentCert.Leaf != nil && time.Now().Before(currentCert.Leaf.NotAfter) { + return currentCert, false, nil + } + } else { + if _, ok := err.(*NoCertKeyError); !ok { + return nil, false, err + } } if bootstrapCertificatePEM == nil || bootstrapKeyPEM == nil { @@ -276,21 +268,14 @@ func getCurrentCertificateOrBootstrap( return nil, false, fmt.Errorf("unable to parse certificate data: %v", err) } bootstrapCert.Leaf = certs[0] - return &bootstrapCert, true, nil -} -// shouldRotate looks at how close the current certificate is to expiring and -// decides if it is time to rotate or not. -func (m *manager) shouldRotate() bool { - m.certAccessLock.RLock() - defer m.certAccessLock.RUnlock() - if m.cert == nil { - return true - } - if m.forceRotation { - return true + if _, err := store.Update(bootstrapCertificatePEM, bootstrapKeyPEM); err != nil { + utilruntime.HandleError(fmt.Errorf("Unable to set the cert/key pair to the bootstrap certificate: %v", err)) + } else { + glog.V(4).Infof("Updated the store to contain the initial bootstrap certificate") } - return time.Now().After(m.rotationDeadline) + + return &bootstrapCert, true, nil } // rotateCerts attempts to request a client cert from the server, wait a reasonable @@ -315,7 +300,7 @@ func (m *manager) rotateCerts() (bool, error) { return false, m.updateServerError(err) } - // Wait for the certificate to be signed. Instead of one long watch, we retry with slighly longer + // Wait for the certificate to be signed. Instead of one long watch, we retry with slightly longer // intervals each time in order to tolerate failures from the server AND to preserve the liveliness // of the cert manager loop. This creates slightly more traffic against the API server in return // for bounding the amount of time we wait when a certificate expires. @@ -349,30 +334,34 @@ func (m *manager) rotateCerts() (bool, error) { } m.updateCached(cert) - m.setRotationDeadline() - m.forceRotation = false return true, nil } -// setRotationDeadline sets a cached value for the threshold at which the +// nextRotationDeadline returns a value for the threshold at which the // current certificate should be rotated, 80%+/-10% of the expiration of the // certificate. -func (m *manager) setRotationDeadline() { +func (m *manager) nextRotationDeadline() time.Time { + // forceRotation is not protected by locks + if m.forceRotation { + m.forceRotation = false + return time.Now() + } + m.certAccessLock.RLock() defer m.certAccessLock.RUnlock() if m.cert == nil { - m.rotationDeadline = time.Now() - return + return time.Now() } notAfter := m.cert.Leaf.NotAfter totalDuration := float64(notAfter.Sub(m.cert.Leaf.NotBefore)) + deadline := m.cert.Leaf.NotBefore.Add(jitteryDuration(totalDuration)) - m.rotationDeadline = m.cert.Leaf.NotBefore.Add(jitteryDuration(totalDuration)) - glog.V(2).Infof("Certificate expiration is %v, rotation deadline is %v", notAfter, m.rotationDeadline) + glog.V(2).Infof("Certificate expiration is %v, rotation deadline is %v", notAfter, deadline) if m.certificateExpiration != nil { m.certificateExpiration.Set(float64(notAfter.Unix())) } + return deadline } // jitteryDuration uses some jitter to set the rotation threshold so each node diff --git a/vendor/k8s.io/client-go/util/certificate/certificate_manager_test.go b/vendor/k8s.io/client-go/util/certificate/certificate_manager_test.go index ab19e37b1..6a23f0426 100644 --- a/vendor/k8s.io/client-go/util/certificate/certificate_manager_test.go +++ b/vendor/k8s.io/client-go/util/certificate/certificate_manager_test.go @@ -146,46 +146,6 @@ func TestNewManagerNoRotation(t *testing.T) { } } -func TestShouldRotate(t *testing.T) { - now := time.Now() - tests := []struct { - name string - notBefore time.Time - notAfter time.Time - shouldRotate bool - }{ - {"just issued, still good", now.Add(-1 * time.Hour), now.Add(99 * time.Hour), false}, - {"half way expired, still good", now.Add(-24 * time.Hour), now.Add(24 * time.Hour), false}, - {"mostly expired, still good", now.Add(-69 * time.Hour), now.Add(31 * time.Hour), false}, - {"just about expired, should rotate", now.Add(-91 * time.Hour), now.Add(9 * time.Hour), true}, - {"nearly expired, should rotate", now.Add(-99 * time.Hour), now.Add(1 * time.Hour), true}, - {"already expired, should rotate", now.Add(-10 * time.Hour), now.Add(-1 * time.Hour), true}, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - m := manager{ - cert: &tls.Certificate{ - Leaf: &x509.Certificate{ - NotBefore: test.notBefore, - NotAfter: test.notAfter, - }, - }, - template: &x509.CertificateRequest{}, - usages: []certificates.KeyUsage{}, - } - m.setRotationDeadline() - if m.shouldRotate() != test.shouldRotate { - t.Errorf("Time %v, a certificate issued for (%v, %v) should rotate should be %t.", - now, - m.cert.Leaf.NotBefore, - m.cert.Leaf.NotAfter, - test.shouldRotate) - } - }) - } -} - type gaugeMock struct { calls int lastValue float64 @@ -233,20 +193,20 @@ func TestSetRotationDeadline(t *testing.T) { jitteryDuration = func(float64) time.Duration { return time.Duration(float64(tc.notAfter.Sub(tc.notBefore)) * 0.7) } lowerBound := tc.notBefore.Add(time.Duration(float64(tc.notAfter.Sub(tc.notBefore)) * 0.7)) - m.setRotationDeadline() + deadline := m.nextRotationDeadline() - if !m.rotationDeadline.Equal(lowerBound) { + if !deadline.Equal(lowerBound) { t.Errorf("For notBefore %v, notAfter %v, the rotationDeadline %v should be %v.", tc.notBefore, tc.notAfter, - m.rotationDeadline, + deadline, lowerBound) } if g.calls != 1 { t.Errorf("%d metrics were recorded, wanted %d", g.calls, 1) } if g.lastValue != float64(tc.notAfter.Unix()) { - t.Errorf("%d value for metric was recorded, wanted %d", g.lastValue, tc.notAfter.Unix()) + t.Errorf("%f value for metric was recorded, wanted %d", g.lastValue, tc.notAfter.Unix()) } }) } @@ -321,7 +281,7 @@ func TestNewManagerBootstrap(t *testing.T) { } if m, ok := cm.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") - } else if !m.shouldRotate() { + } else if !m.forceRotation { t.Errorf("Expected rotation should happen during bootstrap, but it won't.") } } @@ -360,9 +320,8 @@ func TestNewManagerNoBootstrap(t *testing.T) { if m, ok := cm.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") } else { - m.setRotationDeadline() - if m.shouldRotate() { - t.Errorf("Expected rotation should happen during bootstrap, but it won't.") + if m.forceRotation { + t.Errorf("Expected rotation should not happen during bootstrap, but it won't.") } } } @@ -515,8 +474,7 @@ func TestInitializeCertificateSigningRequestClient(t *testing.T) { if m, ok := certificateManager.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") } else { - m.setRotationDeadline() - if m.shouldRotate() { + if m.forceRotation { if success, err := m.rotateCerts(); !success { t.Errorf("Got failure from 'rotateCerts', wanted success.") } else if err != nil { @@ -614,8 +572,7 @@ func TestInitializeOtherRESTClients(t *testing.T) { if m, ok := certificateManager.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") } else { - m.setRotationDeadline() - if m.shouldRotate() { + if m.forceRotation { success, err := certificateManager.(*manager).rotateCerts() if err != nil { t.Errorf("Got error %v, expected none.", err) diff --git a/vendor/k8s.io/client-go/util/certificate/csr/BUILD b/vendor/k8s.io/client-go/util/certificate/csr/BUILD index c6def5bbf..c1bcd9578 100644 --- a/vendor/k8s.io/client-go/util/certificate/csr/BUILD +++ b/vendor/k8s.io/client-go/util/certificate/csr/BUILD @@ -42,8 +42,7 @@ filegroup( go_test( name = "go_default_test", srcs = ["csr_test.go"], - importpath = "k8s.io/client-go/util/certificate/csr", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/certificates/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/k8s.io/client-go/util/flowcontrol/BUILD b/vendor/k8s.io/client-go/util/flowcontrol/BUILD index d74b3f554..819bb7ef3 100644 --- a/vendor/k8s.io/client-go/util/flowcontrol/BUILD +++ b/vendor/k8s.io/client-go/util/flowcontrol/BUILD @@ -12,8 +12,7 @@ go_test( "backoff_test.go", "throttle_test.go", ], - importpath = "k8s.io/client-go/util/flowcontrol", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apimachinery/pkg/util/clock:go_default_library"], ) @@ -25,7 +24,7 @@ go_library( ], importpath = "k8s.io/client-go/util/flowcontrol", deps = [ - "//vendor/github.com/juju/ratelimit:go_default_library", + "//vendor/golang.org/x/time/rate:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/clock:go_default_library", "//vendor/k8s.io/client-go/util/integer:go_default_library", ], diff --git a/vendor/k8s.io/client-go/util/flowcontrol/throttle.go b/vendor/k8s.io/client-go/util/flowcontrol/throttle.go index c45169c40..e671c044d 100644 --- a/vendor/k8s.io/client-go/util/flowcontrol/throttle.go +++ b/vendor/k8s.io/client-go/util/flowcontrol/throttle.go @@ -18,8 +18,9 @@ package flowcontrol import ( "sync" + "time" - "github.com/juju/ratelimit" + "golang.org/x/time/rate" ) type RateLimiter interface { @@ -30,17 +31,13 @@ type RateLimiter interface { Accept() // Stop stops the rate limiter, subsequent calls to CanAccept will return false Stop() - // Saturation returns a percentage number which describes how saturated - // this rate limiter is. - // Usually we use token bucket rate limiter. In that case, - // 1.0 means no tokens are available; 0.0 means we have a full bucket of tokens to use. - Saturation() float64 // QPS returns QPS of this rate limiter QPS() float32 } type tokenBucketRateLimiter struct { - limiter *ratelimit.Bucket + limiter *rate.Limiter + clock Clock qps float32 } @@ -50,42 +47,48 @@ type tokenBucketRateLimiter struct { // The bucket is initially filled with 'burst' tokens, and refills at a rate of 'qps'. // The maximum number of tokens in the bucket is capped at 'burst'. func NewTokenBucketRateLimiter(qps float32, burst int) RateLimiter { - limiter := ratelimit.NewBucketWithRate(float64(qps), int64(burst)) - return newTokenBucketRateLimiter(limiter, qps) + limiter := rate.NewLimiter(rate.Limit(qps), burst) + return newTokenBucketRateLimiter(limiter, realClock{}, qps) } // An injectable, mockable clock interface. type Clock interface { - ratelimit.Clock + Now() time.Time + Sleep(time.Duration) +} + +type realClock struct{} + +func (realClock) Now() time.Time { + return time.Now() +} +func (realClock) Sleep(d time.Duration) { + time.Sleep(d) } // NewTokenBucketRateLimiterWithClock is identical to NewTokenBucketRateLimiter // but allows an injectable clock, for testing. -func NewTokenBucketRateLimiterWithClock(qps float32, burst int, clock Clock) RateLimiter { - limiter := ratelimit.NewBucketWithRateAndClock(float64(qps), int64(burst), clock) - return newTokenBucketRateLimiter(limiter, qps) +func NewTokenBucketRateLimiterWithClock(qps float32, burst int, c Clock) RateLimiter { + limiter := rate.NewLimiter(rate.Limit(qps), burst) + return newTokenBucketRateLimiter(limiter, c, qps) } -func newTokenBucketRateLimiter(limiter *ratelimit.Bucket, qps float32) RateLimiter { +func newTokenBucketRateLimiter(limiter *rate.Limiter, c Clock, qps float32) RateLimiter { return &tokenBucketRateLimiter{ limiter: limiter, + clock: c, qps: qps, } } func (t *tokenBucketRateLimiter) TryAccept() bool { - return t.limiter.TakeAvailable(1) == 1 -} - -func (t *tokenBucketRateLimiter) Saturation() float64 { - capacity := t.limiter.Capacity() - avail := t.limiter.Available() - return float64(capacity-avail) / float64(capacity) + return t.limiter.AllowN(t.clock.Now(), 1) } // Accept will block until a token becomes available func (t *tokenBucketRateLimiter) Accept() { - t.limiter.Wait(1) + now := t.clock.Now() + t.clock.Sleep(t.limiter.ReserveN(now, 1).DelayFrom(now)) } func (t *tokenBucketRateLimiter) Stop() { @@ -105,10 +108,6 @@ func (t *fakeAlwaysRateLimiter) TryAccept() bool { return true } -func (t *fakeAlwaysRateLimiter) Saturation() float64 { - return 0 -} - func (t *fakeAlwaysRateLimiter) Stop() {} func (t *fakeAlwaysRateLimiter) Accept() {} @@ -131,10 +130,6 @@ func (t *fakeNeverRateLimiter) TryAccept() bool { return false } -func (t *fakeNeverRateLimiter) Saturation() float64 { - return 1 -} - func (t *fakeNeverRateLimiter) Stop() { t.wg.Done() } diff --git a/vendor/k8s.io/client-go/util/flowcontrol/throttle_test.go b/vendor/k8s.io/client-go/util/flowcontrol/throttle_test.go index 642020fe4..99cf64d64 100644 --- a/vendor/k8s.io/client-go/util/flowcontrol/throttle_test.go +++ b/vendor/k8s.io/client-go/util/flowcontrol/throttle_test.go @@ -17,7 +17,6 @@ limitations under the License. package flowcontrol import ( - "math" "sync" "testing" "time" @@ -116,29 +115,6 @@ func TestThrottle(t *testing.T) { } } -func TestRateLimiterSaturation(t *testing.T) { - const e = 0.000001 - tests := []struct { - capacity int - take int - - expectedSaturation float64 - }{ - {1, 1, 1}, - {10, 3, 0.3}, - } - for i, tt := range tests { - rl := NewTokenBucketRateLimiter(1, tt.capacity) - for i := 0; i < tt.take; i++ { - rl.Accept() - } - if math.Abs(rl.Saturation()-tt.expectedSaturation) > e { - t.Fatalf("#%d: Saturation rate difference isn't within tolerable range\n want=%f, get=%f", - i, tt.expectedSaturation, rl.Saturation()) - } - } -} - func TestAlwaysFake(t *testing.T) { rl := NewFakeAlwaysRateLimiter() if !rl.TryAccept() { diff --git a/vendor/k8s.io/client-go/util/integer/BUILD b/vendor/k8s.io/client-go/util/integer/BUILD index 67f050e42..8a2105e46 100644 --- a/vendor/k8s.io/client-go/util/integer/BUILD +++ b/vendor/k8s.io/client-go/util/integer/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["integer_test.go"], - importpath = "k8s.io/client-go/util/integer", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/util/jsonpath/BUILD b/vendor/k8s.io/client-go/util/jsonpath/BUILD index 0856e29ca..ab43accd6 100644 --- a/vendor/k8s.io/client-go/util/jsonpath/BUILD +++ b/vendor/k8s.io/client-go/util/jsonpath/BUILD @@ -12,8 +12,7 @@ go_test( "jsonpath_test.go", "parser_test.go", ], - importpath = "k8s.io/client-go/util/jsonpath", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/util/jsonpath/jsonpath_test.go b/vendor/k8s.io/client-go/util/jsonpath/jsonpath_test.go index c65905322..6c7277d10 100644 --- a/vendor/k8s.io/client-go/util/jsonpath/jsonpath_test.go +++ b/vendor/k8s.io/client-go/util/jsonpath/jsonpath_test.go @@ -190,7 +190,7 @@ func TestStructInput(t *testing.T) { {"nonexistent field", "{.hello}", storeData, "hello is not found", false}, {"invalid array", "{.Labels[0]}", storeData, "map[string]int is not array or slice", false}, {"invalid filter operator", "{.Book[?(@.Price<>10)]}", storeData, "unrecognized filter operator <>", false}, - {"redundent end", "{range .Labels.*}{@}{end}{end}", storeData, "not in range, nothing to end", false}, + {"redundant end", "{range .Labels.*}{@}{end}{end}", storeData, "not in range, nothing to end", false}, } testFailJSONPath(failStoreTests, t) } diff --git a/vendor/k8s.io/client-go/util/retry/BUILD b/vendor/k8s.io/client-go/util/retry/BUILD index 9f6f4b848..d74581310 100644 --- a/vendor/k8s.io/client-go/util/retry/BUILD +++ b/vendor/k8s.io/client-go/util/retry/BUILD @@ -19,8 +19,7 @@ go_library( go_test( name = "go_default_test", srcs = ["util_test.go"], - importpath = "k8s.io/client-go/util/retry", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/vendor/k8s.io/client-go/util/testing/BUILD b/vendor/k8s.io/client-go/util/testing/BUILD index 1280a1ed1..726a30f92 100644 --- a/vendor/k8s.io/client-go/util/testing/BUILD +++ b/vendor/k8s.io/client-go/util/testing/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["fake_handler_test.go"], - importpath = "k8s.io/client-go/util/testing", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/util/workqueue/BUILD b/vendor/k8s.io/client-go/util/workqueue/BUILD index 2abd2f82d..7fb9fba48 100644 --- a/vendor/k8s.io/client-go/util/workqueue/BUILD +++ b/vendor/k8s.io/client-go/util/workqueue/BUILD @@ -13,8 +13,7 @@ go_test( "delaying_queue_test.go", "rate_limitting_queue_test.go", ], - importpath = "k8s.io/client-go/util/workqueue", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/util/clock:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", @@ -34,7 +33,7 @@ go_library( ], importpath = "k8s.io/client-go/util/workqueue", deps = [ - "//vendor/github.com/juju/ratelimit:go_default_library", + "//vendor/golang.org/x/time/rate:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/clock:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", ], @@ -43,7 +42,6 @@ go_library( go_test( name = "go_default_xtest", srcs = ["queue_test.go"], - importpath = "k8s.io/client-go/util/workqueue_test", deps = ["//vendor/k8s.io/client-go/util/workqueue:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go b/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go index 35caed4fa..a5bed29e0 100644 --- a/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go +++ b/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go @@ -21,7 +21,7 @@ import ( "sync" "time" - "github.com/juju/ratelimit" + "golang.org/x/time/rate" ) type RateLimiter interface { @@ -40,19 +40,19 @@ func DefaultControllerRateLimiter() RateLimiter { return NewMaxOfRateLimiter( NewItemExponentialFailureRateLimiter(5*time.Millisecond, 1000*time.Second), // 10 qps, 100 bucket size. This is only for retry speed and its only the overall factor (not per item) - &BucketRateLimiter{Bucket: ratelimit.NewBucketWithRate(float64(10), int64(100))}, + &BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(10), 100)}, ) } // BucketRateLimiter adapts a standard bucket to the workqueue ratelimiter API type BucketRateLimiter struct { - *ratelimit.Bucket + *rate.Limiter } var _ RateLimiter = &BucketRateLimiter{} func (r *BucketRateLimiter) When(item interface{}) time.Duration { - return r.Bucket.Take(1) + return r.Limiter.Reserve().Delay() } func (r *BucketRateLimiter) NumRequeues(item interface{}) int { diff --git a/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go b/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go index 74fefd38b..c62ed32ef 100644 --- a/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go +++ b/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go @@ -89,7 +89,7 @@ type waitFor struct { // waitForPriorityQueue implements a priority queue for waitFor items. // -// waitForPriorityQueue implements heap.Interface. The item occuring next in +// waitForPriorityQueue implements heap.Interface. The item occurring next in // time (i.e., the item with the smallest readyAt) is at the root (index 0). // Peek returns this minimum item at index 0. Pop returns the minimum item after // it has been removed from the queue and placed at index Len()-1 by diff --git a/vendor/k8s.io/code-generator/.github/PULL_REQUEST_TEMPLATE.md b/vendor/k8s.io/code-generator/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..e559c074b --- /dev/null +++ b/vendor/k8s.io/code-generator/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,2 @@ +Sorry, we do not accept changes directly against this repository. Please see +CONTRIBUTING.md for information on where and how to contribute instead. diff --git a/vendor/k8s.io/code-generator/CONTRIBUTING.md b/vendor/k8s.io/code-generator/CONTRIBUTING.md new file mode 100644 index 000000000..bc4e7697e --- /dev/null +++ b/vendor/k8s.io/code-generator/CONTRIBUTING.md @@ -0,0 +1,7 @@ +# Contributing guidelines + +Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. + +This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/code-generator](https://git.k8s.io/kubernetes/staging/src/k8s.io/code-generator) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). + +Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/staging.md) for more information diff --git a/vendor/k8s.io/code-generator/Godeps/Godeps.json b/vendor/k8s.io/code-generator/Godeps/Godeps.json index 239636cbe..eae4db27a 100644 --- a/vendor/k8s.io/code-generator/Godeps/Godeps.json +++ b/vendor/k8s.io/code-generator/Godeps/Godeps.json @@ -1,262 +1,270 @@ { - "ImportPath": "k8s.io/code-generator", - "GoVersion": "go1.9", - "GodepVersion": "v79", - "Packages": [ - "./..." - ], - "Deps": [ - { - "ImportPath": "github.com/PuerkitoBio/purell", - "Rev": "8a290539e2e8629dbc4e6bad948158f790ec31f4" - }, - { - "ImportPath": "github.com/PuerkitoBio/urlesc", - "Rev": "5bd2802263f21d8788851d5305584c82a5c75d7e" - }, - { - "ImportPath": "github.com/emicklei/go-restful", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, - { - "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, - { - "ImportPath": "github.com/go-openapi/jsonpointer", - "Rev": "46af16f9f7b149af66e5d1bd010e3574dc06de98" - }, - { - "ImportPath": "github.com/go-openapi/jsonreference", - "Rev": "13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272" - }, - { - "ImportPath": "github.com/go-openapi/spec", - "Rev": "7abd5745472fff5eb3685386d5fb8bf38683154d" - }, - { - "ImportPath": "github.com/go-openapi/swag", - "Rev": "f3f9494671f93fcff853e3c6e9e948b3eb71e590" - }, - { - "ImportPath": "github.com/gogo/protobuf/gogoproto", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/compare", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/defaultcheck", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/description", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/embedcheck", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/enumstringer", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/equal", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/face", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/gostring", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/marshalto", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/oneofcheck", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/populate", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/size", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/stringer", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/testgen", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/union", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/plugin/unmarshal", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/proto", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/descriptor", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/generator", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/grpc", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/plugin", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/sortkeys", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/vanity", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/vanity/command", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/golang/glog", - "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" - }, - { - "ImportPath": "github.com/mailru/easyjson/buffer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jlexer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jwriter", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/spf13/pflag", - "Rev": "9ff6c6923cfffbcd502984b8e0c80539a94968b7" - }, - { - "ImportPath": "golang.org/x/net/idna", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/text/cases", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal/tag", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/language", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/runes", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/secure/bidirule", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/secure/precis", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/transform", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/unicode/bidi", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/unicode/norm", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/width", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "gopkg.in/yaml.v2", - "Rev": "53feefa2559fb8dfa8d81baad31be332c97d6c77" - }, - { - "ImportPath": "k8s.io/gengo/args", - "Rev": "b58fc7edb82e0c6ffc9b8aef61813c7261b785d4" - }, - { - "ImportPath": "k8s.io/gengo/examples/deepcopy-gen/generators", - "Rev": "b58fc7edb82e0c6ffc9b8aef61813c7261b785d4" - }, - { - "ImportPath": "k8s.io/gengo/examples/defaulter-gen/generators", - "Rev": "b58fc7edb82e0c6ffc9b8aef61813c7261b785d4" - }, - { - "ImportPath": "k8s.io/gengo/examples/import-boss/generators", - "Rev": "b58fc7edb82e0c6ffc9b8aef61813c7261b785d4" - }, - { - "ImportPath": "k8s.io/gengo/examples/set-gen/generators", - "Rev": "b58fc7edb82e0c6ffc9b8aef61813c7261b785d4" - }, - { - "ImportPath": "k8s.io/gengo/examples/set-gen/sets", - "Rev": "b58fc7edb82e0c6ffc9b8aef61813c7261b785d4" - }, - { - "ImportPath": "k8s.io/gengo/generator", - "Rev": "b58fc7edb82e0c6ffc9b8aef61813c7261b785d4" - }, - { - "ImportPath": "k8s.io/gengo/namer", - "Rev": "b58fc7edb82e0c6ffc9b8aef61813c7261b785d4" - }, - { - "ImportPath": "k8s.io/gengo/parser", - "Rev": "b58fc7edb82e0c6ffc9b8aef61813c7261b785d4" - }, - { - "ImportPath": "k8s.io/gengo/types", - "Rev": "b58fc7edb82e0c6ffc9b8aef61813c7261b785d4" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/generators", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" - } - ] + "ImportPath": "k8s.io/code-generator", + "GoVersion": "go1.9", + "GodepVersion": "v79", + "Packages": [ + "./..." + ], + "Deps": [ + { + "ImportPath": "github.com/PuerkitoBio/purell", + "Rev": "8a290539e2e8629dbc4e6bad948158f790ec31f4" + }, + { + "ImportPath": "github.com/PuerkitoBio/urlesc", + "Rev": "5bd2802263f21d8788851d5305584c82a5c75d7e" + }, + { + "ImportPath": "github.com/emicklei/go-restful", + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" + }, + { + "ImportPath": "github.com/emicklei/go-restful/log", + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" + }, + { + "ImportPath": "github.com/go-openapi/jsonpointer", + "Rev": "46af16f9f7b149af66e5d1bd010e3574dc06de98" + }, + { + "ImportPath": "github.com/go-openapi/jsonreference", + "Rev": "13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272" + }, + { + "ImportPath": "github.com/go-openapi/spec", + "Rev": "1de3e0542de65ad8d75452a595886fdd0befb363" + }, + { + "ImportPath": "github.com/go-openapi/swag", + "Rev": "f3f9494671f93fcff853e3c6e9e948b3eb71e590" + }, + { + "ImportPath": "github.com/gogo/protobuf/gogoproto", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/compare", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/defaultcheck", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/description", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/embedcheck", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/enumstringer", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/equal", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/face", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/gostring", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/marshalto", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/oneofcheck", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/populate", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/size", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/stringer", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/testgen", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/union", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/plugin/unmarshal", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/proto", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/descriptor", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/generator", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/grpc", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/plugin", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/sortkeys", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/vanity", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/vanity/command", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/golang/glog", + "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" + }, + { + "ImportPath": "github.com/mailru/easyjson/buffer", + "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" + }, + { + "ImportPath": "github.com/mailru/easyjson/jlexer", + "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" + }, + { + "ImportPath": "github.com/mailru/easyjson/jwriter", + "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" + }, + { + "ImportPath": "github.com/spf13/pflag", + "Rev": "4c012f6dcd9546820e378d0bdda4d8fc772cdfea" + }, + { + "ImportPath": "golang.org/x/net/idna", + "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + }, + { + "ImportPath": "golang.org/x/text/cases", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/internal", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/internal/tag", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/language", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/runes", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/secure/bidirule", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/secure/precis", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/transform", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/unicode/bidi", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/unicode/norm", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/width", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/tools/go/ast/astutil", + "Rev": "2382e3994d48b1d22acc2c86bcad0a2aff028e32" + }, + { + "ImportPath": "golang.org/x/tools/imports", + "Rev": "2382e3994d48b1d22acc2c86bcad0a2aff028e32" + }, + { + "ImportPath": "gopkg.in/yaml.v2", + "Rev": "670d4cfef0544295bc27a114dbac37980d83185a" + }, + { + "ImportPath": "k8s.io/gengo/args", + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" + }, + { + "ImportPath": "k8s.io/gengo/examples/deepcopy-gen/generators", + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" + }, + { + "ImportPath": "k8s.io/gengo/examples/defaulter-gen/generators", + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" + }, + { + "ImportPath": "k8s.io/gengo/examples/import-boss/generators", + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" + }, + { + "ImportPath": "k8s.io/gengo/examples/set-gen/generators", + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" + }, + { + "ImportPath": "k8s.io/gengo/examples/set-gen/sets", + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" + }, + { + "ImportPath": "k8s.io/gengo/generator", + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" + }, + { + "ImportPath": "k8s.io/gengo/namer", + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" + }, + { + "ImportPath": "k8s.io/gengo/parser", + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" + }, + { + "ImportPath": "k8s.io/gengo/types", + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" + }, + { + "ImportPath": "k8s.io/kube-openapi/pkg/common", + "Rev": "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" + }, + { + "ImportPath": "k8s.io/kube-openapi/pkg/generators", + "Rev": "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" + } + ] } diff --git a/vendor/k8s.io/code-generator/Godeps/OWNERS b/vendor/k8s.io/code-generator/Godeps/OWNERS new file mode 100644 index 000000000..3d49f3060 --- /dev/null +++ b/vendor/k8s.io/code-generator/Godeps/OWNERS @@ -0,0 +1,2 @@ +approvers: +- dep-approvers diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go index 85dd5b954..66667f1b8 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go @@ -16,15 +16,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package v1 import ( + unsafe "unsafe" + conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" example "k8s.io/code-generator/_examples/apiserver/apis/example" - unsafe "unsafe" ) func init() { diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversions.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversions.go deleted file mode 100644 index 183921e9d..000000000 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversions.go +++ /dev/null @@ -1,113 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by conversion-gen. Do not edit it manually! - -package v1 - -import ( - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - example "k8s.io/code-generator/_examples/apiserver/apis/example" - unsafe "unsafe" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(scheme *runtime.Scheme) error { - return scheme.AddGeneratedConversionFuncs( - Convert_v1_TestType_To_example_TestType, - Convert_example_TestType_To_v1_TestType, - Convert_v1_TestTypeList_To_example_TestTypeList, - Convert_example_TestTypeList_To_v1_TestTypeList, - Convert_v1_TestTypeStatus_To_example_TestTypeStatus, - Convert_example_TestTypeStatus_To_v1_TestTypeStatus, - ) -} - -func autoConvert_v1_TestType_To_example_TestType(in *TestType, out *example.TestType, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_TestTypeStatus_To_example_TestTypeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1_TestType_To_example_TestType is an autogenerated conversion function. -func Convert_v1_TestType_To_example_TestType(in *TestType, out *example.TestType, s conversion.Scope) error { - return autoConvert_v1_TestType_To_example_TestType(in, out, s) -} - -func autoConvert_example_TestType_To_v1_TestType(in *example.TestType, out *TestType, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_example_TestTypeStatus_To_v1_TestTypeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_example_TestType_To_v1_TestType is an autogenerated conversion function. -func Convert_example_TestType_To_v1_TestType(in *example.TestType, out *TestType, s conversion.Scope) error { - return autoConvert_example_TestType_To_v1_TestType(in, out, s) -} - -func autoConvert_v1_TestTypeList_To_example_TestTypeList(in *TestTypeList, out *example.TestTypeList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]example.TestType)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_TestTypeList_To_example_TestTypeList is an autogenerated conversion function. -func Convert_v1_TestTypeList_To_example_TestTypeList(in *TestTypeList, out *example.TestTypeList, s conversion.Scope) error { - return autoConvert_v1_TestTypeList_To_example_TestTypeList(in, out, s) -} - -func autoConvert_example_TestTypeList_To_v1_TestTypeList(in *example.TestTypeList, out *TestTypeList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]TestType)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_example_TestTypeList_To_v1_TestTypeList is an autogenerated conversion function. -func Convert_example_TestTypeList_To_v1_TestTypeList(in *example.TestTypeList, out *TestTypeList, s conversion.Scope) error { - return autoConvert_example_TestTypeList_To_v1_TestTypeList(in, out, s) -} - -func autoConvert_v1_TestTypeStatus_To_example_TestTypeStatus(in *TestTypeStatus, out *example.TestTypeStatus, s conversion.Scope) error { - out.Blah = in.Blah - return nil -} - -// Convert_v1_TestTypeStatus_To_example_TestTypeStatus is an autogenerated conversion function. -func Convert_v1_TestTypeStatus_To_example_TestTypeStatus(in *TestTypeStatus, out *example.TestTypeStatus, s conversion.Scope) error { - return autoConvert_v1_TestTypeStatus_To_example_TestTypeStatus(in, out, s) -} - -func autoConvert_example_TestTypeStatus_To_v1_TestTypeStatus(in *example.TestTypeStatus, out *TestTypeStatus, s conversion.Scope) error { - out.Blah = in.Blah - return nil -} - -// Convert_example_TestTypeStatus_To_v1_TestTypeStatus is an autogenerated conversion function. -func Convert_example_TestTypeStatus_To_v1_TestTypeStatus(in *example.TestTypeStatus, out *TestTypeStatus, s conversion.Scope) error { - return autoConvert_example_TestTypeStatus_To_v1_TestTypeStatus(in, out, s) -} diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.deepcopy.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.deepcopy.go index 96771586c..1e4402a82 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -47,9 +47,8 @@ func (in *TestType) DeepCopy() *TestType { func (in *TestType) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -81,9 +80,8 @@ func (in *TestTypeList) DeepCopy() *TestTypeList { func (in *TestTypeList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.defaults.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.defaults.go index 88d7af085..40d9ab00e 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.defaults.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.defaults.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by defaulter-gen. Do not edit it manually! +// Code generated by defaulter-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/zz_generated.deepcopy.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/zz_generated.deepcopy.go index 7f46d2bbe..291de95fc 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/zz_generated.deepcopy.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package example @@ -47,9 +47,8 @@ func (in *TestType) DeepCopy() *TestType { func (in *TestType) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -81,9 +80,8 @@ func (in *TestTypeList) DeepCopy() *TestTypeList { func (in *TestTypeList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go index 738d2d9bc..e73a0f630 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go @@ -16,15 +16,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by conversion-gen. Do not edit it manually! +// Code generated by conversion-gen. DO NOT EDIT. package v1 import ( + unsafe "unsafe" + conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" example2 "k8s.io/code-generator/_examples/apiserver/apis/example2" - unsafe "unsafe" ) func init() { diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.deepcopy.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.deepcopy.go index 96771586c..1e4402a82 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -47,9 +47,8 @@ func (in *TestType) DeepCopy() *TestType { func (in *TestType) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -81,9 +80,8 @@ func (in *TestTypeList) DeepCopy() *TestTypeList { func (in *TestTypeList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.defaults.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.defaults.go index 88d7af085..40d9ab00e 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.defaults.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.defaults.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by defaulter-gen. Do not edit it manually! +// Code generated by defaulter-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/zz_generated.deepcopy.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/zz_generated.deepcopy.go index 55746bfeb..284ecd2da 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/zz_generated.deepcopy.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package example2 @@ -47,9 +47,8 @@ func (in *TestType) DeepCopy() *TestType { func (in *TestType) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -81,9 +80,8 @@ func (in *TestTypeList) DeepCopy() *TestTypeList { func (in *TestTypeList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/clientset.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/clientset.go index cf71a6772..0cb86bf5c 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/clientset.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/clientset.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package internalversion import ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/doc.go index 6a6cae177..50398f9ef 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated clientset. package internalversion diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/clientset_generated.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/clientset_generated.go index 62ab5446f..efc0095b8 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/clientset_generated.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/clientset_generated.go @@ -14,6 +14,8 @@ 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 ( @@ -43,7 +45,15 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { fakePtr := testing.Fake{} fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) - fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil)) + fakePtr.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/doc.go index 8a3101e39..0bc260bca 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated fake clientset. package fake diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go index 910e117d7..ef0ba8fc2 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go @@ -14,6 +14,8 @@ 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 ( @@ -39,7 +41,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -51,5 +53,4 @@ func init() { func AddToScheme(scheme *runtime.Scheme) { exampleinternalversion.AddToScheme(scheme) secondexampleinternalversion.AddToScheme(scheme) - } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme/doc.go index 3d3ab5f4e..5c5c8debb 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package contains the scheme of the automatically generated clientset. package scheme diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme/register.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme/register.go index 5ee4dddba..e3b2cf663 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme/register.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme/register.go @@ -14,9 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package scheme import ( + os "os" + announced "k8s.io/apimachinery/pkg/apimachinery/announced" registered "k8s.io/apimachinery/pkg/apimachinery/registered" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,7 +29,6 @@ import ( serializer "k8s.io/apimachinery/pkg/runtime/serializer" example "k8s.io/code-generator/_examples/apiserver/apis/example/install" secondexample "k8s.io/code-generator/_examples/apiserver/apis/example2/install" - os "os" ) var Scheme = runtime.NewScheme() @@ -44,5 +47,4 @@ func init() { func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) { example.Install(groupFactoryRegistry, registry, scheme) secondexample.Install(groupFactoryRegistry, registry, scheme) - } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/doc.go index 861501975..b057e5201 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package internalversion diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/example_client.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/example_client.go index 906aa3f47..e99d41f98 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/example_client.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/example_client.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package internalversion import ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/doc.go index 63e2c8a08..87a1873ed 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_example_client.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_example_client.go index b8c081d95..71e9e11cb 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_example_client.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_example_client.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go index bee016ecf..4f268fb81 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/generated_expansion.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/generated_expansion.go index 189d4e23f..0cdfc3128 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/generated_expansion.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/generated_expansion.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package internalversion type TestTypeExpansion interface{} diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go index 5077c0ca7..6cfbcb36d 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package internalversion import ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/doc.go index 861501975..b057e5201 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package internalversion diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/example2_client.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/example2_client.go index 4939e1ec2..b0e673a83 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/example2_client.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/example2_client.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package internalversion import ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/doc.go index 63e2c8a08..87a1873ed 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_example2_client.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_example2_client.go index ea617dc8e..91751c249 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_example2_client.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_example2_client.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go index 0691a4956..3e9e6c7a8 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/generated_expansion.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/generated_expansion.go index 189d4e23f..0cdfc3128 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/generated_expansion.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/generated_expansion.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package internalversion type TestTypeExpansion interface{} diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go index 10725f494..77ab9a342 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package internalversion import ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/clientset.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/clientset.go index 86cca3b19..c0d337d2e 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/clientset.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/clientset.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package versioned import ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/doc.go index 9c6dfafa7..006b79214 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated clientset. package versioned diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/clientset_generated.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/clientset_generated.go index 2a692a5ca..fe657f08e 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/clientset_generated.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/clientset_generated.go @@ -14,6 +14,8 @@ 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 ( @@ -43,7 +45,15 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { fakePtr := testing.Fake{} fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) - fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil)) + fakePtr.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/doc.go index 8a3101e39..0bc260bca 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated fake clientset. package fake diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/register.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/register.go index b4a0ec52f..37c3ae6f8 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/register.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/register.go @@ -14,6 +14,8 @@ 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 ( @@ -39,7 +41,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -51,5 +53,4 @@ func init() { func AddToScheme(scheme *runtime.Scheme) { examplev1.AddToScheme(scheme) secondexamplev1.AddToScheme(scheme) - } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/doc.go index 3d3ab5f4e..5c5c8debb 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package contains the scheme of the automatically generated clientset. package scheme diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go index cad0ee75c..7c7daa6a2 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package scheme import ( @@ -39,7 +41,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -51,5 +53,4 @@ func init() { func AddToScheme(scheme *runtime.Scheme) { examplev1.AddToScheme(scheme) secondexamplev1.AddToScheme(scheme) - } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/doc.go index 95b44dfa8..d007a2903 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/example_client.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/example_client.go index 407fa9e26..4cead71e4 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/example_client.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/example_client.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/doc.go index 63e2c8a08..87a1873ed 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_example_client.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_example_client.go index 1a8636374..c8bbfe7c4 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_example_client.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_example_client.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go index 063d8cc79..a0779aaef 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/generated_expansion.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/generated_expansion.go index 4e2775e3a..3f19f4e33 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/generated_expansion.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/generated_expansion.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type TestTypeExpansion interface{} diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go index 70fded42a..0e51af495 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/doc.go index 95b44dfa8..d007a2903 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/example2_client.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/example2_client.go index 552a87f8a..c245b0716 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/example2_client.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/example2_client.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/doc.go index 63e2c8a08..87a1873ed 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go index 43ad4e988..2c52a1445 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go index 12bbdcbe5..9b005136f 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/generated_expansion.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/generated_expansion.go index 4e2775e3a..3f19f4e33 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/generated_expansion.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/generated_expansion.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type TestTypeExpansion interface{} diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go index fa39745ad..21e7e0805 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/interface.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/interface.go index 21d8874a0..e014cde14 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/interface.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package example diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/interface.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/interface.go index 21e19c623..ae5abf354 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/interface.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go index 0beb10fa7..d8cdead8b 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -27,7 +29,6 @@ import ( versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" v1 "k8s.io/code-generator/_examples/apiserver/listers/example/v1" - time "time" ) // TestTypeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/interface.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/interface.go index c6a044468..7aef7a4e2 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/interface.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package example diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/interface.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/interface.go index 21e19c623..ae5abf354 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/interface.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go index c07397c98..48d098232 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -27,7 +29,6 @@ import ( versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" v1 "k8s.io/code-generator/_examples/apiserver/listers/example2/v1" - time "time" ) // TestTypeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/factory.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/factory.go index 6b77479ee..767191e1b 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/factory.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/factory.go @@ -14,11 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package externalversions import ( + reflect "reflect" + sync "sync" + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -27,9 +31,6 @@ import ( example "k8s.io/code-generator/_examples/apiserver/informers/externalversions/example" example2 "k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2" internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" - reflect "reflect" - sync "sync" - time "time" ) type sharedInformerFactory struct { diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/generic.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/generic.go index 6fd29b0b4..e1273ab31 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/generic.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/generic.go @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package externalversions import ( "fmt" + schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" v1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go index 31df120f6..988e57b54 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -14,16 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalinterfaces import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" - time "time" ) type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/interface.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/interface.go index 836e7e01b..4f0aae2fd 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/interface.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package example diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/interface.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/interface.go index 5abe38523..1ac865c7a 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/interface.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalversion diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go index 5c1c1fe8d..f6991dfdd 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalversion import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -27,7 +29,6 @@ import ( clientset_internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" internalversion "k8s.io/code-generator/_examples/apiserver/listers/example/internalversion" - time "time" ) // TestTypeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/interface.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/interface.go index 0656ffbdc..843463ddd 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/interface.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package example diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/interface.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/interface.go index 5abe38523..1ac865c7a 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/interface.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalversion diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go index 2c00c3d82..613fd6933 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalversion import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -27,7 +29,6 @@ import ( clientset_internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" internalversion "k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion" - time "time" ) // TestTypeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/factory.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/factory.go index fee4e7910..737d5227f 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/factory.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/factory.go @@ -14,11 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalversion import ( + reflect "reflect" + sync "sync" + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -27,9 +31,6 @@ import ( example "k8s.io/code-generator/_examples/apiserver/informers/internalversion/example" example2 "k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2" internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" - reflect "reflect" - sync "sync" - time "time" ) type sharedInformerFactory struct { diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/generic.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/generic.go index bddd60f7b..d0822bbb1 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/generic.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/generic.go @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalversion import ( "fmt" + schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" example "k8s.io/code-generator/_examples/apiserver/apis/example" diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go index 973d73d1d..80e3603a0 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go @@ -14,16 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalinterfaces import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" - time "time" ) type NewInformerFunc func(internalversion.Interface, time.Duration) cache.SharedIndexInformer diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/internalversion/expansion_generated.go b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/internalversion/expansion_generated.go index f308c1673..6d32d9754 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/internalversion/expansion_generated.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/internalversion/expansion_generated.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package internalversion diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/internalversion/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/internalversion/testtype.go index ccfe8f80f..184c1649a 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/internalversion/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/internalversion/testtype.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package internalversion diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/v1/expansion_generated.go b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/v1/expansion_generated.go index d258c22f0..c5f4333d5 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/v1/expansion_generated.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/v1/expansion_generated.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/v1/testtype.go index 5e420f12c..9eee6a69e 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example/v1/testtype.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion/expansion_generated.go b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion/expansion_generated.go index f308c1673..6d32d9754 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion/expansion_generated.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion/expansion_generated.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package internalversion diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion/testtype.go index 35abf8661..24659a2d6 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion/testtype.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package internalversion diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/v1/expansion_generated.go b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/v1/expansion_generated.go index d258c22f0..c5f4333d5 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/v1/expansion_generated.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/v1/expansion_generated.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/v1/testtype.go index 65f5a58b9..64c5bb884 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/listers/example2/v1/testtype.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/crd/apis/example/v1/zz_generated.deepcopy.go b/vendor/k8s.io/code-generator/_examples/crd/apis/example/v1/zz_generated.deepcopy.go index 96771586c..1e4402a82 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/apis/example/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/code-generator/_examples/crd/apis/example/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -47,9 +47,8 @@ func (in *TestType) DeepCopy() *TestType { func (in *TestType) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -81,9 +80,8 @@ func (in *TestTypeList) DeepCopy() *TestTypeList { func (in *TestTypeList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/code-generator/_examples/crd/apis/example2/v1/zz_generated.deepcopy.go b/vendor/k8s.io/code-generator/_examples/crd/apis/example2/v1/zz_generated.deepcopy.go index 96771586c..1e4402a82 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/apis/example2/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/code-generator/_examples/crd/apis/example2/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -47,9 +47,8 @@ func (in *TestType) DeepCopy() *TestType { func (in *TestType) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -81,9 +80,8 @@ func (in *TestTypeList) DeepCopy() *TestTypeList { func (in *TestTypeList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/clientset.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/clientset.go index c0c581df8..fe1447d50 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/clientset.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/clientset.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package versioned import ( diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/doc.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/doc.go index 9c6dfafa7..006b79214 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/doc.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated clientset. package versioned diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/clientset_generated.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/clientset_generated.go index 7fd60de7b..ab158f772 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/clientset_generated.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/clientset_generated.go @@ -14,6 +14,8 @@ 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 ( @@ -43,7 +45,15 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { fakePtr := testing.Fake{} fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) - fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil)) + fakePtr.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} } diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/doc.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/doc.go index 8a3101e39..0bc260bca 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/doc.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated fake clientset. package fake diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/register.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/register.go index 79d925043..08ebf3b3c 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/register.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/register.go @@ -14,6 +14,8 @@ 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 ( @@ -39,7 +41,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -51,5 +53,4 @@ func init() { func AddToScheme(scheme *runtime.Scheme) { examplev1.AddToScheme(scheme) secondexamplev1.AddToScheme(scheme) - } diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/doc.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/doc.go index 3d3ab5f4e..5c5c8debb 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/doc.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package contains the scheme of the automatically generated clientset. package scheme diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/register.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/register.go index 1b55c1cf0..1a2abe6a0 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/register.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/register.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package scheme import ( @@ -39,7 +41,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -51,5 +53,4 @@ func init() { func AddToScheme(scheme *runtime.Scheme) { examplev1.AddToScheme(scheme) secondexamplev1.AddToScheme(scheme) - } diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/doc.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/doc.go index 95b44dfa8..d007a2903 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/doc.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/example_client.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/example_client.go index 1e282aa17..7dcb34bbd 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/example_client.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/example_client.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/doc.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/doc.go index 63e2c8a08..87a1873ed 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/doc.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_example_client.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_example_client.go index c7bf2dfc4..4e99c7cba 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_example_client.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_example_client.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go index 124396f2f..848b529a3 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/generated_expansion.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/generated_expansion.go index 4e2775e3a..3f19f4e33 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/generated_expansion.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/generated_expansion.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type TestTypeExpansion interface{} diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go index 460b68abf..d1175fe7c 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/doc.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/doc.go index 95b44dfa8..d007a2903 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/doc.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/example2_client.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/example2_client.go index a753b9689..71e7cd31a 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/example2_client.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/example2_client.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/doc.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/doc.go index 63e2c8a08..87a1873ed 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/doc.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go index 89e64d648..d63405ffe 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go index ccba168aa..07d26a277 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go @@ -14,6 +14,8 @@ 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 ( diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/generated_expansion.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/generated_expansion.go index 4e2775e3a..3f19f4e33 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/generated_expansion.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/generated_expansion.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type TestTypeExpansion interface{} diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go index bf6b4de43..056415cbe 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/interface.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/interface.go index d74e15f5c..51440cbc9 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/interface.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package example diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/interface.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/interface.go index d0a447bda..9378a06ba 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/interface.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go index 7fe59ce3e..d1e600c9a 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -27,7 +29,6 @@ import ( versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" v1 "k8s.io/code-generator/_examples/crd/listers/example/v1" - time "time" ) // TestTypeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/interface.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/interface.go index d58b0edb4..cf0d52cc8 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/interface.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package example diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/interface.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/interface.go index d0a447bda..9378a06ba 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/interface.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go index 303b34736..855dd1d75 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -27,7 +29,6 @@ import ( versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" v1 "k8s.io/code-generator/_examples/crd/listers/example2/v1" - time "time" ) // TestTypeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/factory.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/factory.go index 2d0b35f96..a843ddb9d 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/factory.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/factory.go @@ -14,11 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package externalversions import ( + reflect "reflect" + sync "sync" + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -27,9 +31,6 @@ import ( example "k8s.io/code-generator/_examples/crd/informers/externalversions/example" example2 "k8s.io/code-generator/_examples/crd/informers/externalversions/example2" internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" - reflect "reflect" - sync "sync" - time "time" ) type sharedInformerFactory struct { diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/generic.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/generic.go index 25acc5078..2e88773e8 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/generic.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/generic.go @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package externalversions import ( "fmt" + schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go index b8da4f9fc..e87f58032 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -14,16 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalinterfaces import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" - time "time" ) type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer diff --git a/vendor/k8s.io/code-generator/_examples/crd/listers/example/v1/expansion_generated.go b/vendor/k8s.io/code-generator/_examples/crd/listers/example/v1/expansion_generated.go index d258c22f0..c5f4333d5 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/listers/example/v1/expansion_generated.go +++ b/vendor/k8s.io/code-generator/_examples/crd/listers/example/v1/expansion_generated.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/crd/listers/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/listers/example/v1/testtype.go index ce132fd2f..c39f5a395 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/listers/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/listers/example/v1/testtype.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/crd/listers/example2/v1/expansion_generated.go b/vendor/k8s.io/code-generator/_examples/crd/listers/example2/v1/expansion_generated.go index d258c22f0..c5f4333d5 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/listers/example2/v1/expansion_generated.go +++ b/vendor/k8s.io/code-generator/_examples/crd/listers/example2/v1/expansion_generated.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/_examples/crd/listers/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/listers/example2/v1/testtype.go index a7ad6062c..cd239c2f9 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/listers/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/listers/example2/v1/testtype.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/BUILD b/vendor/k8s.io/code-generator/cmd/client-gen/BUILD index c4734980e..a164fdfb5 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/BUILD +++ b/vendor/k8s.io/code-generator/cmd/client-gen/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "client-gen", - importpath = "k8s.io/code-generator/cmd/client-gen", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( @@ -21,6 +20,7 @@ go_library( "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/code-generator/cmd/client-gen/args:go_default_library", "//vendor/k8s.io/code-generator/cmd/client-gen/generators:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", ], ) diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/args/BUILD b/vendor/k8s.io/code-generator/cmd/client-gen/args/BUILD index 03a93e447..30c6bbd1b 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/args/BUILD +++ b/vendor/k8s.io/code-generator/cmd/client-gen/args/BUILD @@ -17,6 +17,8 @@ go_library( deps = [ "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/code-generator/cmd/client-gen/types:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", + "//vendor/k8s.io/gengo/args:go_default_library", ], ) @@ -36,8 +38,7 @@ filegroup( go_test( name = "go_default_test", srcs = ["gvpackages_test.go"], - importpath = "k8s.io/code-generator/cmd/client-gen/args", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/code-generator/cmd/client-gen/types:go_default_library", diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go index fee31d90d..f45be1bb8 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go @@ -17,22 +17,23 @@ limitations under the License. package args import ( + "fmt" + "path" + "github.com/spf13/pflag" + "k8s.io/gengo/args" "k8s.io/code-generator/cmd/client-gen/types" + codegenutil "k8s.io/code-generator/pkg/util" ) +var DefaultInputDirs = []string{} + // ClientGenArgs is a wrapper for arguments to client-gen. type CustomArgs struct { // A sorted list of group versions to generate. For each of them the package path is found // in GroupVersionToInputPath. Groups []types.GroupVersions - // GroupVersionToInputPath is a map between GroupVersion and the path to the respective - // types.go, relative to InputBasePath. We still need GroupVersions in the - // struct because we need an order. - GroupVersionToInputPath map[types.GroupVersion]string - // The base for the path of GroupVersionToInputPath. - InputBasePath string // Overrides for which types should be included in the client. IncludedTypesOverrides map[types.GroupVersion][]string @@ -40,10 +41,7 @@ type CustomArgs struct { // ClientsetName is the name of the clientset to be generated. It's // populated from command-line arguments. ClientsetName string - // ClientsetOutputPath is the path the clientset will be generated at. It's - // populated from command-line arguments. - ClientsetOutputPath string - // ClientsetAPIPath is the default API path for generated clients. + // ClientsetAPIPath is the default API HTTP path for generated clients. ClientsetAPIPath string // ClientsetOnly determines if we should generate the clients for groups and // types along with the clientset. It's populated from command-line @@ -53,13 +51,70 @@ type CustomArgs struct { FakeClient bool } -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { - pflag.Var(NewGVPackagesValue(&ca.GroupVersionToInputPath, &ca.Groups, nil), "input", "group/versions that client-gen will generate clients for. At most one version per group is allowed. Specified in the format \"group1/version1,group2/version2...\".") +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{ + ClientsetName: "internalclientset", + ClientsetAPIPath: "/apis", + ClientsetOnly: false, + FakeClient: true, + } + genericArgs.CustomArgs = customArgs + genericArgs.InputDirs = DefaultInputDirs + + if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { + genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/clientset") + } + + return genericArgs, customArgs +} + +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet, inputBase string) { + gvsBuilder := NewGroupVersionsBuilder(&ca.Groups) + pflag.Var(NewGVPackagesValue(gvsBuilder, nil), "input", "group/versions that client-gen will generate clients for. At most one version per group is allowed. Specified in the format \"group1/version1,group2/version2...\".") pflag.Var(NewGVTypesValue(&ca.IncludedTypesOverrides, []string{}), "included-types-overrides", "list of group/version/type for which client should be generated. By default, client is generated for all types which have genclient in types.go. This overrides that. For each groupVersion in this list, only the types mentioned here will be included. The default check of genclient will be used for other group versions.") - pflag.StringVar(&ca.InputBasePath, "input-base", "k8s.io/kubernetes/pkg/apis", "base path to look for the api group.") - pflag.StringVarP(&ca.ClientsetName, "clientset-name", "n", "internalclientset", "the name of the generated clientset package.") - pflag.StringVarP(&ca.ClientsetAPIPath, "clientset-api-path", "", "", "the value of default API path.") - pflag.StringVar(&ca.ClientsetOutputPath, "clientset-path", "k8s.io/kubernetes/pkg/client/clientset_generated/", "the generated clientset will be output to /.") - pflag.BoolVar(&ca.ClientsetOnly, "clientset-only", false, "when set, client-gen only generates the clientset shell, without generating the individual typed clients") - pflag.BoolVar(&ca.FakeClient, "fake-clientset", true, "when set, client-gen will generate the fake clientset that can be used in tests") + pflag.Var(NewInputBasePathValue(gvsBuilder, inputBase), "input-base", "base path to look for the api group.") + pflag.StringVarP(&ca.ClientsetName, "clientset-name", "n", ca.ClientsetName, "the name of the generated clientset package.") + pflag.StringVarP(&ca.ClientsetAPIPath, "clientset-api-path", "", ca.ClientsetAPIPath, "the value of default API HTTP path, starting with / and without trailing /.") + pflag.BoolVar(&ca.ClientsetOnly, "clientset-only", ca.ClientsetOnly, "when set, client-gen only generates the clientset shell, without generating the individual typed clients") + pflag.BoolVar(&ca.FakeClient, "fake-clientset", ca.FakeClient, "when set, client-gen will generate the fake clientset that can be used in tests") + + // support old flags + fs.SetNormalizeFunc(mapFlagName("clientset-path", "output-package", fs.GetNormalizeFunc())) +} + +func Validate(genericArgs *args.GeneratorArgs) error { + customArgs := genericArgs.CustomArgs.(*CustomArgs) + + if len(genericArgs.OutputPackagePath) == 0 { + return fmt.Errorf("output package cannot be empty") + } + if len(customArgs.ClientsetName) == 0 { + return fmt.Errorf("clientset name cannot be empty") + } + if len(customArgs.ClientsetAPIPath) == 0 { + return fmt.Errorf("clientset API path cannot be empty") + } + + return nil +} + +// GroupVersionPackages returns a map from GroupVersion to the package with the types.go. +func (ca *CustomArgs) GroupVersionPackages() map[types.GroupVersion]string { + res := map[types.GroupVersion]string{} + for _, pkg := range ca.Groups { + for _, v := range pkg.Versions { + res[types.GroupVersion{Group: pkg.Group, Version: v.Version}] = v.Package + } + } + return res +} + +func mapFlagName(from, to string, old func(fs *pflag.FlagSet, name string) pflag.NormalizedName) func(fs *pflag.FlagSet, name string) pflag.NormalizedName { + return func(fs *pflag.FlagSet, name string) pflag.NormalizedName { + if name == from { + name = to + } + return old(fs, name) + } } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go b/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go index 4ffdd32ed..8da71d6f9 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go @@ -21,24 +21,48 @@ import ( "encoding/csv" "flag" "path" - "strings" - - "path/filepath" "sort" + "strings" "k8s.io/code-generator/cmd/client-gen/types" ) +type inputBasePathValue struct { + builder *groupVersionsBuilder +} + +var _ flag.Value = &inputBasePathValue{} + +func NewInputBasePathValue(builder *groupVersionsBuilder, def string) *inputBasePathValue { + v := &inputBasePathValue{ + builder: builder, + } + v.Set(def) + return v +} + +func (s *inputBasePathValue) Set(val string) error { + s.builder.importBasePath = val + return s.builder.update() +} + +func (s *inputBasePathValue) Type() string { + return "string" +} + +func (s *inputBasePathValue) String() string { + return s.builder.importBasePath +} + type gvPackagesValue struct { - gvToPath *map[types.GroupVersion]string - groups *[]types.GroupVersions - changed bool + builder *groupVersionsBuilder + groups []string + changed bool } -func NewGVPackagesValue(gvToPath *map[types.GroupVersion]string, groups *[]types.GroupVersions, def []string) *gvPackagesValue { +func NewGVPackagesValue(builder *groupVersionsBuilder, def []string) *gvPackagesValue { gvp := new(gvPackagesValue) - gvp.gvToPath = gvToPath - gvp.groups = groups + gvp.builder = builder if def != nil { if err := gvp.set(def); err != nil { panic(err) @@ -49,55 +73,69 @@ func NewGVPackagesValue(gvToPath *map[types.GroupVersion]string, groups *[]types var _ flag.Value = &gvPackagesValue{} -func readAsCSV(val string) ([]string, error) { - if val == "" { - return []string{}, nil +func (s *gvPackagesValue) set(vs []string) error { + if s.changed { + s.groups = append(s.groups, vs...) + } else { + s.groups = append([]string(nil), vs...) } - stringReader := strings.NewReader(val) - csvReader := csv.NewReader(stringReader) - return csvReader.Read() + + s.builder.groups = s.groups + return s.builder.update() } -func writeAsCSV(vals []string) (string, error) { - b := &bytes.Buffer{} - w := csv.NewWriter(b) - err := w.Write(vals) +func (s *gvPackagesValue) Set(val string) error { + vs, err := readAsCSV(val) if err != nil { - return "", err + return err } - w.Flush() - return strings.TrimSuffix(b.String(), "\n"), nil + if err := s.set(vs); err != nil { + return err + } + s.changed = true + return nil } -func (s *gvPackagesValue) set(vs []string) error { - if !s.changed { - *s.gvToPath = map[types.GroupVersion]string{} - *s.groups = []types.GroupVersions{} - } +func (s *gvPackagesValue) Type() string { + return "stringSlice" +} - var seenGroups = make(map[types.Group]*types.GroupVersions) - for _, g := range *s.groups { - seenGroups[g.Group] = &g +func (s *gvPackagesValue) String() string { + str, _ := writeAsCSV(s.groups) + return "[" + str + "]" +} + +type groupVersionsBuilder struct { + value *[]types.GroupVersions + groups []string + importBasePath string +} + +func NewGroupVersionsBuilder(groups *[]types.GroupVersions) *groupVersionsBuilder { + return &groupVersionsBuilder{ + value: groups, } +} - for _, v := range vs { +func (p *groupVersionsBuilder) update() error { + var seenGroups = make(map[types.Group]*types.GroupVersions) + for _, v := range p.groups { pth, gvString := parsePathGroupVersion(v) gv, err := types.ToGroupVersion(gvString) if err != nil { return err } + versionPkg := types.PackageVersion{Package: path.Join(p.importBasePath, pth, gv.Group.NonEmpty(), gv.Version.String()), Version: gv.Version} if group, ok := seenGroups[gv.Group]; ok { - seenGroups[gv.Group].Versions = append(group.Versions, gv.Version) + seenGroups[gv.Group].Versions = append(group.Versions, versionPkg) } else { seenGroups[gv.Group] = &types.GroupVersions{ PackageName: gv.Group.NonEmpty(), Group: gv.Group, - Versions: []types.Version{gv.Version}, + Versions: []types.PackageVersion{versionPkg}, } } - - (*s.gvToPath)[gv] = groupVersionPath(pth, gv.Group.String(), gv.Version.String()) } var groupNames []string @@ -105,39 +143,14 @@ func (s *gvPackagesValue) set(vs []string) error { groupNames = append(groupNames, groupName.String()) } sort.Strings(groupNames) - *s.groups = []types.GroupVersions{} + *p.value = []types.GroupVersions{} for _, groupName := range groupNames { - *s.groups = append(*s.groups, *seenGroups[types.Group(groupName)]) + *p.value = append(*p.value, *seenGroups[types.Group(groupName)]) } return nil } -func (s *gvPackagesValue) Set(val string) error { - vs, err := readAsCSV(val) - if err != nil { - return err - } - if err := s.set(vs); err != nil { - return err - } - s.changed = true - return nil -} - -func (s *gvPackagesValue) Type() string { - return "stringSlice" -} - -func (s *gvPackagesValue) String() string { - strs := make([]string, 0, len(*s.gvToPath)) - for gv, pth := range *s.gvToPath { - strs = append(strs, path.Join(pth, gv.Group.String(), gv.Version.String())) - } - str, _ := writeAsCSV(strs) - return "[" + str + "]" -} - func parsePathGroupVersion(pgvString string) (gvPath string, gvString string) { subs := strings.Split(pgvString, "/") length := len(subs) @@ -149,12 +162,22 @@ func parsePathGroupVersion(pgvString string) (gvPath string, gvString string) { } } -func groupVersionPath(gvPath string, group string, version string) (path string) { - // special case for the core group - if group == "api" { - path = filepath.Join("core", version) - } else { - path = filepath.Join(gvPath, group, version) +func readAsCSV(val string) ([]string, error) { + if val == "" { + return []string{}, nil } - return + stringReader := strings.NewReader(val) + csvReader := csv.NewReader(stringReader) + return csvReader.Read() +} + +func writeAsCSV(vals []string) (string, error) { + b := &bytes.Buffer{} + w := csv.NewWriter(b) + err := w.Write(vals) + if err != nil { + return "", err + } + w.Flush() + return strings.TrimSuffix(b.String(), "\n"), nil } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages_test.go b/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages_test.go index 1a88dbf32..8154c2eec 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages_test.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages_test.go @@ -31,6 +31,7 @@ func TestGVPackageFlag(t *testing.T) { tests := []struct { args []string def []string + importBasePath string expected map[types.GroupVersion]string expectedGroups []types.GroupVersions parseError string @@ -42,47 +43,56 @@ func TestGVPackageFlag(t *testing.T) { }, { args: []string{"foo/bar/v1", "foo/bar/v2", "foo/bar/", "foo/v1"}, - expected: map[types.GroupVersion]string{ - {Group: "bar", Version: ""}: "foo/bar", - {Group: "bar", Version: "v1"}: "foo/bar/v1", - {Group: "bar", Version: "v2"}: "foo/bar/v2", - {Group: "foo", Version: "v1"}: "foo/v1", - }, expectedGroups: []types.GroupVersions{ - {PackageName: "bar", Group: types.Group("bar"), Versions: []types.Version{types.Version("v1"), types.Version("v2"), types.Version("")}}, - {PackageName: "foo", Group: types.Group("foo"), Versions: []types.Version{types.Version("v1")}}, + {PackageName: "bar", Group: types.Group("bar"), Versions: []types.PackageVersion{ + {"v1", "foo/bar/v1"}, + {"v2", "foo/bar/v2"}, + {"", "foo/bar"}, + }}, + {PackageName: "foo", Group: types.Group("foo"), Versions: []types.PackageVersion{ + {"v1", "foo/v1"}, + }}, }, }, { args: []string{"foo/bar/v1", "foo/bar/v2", "foo/bar/", "foo/v1"}, def: []string{"foo/bar/v1alpha1", "foo/v1"}, - expected: map[types.GroupVersion]string{ - {Group: "bar", Version: ""}: "foo/bar", - {Group: "bar", Version: "v1"}: "foo/bar/v1", - {Group: "bar", Version: "v2"}: "foo/bar/v2", - {Group: "foo", Version: "v1"}: "foo/v1", - }, expectedGroups: []types.GroupVersions{ - {PackageName: "bar", Group: types.Group("bar"), Versions: []types.Version{types.Version("v1"), types.Version("v2"), types.Version("")}}, - {PackageName: "foo", Group: types.Group("foo"), Versions: []types.Version{types.Version("v1")}}, + {PackageName: "bar", Group: types.Group("bar"), Versions: []types.PackageVersion{ + {"v1", "foo/bar/v1"}, + {"v2", "foo/bar/v2"}, + {"", "foo/bar"}, + }}, + {PackageName: "foo", Group: types.Group("foo"), Versions: []types.PackageVersion{ + {"v1", "foo/v1"}, + }}, }, }, { args: []string{"api/v1", "api"}, - expected: map[types.GroupVersion]string{ - {Group: "api", Version: "v1"}: "core/v1", - {Group: "api", Version: ""}: "core", + expectedGroups: []types.GroupVersions{ + {PackageName: "core", Group: types.Group("api"), Versions: []types.PackageVersion{ + {"v1", "core/v1"}, + {"", "core"}, + }}, }, + }, + { + args: []string{"foo/v1"}, + importBasePath: "k8s.io/api", expectedGroups: []types.GroupVersions{ - {PackageName: "core", Group: types.Group("api"), Versions: []types.Version{types.Version("v1"), types.Version("")}}, + {PackageName: "foo", Group: types.Group("foo"), Versions: []types.PackageVersion{ + {"v1", "k8s.io/api/foo/v1"}, + }}, }, }, } for i, test := range tests { fs := pflag.NewFlagSet("testGVPackage", pflag.ContinueOnError) - gvp := map[types.GroupVersion]string{} groups := []types.GroupVersions{} - fs.Var(NewGVPackagesValue(&gvp, &groups, test.def), "input", "usage") + builder := NewGroupVersionsBuilder(&groups) + fs.Var(NewGVPackagesValue(builder, test.def), "input", "usage") + fs.Var(NewInputBasePathValue(builder, test.importBasePath), "input-base-path", "usage") args := []string{} for _, a := range test.args { @@ -99,9 +109,6 @@ func TestGVPackageFlag(t *testing.T) { } else if err != nil { t.Errorf("%d: expected nil error, got %v", i, err) } - if !reflect.DeepEqual(gvp, test.expected) { - t.Errorf("%d: expected %+v, got %+v", i, test.expected, gvp) - } if !reflect.DeepEqual(groups, test.expectedGroups) { t.Errorf("%d: expected groups %+v, got groups %+v", i, test.expectedGroups, groups) } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go index 5d314848f..74af0b31d 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go @@ -233,7 +233,7 @@ func packageForScheme(customArgs *clientgenargs.CustomArgs, clientsetPackage str NextGroup: for _, group := range customArgs.Groups { for _, v := range group.Versions { - if v == "" { + if v.String() == "" { internalClient = true break NextGroup } @@ -258,7 +258,7 @@ NextGroup: DefaultGen: generator.DefaultGen{ OptionalName: "register", }, - InputPackages: customArgs.GroupVersionToInputPath, + InputPackages: customArgs.GroupVersionPackages(), OutputPackage: schemePackage, OutputPath: filepath.Join(srcTreePath, schemePackage), Groups: customArgs.Groups, @@ -274,13 +274,13 @@ NextGroup: // applyGroupOverrides applies group name overrides to each package, if applicable. If there is a // comment of the form "// +groupName=somegroup" or "// +groupName=somegroup.foo.bar.io", use the -// first field (somegroup) as the name of the group when generating. +// first field (somegroup) as the name of the group in Go code, e.g. as the func name in a clientset. // // If the first field of the groupName is not unique within the clientset, use "// +groupName=unique func applyGroupOverrides(universe types.Universe, customArgs *clientgenargs.CustomArgs) { // Create a map from "old GV" to "new GV" so we know what changes we need to make. changes := make(map[clientgentypes.GroupVersion]clientgentypes.GroupVersion) - for gv, inputDir := range customArgs.GroupVersionToInputPath { + for gv, inputDir := range customArgs.GroupVersionPackages() { p := universe.Package(inputDir) if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { newGV := clientgentypes.GroupVersion{ @@ -296,7 +296,7 @@ func applyGroupOverrides(universe types.Universe, customArgs *clientgenargs.Cust for _, gvs := range customArgs.Groups { gv := clientgentypes.GroupVersion{ Group: gvs.Group, - Version: gvs.Versions[0], // we only need a version, and the first will do + Version: gvs.Versions[0].Version, // we only need a version, and the first will do } if newGV, ok := changes[gv]; ok { // There's an override, so use it. @@ -312,19 +312,6 @@ func applyGroupOverrides(universe types.Universe, customArgs *clientgenargs.Cust } } customArgs.Groups = newGroups - - // Modify customArgs.GroupVersionToInputPath based on the groupName overrides. - newGVToInputPath := make(map[clientgentypes.GroupVersion]string) - for gv, inputDir := range customArgs.GroupVersionToInputPath { - if newGV, ok := changes[gv]; ok { - // There's an override, so use it. - newGVToInputPath[newGV] = inputDir - } else { - // No override. - newGVToInputPath[gv] = inputDir - } - } - customArgs.GroupVersionToInputPath = newGVToInputPath } // Packages makes the client package definition. @@ -344,7 +331,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat gvToTypes := map[clientgentypes.GroupVersion][]*types.Type{} groupGoNames := make(map[clientgentypes.GroupVersion]string) - for gv, inputDir := range customArgs.GroupVersionToInputPath { + for gv, inputDir := range customArgs.GroupVersionPackages() { p := context.Universe.Package(path.Vendorless(inputDir)) // If there's a comment of the form "// +groupGoName=SomeUniqueShortName", use that as @@ -384,7 +371,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat } var packageList []generator.Package - clientsetPackage := filepath.Join(customArgs.ClientsetOutputPath, customArgs.ClientsetName) + clientsetPackage := filepath.Join(arguments.OutputPackagePath, customArgs.ClientsetName) packageList = append(packageList, packageForClientset(customArgs, clientsetPackage, groupGoNames, boilerplate)) packageList = append(packageList, packageForScheme(customArgs, clientsetPackage, arguments.OutputBase, groupGoNames, boilerplate)) @@ -398,11 +385,12 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat } orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} + gvPackages := customArgs.GroupVersionPackages() for _, group := range customArgs.Groups { for _, version := range group.Versions { - gv := clientgentypes.GroupVersion{Group: group.Group, Version: version} + gv := clientgentypes.GroupVersion{Group: group.Group, Version: version.Version} types := gvToTypes[gv] - inputPath := customArgs.GroupVersionToInputPath[gv] + inputPath := gvPackages[gv] packageList = append(packageList, packageForGroup(gv, orderer.OrderTypes(types), clientsetPackage, group.PackageName, groupGoNames[gv], customArgs.ClientsetAPIPath, arguments.OutputBase, inputPath, boilerplate)) if customArgs.FakeClient { packageList = append(packageList, fake.PackageForGroup(gv, orderer.OrderTypes(types), clientsetPackage, group.PackageName, groupGoNames[gv], inputPath, boilerplate)) diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go index 941cc35b0..ec439c2f7 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go @@ -84,12 +84,12 @@ func PackageForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, cli } } -func PackageForClientset(customArgs *clientgenargs.CustomArgs, fakeClientsetPackage string, groupGoNames map[clientgentypes.GroupVersion]string, boilerplate []byte) generator.Package { +func PackageForClientset(customArgs *clientgenargs.CustomArgs, clientsetPackage string, groupGoNames map[clientgentypes.GroupVersion]string, boilerplate []byte) generator.Package { return &generator.DefaultPackage{ // TODO: we'll generate fake clientset for different release in the future. // Package name and path are hard coded for now. PackageName: "fake", - PackagePath: filepath.Join(fakeClientsetPackage, "fake"), + PackagePath: filepath.Join(clientsetPackage, "fake"), HeaderText: boilerplate, PackageDocumentation: []byte( `// This package has the automatically generated fake clientset. @@ -107,17 +107,17 @@ func PackageForClientset(customArgs *clientgenargs.CustomArgs, fakeClientsetPack }, groups: customArgs.Groups, groupGoNames: groupGoNames, - fakeClientsetPackage: fakeClientsetPackage, + fakeClientsetPackage: clientsetPackage, outputPackage: "fake", imports: generator.NewImportTracker(), - realClientsetPackage: filepath.Join(customArgs.ClientsetOutputPath, customArgs.ClientsetName), + realClientsetPackage: clientsetPackage, }, &scheme.GenScheme{ DefaultGen: generator.DefaultGen{ OptionalName: "register", }, - InputPackages: customArgs.GroupVersionToInputPath, - OutputPackage: fakeClientsetPackage, + InputPackages: customArgs.GroupVersionPackages(), + OutputPackage: clientsetPackage, Groups: customArgs.Groups, GroupGoNames: groupGoNames, ImportTracker: generator.NewImportTracker(), diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go index b6a8de3f8..f77ab0570 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go @@ -63,7 +63,7 @@ func (g *genClientset) Imports(c *generator.Context) (imports []string) { groupClientPackage := filepath.Join(g.fakeClientsetPackage, "typed", group.PackageName, version.NonEmpty()) fakeGroupClientPackage := filepath.Join(groupClientPackage, "fake") - groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{group.Group, version}]) + groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{group.Group, version.Version}]) imports = append(imports, strings.ToLower(fmt.Sprintf("%s%s \"%s\"", groupAlias, version.NonEmpty(), groupClientPackage))) imports = append(imports, strings.ToLower(fmt.Sprintf("fake%s%s \"%s\"", groupAlias, version.NonEmpty(), fakeGroupClientPackage))) } @@ -87,7 +87,7 @@ func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Wr // perhaps we can adapt the go2ild framework to this kind of usage. sw := generator.NewSnippetWriter(w, c, "$", "$") - allGroups := clientgentypes.ToGroupVersionPackages(g.groups, g.groupGoNames) + allGroups := clientgentypes.ToGroupVersionInfo(g.groups, g.groupGoNames) sw.Do(common, nil) sw.Do(checkImpl, nil) @@ -127,7 +127,15 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { fakePtr := testing.Fake{} fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) - fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil)) + fakePtr.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go index a7fdf85d1..de5264660 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go @@ -59,7 +59,7 @@ func (g *genClientset) Imports(c *generator.Context) (imports []string) { for _, group := range g.groups { for _, version := range group.Versions { typedClientPath := filepath.Join(g.clientsetPackage, "typed", group.PackageName, version.NonEmpty()) - groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{group.Group, version}]) + groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{group.Group, version.Version}]) imports = append(imports, strings.ToLower(fmt.Sprintf("%s%s \"%s\"", groupAlias, version.NonEmpty(), typedClientPath))) } } @@ -71,7 +71,7 @@ func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Wr // perhaps we can adapt the go2ild framework to this kind of usage. sw := generator.NewSnippetWriter(w, c, "$", "$") - allGroups := clientgentypes.ToGroupVersionPackages(g.groups, g.groupGoNames) + allGroups := clientgentypes.ToGroupVersionInfo(g.groups, g.groupGoNames) m := map[string]interface{}{ "allGroups": allGroups, "Config": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Config"}), diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go index 3646794ef..8e569a84f 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go @@ -72,13 +72,10 @@ func (g *genGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer sw := generator.NewSnippetWriter(w, c, "$", "$") apiPath := func(group string) string { - if len(g.apiPath) > 0 { - return `"` + g.apiPath + `"` - } if group == "core" { return `"/api"` } - return `"/apis"` + return `"` + g.apiPath + `"` } groupName := g.group diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go index 416877c49..6000e40da 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go @@ -61,18 +61,18 @@ func (g *GenScheme) Imports(c *generator.Context) (imports []string) { imports = append(imports, g.ImportTracker.ImportLines()...) for _, group := range g.Groups { for _, version := range group.Versions { - packagePath := g.InputPackages[clientgentypes.GroupVersion{Group: group.Group, Version: version}] - groupAlias := strings.ToLower(g.GroupGoNames[clientgentypes.GroupVersion{group.Group, version}]) + packagePath := g.InputPackages[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}] + groupAlias := strings.ToLower(g.GroupGoNames[clientgentypes.GroupVersion{group.Group, version.Version}]) if g.CreateRegistry { // import the install package for internal clientsets instead of the type package with register.go - if version != "" { + if version.Version != "" { packagePath = filepath.Dir(packagePath) } packagePath = filepath.Join(packagePath, "install") imports = append(imports, strings.ToLower(fmt.Sprintf("%s \"%s\"", groupAlias, path.Vendorless(packagePath)))) break } else { - imports = append(imports, strings.ToLower(fmt.Sprintf("%s%s \"%s\"", groupAlias, version.NonEmpty(), path.Vendorless(packagePath)))) + imports = append(imports, strings.ToLower(fmt.Sprintf("%s%s \"%s\"", groupAlias, version.Version.NonEmpty(), path.Vendorless(packagePath)))) } } } @@ -82,7 +82,7 @@ func (g *GenScheme) Imports(c *generator.Context) (imports []string) { func (g *GenScheme) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { sw := generator.NewSnippetWriter(w, c, "$", "$") - allGroupVersions := clientgentypes.ToGroupVersionPackages(g.Groups, g.GroupGoNames) + allGroupVersions := clientgentypes.ToGroupVersionInfo(g.Groups, g.GroupGoNames) allInstallGroups := clientgentypes.ToGroupInstallPackages(g.Groups, g.GroupGoNames) m := map[string]interface{}{ @@ -149,9 +149,12 @@ func init() { // Install registers the API group and adds types to a scheme func Install(groupFactoryRegistry $.announcedAPIGroupFactoryRegistry|raw$, registry *$.registeredAPIRegistrationManager|raw$, scheme *$.runtimeScheme|raw$) { - $range .allInstallGroups$ $.InstallPackageAlias$.Install(groupFactoryRegistry, registry, scheme) - $end$ - $if .customRegister$ExtraInstall(groupFactoryRegistry, registry, scheme)$end$ + $- range .allInstallGroups$ + $.InstallPackageAlias$.Install(groupFactoryRegistry, registry, scheme) + $- end$ + $if .customRegister$ + ExtraInstall(groupFactoryRegistry, registry, scheme) + $end -$ } ` @@ -168,7 +171,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -178,8 +181,11 @@ func init() { // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. func AddToScheme(scheme *$.runtimeScheme|raw$) { - $range .allGroupVersions$ $.PackageAlias$.AddToScheme(scheme) - $end$ - $if .customRegister$ExtraAddToScheme(scheme)$end$ + $- range .allGroupVersions$ + $.PackageAlias$.AddToScheme(scheme) + $- end$ + $if .customRegister$ + ExtraAddToScheme(scheme) + $end -$ } ` diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/BUILD b/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/BUILD index e25c24631..4c6767bf9 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/BUILD +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["tags_test.go"], - importpath = "k8s.io/code-generator/cmd/client-gen/generators/util", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/main.go b/vendor/k8s.io/code-generator/cmd/client-gen/main.go index 72404808e..22c28e35f 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/main.go @@ -19,49 +19,43 @@ package main import ( "flag" - "path" "path/filepath" "github.com/golang/glog" "github.com/spf13/pflag" + "k8s.io/gengo/args" - clientgenargs "k8s.io/code-generator/cmd/client-gen/args" + generatorargs "k8s.io/code-generator/cmd/client-gen/args" "k8s.io/code-generator/cmd/client-gen/generators" - "k8s.io/gengo/args" + "k8s.io/code-generator/pkg/util" ) func main() { - arguments := args.Default().WithoutDefaultFlagParsing() - - // Custom args. - customArgs := &clientgenargs.CustomArgs{} - customArgs.AddFlags(pflag.CommandLine) + genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. - arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt") - arguments.CustomArgs = customArgs - arguments.InputDirs = []string{ - "k8s.io/apimachinery/pkg/fields", - "k8s.io/apimachinery/pkg/labels", - "k8s.io/apimachinery/pkg/watch", - "k8s.io/apimachinery/pkg/apimachinery/registered", - } + // TODO: move this out of client-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/clientset_generated/" - // Register default flags. We do this manually here because we have to override InputDirs below after additional - // input dirs are parse fromt he command-line. - arguments.AddFlags(pflag.CommandLine) + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine, "k8s.io/kubernetes/pkg/apis") // TODO: move this input path out of client-gen + flag.Set("logtostderr", "true") pflag.CommandLine.AddGoFlagSet(flag.CommandLine) pflag.Parse() - // Prefix with InputBaseDir and add client dirs as input dirs. - for gv, pth := range customArgs.GroupVersionToInputPath { - customArgs.GroupVersionToInputPath[gv] = path.Join(customArgs.InputBasePath, pth) + // add group version package as input dirs for gengo + for _, pkg := range customArgs.Groups { + for _, v := range pkg.Versions { + genericArgs.InputDirs = append(genericArgs.InputDirs, v.Package) + } } - for _, pkg := range customArgs.GroupVersionToInputPath { - arguments.InputDirs = append(arguments.InputDirs, pkg) + + if err := generatorargs.Validate(genericArgs); err != nil { + glog.Fatalf("Error: %v", err) } - if err := arguments.Execute( + if err := genericArgs.Execute( generators.NameSystems(), generators.DefaultNameSystem(), generators.Packages, diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/types/BUILD b/vendor/k8s.io/code-generator/cmd/client-gen/types/BUILD index 681d4baf8..8ed06ceef 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/types/BUILD +++ b/vendor/k8s.io/code-generator/cmd/client-gen/types/BUILD @@ -19,8 +19,7 @@ go_library( go_test( name = "go_default_test", srcs = ["helpers_test.go"], - importpath = "k8s.io/code-generator/cmd/client-gen/types", - library = ":go_default_library", + embed = [":go_default_library"], ) filegroup( diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/types/helpers.go b/vendor/k8s.io/code-generator/cmd/client-gen/types/helpers.go index bc4d9dea3..33e6ac451 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/types/helpers.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/types/helpers.go @@ -75,27 +75,27 @@ func (a sortableSliceOfVersions) Less(i, j int) bool { // Determine the default version among versions. If a user calls a group client // without specifying the version (e.g., c.Core(), instead of c.CoreV1()), the // default version will be returned. -func defaultVersion(versions []Version) Version { +func defaultVersion(versions []PackageVersion) Version { var versionStrings []string for _, version := range versions { - versionStrings = append(versionStrings, string(version)) + versionStrings = append(versionStrings, version.Version.String()) } sort.Sort(sortableSliceOfVersions(versionStrings)) return Version(versionStrings[len(versionStrings)-1]) } -// ToGroupVersionPackages is a helper function used by generators for groups. -func ToGroupVersionPackages(groups []GroupVersions, groupGoNames map[GroupVersion]string) []GroupVersionPackage { - var groupVersionPackages []GroupVersionPackage +// ToGroupVersionInfo is a helper function used by generators for groups. +func ToGroupVersionInfo(groups []GroupVersions, groupGoNames map[GroupVersion]string) []GroupVersionInfo { + var groupVersionPackages []GroupVersionInfo for _, group := range groups { defaultVersion := defaultVersion(group.Versions) for _, version := range group.Versions { - groupGoName := groupGoNames[GroupVersion{Group: group.Group, Version: version}] - groupVersionPackages = append(groupVersionPackages, GroupVersionPackage{ + groupGoName := groupGoNames[GroupVersion{Group: group.Group, Version: version.Version}] + groupVersionPackages = append(groupVersionPackages, GroupVersionInfo{ Group: Group(namer.IC(group.Group.NonEmpty())), - Version: Version(namer.IC(version.String())), - PackageAlias: strings.ToLower(groupGoName + version.NonEmpty()), - IsDefaultVersion: version == defaultVersion && version != "", + Version: Version(namer.IC(version.Version.String())), + PackageAlias: strings.ToLower(groupGoName + version.Version.NonEmpty()), + IsDefaultVersion: version.Version == defaultVersion && version.Version != "", GroupGoName: groupGoName, LowerCaseGroupGoName: namer.IL(groupGoName), }) diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/types/types.go b/vendor/k8s.io/code-generator/cmd/client-gen/types/types.go index a2a87b1e1..17fd6e92a 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/types/types.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/types/types.go @@ -42,20 +42,26 @@ func (g Group) NonEmpty() string { return string(g) } +type PackageVersion struct { + Version + // The fully qualified package, e.g. k8s.io/kubernetes/pkg/apis/apps, where the types.go is found. + Package string +} + type GroupVersion struct { Group Group Version Version } type GroupVersions struct { - // The package name of the group, e.g. extensions or networking + // The name of the package for this group, e.g. apps. PackageName string Group Group - Versions []Version + Versions []PackageVersion } -// GroupVersionPackage contains group name, version name, and the package name client-gen will generate for this group version. -type GroupVersionPackage struct { +// GroupVersionInfo contains all the info around a group version. +type GroupVersionInfo struct { Group Group Version Version // If a user calls a group client without specifying the version (e.g., diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/BUILD b/vendor/k8s.io/code-generator/cmd/conversion-gen/BUILD index eea6e9152..361d8fbe6 100644 --- a/vendor/k8s.io/code-generator/cmd/conversion-gen/BUILD +++ b/vendor/k8s.io/code-generator/cmd/conversion-gen/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "conversion-gen", - importpath = "k8s.io/code-generator/cmd/conversion-gen", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( @@ -19,7 +18,9 @@ go_library( deps = [ "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/code-generator/cmd/conversion-gen/args:go_default_library", "//vendor/k8s.io/code-generator/cmd/conversion-gen/generators:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", ], ) @@ -35,6 +36,7 @@ filegroup( name = "all-srcs", srcs = [ ":package-srcs", + "//staging/src/k8s.io/code-generator/cmd/conversion-gen/args:all-srcs", "//staging/src/k8s.io/code-generator/cmd/conversion-gen/generators:all-srcs", ], tags = ["automanaged"], diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/args/BUILD b/vendor/k8s.io/code-generator/cmd/conversion-gen/args/BUILD new file mode 100644 index 000000000..e06b0b1bc --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/conversion-gen/args/BUILD @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["args.go"], + importpath = "k8s.io/code-generator/cmd/conversion-gen/args", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/gengo/args:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/conversion-gen/args/args.go new file mode 100644 index 000000000..3b7b0123d --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/conversion-gen/args/args.go @@ -0,0 +1,83 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" +) + +// DefaultBasePeerDirs are the peer-dirs nearly everybody will use, i.e. those coming from +// apimachinery. +var DefaultBasePeerDirs = []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1", + "k8s.io/apimachinery/pkg/conversion", + "k8s.io/apimachinery/pkg/runtime", +} + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs struct { + // Base peer dirs which nearly everybody will use, i.e. outside of Kubernetes core. Peer dirs + // are declared to make the generator pick up manually written conversion funcs from external + // packages. + BasePeerDirs []string + + // Custom peer dirs which are application specific. Peer dirs are declared to make the + // generator pick up manually written conversion funcs from external packages. + ExtraPeerDirs []string + + // Skipunsafe indicates whether to generate unsafe conversions to improve the efficiency + // of these operations. The unsafe operation is a direct pointer assignment via unsafe + // (within the allowed uses of unsafe) and is equivalent to a proposed Golang change to + // allow structs that are identical to be assigned to each other. + SkipUnsafe bool +} + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{ + BasePeerDirs: DefaultBasePeerDirs, + SkipUnsafe: false, + } + genericArgs.CustomArgs = customArgs + genericArgs.OutputFileBaseName = "conversion_generated" + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { + pflag.CommandLine.StringSliceVar(&ca.BasePeerDirs, "base-peer-dirs", ca.BasePeerDirs, + "Comma-separated list of apimachinery import paths which are considered, after tag-specified peers, for conversions. Only change these if you have very good reasons.") + pflag.CommandLine.StringSliceVar(&ca.ExtraPeerDirs, "extra-peer-dirs", ca.ExtraPeerDirs, + "Application specific comma-separated list of import paths which are considered, after tag-specified peers and base-peer-dirs, for conversions.") + pflag.CommandLine.BoolVar(&ca.SkipUnsafe, "skip-unsafe", ca.SkipUnsafe, + "If true, will not generate code using unsafe pointer conversions; resulting code may be slower.") +} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + _ = genericArgs.CustomArgs.(*CustomArgs) + + if len(genericArgs.OutputFileBaseName) == 0 { + return fmt.Errorf("output file base name cannot be empty") + } + + return nil +} diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/BUILD b/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/BUILD index 49290d578..fd9feff40 100644 --- a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/BUILD +++ b/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/BUILD @@ -11,6 +11,7 @@ go_library( importpath = "k8s.io/code-generator/cmd/conversion-gen/generators", deps = [ "//vendor/github.com/golang/glog:go_default_library", + "//vendor/k8s.io/code-generator/cmd/conversion-gen/args:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", "//vendor/k8s.io/gengo/generator:go_default_library", "//vendor/k8s.io/gengo/namer:go_default_library", diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go b/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go index ed7ab27eb..3c16a85bf 100644 --- a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go +++ b/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go @@ -30,31 +30,9 @@ import ( "k8s.io/gengo/types" "github.com/golang/glog" -) - -// DefaultBasePeerDirs are the peer-dirs nearly everybody will use, i.e. those coming from -// apimachinery. -var DefaultBasePeerDirs = []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1", - "k8s.io/apimachinery/pkg/conversion", - "k8s.io/apimachinery/pkg/runtime", -} -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs struct { - // Base peer dirs which nearly everybody will use, i.e. outside of Kubernetes core. - BasePeerDirs []string - - // Custom peer dirs which are application specific. Always consider these as - // last-ditch possibilities for conversions. - ExtraPeerDirs []string // - - // Skipunsafe indicates whether to generate unsafe conversions to improve the efficiency - // of these operations. The unsafe operation is a direct pointer assignment via unsafe - // (within the allowed uses of unsafe) and is equivalent to a proposed Golang change to - // allow structs that are identical to be assigned to each other. - SkipUnsafe bool -} + conversionargs "k8s.io/code-generator/cmd/conversion-gen/args" +) // These are the comment tags that carry parameters for conversion generation. const ( @@ -215,7 +193,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat packages := generator.Packages{} header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) - header = append(header, []byte("\n// This file was autogenerated by conversion-gen. Do not edit it manually!\n\n")...) // Accumulate pre-existing conversion functions. // TODO: This is too ad-hoc. We need a better way. @@ -264,7 +241,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat continue } skipUnsafe := false - if customArgs, ok := arguments.CustomArgs.(*CustomArgs); ok { + if customArgs, ok := arguments.CustomArgs.(*conversionargs.CustomArgs); ok { peerPkgs = append(peerPkgs, customArgs.BasePeerDirs...) peerPkgs = append(peerPkgs, customArgs.ExtraPeerDirs...) skipUnsafe = customArgs.SkipUnsafe @@ -593,12 +570,6 @@ func argsFromType(inType, outType *types.Type) generator.Args { } } -func defaultingArgsFromType(inType *types.Type) generator.Args { - return generator.Args{ - "inType": inType, - } -} - const nameTmpl = "Convert_$.inType|publicIT$_To_$.outType|publicIT$" func (g *genConversion) preexists(inType, outType *types.Type) (*types.Type, bool) { diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go b/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go index aab38ad1a..f2b91cc2e 100644 --- a/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go @@ -35,37 +35,37 @@ limitations under the License. package main import ( + "flag" "path/filepath" - "k8s.io/code-generator/cmd/conversion-gen/generators" - "k8s.io/gengo/args" - "github.com/golang/glog" "github.com/spf13/pflag" + "k8s.io/gengo/args" + + generatorargs "k8s.io/code-generator/cmd/conversion-gen/args" + "k8s.io/code-generator/cmd/conversion-gen/generators" + "k8s.io/code-generator/pkg/util" ) func main() { - arguments := args.Default() - - // Custom args. - customArgs := &generators.CustomArgs{ - BasePeerDirs: generators.DefaultBasePeerDirs, - SkipUnsafe: false, - } - pflag.CommandLine.StringSliceVar(&customArgs.BasePeerDirs, "base-peer-dirs", customArgs.BasePeerDirs, - "Comma-separated list of apimachinery import paths which are considered, after tag-specified peers, for conversions. Only change these if you have very good reasons.") - pflag.CommandLine.StringSliceVar(&customArgs.ExtraPeerDirs, "extra-peer-dirs", customArgs.ExtraPeerDirs, - "Application specific comma-separated list of import paths which are considered, after tag-specified peers and base-peer-dirs, for conversions.") - pflag.CommandLine.BoolVar(&customArgs.SkipUnsafe, "skip-unsafe", customArgs.SkipUnsafe, - "If true, will not generate code using unsafe pointer conversions; resulting code may be slower.") + genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. - arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt") - arguments.OutputFileBaseName = "conversion_generated" - arguments.CustomArgs = customArgs + // TODO: move this out of conversion-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + glog.Fatalf("Error: %v", err) + } // Run it. - if err := arguments.Execute( + if err := genericArgs.Execute( generators.NameSystems(), generators.DefaultNameSystem(), generators.Packages, diff --git a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/BUILD b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/BUILD index d02e19af5..2ddfd82ef 100644 --- a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/BUILD +++ b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "deepcopy-gen", - importpath = "k8s.io/code-generator/cmd/deepcopy-gen", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( @@ -19,6 +18,8 @@ go_library( deps = [ "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/code-generator/cmd/deepcopy-gen/args:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", "//vendor/k8s.io/gengo/examples/deepcopy-gen/generators:go_default_library", ], @@ -33,6 +34,9 @@ filegroup( filegroup( name = "all-srcs", - srcs = [":package-srcs"], + srcs = [ + ":package-srcs", + "//staging/src/k8s.io/code-generator/cmd/deepcopy-gen/args:all-srcs", + ], tags = ["automanaged"], ) diff --git a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/BUILD b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/BUILD new file mode 100644 index 000000000..cf86fb776 --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/BUILD @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["args.go"], + importpath = "k8s.io/code-generator/cmd/deepcopy-gen/args", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/gengo/args:go_default_library", + "//vendor/k8s.io/gengo/examples/deepcopy-gen/generators:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/args.go new file mode 100644 index 000000000..789713012 --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/args.go @@ -0,0 +1,54 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" + "k8s.io/gengo/examples/deepcopy-gen/generators" +) + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs generators.CustomArgs + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{} + genericArgs.CustomArgs = (*generators.CustomArgs)(customArgs) // convert to upstream type to make type-casts work there + genericArgs.OutputFileBaseName = "deepcopy_generated" + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { + pflag.CommandLine.StringSliceVar(&ca.BoundingDirs, "bounding-dirs", ca.BoundingDirs, + "Comma-separated list of import paths which bound the types for which deep-copies will be generated.") +} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + _ = genericArgs.CustomArgs.(*generators.CustomArgs) + + if len(genericArgs.OutputFileBaseName) == 0 { + return fmt.Errorf("output file base name cannot be empty") + } + + return nil +} diff --git a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go index 75cd29b2e..cce65b772 100644 --- a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go @@ -43,30 +43,37 @@ limitations under the License. package main import ( + "flag" "path/filepath" + "github.com/golang/glog" + "github.com/spf13/pflag" "k8s.io/gengo/args" "k8s.io/gengo/examples/deepcopy-gen/generators" - "github.com/golang/glog" - "github.com/spf13/pflag" + generatorargs "k8s.io/code-generator/cmd/deepcopy-gen/args" + "k8s.io/code-generator/pkg/util" ) func main() { - arguments := args.Default() - - // Custom args. - customArgs := &generators.CustomArgs{} - pflag.CommandLine.StringSliceVar(&customArgs.BoundingDirs, "bounding-dirs", customArgs.BoundingDirs, - "Comma-separated list of import paths which bound the types for which deep-copies will be generated.") + genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. - arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt") - arguments.OutputFileBaseName = "deepcopy_generated" - arguments.CustomArgs = customArgs + // TODO: move this out of deepcopy-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + glog.Fatalf("Error: %v", err) + } // Run it. - if err := arguments.Execute( + if err := genericArgs.Execute( generators.NameSystems(), generators.DefaultNameSystem(), generators.Packages, diff --git a/vendor/k8s.io/code-generator/cmd/defaulter-gen/BUILD b/vendor/k8s.io/code-generator/cmd/defaulter-gen/BUILD index 947327e96..f362fe314 100644 --- a/vendor/k8s.io/code-generator/cmd/defaulter-gen/BUILD +++ b/vendor/k8s.io/code-generator/cmd/defaulter-gen/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "defaulter-gen", - importpath = "k8s.io/code-generator/cmd/defaulter-gen", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( @@ -19,6 +18,8 @@ go_library( deps = [ "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/code-generator/cmd/defaulter-gen/args:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", "//vendor/k8s.io/gengo/examples/defaulter-gen/generators:go_default_library", ], @@ -33,6 +34,9 @@ filegroup( filegroup( name = "all-srcs", - srcs = [":package-srcs"], + srcs = [ + ":package-srcs", + "//staging/src/k8s.io/code-generator/cmd/defaulter-gen/args:all-srcs", + ], tags = ["automanaged"], ) diff --git a/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/BUILD b/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/BUILD new file mode 100644 index 000000000..6f9bb87c5 --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/BUILD @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["args.go"], + importpath = "k8s.io/code-generator/cmd/defaulter-gen/args", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/gengo/args:go_default_library", + "//vendor/k8s.io/gengo/examples/defaulter-gen/generators:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/args.go new file mode 100644 index 000000000..3c5a042c7 --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/args.go @@ -0,0 +1,54 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" + "k8s.io/gengo/examples/defaulter-gen/generators" +) + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs generators.CustomArgs + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{} + genericArgs.CustomArgs = (*generators.CustomArgs)(customArgs) // convert to upstream type to make type-casts work there + genericArgs.OutputFileBaseName = "zz_generated.defaults" + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { + pflag.CommandLine.StringSliceVar(&ca.ExtraPeerDirs, "extra-peer-dirs", ca.ExtraPeerDirs, + "Comma-separated list of import paths which are considered, after tag-specified peers, for conversions.") +} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + _ = genericArgs.CustomArgs.(*generators.CustomArgs) + + if len(genericArgs.OutputFileBaseName) == 0 { + return fmt.Errorf("output file base name cannot be empty") + } + + return nil +} diff --git a/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go b/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go index 119ca1190..9d33f700b 100644 --- a/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go @@ -42,32 +42,37 @@ limitations under the License. package main import ( + "flag" "path/filepath" + "github.com/golang/glog" + "github.com/spf13/pflag" "k8s.io/gengo/args" "k8s.io/gengo/examples/defaulter-gen/generators" - "github.com/golang/glog" - "github.com/spf13/pflag" + generatorargs "k8s.io/code-generator/cmd/defaulter-gen/args" + "k8s.io/code-generator/pkg/util" ) func main() { - arguments := args.Default() - - // Custom args. - customArgs := &generators.CustomArgs{ - ExtraPeerDirs: []string{}, - } - pflag.CommandLine.StringSliceVar(&customArgs.ExtraPeerDirs, "extra-peer-dirs", customArgs.ExtraPeerDirs, - "Comma-separated list of import paths which are considered, after tag-specified peers, for conversions.") + genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. - arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt") - arguments.OutputFileBaseName = "zz_generated.defaults" - arguments.CustomArgs = customArgs + // TODO: move this out of defaulter-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + glog.Fatalf("Error: %v", err) + } // Run it. - if err := arguments.Execute( + if err := genericArgs.Execute( generators.NameSystems(), generators.DefaultNameSystem(), generators.Packages, diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/BUILD b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/BUILD index 4ad6c27bf..fcd3cfaa2 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/BUILD +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "go-to-protobuf", - importpath = "k8s.io/code-generator/cmd/go-to-protobuf", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go index ce1756c11..847a6a5a0 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go @@ -29,6 +29,7 @@ var g = protobuf.New() func init() { g.BindFlags(flag.CommandLine) + goflag.Set("logtostderr", "true") flag.CommandLine.AddGoFlagSet(goflag.CommandLine) } diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/BUILD b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/BUILD index 5750481bf..127a791db 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/BUILD +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/BUILD @@ -21,6 +21,7 @@ go_library( deps = [ "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", "//vendor/k8s.io/code-generator/third_party/forked/golang/reflect:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", "//vendor/k8s.io/gengo/generator:go_default_library", @@ -33,8 +34,7 @@ go_library( go_test( name = "go_default_test", srcs = ["namer_test.go"], - importpath = "k8s.io/code-generator/cmd/go-to-protobuf/protobuf", - library = ":go_default_library", + embed = [":go_default_library"], ) filegroup( diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go index 0c2573bf2..555073225 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go @@ -27,6 +27,7 @@ import ( "path/filepath" "strings" + "k8s.io/code-generator/pkg/util" "k8s.io/gengo/args" "k8s.io/gengo/generator" "k8s.io/gengo/namer" @@ -55,7 +56,7 @@ func New() *Generator { sourceTree := args.DefaultSourceTree() common := args.GeneratorArgs{ OutputBase: sourceTree, - GoHeaderFilePath: filepath.Join(sourceTree, "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt"), + GoHeaderFilePath: filepath.Join(sourceTree, util.BoilerplatePath()), } defaultProtoImport := filepath.Join(sourceTree, "k8s.io", "kubernetes", "vendor", "github.com", "gogo", "protobuf", "protobuf") cwd, err := os.Getwd() @@ -73,7 +74,8 @@ func New() *Generator { `+k8s.io/apimachinery/pkg/runtime/schema`, `+k8s.io/apimachinery/pkg/runtime`, `k8s.io/apimachinery/pkg/apis/meta/v1`, - `k8s.io/apimachinery/pkg/apis/meta/v1alpha1`, + `k8s.io/apimachinery/pkg/apis/meta/v1beta1`, + `k8s.io/apimachinery/pkg/apis/testapigroup/v1`, }, ","), Packages: "", DropEmbeddedFields: "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta", diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go index 94ea7ff66..0e7a7d8ec 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go @@ -128,7 +128,7 @@ func isProtoable(seen map[*types.Type]bool, t *types.Type) bool { case types.Interface: return false default: - log.Printf("WARNING: type %q is not protable: %s", t.Kind, t.Name) + log.Printf("WARNING: type %q is not portable: %s", t.Kind, t.Name) return false } } @@ -516,10 +516,13 @@ func memberTypeToProtobufField(locator ProtobufLocator, field *protoField, t *ty log.Printf("failed to alias: %s %s: err %v", t.Name, t.Underlying.Name, err) return err } - if field.Extras == nil { - field.Extras = make(map[string]string) + // If this is not an alias to a slice, cast to the alias + if !field.Repeated { + if field.Extras == nil { + field.Extras = make(map[string]string) + } + field.Extras["(gogoproto.casttype)"] = strconv.Quote(locator.CastTypeName(t.Name)) } - field.Extras["(gogoproto.casttype)"] = strconv.Quote(locator.CastTypeName(t.Name)) } case types.Slice: if t.Elem.Name.Name == "byte" && len(t.Elem.Name.Package) == 0 { diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo/BUILD b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo/BUILD index 83383bf6c..8f00cafb8 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo/BUILD +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "protoc-gen-gogo", - importpath = "k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/code-generator/cmd/import-boss/BUILD b/vendor/k8s.io/code-generator/cmd/import-boss/BUILD index 3e3e3a035..17ab02ffb 100644 --- a/vendor/k8s.io/code-generator/cmd/import-boss/BUILD +++ b/vendor/k8s.io/code-generator/cmd/import-boss/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "import-boss", - importpath = "k8s.io/code-generator/cmd/import-boss", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( @@ -18,6 +17,7 @@ go_library( importpath = "k8s.io/code-generator/cmd/import-boss", deps = [ "//vendor/github.com/golang/glog:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", "//vendor/k8s.io/gengo/examples/import-boss/generators:go_default_library", ], diff --git a/vendor/k8s.io/code-generator/cmd/import-boss/main.go b/vendor/k8s.io/code-generator/cmd/import-boss/main.go index a6fad8efe..d99899441 100644 --- a/vendor/k8s.io/code-generator/cmd/import-boss/main.go +++ b/vendor/k8s.io/code-generator/cmd/import-boss/main.go @@ -59,6 +59,7 @@ import ( "os" "path/filepath" + "k8s.io/code-generator/pkg/util" "k8s.io/gengo/args" "k8s.io/gengo/examples/import-boss/generators" @@ -69,7 +70,7 @@ func main() { arguments := args.Default() // Override defaults. - arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt") + arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) arguments.InputDirs = []string{ "k8s.io/kubernetes/pkg/...", "k8s.io/kubernetes/cmd/...", diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/BUILD b/vendor/k8s.io/code-generator/cmd/informer-gen/BUILD index 81eeb5c61..f6a5eec32 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/BUILD +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "informer-gen", - importpath = "k8s.io/code-generator/cmd/informer-gen", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( @@ -19,7 +18,9 @@ go_library( deps = [ "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/code-generator/cmd/informer-gen/args:go_default_library", "//vendor/k8s.io/code-generator/cmd/informer-gen/generators:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", ], ) @@ -35,6 +36,7 @@ filegroup( name = "all-srcs", srcs = [ ":package-srcs", + "//staging/src/k8s.io/code-generator/cmd/informer-gen/args:all-srcs", "//staging/src/k8s.io/code-generator/cmd/informer-gen/generators:all-srcs", ], tags = ["automanaged"], diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/args/BUILD b/vendor/k8s.io/code-generator/cmd/informer-gen/args/BUILD new file mode 100644 index 000000000..e22338101 --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/args/BUILD @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["args.go"], + importpath = "k8s.io/code-generator/cmd/informer-gen/args", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", + "//vendor/k8s.io/gengo/args:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go new file mode 100644 index 000000000..ba7f72091 --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go @@ -0,0 +1,77 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + "path" + + "github.com/spf13/pflag" + codegenutil "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" +) + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs struct { + VersionedClientSetPackage string + InternalClientSetPackage string + ListersPackage string + SingleDirectory bool +} + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{ + SingleDirectory: false, + } + genericArgs.CustomArgs = customArgs + + if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { + genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/informers") + customArgs.VersionedClientSetPackage = path.Join(pkg, "pkg/client/clientset/versioned") + customArgs.InternalClientSetPackage = path.Join(pkg, "pkg/client/clientset/internalversion") + customArgs.ListersPackage = path.Join(pkg, "pkg/client/listers") + } + + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { + fs.StringVar(&ca.InternalClientSetPackage, "internal-clientset-package", ca.InternalClientSetPackage, "the full package name for the internal clientset to use") + fs.StringVar(&ca.VersionedClientSetPackage, "versioned-clientset-package", ca.VersionedClientSetPackage, "the full package name for the versioned clientset to use") + fs.StringVar(&ca.ListersPackage, "listers-package", ca.ListersPackage, "the full package name for the listers to use") + fs.BoolVar(&ca.SingleDirectory, "single-directory", ca.SingleDirectory, "if true, omit the intermediate \"internalversion\" and \"externalversions\" subdirectories") +} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + customArgs := genericArgs.CustomArgs.(*CustomArgs) + + if len(genericArgs.OutputPackagePath) == 0 { + return fmt.Errorf("output package cannot be empty") + } + if len(customArgs.VersionedClientSetPackage) == 0 { + return fmt.Errorf("versioned clientset package cannot be empty") + } + if len(customArgs.ListersPackage) == 0 { + return fmt.Errorf("listers package cannot be empty") + } + + return nil +} diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/BUILD b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/BUILD index 5b1de7e77..9c220b55a 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/BUILD +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/BUILD @@ -8,7 +8,6 @@ load( go_library( name = "go_default_library", srcs = [ - "customargs.go", "factory.go", "factoryinterface.go", "generic.go", @@ -22,9 +21,9 @@ go_library( importpath = "k8s.io/code-generator/cmd/informer-gen/generators", deps = [ "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/code-generator/cmd/client-gen/generators/util:go_default_library", "//vendor/k8s.io/code-generator/cmd/client-gen/types:go_default_library", + "//vendor/k8s.io/code-generator/cmd/informer-gen/args:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", "//vendor/k8s.io/gengo/generator:go_default_library", "//vendor/k8s.io/gengo/namer:go_default_library", diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/customargs.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/customargs.go deleted file mode 100644 index 168309a92..000000000 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/customargs.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import "github.com/spf13/pflag" - -type CustomArgs struct { - VersionedClientSetPackage string - InternalClientSetPackage string - ListersPackage string - SingleDirectory bool -} - -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { - fs.StringVar(&ca.InternalClientSetPackage, "internal-clientset-package", ca.InternalClientSetPackage, "the full package name for the internal clientset to use") - fs.StringVar(&ca.VersionedClientSetPackage, "versioned-clientset-package", ca.VersionedClientSetPackage, "the full package name for the versioned clientset to use") - fs.StringVar(&ca.ListersPackage, "listers-package", ca.ListersPackage, "the full package name for the listers to use") - fs.BoolVar(&ca.SingleDirectory, "single-directory", ca.SingleDirectory, "if true, omit the intermediate \"internalversion\" and \"externalversions\" subdirectories") -} diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go index 891cac313..54632de05 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go @@ -105,10 +105,10 @@ func (g *genericGenerator) GenerateType(c *generator.Context, t *types.Type, w i Versions: []*version{}, } for _, v := range groupVersions.Versions { - gv := clientgentypes.GroupVersion{Group: groupVersions.Group, Version: v} + gv := clientgentypes.GroupVersion{Group: groupVersions.Group, Version: v.Version} version := &version{ - Name: v.NonEmpty(), - GoName: namer.IC(v.NonEmpty()), + Name: v.Version.NonEmpty(), + GoName: namer.IC(v.Version.NonEmpty()), Resources: orderer.OrderTypes(g.typesForGroupVersion[gv]), } schemeGVs[version] = c.Universe.Variable(types.Name{Package: g.typesForGroupVersion[gv][0].Name.Package, Name: "SchemeGroupVersion"}) diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/groupinterface.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/groupinterface.go index 253b79f37..0bba93c4b 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/groupinterface.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/groupinterface.go @@ -69,11 +69,11 @@ func (g *groupInterfaceGenerator) GenerateType(c *generator.Context, t *types.Ty versions := make([]versionData, 0, len(g.groupVersions.Versions)) for _, version := range g.groupVersions.Versions { - gv := clientgentypes.GroupVersion{Group: g.groupVersions.Group, Version: version} + gv := clientgentypes.GroupVersion{Group: g.groupVersions.Group, Version: version.Version} versionPackage := filepath.Join(g.outputPackage, strings.ToLower(gv.Version.NonEmpty())) iface := c.Universe.Type(types.Name{Package: versionPackage, Name: "Interface"}) versions = append(versions, versionData{ - Name: namer.IC(version.NonEmpty()), + Name: namer.IC(version.Version.NonEmpty()), Interface: iface, New: c.Universe.Function(types.Name{Package: versionPackage, Name: "New"}), }) diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go index faa012188..2cc0372f8 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go @@ -18,9 +18,11 @@ package generators import ( "fmt" + "path" "path/filepath" "strings" + "github.com/golang/glog" "k8s.io/gengo/args" "k8s.io/gengo/generator" "k8s.io/gengo/namer" @@ -28,8 +30,7 @@ import ( "k8s.io/code-generator/cmd/client-gen/generators/util" clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - - "github.com/golang/glog" + informergenargs "k8s.io/code-generator/cmd/informer-gen/args" ) // NameSystems returns the name system used by the generators in this package. @@ -61,12 +62,6 @@ func DefaultNameSystem() string { return "public" } -// generatedBy returns information about the arguments used to invoke -// lister-gen. -func generatedBy() string { - return fmt.Sprintf("\n// This file was automatically generated by informer-gen\n\n") -} - // objectMetaForPackage returns the type of ObjectMeta used by package p. func objectMetaForPackage(p *types.Package) (*types.Type, bool, error) { generatingForPackage := false @@ -110,9 +105,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat glog.Fatalf("Failed loading boilerplate: %v", err) } - boilerplate = append(boilerplate, []byte(generatedBy())...) - - customArgs, ok := arguments.CustomArgs.(*CustomArgs) + customArgs, ok := arguments.CustomArgs.(*informergenargs.CustomArgs) if !ok { glog.Fatalf("Wrong CustomArgs type: %T", arguments.CustomArgs) } @@ -158,7 +151,8 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat gv.Version = clientgentypes.Version(parts[len(parts)-1]) targetGroupVersions = externalGroupVersions } - groupPkgName := strings.ToLower(gv.Group.NonEmpty()) + groupPackageName := gv.Group.NonEmpty() + gvPackage := path.Clean(p.Path) // If there's a comment of the form "// +groupName=somegroup" or // "// +groupName=somegroup.foo.bar.io", use the first field (somegroup) as the name of the @@ -169,9 +163,9 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat // If there's a comment of the form "// +groupGoName=SomeUniqueShortName", use that as // the Go group identifier in CamelCase. It defaults - groupGoNames[groupPkgName] = namer.IC(strings.Split(gv.Group.NonEmpty(), ".")[0]) + groupGoNames[groupPackageName] = namer.IC(strings.Split(gv.Group.NonEmpty(), ".")[0]) if override := types.ExtractCommentTags("+", p.Comments)["groupGoName"]; override != nil { - groupGoNames[groupPkgName] = namer.IC(override[0]) + groupGoNames[groupPackageName] = namer.IC(override[0]) } var typesToGenerate []*types.Type @@ -192,23 +186,23 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat continue } - groupVersionsEntry, ok := targetGroupVersions[groupPkgName] + groupVersionsEntry, ok := targetGroupVersions[groupPackageName] if !ok { groupVersionsEntry = clientgentypes.GroupVersions{ - PackageName: groupPkgName, + PackageName: groupPackageName, Group: gv.Group, } } - groupVersionsEntry.Versions = append(groupVersionsEntry.Versions, gv.Version) - targetGroupVersions[groupPkgName] = groupVersionsEntry + groupVersionsEntry.Versions = append(groupVersionsEntry.Versions, clientgentypes.PackageVersion{Version: gv.Version, Package: gvPackage}) + targetGroupVersions[groupPackageName] = groupVersionsEntry orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} typesToGenerate = orderer.OrderTypes(typesToGenerate) if internal { - packageList = append(packageList, versionPackage(internalVersionPackagePath, groupPkgName, gv, groupGoNames[groupPkgName], boilerplate, typesToGenerate, customArgs.InternalClientSetPackage, customArgs.ListersPackage)) + packageList = append(packageList, versionPackage(internalVersionPackagePath, groupPackageName, gv, groupGoNames[groupPackageName], boilerplate, typesToGenerate, customArgs.InternalClientSetPackage, customArgs.ListersPackage)) } else { - packageList = append(packageList, versionPackage(externalVersionPackagePath, groupPkgName, gv, groupGoNames[groupPkgName], boilerplate, typesToGenerate, customArgs.VersionedClientSetPackage, customArgs.ListersPackage)) + packageList = append(packageList, versionPackage(externalVersionPackagePath, groupPackageName, gv, groupGoNames[groupPackageName], boilerplate, typesToGenerate, customArgs.VersionedClientSetPackage, customArgs.ListersPackage)) } } diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/main.go b/vendor/k8s.io/code-generator/cmd/informer-gen/main.go index 78c0b3829..bfe826080 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/main.go @@ -17,34 +17,41 @@ limitations under the License. package main import ( + "flag" "path/filepath" + "github.com/golang/glog" + "github.com/spf13/pflag" "k8s.io/code-generator/cmd/informer-gen/generators" + "k8s.io/code-generator/pkg/util" "k8s.io/gengo/args" - "github.com/golang/glog" - "github.com/spf13/pflag" + generatorargs "k8s.io/code-generator/cmd/informer-gen/args" ) func main() { - arguments := args.Default() - - // Custom arguments. - customArgs := &generators.CustomArgs{ - VersionedClientSetPackage: "k8s.io/kubernetes/pkg/client/clientset_generated/clientset", - InternalClientSetPackage: "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset", - ListersPackage: "k8s.io/kubernetes/pkg/client/listers", - SingleDirectory: false, - } - customArgs.AddFlags(pflag.CommandLine) + genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. - arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt") - arguments.OutputPackagePath = "k8s.io/kubernetes/pkg/client/informers/informers_generated" - arguments.CustomArgs = customArgs + // TODO: move out of informer-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/informers/informers_generated" + customArgs.VersionedClientSetPackage = "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" + customArgs.InternalClientSetPackage = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + customArgs.ListersPackage = "k8s.io/kubernetes/pkg/client/listers" + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + glog.Fatalf("Error: %v", err) + } // Run it. - if err := arguments.Execute( + if err := genericArgs.Execute( generators.NameSystems(), generators.DefaultNameSystem(), generators.Packages, diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/BUILD b/vendor/k8s.io/code-generator/cmd/lister-gen/BUILD index 186c41011..1e4b2ca3f 100644 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/BUILD +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "lister-gen", - importpath = "k8s.io/code-generator/cmd/lister-gen", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( @@ -18,7 +17,10 @@ go_library( importpath = "k8s.io/code-generator/cmd/lister-gen", deps = [ "//vendor/github.com/golang/glog:go_default_library", + "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/code-generator/cmd/lister-gen/args:go_default_library", "//vendor/k8s.io/code-generator/cmd/lister-gen/generators:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", ], ) @@ -34,6 +36,7 @@ filegroup( name = "all-srcs", srcs = [ ":package-srcs", + "//staging/src/k8s.io/code-generator/cmd/lister-gen/args:all-srcs", "//staging/src/k8s.io/code-generator/cmd/lister-gen/generators:all-srcs", ], tags = ["automanaged"], diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/args/BUILD b/vendor/k8s.io/code-generator/cmd/lister-gen/args/BUILD new file mode 100644 index 000000000..53c1eefde --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/args/BUILD @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["args.go"], + importpath = "k8s.io/code-generator/cmd/lister-gen/args", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", + "//vendor/k8s.io/gengo/args:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go new file mode 100644 index 000000000..34914ea8c --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go @@ -0,0 +1,56 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + "path" + + "github.com/spf13/pflag" + codegenutil "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" +) + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs struct{} + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{} + genericArgs.CustomArgs = customArgs + + if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { + genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/listers") + } + + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) {} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + _ = genericArgs.CustomArgs.(*CustomArgs) + + if len(genericArgs.OutputPackagePath) == 0 { + return fmt.Errorf("output package cannot be empty") + } + + return nil +} diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go index 3da8d2ddd..cde6e2f77 100644 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go @@ -62,12 +62,6 @@ func DefaultNameSystem() string { return "public" } -// generatedBy returns information about the arguments used to invoke -// lister-gen. -func generatedBy() string { - return fmt.Sprintf("\n// This file was automatically generated by lister-gen\n\n") -} - // Packages makes the client package definition. func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { boilerplate, err := arguments.LoadGoBoilerplate() @@ -75,8 +69,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat glog.Fatalf("Failed loading boilerplate: %v", err) } - boilerplate = append(boilerplate, []byte(generatedBy())...) - var packageList generator.Packages for _, inputDir := range arguments.InputDirs { p := context.Universe.Package(inputDir) diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/main.go b/vendor/k8s.io/code-generator/cmd/lister-gen/main.go index 3b305f828..d5ff8e46e 100644 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/main.go @@ -17,23 +17,38 @@ limitations under the License. package main import ( + "flag" "path/filepath" + "github.com/golang/glog" + "github.com/spf13/pflag" "k8s.io/code-generator/cmd/lister-gen/generators" + "k8s.io/code-generator/pkg/util" "k8s.io/gengo/args" - "github.com/golang/glog" + generatorargs "k8s.io/code-generator/cmd/lister-gen/args" ) func main() { - arguments := args.Default() + genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. - arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt") - arguments.OutputPackagePath = "k8s.io/kubernetes/pkg/client/listers" + // TODO: move this out of lister-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/listers" + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + glog.Fatalf("Error: %v", err) + } // Run it. - if err := arguments.Execute( + if err := genericArgs.Execute( generators.NameSystems(), generators.DefaultNameSystem(), generators.Packages, diff --git a/vendor/k8s.io/code-generator/cmd/openapi-gen/BUILD b/vendor/k8s.io/code-generator/cmd/openapi-gen/BUILD index bf4a9faef..041d71001 100644 --- a/vendor/k8s.io/code-generator/cmd/openapi-gen/BUILD +++ b/vendor/k8s.io/code-generator/cmd/openapi-gen/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "openapi-gen", - importpath = "k8s.io/code-generator/cmd/openapi-gen", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( @@ -18,6 +17,9 @@ go_library( importpath = "k8s.io/code-generator/cmd/openapi-gen", deps = [ "//vendor/github.com/golang/glog:go_default_library", + "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/code-generator/cmd/openapi-gen/args:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", "//vendor/k8s.io/kube-openapi/pkg/generators:go_default_library", ], @@ -32,6 +34,9 @@ filegroup( filegroup( name = "all-srcs", - srcs = [":package-srcs"], + srcs = [ + ":package-srcs", + "//staging/src/k8s.io/code-generator/cmd/openapi-gen/args:all-srcs", + ], tags = ["automanaged"], ) diff --git a/vendor/k8s.io/code-generator/cmd/openapi-gen/args/BUILD b/vendor/k8s.io/code-generator/cmd/openapi-gen/args/BUILD new file mode 100644 index 000000000..e1eb70ea7 --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/openapi-gen/args/BUILD @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["args.go"], + importpath = "k8s.io/code-generator/cmd/openapi-gen/args", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/gengo/args:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/code-generator/cmd/openapi-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/openapi-gen/args/args.go new file mode 100644 index 000000000..f9bb17e1a --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/openapi-gen/args/args.go @@ -0,0 +1,53 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" +) + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs struct{} + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{} + genericArgs.CustomArgs = customArgs + genericArgs.OutputFileBaseName = "openapi_generated" + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) {} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + _ = genericArgs.CustomArgs.(*CustomArgs) + + if len(genericArgs.OutputFileBaseName) == 0 { + return fmt.Errorf("output file base name cannot be empty") + } + if len(genericArgs.OutputPackagePath) == 0 { + return fmt.Errorf("output package cannot be empty") + } + + return nil +} diff --git a/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go b/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go index 67355f834..fbafc5025 100644 --- a/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go @@ -20,23 +20,37 @@ limitations under the License. package main import ( + "flag" "path/filepath" + "github.com/golang/glog" + "github.com/spf13/pflag" "k8s.io/gengo/args" "k8s.io/kube-openapi/pkg/generators" - "github.com/golang/glog" + generatorargs "k8s.io/code-generator/cmd/openapi-gen/args" + "k8s.io/code-generator/pkg/util" ) func main() { - arguments := args.Default() + genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. - arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt") - arguments.OutputFileBaseName = "openapi_generated" + // TODO: move this out of openapi-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + glog.Fatalf("Error: %v", err) + } // Run it. - if err := arguments.Execute( + if err := genericArgs.Execute( generators.NameSystems(), generators.DefaultNameSystem(), generators.Packages, diff --git a/vendor/k8s.io/code-generator/cmd/set-gen/BUILD b/vendor/k8s.io/code-generator/cmd/set-gen/BUILD index 74bfefd54..ed8c34809 100644 --- a/vendor/k8s.io/code-generator/cmd/set-gen/BUILD +++ b/vendor/k8s.io/code-generator/cmd/set-gen/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "set-gen", - importpath = "k8s.io/code-generator/cmd/set-gen", - library = ":go_default_library", + embed = [":go_default_library"], ) exports_files([ @@ -22,6 +21,7 @@ go_library( importpath = "k8s.io/code-generator/cmd/set-gen", deps = [ "//vendor/github.com/golang/glog:go_default_library", + "//vendor/k8s.io/code-generator/pkg/util:go_default_library", "//vendor/k8s.io/gengo/args:go_default_library", "//vendor/k8s.io/gengo/examples/set-gen/generators:go_default_library", ], diff --git a/vendor/k8s.io/code-generator/cmd/set-gen/main.go b/vendor/k8s.io/code-generator/cmd/set-gen/main.go index 24af2229f..cf8f01d89 100644 --- a/vendor/k8s.io/code-generator/cmd/set-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/set-gen/main.go @@ -28,6 +28,7 @@ import ( "os" "path/filepath" + "k8s.io/code-generator/pkg/util" "k8s.io/gengo/args" "k8s.io/gengo/examples/set-gen/generators" @@ -38,7 +39,7 @@ func main() { arguments := args.Default() // Override defaults. - arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt") + arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) arguments.InputDirs = []string{"k8s.io/kubernetes/pkg/util/sets/types"} arguments.OutputPackagePath = "k8s.io/apimachinery/pkg/util/sets" diff --git a/vendor/k8s.io/code-generator/code-of-conduct.md b/vendor/k8s.io/code-generator/code-of-conduct.md new file mode 100644 index 000000000..0d15c00cf --- /dev/null +++ b/vendor/k8s.io/code-generator/code-of-conduct.md @@ -0,0 +1,3 @@ +# Kubernetes Community Code of Conduct + +Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/k8s.io/code-generator/generate-groups.sh b/vendor/k8s.io/code-generator/generate-groups.sh index 145b12400..b92296d96 100755 --- a/vendor/k8s.io/code-generator/generate-groups.sh +++ b/vendor/k8s.io/code-generator/generate-groups.sh @@ -67,7 +67,7 @@ fi if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/clientset" - ${GOPATH}/bin/client-gen --clientset-name versioned --input-base "" --input $(codegen::join , "${FQ_APIS[@]}") --clientset-path ${OUTPUT_PKG}/clientset "$@" + ${GOPATH}/bin/client-gen --clientset-name versioned --input-base "" --input $(codegen::join , "${FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/clientset "$@" fi if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then diff --git a/vendor/k8s.io/code-generator/generate-internal-groups.sh b/vendor/k8s.io/code-generator/generate-internal-groups.sh index b995dd4d5..0de606d39 100755 --- a/vendor/k8s.io/code-generator/generate-internal-groups.sh +++ b/vendor/k8s.io/code-generator/generate-internal-groups.sh @@ -87,9 +87,9 @@ fi if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/clientset" if [ -n "${INT_APIS_PKG}" ]; then - ${GOPATH}/bin/client-gen --clientset-name internalversion --input-base "" --input $(codegen::join , $(printf '%s/ ' "${INT_FQ_APIS[@]}")) --clientset-path ${OUTPUT_PKG}/clientset "$@" + ${GOPATH}/bin/client-gen --clientset-name internalversion --input-base "" --input $(codegen::join , $(printf '%s/ ' "${INT_FQ_APIS[@]}")) --output-package ${OUTPUT_PKG}/clientset "$@" fi - ${GOPATH}/bin/client-gen --clientset-name versioned --input-base "" --input $(codegen::join , "${EXT_FQ_APIS[@]}") --clientset-path ${OUTPUT_PKG}/clientset "$@" + ${GOPATH}/bin/client-gen --clientset-name versioned --input-base "" --input $(codegen::join , "${EXT_FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/clientset "$@" fi if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then diff --git a/vendor/k8s.io/code-generator/hack/BUILD b/vendor/k8s.io/code-generator/hack/BUILD new file mode 100644 index 000000000..bf12794f6 --- /dev/null +++ b/vendor/k8s.io/code-generator/hack/BUILD @@ -0,0 +1,18 @@ +exports_files( + glob(["*.txt"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:public"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/apiserver/pkg/apis/example2/v1/types_swagger_doc_generated.go b/vendor/k8s.io/code-generator/hack/boilerplate.go.txt similarity index 91% rename from vendor/k8s.io/apiserver/pkg/apis/example2/v1/types_swagger_doc_generated.go rename to vendor/k8s.io/code-generator/hack/boilerplate.go.txt index c7be42d5a..59e740c1e 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/example2/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/code-generator/hack/boilerplate.go.txt @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors. +Copyright YEAR The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,3 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1 diff --git a/vendor/k8s.io/code-generator/pkg/util/BUILD b/vendor/k8s.io/code-generator/pkg/util/BUILD new file mode 100644 index 000000000..4b6ea978c --- /dev/null +++ b/vendor/k8s.io/code-generator/pkg/util/BUILD @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["build.go"], + importpath = "k8s.io/code-generator/pkg/util", + visibility = ["//visibility:public"], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/code-generator/pkg/util/build.go b/vendor/k8s.io/code-generator/pkg/util/build.go new file mode 100644 index 000000000..6ea8f52ee --- /dev/null +++ b/vendor/k8s.io/code-generator/pkg/util/build.go @@ -0,0 +1,61 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package util + +import ( + gobuild "go/build" + "path" + "path/filepath" + "reflect" + "strings" +) + +type empty struct{} + +// CurrentPackage returns the go package of the current directory, or "" if it cannot +// be derived from the GOPATH. +func CurrentPackage() string { + for _, root := range gobuild.Default.SrcDirs() { + if pkg, ok := hasSubdir(root, "."); ok { + return pkg + } + } + return "" +} + +func hasSubdir(root, dir string) (rel string, ok bool) { + // ensure a tailing separator to properly compare on word-boundaries + const sep = string(filepath.Separator) + root = filepath.Clean(root) + if !strings.HasSuffix(root, sep) { + root += sep + } + + // check whether root dir starts with root + dir = filepath.Clean(dir) + if !strings.HasPrefix(dir, root) { + return "", false + } + + // cut off root + return filepath.ToSlash(dir[len(root):]), true +} + +// BoilerplatePath uses the boilerplate in code-generator by calculating the relative path to it. +func BoilerplatePath() string { + return path.Join(reflect.TypeOf(empty{}).PkgPath(), "/../../hack/boilerplate.go.txt") +} diff --git a/vendor/k8s.io/gengo/code-of-conduct.md b/vendor/k8s.io/gengo/code-of-conduct.md index 0d15c00cf..8f0d060e3 100644 --- a/vendor/k8s.io/gengo/code-of-conduct.md +++ b/vendor/k8s.io/gengo/code-of-conduct.md @@ -1,3 +1,58 @@ -# Kubernetes Community Code of Conduct +## Kubernetes Community Code of Conduct -Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) +### Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of fostering +an open and welcoming community, we pledge to respect all people who contribute +through reporting issues, posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free experience for +everyone, regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, body size, race, ethnicity, age, +religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, such as physical or electronic addresses, + without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are not +aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers +commit themselves to fairly and consistently applying these principles to every aspect +of managing this project. Project maintainers who do not follow or enforce the Code of +Conduct may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a Kubernetes maintainer, Sarah Novotny , and/or Dan Kohn . + +This Code of Conduct is adapted from the Contributor Covenant +(http://contributor-covenant.org), version 1.2.0, available at +http://contributor-covenant.org/version/1/2/0/ + +### Kubernetes Events Code of Conduct + +Kubernetes events are working conferences intended for professional networking and collaboration in the +Kubernetes community. Attendees are expected to behave according to professional standards and in accordance +with their employer's policies on appropriate workplace behavior. + +While at Kubernetes events or related social networking opportunities, attendees should not engage in +discriminatory or offensive speech or actions regarding gender, sexuality, race, or religion. Speakers should +be especially aware of these concerns. + +The Kubernetes team does not condone any statements by speakers contrary to these standards. The Kubernetes +team reserves the right to deny entrance and/or eject from an event (without refund) any individual found to +be engaging in discriminatory or offensive speech or actions. + +Please bring any concerns to the immediate attention of Kubernetes event staff. + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/code-of-conduct.md?pixel)]() diff --git a/vendor/k8s.io/gengo/examples/go-to-protobuf/build-image/Dockerfile b/vendor/k8s.io/gengo/examples/go-to-protobuf/build-image/Dockerfile index 1fbfd25ab..ae7c6fc43 100644 --- a/vendor/k8s.io/gengo/examples/go-to-protobuf/build-image/Dockerfile +++ b/vendor/k8s.io/gengo/examples/go-to-protobuf/build-image/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # This file creates a standard build environment for building Kubernetes -FROM k8s.gcr.io/kube-cross:KUBE_BUILD_IMAGE_CROSS_TAG +FROM gcr.io/google_containers/kube-cross:KUBE_BUILD_IMAGE_CROSS_TAG # Mark this as a kube-build container RUN touch /kube-build-image diff --git a/vendor/k8s.io/gengo/parser/parse.go b/vendor/k8s.io/gengo/parser/parse.go index 865b430f7..d2bfed30c 100644 --- a/vendor/k8s.io/gengo/parser/parse.go +++ b/vendor/k8s.io/gengo/parser/parse.go @@ -578,7 +578,7 @@ func splitLines(str string) []string { } func tcFuncNameToName(in string) types.Name { - name := strings.TrimPrefix(in, "func ") + name := strings.TrimLeft(in, "func ") nameParts := strings.Split(name, "(") return tcNameToName(nameParts[0]) }