From e857adbdfdba795ceca870f194d8d8a296bbdc21 Mon Sep 17 00:00:00 2001 From: David Eads Date: Wed, 27 May 2020 14:27:08 -0400 Subject: [PATCH] remove-api --- api/api-rules/violation_exceptions.list | 2 - api/openapi-spec/swagger.json | 1044 --------- build/kazel_generated.bzl | 4 - cmd/kube-apiserver/app/aggregator.go | 1 - hack/.golint_failures | 3 - hack/.import-aliases | 1 - hack/lib/init.sh | 1 - pkg/BUILD | 1 - pkg/api/testing/BUILD | 2 - pkg/api/testing/defaulting_test.go | 2 - pkg/api/testing/fuzzer.go | 2 - pkg/api/testing/install.go | 1 - pkg/apis/auditregistration/BUILD | 38 - pkg/apis/auditregistration/doc.go | 20 - pkg/apis/auditregistration/fuzzer/BUILD | 27 - pkg/apis/auditregistration/fuzzer/fuzzer.go | 38 - pkg/apis/auditregistration/install/BUILD | 29 - pkg/apis/auditregistration/install/install.go | 38 - pkg/apis/auditregistration/register.go | 53 - pkg/apis/auditregistration/types.go | 197 -- pkg/apis/auditregistration/v1alpha1/BUILD | 51 - .../auditregistration/v1alpha1/defaults.go | 63 - .../v1alpha1/defaults_test.go | 165 -- pkg/apis/auditregistration/v1alpha1/doc.go | 24 - .../auditregistration/v1alpha1/register.go | 46 - .../v1alpha1/zz_generated.conversion.go | 359 --- .../v1alpha1/zz_generated.defaults.go | 49 - pkg/apis/auditregistration/validation/BUILD | 42 - .../validation/validation.go | 123 - .../validation/validation_test.go | 359 --- .../zz_generated.deepcopy.go | 224 -- pkg/master/BUILD | 3 - pkg/master/import_known_versions.go | 1 - pkg/master/master.go | 4 - pkg/registry/BUILD | 2 - .../auditregistration/auditsink/BUILD | 36 - .../auditregistration/auditsink/doc.go | 17 - .../auditregistration/auditsink/storage/BUILD | 30 - .../auditsink/storage/storage.go | 55 - .../auditregistration/auditsink/strategy.go | 89 - pkg/registry/auditregistration/rest/BUILD | 31 - .../rest/storage_auditregistration.go | 57 - staging/src/k8s.io/api/BUILD | 1 - .../src/k8s.io/api/auditregistration/OWNERS | 8 - .../api/auditregistration/v1alpha1/BUILD | 36 - .../api/auditregistration/v1alpha1/doc.go | 23 - .../v1alpha1/generated.pb.go | 2030 ----------------- .../v1alpha1/generated.proto | 162 -- .../auditregistration/v1alpha1/register.go | 56 - .../api/auditregistration/v1alpha1/types.go | 198 -- .../v1alpha1/types_swagger_doc_generated.go | 111 - .../v1alpha1/zz_generated.deepcopy.go | 229 -- staging/src/k8s.io/apiserver/pkg/audit/BUILD | 1 - .../k8s.io/apiserver/pkg/audit/policy/BUILD | 4 - .../apiserver/pkg/audit/policy/dynamic.go | 54 - .../pkg/audit/policy/dynamic_test.go | 81 - .../src/k8s.io/apiserver/pkg/audit/util/BUILD | 40 - .../apiserver/pkg/audit/util/conversion.go | 49 - .../pkg/audit/util/conversion_test.go | 91 - staging/src/k8s.io/client-go/BUILD | 1 - staging/src/k8s.io/client-go/deprecated/BUILD | 2 - .../k8s.io/client-go/deprecated/clientset.go | 14 - .../k8s.io/client-go/deprecated/fake/BUILD | 3 - .../deprecated/fake/clientset_generated.go | 7 - .../client-go/deprecated/fake/register.go | 2 - .../k8s.io/client-go/deprecated/scheme/BUILD | 1 - .../client-go/deprecated/scheme/register.go | 2 - .../typed/auditregistration/v1alpha1/BUILD | 39 - .../v1alpha1/auditregistration_client.go | 89 - .../auditregistration/v1alpha1/auditsink.go | 165 -- .../typed/auditregistration/v1alpha1/doc.go | 20 - .../auditregistration/v1alpha1/fake/BUILD | 38 - .../auditregistration/v1alpha1/fake/doc.go | 20 - .../fake/fake_auditregistration_client.go | 40 - .../v1alpha1/fake/fake_auditsink.go | 120 - .../v1alpha1/generated_expansion.go | 21 - staging/src/k8s.io/client-go/informers/BUILD | 3 - .../informers/auditregistration/BUILD | 30 - .../informers/auditregistration/interface.go | 46 - .../auditregistration/v1alpha1/BUILD | 36 - .../auditregistration/v1alpha1/auditsink.go | 89 - .../auditregistration/v1alpha1/interface.go | 45 - .../src/k8s.io/client-go/informers/factory.go | 6 - .../src/k8s.io/client-go/informers/generic.go | 9 +- staging/src/k8s.io/client-go/kubernetes/BUILD | 2 - .../k8s.io/client-go/kubernetes/clientset.go | 14 - .../k8s.io/client-go/kubernetes/fake/BUILD | 3 - .../kubernetes/fake/clientset_generated.go | 7 - .../client-go/kubernetes/fake/register.go | 2 - .../k8s.io/client-go/kubernetes/scheme/BUILD | 1 - .../client-go/kubernetes/scheme/register.go | 2 - .../typed/auditregistration/v1alpha1/BUILD | 39 - .../v1alpha1/auditregistration_client.go | 89 - .../auditregistration/v1alpha1/auditsink.go | 168 -- .../typed/auditregistration/v1alpha1/doc.go | 20 - .../auditregistration/v1alpha1/fake/BUILD | 38 - .../auditregistration/v1alpha1/fake/doc.go | 20 - .../fake/fake_auditregistration_client.go | 40 - .../v1alpha1/fake/fake_auditsink.go | 122 - .../v1alpha1/generated_expansion.go | 21 - .../listers/auditregistration/v1alpha1/BUILD | 32 - .../auditregistration/v1alpha1/auditsink.go | 68 - .../v1alpha1/expansion_generated.go | 23 - test/integration/apiserver/BUILD | 1 - test/integration/apiserver/print_test.go | 2 - test/integration/etcd/data.go | 7 - test/utils/BUILD | 4 - test/utils/audit_dynamic.go | 191 -- vendor/modules.txt | 10 - 109 files changed, 2 insertions(+), 8280 deletions(-) delete mode 100644 pkg/apis/auditregistration/BUILD delete mode 100644 pkg/apis/auditregistration/doc.go delete mode 100644 pkg/apis/auditregistration/fuzzer/BUILD delete mode 100644 pkg/apis/auditregistration/fuzzer/fuzzer.go delete mode 100644 pkg/apis/auditregistration/install/BUILD delete mode 100644 pkg/apis/auditregistration/install/install.go delete mode 100644 pkg/apis/auditregistration/register.go delete mode 100644 pkg/apis/auditregistration/types.go delete mode 100644 pkg/apis/auditregistration/v1alpha1/BUILD delete mode 100644 pkg/apis/auditregistration/v1alpha1/defaults.go delete mode 100644 pkg/apis/auditregistration/v1alpha1/defaults_test.go delete mode 100644 pkg/apis/auditregistration/v1alpha1/doc.go delete mode 100644 pkg/apis/auditregistration/v1alpha1/register.go delete mode 100644 pkg/apis/auditregistration/v1alpha1/zz_generated.conversion.go delete mode 100644 pkg/apis/auditregistration/v1alpha1/zz_generated.defaults.go delete mode 100644 pkg/apis/auditregistration/validation/BUILD delete mode 100644 pkg/apis/auditregistration/validation/validation.go delete mode 100644 pkg/apis/auditregistration/validation/validation_test.go delete mode 100644 pkg/apis/auditregistration/zz_generated.deepcopy.go delete mode 100644 pkg/registry/auditregistration/auditsink/BUILD delete mode 100644 pkg/registry/auditregistration/auditsink/doc.go delete mode 100644 pkg/registry/auditregistration/auditsink/storage/BUILD delete mode 100644 pkg/registry/auditregistration/auditsink/storage/storage.go delete mode 100644 pkg/registry/auditregistration/auditsink/strategy.go delete mode 100644 pkg/registry/auditregistration/rest/BUILD delete mode 100644 pkg/registry/auditregistration/rest/storage_auditregistration.go delete mode 100644 staging/src/k8s.io/api/auditregistration/OWNERS delete mode 100644 staging/src/k8s.io/api/auditregistration/v1alpha1/BUILD delete mode 100644 staging/src/k8s.io/api/auditregistration/v1alpha1/doc.go delete mode 100644 staging/src/k8s.io/api/auditregistration/v1alpha1/generated.pb.go delete mode 100644 staging/src/k8s.io/api/auditregistration/v1alpha1/generated.proto delete mode 100644 staging/src/k8s.io/api/auditregistration/v1alpha1/register.go delete mode 100644 staging/src/k8s.io/api/auditregistration/v1alpha1/types.go delete mode 100644 staging/src/k8s.io/api/auditregistration/v1alpha1/types_swagger_doc_generated.go delete mode 100644 staging/src/k8s.io/api/auditregistration/v1alpha1/zz_generated.deepcopy.go delete mode 100644 staging/src/k8s.io/apiserver/pkg/audit/policy/dynamic.go delete mode 100644 staging/src/k8s.io/apiserver/pkg/audit/policy/dynamic_test.go delete mode 100644 staging/src/k8s.io/apiserver/pkg/audit/util/BUILD delete mode 100644 staging/src/k8s.io/apiserver/pkg/audit/util/conversion.go delete mode 100644 staging/src/k8s.io/apiserver/pkg/audit/util/conversion_test.go delete mode 100644 staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/BUILD delete mode 100644 staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/auditregistration_client.go delete mode 100644 staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/auditsink.go delete mode 100644 staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/doc.go delete mode 100644 staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/BUILD delete mode 100644 staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/doc.go delete mode 100644 staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/fake_auditregistration_client.go delete mode 100644 staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/fake_auditsink.go delete mode 100644 staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/generated_expansion.go delete mode 100644 staging/src/k8s.io/client-go/informers/auditregistration/BUILD delete mode 100644 staging/src/k8s.io/client-go/informers/auditregistration/interface.go delete mode 100644 staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/BUILD delete mode 100644 staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/auditsink.go delete mode 100644 staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/interface.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/BUILD delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditregistration_client.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/doc.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/BUILD delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/doc.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditregistration_client.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditsink.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/generated_expansion.go delete mode 100644 staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/BUILD delete mode 100644 staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/auditsink.go delete mode 100644 staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/expansion_generated.go delete mode 100644 test/utils/audit_dynamic.go diff --git a/api/api-rules/violation_exceptions.list b/api/api-rules/violation_exceptions.list index 1bafd7cc76a..8be18e16a41 100644 --- a/api/api-rules/violation_exceptions.list +++ b/api/api-rules/violation_exceptions.list @@ -33,8 +33,6 @@ API rule violation: list_type_missing,k8s.io/api/apps/v1beta2,DeploymentStatus,C API rule violation: list_type_missing,k8s.io/api/apps/v1beta2,ReplicaSetStatus,Conditions API rule violation: list_type_missing,k8s.io/api/apps/v1beta2,StatefulSetSpec,VolumeClaimTemplates API rule violation: list_type_missing,k8s.io/api/apps/v1beta2,StatefulSetStatus,Conditions -API rule violation: list_type_missing,k8s.io/api/auditregistration/v1alpha1,Policy,Stages -API rule violation: list_type_missing,k8s.io/api/auditregistration/v1alpha1,WebhookClientConfig,CABundle API rule violation: list_type_missing,k8s.io/api/authentication/v1,TokenRequestSpec,Audiences API rule violation: list_type_missing,k8s.io/api/authentication/v1,TokenReviewSpec,Audiences API rule violation: list_type_missing,k8s.io/api/authentication/v1,TokenReviewStatus,Audiences diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index 4417cc9eef4..471e46d21ad 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -1595,185 +1595,6 @@ }, "type": "object" }, - "io.k8s.api.auditregistration.v1alpha1.AuditSink": { - "description": "AuditSink represents a cluster level audit sink", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "spec": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSinkSpec", - "description": "Spec defines the audit configuration spec" - } - }, - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "auditregistration.k8s.io", - "kind": "AuditSink", - "version": "v1alpha1" - } - ] - }, - "io.k8s.api.auditregistration.v1alpha1.AuditSinkList": { - "description": "AuditSinkList is a list of AuditSink items.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "List of audit configurations.", - "items": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSink" - }, - "type": "array" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - }, - "required": [ - "items" - ], - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "auditregistration.k8s.io", - "kind": "AuditSinkList", - "version": "v1alpha1" - } - ] - }, - "io.k8s.api.auditregistration.v1alpha1.AuditSinkSpec": { - "description": "AuditSinkSpec holds the spec for the audit sink", - "properties": { - "policy": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.Policy", - "description": "Policy defines the policy for selecting which events should be sent to the webhook required" - }, - "webhook": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.Webhook", - "description": "Webhook to send events required" - } - }, - "required": [ - "policy", - "webhook" - ], - "type": "object" - }, - "io.k8s.api.auditregistration.v1alpha1.Policy": { - "description": "Policy defines the configuration of how audit events are logged", - "properties": { - "level": { - "description": "The Level that all requests are recorded at. available options: None, Metadata, Request, RequestResponse required", - "type": "string" - }, - "stages": { - "description": "Stages is a list of stages for which events are created.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "level" - ], - "type": "object" - }, - "io.k8s.api.auditregistration.v1alpha1.ServiceReference": { - "description": "ServiceReference holds a reference to Service.legacy.k8s.io", - "properties": { - "name": { - "description": "`name` is the name of the service. Required", - "type": "string" - }, - "namespace": { - "description": "`namespace` is the namespace of the service. Required", - "type": "string" - }, - "path": { - "description": "`path` is an optional URL path which will be sent in any request to this service.", - "type": "string" - }, - "port": { - "description": "If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive).", - "format": "int32", - "type": "integer" - } - }, - "required": [ - "namespace", - "name" - ], - "type": "object" - }, - "io.k8s.api.auditregistration.v1alpha1.Webhook": { - "description": "Webhook holds the configuration of the webhook", - "properties": { - "clientConfig": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.WebhookClientConfig", - "description": "ClientConfig holds the connection parameters for the webhook required" - }, - "throttle": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.WebhookThrottleConfig", - "description": "Throttle holds the options for throttling the webhook" - } - }, - "required": [ - "clientConfig" - ], - "type": "object" - }, - "io.k8s.api.auditregistration.v1alpha1.WebhookClientConfig": { - "description": "WebhookClientConfig contains the information to make a connection with the webhook", - "properties": { - "caBundle": { - "description": "`caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used.", - "format": "byte", - "type": "string" - }, - "service": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.ServiceReference", - "description": "`service` is a reference to the service for this webhook. Either `service` or `url` must be specified.\n\nIf the webhook is running within the cluster, then you should use `service`." - }, - "url": { - "description": "`url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified.\n\nThe `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address.\n\nPlease note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster.\n\nThe scheme must be \"https\"; the URL must begin with \"https://\".\n\nA path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier.\n\nAttempting to use a user or basic auth e.g. \"user:password@\" is not allowed. Fragments (\"#...\") and query parameters (\"?...\") are not allowed, either.", - "type": "string" - } - }, - "type": "object" - }, - "io.k8s.api.auditregistration.v1alpha1.WebhookThrottleConfig": { - "description": "WebhookThrottleConfig holds the configuration for throttling events", - "properties": { - "burst": { - "description": "ThrottleBurst is the maximum number of events sent at the same moment default 15 QPS", - "format": "int64", - "type": "integer" - }, - "qps": { - "description": "ThrottleQPS maximum number of batches per second default 10 QPS", - "format": "int64", - "type": "integer" - } - }, - "type": "object" - }, "io.k8s.api.authentication.v1.BoundObjectReference": { "description": "BoundObjectReference is a reference to an object that a token is bound to.", "properties": { @@ -16906,11 +16727,6 @@ "kind": "DeleteOptions", "version": "v1beta2" }, - { - "group": "auditregistration.k8s.io", - "kind": "DeleteOptions", - "version": "v1alpha1" - }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", @@ -17552,11 +17368,6 @@ "kind": "WatchEvent", "version": "v1beta2" }, - { - "group": "auditregistration.k8s.io", - "kind": "WatchEvent", - "version": "v1alpha1" - }, { "group": "authentication.k8s.io", "kind": "WatchEvent", @@ -51041,861 +50852,6 @@ } ] }, - "/apis/auditregistration.k8s.io/": { - "get": { - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "description": "get information of a group", - "operationId": "getAuditregistrationAPIGroup", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "auditregistration" - ] - } - }, - "/apis/auditregistration.k8s.io/v1alpha1/": { - "get": { - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "description": "get available resources", - "operationId": "getAuditregistrationV1alpha1APIResources", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "auditregistration_v1alpha1" - ] - } - }, - "/apis/auditregistration.k8s.io/v1alpha1/auditsinks": { - "delete": { - "consumes": [ - "*/*" - ], - "description": "delete collection of AuditSink", - "operationId": "deleteAuditregistrationV1alpha1CollectionAuditSink", - "parameters": [ - { - "in": "body", - "name": "body", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "type": "string", - "uniqueItems": true - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "type": "string", - "uniqueItems": true - }, - { - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "in": "query", - "name": "gracePeriodSeconds", - "type": "integer", - "uniqueItems": true - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "type": "string", - "uniqueItems": true - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "type": "integer", - "uniqueItems": true - }, - { - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "in": "query", - "name": "orphanDependents", - "type": "boolean", - "uniqueItems": true - }, - { - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - "in": "query", - "name": "propagationPolicy", - "type": "string", - "uniqueItems": true - }, - { - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "in": "query", - "name": "resourceVersion", - "type": "string", - "uniqueItems": true - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "type": "integer", - "uniqueItems": true - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "auditregistration_v1alpha1" - ], - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "auditregistration.k8s.io", - "kind": "AuditSink", - "version": "v1alpha1" - } - }, - "get": { - "consumes": [ - "*/*" - ], - "description": "list or watch objects of kind AuditSink", - "operationId": "listAuditregistrationV1alpha1AuditSink", - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "type": "boolean", - "uniqueItems": true - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "type": "string", - "uniqueItems": true - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "type": "string", - "uniqueItems": true - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "type": "string", - "uniqueItems": true - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "type": "integer", - "uniqueItems": true - }, - { - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "in": "query", - "name": "resourceVersion", - "type": "string", - "uniqueItems": true - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "type": "integer", - "uniqueItems": true - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "type": "boolean", - "uniqueItems": true - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSinkList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "auditregistration_v1alpha1" - ], - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "auditregistration.k8s.io", - "kind": "AuditSink", - "version": "v1alpha1" - } - }, - "parameters": [ - { - "description": "If 'true', then the output is pretty printed.", - "in": "query", - "name": "pretty", - "type": "string", - "uniqueItems": true - } - ], - "post": { - "consumes": [ - "*/*" - ], - "description": "create an AuditSink", - "operationId": "createAuditregistrationV1alpha1AuditSink", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSink" - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - "in": "query", - "name": "fieldManager", - "type": "string", - "uniqueItems": true - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSink" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSink" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSink" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "auditregistration_v1alpha1" - ], - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "auditregistration.k8s.io", - "kind": "AuditSink", - "version": "v1alpha1" - } - } - }, - "/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}": { - "delete": { - "consumes": [ - "*/*" - ], - "description": "delete an AuditSink", - "operationId": "deleteAuditregistrationV1alpha1AuditSink", - "parameters": [ - { - "in": "body", - "name": "body", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "in": "query", - "name": "gracePeriodSeconds", - "type": "integer", - "uniqueItems": true - }, - { - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "in": "query", - "name": "orphanDependents", - "type": "boolean", - "uniqueItems": true - }, - { - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - "in": "query", - "name": "propagationPolicy", - "type": "string", - "uniqueItems": true - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "auditregistration_v1alpha1" - ], - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "auditregistration.k8s.io", - "kind": "AuditSink", - "version": "v1alpha1" - } - }, - "get": { - "consumes": [ - "*/*" - ], - "description": "read the specified AuditSink", - "operationId": "readAuditregistrationV1alpha1AuditSink", - "parameters": [ - { - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18.", - "in": "query", - "name": "exact", - "type": "boolean", - "uniqueItems": true - }, - { - "description": "Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18.", - "in": "query", - "name": "export", - "type": "boolean", - "uniqueItems": true - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSink" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "auditregistration_v1alpha1" - ], - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "auditregistration.k8s.io", - "kind": "AuditSink", - "version": "v1alpha1" - } - }, - "parameters": [ - { - "description": "name of the AuditSink", - "in": "path", - "name": "name", - "required": true, - "type": "string", - "uniqueItems": true - }, - { - "description": "If 'true', then the output is pretty printed.", - "in": "query", - "name": "pretty", - "type": "string", - "uniqueItems": true - } - ], - "patch": { - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json", - "application/apply-patch+yaml" - ], - "description": "partially update the specified AuditSink", - "operationId": "patchAuditregistrationV1alpha1AuditSink", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", - "in": "query", - "name": "fieldManager", - "type": "string", - "uniqueItems": true - }, - { - "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", - "in": "query", - "name": "force", - "type": "boolean", - "uniqueItems": true - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSink" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "auditregistration_v1alpha1" - ], - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "auditregistration.k8s.io", - "kind": "AuditSink", - "version": "v1alpha1" - } - }, - "put": { - "consumes": [ - "*/*" - ], - "description": "replace the specified AuditSink", - "operationId": "replaceAuditregistrationV1alpha1AuditSink", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSink" - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - "in": "query", - "name": "fieldManager", - "type": "string", - "uniqueItems": true - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSink" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.auditregistration.v1alpha1.AuditSink" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "auditregistration_v1alpha1" - ], - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "auditregistration.k8s.io", - "kind": "AuditSink", - "version": "v1alpha1" - } - } - }, - "/apis/auditregistration.k8s.io/v1alpha1/watch/auditsinks": { - "get": { - "consumes": [ - "*/*" - ], - "description": "watch individual changes to a list of AuditSink. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchAuditregistrationV1alpha1AuditSinkList", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "auditregistration_v1alpha1" - ], - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "auditregistration.k8s.io", - "kind": "AuditSink", - "version": "v1alpha1" - } - }, - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "type": "boolean", - "uniqueItems": true - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "type": "string", - "uniqueItems": true - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "type": "string", - "uniqueItems": true - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "type": "string", - "uniqueItems": true - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "type": "integer", - "uniqueItems": true - }, - { - "description": "If 'true', then the output is pretty printed.", - "in": "query", - "name": "pretty", - "type": "string", - "uniqueItems": true - }, - { - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "in": "query", - "name": "resourceVersion", - "type": "string", - "uniqueItems": true - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "type": "integer", - "uniqueItems": true - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "type": "boolean", - "uniqueItems": true - } - ] - }, - "/apis/auditregistration.k8s.io/v1alpha1/watch/auditsinks/{name}": { - "get": { - "consumes": [ - "*/*" - ], - "description": "watch changes to an object of kind AuditSink. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchAuditregistrationV1alpha1AuditSink", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "auditregistration_v1alpha1" - ], - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "auditregistration.k8s.io", - "kind": "AuditSink", - "version": "v1alpha1" - } - }, - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "type": "boolean", - "uniqueItems": true - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "type": "string", - "uniqueItems": true - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "type": "string", - "uniqueItems": true - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "type": "string", - "uniqueItems": true - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "type": "integer", - "uniqueItems": true - }, - { - "description": "name of the AuditSink", - "in": "path", - "name": "name", - "required": true, - "type": "string", - "uniqueItems": true - }, - { - "description": "If 'true', then the output is pretty printed.", - "in": "query", - "name": "pretty", - "type": "string", - "uniqueItems": true - }, - { - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "in": "query", - "name": "resourceVersion", - "type": "string", - "uniqueItems": true - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "type": "integer", - "uniqueItems": true - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "type": "boolean", - "uniqueItems": true - } - ] - }, "/apis/authentication.k8s.io/": { "get": { "consumes": [ diff --git a/build/kazel_generated.bzl b/build/kazel_generated.bzl index ad366e567b5..86864936004 100644 --- a/build/kazel_generated.bzl +++ b/build/kazel_generated.bzl @@ -38,13 +38,11 @@ tags_values_pkgs = {"openapi-gen": { "cmd/cloud-controller-manager/app/apis/config/v1alpha1", "pkg/apis/abac/v0", "pkg/apis/abac/v1beta1", - "pkg/apis/auditregistration", "staging/src/k8s.io/api/admissionregistration/v1", "staging/src/k8s.io/api/admissionregistration/v1beta1", "staging/src/k8s.io/api/apps/v1", "staging/src/k8s.io/api/apps/v1beta1", "staging/src/k8s.io/api/apps/v1beta2", - "staging/src/k8s.io/api/auditregistration/v1alpha1", "staging/src/k8s.io/api/authentication/v1", "staging/src/k8s.io/api/authentication/v1beta1", "staging/src/k8s.io/api/authorization/v1", @@ -116,7 +114,6 @@ tags_pkgs_values = {"openapi-gen": { "cmd/cloud-controller-manager/app/apis/config/v1alpha1": ["true"], "pkg/apis/abac/v0": ["true"], "pkg/apis/abac/v1beta1": ["true"], - "pkg/apis/auditregistration": ["true"], "staging/src/k8s.io/api/admission/v1": ["false"], "staging/src/k8s.io/api/admission/v1beta1": ["false"], "staging/src/k8s.io/api/admissionregistration/v1": ["true"], @@ -124,7 +121,6 @@ tags_pkgs_values = {"openapi-gen": { "staging/src/k8s.io/api/apps/v1": ["true"], "staging/src/k8s.io/api/apps/v1beta1": ["true"], "staging/src/k8s.io/api/apps/v1beta2": ["true"], - "staging/src/k8s.io/api/auditregistration/v1alpha1": ["true"], "staging/src/k8s.io/api/authentication/v1": ["true"], "staging/src/k8s.io/api/authentication/v1beta1": ["true"], "staging/src/k8s.io/api/authorization/v1": ["true"], diff --git a/cmd/kube-apiserver/app/aggregator.go b/cmd/kube-apiserver/app/aggregator.go index f38c81d53c6..c0f827eb3a6 100644 --- a/cmd/kube-apiserver/app/aggregator.go +++ b/cmd/kube-apiserver/app/aggregator.go @@ -283,7 +283,6 @@ var apiVersionPriorities = map[schema.GroupVersion]priority{ {Group: "scheduling.k8s.io", Version: "v1alpha1"}: {group: 16600, version: 9}, {Group: "coordination.k8s.io", Version: "v1"}: {group: 16500, version: 15}, {Group: "coordination.k8s.io", Version: "v1beta1"}: {group: 16500, version: 9}, - {Group: "auditregistration.k8s.io", Version: "v1alpha1"}: {group: 16400, version: 1}, {Group: "node.k8s.io", Version: "v1alpha1"}: {group: 16300, version: 1}, {Group: "node.k8s.io", Version: "v1beta1"}: {group: 16300, version: 9}, {Group: "discovery.k8s.io", Version: "v1beta1"}: {group: 16200, version: 12}, diff --git a/hack/.golint_failures b/hack/.golint_failures index 3973e6b3aec..23d53b0326c 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -12,7 +12,6 @@ pkg/apis/admissionregistration/validation pkg/apis/apps/v1 pkg/apis/apps/v1beta1 pkg/apis/apps/v1beta2 -pkg/apis/auditregistration/v1alpha1 pkg/apis/authentication/v1 pkg/apis/autoscaling/v1 pkg/apis/autoscaling/v2beta1 @@ -125,7 +124,6 @@ pkg/proxy/userspace pkg/proxy/winkernel pkg/proxy/winuserspace pkg/registry/admissionregistration/rest -pkg/registry/auditregistration/rest pkg/registry/authentication/rest pkg/registry/authentication/tokenreview pkg/registry/authorization/localsubjectaccessreview @@ -217,7 +215,6 @@ staging/src/k8s.io/api/admissionregistration/v1beta1 staging/src/k8s.io/api/apps/v1 staging/src/k8s.io/api/apps/v1beta1 staging/src/k8s.io/api/apps/v1beta2 -staging/src/k8s.io/api/auditregistration/v1alpha1 staging/src/k8s.io/api/authentication/v1 staging/src/k8s.io/api/authentication/v1beta1 staging/src/k8s.io/api/authorization/v1 diff --git a/hack/.import-aliases b/hack/.import-aliases index 7bc1c95e7f7..f6aa7a46ada 100644 --- a/hack/.import-aliases +++ b/hack/.import-aliases @@ -6,7 +6,6 @@ "k8s.io/api/apps/v1": "appsv1", "k8s.io/api/apps/v1beta1": "appsv1beta1", "k8s.io/api/apps/v1beta2": "appsv1beta2", - "k8s.io/api/auditregistration/v1alpha1": "auditregistrationv1alpha1", "k8s.io/api/authentication/v1": "authenticationv1", "k8s.io/api/authentication/v1beta1": "authenticationv1beta1", "k8s.io/api/authorization/v1": "authorizationv1", diff --git a/hack/lib/init.sh b/hack/lib/init.sh index b7a3e5ae08f..d585403b7ed 100755 --- a/hack/lib/init.sh +++ b/hack/lib/init.sh @@ -70,7 +70,6 @@ admission.k8s.io/v1beta1 \ apps/v1 \ apps/v1beta1 \ apps/v1beta2 \ -auditregistration.k8s.io/v1alpha1 \ authentication.k8s.io/v1 \ authentication.k8s.io/v1beta1 \ authorization.k8s.io/v1 \ diff --git a/pkg/BUILD b/pkg/BUILD index 6cccf2081f9..4df371aec16 100644 --- a/pkg/BUILD +++ b/pkg/BUILD @@ -28,7 +28,6 @@ filegroup( "//pkg/apis/admission:all-srcs", "//pkg/apis/admissionregistration:all-srcs", "//pkg/apis/apps:all-srcs", - "//pkg/apis/auditregistration:all-srcs", "//pkg/apis/authentication:all-srcs", "//pkg/apis/authorization:all-srcs", "//pkg/apis/autoscaling:all-srcs", diff --git a/pkg/api/testing/BUILD b/pkg/api/testing/BUILD index edfc62144df..cd4fffbe9cd 100644 --- a/pkg/api/testing/BUILD +++ b/pkg/api/testing/BUILD @@ -23,8 +23,6 @@ go_library( "//pkg/apis/apps:go_default_library", "//pkg/apis/apps/fuzzer:go_default_library", "//pkg/apis/apps/install:go_default_library", - "//pkg/apis/auditregistration/fuzzer:go_default_library", - "//pkg/apis/auditregistration/install:go_default_library", "//pkg/apis/authentication/install:go_default_library", "//pkg/apis/authorization/install:go_default_library", "//pkg/apis/autoscaling/fuzzer:go_default_library", diff --git a/pkg/api/testing/defaulting_test.go b/pkg/api/testing/defaulting_test.go index d83d4c9ccab..1d82c337056 100644 --- a/pkg/api/testing/defaulting_test.go +++ b/pkg/api/testing/defaulting_test.go @@ -145,8 +145,6 @@ func TestDefaulting(t *testing.T) { {Group: "admissionregistration.k8s.io", Version: "v1", Kind: "ValidatingWebhookConfigurationList"}: {}, {Group: "admissionregistration.k8s.io", Version: "v1", Kind: "MutatingWebhookConfiguration"}: {}, {Group: "admissionregistration.k8s.io", Version: "v1", Kind: "MutatingWebhookConfigurationList"}: {}, - {Group: "auditregistration.k8s.io", Version: "v1alpha1", Kind: "AuditSink"}: {}, - {Group: "auditregistration.k8s.io", Version: "v1alpha1", Kind: "AuditSinkList"}: {}, {Group: "networking.k8s.io", Version: "v1", Kind: "NetworkPolicy"}: {}, {Group: "networking.k8s.io", Version: "v1", Kind: "NetworkPolicyList"}: {}, {Group: "networking.k8s.io", Version: "v1beta1", Kind: "Ingress"}: {}, diff --git a/pkg/api/testing/fuzzer.go b/pkg/api/testing/fuzzer.go index 50f83a88127..462a7c1bc92 100644 --- a/pkg/api/testing/fuzzer.go +++ b/pkg/api/testing/fuzzer.go @@ -31,7 +31,6 @@ import ( admissionregistrationfuzzer "k8s.io/kubernetes/pkg/apis/admissionregistration/fuzzer" "k8s.io/kubernetes/pkg/apis/apps" appsfuzzer "k8s.io/kubernetes/pkg/apis/apps/fuzzer" - auditregistrationfuzzer "k8s.io/kubernetes/pkg/apis/auditregistration/fuzzer" autoscalingfuzzer "k8s.io/kubernetes/pkg/apis/autoscaling/fuzzer" batchfuzzer "k8s.io/kubernetes/pkg/apis/batch/fuzzer" certificatesfuzzer "k8s.io/kubernetes/pkg/apis/certificates/fuzzer" @@ -103,7 +102,6 @@ var FuzzerFuncs = fuzzer.MergeFuzzerFuncs( policyfuzzer.Funcs, certificatesfuzzer.Funcs, admissionregistrationfuzzer.Funcs, - auditregistrationfuzzer.Funcs, storagefuzzer.Funcs, networkingfuzzer.Funcs, metafuzzer.Funcs, diff --git a/pkg/api/testing/install.go b/pkg/api/testing/install.go index 0e26f65bf22..800fcd3ee93 100644 --- a/pkg/api/testing/install.go +++ b/pkg/api/testing/install.go @@ -21,7 +21,6 @@ import ( _ "k8s.io/kubernetes/pkg/apis/admission/install" _ "k8s.io/kubernetes/pkg/apis/admissionregistration/install" _ "k8s.io/kubernetes/pkg/apis/apps/install" - _ "k8s.io/kubernetes/pkg/apis/auditregistration/install" _ "k8s.io/kubernetes/pkg/apis/authentication/install" _ "k8s.io/kubernetes/pkg/apis/authorization/install" _ "k8s.io/kubernetes/pkg/apis/autoscaling/install" diff --git a/pkg/apis/auditregistration/BUILD b/pkg/apis/auditregistration/BUILD deleted file mode 100644 index 65913a1c996..00000000000 --- a/pkg/apis/auditregistration/BUILD +++ /dev/null @@ -1,38 +0,0 @@ -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/kubernetes/pkg/apis/auditregistration", - visibility = ["//visibility:public"], - deps = [ - "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//staging/src/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", - "//pkg/apis/auditregistration/fuzzer:all-srcs", - "//pkg/apis/auditregistration/install:all-srcs", - "//pkg/apis/auditregistration/v1alpha1:all-srcs", - "//pkg/apis/auditregistration/validation:all-srcs", - ], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/pkg/apis/auditregistration/doc.go b/pkg/apis/auditregistration/doc.go deleted file mode 100644 index 1046b5a62be..00000000000 --- a/pkg/apis/auditregistration/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2018 The 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 -// +groupName=auditregistration.k8s.io - -package auditregistration // import "k8s.io/kubernetes/pkg/apis/auditregistration" diff --git a/pkg/apis/auditregistration/fuzzer/BUILD b/pkg/apis/auditregistration/fuzzer/BUILD deleted file mode 100644 index 3c4d743d8f6..00000000000 --- a/pkg/apis/auditregistration/fuzzer/BUILD +++ /dev/null @@ -1,27 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["fuzzer.go"], - importpath = "k8s.io/kubernetes/pkg/apis/auditregistration/fuzzer", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/auditregistration:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", - "//vendor/github.com/google/gofuzz: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/pkg/apis/auditregistration/fuzzer/fuzzer.go b/pkg/apis/auditregistration/fuzzer/fuzzer.go deleted file mode 100644 index eb141540fe5..00000000000 --- a/pkg/apis/auditregistration/fuzzer/fuzzer.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2018 The 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 fuzzer - -import ( - fuzz "github.com/google/gofuzz" - - runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/kubernetes/pkg/apis/auditregistration" -) - -// Funcs returns the fuzzer functions for the auditregistration api group. -var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} { - return []interface{}{ - func(obj *auditregistration.AuditSink, c fuzz.Continue) { - c.FuzzNoCustom(obj) - v := int64(1) - obj.Spec.Webhook.Throttle = &auditregistration.WebhookThrottleConfig{ - QPS: &v, - Burst: &v, - } - }, - } -} diff --git a/pkg/apis/auditregistration/install/BUILD b/pkg/apis/auditregistration/install/BUILD deleted file mode 100644 index 09172ed23c9..00000000000 --- a/pkg/apis/auditregistration/install/BUILD +++ /dev/null @@ -1,29 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["install.go"], - importpath = "k8s.io/kubernetes/pkg/apis/auditregistration/install", - visibility = ["//visibility:public"], - deps = [ - "//pkg/api/legacyscheme:go_default_library", - "//pkg/apis/auditregistration:go_default_library", - "//pkg/apis/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/util/runtime: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/pkg/apis/auditregistration/install/install.go b/pkg/apis/auditregistration/install/install.go deleted file mode 100644 index ffb905cd131..00000000000 --- a/pkg/apis/auditregistration/install/install.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2018 The 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 adds 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/runtime" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/apis/auditregistration" - "k8s.io/kubernetes/pkg/apis/auditregistration/v1alpha1" -) - -func init() { - Install(legacyscheme.Scheme) -} - -// Install registers the API group and adds types to a scheme -func Install(scheme *runtime.Scheme) { - utilruntime.Must(auditregistration.AddToScheme(scheme)) - utilruntime.Must(v1alpha1.AddToScheme(scheme)) - utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion)) -} diff --git a/pkg/apis/auditregistration/register.go b/pkg/apis/auditregistration/register.go deleted file mode 100644 index ebaa3810948..00000000000 --- a/pkg/apis/auditregistration/register.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2018 The 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 auditregistration - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the group name use in this package -const GroupName = "auditregistration.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 for audit registration - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme audit registration - AddToScheme = SchemeBuilder.AddToScheme -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &AuditSink{}, - &AuditSinkList{}, - ) - return nil -} diff --git a/pkg/apis/auditregistration/types.go b/pkg/apis/auditregistration/types.go deleted file mode 100644 index 97f6bb2ef36..00000000000 --- a/pkg/apis/auditregistration/types.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright 2018 The 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:openapi-gen=true - -package auditregistration - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Level defines the amount of information logged during auditing -type Level string - -// Valid audit levels -const ( - // LevelNone disables auditing - LevelNone Level = "None" - // LevelMetadata provides the basic level of auditing. - LevelMetadata Level = "Metadata" - // LevelRequest provides Metadata level of auditing, and additionally - // logs the request object (does not apply for non-resource requests). - LevelRequest Level = "Request" - // LevelRequestResponse provides Request level of auditing, and additionally - // logs the response object (does not apply for non-resource requests and watches). - LevelRequestResponse Level = "RequestResponse" -) - -// Stage defines the stages in request handling during which audit events may be generated. -type Stage string - -// Valid audit stages. -const ( - // The stage for events generated after the audit handler receives the request, but before it - // is delegated down the handler chain. - StageRequestReceived = "RequestReceived" - // The stage for events generated after the response headers are sent, but before the response body - // is sent. This stage is only generated for long-running requests (e.g. watch). - StageResponseStarted = "ResponseStarted" - // The stage for events generated after the response body has been completed, and no more bytes - // will be sent. - StageResponseComplete = "ResponseComplete" - // The stage for events generated when a panic occurred. - StagePanic = "Panic" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AuditSink represents a cluster level sink for audit data -type AuditSink struct { - metav1.TypeMeta - - // +optional - metav1.ObjectMeta - - // Spec defines the audit sink spec - Spec AuditSinkSpec -} - -// AuditSinkSpec is the spec for the audit sink object -type AuditSinkSpec struct { - // Policy defines the policy for selecting which events should be sent to the backend - // required - Policy Policy - - // Webhook to send events - // required - Webhook Webhook -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AuditSinkList is a list of a audit sink items. -type AuditSinkList struct { - metav1.TypeMeta - - // +optional - metav1.ListMeta - - // List of audit configurations. - Items []AuditSink -} - -// Policy defines the configuration of how audit events are logged -type Policy struct { - // The Level that all requests are recorded at. - // available options: None, Metadata, Request, RequestResponse - // required - Level Level - - // Stages is a list of stages for which events are created. - // +optional - Stages []Stage -} - -// Webhook holds the configuration of the webhooks -type Webhook struct { - // Throttle holds the options for throttling the webhook - // +optional - Throttle *WebhookThrottleConfig - - // ClientConfig holds the connection parameters for the webhook - // required - ClientConfig WebhookClientConfig -} - -// WebhookThrottleConfig holds the configuration for throttling -type WebhookThrottleConfig struct { - // QPS maximum number of batches per second - // default 10 QPS - // +optional - QPS *int64 - - // Burst is the maximum number of events sent at the same moment - // default 15 QPS - // +optional - Burst *int64 -} - -// WebhookClientConfig contains the information to make a connection with the webhook -type WebhookClientConfig struct { - // `url` gives the location of the webhook, in standard URL form - // (`scheme://host:port/path`). Exactly one of `url` or `service` - // must be specified. - // - // The `host` should not refer to a service running in the cluster; use - // the `service` field instead. The host might be resolved via external - // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve - // in-cluster DNS as that would be a layering violation). `host` may - // also be an IP address. - // - // Please note that using `localhost` or `127.0.0.1` as a `host` is - // risky unless you take great care to run this webhook on all hosts - // which run an apiserver which might need to make calls to this - // webhook. Such installs are likely to be non-portable, i.e., not easy - // to turn up in a new cluster. - // - // The scheme must be "https"; the URL must begin with "https://". - // - // A path is optional, and if present may be any string permissible in - // a URL. You may use the path to pass an arbitrary string to the - // webhook, for example, a cluster identifier. - // - // Attempting to use a user or basic auth e.g. "user:password@" is not - // allowed. Fragments ("#...") and query parameters ("?...") are not - // allowed, either. - // - // +optional - URL *string - - // `service` is a reference to the service for this webhook. Either - // `service` or `url` must be specified. - // - // If the webhook is running within the cluster, then you should use `service`. - // - // +optional - Service *ServiceReference - - // `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. - // If unspecified, system trust roots on the apiserver are used. - // +optional - CABundle []byte -} - -// ServiceReference holds a reference to Service.legacy.k8s.io -type ServiceReference struct { - // `namespace` is the namespace of the service. - // Required - Namespace string - - // `name` is the name of the service. - // Required - Name string - - // `path` is an optional URL path which will be sent in any request to - // this service. - // +optional - Path *string - - // If specified, the port on the service that hosting webhook. - // `port` should be a valid port number (1-65535, inclusive). - // +optional - Port int32 -} diff --git a/pkg/apis/auditregistration/v1alpha1/BUILD b/pkg/apis/auditregistration/v1alpha1/BUILD deleted file mode 100644 index aef7545b0d9..00000000000 --- a/pkg/apis/auditregistration/v1alpha1/BUILD +++ /dev/null @@ -1,51 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = [ - "defaults.go", - "doc.go", - "register.go", - "zz_generated.conversion.go", - "zz_generated.defaults.go", - ], - importpath = "k8s.io/kubernetes/pkg/apis/auditregistration/v1alpha1", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/auditregistration:go_default_library", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//vendor/k8s.io/utils/pointer:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["defaults_test.go"], - embed = [":go_default_library"], - deps = [ - "//pkg/api/legacyscheme:go_default_library", - "//pkg/apis/auditregistration/install:go_default_library", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/utils/pointer: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/pkg/apis/auditregistration/v1alpha1/defaults.go b/pkg/apis/auditregistration/v1alpha1/defaults.go deleted file mode 100644 index dc23c0742cd..00000000000 --- a/pkg/apis/auditregistration/v1alpha1/defaults.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2018 The 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 ( - auditregistrationv1alpha1 "k8s.io/api/auditregistration/v1alpha1" - "k8s.io/apimachinery/pkg/runtime" - utilpointer "k8s.io/utils/pointer" -) - -const ( - // DefaultQPS is the default QPS value - DefaultQPS = int64(10) - // DefaultBurst is the default burst value - DefaultBurst = int64(15) -) - -// DefaultThrottle is a default throttle config -func DefaultThrottle() *auditregistrationv1alpha1.WebhookThrottleConfig { - return &auditregistrationv1alpha1.WebhookThrottleConfig{ - QPS: utilpointer.Int64Ptr(DefaultQPS), - Burst: utilpointer.Int64Ptr(DefaultBurst), - } -} - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - return RegisterDefaults(scheme) -} - -// SetDefaults_AuditSink sets defaults if the audit sink isn't present -func SetDefaults_AuditSink(obj *auditregistrationv1alpha1.AuditSink) { - if obj.Spec.Webhook.Throttle != nil { - if obj.Spec.Webhook.Throttle.QPS == nil { - obj.Spec.Webhook.Throttle.QPS = utilpointer.Int64Ptr(DefaultQPS) - } - if obj.Spec.Webhook.Throttle.Burst == nil { - obj.Spec.Webhook.Throttle.Burst = utilpointer.Int64Ptr(DefaultBurst) - } - } else { - obj.Spec.Webhook.Throttle = DefaultThrottle() - } -} - -// SetDefaults_ServiceReference sets defaults for AuditSync Webhook's ServiceReference -func SetDefaults_ServiceReference(obj *auditregistrationv1alpha1.ServiceReference) { - if obj.Port == nil { - obj.Port = utilpointer.Int32Ptr(443) - } -} diff --git a/pkg/apis/auditregistration/v1alpha1/defaults_test.go b/pkg/apis/auditregistration/v1alpha1/defaults_test.go deleted file mode 100644 index acfc7fba8a1..00000000000 --- a/pkg/apis/auditregistration/v1alpha1/defaults_test.go +++ /dev/null @@ -1,165 +0,0 @@ -/* -Copyright 2018 The 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_test - -import ( - "reflect" - "testing" - - auditregistrationv1alpha1 "k8s.io/api/auditregistration/v1alpha1" - apiequality "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/kubernetes/pkg/api/legacyscheme" - _ "k8s.io/kubernetes/pkg/apis/auditregistration/install" - . "k8s.io/kubernetes/pkg/apis/auditregistration/v1alpha1" - utilpointer "k8s.io/utils/pointer" -) - -func TestSetDefaultAuditSink(t *testing.T) { - defaultURL := "http://test" - tests := []struct { - original *auditregistrationv1alpha1.AuditSink - expected *auditregistrationv1alpha1.AuditSink - }{ - { // Missing Throttle - original: &auditregistrationv1alpha1.AuditSink{ - Spec: auditregistrationv1alpha1.AuditSinkSpec{ - Policy: auditregistrationv1alpha1.Policy{ - Level: auditregistrationv1alpha1.LevelMetadata, - }, - Webhook: auditregistrationv1alpha1.Webhook{ - ClientConfig: auditregistrationv1alpha1.WebhookClientConfig{ - URL: &defaultURL, - }, - }, - }, - }, - expected: &auditregistrationv1alpha1.AuditSink{ - Spec: auditregistrationv1alpha1.AuditSinkSpec{ - Policy: auditregistrationv1alpha1.Policy{ - Level: auditregistrationv1alpha1.LevelMetadata, - }, - Webhook: auditregistrationv1alpha1.Webhook{ - Throttle: DefaultThrottle(), - ClientConfig: auditregistrationv1alpha1.WebhookClientConfig{ - URL: &defaultURL, - }, - }, - }, - }, - }, - { // Missing QPS - original: &auditregistrationv1alpha1.AuditSink{ - Spec: auditregistrationv1alpha1.AuditSinkSpec{ - Policy: auditregistrationv1alpha1.Policy{ - Level: auditregistrationv1alpha1.LevelMetadata, - }, - Webhook: auditregistrationv1alpha1.Webhook{ - Throttle: &auditregistrationv1alpha1.WebhookThrottleConfig{ - Burst: utilpointer.Int64Ptr(1), - }, - ClientConfig: auditregistrationv1alpha1.WebhookClientConfig{ - URL: &defaultURL, - }, - }, - }, - }, - expected: &auditregistrationv1alpha1.AuditSink{ - Spec: auditregistrationv1alpha1.AuditSinkSpec{ - Policy: auditregistrationv1alpha1.Policy{ - Level: auditregistrationv1alpha1.LevelMetadata, - }, - Webhook: auditregistrationv1alpha1.Webhook{ - Throttle: &auditregistrationv1alpha1.WebhookThrottleConfig{ - QPS: DefaultThrottle().QPS, - Burst: utilpointer.Int64Ptr(1), - }, - ClientConfig: auditregistrationv1alpha1.WebhookClientConfig{ - URL: &defaultURL, - }, - }, - }, - }, - }, - { // Missing Burst - original: &auditregistrationv1alpha1.AuditSink{ - Spec: auditregistrationv1alpha1.AuditSinkSpec{ - Policy: auditregistrationv1alpha1.Policy{ - Level: auditregistrationv1alpha1.LevelMetadata, - }, - Webhook: auditregistrationv1alpha1.Webhook{ - Throttle: &auditregistrationv1alpha1.WebhookThrottleConfig{ - QPS: utilpointer.Int64Ptr(1), - }, - ClientConfig: auditregistrationv1alpha1.WebhookClientConfig{ - URL: &defaultURL, - }, - }, - }, - }, - expected: &auditregistrationv1alpha1.AuditSink{ - Spec: auditregistrationv1alpha1.AuditSinkSpec{ - Policy: auditregistrationv1alpha1.Policy{ - Level: auditregistrationv1alpha1.LevelMetadata, - }, - Webhook: auditregistrationv1alpha1.Webhook{ - Throttle: &auditregistrationv1alpha1.WebhookThrottleConfig{ - QPS: utilpointer.Int64Ptr(1), - Burst: DefaultThrottle().Burst, - }, - ClientConfig: auditregistrationv1alpha1.WebhookClientConfig{ - URL: &defaultURL, - }, - }, - }, - }, - }, - } - - for i, test := range tests { - original := test.original - expected := test.expected - obj2 := roundTrip(t, runtime.Object(original)) - got, ok := obj2.(*auditregistrationv1alpha1.AuditSink) - if !ok { - t.Fatalf("(%d) unexpected object: %v", i, obj2) - } - if !apiequality.Semantic.DeepEqual(got.Spec, expected.Spec) { - t.Errorf("(%d) got different than expected\ngot:\n\t%+v\nexpected:\n\t%+v", i, got.Spec, expected.Spec) - } - } -} - -func roundTrip(t *testing.T, obj runtime.Object) runtime.Object { - data, err := runtime.Encode(legacyscheme.Codecs.LegacyCodec(SchemeGroupVersion), obj) - if err != nil { - t.Errorf("%v\n %#v", err, obj) - return nil - } - obj2, err := runtime.Decode(legacyscheme.Codecs.UniversalDecoder(), data) - if err != nil { - t.Errorf("%v\nData: %s\nSource: %#v", err, string(data), obj) - return nil - } - obj3 := reflect.New(reflect.TypeOf(obj).Elem()).Interface().(runtime.Object) - err = legacyscheme.Scheme.Convert(obj2, obj3, nil) - if err != nil { - t.Errorf("%v\nSource: %#v", err, obj2) - return nil - } - return obj3 -} diff --git a/pkg/apis/auditregistration/v1alpha1/doc.go b/pkg/apis/auditregistration/v1alpha1/doc.go deleted file mode 100644 index 606c457c302..00000000000 --- a/pkg/apis/auditregistration/v1alpha1/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2018 The 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:conversion-gen=k8s.io/kubernetes/pkg/apis/auditregistration -// +k8s:conversion-gen-external-types=k8s.io/api/auditregistration/v1alpha1 -// +k8s:defaulter-gen=TypeMeta -// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/auditregistration/v1alpha1 - -// +groupName=auditregistration.k8s.io - -package v1alpha1 // import "k8s.io/kubernetes/pkg/apis/auditregistration/v1alpha1" diff --git a/pkg/apis/auditregistration/v1alpha1/register.go b/pkg/apis/auditregistration/v1alpha1/register.go deleted file mode 100644 index a74b162b6ad..00000000000 --- a/pkg/apis/auditregistration/v1alpha1/register.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2018 The 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 ( - auditregistrationv1alpha1 "k8s.io/api/auditregistration/v1alpha1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName for audit registration -const GroupName = "auditregistration.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 ( - localSchemeBuilder = &auditregistrationv1alpha1.SchemeBuilder - // AddToScheme audit registration - 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(addDefaultingFuncs) -} diff --git a/pkg/apis/auditregistration/v1alpha1/zz_generated.conversion.go b/pkg/apis/auditregistration/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index 0e0d2f55458..00000000000 --- a/pkg/apis/auditregistration/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,359 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright The 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" - - v1alpha1 "k8s.io/api/auditregistration/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - auditregistration "k8s.io/kubernetes/pkg/apis/auditregistration" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*v1alpha1.AuditSink)(nil), (*auditregistration.AuditSink)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AuditSink_To_auditregistration_AuditSink(a.(*v1alpha1.AuditSink), b.(*auditregistration.AuditSink), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*auditregistration.AuditSink)(nil), (*v1alpha1.AuditSink)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_auditregistration_AuditSink_To_v1alpha1_AuditSink(a.(*auditregistration.AuditSink), b.(*v1alpha1.AuditSink), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha1.AuditSinkList)(nil), (*auditregistration.AuditSinkList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AuditSinkList_To_auditregistration_AuditSinkList(a.(*v1alpha1.AuditSinkList), b.(*auditregistration.AuditSinkList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*auditregistration.AuditSinkList)(nil), (*v1alpha1.AuditSinkList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_auditregistration_AuditSinkList_To_v1alpha1_AuditSinkList(a.(*auditregistration.AuditSinkList), b.(*v1alpha1.AuditSinkList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha1.AuditSinkSpec)(nil), (*auditregistration.AuditSinkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AuditSinkSpec_To_auditregistration_AuditSinkSpec(a.(*v1alpha1.AuditSinkSpec), b.(*auditregistration.AuditSinkSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*auditregistration.AuditSinkSpec)(nil), (*v1alpha1.AuditSinkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_auditregistration_AuditSinkSpec_To_v1alpha1_AuditSinkSpec(a.(*auditregistration.AuditSinkSpec), b.(*v1alpha1.AuditSinkSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha1.Policy)(nil), (*auditregistration.Policy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Policy_To_auditregistration_Policy(a.(*v1alpha1.Policy), b.(*auditregistration.Policy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*auditregistration.Policy)(nil), (*v1alpha1.Policy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_auditregistration_Policy_To_v1alpha1_Policy(a.(*auditregistration.Policy), b.(*v1alpha1.Policy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha1.ServiceReference)(nil), (*auditregistration.ServiceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ServiceReference_To_auditregistration_ServiceReference(a.(*v1alpha1.ServiceReference), b.(*auditregistration.ServiceReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*auditregistration.ServiceReference)(nil), (*v1alpha1.ServiceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_auditregistration_ServiceReference_To_v1alpha1_ServiceReference(a.(*auditregistration.ServiceReference), b.(*v1alpha1.ServiceReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha1.Webhook)(nil), (*auditregistration.Webhook)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Webhook_To_auditregistration_Webhook(a.(*v1alpha1.Webhook), b.(*auditregistration.Webhook), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*auditregistration.Webhook)(nil), (*v1alpha1.Webhook)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_auditregistration_Webhook_To_v1alpha1_Webhook(a.(*auditregistration.Webhook), b.(*v1alpha1.Webhook), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha1.WebhookClientConfig)(nil), (*auditregistration.WebhookClientConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_WebhookClientConfig_To_auditregistration_WebhookClientConfig(a.(*v1alpha1.WebhookClientConfig), b.(*auditregistration.WebhookClientConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*auditregistration.WebhookClientConfig)(nil), (*v1alpha1.WebhookClientConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_auditregistration_WebhookClientConfig_To_v1alpha1_WebhookClientConfig(a.(*auditregistration.WebhookClientConfig), b.(*v1alpha1.WebhookClientConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha1.WebhookThrottleConfig)(nil), (*auditregistration.WebhookThrottleConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_WebhookThrottleConfig_To_auditregistration_WebhookThrottleConfig(a.(*v1alpha1.WebhookThrottleConfig), b.(*auditregistration.WebhookThrottleConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*auditregistration.WebhookThrottleConfig)(nil), (*v1alpha1.WebhookThrottleConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_auditregistration_WebhookThrottleConfig_To_v1alpha1_WebhookThrottleConfig(a.(*auditregistration.WebhookThrottleConfig), b.(*v1alpha1.WebhookThrottleConfig), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_AuditSink_To_auditregistration_AuditSink(in *v1alpha1.AuditSink, out *auditregistration.AuditSink, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_AuditSinkSpec_To_auditregistration_AuditSinkSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_AuditSink_To_auditregistration_AuditSink is an autogenerated conversion function. -func Convert_v1alpha1_AuditSink_To_auditregistration_AuditSink(in *v1alpha1.AuditSink, out *auditregistration.AuditSink, s conversion.Scope) error { - return autoConvert_v1alpha1_AuditSink_To_auditregistration_AuditSink(in, out, s) -} - -func autoConvert_auditregistration_AuditSink_To_v1alpha1_AuditSink(in *auditregistration.AuditSink, out *v1alpha1.AuditSink, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_auditregistration_AuditSinkSpec_To_v1alpha1_AuditSinkSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_auditregistration_AuditSink_To_v1alpha1_AuditSink is an autogenerated conversion function. -func Convert_auditregistration_AuditSink_To_v1alpha1_AuditSink(in *auditregistration.AuditSink, out *v1alpha1.AuditSink, s conversion.Scope) error { - return autoConvert_auditregistration_AuditSink_To_v1alpha1_AuditSink(in, out, s) -} - -func autoConvert_v1alpha1_AuditSinkList_To_auditregistration_AuditSinkList(in *v1alpha1.AuditSinkList, out *auditregistration.AuditSinkList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]auditregistration.AuditSink, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_AuditSink_To_auditregistration_AuditSink(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha1_AuditSinkList_To_auditregistration_AuditSinkList is an autogenerated conversion function. -func Convert_v1alpha1_AuditSinkList_To_auditregistration_AuditSinkList(in *v1alpha1.AuditSinkList, out *auditregistration.AuditSinkList, s conversion.Scope) error { - return autoConvert_v1alpha1_AuditSinkList_To_auditregistration_AuditSinkList(in, out, s) -} - -func autoConvert_auditregistration_AuditSinkList_To_v1alpha1_AuditSinkList(in *auditregistration.AuditSinkList, out *v1alpha1.AuditSinkList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1alpha1.AuditSink, len(*in)) - for i := range *in { - if err := Convert_auditregistration_AuditSink_To_v1alpha1_AuditSink(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_auditregistration_AuditSinkList_To_v1alpha1_AuditSinkList is an autogenerated conversion function. -func Convert_auditregistration_AuditSinkList_To_v1alpha1_AuditSinkList(in *auditregistration.AuditSinkList, out *v1alpha1.AuditSinkList, s conversion.Scope) error { - return autoConvert_auditregistration_AuditSinkList_To_v1alpha1_AuditSinkList(in, out, s) -} - -func autoConvert_v1alpha1_AuditSinkSpec_To_auditregistration_AuditSinkSpec(in *v1alpha1.AuditSinkSpec, out *auditregistration.AuditSinkSpec, s conversion.Scope) error { - if err := Convert_v1alpha1_Policy_To_auditregistration_Policy(&in.Policy, &out.Policy, s); err != nil { - return err - } - if err := Convert_v1alpha1_Webhook_To_auditregistration_Webhook(&in.Webhook, &out.Webhook, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_AuditSinkSpec_To_auditregistration_AuditSinkSpec is an autogenerated conversion function. -func Convert_v1alpha1_AuditSinkSpec_To_auditregistration_AuditSinkSpec(in *v1alpha1.AuditSinkSpec, out *auditregistration.AuditSinkSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_AuditSinkSpec_To_auditregistration_AuditSinkSpec(in, out, s) -} - -func autoConvert_auditregistration_AuditSinkSpec_To_v1alpha1_AuditSinkSpec(in *auditregistration.AuditSinkSpec, out *v1alpha1.AuditSinkSpec, s conversion.Scope) error { - if err := Convert_auditregistration_Policy_To_v1alpha1_Policy(&in.Policy, &out.Policy, s); err != nil { - return err - } - if err := Convert_auditregistration_Webhook_To_v1alpha1_Webhook(&in.Webhook, &out.Webhook, s); err != nil { - return err - } - return nil -} - -// Convert_auditregistration_AuditSinkSpec_To_v1alpha1_AuditSinkSpec is an autogenerated conversion function. -func Convert_auditregistration_AuditSinkSpec_To_v1alpha1_AuditSinkSpec(in *auditregistration.AuditSinkSpec, out *v1alpha1.AuditSinkSpec, s conversion.Scope) error { - return autoConvert_auditregistration_AuditSinkSpec_To_v1alpha1_AuditSinkSpec(in, out, s) -} - -func autoConvert_v1alpha1_Policy_To_auditregistration_Policy(in *v1alpha1.Policy, out *auditregistration.Policy, s conversion.Scope) error { - out.Level = auditregistration.Level(in.Level) - out.Stages = *(*[]auditregistration.Stage)(unsafe.Pointer(&in.Stages)) - return nil -} - -// Convert_v1alpha1_Policy_To_auditregistration_Policy is an autogenerated conversion function. -func Convert_v1alpha1_Policy_To_auditregistration_Policy(in *v1alpha1.Policy, out *auditregistration.Policy, s conversion.Scope) error { - return autoConvert_v1alpha1_Policy_To_auditregistration_Policy(in, out, s) -} - -func autoConvert_auditregistration_Policy_To_v1alpha1_Policy(in *auditregistration.Policy, out *v1alpha1.Policy, s conversion.Scope) error { - out.Level = v1alpha1.Level(in.Level) - out.Stages = *(*[]v1alpha1.Stage)(unsafe.Pointer(&in.Stages)) - return nil -} - -// Convert_auditregistration_Policy_To_v1alpha1_Policy is an autogenerated conversion function. -func Convert_auditregistration_Policy_To_v1alpha1_Policy(in *auditregistration.Policy, out *v1alpha1.Policy, s conversion.Scope) error { - return autoConvert_auditregistration_Policy_To_v1alpha1_Policy(in, out, s) -} - -func autoConvert_v1alpha1_ServiceReference_To_auditregistration_ServiceReference(in *v1alpha1.ServiceReference, out *auditregistration.ServiceReference, s conversion.Scope) error { - out.Namespace = in.Namespace - out.Name = in.Name - out.Path = (*string)(unsafe.Pointer(in.Path)) - if err := v1.Convert_Pointer_int32_To_int32(&in.Port, &out.Port, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_ServiceReference_To_auditregistration_ServiceReference is an autogenerated conversion function. -func Convert_v1alpha1_ServiceReference_To_auditregistration_ServiceReference(in *v1alpha1.ServiceReference, out *auditregistration.ServiceReference, s conversion.Scope) error { - return autoConvert_v1alpha1_ServiceReference_To_auditregistration_ServiceReference(in, out, s) -} - -func autoConvert_auditregistration_ServiceReference_To_v1alpha1_ServiceReference(in *auditregistration.ServiceReference, out *v1alpha1.ServiceReference, s conversion.Scope) error { - out.Namespace = in.Namespace - out.Name = in.Name - out.Path = (*string)(unsafe.Pointer(in.Path)) - if err := v1.Convert_int32_To_Pointer_int32(&in.Port, &out.Port, s); err != nil { - return err - } - return nil -} - -// Convert_auditregistration_ServiceReference_To_v1alpha1_ServiceReference is an autogenerated conversion function. -func Convert_auditregistration_ServiceReference_To_v1alpha1_ServiceReference(in *auditregistration.ServiceReference, out *v1alpha1.ServiceReference, s conversion.Scope) error { - return autoConvert_auditregistration_ServiceReference_To_v1alpha1_ServiceReference(in, out, s) -} - -func autoConvert_v1alpha1_Webhook_To_auditregistration_Webhook(in *v1alpha1.Webhook, out *auditregistration.Webhook, s conversion.Scope) error { - out.Throttle = (*auditregistration.WebhookThrottleConfig)(unsafe.Pointer(in.Throttle)) - if err := Convert_v1alpha1_WebhookClientConfig_To_auditregistration_WebhookClientConfig(&in.ClientConfig, &out.ClientConfig, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_Webhook_To_auditregistration_Webhook is an autogenerated conversion function. -func Convert_v1alpha1_Webhook_To_auditregistration_Webhook(in *v1alpha1.Webhook, out *auditregistration.Webhook, s conversion.Scope) error { - return autoConvert_v1alpha1_Webhook_To_auditregistration_Webhook(in, out, s) -} - -func autoConvert_auditregistration_Webhook_To_v1alpha1_Webhook(in *auditregistration.Webhook, out *v1alpha1.Webhook, s conversion.Scope) error { - out.Throttle = (*v1alpha1.WebhookThrottleConfig)(unsafe.Pointer(in.Throttle)) - if err := Convert_auditregistration_WebhookClientConfig_To_v1alpha1_WebhookClientConfig(&in.ClientConfig, &out.ClientConfig, s); err != nil { - return err - } - return nil -} - -// Convert_auditregistration_Webhook_To_v1alpha1_Webhook is an autogenerated conversion function. -func Convert_auditregistration_Webhook_To_v1alpha1_Webhook(in *auditregistration.Webhook, out *v1alpha1.Webhook, s conversion.Scope) error { - return autoConvert_auditregistration_Webhook_To_v1alpha1_Webhook(in, out, s) -} - -func autoConvert_v1alpha1_WebhookClientConfig_To_auditregistration_WebhookClientConfig(in *v1alpha1.WebhookClientConfig, out *auditregistration.WebhookClientConfig, s conversion.Scope) error { - out.URL = (*string)(unsafe.Pointer(in.URL)) - if in.Service != nil { - in, out := &in.Service, &out.Service - *out = new(auditregistration.ServiceReference) - if err := Convert_v1alpha1_ServiceReference_To_auditregistration_ServiceReference(*in, *out, s); err != nil { - return err - } - } else { - out.Service = nil - } - out.CABundle = *(*[]byte)(unsafe.Pointer(&in.CABundle)) - return nil -} - -// Convert_v1alpha1_WebhookClientConfig_To_auditregistration_WebhookClientConfig is an autogenerated conversion function. -func Convert_v1alpha1_WebhookClientConfig_To_auditregistration_WebhookClientConfig(in *v1alpha1.WebhookClientConfig, out *auditregistration.WebhookClientConfig, s conversion.Scope) error { - return autoConvert_v1alpha1_WebhookClientConfig_To_auditregistration_WebhookClientConfig(in, out, s) -} - -func autoConvert_auditregistration_WebhookClientConfig_To_v1alpha1_WebhookClientConfig(in *auditregistration.WebhookClientConfig, out *v1alpha1.WebhookClientConfig, s conversion.Scope) error { - out.URL = (*string)(unsafe.Pointer(in.URL)) - if in.Service != nil { - in, out := &in.Service, &out.Service - *out = new(v1alpha1.ServiceReference) - if err := Convert_auditregistration_ServiceReference_To_v1alpha1_ServiceReference(*in, *out, s); err != nil { - return err - } - } else { - out.Service = nil - } - out.CABundle = *(*[]byte)(unsafe.Pointer(&in.CABundle)) - return nil -} - -// Convert_auditregistration_WebhookClientConfig_To_v1alpha1_WebhookClientConfig is an autogenerated conversion function. -func Convert_auditregistration_WebhookClientConfig_To_v1alpha1_WebhookClientConfig(in *auditregistration.WebhookClientConfig, out *v1alpha1.WebhookClientConfig, s conversion.Scope) error { - return autoConvert_auditregistration_WebhookClientConfig_To_v1alpha1_WebhookClientConfig(in, out, s) -} - -func autoConvert_v1alpha1_WebhookThrottleConfig_To_auditregistration_WebhookThrottleConfig(in *v1alpha1.WebhookThrottleConfig, out *auditregistration.WebhookThrottleConfig, s conversion.Scope) error { - out.QPS = (*int64)(unsafe.Pointer(in.QPS)) - out.Burst = (*int64)(unsafe.Pointer(in.Burst)) - return nil -} - -// Convert_v1alpha1_WebhookThrottleConfig_To_auditregistration_WebhookThrottleConfig is an autogenerated conversion function. -func Convert_v1alpha1_WebhookThrottleConfig_To_auditregistration_WebhookThrottleConfig(in *v1alpha1.WebhookThrottleConfig, out *auditregistration.WebhookThrottleConfig, s conversion.Scope) error { - return autoConvert_v1alpha1_WebhookThrottleConfig_To_auditregistration_WebhookThrottleConfig(in, out, s) -} - -func autoConvert_auditregistration_WebhookThrottleConfig_To_v1alpha1_WebhookThrottleConfig(in *auditregistration.WebhookThrottleConfig, out *v1alpha1.WebhookThrottleConfig, s conversion.Scope) error { - out.QPS = (*int64)(unsafe.Pointer(in.QPS)) - out.Burst = (*int64)(unsafe.Pointer(in.Burst)) - return nil -} - -// Convert_auditregistration_WebhookThrottleConfig_To_v1alpha1_WebhookThrottleConfig is an autogenerated conversion function. -func Convert_auditregistration_WebhookThrottleConfig_To_v1alpha1_WebhookThrottleConfig(in *auditregistration.WebhookThrottleConfig, out *v1alpha1.WebhookThrottleConfig, s conversion.Scope) error { - return autoConvert_auditregistration_WebhookThrottleConfig_To_v1alpha1_WebhookThrottleConfig(in, out, s) -} diff --git a/pkg/apis/auditregistration/v1alpha1/zz_generated.defaults.go b/pkg/apis/auditregistration/v1alpha1/zz_generated.defaults.go deleted file mode 100644 index 7633a012e78..00000000000 --- a/pkg/apis/auditregistration/v1alpha1/zz_generated.defaults.go +++ /dev/null @@ -1,49 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright The 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 ( - v1alpha1 "k8s.io/api/auditregistration/v1alpha1" - 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 { - scheme.AddTypeDefaultingFunc(&v1alpha1.AuditSink{}, func(obj interface{}) { SetObjectDefaults_AuditSink(obj.(*v1alpha1.AuditSink)) }) - scheme.AddTypeDefaultingFunc(&v1alpha1.AuditSinkList{}, func(obj interface{}) { SetObjectDefaults_AuditSinkList(obj.(*v1alpha1.AuditSinkList)) }) - return nil -} - -func SetObjectDefaults_AuditSink(in *v1alpha1.AuditSink) { - SetDefaults_AuditSink(in) - if in.Spec.Webhook.ClientConfig.Service != nil { - SetDefaults_ServiceReference(in.Spec.Webhook.ClientConfig.Service) - } -} - -func SetObjectDefaults_AuditSinkList(in *v1alpha1.AuditSinkList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_AuditSink(a) - } -} diff --git a/pkg/apis/auditregistration/validation/BUILD b/pkg/apis/auditregistration/validation/BUILD deleted file mode 100644 index 504e8299b7f..00000000000 --- a/pkg/apis/auditregistration/validation/BUILD +++ /dev/null @@ -1,42 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["validation.go"], - importpath = "k8s.io/kubernetes/pkg/apis/auditregistration/validation", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/auditregistration:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/api/validation:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/webhook:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["validation_test.go"], - embed = [":go_default_library"], - deps = [ - "//pkg/apis/auditregistration:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - "//vendor/github.com/stretchr/testify/require:go_default_library", - "//vendor/k8s.io/utils/pointer: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/pkg/apis/auditregistration/validation/validation.go b/pkg/apis/auditregistration/validation/validation.go deleted file mode 100644 index 5934883c957..00000000000 --- a/pkg/apis/auditregistration/validation/validation.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -Copyright 2018 The 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 validation - -import ( - "strings" - - genericvalidation "k8s.io/apimachinery/pkg/api/validation" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apiserver/pkg/util/webhook" - "k8s.io/kubernetes/pkg/apis/auditregistration" -) - -// ValidateAuditSink validates the AuditSinks -func ValidateAuditSink(as *auditregistration.AuditSink) field.ErrorList { - allErrs := genericvalidation.ValidateObjectMeta(&as.ObjectMeta, false, genericvalidation.NameIsDNSSubdomain, field.NewPath("metadata")) - allErrs = append(allErrs, ValidateAuditSinkSpec(as.Spec, field.NewPath("spec"))...) - return allErrs -} - -// ValidateAuditSinkSpec validates the sink spec for audit -func ValidateAuditSinkSpec(s auditregistration.AuditSinkSpec, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - allErrs = append(allErrs, ValidatePolicy(s.Policy, fldPath.Child("policy"))...) - allErrs = append(allErrs, ValidateWebhook(s.Webhook, fldPath.Child("webhook"))...) - return allErrs -} - -// ValidateWebhook validates the webhook -func ValidateWebhook(w auditregistration.Webhook, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - if w.Throttle != nil { - allErrs = append(allErrs, ValidateWebhookThrottleConfig(w.Throttle, fldPath.Child("throttle"))...) - } - - cc := w.ClientConfig - switch { - case (cc.URL == nil) == (cc.Service == nil): - allErrs = append(allErrs, field.Required(fldPath.Child("clientConfig"), "exactly one of url or service is required")) - case cc.URL != nil: - allErrs = append(allErrs, webhook.ValidateWebhookURL(fldPath.Child("clientConfig").Child("url"), *cc.URL, false)...) - case cc.Service != nil: - allErrs = append(allErrs, webhook.ValidateWebhookService(fldPath.Child("clientConfig").Child("service"), cc.Service.Name, cc.Service.Namespace, cc.Service.Path, cc.Service.Port)...) - } - return allErrs -} - -// ValidateWebhookThrottleConfig validates the throttle config -func ValidateWebhookThrottleConfig(c *auditregistration.WebhookThrottleConfig, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - if c.QPS != nil && *c.QPS <= 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("qps"), c.QPS, "qps must be a positive number")) - } - if c.Burst != nil && *c.Burst <= 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("burst"), c.Burst, "burst must be a positive number")) - } - return allErrs -} - -// ValidatePolicy validates the audit policy -func ValidatePolicy(policy auditregistration.Policy, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - allErrs = append(allErrs, validateStages(policy.Stages, fldPath.Child("stages"))...) - allErrs = append(allErrs, validateLevel(policy.Level, fldPath.Child("level"))...) - if policy.Level != auditregistration.LevelNone && len(policy.Stages) == 0 { - return field.ErrorList{field.Required(fldPath.Child("stages"), "")} - } - return allErrs -} - -var validLevels = sets.NewString( - string(auditregistration.LevelNone), - string(auditregistration.LevelMetadata), - string(auditregistration.LevelRequest), - string(auditregistration.LevelRequestResponse), -) - -var validStages = sets.NewString( - string(auditregistration.StageRequestReceived), - string(auditregistration.StageResponseStarted), - string(auditregistration.StageResponseComplete), - string(auditregistration.StagePanic), -) - -func validateLevel(level auditregistration.Level, fldPath *field.Path) field.ErrorList { - if string(level) == "" { - return field.ErrorList{field.Required(fldPath, "")} - } - if !validLevels.Has(string(level)) { - return field.ErrorList{field.NotSupported(fldPath, level, validLevels.List())} - } - return nil -} - -func validateStages(stages []auditregistration.Stage, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - for i, stage := range stages { - if !validStages.Has(string(stage)) { - allErrs = append(allErrs, field.Invalid(fldPath.Index(i), string(stage), "allowed stages are "+strings.Join(validStages.List(), ","))) - } - } - return allErrs -} - -// ValidateAuditSinkUpdate validates an update to the object -func ValidateAuditSinkUpdate(newC, oldC *auditregistration.AuditSink) field.ErrorList { - return ValidateAuditSink(newC) -} diff --git a/pkg/apis/auditregistration/validation/validation_test.go b/pkg/apis/auditregistration/validation/validation_test.go deleted file mode 100644 index a03a710f849..00000000000 --- a/pkg/apis/auditregistration/validation/validation_test.go +++ /dev/null @@ -1,359 +0,0 @@ -/* -Copyright 2018 The 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 validation - -import ( - "strings" - "testing" - - "github.com/stretchr/testify/require" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/kubernetes/pkg/apis/auditregistration" - utilpointer "k8s.io/utils/pointer" -) - -func TestValidateAuditSink(t *testing.T) { - testQPS := int64(10) - testURL := "http://localhost" - testCases := []struct { - name string - conf auditregistration.AuditSink - numErr int - }{ - { - name: "should pass full config", - conf: auditregistration.AuditSink{ - ObjectMeta: metav1.ObjectMeta{ - Name: "myconf", - }, - Spec: auditregistration.AuditSinkSpec{ - Policy: auditregistration.Policy{ - Level: auditregistration.LevelRequest, - Stages: []auditregistration.Stage{ - auditregistration.StageRequestReceived, - }, - }, - Webhook: auditregistration.Webhook{ - Throttle: &auditregistration.WebhookThrottleConfig{ - QPS: &testQPS, - }, - ClientConfig: auditregistration.WebhookClientConfig{ - URL: &testURL, - }, - }, - }, - }, - numErr: 0, - }, - { - name: "should fail no policy", - conf: auditregistration.AuditSink{ - ObjectMeta: metav1.ObjectMeta{ - Name: "myconf", - }, - Spec: auditregistration.AuditSinkSpec{ - Webhook: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - URL: &testURL, - }, - }, - }, - }, - numErr: 1, - }, - { - name: "should fail no webhook", - conf: auditregistration.AuditSink{ - ObjectMeta: metav1.ObjectMeta{ - Name: "myconf", - }, - Spec: auditregistration.AuditSinkSpec{ - Policy: auditregistration.Policy{ - Level: auditregistration.LevelMetadata, - Stages: []auditregistration.Stage{ - auditregistration.StageRequestReceived, - }, - }, - }, - }, - numErr: 1, - }, - } - - for _, test := range testCases { - t.Run(test.name, func(t *testing.T) { - errs := ValidateAuditSink(&test.conf) - require.Len(t, errs, test.numErr) - }) - } -} - -func TestValidatePolicy(t *testing.T) { - successCases := []auditregistration.Policy{} - successCases = append(successCases, auditregistration.Policy{ // Policy with omitStages and level - Level: auditregistration.LevelRequest, - Stages: []auditregistration.Stage{ - auditregistration.Stage("RequestReceived"), - auditregistration.Stage("ResponseStarted"), - }, - }) - successCases = append(successCases, auditregistration.Policy{Level: auditregistration.LevelNone}) // Policy with none level only - - for i, policy := range successCases { - if errs := ValidatePolicy(policy, field.NewPath("policy")); len(errs) != 0 { - t.Errorf("[%d] Expected policy %#v to be valid: %v", i, policy, errs) - } - } - - errorCases := []auditregistration.Policy{} - errorCases = append(errorCases, auditregistration.Policy{}) // Empty policy // Policy with missing level - errorCases = append(errorCases, auditregistration.Policy{Stages: []auditregistration.Stage{ // Policy with invalid stages - auditregistration.Stage("Bad")}}) - errorCases = append(errorCases, auditregistration.Policy{Level: auditregistration.Level("invalid")}) // Policy with bad level - errorCases = append(errorCases, auditregistration.Policy{Level: auditregistration.LevelMetadata}) // Policy without stages - - for i, policy := range errorCases { - if errs := ValidatePolicy(policy, field.NewPath("policy")); len(errs) == 0 { - t.Errorf("[%d] Expected policy %#v to be invalid!", i, policy) - } - } -} - -func TestValidateWebhookConfiguration(t *testing.T) { - tests := []struct { - name string - config auditregistration.Webhook - expectedError string - }{ - { - name: "both service and URL missing", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{}, - }, - expectedError: `exactly one of`, - }, - { - name: "both service and URL provided", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - Service: &auditregistration.ServiceReference{ - Namespace: "ns", - Name: "n", - Port: 443, - }, - URL: utilpointer.StringPtr("example.com/k8s/webhook"), - }, - }, - expectedError: `webhook.clientConfig: Required value: exactly one of url or service is required`, - }, - { - name: "blank URL", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - URL: utilpointer.StringPtr(""), - }, - }, - expectedError: `webhook.clientConfig.url: Invalid value: "": host must be provided`, - }, - { - name: "missing host", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - URL: utilpointer.StringPtr("https:///fancy/webhook"), - }, - }, - expectedError: `host must be provided`, - }, - { - name: "fragment", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - URL: utilpointer.StringPtr("https://example.com/#bookmark"), - }, - }, - expectedError: `"bookmark": fragments are not permitted`, - }, - { - name: "query", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - URL: utilpointer.StringPtr("https://example.com?arg=value"), - }, - }, - expectedError: `"arg=value": query parameters are not permitted`, - }, - { - name: "user", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - URL: utilpointer.StringPtr("https://harry.potter@example.com/"), - }, - }, - expectedError: `"harry.potter": user information is not permitted`, - }, - { - name: "just totally wrong", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - URL: utilpointer.StringPtr("arg#backwards=thisis?html.index/port:host//:https"), - }, - }, - expectedError: `host must be provided`, - }, - { - name: "path must start with slash", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - Service: &auditregistration.ServiceReference{ - Namespace: "ns", - Name: "n", - Path: utilpointer.StringPtr("foo/"), - Port: 443, - }, - }, - }, - expectedError: `clientConfig.service.path: Invalid value: "foo/": must start with a '/'`, - }, - { - name: "invalid port >65535", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - Service: &auditregistration.ServiceReference{ - Namespace: "ns", - Name: "n", - Path: utilpointer.StringPtr("foo/"), - Port: 65536, - }, - }, - }, - expectedError: `Invalid value: 65536: port is not valid: must be between 1 and 65535, inclusive`, - }, - { - name: "invalid port 0", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - Service: &auditregistration.ServiceReference{ - Namespace: "ns", - Name: "n", - Path: utilpointer.StringPtr("foo/"), - Port: 0, - }, - }, - }, - expectedError: `Invalid value: 0: port is not valid: must be between 1 and 65535, inclusive`, - }, - { - name: "path accepts slash", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - Service: &auditregistration.ServiceReference{ - Namespace: "ns", - Name: "n", - Path: utilpointer.StringPtr("/"), - Port: 443, - }, - }, - }, - expectedError: ``, - }, - { - name: "path accepts no trailing slash", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - Service: &auditregistration.ServiceReference{ - Namespace: "ns", - Name: "n", - Path: utilpointer.StringPtr("/foo"), - Port: 443, - }, - }, - }, - expectedError: ``, - }, - { - name: "path fails //", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - Service: &auditregistration.ServiceReference{ - Namespace: "ns", - Name: "n", - Path: utilpointer.StringPtr("//"), - Port: 443, - }, - }, - }, - expectedError: `clientConfig.service.path: Invalid value: "//": segment[0] may not be empty`, - }, - { - name: "path no empty step", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - Service: &auditregistration.ServiceReference{ - Namespace: "ns", - Name: "n", - Path: utilpointer.StringPtr("/foo//bar/"), - Port: 443, - }, - }, - }, - expectedError: `clientConfig.service.path: Invalid value: "/foo//bar/": segment[1] may not be empty`, - }, { - name: "path no empty step 2", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - Service: &auditregistration.ServiceReference{ - Namespace: "ns", - Name: "n", - Path: utilpointer.StringPtr("/foo/bar//"), - Port: 443, - }, - }, - }, - expectedError: `clientConfig.service.path: Invalid value: "/foo/bar//": segment[2] may not be empty`, - }, - { - name: "path no non-subdomain", - config: auditregistration.Webhook{ - ClientConfig: auditregistration.WebhookClientConfig{ - Service: &auditregistration.ServiceReference{ - Namespace: "ns", - Name: "n", - Path: utilpointer.StringPtr("/apis/foo.bar/v1alpha1/--bad"), - Port: 443, - }, - }, - }, - expectedError: `clientConfig.service.path: Invalid value: "/apis/foo.bar/v1alpha1/--bad": segment[3]: a DNS-1123 subdomain`, - }, - } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - errs := ValidateWebhook(test.config, field.NewPath("webhook")) - err := errs.ToAggregate() - if err != nil { - if e, a := test.expectedError, err.Error(); !strings.Contains(a, e) || e == "" { - t.Errorf("expected to contain \nerr: %s \ngot: %s", e, a) - } - } else { - if test.expectedError != "" { - t.Errorf("unexpected no error, expected to contain %s", test.expectedError) - } - } - }) - } -} diff --git a/pkg/apis/auditregistration/zz_generated.deepcopy.go b/pkg/apis/auditregistration/zz_generated.deepcopy.go deleted file mode 100644 index 28423787b7e..00000000000 --- a/pkg/apis/auditregistration/zz_generated.deepcopy.go +++ /dev/null @@ -1,224 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright The 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 auditregistration - -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 *AuditSink) DeepCopyInto(out *AuditSink) { - *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 AuditSink. -func (in *AuditSink) DeepCopy() *AuditSink { - if in == nil { - return nil - } - out := new(AuditSink) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AuditSink) 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 *AuditSinkList) DeepCopyInto(out *AuditSinkList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AuditSink, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuditSinkList. -func (in *AuditSinkList) DeepCopy() *AuditSinkList { - if in == nil { - return nil - } - out := new(AuditSinkList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AuditSinkList) 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 *AuditSinkSpec) DeepCopyInto(out *AuditSinkSpec) { - *out = *in - in.Policy.DeepCopyInto(&out.Policy) - in.Webhook.DeepCopyInto(&out.Webhook) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuditSinkSpec. -func (in *AuditSinkSpec) DeepCopy() *AuditSinkSpec { - if in == nil { - return nil - } - out := new(AuditSinkSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Policy) DeepCopyInto(out *Policy) { - *out = *in - if in.Stages != nil { - in, out := &in.Stages, &out.Stages - *out = make([]Stage, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy. -func (in *Policy) DeepCopy() *Policy { - if in == nil { - return nil - } - out := new(Policy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceReference) DeepCopyInto(out *ServiceReference) { - *out = *in - if in.Path != nil { - in, out := &in.Path, &out.Path - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReference. -func (in *ServiceReference) DeepCopy() *ServiceReference { - if in == nil { - return nil - } - out := new(ServiceReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Webhook) DeepCopyInto(out *Webhook) { - *out = *in - if in.Throttle != nil { - in, out := &in.Throttle, &out.Throttle - *out = new(WebhookThrottleConfig) - (*in).DeepCopyInto(*out) - } - in.ClientConfig.DeepCopyInto(&out.ClientConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Webhook. -func (in *Webhook) DeepCopy() *Webhook { - if in == nil { - return nil - } - out := new(Webhook) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WebhookClientConfig) DeepCopyInto(out *WebhookClientConfig) { - *out = *in - if in.URL != nil { - in, out := &in.URL, &out.URL - *out = new(string) - **out = **in - } - if in.Service != nil { - in, out := &in.Service, &out.Service - *out = new(ServiceReference) - (*in).DeepCopyInto(*out) - } - if in.CABundle != nil { - in, out := &in.CABundle, &out.CABundle - *out = make([]byte, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookClientConfig. -func (in *WebhookClientConfig) DeepCopy() *WebhookClientConfig { - if in == nil { - return nil - } - out := new(WebhookClientConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WebhookThrottleConfig) DeepCopyInto(out *WebhookThrottleConfig) { - *out = *in - if in.QPS != nil { - in, out := &in.QPS, &out.QPS - *out = new(int64) - **out = **in - } - if in.Burst != nil { - in, out := &in.Burst, &out.Burst - *out = new(int64) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookThrottleConfig. -func (in *WebhookThrottleConfig) DeepCopy() *WebhookThrottleConfig { - if in == nil { - return nil - } - out := new(WebhookThrottleConfig) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/master/BUILD b/pkg/master/BUILD index c52364a9e0d..796d675895d 100644 --- a/pkg/master/BUILD +++ b/pkg/master/BUILD @@ -16,7 +16,6 @@ go_library( "//pkg/apis/admission/install:go_default_library", "//pkg/apis/admissionregistration/install:go_default_library", "//pkg/apis/apps/install:go_default_library", - "//pkg/apis/auditregistration/install:go_default_library", "//pkg/apis/authentication/install:go_default_library", "//pkg/apis/authorization/install:go_default_library", "//pkg/apis/autoscaling/install:go_default_library", @@ -45,7 +44,6 @@ go_library( "//pkg/master/tunneler:go_default_library", "//pkg/registry/admissionregistration/rest:go_default_library", "//pkg/registry/apps/rest:go_default_library", - "//pkg/registry/auditregistration/rest:go_default_library", "//pkg/registry/authentication/rest:go_default_library", "//pkg/registry/authorization/rest:go_default_library", "//pkg/registry/autoscaling/rest:go_default_library", @@ -74,7 +72,6 @@ go_library( "//staging/src/k8s.io/api/admissionregistration/v1:go_default_library", "//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library", "//staging/src/k8s.io/api/apps/v1:go_default_library", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/api/authentication/v1:go_default_library", "//staging/src/k8s.io/api/authentication/v1beta1:go_default_library", "//staging/src/k8s.io/api/authorization/v1:go_default_library", diff --git a/pkg/master/import_known_versions.go b/pkg/master/import_known_versions.go index b7b01e4bdc6..5c71e5fca77 100644 --- a/pkg/master/import_known_versions.go +++ b/pkg/master/import_known_versions.go @@ -21,7 +21,6 @@ import ( _ "k8s.io/kubernetes/pkg/apis/admission/install" _ "k8s.io/kubernetes/pkg/apis/admissionregistration/install" _ "k8s.io/kubernetes/pkg/apis/apps/install" - _ "k8s.io/kubernetes/pkg/apis/auditregistration/install" _ "k8s.io/kubernetes/pkg/apis/authentication/install" _ "k8s.io/kubernetes/pkg/apis/authorization/install" _ "k8s.io/kubernetes/pkg/apis/autoscaling/install" diff --git a/pkg/master/master.go b/pkg/master/master.go index cccdbdd7eec..232eb736a5f 100644 --- a/pkg/master/master.go +++ b/pkg/master/master.go @@ -28,7 +28,6 @@ import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" appsv1 "k8s.io/api/apps/v1" - auditregistrationv1alpha1 "k8s.io/api/auditregistration/v1alpha1" authenticationv1 "k8s.io/api/authentication/v1" authenticationv1beta1 "k8s.io/api/authentication/v1beta1" authorizationapiv1 "k8s.io/api/authorization/v1" @@ -93,7 +92,6 @@ import ( // RESTStorage installers admissionregistrationrest "k8s.io/kubernetes/pkg/registry/admissionregistration/rest" appsrest "k8s.io/kubernetes/pkg/registry/apps/rest" - auditregistrationrest "k8s.io/kubernetes/pkg/registry/auditregistration/rest" authenticationrest "k8s.io/kubernetes/pkg/registry/authentication/rest" authorizationrest "k8s.io/kubernetes/pkg/registry/authorization/rest" autoscalingrest "k8s.io/kubernetes/pkg/registry/autoscaling/rest" @@ -415,7 +413,6 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget) // TODO: describe the priority all the way down in the RESTStorageProviders and plumb it back through the various discovery // handlers that we have. restStorageProviders := []RESTStorageProvider{ - auditregistrationrest.RESTStorageProvider{}, authenticationrest.RESTStorageProvider{Authenticator: c.GenericConfig.Authentication.Authenticator, APIAudiences: c.GenericConfig.Authentication.APIAudiences}, authorizationrest.RESTStorageProvider{Authorizer: c.GenericConfig.Authorization.Authorizer, RuleResolver: c.GenericConfig.RuleResolver}, autoscalingrest.RESTStorageProvider{}, @@ -632,7 +629,6 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig { ) // disable alpha versions explicitly so we have a full list of what's possible to serve ret.DisableVersions( - auditregistrationv1alpha1.SchemeGroupVersion, batchapiv2alpha1.SchemeGroupVersion, nodev1alpha1.SchemeGroupVersion, rbacv1alpha1.SchemeGroupVersion, diff --git a/pkg/registry/BUILD b/pkg/registry/BUILD index 78c3a21fd8e..3652ce3a475 100644 --- a/pkg/registry/BUILD +++ b/pkg/registry/BUILD @@ -31,8 +31,6 @@ filegroup( "//pkg/registry/apps/replicaset:all-srcs", "//pkg/registry/apps/rest:all-srcs", "//pkg/registry/apps/statefulset:all-srcs", - "//pkg/registry/auditregistration/auditsink:all-srcs", - "//pkg/registry/auditregistration/rest:all-srcs", "//pkg/registry/authentication/rest:all-srcs", "//pkg/registry/authentication/tokenreview:all-srcs", "//pkg/registry/authorization/localsubjectaccessreview:all-srcs", diff --git a/pkg/registry/auditregistration/auditsink/BUILD b/pkg/registry/auditregistration/auditsink/BUILD deleted file mode 100644 index c34dafb7770..00000000000 --- a/pkg/registry/auditregistration/auditsink/BUILD +++ /dev/null @@ -1,36 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "strategy.go", - ], - importpath = "k8s.io/kubernetes/pkg/registry/auditregistration/auditsink", - visibility = ["//visibility:public"], - deps = [ - "//pkg/api/legacyscheme:go_default_library", - "//pkg/apis/auditregistration:go_default_library", - "//pkg/apis/auditregistration/validation:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/storage/names:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//pkg/registry/auditregistration/auditsink/storage:all-srcs", - ], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/pkg/registry/auditregistration/auditsink/doc.go b/pkg/registry/auditregistration/auditsink/doc.go deleted file mode 100644 index 09f36e9aa81..00000000000 --- a/pkg/registry/auditregistration/auditsink/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright 2018 The 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 auditsink // import "k8s.io/kubernetes/pkg/registry/auditregistration/auditsink" diff --git a/pkg/registry/auditregistration/auditsink/storage/BUILD b/pkg/registry/auditregistration/auditsink/storage/BUILD deleted file mode 100644 index 0c58422bef7..00000000000 --- a/pkg/registry/auditregistration/auditsink/storage/BUILD +++ /dev/null @@ -1,30 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["storage.go"], - importpath = "k8s.io/kubernetes/pkg/registry/auditregistration/auditsink/storage", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/auditregistration:go_default_library", - "//pkg/registry/auditregistration/auditsink:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/registry/generic:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/registry/generic/registry:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/registry/rest: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/pkg/registry/auditregistration/auditsink/storage/storage.go b/pkg/registry/auditregistration/auditsink/storage/storage.go deleted file mode 100644 index a2ba834c7f7..00000000000 --- a/pkg/registry/auditregistration/auditsink/storage/storage.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2018 The 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 storage - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apiserver/pkg/registry/generic" - genericregistry "k8s.io/apiserver/pkg/registry/generic/registry" - "k8s.io/apiserver/pkg/registry/rest" - "k8s.io/kubernetes/pkg/apis/auditregistration" - auditstrategy "k8s.io/kubernetes/pkg/registry/auditregistration/auditsink" -) - -// REST implements a RESTStorage for audit sink against etcd -type REST struct { - *genericregistry.Store -} - -// NewREST returns a RESTStorage object that will work against audit sinks -func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, error) { - store := &genericregistry.Store{ - NewFunc: func() runtime.Object { return &auditregistration.AuditSink{} }, - NewListFunc: func() runtime.Object { return &auditregistration.AuditSinkList{} }, - ObjectNameFunc: func(obj runtime.Object) (string, error) { - return obj.(*auditregistration.AuditSink).Name, nil - }, - DefaultQualifiedResource: auditregistration.Resource("auditsinks"), - - CreateStrategy: auditstrategy.Strategy, - UpdateStrategy: auditstrategy.Strategy, - DeleteStrategy: auditstrategy.Strategy, - - // TODO: define table converter that exposes more than name/creation timestamp - TableConvertor: rest.NewDefaultTableConvertor(auditregistration.Resource("auditsinks")), - } - options := &generic.StoreOptions{RESTOptions: optsGetter} - if err := store.CompleteWithOptions(options); err != nil { - return nil, err - } - return &REST{store}, nil -} diff --git a/pkg/registry/auditregistration/auditsink/strategy.go b/pkg/registry/auditregistration/auditsink/strategy.go deleted file mode 100644 index 23c85ccbca6..00000000000 --- a/pkg/registry/auditregistration/auditsink/strategy.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2018 The 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 auditsink - -import ( - "context" - "reflect" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apiserver/pkg/storage/names" - "k8s.io/kubernetes/pkg/api/legacyscheme" - audit "k8s.io/kubernetes/pkg/apis/auditregistration" - "k8s.io/kubernetes/pkg/apis/auditregistration/validation" -) - -// auditSinkStrategy implements verification logic for AuditSink. -type auditSinkStrategy struct { - runtime.ObjectTyper - names.NameGenerator -} - -// Strategy is the default logic that applies when creating and updating AuditSink objects. -var Strategy = auditSinkStrategy{legacyscheme.Scheme, names.SimpleNameGenerator} - -// NamespaceScoped returns false because all AuditSink's need to be cluster scoped -func (auditSinkStrategy) NamespaceScoped() bool { - return false -} - -// PrepareForCreate clears the status of an AuditSink before creation. -func (auditSinkStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { - ic := obj.(*audit.AuditSink) - ic.Generation = 1 -} - -// PrepareForUpdate clears fields that are not allowed to be set by end users on update. -func (auditSinkStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { - newIC := obj.(*audit.AuditSink) - oldIC := old.(*audit.AuditSink) - - // Any changes to the policy or backend increment the generation number - // See metav1.ObjectMeta description for more information on Generation. - if !reflect.DeepEqual(oldIC.Spec, newIC.Spec) { - newIC.Generation = oldIC.Generation + 1 - } -} - -// Validate validates a new auditSink. -func (auditSinkStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { - ic := obj.(*audit.AuditSink) - return validation.ValidateAuditSink(ic) -} - -// Canonicalize normalizes the object after validation. -func (auditSinkStrategy) Canonicalize(obj runtime.Object) { -} - -// AllowCreateOnUpdate is true for auditSink; this means you may create one with a PUT request. -func (auditSinkStrategy) AllowCreateOnUpdate() bool { - return false -} - -// ValidateUpdate is the default update validation for an end user. -func (auditSinkStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { - validationErrorList := validation.ValidateAuditSink(obj.(*audit.AuditSink)) - updateErrorList := validation.ValidateAuditSinkUpdate(obj.(*audit.AuditSink), old.(*audit.AuditSink)) - return append(validationErrorList, updateErrorList...) -} - -// AllowUnconditionalUpdate is the default update policy for auditSink objects. Status update should -// only be allowed if version match. -func (auditSinkStrategy) AllowUnconditionalUpdate() bool { - return false -} diff --git a/pkg/registry/auditregistration/rest/BUILD b/pkg/registry/auditregistration/rest/BUILD deleted file mode 100644 index a772ac495a0..00000000000 --- a/pkg/registry/auditregistration/rest/BUILD +++ /dev/null @@ -1,31 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["storage_auditregistration.go"], - importpath = "k8s.io/kubernetes/pkg/registry/auditregistration/rest", - visibility = ["//visibility:public"], - deps = [ - "//pkg/api/legacyscheme:go_default_library", - "//pkg/registry/auditregistration/auditsink/storage:go_default_library", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/registry/generic:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/registry/rest:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/server:go_default_library", - "//staging/src/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/pkg/registry/auditregistration/rest/storage_auditregistration.go b/pkg/registry/auditregistration/rest/storage_auditregistration.go deleted file mode 100644 index 4c218c41a90..00000000000 --- a/pkg/registry/auditregistration/rest/storage_auditregistration.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2018 The 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 ( - auditv1alpha1 "k8s.io/api/auditregistration/v1alpha1" - "k8s.io/apiserver/pkg/registry/generic" - "k8s.io/apiserver/pkg/registry/rest" - genericapiserver "k8s.io/apiserver/pkg/server" - serverstorage "k8s.io/apiserver/pkg/server/storage" - "k8s.io/kubernetes/pkg/api/legacyscheme" - auditstorage "k8s.io/kubernetes/pkg/registry/auditregistration/auditsink/storage" -) - -// RESTStorageProvider is a REST storage provider for audit.k8s.io -type RESTStorageProvider struct{} - -// NewRESTStorage returns a RESTStorageProvider -func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool, error) { - apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(auditv1alpha1.GroupName, legacyscheme.Scheme, legacyscheme.ParameterCodec, legacyscheme.Codecs) - - if apiResourceConfigSource.VersionEnabled(auditv1alpha1.SchemeGroupVersion) { - if storageMap, err := p.v1alpha1Storage(apiResourceConfigSource, restOptionsGetter); err != nil { - return genericapiserver.APIGroupInfo{}, false, err - } else { - apiGroupInfo.VersionedResourcesStorageMap[auditv1alpha1.SchemeGroupVersion.Version] = storageMap - } - } - return apiGroupInfo, true, nil -} - -func (p RESTStorageProvider) v1alpha1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) { - storage := map[string]rest.Storage{} - s, err := auditstorage.NewREST(restOptionsGetter) - storage["auditsinks"] = s - - return storage, err -} - -// GroupName is the group name for the storage provider -func (p RESTStorageProvider) GroupName() string { - return auditv1alpha1.GroupName -} diff --git a/staging/src/k8s.io/api/BUILD b/staging/src/k8s.io/api/BUILD index bd9a271ff69..24316ca4d1d 100644 --- a/staging/src/k8s.io/api/BUILD +++ b/staging/src/k8s.io/api/BUILD @@ -71,7 +71,6 @@ filegroup( "//staging/src/k8s.io/api/apps/v1:all-srcs", "//staging/src/k8s.io/api/apps/v1beta1:all-srcs", "//staging/src/k8s.io/api/apps/v1beta2:all-srcs", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:all-srcs", "//staging/src/k8s.io/api/authentication/v1:all-srcs", "//staging/src/k8s.io/api/authentication/v1beta1:all-srcs", "//staging/src/k8s.io/api/authorization/v1:all-srcs", diff --git a/staging/src/k8s.io/api/auditregistration/OWNERS b/staging/src/k8s.io/api/auditregistration/OWNERS deleted file mode 100644 index 3ff06a10f52..00000000000 --- a/staging/src/k8s.io/api/auditregistration/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: -- sig-auth-audit-approvers -- sig-auth-audit-reviewers -labels: -- sig/auth - diff --git a/staging/src/k8s.io/api/auditregistration/v1alpha1/BUILD b/staging/src/k8s.io/api/auditregistration/v1alpha1/BUILD deleted file mode 100644 index 5f1523e0f00..00000000000 --- a/staging/src/k8s.io/api/auditregistration/v1alpha1/BUILD +++ /dev/null @@ -1,36 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "generated.pb.go", - "register.go", - "types.go", - "types_swagger_doc_generated.go", - "zz_generated.deepcopy.go", - ], - importmap = "k8s.io/kubernetes/vendor/k8s.io/api/auditregistration/v1alpha1", - importpath = "k8s.io/api/auditregistration/v1alpha1", - visibility = ["//visibility:public"], - deps = [ - "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//vendor/github.com/gogo/protobuf/proto: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/staging/src/k8s.io/api/auditregistration/v1alpha1/doc.go b/staging/src/k8s.io/api/auditregistration/v1alpha1/doc.go deleted file mode 100644 index ae8f7671493..00000000000 --- a/staging/src/k8s.io/api/auditregistration/v1alpha1/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2018 The 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:protobuf-gen=package -// +k8s:openapi-gen=true - -// +groupName=auditregistration.k8s.io - -package v1alpha1 // import "k8s.io/api/auditregistration/v1alpha1" diff --git a/staging/src/k8s.io/api/auditregistration/v1alpha1/generated.pb.go b/staging/src/k8s.io/api/auditregistration/v1alpha1/generated.pb.go deleted file mode 100644 index f8eec3df2b5..00000000000 --- a/staging/src/k8s.io/api/auditregistration/v1alpha1/generated.pb.go +++ /dev/null @@ -1,2030 +0,0 @@ -/* -Copyright The 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. DO NOT EDIT. -// source: k8s.io/kubernetes/vendor/k8s.io/api/auditregistration/v1alpha1/generated.proto - -package v1alpha1 - -import ( - fmt "fmt" - - io "io" - - proto "github.com/gogo/protobuf/proto" - - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -func (m *AuditSink) Reset() { *m = AuditSink{} } -func (*AuditSink) ProtoMessage() {} -func (*AuditSink) Descriptor() ([]byte, []int) { - return fileDescriptor_642d3597c6afa8ba, []int{0} -} -func (m *AuditSink) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuditSink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *AuditSink) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuditSink.Merge(m, src) -} -func (m *AuditSink) XXX_Size() int { - return m.Size() -} -func (m *AuditSink) XXX_DiscardUnknown() { - xxx_messageInfo_AuditSink.DiscardUnknown(m) -} - -var xxx_messageInfo_AuditSink proto.InternalMessageInfo - -func (m *AuditSinkList) Reset() { *m = AuditSinkList{} } -func (*AuditSinkList) ProtoMessage() {} -func (*AuditSinkList) Descriptor() ([]byte, []int) { - return fileDescriptor_642d3597c6afa8ba, []int{1} -} -func (m *AuditSinkList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuditSinkList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *AuditSinkList) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuditSinkList.Merge(m, src) -} -func (m *AuditSinkList) XXX_Size() int { - return m.Size() -} -func (m *AuditSinkList) XXX_DiscardUnknown() { - xxx_messageInfo_AuditSinkList.DiscardUnknown(m) -} - -var xxx_messageInfo_AuditSinkList proto.InternalMessageInfo - -func (m *AuditSinkSpec) Reset() { *m = AuditSinkSpec{} } -func (*AuditSinkSpec) ProtoMessage() {} -func (*AuditSinkSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_642d3597c6afa8ba, []int{2} -} -func (m *AuditSinkSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuditSinkSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *AuditSinkSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuditSinkSpec.Merge(m, src) -} -func (m *AuditSinkSpec) XXX_Size() int { - return m.Size() -} -func (m *AuditSinkSpec) XXX_DiscardUnknown() { - xxx_messageInfo_AuditSinkSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_AuditSinkSpec proto.InternalMessageInfo - -func (m *Policy) Reset() { *m = Policy{} } -func (*Policy) ProtoMessage() {} -func (*Policy) Descriptor() ([]byte, []int) { - return fileDescriptor_642d3597c6afa8ba, []int{3} -} -func (m *Policy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Policy) XXX_Merge(src proto.Message) { - xxx_messageInfo_Policy.Merge(m, src) -} -func (m *Policy) XXX_Size() int { - return m.Size() -} -func (m *Policy) XXX_DiscardUnknown() { - xxx_messageInfo_Policy.DiscardUnknown(m) -} - -var xxx_messageInfo_Policy proto.InternalMessageInfo - -func (m *ServiceReference) Reset() { *m = ServiceReference{} } -func (*ServiceReference) ProtoMessage() {} -func (*ServiceReference) Descriptor() ([]byte, []int) { - return fileDescriptor_642d3597c6afa8ba, []int{4} -} -func (m *ServiceReference) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ServiceReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceReference.Merge(m, src) -} -func (m *ServiceReference) XXX_Size() int { - return m.Size() -} -func (m *ServiceReference) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceReference.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceReference proto.InternalMessageInfo - -func (m *Webhook) Reset() { *m = Webhook{} } -func (*Webhook) ProtoMessage() {} -func (*Webhook) Descriptor() ([]byte, []int) { - return fileDescriptor_642d3597c6afa8ba, []int{5} -} -func (m *Webhook) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Webhook) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Webhook) XXX_Merge(src proto.Message) { - xxx_messageInfo_Webhook.Merge(m, src) -} -func (m *Webhook) XXX_Size() int { - return m.Size() -} -func (m *Webhook) XXX_DiscardUnknown() { - xxx_messageInfo_Webhook.DiscardUnknown(m) -} - -var xxx_messageInfo_Webhook proto.InternalMessageInfo - -func (m *WebhookClientConfig) Reset() { *m = WebhookClientConfig{} } -func (*WebhookClientConfig) ProtoMessage() {} -func (*WebhookClientConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_642d3597c6afa8ba, []int{6} -} -func (m *WebhookClientConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WebhookClientConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *WebhookClientConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_WebhookClientConfig.Merge(m, src) -} -func (m *WebhookClientConfig) XXX_Size() int { - return m.Size() -} -func (m *WebhookClientConfig) XXX_DiscardUnknown() { - xxx_messageInfo_WebhookClientConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_WebhookClientConfig proto.InternalMessageInfo - -func (m *WebhookThrottleConfig) Reset() { *m = WebhookThrottleConfig{} } -func (*WebhookThrottleConfig) ProtoMessage() {} -func (*WebhookThrottleConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_642d3597c6afa8ba, []int{7} -} -func (m *WebhookThrottleConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WebhookThrottleConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *WebhookThrottleConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_WebhookThrottleConfig.Merge(m, src) -} -func (m *WebhookThrottleConfig) XXX_Size() int { - return m.Size() -} -func (m *WebhookThrottleConfig) XXX_DiscardUnknown() { - xxx_messageInfo_WebhookThrottleConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_WebhookThrottleConfig proto.InternalMessageInfo - -func init() { - proto.RegisterType((*AuditSink)(nil), "k8s.io.api.auditregistration.v1alpha1.AuditSink") - proto.RegisterType((*AuditSinkList)(nil), "k8s.io.api.auditregistration.v1alpha1.AuditSinkList") - proto.RegisterType((*AuditSinkSpec)(nil), "k8s.io.api.auditregistration.v1alpha1.AuditSinkSpec") - proto.RegisterType((*Policy)(nil), "k8s.io.api.auditregistration.v1alpha1.Policy") - proto.RegisterType((*ServiceReference)(nil), "k8s.io.api.auditregistration.v1alpha1.ServiceReference") - proto.RegisterType((*Webhook)(nil), "k8s.io.api.auditregistration.v1alpha1.Webhook") - proto.RegisterType((*WebhookClientConfig)(nil), "k8s.io.api.auditregistration.v1alpha1.WebhookClientConfig") - proto.RegisterType((*WebhookThrottleConfig)(nil), "k8s.io.api.auditregistration.v1alpha1.WebhookThrottleConfig") -} - -func init() { - proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/auditregistration/v1alpha1/generated.proto", fileDescriptor_642d3597c6afa8ba) -} - -var fileDescriptor_642d3597c6afa8ba = []byte{ - // 765 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x41, 0x6f, 0x13, 0x47, - 0x14, 0xf6, 0xc6, 0x76, 0x6c, 0x4f, 0x9c, 0x36, 0x9d, 0xb4, 0x95, 0x1b, 0x55, 0x6b, 0x6b, 0xa5, - 0x4a, 0x91, 0xda, 0xcc, 0x36, 0x55, 0xd4, 0x56, 0x88, 0x4b, 0x36, 0x27, 0xa4, 0x10, 0xc2, 0x98, - 0x80, 0x40, 0x08, 0x31, 0x5e, 0x3f, 0xef, 0x0e, 0xb6, 0x77, 0x97, 0xdd, 0x59, 0xa3, 0xdc, 0xf8, - 0x09, 0xfc, 0x05, 0xfe, 0x06, 0x37, 0x24, 0x90, 0x72, 0xcc, 0x31, 0xa7, 0x88, 0x98, 0x03, 0xff, - 0x81, 0x13, 0x9a, 0xd9, 0x59, 0xdb, 0xc4, 0x41, 0x38, 0xb7, 0x79, 0xdf, 0x7b, 0xdf, 0xf7, 0xbe, - 0xf7, 0xde, 0xa0, 0x83, 0xfe, 0xff, 0x09, 0xe1, 0xa1, 0xdd, 0x4f, 0x3b, 0x10, 0x07, 0x20, 0x20, - 0xb1, 0x47, 0x10, 0x74, 0xc3, 0xd8, 0xd6, 0x09, 0x16, 0x71, 0x9b, 0xa5, 0x5d, 0x2e, 0x62, 0xf0, - 0x78, 0x22, 0x62, 0x26, 0x78, 0x18, 0xd8, 0xa3, 0x6d, 0x36, 0x88, 0x7c, 0xb6, 0x6d, 0x7b, 0x10, - 0x40, 0xcc, 0x04, 0x74, 0x49, 0x14, 0x87, 0x22, 0xc4, 0x7f, 0x64, 0x34, 0xc2, 0x22, 0x4e, 0xe6, - 0x68, 0x24, 0xa7, 0x6d, 0x6c, 0x79, 0x5c, 0xf8, 0x69, 0x87, 0xb8, 0xe1, 0xd0, 0xf6, 0x42, 0x2f, - 0xb4, 0x15, 0xbb, 0x93, 0xf6, 0x54, 0xa4, 0x02, 0xf5, 0xca, 0x54, 0x37, 0x76, 0xa6, 0x66, 0x86, - 0xcc, 0xf5, 0x79, 0x00, 0xf1, 0xb1, 0x1d, 0xf5, 0x3d, 0x09, 0x24, 0xf6, 0x10, 0x04, 0xb3, 0x47, - 0x73, 0x5e, 0x36, 0xec, 0x6f, 0xb1, 0xe2, 0x34, 0x10, 0x7c, 0x08, 0x73, 0x84, 0x7f, 0xbf, 0x47, - 0x48, 0x5c, 0x1f, 0x86, 0xec, 0x32, 0xcf, 0x7a, 0x6f, 0xa0, 0xda, 0xae, 0x1c, 0xb6, 0xcd, 0x83, - 0x3e, 0x7e, 0x8a, 0xaa, 0xd2, 0x51, 0x97, 0x09, 0xd6, 0x30, 0x5a, 0xc6, 0xe6, 0xca, 0x3f, 0x7f, - 0x93, 0xe9, 0x56, 0x26, 0xc2, 0x24, 0xea, 0x7b, 0x12, 0x48, 0x88, 0xac, 0x26, 0xa3, 0x6d, 0x72, - 0xa7, 0xf3, 0x0c, 0x5c, 0x71, 0x1b, 0x04, 0x73, 0xf0, 0xc9, 0x79, 0xb3, 0x30, 0x3e, 0x6f, 0xa2, - 0x29, 0x46, 0x27, 0xaa, 0xf8, 0x3e, 0x2a, 0x25, 0x11, 0xb8, 0x8d, 0x25, 0xa5, 0xbe, 0x43, 0x16, - 0xda, 0x39, 0x99, 0x38, 0x6c, 0x47, 0xe0, 0x3a, 0x75, 0xdd, 0xa1, 0x24, 0x23, 0xaa, 0xf4, 0xac, - 0x77, 0x06, 0x5a, 0x9d, 0x54, 0xed, 0xf3, 0x44, 0xe0, 0xc7, 0x73, 0xb3, 0x90, 0xc5, 0x66, 0x91, - 0x6c, 0x35, 0xc9, 0x9a, 0xee, 0x53, 0xcd, 0x91, 0x99, 0x39, 0x8e, 0x50, 0x99, 0x0b, 0x18, 0x26, - 0x8d, 0xa5, 0x56, 0xf1, 0xd2, 0x9a, 0x16, 0x1a, 0xc4, 0x59, 0xd5, 0xe2, 0xe5, 0x5b, 0x52, 0x86, - 0x66, 0x6a, 0xd6, 0xdb, 0xd9, 0x31, 0xe4, 0x78, 0xf8, 0x08, 0x2d, 0x47, 0xe1, 0x80, 0xbb, 0xc7, - 0x7a, 0x88, 0xad, 0x05, 0x3b, 0x1d, 0x2a, 0x92, 0xf3, 0x83, 0x6e, 0xb3, 0x9c, 0xc5, 0x54, 0x8b, - 0xe1, 0x87, 0xa8, 0xf2, 0x02, 0x3a, 0x7e, 0x18, 0xf6, 0xf5, 0x29, 0xc8, 0x82, 0xba, 0x0f, 0x32, - 0x96, 0xf3, 0xa3, 0x16, 0xae, 0x68, 0x80, 0xe6, 0x7a, 0x96, 0x8b, 0x74, 0x33, 0xfc, 0x17, 0x2a, - 0x0f, 0x60, 0x04, 0x03, 0x65, 0xbd, 0xe6, 0xfc, 0x9a, 0x8f, 0xbc, 0x2f, 0xc1, 0xcf, 0xf9, 0x83, - 0x66, 0x45, 0xf8, 0x4f, 0xb4, 0x9c, 0x08, 0xe6, 0x41, 0xb6, 0xd3, 0x9a, 0xb3, 0x2e, 0x6d, 0xb7, - 0x15, 0x22, 0x6b, 0xd5, 0x8b, 0xea, 0x12, 0xeb, 0xb5, 0x81, 0xd6, 0xda, 0x10, 0x8f, 0xb8, 0x0b, - 0x14, 0x7a, 0x10, 0x43, 0xe0, 0x02, 0xb6, 0x51, 0x2d, 0x60, 0x43, 0x48, 0x22, 0xe6, 0x82, 0xee, - 0xf9, 0x93, 0xee, 0x59, 0x3b, 0xc8, 0x13, 0x74, 0x5a, 0x83, 0x5b, 0xa8, 0x24, 0x03, 0xb5, 0x82, - 0xda, 0xf4, 0x5f, 0xc9, 0x5a, 0xaa, 0x32, 0xf8, 0x77, 0x54, 0x8a, 0x98, 0xf0, 0x1b, 0x45, 0x55, - 0x51, 0x95, 0xd9, 0x43, 0x26, 0x7c, 0xaa, 0x50, 0x95, 0x0d, 0x63, 0xd1, 0x28, 0xb5, 0x8c, 0xcd, - 0xb2, 0xce, 0x86, 0xb1, 0xa0, 0x0a, 0xb5, 0x3e, 0x19, 0x28, 0xdf, 0x0e, 0xee, 0xa1, 0xaa, 0xf0, - 0xe3, 0x50, 0x88, 0x01, 0xe8, 0x43, 0xde, 0xbc, 0xde, 0xc2, 0xef, 0x69, 0xf6, 0x5e, 0x18, 0xf4, - 0xb8, 0xe7, 0xd4, 0xe5, 0xbf, 0xcc, 0x31, 0x3a, 0xd1, 0xc6, 0x02, 0xd5, 0xdd, 0x01, 0x87, 0x40, - 0x64, 0x75, 0xfa, 0xb8, 0x37, 0xae, 0xd7, 0x6b, 0x6f, 0x46, 0xc1, 0xf9, 0x59, 0x6f, 0xa5, 0x3e, - 0x8b, 0xd2, 0xaf, 0xba, 0x58, 0x6f, 0x0c, 0xb4, 0x7e, 0x05, 0x17, 0xff, 0x86, 0x8a, 0x69, 0x9c, - 0x9f, 0xbf, 0x32, 0x3e, 0x6f, 0x16, 0x8f, 0xe8, 0x3e, 0x95, 0x18, 0x7e, 0x82, 0x2a, 0x49, 0x76, - 0x3f, 0xed, 0xf1, 0xbf, 0x05, 0x3d, 0x5e, 0xbe, 0xba, 0xb3, 0x22, 0x7f, 0x61, 0x8e, 0xe6, 0xa2, - 0x78, 0x13, 0x55, 0x5d, 0xe6, 0xa4, 0x41, 0x77, 0x00, 0xea, 0x78, 0xf5, 0x6c, 0x65, 0x7b, 0xbb, - 0x19, 0x46, 0x27, 0x59, 0xab, 0x8d, 0x7e, 0xb9, 0x72, 0xc7, 0xd2, 0xfd, 0xf3, 0x28, 0x51, 0xee, - 0x8b, 0x99, 0xfb, 0xbb, 0x87, 0x6d, 0x2a, 0x31, 0xdc, 0x44, 0xe5, 0x4e, 0x1a, 0x27, 0x42, 0x79, - 0x2f, 0x3a, 0x35, 0xf9, 0xab, 0x1d, 0x09, 0xd0, 0x0c, 0x77, 0xc8, 0xc9, 0x85, 0x59, 0x38, 0xbd, - 0x30, 0x0b, 0x67, 0x17, 0x66, 0xe1, 0xe5, 0xd8, 0x34, 0x4e, 0xc6, 0xa6, 0x71, 0x3a, 0x36, 0x8d, - 0xb3, 0xb1, 0x69, 0x7c, 0x18, 0x9b, 0xc6, 0xab, 0x8f, 0x66, 0xe1, 0x51, 0x35, 0x9f, 0xea, 0x4b, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x6c, 0xff, 0x86, 0xcd, 0x06, 0x00, 0x00, -} - -func (m *AuditSink) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuditSink) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuditSink) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *AuditSinkList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuditSinkList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuditSinkList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *AuditSinkSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuditSinkSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuditSinkSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Policy) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Policy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Policy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Stages) > 0 { - for iNdEx := len(m.Stages) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Stages[iNdEx]) - copy(dAtA[i:], m.Stages[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Stages[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - i -= len(m.Level) - copy(dAtA[i:], m.Level) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Level))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ServiceReference) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ServiceReference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Port != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.Port)) - i-- - dAtA[i] = 0x20 - } - if m.Path != nil { - i -= len(*m.Path) - copy(dAtA[i:], *m.Path) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Path))) - i-- - dAtA[i] = 0x1a - } - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Webhook) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Webhook) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Webhook) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.ClientConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Throttle != nil { - { - size, err := m.Throttle.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WebhookClientConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WebhookClientConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WebhookClientConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CABundle != nil { - i -= len(m.CABundle) - copy(dAtA[i:], m.CABundle) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.CABundle))) - i-- - dAtA[i] = 0x1a - } - if m.Service != nil { - { - size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.URL != nil { - i -= len(*m.URL) - copy(dAtA[i:], *m.URL) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.URL))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WebhookThrottleConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WebhookThrottleConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WebhookThrottleConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Burst != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.Burst)) - i-- - dAtA[i] = 0x10 - } - if m.QPS != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.QPS)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - offset -= sovGenerated(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *AuditSink) Size() (n int) { - if m == nil { - return 0 - } - 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 *AuditSinkList) Size() (n int) { - if m == nil { - return 0 - } - 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 *AuditSinkSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Policy.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Webhook.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *Policy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Level) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Stages) > 0 { - for _, s := range m.Stages { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *ServiceReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Namespace) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - if m.Path != nil { - l = len(*m.Path) - n += 1 + l + sovGenerated(uint64(l)) - } - if m.Port != nil { - n += 1 + sovGenerated(uint64(*m.Port)) - } - return n -} - -func (m *Webhook) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Throttle != nil { - l = m.Throttle.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - l = m.ClientConfig.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *WebhookClientConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.URL != nil { - l = len(*m.URL) - n += 1 + l + sovGenerated(uint64(l)) - } - if m.Service != nil { - l = m.Service.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.CABundle != nil { - l = len(m.CABundle) - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *WebhookThrottleConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.QPS != nil { - n += 1 + sovGenerated(uint64(*m.QPS)) - } - if m.Burst != nil { - n += 1 + sovGenerated(uint64(*m.Burst)) - } - return n -} - -func sovGenerated(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *AuditSink) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AuditSink{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "AuditSinkSpec", "AuditSinkSpec", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *AuditSinkList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]AuditSink{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "AuditSink", "AuditSink", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&AuditSinkList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *AuditSinkSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AuditSinkSpec{`, - `Policy:` + strings.Replace(strings.Replace(this.Policy.String(), "Policy", "Policy", 1), `&`, ``, 1) + `,`, - `Webhook:` + strings.Replace(strings.Replace(this.Webhook.String(), "Webhook", "Webhook", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *Policy) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Policy{`, - `Level:` + fmt.Sprintf("%v", this.Level) + `,`, - `Stages:` + fmt.Sprintf("%v", this.Stages) + `,`, - `}`, - }, "") - return s -} -func (this *ServiceReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ServiceReference{`, - `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Path:` + valueToStringGenerated(this.Path) + `,`, - `Port:` + valueToStringGenerated(this.Port) + `,`, - `}`, - }, "") - return s -} -func (this *Webhook) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Webhook{`, - `Throttle:` + strings.Replace(this.Throttle.String(), "WebhookThrottleConfig", "WebhookThrottleConfig", 1) + `,`, - `ClientConfig:` + strings.Replace(strings.Replace(this.ClientConfig.String(), "WebhookClientConfig", "WebhookClientConfig", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *WebhookClientConfig) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&WebhookClientConfig{`, - `URL:` + valueToStringGenerated(this.URL) + `,`, - `Service:` + strings.Replace(this.Service.String(), "ServiceReference", "ServiceReference", 1) + `,`, - `CABundle:` + valueToStringGenerated(this.CABundle) + `,`, - `}`, - }, "") - return s -} -func (this *WebhookThrottleConfig) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&WebhookThrottleConfig{`, - `QPS:` + valueToStringGenerated(this.QPS) + `,`, - `Burst:` + valueToStringGenerated(this.Burst) + `,`, - `}`, - }, "") - 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 *AuditSink) 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: AuditSink: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuditSink: 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 < 0 { - return ErrInvalidLengthGenerated - } - 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 < 0 { - return ErrInvalidLengthGenerated - } - 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) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuditSinkList) 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: AuditSinkList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuditSinkList: 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 < 0 { - return ErrInvalidLengthGenerated - } - 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, AuditSink{}) - 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) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuditSinkSpec) 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: AuditSinkSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuditSinkSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Policy", 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Policy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Webhook", 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Webhook.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) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Policy) 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: Policy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Policy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Level", 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Level = Level(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stages", 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Stages = append(m.Stages, Stage(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) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ServiceReference) 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: ServiceReference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceReference: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Path = &s - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Port = &v - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Webhook) 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: Webhook: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Webhook: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Throttle", 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Throttle == nil { - m.Throttle = &WebhookThrottleConfig{} - } - if err := m.Throttle.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientConfig", 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ClientConfig.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) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WebhookClientConfig) 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: WebhookClientConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WebhookClientConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field URL", 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.URL = &s - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", 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 < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Service == nil { - m.Service = &ServiceReference{} - } - if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CABundle", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CABundle = append(m.CABundle[:0], dAtA[iNdEx:postIndex]...) - if m.CABundle == nil { - m.CABundle = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WebhookThrottleConfig) 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: WebhookThrottleConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WebhookThrottleConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field QPS", 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.QPS = &v - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Burst", 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.Burst = &v - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenerated(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenerated - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenerated - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") -) diff --git a/staging/src/k8s.io/api/auditregistration/v1alpha1/generated.proto b/staging/src/k8s.io/api/auditregistration/v1alpha1/generated.proto deleted file mode 100644 index 674debee4f2..00000000000 --- a/staging/src/k8s.io/api/auditregistration/v1alpha1/generated.proto +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright The 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 go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.auditregistration.v1alpha1; - -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"; - -// Package-wide variables from generator "generated". -option go_package = "v1alpha1"; - -// AuditSink represents a cluster level audit sink -message AuditSink { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the audit configuration spec - optional AuditSinkSpec spec = 2; -} - -// AuditSinkList is a list of AuditSink items. -message AuditSinkList { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of audit configurations. - repeated AuditSink items = 2; -} - -// AuditSinkSpec holds the spec for the audit sink -message AuditSinkSpec { - // Policy defines the policy for selecting which events should be sent to the webhook - // required - optional Policy policy = 1; - - // Webhook to send events - // required - optional Webhook webhook = 2; -} - -// Policy defines the configuration of how audit events are logged -message Policy { - // The Level that all requests are recorded at. - // available options: None, Metadata, Request, RequestResponse - // required - optional string level = 1; - - // Stages is a list of stages for which events are created. - // +optional - repeated string stages = 2; -} - -// ServiceReference holds a reference to Service.legacy.k8s.io -message ServiceReference { - // `namespace` is the namespace of the service. - // Required - optional string namespace = 1; - - // `name` is the name of the service. - // Required - optional string name = 2; - - // `path` is an optional URL path which will be sent in any request to - // this service. - // +optional - optional string path = 3; - - // If specified, the port on the service that hosting webhook. - // Default to 443 for backward compatibility. - // `port` should be a valid port number (1-65535, inclusive). - // +optional - optional int32 port = 4; -} - -// Webhook holds the configuration of the webhook -message Webhook { - // Throttle holds the options for throttling the webhook - // +optional - optional WebhookThrottleConfig throttle = 1; - - // ClientConfig holds the connection parameters for the webhook - // required - optional WebhookClientConfig clientConfig = 2; -} - -// WebhookClientConfig contains the information to make a connection with the webhook -message WebhookClientConfig { - // `url` gives the location of the webhook, in standard URL form - // (`scheme://host:port/path`). Exactly one of `url` or `service` - // must be specified. - // - // The `host` should not refer to a service running in the cluster; use - // the `service` field instead. The host might be resolved via external - // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve - // in-cluster DNS as that would be a layering violation). `host` may - // also be an IP address. - // - // Please note that using `localhost` or `127.0.0.1` as a `host` is - // risky unless you take great care to run this webhook on all hosts - // which run an apiserver which might need to make calls to this - // webhook. Such installs are likely to be non-portable, i.e., not easy - // to turn up in a new cluster. - // - // The scheme must be "https"; the URL must begin with "https://". - // - // A path is optional, and if present may be any string permissible in - // a URL. You may use the path to pass an arbitrary string to the - // webhook, for example, a cluster identifier. - // - // Attempting to use a user or basic auth e.g. "user:password@" is not - // allowed. Fragments ("#...") and query parameters ("?...") are not - // allowed, either. - // - // +optional - optional string url = 1; - - // `service` is a reference to the service for this webhook. Either - // `service` or `url` must be specified. - // - // If the webhook is running within the cluster, then you should use `service`. - // - // +optional - optional ServiceReference service = 2; - - // `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. - // If unspecified, system trust roots on the apiserver are used. - // +optional - optional bytes caBundle = 3; -} - -// WebhookThrottleConfig holds the configuration for throttling events -message WebhookThrottleConfig { - // ThrottleQPS maximum number of batches per second - // default 10 QPS - // +optional - optional int64 qps = 1; - - // ThrottleBurst is the maximum number of events sent at the same moment - // default 15 QPS - // +optional - optional int64 burst = 2; -} - diff --git a/staging/src/k8s.io/api/auditregistration/v1alpha1/register.go b/staging/src/k8s.io/api/auditregistration/v1alpha1/register.go deleted file mode 100644 index d6271608f00..00000000000 --- a/staging/src/k8s.io/api/auditregistration/v1alpha1/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2018 The 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 = "auditregistration.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, - &AuditSink{}, - &AuditSinkList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/staging/src/k8s.io/api/auditregistration/v1alpha1/types.go b/staging/src/k8s.io/api/auditregistration/v1alpha1/types.go deleted file mode 100644 index a0fb48c301b..00000000000 --- a/staging/src/k8s.io/api/auditregistration/v1alpha1/types.go +++ /dev/null @@ -1,198 +0,0 @@ -/* -Copyright 2018 The 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:openapi-gen=true - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Level defines the amount of information logged during auditing -type Level string - -// Valid audit levels -const ( - // LevelNone disables auditing - LevelNone Level = "None" - // LevelMetadata provides the basic level of auditing. - LevelMetadata Level = "Metadata" - // LevelRequest provides Metadata level of auditing, and additionally - // logs the request object (does not apply for non-resource requests). - LevelRequest Level = "Request" - // LevelRequestResponse provides Request level of auditing, and additionally - // logs the response object (does not apply for non-resource requests and watches). - LevelRequestResponse Level = "RequestResponse" -) - -// Stage defines the stages in request handling during which audit events may be generated. -type Stage string - -// Valid audit stages. -const ( - // The stage for events generated after the audit handler receives the request, but before it - // is delegated down the handler chain. - StageRequestReceived = "RequestReceived" - // The stage for events generated after the response headers are sent, but before the response body - // is sent. This stage is only generated for long-running requests (e.g. watch). - StageResponseStarted = "ResponseStarted" - // The stage for events generated after the response body has been completed, and no more bytes - // will be sent. - StageResponseComplete = "ResponseComplete" - // The stage for events generated when a panic occurred. - StagePanic = "Panic" -) - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AuditSink represents a cluster level audit sink -type AuditSink struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Spec defines the audit configuration spec - Spec AuditSinkSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -// AuditSinkSpec holds the spec for the audit sink -type AuditSinkSpec struct { - // Policy defines the policy for selecting which events should be sent to the webhook - // required - Policy Policy `json:"policy" protobuf:"bytes,1,opt,name=policy"` - - // Webhook to send events - // required - Webhook Webhook `json:"webhook" protobuf:"bytes,2,opt,name=webhook"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AuditSinkList is a list of AuditSink items. -type AuditSinkList struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // List of audit configurations. - Items []AuditSink `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// Policy defines the configuration of how audit events are logged -type Policy struct { - // The Level that all requests are recorded at. - // available options: None, Metadata, Request, RequestResponse - // required - Level Level `json:"level" protobuf:"bytes,1,opt,name=level"` - - // Stages is a list of stages for which events are created. - // +optional - Stages []Stage `json:"stages" protobuf:"bytes,2,opt,name=stages"` -} - -// Webhook holds the configuration of the webhook -type Webhook struct { - // Throttle holds the options for throttling the webhook - // +optional - Throttle *WebhookThrottleConfig `json:"throttle,omitempty" protobuf:"bytes,1,opt,name=throttle"` - - // ClientConfig holds the connection parameters for the webhook - // required - ClientConfig WebhookClientConfig `json:"clientConfig" protobuf:"bytes,2,opt,name=clientConfig"` -} - -// WebhookThrottleConfig holds the configuration for throttling events -type WebhookThrottleConfig struct { - // ThrottleQPS maximum number of batches per second - // default 10 QPS - // +optional - QPS *int64 `json:"qps,omitempty" protobuf:"bytes,1,opt,name=qps"` - - // ThrottleBurst is the maximum number of events sent at the same moment - // default 15 QPS - // +optional - Burst *int64 `json:"burst,omitempty" protobuf:"bytes,2,opt,name=burst"` -} - -// WebhookClientConfig contains the information to make a connection with the webhook -type WebhookClientConfig struct { - // `url` gives the location of the webhook, in standard URL form - // (`scheme://host:port/path`). Exactly one of `url` or `service` - // must be specified. - // - // The `host` should not refer to a service running in the cluster; use - // the `service` field instead. The host might be resolved via external - // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve - // in-cluster DNS as that would be a layering violation). `host` may - // also be an IP address. - // - // Please note that using `localhost` or `127.0.0.1` as a `host` is - // risky unless you take great care to run this webhook on all hosts - // which run an apiserver which might need to make calls to this - // webhook. Such installs are likely to be non-portable, i.e., not easy - // to turn up in a new cluster. - // - // The scheme must be "https"; the URL must begin with "https://". - // - // A path is optional, and if present may be any string permissible in - // a URL. You may use the path to pass an arbitrary string to the - // webhook, for example, a cluster identifier. - // - // Attempting to use a user or basic auth e.g. "user:password@" is not - // allowed. Fragments ("#...") and query parameters ("?...") are not - // allowed, either. - // - // +optional - URL *string `json:"url,omitempty" protobuf:"bytes,1,opt,name=url"` - - // `service` is a reference to the service for this webhook. Either - // `service` or `url` must be specified. - // - // If the webhook is running within the cluster, then you should use `service`. - // - // +optional - Service *ServiceReference `json:"service,omitempty" protobuf:"bytes,2,opt,name=service"` - - // `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. - // If unspecified, system trust roots on the apiserver are used. - // +optional - CABundle []byte `json:"caBundle,omitempty" protobuf:"bytes,3,opt,name=caBundle"` -} - -// ServiceReference holds a reference to Service.legacy.k8s.io -type ServiceReference struct { - // `namespace` is the namespace of the service. - // Required - Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"` - - // `name` is the name of the service. - // Required - Name string `json:"name" protobuf:"bytes,2,opt,name=name"` - - // `path` is an optional URL path which will be sent in any request to - // this service. - // +optional - Path *string `json:"path,omitempty" protobuf:"bytes,3,opt,name=path"` - - // If specified, the port on the service that hosting webhook. - // Default to 443 for backward compatibility. - // `port` should be a valid port number (1-65535, inclusive). - // +optional - Port *int32 `json:"port,omitempty" protobuf:"varint,4,opt,name=port"` -} diff --git a/staging/src/k8s.io/api/auditregistration/v1alpha1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/auditregistration/v1alpha1/types_swagger_doc_generated.go deleted file mode 100644 index 1a86f4da5a7..00000000000 --- a/staging/src/k8s.io/api/auditregistration/v1alpha1/types_swagger_doc_generated.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -Copyright The 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 - -// This file contains a collection of methods that can be used from go-restful to -// generate Swagger API documentation for its models. Please read this PR for more -// information on the implementation: https://github.com/emicklei/go-restful/pull/215 -// -// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if -// they are on one line! For multiple line or blocks that you want to ignore use ---. -// Any context after a --- is ignored. -// -// Those methods can be generated by using hack/update-generated-swagger-docs.sh - -// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. -var map_AuditSink = map[string]string{ - "": "AuditSink represents a cluster level audit sink", - "spec": "Spec defines the audit configuration spec", -} - -func (AuditSink) SwaggerDoc() map[string]string { - return map_AuditSink -} - -var map_AuditSinkList = map[string]string{ - "": "AuditSinkList is a list of AuditSink items.", - "items": "List of audit configurations.", -} - -func (AuditSinkList) SwaggerDoc() map[string]string { - return map_AuditSinkList -} - -var map_AuditSinkSpec = map[string]string{ - "": "AuditSinkSpec holds the spec for the audit sink", - "policy": "Policy defines the policy for selecting which events should be sent to the webhook required", - "webhook": "Webhook to send events required", -} - -func (AuditSinkSpec) SwaggerDoc() map[string]string { - return map_AuditSinkSpec -} - -var map_Policy = map[string]string{ - "": "Policy defines the configuration of how audit events are logged", - "level": "The Level that all requests are recorded at. available options: None, Metadata, Request, RequestResponse required", - "stages": "Stages is a list of stages for which events are created.", -} - -func (Policy) SwaggerDoc() map[string]string { - return map_Policy -} - -var map_ServiceReference = map[string]string{ - "": "ServiceReference holds a reference to Service.legacy.k8s.io", - "namespace": "`namespace` is the namespace of the service. Required", - "name": "`name` is the name of the service. Required", - "path": "`path` is an optional URL path which will be sent in any request to this service.", - "port": "If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive).", -} - -func (ServiceReference) SwaggerDoc() map[string]string { - return map_ServiceReference -} - -var map_Webhook = map[string]string{ - "": "Webhook holds the configuration of the webhook", - "throttle": "Throttle holds the options for throttling the webhook", - "clientConfig": "ClientConfig holds the connection parameters for the webhook required", -} - -func (Webhook) SwaggerDoc() map[string]string { - return map_Webhook -} - -var map_WebhookClientConfig = map[string]string{ - "": "WebhookClientConfig contains the information to make a connection with the webhook", - "url": "`url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified.\n\nThe `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address.\n\nPlease note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster.\n\nThe scheme must be \"https\"; the URL must begin with \"https://\".\n\nA path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier.\n\nAttempting to use a user or basic auth e.g. \"user:password@\" is not allowed. Fragments (\"#...\") and query parameters (\"?...\") are not allowed, either.", - "service": "`service` is a reference to the service for this webhook. Either `service` or `url` must be specified.\n\nIf the webhook is running within the cluster, then you should use `service`.", - "caBundle": "`caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used.", -} - -func (WebhookClientConfig) SwaggerDoc() map[string]string { - return map_WebhookClientConfig -} - -var map_WebhookThrottleConfig = map[string]string{ - "": "WebhookThrottleConfig holds the configuration for throttling events", - "qps": "ThrottleQPS maximum number of batches per second default 10 QPS", - "burst": "ThrottleBurst is the maximum number of events sent at the same moment default 15 QPS", -} - -func (WebhookThrottleConfig) SwaggerDoc() map[string]string { - return map_WebhookThrottleConfig -} - -// AUTO-GENERATED FUNCTIONS END HERE diff --git a/staging/src/k8s.io/api/auditregistration/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/auditregistration/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 621a19e8312..00000000000 --- a/staging/src/k8s.io/api/auditregistration/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,229 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright The 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 *AuditSink) DeepCopyInto(out *AuditSink) { - *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 AuditSink. -func (in *AuditSink) DeepCopy() *AuditSink { - if in == nil { - return nil - } - out := new(AuditSink) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AuditSink) 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 *AuditSinkList) DeepCopyInto(out *AuditSinkList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AuditSink, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuditSinkList. -func (in *AuditSinkList) DeepCopy() *AuditSinkList { - if in == nil { - return nil - } - out := new(AuditSinkList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AuditSinkList) 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 *AuditSinkSpec) DeepCopyInto(out *AuditSinkSpec) { - *out = *in - in.Policy.DeepCopyInto(&out.Policy) - in.Webhook.DeepCopyInto(&out.Webhook) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuditSinkSpec. -func (in *AuditSinkSpec) DeepCopy() *AuditSinkSpec { - if in == nil { - return nil - } - out := new(AuditSinkSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Policy) DeepCopyInto(out *Policy) { - *out = *in - if in.Stages != nil { - in, out := &in.Stages, &out.Stages - *out = make([]Stage, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy. -func (in *Policy) DeepCopy() *Policy { - if in == nil { - return nil - } - out := new(Policy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceReference) DeepCopyInto(out *ServiceReference) { - *out = *in - if in.Path != nil { - in, out := &in.Path, &out.Path - *out = new(string) - **out = **in - } - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReference. -func (in *ServiceReference) DeepCopy() *ServiceReference { - if in == nil { - return nil - } - out := new(ServiceReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Webhook) DeepCopyInto(out *Webhook) { - *out = *in - if in.Throttle != nil { - in, out := &in.Throttle, &out.Throttle - *out = new(WebhookThrottleConfig) - (*in).DeepCopyInto(*out) - } - in.ClientConfig.DeepCopyInto(&out.ClientConfig) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Webhook. -func (in *Webhook) DeepCopy() *Webhook { - if in == nil { - return nil - } - out := new(Webhook) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WebhookClientConfig) DeepCopyInto(out *WebhookClientConfig) { - *out = *in - if in.URL != nil { - in, out := &in.URL, &out.URL - *out = new(string) - **out = **in - } - if in.Service != nil { - in, out := &in.Service, &out.Service - *out = new(ServiceReference) - (*in).DeepCopyInto(*out) - } - if in.CABundle != nil { - in, out := &in.CABundle, &out.CABundle - *out = make([]byte, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookClientConfig. -func (in *WebhookClientConfig) DeepCopy() *WebhookClientConfig { - if in == nil { - return nil - } - out := new(WebhookClientConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WebhookThrottleConfig) DeepCopyInto(out *WebhookThrottleConfig) { - *out = *in - if in.QPS != nil { - in, out := &in.QPS, &out.QPS - *out = new(int64) - **out = **in - } - if in.Burst != nil { - in, out := &in.Burst, &out.Burst - *out = new(int64) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookThrottleConfig. -func (in *WebhookThrottleConfig) DeepCopy() *WebhookThrottleConfig { - if in == nil { - return nil - } - out := new(WebhookThrottleConfig) - in.DeepCopyInto(out) - return out -} diff --git a/staging/src/k8s.io/apiserver/pkg/audit/BUILD b/staging/src/k8s.io/apiserver/pkg/audit/BUILD index db2a715d4c9..7f64aee1d92 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/audit/BUILD @@ -71,7 +71,6 @@ filegroup( ":package-srcs", "//staging/src/k8s.io/apiserver/pkg/audit/event:all-srcs", "//staging/src/k8s.io/apiserver/pkg/audit/policy:all-srcs", - "//staging/src/k8s.io/apiserver/pkg/audit/util:all-srcs", ], tags = ["automanaged"], ) diff --git a/staging/src/k8s.io/apiserver/pkg/audit/policy/BUILD b/staging/src/k8s.io/apiserver/pkg/audit/policy/BUILD index 865fb9dc667..f845fddf995 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/policy/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/audit/policy/BUILD @@ -10,14 +10,12 @@ go_test( name = "go_default_test", srcs = [ "checker_test.go", - "dynamic_test.go", "enforce_test.go", "reader_test.go", "util_test.go", ], embed = [":go_default_library"], deps = [ - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/apitesting/fuzzer:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", @@ -37,7 +35,6 @@ go_library( name = "go_default_library", srcs = [ "checker.go", - "dynamic.go", "enforce.go", "reader.go", "util.go", @@ -45,7 +42,6 @@ go_library( importmap = "k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/audit/policy", importpath = "k8s.io/apiserver/pkg/audit/policy", deps = [ - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//staging/src/k8s.io/apiserver/pkg/apis/audit:go_default_library", diff --git a/staging/src/k8s.io/apiserver/pkg/audit/policy/dynamic.go b/staging/src/k8s.io/apiserver/pkg/audit/policy/dynamic.go deleted file mode 100644 index 4b5f29a1132..00000000000 --- a/staging/src/k8s.io/apiserver/pkg/audit/policy/dynamic.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2018 The 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 policy - -import ( - "k8s.io/api/auditregistration/v1alpha1" - "k8s.io/apiserver/pkg/apis/audit" - "k8s.io/apiserver/pkg/authorization/authorizer" -) - -// ConvertDynamicPolicyToInternal constructs an internal policy type from a -// v1alpha1 dynamic type -func ConvertDynamicPolicyToInternal(p *v1alpha1.Policy) *audit.Policy { - stages := make([]audit.Stage, len(p.Stages)) - for i, stage := range p.Stages { - stages[i] = audit.Stage(stage) - } - return &audit.Policy{ - Rules: []audit.PolicyRule{ - { - Level: audit.Level(p.Level), - }, - }, - OmitStages: InvertStages(stages), - } -} - -// NewDynamicChecker returns a new dynamic policy checker -func NewDynamicChecker() Checker { - return &dynamicPolicyChecker{} -} - -type dynamicPolicyChecker struct{} - -// LevelAndStages returns returns a fixed level of the full event, this is so that the downstream policy -// can be applied per sink. -// TODO: this needs benchmarking before the API moves to beta to determine the effect this has on the apiserver -func (d *dynamicPolicyChecker) LevelAndStages(authorizer.Attributes) (audit.Level, []audit.Stage) { - return audit.LevelRequestResponse, []audit.Stage{} -} diff --git a/staging/src/k8s.io/apiserver/pkg/audit/policy/dynamic_test.go b/staging/src/k8s.io/apiserver/pkg/audit/policy/dynamic_test.go deleted file mode 100644 index 3697160014d..00000000000 --- a/staging/src/k8s.io/apiserver/pkg/audit/policy/dynamic_test.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright 2018 The 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 policy - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "k8s.io/api/auditregistration/v1alpha1" - "k8s.io/apiserver/pkg/apis/audit" -) - -func TestConvertDynamicPolicyToInternal(t *testing.T) { - for _, test := range []struct { - desc string - dynamic *v1alpha1.Policy - internal *audit.Policy - }{ - { - desc: "should convert full", - dynamic: &v1alpha1.Policy{ - Level: v1alpha1.LevelMetadata, - Stages: []v1alpha1.Stage{ - v1alpha1.StageResponseComplete, - }, - }, - internal: &audit.Policy{ - Rules: []audit.PolicyRule{ - { - Level: audit.LevelMetadata, - }, - }, - OmitStages: []audit.Stage{ - audit.StageRequestReceived, - audit.StageResponseStarted, - audit.StagePanic, - }, - }, - }, - { - desc: "should convert missing stages", - dynamic: &v1alpha1.Policy{ - Level: v1alpha1.LevelMetadata, - }, - internal: &audit.Policy{ - Rules: []audit.PolicyRule{ - { - Level: audit.LevelMetadata, - }, - }, - OmitStages: []audit.Stage{ - audit.StageRequestReceived, - audit.StageResponseStarted, - audit.StageResponseComplete, - audit.StagePanic, - }, - }, - }, - } { - t.Run(test.desc, func(t *testing.T) { - d := ConvertDynamicPolicyToInternal(test.dynamic) - require.ElementsMatch(t, test.internal.OmitStages, d.OmitStages) - require.Equal(t, test.internal.Rules, d.Rules) - }) - } -} diff --git a/staging/src/k8s.io/apiserver/pkg/audit/util/BUILD b/staging/src/k8s.io/apiserver/pkg/audit/util/BUILD deleted file mode 100644 index a871d3d9217..00000000000 --- a/staging/src/k8s.io/apiserver/pkg/audit/util/BUILD +++ /dev/null @@ -1,40 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["conversion.go"], - importmap = "k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/audit/util", - importpath = "k8s.io/apiserver/pkg/audit/util", - visibility = ["//visibility:public"], - deps = [ - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/webhook: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"], -) - -go_test( - name = "go_default_test", - srcs = ["conversion_test.go"], - embed = [":go_default_library"], - deps = [ - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/webhook:go_default_library", - "//vendor/github.com/stretchr/testify/require:go_default_library", - "//vendor/k8s.io/utils/pointer:go_default_library", - ], -) diff --git a/staging/src/k8s.io/apiserver/pkg/audit/util/conversion.go b/staging/src/k8s.io/apiserver/pkg/audit/util/conversion.go deleted file mode 100644 index 9e2930bd365..00000000000 --- a/staging/src/k8s.io/apiserver/pkg/audit/util/conversion.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2018 The 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 ( - "k8s.io/api/auditregistration/v1alpha1" - "k8s.io/apiserver/pkg/util/webhook" -) - -// HookClientConfigForSink constructs a webhook.ClientConfig using a v1alpha1.AuditSink API object. -// webhook.ClientConfig is used to create a HookClient and the purpose of the config struct is to -// share that with other packages that need to create a HookClient. -func HookClientConfigForSink(a *v1alpha1.AuditSink) webhook.ClientConfig { - c := a.Spec.Webhook.ClientConfig - ret := webhook.ClientConfig{Name: a.Name, CABundle: c.CABundle} - if c.URL != nil { - ret.URL = *c.URL - } - if c.Service != nil { - ret.Service = &webhook.ClientConfigService{ - Name: c.Service.Name, - Namespace: c.Service.Namespace, - } - if c.Service.Port != nil { - ret.Service.Port = *c.Service.Port - } else { - ret.Service.Port = 443 - } - - if c.Service.Path != nil { - ret.Service.Path = *c.Service.Path - } - } - return ret -} diff --git a/staging/src/k8s.io/apiserver/pkg/audit/util/conversion_test.go b/staging/src/k8s.io/apiserver/pkg/audit/util/conversion_test.go deleted file mode 100644 index c8f0c66da14..00000000000 --- a/staging/src/k8s.io/apiserver/pkg/audit/util/conversion_test.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2018 The 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 ( - "testing" - - "github.com/stretchr/testify/require" - - auditregv1alpha1 "k8s.io/api/auditregistration/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apiserver/pkg/util/webhook" - "k8s.io/utils/pointer" -) - -func TestHookClientConfigForSink(t *testing.T) { - testURL := "http://localhost" - path := "/path" - for _, tc := range []struct { - desc string - sink *auditregv1alpha1.AuditSink - clientConfig webhook.ClientConfig - }{ - { - desc: "build full", - sink: &auditregv1alpha1.AuditSink{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: auditregv1alpha1.AuditSinkSpec{ - Webhook: auditregv1alpha1.Webhook{ - ClientConfig: auditregv1alpha1.WebhookClientConfig{ - URL: &testURL, - Service: &auditregv1alpha1.ServiceReference{ - Name: "test", - Path: &path, - Namespace: "test", - Port: pointer.Int32Ptr(123), - }, - }, - }, - }, - }, - clientConfig: webhook.ClientConfig{ - Name: "test", - URL: testURL, - Service: &webhook.ClientConfigService{ - Name: "test", - Namespace: "test", - Path: path, - Port: 123, - }, - }, - }, - { - desc: "build empty client config", - sink: &auditregv1alpha1.AuditSink{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: auditregv1alpha1.AuditSinkSpec{ - Webhook: auditregv1alpha1.Webhook{ - ClientConfig: auditregv1alpha1.WebhookClientConfig{}, - }, - }, - }, - clientConfig: webhook.ClientConfig{ - Name: "test", - }, - }, - } { - t.Run(tc.desc, func(t *testing.T) { - ret := HookClientConfigForSink(tc.sink) - require.Equal(t, tc.clientConfig, ret) - }) - } -} diff --git a/staging/src/k8s.io/client-go/BUILD b/staging/src/k8s.io/client-go/BUILD index 8fade6710dd..f4d020b35d9 100644 --- a/staging/src/k8s.io/client-go/BUILD +++ b/staging/src/k8s.io/client-go/BUILD @@ -27,7 +27,6 @@ filegroup( "//staging/src/k8s.io/client-go/listers/apps/v1:all-srcs", "//staging/src/k8s.io/client-go/listers/apps/v1beta1:all-srcs", "//staging/src/k8s.io/client-go/listers/apps/v1beta2:all-srcs", - "//staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1:all-srcs", "//staging/src/k8s.io/client-go/listers/authentication/v1:all-srcs", "//staging/src/k8s.io/client-go/listers/authentication/v1beta1:all-srcs", "//staging/src/k8s.io/client-go/listers/authorization/v1:all-srcs", diff --git a/staging/src/k8s.io/client-go/deprecated/BUILD b/staging/src/k8s.io/client-go/deprecated/BUILD index 4badc4e9d58..3ff64c711b7 100644 --- a/staging/src/k8s.io/client-go/deprecated/BUILD +++ b/staging/src/k8s.io/client-go/deprecated/BUILD @@ -16,7 +16,6 @@ go_library( "//staging/src/k8s.io/client-go/deprecated/typed/apps/v1:go_default_library", "//staging/src/k8s.io/client-go/deprecated/typed/apps/v1beta1:go_default_library", "//staging/src/k8s.io/client-go/deprecated/typed/apps/v1beta2:go_default_library", - "//staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/client-go/deprecated/typed/authentication/v1:go_default_library", "//staging/src/k8s.io/client-go/deprecated/typed/authentication/v1beta1:go_default_library", "//staging/src/k8s.io/client-go/deprecated/typed/authorization/v1:go_default_library", @@ -75,7 +74,6 @@ filegroup( "//staging/src/k8s.io/client-go/deprecated/typed/apps/v1:all-srcs", "//staging/src/k8s.io/client-go/deprecated/typed/apps/v1beta1:all-srcs", "//staging/src/k8s.io/client-go/deprecated/typed/apps/v1beta2:all-srcs", - "//staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1:all-srcs", "//staging/src/k8s.io/client-go/deprecated/typed/authentication/v1:all-srcs", "//staging/src/k8s.io/client-go/deprecated/typed/authentication/v1beta1:all-srcs", "//staging/src/k8s.io/client-go/deprecated/typed/authorization/v1:all-srcs", diff --git a/staging/src/k8s.io/client-go/deprecated/clientset.go b/staging/src/k8s.io/client-go/deprecated/clientset.go index decc11f3b13..bdc6633b6f5 100644 --- a/staging/src/k8s.io/client-go/deprecated/clientset.go +++ b/staging/src/k8s.io/client-go/deprecated/clientset.go @@ -26,7 +26,6 @@ import ( appsv1 "k8s.io/client-go/deprecated/typed/apps/v1" appsv1beta1 "k8s.io/client-go/deprecated/typed/apps/v1beta1" appsv1beta2 "k8s.io/client-go/deprecated/typed/apps/v1beta2" - auditregistrationv1alpha1 "k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1" authenticationv1 "k8s.io/client-go/deprecated/typed/authentication/v1" authenticationv1beta1 "k8s.io/client-go/deprecated/typed/authentication/v1beta1" authorizationv1 "k8s.io/client-go/deprecated/typed/authorization/v1" @@ -73,7 +72,6 @@ type Interface interface { AppsV1() appsv1.AppsV1Interface AppsV1beta1() appsv1beta1.AppsV1beta1Interface AppsV1beta2() appsv1beta2.AppsV1beta2Interface - AuditregistrationV1alpha1() auditregistrationv1alpha1.AuditregistrationV1alpha1Interface AuthenticationV1() authenticationv1.AuthenticationV1Interface AuthenticationV1beta1() authenticationv1beta1.AuthenticationV1beta1Interface AuthorizationV1() authorizationv1.AuthorizationV1Interface @@ -119,7 +117,6 @@ type Clientset struct { appsV1 *appsv1.AppsV1Client appsV1beta1 *appsv1beta1.AppsV1beta1Client appsV1beta2 *appsv1beta2.AppsV1beta2Client - auditregistrationV1alpha1 *auditregistrationv1alpha1.AuditregistrationV1alpha1Client authenticationV1 *authenticationv1.AuthenticationV1Client authenticationV1beta1 *authenticationv1beta1.AuthenticationV1beta1Client authorizationV1 *authorizationv1.AuthorizationV1Client @@ -181,11 +178,6 @@ func (c *Clientset) AppsV1beta2() appsv1beta2.AppsV1beta2Interface { return c.appsV1beta2 } -// AuditregistrationV1alpha1 retrieves the AuditregistrationV1alpha1Client -func (c *Clientset) AuditregistrationV1alpha1() auditregistrationv1alpha1.AuditregistrationV1alpha1Interface { - return c.auditregistrationV1alpha1 -} - // AuthenticationV1 retrieves the AuthenticationV1Client func (c *Clientset) AuthenticationV1() authenticationv1.AuthenticationV1Interface { return c.authenticationV1 @@ -397,10 +389,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } - cs.auditregistrationV1alpha1, err = auditregistrationv1alpha1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } cs.authenticationV1, err = authenticationv1.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -554,7 +542,6 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { cs.appsV1 = appsv1.NewForConfigOrDie(c) cs.appsV1beta1 = appsv1beta1.NewForConfigOrDie(c) cs.appsV1beta2 = appsv1beta2.NewForConfigOrDie(c) - cs.auditregistrationV1alpha1 = auditregistrationv1alpha1.NewForConfigOrDie(c) cs.authenticationV1 = authenticationv1.NewForConfigOrDie(c) cs.authenticationV1beta1 = authenticationv1beta1.NewForConfigOrDie(c) cs.authorizationV1 = authorizationv1.NewForConfigOrDie(c) @@ -602,7 +589,6 @@ func New(c rest.Interface) *Clientset { cs.appsV1 = appsv1.New(c) cs.appsV1beta1 = appsv1beta1.New(c) cs.appsV1beta2 = appsv1beta2.New(c) - cs.auditregistrationV1alpha1 = auditregistrationv1alpha1.New(c) cs.authenticationV1 = authenticationv1.New(c) cs.authenticationV1beta1 = authenticationv1beta1.New(c) cs.authorizationV1 = authorizationv1.New(c) diff --git a/staging/src/k8s.io/client-go/deprecated/fake/BUILD b/staging/src/k8s.io/client-go/deprecated/fake/BUILD index 6e789831429..f8668b088db 100644 --- a/staging/src/k8s.io/client-go/deprecated/fake/BUILD +++ b/staging/src/k8s.io/client-go/deprecated/fake/BUILD @@ -16,7 +16,6 @@ go_library( "//staging/src/k8s.io/api/apps/v1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta2:go_default_library", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/api/authentication/v1:go_default_library", "//staging/src/k8s.io/api/authentication/v1beta1:go_default_library", "//staging/src/k8s.io/api/authorization/v1:go_default_library", @@ -68,8 +67,6 @@ go_library( "//staging/src/k8s.io/client-go/deprecated/typed/apps/v1beta1/fake:go_default_library", "//staging/src/k8s.io/client-go/deprecated/typed/apps/v1beta2:go_default_library", "//staging/src/k8s.io/client-go/deprecated/typed/apps/v1beta2/fake:go_default_library", - "//staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake:go_default_library", "//staging/src/k8s.io/client-go/deprecated/typed/authentication/v1:go_default_library", "//staging/src/k8s.io/client-go/deprecated/typed/authentication/v1/fake:go_default_library", "//staging/src/k8s.io/client-go/deprecated/typed/authentication/v1beta1:go_default_library", diff --git a/staging/src/k8s.io/client-go/deprecated/fake/clientset_generated.go b/staging/src/k8s.io/client-go/deprecated/fake/clientset_generated.go index 3d0c3a990eb..eced5113202 100644 --- a/staging/src/k8s.io/client-go/deprecated/fake/clientset_generated.go +++ b/staging/src/k8s.io/client-go/deprecated/fake/clientset_generated.go @@ -32,8 +32,6 @@ import ( fakeappsv1beta1 "k8s.io/client-go/deprecated/typed/apps/v1beta1/fake" appsv1beta2 "k8s.io/client-go/deprecated/typed/apps/v1beta2" fakeappsv1beta2 "k8s.io/client-go/deprecated/typed/apps/v1beta2/fake" - auditregistrationv1alpha1 "k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1" - fakeauditregistrationv1alpha1 "k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake" authenticationv1 "k8s.io/client-go/deprecated/typed/authentication/v1" fakeauthenticationv1 "k8s.io/client-go/deprecated/typed/authentication/v1/fake" authenticationv1beta1 "k8s.io/client-go/deprecated/typed/authentication/v1beta1" @@ -179,11 +177,6 @@ func (c *Clientset) AppsV1beta2() appsv1beta2.AppsV1beta2Interface { return &fakeappsv1beta2.FakeAppsV1beta2{Fake: &c.Fake} } -// AuditregistrationV1alpha1 retrieves the AuditregistrationV1alpha1Client -func (c *Clientset) AuditregistrationV1alpha1() auditregistrationv1alpha1.AuditregistrationV1alpha1Interface { - return &fakeauditregistrationv1alpha1.FakeAuditregistrationV1alpha1{Fake: &c.Fake} -} - // AuthenticationV1 retrieves the AuthenticationV1Client func (c *Clientset) AuthenticationV1() authenticationv1.AuthenticationV1Interface { return &fakeauthenticationv1.FakeAuthenticationV1{Fake: &c.Fake} diff --git a/staging/src/k8s.io/client-go/deprecated/fake/register.go b/staging/src/k8s.io/client-go/deprecated/fake/register.go index f957271689b..843f504ce18 100644 --- a/staging/src/k8s.io/client-go/deprecated/fake/register.go +++ b/staging/src/k8s.io/client-go/deprecated/fake/register.go @@ -24,7 +24,6 @@ import ( appsv1 "k8s.io/api/apps/v1" appsv1beta1 "k8s.io/api/apps/v1beta1" appsv1beta2 "k8s.io/api/apps/v1beta2" - auditregistrationv1alpha1 "k8s.io/api/auditregistration/v1alpha1" authenticationv1 "k8s.io/api/authentication/v1" authenticationv1beta1 "k8s.io/api/authentication/v1beta1" authorizationv1 "k8s.io/api/authorization/v1" @@ -75,7 +74,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ appsv1.AddToScheme, appsv1beta1.AddToScheme, appsv1beta2.AddToScheme, - auditregistrationv1alpha1.AddToScheme, authenticationv1.AddToScheme, authenticationv1beta1.AddToScheme, authorizationv1.AddToScheme, diff --git a/staging/src/k8s.io/client-go/deprecated/scheme/BUILD b/staging/src/k8s.io/client-go/deprecated/scheme/BUILD index 72e99538b59..99e3d097eb6 100644 --- a/staging/src/k8s.io/client-go/deprecated/scheme/BUILD +++ b/staging/src/k8s.io/client-go/deprecated/scheme/BUILD @@ -15,7 +15,6 @@ go_library( "//staging/src/k8s.io/api/apps/v1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta2:go_default_library", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/api/authentication/v1:go_default_library", "//staging/src/k8s.io/api/authentication/v1beta1:go_default_library", "//staging/src/k8s.io/api/authorization/v1:go_default_library", diff --git a/staging/src/k8s.io/client-go/deprecated/scheme/register.go b/staging/src/k8s.io/client-go/deprecated/scheme/register.go index b7213617124..7c495986695 100644 --- a/staging/src/k8s.io/client-go/deprecated/scheme/register.go +++ b/staging/src/k8s.io/client-go/deprecated/scheme/register.go @@ -24,7 +24,6 @@ import ( appsv1 "k8s.io/api/apps/v1" appsv1beta1 "k8s.io/api/apps/v1beta1" appsv1beta2 "k8s.io/api/apps/v1beta2" - auditregistrationv1alpha1 "k8s.io/api/auditregistration/v1alpha1" authenticationv1 "k8s.io/api/authentication/v1" authenticationv1beta1 "k8s.io/api/authentication/v1beta1" authorizationv1 "k8s.io/api/authorization/v1" @@ -75,7 +74,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ appsv1.AddToScheme, appsv1beta1.AddToScheme, appsv1beta2.AddToScheme, - auditregistrationv1alpha1.AddToScheme, authenticationv1.AddToScheme, authenticationv1beta1.AddToScheme, authorizationv1.AddToScheme, diff --git a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/BUILD b/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/BUILD deleted file mode 100644 index 7de19f4ab69..00000000000 --- a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/BUILD +++ /dev/null @@ -1,39 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "auditregistration_client.go", - "auditsink.go", - "doc.go", - "generated_expansion.go", - ], - importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1", - importpath = "k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1", - visibility = ["//staging/src/k8s.io/client-go/deprecated:__subpackages__"], - deps = [ - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", - "//staging/src/k8s.io/client-go/deprecated/scheme:go_default_library", - "//staging/src/k8s.io/client-go/rest: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/deprecated/typed/auditregistration/v1alpha1/fake:all-srcs", - ], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/auditregistration_client.go b/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/auditregistration_client.go deleted file mode 100644 index 158526b4422..00000000000 --- a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/auditregistration_client.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The 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 v1alpha1 - -import ( - v1alpha1 "k8s.io/api/auditregistration/v1alpha1" - "k8s.io/client-go/deprecated/scheme" - rest "k8s.io/client-go/rest" -) - -type AuditregistrationV1alpha1Interface interface { - RESTClient() rest.Interface - AuditSinksGetter -} - -// AuditregistrationV1alpha1Client is used to interact with features provided by the auditregistration.k8s.io group. -type AuditregistrationV1alpha1Client struct { - restClient rest.Interface -} - -func (c *AuditregistrationV1alpha1Client) AuditSinks() AuditSinkInterface { - return newAuditSinks(c) -} - -// NewForConfig creates a new AuditregistrationV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*AuditregistrationV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &AuditregistrationV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new AuditregistrationV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *AuditregistrationV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new AuditregistrationV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *AuditregistrationV1alpha1Client { - return &AuditregistrationV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *AuditregistrationV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/auditsink.go b/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/auditsink.go deleted file mode 100644 index 6c07a08616f..00000000000 --- a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/auditsink.go +++ /dev/null @@ -1,165 +0,0 @@ -/* -Copyright The 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 v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "k8s.io/api/auditregistration/v1alpha1" - 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/deprecated/scheme" - rest "k8s.io/client-go/rest" -) - -// AuditSinksGetter has a method to return a AuditSinkInterface. -// A group's client should implement this interface. -type AuditSinksGetter interface { - AuditSinks() AuditSinkInterface -} - -// AuditSinkInterface has methods to work with AuditSink resources. -type AuditSinkInterface interface { - Create(*v1alpha1.AuditSink) (*v1alpha1.AuditSink, error) - Update(*v1alpha1.AuditSink) (*v1alpha1.AuditSink, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.AuditSink, error) - List(opts v1.ListOptions) (*v1alpha1.AuditSinkList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.AuditSink, err error) - AuditSinkExpansion -} - -// auditSinks implements AuditSinkInterface -type auditSinks struct { - client rest.Interface -} - -// newAuditSinks returns a AuditSinks -func newAuditSinks(c *AuditregistrationV1alpha1Client) *auditSinks { - return &auditSinks{ - client: c.RESTClient(), - } -} - -// Get takes name of the auditSink, and returns the corresponding auditSink object, and an error if there is any. -func (c *auditSinks) Get(name string, options v1.GetOptions) (result *v1alpha1.AuditSink, err error) { - result = &v1alpha1.AuditSink{} - err = c.client.Get(). - Resource("auditsinks"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(context.TODO()). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of AuditSinks that match those selectors. -func (c *auditSinks) List(opts v1.ListOptions) (result *v1alpha1.AuditSinkList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.AuditSinkList{} - err = c.client.Get(). - Resource("auditsinks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(context.TODO()). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested auditSinks. -func (c *auditSinks) Watch(opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("auditsinks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(context.TODO()) -} - -// Create takes the representation of a auditSink and creates it. Returns the server's representation of the auditSink, and an error, if there is any. -func (c *auditSinks) Create(auditSink *v1alpha1.AuditSink) (result *v1alpha1.AuditSink, err error) { - result = &v1alpha1.AuditSink{} - err = c.client.Post(). - Resource("auditsinks"). - Body(auditSink). - Do(context.TODO()). - Into(result) - return -} - -// Update takes the representation of a auditSink and updates it. Returns the server's representation of the auditSink, and an error, if there is any. -func (c *auditSinks) Update(auditSink *v1alpha1.AuditSink) (result *v1alpha1.AuditSink, err error) { - result = &v1alpha1.AuditSink{} - err = c.client.Put(). - Resource("auditsinks"). - Name(auditSink.Name). - Body(auditSink). - Do(context.TODO()). - Into(result) - return -} - -// Delete takes name of the auditSink and deletes it. Returns an error if one occurs. -func (c *auditSinks) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Resource("auditsinks"). - Name(name). - Body(options). - Do(context.TODO()). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *auditSinks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("auditsinks"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Timeout(timeout). - Body(options). - Do(context.TODO()). - Error() -} - -// Patch applies the patch and returns the patched auditSink. -func (c *auditSinks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.AuditSink, err error) { - result = &v1alpha1.AuditSink{} - err = c.client.Patch(pt). - Resource("auditsinks"). - SubResource(subresources...). - Name(name). - Body(data). - Do(context.TODO()). - Into(result) - return -} diff --git a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/doc.go b/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/doc.go deleted file mode 100644 index df51baa4d4c..00000000000 --- a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The 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. - -// This package has the automatically generated typed clients. -package v1alpha1 diff --git a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/BUILD b/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/BUILD deleted file mode 100644 index cee961c6cb6..00000000000 --- a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/BUILD +++ /dev/null @@ -1,38 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "fake_auditregistration_client.go", - "fake_auditsink.go", - ], - importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake", - importpath = "k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake", - visibility = ["//staging/src/k8s.io/client-go/deprecated:__subpackages__"], - deps = [ - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", - "//staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/client-go/rest:go_default_library", - "//staging/src/k8s.io/client-go/testing: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/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/doc.go b/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/doc.go deleted file mode 100644 index 16f44399065..00000000000 --- a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The 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 has the automatically generated clients. -package fake diff --git a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/fake_auditregistration_client.go b/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/fake_auditregistration_client.go deleted file mode 100644 index dad4e3a57c2..00000000000 --- a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/fake_auditregistration_client.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright The 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 ( - v1alpha1 "k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAuditregistrationV1alpha1 struct { - *testing.Fake -} - -func (c *FakeAuditregistrationV1alpha1) AuditSinks() v1alpha1.AuditSinkInterface { - return &FakeAuditSinks{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAuditregistrationV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/fake_auditsink.go b/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/fake_auditsink.go deleted file mode 100644 index d0bb9fd0009..00000000000 --- a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/fake/fake_auditsink.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright The 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 ( - v1alpha1 "k8s.io/api/auditregistration/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" -) - -// FakeAuditSinks implements AuditSinkInterface -type FakeAuditSinks struct { - Fake *FakeAuditregistrationV1alpha1 -} - -var auditsinksResource = schema.GroupVersionResource{Group: "auditregistration.k8s.io", Version: "v1alpha1", Resource: "auditsinks"} - -var auditsinksKind = schema.GroupVersionKind{Group: "auditregistration.k8s.io", Version: "v1alpha1", Kind: "AuditSink"} - -// Get takes name of the auditSink, and returns the corresponding auditSink object, and an error if there is any. -func (c *FakeAuditSinks) Get(name string, options v1.GetOptions) (result *v1alpha1.AuditSink, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(auditsinksResource, name), &v1alpha1.AuditSink{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.AuditSink), err -} - -// List takes label and field selectors, and returns the list of AuditSinks that match those selectors. -func (c *FakeAuditSinks) List(opts v1.ListOptions) (result *v1alpha1.AuditSinkList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(auditsinksResource, auditsinksKind, opts), &v1alpha1.AuditSinkList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.AuditSinkList{ListMeta: obj.(*v1alpha1.AuditSinkList).ListMeta} - for _, item := range obj.(*v1alpha1.AuditSinkList).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 auditSinks. -func (c *FakeAuditSinks) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(auditsinksResource, opts)) -} - -// Create takes the representation of a auditSink and creates it. Returns the server's representation of the auditSink, and an error, if there is any. -func (c *FakeAuditSinks) Create(auditSink *v1alpha1.AuditSink) (result *v1alpha1.AuditSink, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(auditsinksResource, auditSink), &v1alpha1.AuditSink{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.AuditSink), err -} - -// Update takes the representation of a auditSink and updates it. Returns the server's representation of the auditSink, and an error, if there is any. -func (c *FakeAuditSinks) Update(auditSink *v1alpha1.AuditSink) (result *v1alpha1.AuditSink, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(auditsinksResource, auditSink), &v1alpha1.AuditSink{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.AuditSink), err -} - -// Delete takes name of the auditSink and deletes it. Returns an error if one occurs. -func (c *FakeAuditSinks) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(auditsinksResource, name), &v1alpha1.AuditSink{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAuditSinks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(auditsinksResource, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.AuditSinkList{}) - return err -} - -// Patch applies the patch and returns the patched auditSink. -func (c *FakeAuditSinks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.AuditSink, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(auditsinksResource, name, pt, data, subresources...), &v1alpha1.AuditSink{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.AuditSink), err -} diff --git a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/generated_expansion.go b/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/generated_expansion.go deleted file mode 100644 index f0f51172641..00000000000 --- a/staging/src/k8s.io/client-go/deprecated/typed/auditregistration/v1alpha1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright The 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 v1alpha1 - -type AuditSinkExpansion interface{} diff --git a/staging/src/k8s.io/client-go/informers/BUILD b/staging/src/k8s.io/client-go/informers/BUILD index 2eb50fb94df..482c71020d5 100644 --- a/staging/src/k8s.io/client-go/informers/BUILD +++ b/staging/src/k8s.io/client-go/informers/BUILD @@ -15,7 +15,6 @@ go_library( "//staging/src/k8s.io/api/apps/v1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta2:go_default_library", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/api/autoscaling/v1:go_default_library", "//staging/src/k8s.io/api/autoscaling/v2beta1:go_default_library", "//staging/src/k8s.io/api/autoscaling/v2beta2:go_default_library", @@ -51,7 +50,6 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/client-go/informers/admissionregistration:go_default_library", "//staging/src/k8s.io/client-go/informers/apps:go_default_library", - "//staging/src/k8s.io/client-go/informers/auditregistration:go_default_library", "//staging/src/k8s.io/client-go/informers/autoscaling:go_default_library", "//staging/src/k8s.io/client-go/informers/batch:go_default_library", "//staging/src/k8s.io/client-go/informers/certificates:go_default_library", @@ -87,7 +85,6 @@ filegroup( ":package-srcs", "//staging/src/k8s.io/client-go/informers/admissionregistration:all-srcs", "//staging/src/k8s.io/client-go/informers/apps:all-srcs", - "//staging/src/k8s.io/client-go/informers/auditregistration:all-srcs", "//staging/src/k8s.io/client-go/informers/autoscaling:all-srcs", "//staging/src/k8s.io/client-go/informers/batch:all-srcs", "//staging/src/k8s.io/client-go/informers/certificates:all-srcs", diff --git a/staging/src/k8s.io/client-go/informers/auditregistration/BUILD b/staging/src/k8s.io/client-go/informers/auditregistration/BUILD deleted file mode 100644 index 3a3afe0dac7..00000000000 --- a/staging/src/k8s.io/client-go/informers/auditregistration/BUILD +++ /dev/null @@ -1,30 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["interface.go"], - importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/informers/auditregistration", - importpath = "k8s.io/client-go/informers/auditregistration", - visibility = ["//visibility:public"], - deps = [ - "//staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/client-go/informers/internalinterfaces: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/informers/auditregistration/v1alpha1:all-srcs", - ], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/staging/src/k8s.io/client-go/informers/auditregistration/interface.go b/staging/src/k8s.io/client-go/informers/auditregistration/interface.go deleted file mode 100644 index 0f1682c478d..00000000000 --- a/staging/src/k8s.io/client-go/informers/auditregistration/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright The 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 auditregistration - -import ( - v1alpha1 "k8s.io/client-go/informers/auditregistration/v1alpha1" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1alpha1 provides access to shared informers for resources in V1alpha1. - V1alpha1() v1alpha1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1alpha1 returns a new v1alpha1.Interface. -func (g *group) V1alpha1() v1alpha1.Interface { - return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/BUILD b/staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/BUILD deleted file mode 100644 index 846f0d680ec..00000000000 --- a/staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/BUILD +++ /dev/null @@ -1,36 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "auditsink.go", - "interface.go", - ], - importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/informers/auditregistration/v1alpha1", - importpath = "k8s.io/client-go/informers/auditregistration/v1alpha1", - visibility = ["//visibility:public"], - deps = [ - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", - "//staging/src/k8s.io/client-go/informers/internalinterfaces:go_default_library", - "//staging/src/k8s.io/client-go/kubernetes:go_default_library", - "//staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/client-go/tools/cache: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/staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/auditsink.go b/staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/auditsink.go deleted file mode 100644 index ef178c3aa82..00000000000 --- a/staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/auditsink.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The 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 v1alpha1 - -import ( - "context" - time "time" - - auditregistrationv1alpha1 "k8s.io/api/auditregistration/v1alpha1" - 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" - v1alpha1 "k8s.io/client-go/listers/auditregistration/v1alpha1" - cache "k8s.io/client-go/tools/cache" -) - -// AuditSinkInformer provides access to a shared informer and lister for -// AuditSinks. -type AuditSinkInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.AuditSinkLister -} - -type auditSinkInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewAuditSinkInformer constructs a new informer for AuditSink 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 NewAuditSinkInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredAuditSinkInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredAuditSinkInformer constructs a new informer for AuditSink 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 NewFilteredAuditSinkInformer(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.AuditregistrationV1alpha1().AuditSinks().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.AuditregistrationV1alpha1().AuditSinks().Watch(context.TODO(), options) - }, - }, - &auditregistrationv1alpha1.AuditSink{}, - resyncPeriod, - indexers, - ) -} - -func (f *auditSinkInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredAuditSinkInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *auditSinkInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&auditregistrationv1alpha1.AuditSink{}, f.defaultInformer) -} - -func (f *auditSinkInformer) Lister() v1alpha1.AuditSinkLister { - return v1alpha1.NewAuditSinkLister(f.Informer().GetIndexer()) -} diff --git a/staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/interface.go b/staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/interface.go deleted file mode 100644 index 0a67ba821df..00000000000 --- a/staging/src/k8s.io/client-go/informers/auditregistration/v1alpha1/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright The 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 v1alpha1 - -import ( - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // AuditSinks returns a AuditSinkInformer. - AuditSinks() AuditSinkInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// AuditSinks returns a AuditSinkInformer. -func (v *version) AuditSinks() AuditSinkInformer { - return &auditSinkInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/staging/src/k8s.io/client-go/informers/factory.go b/staging/src/k8s.io/client-go/informers/factory.go index dbbc8f5e9ad..5c17f81f936 100644 --- a/staging/src/k8s.io/client-go/informers/factory.go +++ b/staging/src/k8s.io/client-go/informers/factory.go @@ -28,7 +28,6 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" admissionregistration "k8s.io/client-go/informers/admissionregistration" apps "k8s.io/client-go/informers/apps" - auditregistration "k8s.io/client-go/informers/auditregistration" autoscaling "k8s.io/client-go/informers/autoscaling" batch "k8s.io/client-go/informers/batch" certificates "k8s.io/client-go/informers/certificates" @@ -192,7 +191,6 @@ type SharedInformerFactory interface { Admissionregistration() admissionregistration.Interface Apps() apps.Interface - Auditregistration() auditregistration.Interface Autoscaling() autoscaling.Interface Batch() batch.Interface Certificates() certificates.Interface @@ -219,10 +217,6 @@ func (f *sharedInformerFactory) Apps() apps.Interface { return apps.New(f, f.namespace, f.tweakListOptions) } -func (f *sharedInformerFactory) Auditregistration() auditregistration.Interface { - return auditregistration.New(f, f.namespace, f.tweakListOptions) -} - func (f *sharedInformerFactory) Autoscaling() autoscaling.Interface { return autoscaling.New(f, f.namespace, f.tweakListOptions) } diff --git a/staging/src/k8s.io/client-go/informers/generic.go b/staging/src/k8s.io/client-go/informers/generic.go index 5bc555da65a..d763b3cf0db 100644 --- a/staging/src/k8s.io/client-go/informers/generic.go +++ b/staging/src/k8s.io/client-go/informers/generic.go @@ -26,7 +26,6 @@ import ( appsv1 "k8s.io/api/apps/v1" appsv1beta1 "k8s.io/api/apps/v1beta1" v1beta2 "k8s.io/api/apps/v1beta2" - v1alpha1 "k8s.io/api/auditregistration/v1alpha1" autoscalingv1 "k8s.io/api/autoscaling/v1" v2beta1 "k8s.io/api/autoscaling/v2beta1" v2beta2 "k8s.io/api/autoscaling/v2beta2" @@ -37,7 +36,7 @@ import ( coordinationv1 "k8s.io/api/coordination/v1" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" corev1 "k8s.io/api/core/v1" - discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1" + v1alpha1 "k8s.io/api/discovery/v1alpha1" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" eventsv1beta1 "k8s.io/api/events/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" @@ -131,10 +130,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v1beta2.SchemeGroupVersion.WithResource("statefulsets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta2().StatefulSets().Informer()}, nil - // Group=auditregistration.k8s.io, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("auditsinks"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Auditregistration().V1alpha1().AuditSinks().Informer()}, nil - // Group=autoscaling, Version=v1 case autoscalingv1.SchemeGroupVersion.WithResource("horizontalpodautoscalers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Autoscaling().V1().HorizontalPodAutoscalers().Informer()}, nil @@ -206,7 +201,7 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ServiceAccounts().Informer()}, nil // Group=discovery.k8s.io, Version=v1alpha1 - case discoveryv1alpha1.SchemeGroupVersion.WithResource("endpointslices"): + case v1alpha1.SchemeGroupVersion.WithResource("endpointslices"): return &genericInformer{resource: resource.GroupResource(), informer: f.Discovery().V1alpha1().EndpointSlices().Informer()}, nil // Group=discovery.k8s.io, Version=v1beta1 diff --git a/staging/src/k8s.io/client-go/kubernetes/BUILD b/staging/src/k8s.io/client-go/kubernetes/BUILD index 6858c78d879..170e5c5548a 100644 --- a/staging/src/k8s.io/client-go/kubernetes/BUILD +++ b/staging/src/k8s.io/client-go/kubernetes/BUILD @@ -17,7 +17,6 @@ go_library( "//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2:go_default_library", - "//staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1:go_default_library", @@ -75,7 +74,6 @@ filegroup( "//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:all-srcs", "//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1:all-srcs", "//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2:all-srcs", - "//staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1:all-srcs", "//staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1:all-srcs", "//staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1:all-srcs", "//staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1:all-srcs", diff --git a/staging/src/k8s.io/client-go/kubernetes/clientset.go b/staging/src/k8s.io/client-go/kubernetes/clientset.go index d76e9ac9b61..37288520c9b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/clientset.go +++ b/staging/src/k8s.io/client-go/kubernetes/clientset.go @@ -27,7 +27,6 @@ import ( appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1" appsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" appsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" - auditregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1" authenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1" authenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" authorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1" @@ -73,7 +72,6 @@ type Interface interface { AppsV1() appsv1.AppsV1Interface AppsV1beta1() appsv1beta1.AppsV1beta1Interface AppsV1beta2() appsv1beta2.AppsV1beta2Interface - AuditregistrationV1alpha1() auditregistrationv1alpha1.AuditregistrationV1alpha1Interface AuthenticationV1() authenticationv1.AuthenticationV1Interface AuthenticationV1beta1() authenticationv1beta1.AuthenticationV1beta1Interface AuthorizationV1() authorizationv1.AuthorizationV1Interface @@ -119,7 +117,6 @@ type Clientset struct { appsV1 *appsv1.AppsV1Client appsV1beta1 *appsv1beta1.AppsV1beta1Client appsV1beta2 *appsv1beta2.AppsV1beta2Client - auditregistrationV1alpha1 *auditregistrationv1alpha1.AuditregistrationV1alpha1Client authenticationV1 *authenticationv1.AuthenticationV1Client authenticationV1beta1 *authenticationv1beta1.AuthenticationV1beta1Client authorizationV1 *authorizationv1.AuthorizationV1Client @@ -181,11 +178,6 @@ func (c *Clientset) AppsV1beta2() appsv1beta2.AppsV1beta2Interface { return c.appsV1beta2 } -// AuditregistrationV1alpha1 retrieves the AuditregistrationV1alpha1Client -func (c *Clientset) AuditregistrationV1alpha1() auditregistrationv1alpha1.AuditregistrationV1alpha1Interface { - return c.auditregistrationV1alpha1 -} - // AuthenticationV1 retrieves the AuthenticationV1Client func (c *Clientset) AuthenticationV1() authenticationv1.AuthenticationV1Interface { return c.authenticationV1 @@ -397,10 +389,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } - cs.auditregistrationV1alpha1, err = auditregistrationv1alpha1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } cs.authenticationV1, err = authenticationv1.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -554,7 +542,6 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { cs.appsV1 = appsv1.NewForConfigOrDie(c) cs.appsV1beta1 = appsv1beta1.NewForConfigOrDie(c) cs.appsV1beta2 = appsv1beta2.NewForConfigOrDie(c) - cs.auditregistrationV1alpha1 = auditregistrationv1alpha1.NewForConfigOrDie(c) cs.authenticationV1 = authenticationv1.NewForConfigOrDie(c) cs.authenticationV1beta1 = authenticationv1beta1.NewForConfigOrDie(c) cs.authorizationV1 = authorizationv1.NewForConfigOrDie(c) @@ -602,7 +589,6 @@ func New(c rest.Interface) *Clientset { cs.appsV1 = appsv1.New(c) cs.appsV1beta1 = appsv1beta1.New(c) cs.appsV1beta2 = appsv1beta2.New(c) - cs.auditregistrationV1alpha1 = auditregistrationv1alpha1.New(c) cs.authenticationV1 = authenticationv1.New(c) cs.authenticationV1beta1 = authenticationv1beta1.New(c) cs.authorizationV1 = authorizationv1.New(c) diff --git a/staging/src/k8s.io/client-go/kubernetes/fake/BUILD b/staging/src/k8s.io/client-go/kubernetes/fake/BUILD index 4753a9e10fa..df77d4d25d6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/fake/BUILD +++ b/staging/src/k8s.io/client-go/kubernetes/fake/BUILD @@ -16,7 +16,6 @@ go_library( "//staging/src/k8s.io/api/apps/v1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta2:go_default_library", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/api/authentication/v1:go_default_library", "//staging/src/k8s.io/api/authentication/v1beta1:go_default_library", "//staging/src/k8s.io/api/authorization/v1:go_default_library", @@ -70,8 +69,6 @@ go_library( "//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake:go_default_library", - "//staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1:go_default_library", diff --git a/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go b/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go index ccb103cc3cd..77686138db1 100644 --- a/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go +++ b/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go @@ -34,8 +34,6 @@ import ( fakeappsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake" appsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" fakeappsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake" - auditregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1" - fakeauditregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake" authenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1" fakeauthenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1/fake" authenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" @@ -179,11 +177,6 @@ func (c *Clientset) AppsV1beta2() appsv1beta2.AppsV1beta2Interface { return &fakeappsv1beta2.FakeAppsV1beta2{Fake: &c.Fake} } -// AuditregistrationV1alpha1 retrieves the AuditregistrationV1alpha1Client -func (c *Clientset) AuditregistrationV1alpha1() auditregistrationv1alpha1.AuditregistrationV1alpha1Interface { - return &fakeauditregistrationv1alpha1.FakeAuditregistrationV1alpha1{Fake: &c.Fake} -} - // AuthenticationV1 retrieves the AuthenticationV1Client func (c *Clientset) AuthenticationV1() authenticationv1.AuthenticationV1Interface { return &fakeauthenticationv1.FakeAuthenticationV1{Fake: &c.Fake} diff --git a/staging/src/k8s.io/client-go/kubernetes/fake/register.go b/staging/src/k8s.io/client-go/kubernetes/fake/register.go index e2296c13cc3..23a27ea5fc0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/fake/register.go +++ b/staging/src/k8s.io/client-go/kubernetes/fake/register.go @@ -24,7 +24,6 @@ import ( appsv1 "k8s.io/api/apps/v1" appsv1beta1 "k8s.io/api/apps/v1beta1" appsv1beta2 "k8s.io/api/apps/v1beta2" - auditregistrationv1alpha1 "k8s.io/api/auditregistration/v1alpha1" authenticationv1 "k8s.io/api/authentication/v1" authenticationv1beta1 "k8s.io/api/authentication/v1beta1" authorizationv1 "k8s.io/api/authorization/v1" @@ -75,7 +74,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ appsv1.AddToScheme, appsv1beta1.AddToScheme, appsv1beta2.AddToScheme, - auditregistrationv1alpha1.AddToScheme, authenticationv1.AddToScheme, authenticationv1beta1.AddToScheme, authorizationv1.AddToScheme, diff --git a/staging/src/k8s.io/client-go/kubernetes/scheme/BUILD b/staging/src/k8s.io/client-go/kubernetes/scheme/BUILD index a78e6215750..94d2778b409 100644 --- a/staging/src/k8s.io/client-go/kubernetes/scheme/BUILD +++ b/staging/src/k8s.io/client-go/kubernetes/scheme/BUILD @@ -15,7 +15,6 @@ go_library( "//staging/src/k8s.io/api/apps/v1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta2:go_default_library", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/api/authentication/v1:go_default_library", "//staging/src/k8s.io/api/authentication/v1beta1:go_default_library", "//staging/src/k8s.io/api/authorization/v1:go_default_library", diff --git a/staging/src/k8s.io/client-go/kubernetes/scheme/register.go b/staging/src/k8s.io/client-go/kubernetes/scheme/register.go index 4d8e8b7f780..5ca75a021c9 100644 --- a/staging/src/k8s.io/client-go/kubernetes/scheme/register.go +++ b/staging/src/k8s.io/client-go/kubernetes/scheme/register.go @@ -24,7 +24,6 @@ import ( appsv1 "k8s.io/api/apps/v1" appsv1beta1 "k8s.io/api/apps/v1beta1" appsv1beta2 "k8s.io/api/apps/v1beta2" - auditregistrationv1alpha1 "k8s.io/api/auditregistration/v1alpha1" authenticationv1 "k8s.io/api/authentication/v1" authenticationv1beta1 "k8s.io/api/authentication/v1beta1" authorizationv1 "k8s.io/api/authorization/v1" @@ -75,7 +74,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ appsv1.AddToScheme, appsv1beta1.AddToScheme, appsv1beta2.AddToScheme, - auditregistrationv1alpha1.AddToScheme, authenticationv1.AddToScheme, authenticationv1beta1.AddToScheme, authorizationv1.AddToScheme, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/BUILD deleted file mode 100644 index addd6cd1bfc..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/BUILD +++ /dev/null @@ -1,39 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "auditregistration_client.go", - "auditsink.go", - "doc.go", - "generated_expansion.go", - ], - importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1", - importpath = "k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1", - visibility = ["//visibility:public"], - deps = [ - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", - "//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library", - "//staging/src/k8s.io/client-go/rest: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/kubernetes/typed/auditregistration/v1alpha1/fake:all-srcs", - ], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditregistration_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditregistration_client.go deleted file mode 100644 index ec63179eacb..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditregistration_client.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The 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 v1alpha1 - -import ( - v1alpha1 "k8s.io/api/auditregistration/v1alpha1" - "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -type AuditregistrationV1alpha1Interface interface { - RESTClient() rest.Interface - AuditSinksGetter -} - -// AuditregistrationV1alpha1Client is used to interact with features provided by the auditregistration.k8s.io group. -type AuditregistrationV1alpha1Client struct { - restClient rest.Interface -} - -func (c *AuditregistrationV1alpha1Client) AuditSinks() AuditSinkInterface { - return newAuditSinks(c) -} - -// NewForConfig creates a new AuditregistrationV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*AuditregistrationV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &AuditregistrationV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new AuditregistrationV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *AuditregistrationV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new AuditregistrationV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *AuditregistrationV1alpha1Client { - return &AuditregistrationV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *AuditregistrationV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go deleted file mode 100644 index ea748c66225..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright The 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 v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "k8s.io/api/auditregistration/v1alpha1" - 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" -) - -// AuditSinksGetter has a method to return a AuditSinkInterface. -// A group's client should implement this interface. -type AuditSinksGetter interface { - AuditSinks() AuditSinkInterface -} - -// AuditSinkInterface has methods to work with AuditSink resources. -type AuditSinkInterface interface { - Create(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.CreateOptions) (*v1alpha1.AuditSink, error) - Update(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.UpdateOptions) (*v1alpha1.AuditSink, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.AuditSink, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AuditSinkList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AuditSink, err error) - AuditSinkExpansion -} - -// auditSinks implements AuditSinkInterface -type auditSinks struct { - client rest.Interface -} - -// newAuditSinks returns a AuditSinks -func newAuditSinks(c *AuditregistrationV1alpha1Client) *auditSinks { - return &auditSinks{ - client: c.RESTClient(), - } -} - -// Get takes name of the auditSink, and returns the corresponding auditSink object, and an error if there is any. -func (c *auditSinks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AuditSink, err error) { - result = &v1alpha1.AuditSink{} - err = c.client.Get(). - Resource("auditsinks"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of AuditSinks that match those selectors. -func (c *auditSinks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AuditSinkList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.AuditSinkList{} - err = c.client.Get(). - Resource("auditsinks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested auditSinks. -func (c *auditSinks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("auditsinks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a auditSink and creates it. Returns the server's representation of the auditSink, and an error, if there is any. -func (c *auditSinks) Create(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.CreateOptions) (result *v1alpha1.AuditSink, err error) { - result = &v1alpha1.AuditSink{} - err = c.client.Post(). - Resource("auditsinks"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(auditSink). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a auditSink and updates it. Returns the server's representation of the auditSink, and an error, if there is any. -func (c *auditSinks) Update(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.UpdateOptions) (result *v1alpha1.AuditSink, err error) { - result = &v1alpha1.AuditSink{} - err = c.client.Put(). - Resource("auditsinks"). - Name(auditSink.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(auditSink). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the auditSink and deletes it. Returns an error if one occurs. -func (c *auditSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("auditsinks"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *auditSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("auditsinks"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched auditSink. -func (c *auditSinks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AuditSink, err error) { - result = &v1alpha1.AuditSink{} - err = c.client.Patch(pt). - Resource("auditsinks"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/doc.go deleted file mode 100644 index df51baa4d4c..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The 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. - -// This package has the automatically generated typed clients. -package v1alpha1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/BUILD deleted file mode 100644 index 76ac78a7db8..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/BUILD +++ /dev/null @@ -1,38 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "fake_auditregistration_client.go", - "fake_auditsink.go", - ], - importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake", - importpath = "k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake", - visibility = ["//visibility:public"], - deps = [ - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", - "//staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/client-go/rest:go_default_library", - "//staging/src/k8s.io/client-go/testing: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/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/doc.go deleted file mode 100644 index 16f44399065..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The 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 has the automatically generated clients. -package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditregistration_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditregistration_client.go deleted file mode 100644 index c22acabcf47..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditregistration_client.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright The 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 ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAuditregistrationV1alpha1 struct { - *testing.Fake -} - -func (c *FakeAuditregistrationV1alpha1) AuditSinks() v1alpha1.AuditSinkInterface { - return &FakeAuditSinks{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAuditregistrationV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditsink.go b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditsink.go deleted file mode 100644 index f97c6747143..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake/fake_auditsink.go +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright The 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 ( - "context" - - v1alpha1 "k8s.io/api/auditregistration/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" -) - -// FakeAuditSinks implements AuditSinkInterface -type FakeAuditSinks struct { - Fake *FakeAuditregistrationV1alpha1 -} - -var auditsinksResource = schema.GroupVersionResource{Group: "auditregistration.k8s.io", Version: "v1alpha1", Resource: "auditsinks"} - -var auditsinksKind = schema.GroupVersionKind{Group: "auditregistration.k8s.io", Version: "v1alpha1", Kind: "AuditSink"} - -// Get takes name of the auditSink, and returns the corresponding auditSink object, and an error if there is any. -func (c *FakeAuditSinks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AuditSink, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(auditsinksResource, name), &v1alpha1.AuditSink{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.AuditSink), err -} - -// List takes label and field selectors, and returns the list of AuditSinks that match those selectors. -func (c *FakeAuditSinks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AuditSinkList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(auditsinksResource, auditsinksKind, opts), &v1alpha1.AuditSinkList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.AuditSinkList{ListMeta: obj.(*v1alpha1.AuditSinkList).ListMeta} - for _, item := range obj.(*v1alpha1.AuditSinkList).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 auditSinks. -func (c *FakeAuditSinks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(auditsinksResource, opts)) -} - -// Create takes the representation of a auditSink and creates it. Returns the server's representation of the auditSink, and an error, if there is any. -func (c *FakeAuditSinks) Create(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.CreateOptions) (result *v1alpha1.AuditSink, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(auditsinksResource, auditSink), &v1alpha1.AuditSink{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.AuditSink), err -} - -// Update takes the representation of a auditSink and updates it. Returns the server's representation of the auditSink, and an error, if there is any. -func (c *FakeAuditSinks) Update(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.UpdateOptions) (result *v1alpha1.AuditSink, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(auditsinksResource, auditSink), &v1alpha1.AuditSink{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.AuditSink), err -} - -// Delete takes name of the auditSink and deletes it. Returns an error if one occurs. -func (c *FakeAuditSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(auditsinksResource, name), &v1alpha1.AuditSink{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAuditSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(auditsinksResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.AuditSinkList{}) - return err -} - -// Patch applies the patch and returns the patched auditSink. -func (c *FakeAuditSinks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AuditSink, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(auditsinksResource, name, pt, data, subresources...), &v1alpha1.AuditSink{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.AuditSink), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/generated_expansion.go deleted file mode 100644 index f0f51172641..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright The 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 v1alpha1 - -type AuditSinkExpansion interface{} diff --git a/staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/BUILD b/staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/BUILD deleted file mode 100644 index c23bd63a400..00000000000 --- a/staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/BUILD +++ /dev/null @@ -1,32 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "auditsink.go", - "expansion_generated.go", - ], - importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/listers/auditregistration/v1alpha1", - importpath = "k8s.io/client-go/listers/auditregistration/v1alpha1", - visibility = ["//visibility:public"], - deps = [ - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", - "//staging/src/k8s.io/client-go/tools/cache: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/staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/auditsink.go b/staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/auditsink.go deleted file mode 100644 index bd3ee991017..00000000000 --- a/staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/auditsink.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright The 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 v1alpha1 - -import ( - v1alpha1 "k8s.io/api/auditregistration/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// AuditSinkLister helps list AuditSinks. -// All objects returned here must be treated as read-only. -type AuditSinkLister interface { - // List lists all AuditSinks in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.AuditSink, err error) - // Get retrieves the AuditSink from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.AuditSink, error) - AuditSinkListerExpansion -} - -// auditSinkLister implements the AuditSinkLister interface. -type auditSinkLister struct { - indexer cache.Indexer -} - -// NewAuditSinkLister returns a new AuditSinkLister. -func NewAuditSinkLister(indexer cache.Indexer) AuditSinkLister { - return &auditSinkLister{indexer: indexer} -} - -// List lists all AuditSinks in the indexer. -func (s *auditSinkLister) List(selector labels.Selector) (ret []*v1alpha1.AuditSink, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.AuditSink)) - }) - return ret, err -} - -// Get retrieves the AuditSink from the index for a given name. -func (s *auditSinkLister) Get(name string) (*v1alpha1.AuditSink, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("auditsink"), name) - } - return obj.(*v1alpha1.AuditSink), nil -} diff --git a/staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/expansion_generated.go b/staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/expansion_generated.go deleted file mode 100644 index 533dd0631f9..00000000000 --- a/staging/src/k8s.io/client-go/listers/auditregistration/v1alpha1/expansion_generated.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright The 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 v1alpha1 - -// AuditSinkListerExpansion allows custom methods to be added to -// AuditSinkLister. -type AuditSinkListerExpansion interface{} diff --git a/test/integration/apiserver/BUILD b/test/integration/apiserver/BUILD index 05152884953..68cd1f33c5b 100644 --- a/test/integration/apiserver/BUILD +++ b/test/integration/apiserver/BUILD @@ -28,7 +28,6 @@ go_test( "//pkg/printers:go_default_library", "//pkg/printers/internalversion:go_default_library", "//staging/src/k8s.io/api/apps/v1:go_default_library", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/api/batch/v2alpha1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/discovery/v1alpha1:go_default_library", diff --git a/test/integration/apiserver/print_test.go b/test/integration/apiserver/print_test.go index 679cb1280c0..3078f98db60 100644 --- a/test/integration/apiserver/print_test.go +++ b/test/integration/apiserver/print_test.go @@ -27,7 +27,6 @@ import ( "testing" "time" - auditregv1alpha1 "k8s.io/api/auditregistration/v1alpha1" batchv2alpha1 "k8s.io/api/batch/v2alpha1" discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" @@ -158,7 +157,6 @@ func TestServerSidePrint(t *testing.T) { s, _, closeFn := setupWithResources(t, // additional groupversions needed for the test to run []schema.GroupVersion{ - auditregv1alpha1.SchemeGroupVersion, batchv2alpha1.SchemeGroupVersion, discoveryv1alpha1.SchemeGroupVersion, discoveryv1beta1.SchemeGroupVersion, diff --git a/test/integration/etcd/data.go b/test/integration/etcd/data.go index 82ab2b97e6c..8d17cfa99ff 100644 --- a/test/integration/etcd/data.go +++ b/test/integration/etcd/data.go @@ -468,13 +468,6 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes }, // -- - // k8s.io/kubernetes/pkg/apis/auditregistration/v1alpha1 - gvr("auditregistration.k8s.io", "v1alpha1", "auditsinks"): { - Stub: `{"metadata":{"name":"sink1"},"spec":{"policy":{"level":"Metadata","stages":["ResponseStarted"]},"webhook":{"clientConfig":{"url":"http://localhost:4444","service":null,"caBundle":null}}}}`, - ExpectedEtcdPath: "/registry/auditsinks/sink1", - }, - // -- - // k8s.io/kubernetes/pkg/apis/node/v1alpha1 gvr("node.k8s.io", "v1alpha1", "runtimeclasses"): { Stub: `{"metadata": {"name": "rc1"}, "spec": {"runtimeHandler": "h1"}}`, diff --git a/test/utils/BUILD b/test/utils/BUILD index aac1239ab70..5e9b491a5d3 100644 --- a/test/utils/BUILD +++ b/test/utils/BUILD @@ -10,7 +10,6 @@ go_library( srcs = [ "admission_webhook.go", "audit.go", - "audit_dynamic.go", "conditions.go", "create_resources.go", "delete_resources.go", @@ -36,7 +35,6 @@ go_library( "//pkg/util/labels:go_default_library", "//staging/src/k8s.io/api/admission/v1beta1:go_default_library", "//staging/src/k8s.io/api/apps/v1:go_default_library", - "//staging/src/k8s.io/api/auditregistration/v1alpha1:go_default_library", "//staging/src/k8s.io/api/batch/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/storage/v1:go_default_library", @@ -59,7 +57,6 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", "//staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating:go_default_library", "//staging/src/k8s.io/apiserver/pkg/apis/audit:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/apis/audit/v1:go_default_library", "//staging/src/k8s.io/apiserver/pkg/audit:go_default_library", "//staging/src/k8s.io/client-go/kubernetes:go_default_library", "//staging/src/k8s.io/client-go/scale:go_default_library", @@ -69,7 +66,6 @@ go_library( "//staging/src/k8s.io/kubectl/pkg/scale:go_default_library", "//vendor/github.com/davecgh/go-spew/spew:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", - "//vendor/github.com/stretchr/testify/require:go_default_library", "//vendor/k8s.io/klog/v2:go_default_library", ], ) diff --git a/test/utils/audit_dynamic.go b/test/utils/audit_dynamic.go deleted file mode 100644 index d4a58dee314..00000000000 --- a/test/utils/audit_dynamic.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -Copyright 2018 The 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 utils - -import ( - "fmt" - "io/ioutil" - "net/http" - "net/http/httptest" - "sync" - "testing" - "time" - - "github.com/stretchr/testify/require" - - auditregv1alpha1 "k8s.io/api/auditregistration/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/wait" - auditinternal "k8s.io/apiserver/pkg/apis/audit" - auditv1 "k8s.io/apiserver/pkg/apis/audit/v1" - "k8s.io/apiserver/pkg/audit" -) - -// AuditTestServer is a helper server for dynamic audit testing -type AuditTestServer struct { - Name string - LockedEventList *LockedEventList - Server *httptest.Server - t *testing.T -} - -// LockedEventList is an event list with a lock for concurrent access -type LockedEventList struct { - *sync.RWMutex - EventList auditinternal.EventList -} - -// NewLockedEventList returns a new LockedEventList -func NewLockedEventList() *LockedEventList { - return &LockedEventList{ - RWMutex: &sync.RWMutex{}, - EventList: auditinternal.EventList{}, - } -} - -// NewAuditTestServer returns a new audit test server -func NewAuditTestServer(t *testing.T, name string) *AuditTestServer { - s := &AuditTestServer{ - Name: name, - LockedEventList: NewLockedEventList(), - t: t, - } - s.buildServer() - return s -} - -// GetEventList safely returns the internal event list -func (a *AuditTestServer) GetEventList() auditinternal.EventList { - a.LockedEventList.RLock() - defer a.LockedEventList.RUnlock() - return a.LockedEventList.EventList -} - -// ResetEventList resets the internal event list -func (a *AuditTestServer) ResetEventList() { - a.LockedEventList.Lock() - defer a.LockedEventList.Unlock() - a.LockedEventList.EventList = auditinternal.EventList{} -} - -// AppendEvents will add the given events to the internal event list -func (a *AuditTestServer) AppendEvents(events []auditinternal.Event) { - a.LockedEventList.Lock() - defer a.LockedEventList.Unlock() - a.LockedEventList.EventList.Items = append(a.LockedEventList.EventList.Items, events...) -} - -// WaitForEvents waits for the given events to arrive in the server or the 30s timeout is reached -func (a *AuditTestServer) WaitForEvents(expected []AuditEvent) ([]AuditEvent, error) { - var missing []AuditEvent - err := wait.PollImmediate(50*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { - var err error - el := a.GetEventList() - if len(el.Items) < 1 { - return false, nil - } - missing, err = CheckAuditList(el, expected) - if err != nil { - return false, nil - } - return true, nil - }) - return missing, err -} - -// WaitForNumEvents checks that at least the given number of events has arrived or the 30s timeout is reached -func (a *AuditTestServer) WaitForNumEvents(numEvents int) error { - err := wait.PollImmediate(50*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { - el := a.GetEventList() - if len(el.Items) < numEvents { - return false, nil - } - return true, nil - }) - if err != nil { - return fmt.Errorf("%v: %d events failed to arrive in %v", err, numEvents, wait.ForeverTestTimeout) - } - return nil -} - -// Health polls the server healthcheck until successful or the 30s timeout has been reached -func (a *AuditTestServer) Health() error { - err := wait.PollImmediate(100*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { - resp, err := http.Get(fmt.Sprintf("%s/health", a.Server.URL)) - if err != nil { - return false, nil - } - if resp.StatusCode != 200 { - return false, nil - } - return true, nil - }) - if err != nil { - return fmt.Errorf("server %s permanently failed health check: %v", a.Server.URL, err) - } - return nil -} - -// Close the server -func (a *AuditTestServer) Close() { - a.Server.Close() -} - -// BuildSinkConfiguration creates a generic audit sink configuration for this server -func (a *AuditTestServer) BuildSinkConfiguration() *auditregv1alpha1.AuditSink { - return &auditregv1alpha1.AuditSink{ - ObjectMeta: metav1.ObjectMeta{ - Name: a.Name, - }, - Spec: auditregv1alpha1.AuditSinkSpec{ - Policy: auditregv1alpha1.Policy{ - Level: auditregv1alpha1.LevelRequestResponse, - Stages: []auditregv1alpha1.Stage{ - auditregv1alpha1.StageResponseStarted, - auditregv1alpha1.StageResponseComplete, - }, - }, - Webhook: auditregv1alpha1.Webhook{ - ClientConfig: auditregv1alpha1.WebhookClientConfig{ - URL: &a.Server.URL, - }, - }, - }, - } -} - -// buildServer creates an http test server that will update the internal event list -// with the value it receives -func (a *AuditTestServer) buildServer() { - decoder := audit.Codecs.UniversalDecoder(auditv1.SchemeGroupVersion) - mux := http.NewServeMux() - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - body, err := ioutil.ReadAll(r.Body) - require.NoError(a.t, err, "could not read request body") - el := auditinternal.EventList{} - err = runtime.DecodeInto(decoder, body, &el) - r.Body.Close() - require.NoError(a.t, err, "failed decoding buf: %b, apiVersion: %s", body, auditv1.SchemeGroupVersion) - a.AppendEvents(el.Items) - w.WriteHeader(200) - }) - mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(200) - }) - a.Server = httptest.NewServer(mux) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index d4ab3530383..18c97fe10bd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1095,7 +1095,6 @@ k8s.io/api/admissionregistration/v1beta1 k8s.io/api/apps/v1 k8s.io/api/apps/v1beta1 k8s.io/api/apps/v1beta2 -k8s.io/api/auditregistration/v1alpha1 k8s.io/api/authentication/v1 k8s.io/api/authentication/v1beta1 k8s.io/api/authorization/v1 @@ -1281,9 +1280,7 @@ k8s.io/apiserver/pkg/apis/config/validation k8s.io/apiserver/pkg/apis/example k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap k8s.io/apiserver/pkg/audit -k8s.io/apiserver/pkg/audit/event k8s.io/apiserver/pkg/audit/policy -k8s.io/apiserver/pkg/audit/util k8s.io/apiserver/pkg/authentication/authenticator k8s.io/apiserver/pkg/authentication/authenticatorfactory k8s.io/apiserver/pkg/authentication/group @@ -1370,8 +1367,6 @@ k8s.io/apiserver/pkg/util/shufflesharding k8s.io/apiserver/pkg/util/webhook k8s.io/apiserver/pkg/util/wsstream k8s.io/apiserver/plugin/pkg/audit/buffered -k8s.io/apiserver/plugin/pkg/audit/dynamic -k8s.io/apiserver/plugin/pkg/audit/dynamic/enforced k8s.io/apiserver/plugin/pkg/audit/log k8s.io/apiserver/plugin/pkg/audit/truncate k8s.io/apiserver/plugin/pkg/audit/webhook @@ -1408,8 +1403,6 @@ k8s.io/client-go/informers/apps k8s.io/client-go/informers/apps/v1 k8s.io/client-go/informers/apps/v1beta1 k8s.io/client-go/informers/apps/v1beta2 -k8s.io/client-go/informers/auditregistration -k8s.io/client-go/informers/auditregistration/v1alpha1 k8s.io/client-go/informers/autoscaling k8s.io/client-go/informers/autoscaling/v1 k8s.io/client-go/informers/autoscaling/v2beta1 @@ -1470,8 +1463,6 @@ k8s.io/client-go/kubernetes/typed/apps/v1beta1 k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake k8s.io/client-go/kubernetes/typed/apps/v1beta2 k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake -k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1 -k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/fake k8s.io/client-go/kubernetes/typed/authentication/v1 k8s.io/client-go/kubernetes/typed/authentication/v1/fake k8s.io/client-go/kubernetes/typed/authentication/v1beta1 @@ -1545,7 +1536,6 @@ k8s.io/client-go/listers/admissionregistration/v1beta1 k8s.io/client-go/listers/apps/v1 k8s.io/client-go/listers/apps/v1beta1 k8s.io/client-go/listers/apps/v1beta2 -k8s.io/client-go/listers/auditregistration/v1alpha1 k8s.io/client-go/listers/autoscaling/v1 k8s.io/client-go/listers/autoscaling/v2beta1 k8s.io/client-go/listers/autoscaling/v2beta2