Skip to content

Commit

Permalink
update API types for new dependencies on k8s.io/api
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed Oct 27, 2017
1 parent 951bdbd commit 0518cd9
Show file tree
Hide file tree
Showing 22 changed files with 114 additions and 114 deletions.
6 changes: 3 additions & 3 deletions apps/v1/register.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand All @@ -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
)

Expand Down
20 changes: 10 additions & 10 deletions apps/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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"`
}
Expand Down Expand Up @@ -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"`
Expand All @@ -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.
Expand Down Expand Up @@ -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"`
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions authorization/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
14 changes: 7 additions & 7 deletions authorization/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"`
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"`
}
Expand Down
8 changes: 4 additions & 4 deletions build/v1/register.go
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
)

Expand All @@ -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
Expand Down
Loading

0 comments on commit 0518cd9

Please sign in to comment.