From 0518cd9ccbd50546826c1e2cef687e0ae82e16e0 Mon Sep 17 00:00:00 2001 From: David Eads Date: Fri, 27 Oct 2017 08:00:28 -0400 Subject: [PATCH] update API types for new dependencies on k8s.io/api --- apps/v1/register.go | 6 ++-- apps/v1/types.go | 20 ++++++------ authorization/v1/register.go | 4 +-- authorization/v1/types.go | 14 ++++----- build/v1/register.go | 8 ++--- build/v1/types.go | 56 +++++++++++++++++----------------- image/dockerpre012/register.go | 4 +-- image/v1/register.go | 12 ++++---- image/v1/types.go | 14 ++++----- network/v1/types.go | 4 +-- oauth/v1/register.go | 4 +-- project/v1/register.go | 4 +-- project/v1/types.go | 8 ++--- quota/v1/types.go | 8 ++--- route/v1/register.go | 4 +-- route/v1/types.go | 4 +-- security/v1/register.go | 4 +-- security/v1/types.go | 22 ++++++------- template/v1/register.go | 4 +-- template/v1/types.go | 12 ++++---- user/v1/register.go | 4 +-- user/v1/types.go | 8 ++--- 22 files changed, 114 insertions(+), 114 deletions(-) diff --git a/apps/v1/register.go b/apps/v1/register.go index 58880068c38..88e40b4d4a2 100644 --- a/apps/v1/register.go +++ b/apps/v1/register.go @@ -1,10 +1,10 @@ package v1 import ( + extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - extensionsv1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" ) const ( @@ -16,10 +16,10 @@ var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} LegacySchemeGroupVersion = schema.GroupVersion{Group: LegacyGroupName, Version: "v1"} - LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, addConversionFuncs, RegisterDefaults) + LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes) AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, RegisterDefaults) + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) diff --git a/apps/v1/types.go b/apps/v1/types.go index 912bd913b65..7e637930c16 100644 --- a/apps/v1/types.go +++ b/apps/v1/types.go @@ -3,9 +3,9 @@ package v1 import ( "fmt" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - kapi "k8s.io/kubernetes/pkg/api/v1" ) // +genclient @@ -73,7 +73,7 @@ type DeploymentConfigSpec struct { // Template is the object that describes the pod that will be created if // insufficient replicas are detected. - Template *kapi.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,8,opt,name=template"` + Template *corev1.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,8,opt,name=template"` } // DeploymentStrategy describes how to perform a deployment. @@ -91,7 +91,7 @@ type DeploymentStrategy struct { RollingParams *RollingDeploymentStrategyParams `json:"rollingParams,omitempty" protobuf:"bytes,4,opt,name=rollingParams"` // Resources contains resource requirements to execute the deployment and any hooks. - Resources kapi.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,5,opt,name=resources"` + Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,5,opt,name=resources"` // Labels is a set of key, value pairs added to custom deployer and lifecycle pre/post hook pods. Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,6,rep,name=labels"` // Annotations is a set of key, value pairs added to custom deployer and lifecycle pre/post hook pods. @@ -119,7 +119,7 @@ type CustomDeploymentStrategyParams struct { // Image specifies a Docker image which can carry out a deployment. Image string `json:"image,omitempty" protobuf:"bytes,1,opt,name=image"` // Environment holds the environment which will be given to the container for Image. - Environment []kapi.EnvVar `json:"environment,omitempty" protobuf:"bytes,2,rep,name=environment"` + Environment []corev1.EnvVar `json:"environment,omitempty" protobuf:"bytes,2,rep,name=environment"` // Command is optional and overrides CMD in the container Image. Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` } @@ -219,7 +219,7 @@ type ExecNewPodHook struct { // Command is the action command and its arguments. Command []string `json:"command" protobuf:"bytes,1,rep,name=command"` // Env is a set of environment variables to supply to the hook pod's container. - Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,2,rep,name=env"` + Env []corev1.EnvVar `json:"env,omitempty" protobuf:"bytes,2,rep,name=env"` // ContainerName is the name of a container in the deployment pod template // whose Docker image will be used for the hook pod's container. ContainerName string `json:"containerName" protobuf:"bytes,3,opt,name=containerName"` @@ -235,7 +235,7 @@ type TagImageHook struct { // container this value will be defaulted to the name of that container. ContainerName string `json:"containerName" protobuf:"bytes,1,opt,name=containerName"` // To is the target ImageStreamTag to set the container's image onto. - To kapi.ObjectReference `json:"to" protobuf:"bytes,2,opt,name=to"` + To corev1.ObjectReference `json:"to" protobuf:"bytes,2,opt,name=to"` } // DeploymentTriggerPolicies is a list of policies where nil values and different from empty arrays. @@ -280,7 +280,7 @@ type DeploymentTriggerImageChangeParams struct { // From is a reference to an image stream tag to watch for changes. From.Name is the only // required subfield - if From.Namespace is blank, the namespace of the current deployment // trigger will be used. - From kapi.ObjectReference `json:"from" protobuf:"bytes,3,opt,name=from"` + From corev1.ObjectReference `json:"from" protobuf:"bytes,3,opt,name=from"` // LastTriggeredImage is the last image to be triggered. LastTriggeredImage string `json:"lastTriggeredImage,omitempty" protobuf:"bytes,4,opt,name=lastTriggeredImage"` } @@ -333,7 +333,7 @@ type DeploymentCause struct { type DeploymentCauseImageTrigger struct { // From is a reference to the changed object which triggered a deployment. The field may have // the kinds DockerImage, ImageStreamTag, or ImageStreamImage. - From kapi.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` + From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` } type DeploymentConditionType string @@ -369,7 +369,7 @@ type DeploymentCondition struct { // Type of deployment condition. Type DeploymentConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=DeploymentConditionType"` // Status of the condition, one of True, False, Unknown. - Status kapi.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` + Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` // The last time this condition was updated. LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,6,opt,name=lastUpdateTime"` // The last time the condition transitioned from one status to another. @@ -408,7 +408,7 @@ type DeploymentConfigRollback struct { // DeploymentConfigRollbackSpec represents the options for rollback generation. type DeploymentConfigRollbackSpec struct { // From points to a ReplicationController which is a deployment. - From kapi.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` + From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` // Revision to rollback to. If set to 0, rollback to the last revision. Revision int64 `json:"revision,omitempty" protobuf:"varint,2,opt,name=revision"` // IncludeTriggers specifies whether to include config Triggers. diff --git a/authorization/v1/register.go b/authorization/v1/register.go index 8a575bba0da..c3779ad3ca3 100644 --- a/authorization/v1/register.go +++ b/authorization/v1/register.go @@ -15,10 +15,10 @@ var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} LegacySchemeGroupVersion = schema.GroupVersion{Group: LegacyGroupName, Version: "v1"} - LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, addConversionFuncs, addLegacyFieldSelectorKeyConversions, RegisterDefaults) + LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes) AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addFieldSelectorKeyConversions, RegisterDefaults) + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) diff --git a/authorization/v1/types.go b/authorization/v1/types.go index 95d26ae1993..5f20fef5bc9 100644 --- a/authorization/v1/types.go +++ b/authorization/v1/types.go @@ -3,9 +3,9 @@ package v1 import ( "fmt" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kruntime "k8s.io/apimachinery/pkg/runtime" - kapi "k8s.io/kubernetes/pkg/api/v1" ) // Authorization is calculated against @@ -91,12 +91,12 @@ type RoleBinding struct { // Thus newer clients that do not need to support backwards compatibility should send // only fully qualified Subjects and should omit the UserNames and GroupNames fields. // Clients that need to support backwards compatibility can use this field to build the UserNames and GroupNames. - Subjects []kapi.ObjectReference `json:"subjects" protobuf:"bytes,4,rep,name=subjects"` + Subjects []corev1.ObjectReference `json:"subjects" protobuf:"bytes,4,rep,name=subjects"` // RoleRef can only reference the current namespace and the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // Since Policy is a singleton, this is sufficient knowledge to locate a role. - RoleRef kapi.ObjectReference `json:"roleRef" protobuf:"bytes,5,opt,name=roleRef"` + RoleRef corev1.ObjectReference `json:"roleRef" protobuf:"bytes,5,opt,name=roleRef"` } type NamedRoles []NamedRole @@ -134,7 +134,7 @@ type PolicyBinding struct { LastModified metav1.Time `json:"lastModified" protobuf:"bytes,2,opt,name=lastModified"` // PolicyRef is a reference to the Policy that contains all the Roles that this PolicyBinding's RoleBindings may reference - PolicyRef kapi.ObjectReference `json:"policyRef" protobuf:"bytes,3,opt,name=policyRef"` + PolicyRef corev1.ObjectReference `json:"policyRef" protobuf:"bytes,3,opt,name=policyRef"` // RoleBindings holds all the RoleBindings held by this PolicyBinding, mapped by RoleBinding.Name RoleBindings NamedRoleBindings `json:"roleBindings" protobuf:"bytes,4,rep,name=roleBindings"` } @@ -448,12 +448,12 @@ type ClusterRoleBinding struct { // Thus newer clients that do not need to support backwards compatibility should send // only fully qualified Subjects and should omit the UserNames and GroupNames fields. // Clients that need to support backwards compatibility can use this field to build the UserNames and GroupNames. - Subjects []kapi.ObjectReference `json:"subjects" protobuf:"bytes,4,rep,name=subjects"` + Subjects []corev1.ObjectReference `json:"subjects" protobuf:"bytes,4,rep,name=subjects"` // RoleRef can only reference the current namespace and the global namespace. // If the ClusterRoleRef cannot be resolved, the Authorizer must return an error. // Since Policy is a singleton, this is sufficient knowledge to locate a role. - RoleRef kapi.ObjectReference `json:"roleRef" protobuf:"bytes,5,opt,name=roleRef"` + RoleRef corev1.ObjectReference `json:"roleRef" protobuf:"bytes,5,opt,name=roleRef"` } type NamedClusterRoles []NamedClusterRole @@ -493,7 +493,7 @@ type ClusterPolicyBinding struct { LastModified metav1.Time `json:"lastModified" protobuf:"bytes,2,opt,name=lastModified"` // PolicyRef is a reference to the ClusterPolicy that contains all the ClusterRoles that this ClusterPolicyBinding's RoleBindings may reference - PolicyRef kapi.ObjectReference `json:"policyRef" protobuf:"bytes,3,opt,name=policyRef"` + PolicyRef corev1.ObjectReference `json:"policyRef" protobuf:"bytes,3,opt,name=policyRef"` // RoleBindings holds all the ClusterRoleBindings held by this ClusterPolicyBinding, mapped by ClusterRoleBinding.Name RoleBindings NamedClusterRoleBindings `json:"roleBindings" protobuf:"bytes,4,rep,name=roleBindings"` } diff --git a/build/v1/register.go b/build/v1/register.go index b7212be6e97..d9e7e60360f 100644 --- a/build/v1/register.go +++ b/build/v1/register.go @@ -1,10 +1,10 @@ package v1 import ( + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - kapiv1 "k8s.io/kubernetes/pkg/api/v1" ) const GroupName = "build.openshift.io" @@ -14,10 +14,10 @@ var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} LegacySchemeGroupVersion = schema.GroupVersion{Group: LegacyGroupName, Version: "v1"} - LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, addConversionFuncs, addLegacyFieldSelectorKeyConversions, RegisterDefaults) + LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes) AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addFieldSelectorKeyConversions, RegisterDefaults) + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) @@ -37,7 +37,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &BuildLogOptions{}, &BinaryBuildRequestOptions{}, // This is needed for webhooks - &kapiv1.PodProxyOptions{}, + &corev1.PodProxyOptions{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/build/v1/types.go b/build/v1/types.go index 36627aeb2e4..2e56ca1bccf 100644 --- a/build/v1/types.go +++ b/build/v1/types.go @@ -4,8 +4,8 @@ import ( "fmt" "time" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kapi "k8s.io/kubernetes/pkg/api/v1" ) // +genclient @@ -68,7 +68,7 @@ type CommonSpec struct { Output BuildOutput `json:"output,omitempty" protobuf:"bytes,5,opt,name=output"` // resources computes resource requirements to execute the build. - Resources kapi.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,6,opt,name=resources"` + Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,6,opt,name=resources"` // postCommit is a build hook executed after the build output image is // committed, before it is pushed to a registry. @@ -168,7 +168,7 @@ type ImageChangeCause struct { // fromRef contains detailed information about an image that triggered a // build. - FromRef *kapi.ObjectReference `json:"fromRef,omitempty" protobuf:"bytes,2,opt,name=fromRef"` + FromRef *corev1.ObjectReference `json:"fromRef,omitempty" protobuf:"bytes,2,opt,name=fromRef"` } // BuildStatus contains the status of a build @@ -207,7 +207,7 @@ type BuildStatus struct { OutputDockerImageReference string `json:"outputDockerImageReference,omitempty" protobuf:"bytes,8,opt,name=outputDockerImageReference"` // config is an ObjectReference to the BuildConfig this Build is based on. - Config *kapi.ObjectReference `json:"config,omitempty" protobuf:"bytes,9,opt,name=config"` + Config *corev1.ObjectReference `json:"config,omitempty" protobuf:"bytes,9,opt,name=config"` // output describes the Docker image the build has produced. Output BuildStatusOutput `json:"output,omitempty" protobuf:"bytes,10,opt,name=output"` @@ -411,7 +411,7 @@ type BuildSource struct { // The secret contains valid credentials for remote repository, where the // data's key represent the authentication method to be used and value is // the base64 encoded credentials. Supported auth methods are: ssh-privatekey. - SourceSecret *kapi.LocalObjectReference `json:"sourceSecret,omitempty" protobuf:"bytes,7,opt,name=sourceSecret"` + SourceSecret *corev1.LocalObjectReference `json:"sourceSecret,omitempty" protobuf:"bytes,7,opt,name=sourceSecret"` // secrets represents a list of secrets and their destinations that will // be used only for the build. @@ -426,14 +426,14 @@ type BuildSource struct { type ImageSource struct { // from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to // copy source from. - From kapi.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` + From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` // paths is a list of source and destination paths to copy from the image. Paths []ImageSourcePath `json:"paths" protobuf:"bytes,2,rep,name=paths"` // pullSecret is a reference to a secret to be used to pull the image from a registry // If the image is pulled from the OpenShift registry, this field does not need to be set. - PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,3,opt,name=pullSecret"` + PullSecret *corev1.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,3,opt,name=pullSecret"` } // ImageSourcePath describes a path to be copied from a source image and its destination within the build directory. @@ -455,7 +455,7 @@ type ImageSourcePath struct { type SecretBuildSource struct { // secret is a reference to an existing secret that you want to use in your // build. - Secret kapi.LocalObjectReference `json:"secret" protobuf:"bytes,1,opt,name=secret"` + Secret corev1.LocalObjectReference `json:"secret" protobuf:"bytes,1,opt,name=secret"` // destinationDir is the directory where the files from the secret should be // available for the build time. @@ -581,15 +581,15 @@ const ( type CustomBuildStrategy struct { // from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which // the docker image should be pulled - From kapi.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` + From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` // pullSecret is the name of a Secret that would be used for setting up // the authentication for pulling the Docker images from the private Docker // registries - PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,2,opt,name=pullSecret"` + PullSecret *corev1.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,2,opt,name=pullSecret"` // env contains additional environment variables you want to pass into a builder container. - Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,3,rep,name=env"` + Env []corev1.EnvVar `json:"env,omitempty" protobuf:"bytes,3,rep,name=env"` // exposeDockerSocket will allow running Docker commands (and build Docker images) from // inside the Docker container. @@ -633,19 +633,19 @@ type DockerBuildStrategy struct { // from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which // the docker image should be pulled // the resulting image will be used in the FROM line of the Dockerfile for this build. - From *kapi.ObjectReference `json:"from,omitempty" protobuf:"bytes,1,opt,name=from"` + From *corev1.ObjectReference `json:"from,omitempty" protobuf:"bytes,1,opt,name=from"` // pullSecret is the name of a Secret that would be used for setting up // the authentication for pulling the Docker images from the private Docker // registries - PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,2,opt,name=pullSecret"` + PullSecret *corev1.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,2,opt,name=pullSecret"` // noCache if set to true indicates that the docker build must be executed with the // --no-cache=true flag NoCache bool `json:"noCache,omitempty" protobuf:"varint,3,opt,name=noCache"` // env contains additional environment variables you want to pass into a builder container. - Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,4,rep,name=env"` + Env []corev1.EnvVar `json:"env,omitempty" protobuf:"bytes,4,rep,name=env"` // forcePull describes if the builder should pull the images from registry prior to building. ForcePull bool `json:"forcePull,omitempty" protobuf:"varint,5,opt,name=forcePull"` @@ -656,7 +656,7 @@ type DockerBuildStrategy struct { // buildArgs contains build arguments that will be resolved in the Dockerfile. See // https://docs.docker.com/engine/reference/builder/#/arg for more details. - BuildArgs []kapi.EnvVar `json:"buildArgs,omitempty" protobuf:"bytes,7,rep,name=buildArgs"` + BuildArgs []corev1.EnvVar `json:"buildArgs,omitempty" protobuf:"bytes,7,rep,name=buildArgs"` // imageOptimizationPolicy describes what optimizations the system can use when building images // to reduce the final size or time spent building the image. The default policy is 'None' which @@ -672,15 +672,15 @@ type DockerBuildStrategy struct { type SourceBuildStrategy struct { // from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which // the docker image should be pulled - From kapi.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` + From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` // pullSecret is the name of a Secret that would be used for setting up // the authentication for pulling the Docker images from the private Docker // registries - PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,2,opt,name=pullSecret"` + PullSecret *corev1.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,2,opt,name=pullSecret"` // env contains additional environment variables you want to pass into a builder container. - Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,3,rep,name=env"` + Env []corev1.EnvVar `json:"env,omitempty" protobuf:"bytes,3,rep,name=env"` // scripts is the location of Source scripts Scripts string `json:"scripts,omitempty" protobuf:"bytes,4,opt,name=scripts"` @@ -710,7 +710,7 @@ type JenkinsPipelineBuildStrategy struct { Jenkinsfile string `json:"jenkinsfile,omitempty" protobuf:"bytes,2,opt,name=jenkinsfile"` // env contains additional environment variables you want to pass into a build pipeline. - Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,3,rep,name=env"` + Env []corev1.EnvVar `json:"env,omitempty" protobuf:"bytes,3,rep,name=env"` } // A BuildPostCommitSpec holds a build post commit hook specification. The hook @@ -809,12 +809,12 @@ type BuildOutput struct { // This value will be used to look up a Docker image repository to push to. // In the case of an ImageStreamTag, the ImageStreamTag will be looked for in the namespace of // the build unless Namespace is specified. - To *kapi.ObjectReference `json:"to,omitempty" protobuf:"bytes,1,opt,name=to"` + To *corev1.ObjectReference `json:"to,omitempty" protobuf:"bytes,1,opt,name=to"` // PushSecret is the name of a Secret that would be used for setting // up the authentication for executing the Docker push to authentication // enabled Docker Registry (or Docker Hub). - PushSecret *kapi.LocalObjectReference `json:"pushSecret,omitempty" protobuf:"bytes,2,opt,name=pushSecret"` + PushSecret *corev1.LocalObjectReference `json:"pushSecret,omitempty" protobuf:"bytes,2,opt,name=pushSecret"` // imageLabels define a list of labels that are applied to the resulting image. If there // are multiple labels with the same name then the last one in the list is used. @@ -919,7 +919,7 @@ type ImageChangeTrigger struct { // It is optional. If no From is specified, the From image from the build strategy // will be used. Only one ImageChangeTrigger with an empty From reference is allowed in // a build configuration. - From *kapi.ObjectReference `json:"from,omitempty" protobuf:"bytes,2,opt,name=from"` + From *corev1.ObjectReference `json:"from,omitempty" protobuf:"bytes,2,opt,name=from"` } // BuildTriggerPolicy describes a policy for a single trigger that results in a new Build. @@ -1011,7 +1011,7 @@ type GenericWebHookEvent struct { // env contains additional environment variables you want to pass into a builder container. // ValueFrom is not supported. - Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,3,rep,name=env"` + Env []corev1.EnvVar `json:"env,omitempty" protobuf:"bytes,3,rep,name=env"` // DockerStrategyOptions contains additional docker-strategy specific options for the build DockerStrategyOptions *DockerStrategyOptions `json:"dockerStrategyOptions,omitempty" protobuf:"bytes,4,opt,name=dockerStrategyOptions"` @@ -1034,7 +1034,7 @@ type BuildLog struct { type DockerStrategyOptions struct { // Args contains any build arguments that are to be passed to Docker. See // https://docs.docker.com/engine/reference/builder/#/arg for more details - BuildArgs []kapi.EnvVar `json:"buildArgs,omitempty" protobuf:"bytes,1,rep,name=buildArgs"` + BuildArgs []corev1.EnvVar `json:"buildArgs,omitempty" protobuf:"bytes,1,rep,name=buildArgs"` // noCache overrides the docker-strategy noCache option in the build config NoCache *bool `json:"noCache,omitempty" protobuf:"varint,2,opt,name=noCache"` @@ -1058,10 +1058,10 @@ type BuildRequest struct { Revision *SourceRevision `json:"revision,omitempty" protobuf:"bytes,2,opt,name=revision"` // triggeredByImage is the Image that triggered this build. - TriggeredByImage *kapi.ObjectReference `json:"triggeredByImage,omitempty" protobuf:"bytes,3,opt,name=triggeredByImage"` + TriggeredByImage *corev1.ObjectReference `json:"triggeredByImage,omitempty" protobuf:"bytes,3,opt,name=triggeredByImage"` // from is the reference to the ImageStreamTag that triggered the build. - From *kapi.ObjectReference `json:"from,omitempty" protobuf:"bytes,4,opt,name=from"` + From *corev1.ObjectReference `json:"from,omitempty" protobuf:"bytes,4,opt,name=from"` // binary indicates a request to build from a binary provided to the builder Binary *BinaryBuildSource `json:"binary,omitempty" protobuf:"bytes,5,opt,name=binary"` @@ -1072,7 +1072,7 @@ type BuildRequest struct { LastVersion *int64 `json:"lastVersion,omitempty" protobuf:"varint,6,opt,name=lastVersion"` // env contains additional environment variables you want to pass into a builder container. - Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,7,rep,name=env"` + Env []corev1.EnvVar `json:"env,omitempty" protobuf:"bytes,7,rep,name=env"` // triggeredBy describes which triggers started the most recent update to the // build configuration and contains information about those triggers. @@ -1163,7 +1163,7 @@ type BuildLogOptions struct { // SecretSpec specifies a secret to be included in a build pod and its corresponding mount point type SecretSpec struct { // secretSource is a reference to the secret - SecretSource kapi.LocalObjectReference `json:"secretSource" protobuf:"bytes,1,opt,name=secretSource"` + SecretSource corev1.LocalObjectReference `json:"secretSource" protobuf:"bytes,1,opt,name=secretSource"` // mountPath is the path at which to mount the secret MountPath string `json:"mountPath" protobuf:"bytes,2,opt,name=mountPath"` diff --git a/image/dockerpre012/register.go b/image/dockerpre012/register.go index 57bbcf7770d..469806dbe74 100644 --- a/image/dockerpre012/register.go +++ b/image/dockerpre012/register.go @@ -14,10 +14,10 @@ var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "pre012"} LegacySchemeGroupVersion = schema.GroupVersion{Group: LegacyGroupName, Version: "pre012"} - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs) + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme - LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, addConversionFuncs) + LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes) AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme ) diff --git a/image/v1/register.go b/image/v1/register.go index 11368d16b7b..d7189603b18 100644 --- a/image/v1/register.go +++ b/image/v1/register.go @@ -1,13 +1,13 @@ package v1 import ( + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - kapiv1 "k8s.io/kubernetes/pkg/api/v1" - "github.com/openshift/origin/pkg/image/apis/image/docker10" - "github.com/openshift/origin/pkg/image/apis/image/dockerpre012" + "github.com/openshift/api/image/docker10" + "github.com/openshift/api/image/dockerpre012" ) const ( @@ -19,10 +19,10 @@ var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} LegacySchemeGroupVersion = schema.GroupVersion{Group: LegacyGroupName, Version: "v1"} - LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, addConversionFuncs, addLegacyFieldSelectorKeyConversions, RegisterDefaults, docker10.AddToSchemeInCoreGroup, dockerpre012.AddToSchemeInCoreGroup) + LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, docker10.AddToSchemeInCoreGroup, dockerpre012.AddToSchemeInCoreGroup) AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addFieldSelectorKeyConversions, RegisterDefaults, docker10.AddToScheme, dockerpre012.AddToScheme) + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, docker10.AddToScheme, dockerpre012.AddToScheme) AddToScheme = SchemeBuilder.AddToScheme ) @@ -61,7 +61,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ImageStreamTagList{}, &ImageStreamImage{}, &ImageStreamImport{}, - &kapiv1.SecretList{}, + &corev1.SecretList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/image/v1/types.go b/image/v1/types.go index 556875b8181..2e690db04a3 100644 --- a/image/v1/types.go +++ b/image/v1/types.go @@ -1,9 +1,9 @@ package v1 import ( + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - kapi "k8s.io/kubernetes/pkg/api/v1" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -111,7 +111,7 @@ type SignatureCondition struct { // Type of signature condition, Complete or Failed. Type SignatureConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=SignatureConditionType"` // Status of the condition, one of True, False, Unknown. - Status kapi.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` + Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` // Last time the condition was checked. LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"` // Last time the condition transit from one status to another. @@ -206,7 +206,7 @@ type TagReference struct { Annotations map[string]string `json:"annotations" protobuf:"bytes,2,rep,name=annotations"` // Optional; if specified, a reference to another image that this tag should point to. Valid values // are ImageStreamTag, ImageStreamImage, and DockerImage. - From *kapi.ObjectReference `json:"from,omitempty" protobuf:"bytes,3,opt,name=from"` + From *corev1.ObjectReference `json:"from,omitempty" protobuf:"bytes,3,opt,name=from"` // Reference states if the tag will be imported. Default value is false, which means the tag will // be imported. Reference bool `json:"reference,omitempty" protobuf:"varint,4,opt,name=reference"` @@ -310,7 +310,7 @@ type TagEventCondition struct { // Type of tag event condition, currently only ImportSuccess Type TagEventConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=TagEventConditionType"` // Status of the condition, one of True, False, Unknown. - Status kapi.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` + Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` // LastTransitionTIme is the time the condition transitioned from one status to another. LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // Reason is a brief machine readable explanation for the condition's last transition. @@ -458,7 +458,7 @@ type ImageStreamImportStatus struct { // RepositoryImportSpec describes a request to import images from a Docker image repository. type RepositoryImportSpec struct { // From is the source for the image repository to import; only kind DockerImage and a name of a Docker image repository is allowed - From kapi.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` + From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` // ImportPolicy is the policy controlling how the image is imported ImportPolicy TagImportPolicy `json:"importPolicy,omitempty" protobuf:"bytes,2,opt,name=importPolicy"` @@ -482,9 +482,9 @@ type RepositoryImportStatus struct { // ImageImportSpec describes a request to import a specific image. type ImageImportSpec struct { // From is the source of an image to import; only kind DockerImage is allowed - From kapi.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` + From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` // To is a tag in the current image stream to assign the imported image to, if name is not specified the default tag from from.name will be used - To *kapi.LocalObjectReference `json:"to,omitempty" protobuf:"bytes,2,opt,name=to"` + To *corev1.LocalObjectReference `json:"to,omitempty" protobuf:"bytes,2,opt,name=to"` // ImportPolicy is the policy controlling how the image is imported ImportPolicy TagImportPolicy `json:"importPolicy,omitempty" protobuf:"bytes,3,opt,name=importPolicy"` diff --git a/network/v1/types.go b/network/v1/types.go index fef617a331c..9735d5068f5 100644 --- a/network/v1/types.go +++ b/network/v1/types.go @@ -32,8 +32,6 @@ type ClusterNetwork struct { ClusterNetworks []ClusterNetworkEntry `json:"clusterNetworks" protobuf:"bytes,6,rep,name=clusterNetworks"` } -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - // ClusterNetworkEntry defines an individual cluster network. The CIDRs cannot overlap with other cluster network CIDRs, CIDRs reserved for external ips, CIDRs reserved for service networks, and CIDRs reserved for ingress ips. type ClusterNetworkEntry struct { // CIDR defines the total range of a cluster networks address space. @@ -42,6 +40,8 @@ type ClusterNetworkEntry struct { HostSubnetLength uint32 `json:"hostSubnetLength" protobuf:"varint,2,opt,name=hostSubnetLength"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // ClusterNetworkList is a collection of ClusterNetworks type ClusterNetworkList struct { metav1.TypeMeta `json:",inline"` diff --git a/oauth/v1/register.go b/oauth/v1/register.go index 63216ca1f19..a1e97c4d3e6 100644 --- a/oauth/v1/register.go +++ b/oauth/v1/register.go @@ -16,10 +16,10 @@ var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} LegacySchemeGroupVersion = schema.GroupVersion{Group: LegacyGroupName, Version: "v1"} - LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, addConversionFuncs, addLegacyFieldSelectorKeyConversions, RegisterDefaults) + LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes) AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addFieldSelectorKeyConversions, RegisterDefaults) + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) diff --git a/project/v1/register.go b/project/v1/register.go index b89fe3a94f5..07f86689792 100644 --- a/project/v1/register.go +++ b/project/v1/register.go @@ -16,10 +16,10 @@ var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} LegacySchemeGroupVersion = schema.GroupVersion{Group: LegacyGroupName, Version: "v1"} - LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, addConversionFuncs, addLegacyFieldSelectorKeyConversions) + LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes) AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addFieldSelectorKeyConversions) + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) diff --git a/project/v1/types.go b/project/v1/types.go index e871c1b6e6f..33664e1b9f9 100644 --- a/project/v1/types.go +++ b/project/v1/types.go @@ -1,8 +1,8 @@ package v1 import ( + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kapi "k8s.io/kubernetes/pkg/api/v1" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -18,19 +18,19 @@ type ProjectList struct { const ( // These are internal finalizer values to Origin - FinalizerOrigin kapi.FinalizerName = "openshift.io/origin" + FinalizerOrigin corev1.FinalizerName = "openshift.io/origin" ) // ProjectSpec describes the attributes on a Project type ProjectSpec struct { // Finalizers is an opaque list of values that must be empty to permanently remove object from storage - Finalizers []kapi.FinalizerName `json:"finalizers,omitempty" protobuf:"bytes,1,rep,name=finalizers,casttype=k8s.io/kubernetes/pkg/api/v1.FinalizerName"` + Finalizers []corev1.FinalizerName `json:"finalizers,omitempty" protobuf:"bytes,1,rep,name=finalizers,casttype=k8s.io/kubernetes/pkg/api/v1.FinalizerName"` } // ProjectStatus is information about the current status of a Project type ProjectStatus struct { // Phase is the current lifecycle phase of the project - Phase kapi.NamespacePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=k8s.io/kubernetes/pkg/api/v1.NamespacePhase"` + Phase corev1.NamespacePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=k8s.io/kubernetes/pkg/api/v1.NamespacePhase"` } // +genclient diff --git a/quota/v1/types.go b/quota/v1/types.go index d1ff93fa837..50236e0682e 100644 --- a/quota/v1/types.go +++ b/quota/v1/types.go @@ -1,8 +1,8 @@ package v1 import ( + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kapi "k8s.io/kubernetes/pkg/api/v1" ) // +genclient @@ -32,7 +32,7 @@ type ClusterResourceQuotaSpec struct { Selector ClusterResourceQuotaSelector `json:"selector" protobuf:"bytes,1,opt,name=selector"` // Quota defines the desired quota - Quota kapi.ResourceQuotaSpec `json:"quota" protobuf:"bytes,2,opt,name=quota"` + Quota corev1.ResourceQuotaSpec `json:"quota" protobuf:"bytes,2,opt,name=quota"` } // ClusterResourceQuotaSelector is used to select projects. At least one of LabelSelector or AnnotationSelector @@ -49,7 +49,7 @@ type ClusterResourceQuotaSelector struct { // ClusterResourceQuotaStatus defines the actual enforced quota and its current usage type ClusterResourceQuotaStatus struct { // Total defines the actual enforced quota and its current usage across all projects - Total kapi.ResourceQuotaStatus `json:"total" protobuf:"bytes,1,opt,name=total"` + Total corev1.ResourceQuotaStatus `json:"total" protobuf:"bytes,1,opt,name=total"` // Namespaces slices the usage by project. This division allows for quick resolution of // deletion reconciliation inside of a single project without requiring a recalculation @@ -78,7 +78,7 @@ type ResourceQuotaStatusByNamespace struct { Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"` // Status indicates how many resources have been consumed by this project - Status kapi.ResourceQuotaStatus `json:"status" protobuf:"bytes,2,opt,name=status"` + Status corev1.ResourceQuotaStatus `json:"status" protobuf:"bytes,2,opt,name=status"` } // +genclient diff --git a/route/v1/register.go b/route/v1/register.go index 07ef65ef9ad..7257f023586 100644 --- a/route/v1/register.go +++ b/route/v1/register.go @@ -16,10 +16,10 @@ var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} LegacySchemeGroupVersion = schema.GroupVersion{Group: LegacyGroupName, Version: "v1"} - LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, addLegacyFieldSelectorKeyConversions, RegisterDefaults) + LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes) AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addFieldSelectorKeyConversions, RegisterDefaults) + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) diff --git a/route/v1/types.go b/route/v1/types.go index f5dc65d50b7..eac730226b4 100644 --- a/route/v1/types.go +++ b/route/v1/types.go @@ -1,9 +1,9 @@ package v1 import ( + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - kapi "k8s.io/kubernetes/pkg/api/v1" ) // +genclient @@ -160,7 +160,7 @@ type RouteIngressCondition struct { Type RouteIngressConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=RouteIngressConditionType"` // Status is the status of the condition. // Can be True, False, Unknown. - Status kapi.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` + Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` // (brief) reason for the condition's last transition, and is usually a machine and human // readable constant Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` diff --git a/security/v1/register.go b/security/v1/register.go index 3d3cc879fdf..6d13ea41339 100644 --- a/security/v1/register.go +++ b/security/v1/register.go @@ -16,10 +16,10 @@ var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} LegacySchemeGroupVersion = schema.GroupVersion{Group: LegacyGroupName, Version: "v1"} - LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, addConversionFuncs, addDefaultingFuncs) + LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes) AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addDefaultingFuncs) + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) diff --git a/security/v1/types.go b/security/v1/types.go index e2101f2f28f..8f90ce568a0 100644 --- a/security/v1/types.go +++ b/security/v1/types.go @@ -1,14 +1,14 @@ package v1 import ( + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kapi "k8s.io/kubernetes/pkg/api/v1" ) // AllowAllCapabilities can be used as a value for the // SecurityContextConstraints.AllowAllCapabilities field and means that any // capabilities are allowed to be requested. -var AllowAllCapabilities kapi.Capability = "*" +var AllowAllCapabilities corev1.Capability = "*" // +genclient // +genclient:nonNamespaced @@ -35,15 +35,15 @@ type SecurityContextConstraints struct { // DefaultAddCapabilities is the default set of capabilities that will be added to the container // unless the pod spec specifically drops the capability. You may not list a capabiility in both // DefaultAddCapabilities and RequiredDropCapabilities. - DefaultAddCapabilities []kapi.Capability `json:"defaultAddCapabilities" protobuf:"bytes,4,rep,name=defaultAddCapabilities,casttype=Capability"` + DefaultAddCapabilities []corev1.Capability `json:"defaultAddCapabilities" protobuf:"bytes,4,rep,name=defaultAddCapabilities,casttype=Capability"` // RequiredDropCapabilities are the capabilities that will be dropped from the container. These // are required to be dropped and cannot be added. - RequiredDropCapabilities []kapi.Capability `json:"requiredDropCapabilities" protobuf:"bytes,5,rep,name=requiredDropCapabilities,casttype=Capability"` + RequiredDropCapabilities []corev1.Capability `json:"requiredDropCapabilities" protobuf:"bytes,5,rep,name=requiredDropCapabilities,casttype=Capability"` // AllowedCapabilities is a list of capabilities that can be requested to add to the container. // Capabilities in this field maybe added at the pod author's discretion. // You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities. // To allow all capabilities you may use '*'. - AllowedCapabilities []kapi.Capability `json:"allowedCapabilities" protobuf:"bytes,6,rep,name=allowedCapabilities,casttype=Capability"` + AllowedCapabilities []corev1.Capability `json:"allowedCapabilities" protobuf:"bytes,6,rep,name=allowedCapabilities,casttype=Capability"` // AllowHostDirVolumePlugin determines if the policy allow containers to use the HostDir volume plugin // +k8s:conversion-gen=false AllowHostDirVolumePlugin bool `json:"allowHostDirVolumePlugin" protobuf:"varint,7,opt,name=allowHostDirVolumePlugin"` @@ -137,7 +137,7 @@ type SELinuxContextStrategyOptions struct { // Type is the strategy that will dictate what SELinux context is used in the SecurityContext. Type SELinuxContextStrategyType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=SELinuxContextStrategyType"` // seLinuxOptions required to run as; required for MustRunAs - SELinuxOptions *kapi.SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,2,opt,name=seLinuxOptions"` + SELinuxOptions *corev1.SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,2,opt,name=seLinuxOptions"` } // RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. @@ -254,7 +254,7 @@ type PodSecurityPolicySubjectReview struct { type PodSecurityPolicySubjectReviewSpec struct { // template is the PodTemplateSpec to check. If template.spec.serviceAccountName is empty it will not be defaulted. // If its non-empty, it will be checked. - Template kapi.PodTemplateSpec `json:"template" protobuf:"bytes,1,opt,name=template"` + Template corev1.PodTemplateSpec `json:"template" protobuf:"bytes,1,opt,name=template"` // user is the user you're testing for. // If you specify "user" but not "group", then is it interpreted as "What if user were not a member of any groups. @@ -270,7 +270,7 @@ type PodSecurityPolicySubjectReviewStatus struct { // allowedBy is a reference to the rule that allows the PodTemplateSpec. // A rule can be a SecurityContextConstraint or a PodSecurityPolicy // A `nil`, indicates that it was denied. - AllowedBy *kapi.ObjectReference `json:"allowedBy,omitempty" protobuf:"bytes,1,opt,name=allowedBy"` + AllowedBy *corev1.ObjectReference `json:"allowedBy,omitempty" protobuf:"bytes,1,opt,name=allowedBy"` // A machine-readable description of why this operation is in the // "Failure" status. If this value is empty there @@ -278,7 +278,7 @@ type PodSecurityPolicySubjectReviewStatus struct { Reason string `json:"reason,omitempty" protobuf:"bytes,2,opt,name=reason"` // template is the PodTemplateSpec after the defaulting is applied. - Template kapi.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"` + Template corev1.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"` } // +genclient @@ -299,7 +299,7 @@ type PodSecurityPolicySelfSubjectReview struct { // PodSecurityPolicySelfSubjectReviewSpec contains specification for PodSecurityPolicySelfSubjectReview. type PodSecurityPolicySelfSubjectReviewSpec struct { // template is the PodTemplateSpec to check. - Template kapi.PodTemplateSpec `json:"template" protobuf:"bytes,1,opt,name=template"` + Template corev1.PodTemplateSpec `json:"template" protobuf:"bytes,1,opt,name=template"` } // +genclient @@ -323,7 +323,7 @@ type PodSecurityPolicyReviewSpec struct { // if serviceAccountNames is empty, unless the template.spec.serviceAccountName is empty, // in which case "default" is used. // If serviceAccountNames is specified, template.spec.serviceAccountName is ignored. - Template kapi.PodTemplateSpec `json:"template" protobuf:"bytes,1,opt,name=template"` + Template corev1.PodTemplateSpec `json:"template" protobuf:"bytes,1,opt,name=template"` // serviceAccountNames is an optional set of ServiceAccounts to run the check with. // If serviceAccountNames is empty, the template.spec.serviceAccountName is used, diff --git a/template/v1/register.go b/template/v1/register.go index a8f108cf916..da9a7649bc9 100644 --- a/template/v1/register.go +++ b/template/v1/register.go @@ -1,10 +1,10 @@ package v1 import ( + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - kapiv1 "k8s.io/kubernetes/pkg/api/v1" ) const ( @@ -37,7 +37,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &TemplateInstanceList{}, &BrokerTemplateInstance{}, &BrokerTemplateInstanceList{}, - &kapiv1.List{}, + &corev1.List{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/template/v1/types.go b/template/v1/types.go index 7fc3f0bb810..a832c7c73d4 100644 --- a/template/v1/types.go +++ b/template/v1/types.go @@ -3,9 +3,9 @@ package v1 import ( "fmt" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - kapiv1 "k8s.io/kubernetes/pkg/api/v1" ) // +genclient @@ -123,7 +123,7 @@ type TemplateInstanceSpec struct { // secret is a reference to a Secret object containing the necessary // template parameters. - Secret *kapiv1.LocalObjectReference `json:"secret,omitempty" protobuf:"bytes,2,opt,name=secret"` + Secret *corev1.LocalObjectReference `json:"secret,omitempty" protobuf:"bytes,2,opt,name=secret"` // requester holds the identity of the agent requesting the template // instantiation. @@ -173,7 +173,7 @@ type TemplateInstanceCondition struct { // Type of the condition, currently Ready or InstantiateFailure. Type TemplateInstanceConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=TemplateInstanceConditionType"` // Status of the condition, one of True, False or Unknown. - Status kapiv1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status"` + Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status"` // LastTransitionTime is the last time a condition status transitioned from // one state to another. LastTransitionTime metav1.Time `json:"lastTransitionTime" protobuf:"bytes,3,opt,name=lastTransitionTime"` @@ -203,7 +203,7 @@ type TemplateInstanceObject struct { // ref is a reference to the created object. When used under .spec, only // name and namespace are used; these can contain references to parameters // which will be substituted following the usual rules. - Ref kapiv1.ObjectReference `json:"ref,omitempty" protobuf:"bytes,1,opt,name=ref"` + Ref corev1.ObjectReference `json:"ref,omitempty" protobuf:"bytes,1,opt,name=ref"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -237,11 +237,11 @@ type BrokerTemplateInstance struct { type BrokerTemplateInstanceSpec struct { // templateinstance is a reference to a TemplateInstance object residing // in a namespace. - TemplateInstance kapiv1.ObjectReference `json:"templateInstance" protobuf:"bytes,1,opt,name=templateInstance"` + TemplateInstance corev1.ObjectReference `json:"templateInstance" protobuf:"bytes,1,opt,name=templateInstance"` // secret is a reference to a Secret object residing in a namespace, // containing the necessary template parameters. - Secret kapiv1.ObjectReference `json:"secret" protobuf:"bytes,2,opt,name=secret"` + Secret corev1.ObjectReference `json:"secret" protobuf:"bytes,2,opt,name=secret"` // bindingids is a list of 'binding_id's provided during successive bind // calls to the template service broker. diff --git a/user/v1/register.go b/user/v1/register.go index 5f3bdda9fc8..bd431b5c2be 100644 --- a/user/v1/register.go +++ b/user/v1/register.go @@ -16,10 +16,10 @@ var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} LegacySchemeGroupVersion = schema.GroupVersion{Group: LegacyGroupName, Version: "v1"} - LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, addConversionFuncs, addLegacyFieldSelectorKeyConversions) + LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes) AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addFieldSelectorKeyConversions) + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) diff --git a/user/v1/types.go b/user/v1/types.go index cf3759cee7f..6881b1728eb 100644 --- a/user/v1/types.go +++ b/user/v1/types.go @@ -3,8 +3,8 @@ package v1 import ( "fmt" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kapi "k8s.io/kubernetes/pkg/api/v1" ) // +genclient @@ -66,7 +66,7 @@ type Identity struct { // User is a reference to the user this identity is associated with // Both Name and UID must be set - User kapi.ObjectReference `json:"user" protobuf:"bytes,4,opt,name=user"` + User corev1.ObjectReference `json:"user" protobuf:"bytes,4,opt,name=user"` // Extra holds extra information about this identity Extra map[string]string `json:"extra,omitempty" protobuf:"bytes,5,rep,name=extra"` @@ -95,9 +95,9 @@ type UserIdentityMapping struct { metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Identity is a reference to an identity - Identity kapi.ObjectReference `json:"identity,omitempty" protobuf:"bytes,2,opt,name=identity"` + Identity corev1.ObjectReference `json:"identity,omitempty" protobuf:"bytes,2,opt,name=identity"` // User is a reference to a user - User kapi.ObjectReference `json:"user,omitempty" protobuf:"bytes,3,opt,name=user"` + User corev1.ObjectReference `json:"user,omitempty" protobuf:"bytes,3,opt,name=user"` } // OptionalNames is an array that may also be left nil to distinguish between set and unset.