mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
refactor: generated
This commit is contained in:
parent
6536dcfdc2
commit
5df8cc39c9
@ -15,8 +15,8 @@ go_library(
|
|||||||
srcs = ["options.go"],
|
srcs = ["options.go"],
|
||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/apis/componentconfig:go_default_library",
|
"//pkg/apis/componentconfig:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/client/leaderelection:go_default_library",
|
"//pkg/client/leaderelection:go_default_library",
|
||||||
"//pkg/master/ports:go_default_library",
|
"//pkg/master/ports:go_default_library",
|
||||||
"//pkg/util/config:go_default_library",
|
"//pkg/util/config:go_default_library",
|
||||||
|
@ -21,7 +21,7 @@ package options
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||||
"k8s.io/kubernetes/pkg/client/leaderelection"
|
"k8s.io/kubernetes/pkg/client/leaderelection"
|
||||||
"k8s.io/kubernetes/pkg/master/ports"
|
"k8s.io/kubernetes/pkg/master/ports"
|
||||||
@ -57,19 +57,19 @@ func NewCMServer() *CMServer {
|
|||||||
LookupCacheSizeForRC: 4096,
|
LookupCacheSizeForRC: 4096,
|
||||||
LookupCacheSizeForRS: 4096,
|
LookupCacheSizeForRS: 4096,
|
||||||
LookupCacheSizeForDaemonSet: 1024,
|
LookupCacheSizeForDaemonSet: 1024,
|
||||||
ServiceSyncPeriod: unversioned.Duration{Duration: 5 * time.Minute},
|
ServiceSyncPeriod: metav1.Duration{Duration: 5 * time.Minute},
|
||||||
RouteReconciliationPeriod: unversioned.Duration{Duration: 10 * time.Second},
|
RouteReconciliationPeriod: metav1.Duration{Duration: 10 * time.Second},
|
||||||
ResourceQuotaSyncPeriod: unversioned.Duration{Duration: 5 * time.Minute},
|
ResourceQuotaSyncPeriod: metav1.Duration{Duration: 5 * time.Minute},
|
||||||
NamespaceSyncPeriod: unversioned.Duration{Duration: 5 * time.Minute},
|
NamespaceSyncPeriod: metav1.Duration{Duration: 5 * time.Minute},
|
||||||
PVClaimBinderSyncPeriod: unversioned.Duration{Duration: 15 * time.Second},
|
PVClaimBinderSyncPeriod: metav1.Duration{Duration: 15 * time.Second},
|
||||||
HorizontalPodAutoscalerSyncPeriod: unversioned.Duration{Duration: 30 * time.Second},
|
HorizontalPodAutoscalerSyncPeriod: metav1.Duration{Duration: 30 * time.Second},
|
||||||
DeploymentControllerSyncPeriod: unversioned.Duration{Duration: 30 * time.Second},
|
DeploymentControllerSyncPeriod: metav1.Duration{Duration: 30 * time.Second},
|
||||||
MinResyncPeriod: unversioned.Duration{Duration: 12 * time.Hour},
|
MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour},
|
||||||
RegisterRetryCount: 10,
|
RegisterRetryCount: 10,
|
||||||
PodEvictionTimeout: unversioned.Duration{Duration: 5 * time.Minute},
|
PodEvictionTimeout: metav1.Duration{Duration: 5 * time.Minute},
|
||||||
NodeMonitorGracePeriod: unversioned.Duration{Duration: 40 * time.Second},
|
NodeMonitorGracePeriod: metav1.Duration{Duration: 40 * time.Second},
|
||||||
NodeStartupGracePeriod: unversioned.Duration{Duration: 60 * time.Second},
|
NodeStartupGracePeriod: metav1.Duration{Duration: 60 * time.Second},
|
||||||
NodeMonitorPeriod: unversioned.Duration{Duration: 5 * time.Second},
|
NodeMonitorPeriod: metav1.Duration{Duration: 5 * time.Second},
|
||||||
ClusterName: "kubernetes",
|
ClusterName: "kubernetes",
|
||||||
NodeCIDRMaskSize: 24,
|
NodeCIDRMaskSize: 24,
|
||||||
ConfigureCloudRoutes: true,
|
ConfigureCloudRoutes: true,
|
||||||
@ -90,7 +90,7 @@ func NewCMServer() *CMServer {
|
|||||||
KubeAPIQPS: 20.0,
|
KubeAPIQPS: 20.0,
|
||||||
KubeAPIBurst: 30,
|
KubeAPIBurst: 30,
|
||||||
LeaderElection: leaderelection.DefaultLeaderElectionConfiguration(),
|
LeaderElection: leaderelection.DefaultLeaderElectionConfiguration(),
|
||||||
ControllerStartInterval: unversioned.Duration{Duration: 0 * time.Second},
|
ControllerStartInterval: metav1.Duration{Duration: 0 * time.Second},
|
||||||
EnableGarbageCollector: true,
|
EnableGarbageCollector: true,
|
||||||
ConcurrentGCSyncs: 20,
|
ConcurrentGCSyncs: 20,
|
||||||
ClusterSigningCertFile: "/etc/kubernetes/ca/ca.pem",
|
ClusterSigningCertFile: "/etc/kubernetes/ca/ca.pem",
|
||||||
|
@ -21,7 +21,7 @@ go_library(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
],
|
],
|
||||||
|
@ -18,7 +18,7 @@ package kubeadm
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
)
|
)
|
||||||
@ -51,7 +51,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
&ClusterInfo{},
|
&ClusterInfo{},
|
||||||
&api.ListOptions{},
|
&api.ListOptions{},
|
||||||
&api.DeleteOptions{},
|
&api.DeleteOptions{},
|
||||||
&unversioned.ExportOptions{},
|
&metav1.ExportOptions{},
|
||||||
)
|
)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
|
|
||||||
package kubeadm
|
package kubeadm
|
||||||
|
|
||||||
import "k8s.io/kubernetes/pkg/api/unversioned"
|
import ( metav1 "k8s.io/kubernetes/pkg/apis/meta/v1" )
|
||||||
|
|
||||||
type EnvParams struct {
|
type EnvParams struct {
|
||||||
KubernetesDir string
|
KubernetesDir string
|
||||||
@ -30,7 +30,7 @@ type EnvParams struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type MasterConfiguration struct {
|
type MasterConfiguration struct {
|
||||||
unversioned.TypeMeta
|
metav1.TypeMeta
|
||||||
|
|
||||||
Secrets Secrets
|
Secrets Secrets
|
||||||
API API
|
API API
|
||||||
@ -72,7 +72,7 @@ type Secrets struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NodeConfiguration struct {
|
type NodeConfiguration struct {
|
||||||
unversioned.TypeMeta
|
metav1.TypeMeta
|
||||||
|
|
||||||
MasterAddresses []string
|
MasterAddresses []string
|
||||||
Secrets Secrets
|
Secrets Secrets
|
||||||
@ -82,7 +82,7 @@ type NodeConfiguration struct {
|
|||||||
|
|
||||||
// ClusterInfo TODO add description
|
// ClusterInfo TODO add description
|
||||||
type ClusterInfo struct {
|
type ClusterInfo struct {
|
||||||
unversioned.TypeMeta
|
metav1.TypeMeta
|
||||||
// TODO(phase1+) this may become simply `api.Config`
|
// TODO(phase1+) this may become simply `api.Config`
|
||||||
CertificateAuthorities []string `json:"certificateAuthorities"`
|
CertificateAuthorities []string `json:"certificateAuthorities"`
|
||||||
Endpoints []string `json:"endpoints"`
|
Endpoints []string `json:"endpoints"`
|
||||||
|
@ -21,8 +21,8 @@ go_library(
|
|||||||
],
|
],
|
||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
],
|
],
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
@ -51,7 +51,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
&ClusterInfo{},
|
&ClusterInfo{},
|
||||||
&v1.ListOptions{},
|
&v1.ListOptions{},
|
||||||
&v1.DeleteOptions{},
|
&v1.DeleteOptions{},
|
||||||
&unversioned.ExportOptions{},
|
&metav1.ExportOptions{},
|
||||||
)
|
)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -16,10 +16,10 @@ limitations under the License.
|
|||||||
|
|
||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
import "k8s.io/kubernetes/pkg/api/unversioned"
|
import ( metav1 "k8s.io/kubernetes/pkg/apis/meta/v1" )
|
||||||
|
|
||||||
type MasterConfiguration struct {
|
type MasterConfiguration struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
Secrets Secrets `json:"secrets"`
|
Secrets Secrets `json:"secrets"`
|
||||||
API API `json:"api"`
|
API API `json:"api"`
|
||||||
@ -61,7 +61,7 @@ type Secrets struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NodeConfiguration struct {
|
type NodeConfiguration struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
MasterAddresses []string `json:"masterAddresses"`
|
MasterAddresses []string `json:"masterAddresses"`
|
||||||
Secrets Secrets `json:"secrets"`
|
Secrets Secrets `json:"secrets"`
|
||||||
@ -71,7 +71,7 @@ type NodeConfiguration struct {
|
|||||||
|
|
||||||
// ClusterInfo TODO add description
|
// ClusterInfo TODO add description
|
||||||
type ClusterInfo struct {
|
type ClusterInfo struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// TODO(phase1+) this may become simply `api.Config`
|
// TODO(phase1+) this may become simply `api.Config`
|
||||||
CertificateAuthorities []string `json:"certificateAuthorities"`
|
CertificateAuthorities []string `json:"certificateAuthorities"`
|
||||||
Endpoints []string `json:"endpoints"`
|
Endpoints []string `json:"endpoints"`
|
||||||
|
@ -30,9 +30,9 @@ go_library(
|
|||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/errors:go_default_library",
|
"//pkg/api/errors:go_default_library",
|
||||||
"//pkg/api/resource:go_default_library",
|
"//pkg/api/resource:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
"//pkg/apis/extensions/v1beta1:go_default_library",
|
"//pkg/apis/extensions/v1beta1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/client/clientset_generated/release_1_5:go_default_library",
|
"//pkg/client/clientset_generated/release_1_5:go_default_library",
|
||||||
"//pkg/client/unversioned/clientcmd:go_default_library",
|
"//pkg/client/unversioned/clientcmd:go_default_library",
|
||||||
"//pkg/client/unversioned/clientcmd/api:go_default_library",
|
"//pkg/client/unversioned/clientcmd/api:go_default_library",
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"k8s.io/kubernetes/cmd/kubeadm/app/images"
|
"k8s.io/kubernetes/cmd/kubeadm/app/images"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
apierrs "k8s.io/kubernetes/pkg/api/errors"
|
apierrs "k8s.io/kubernetes/pkg/api/errors"
|
||||||
unversionedapi "k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
extensions "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
extensions "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||||
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5"
|
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5"
|
||||||
@ -116,7 +116,7 @@ func NewDaemonSet(daemonName string, podSpec v1.PodSpec) *extensions.DaemonSet {
|
|||||||
return &extensions.DaemonSet{
|
return &extensions.DaemonSet{
|
||||||
ObjectMeta: v1.ObjectMeta{Name: daemonName},
|
ObjectMeta: v1.ObjectMeta{Name: daemonName},
|
||||||
Spec: extensions.DaemonSetSpec{
|
Spec: extensions.DaemonSetSpec{
|
||||||
Selector: &unversionedapi.LabelSelector{MatchLabels: l},
|
Selector: &metav1.LabelSelector{MatchLabels: l},
|
||||||
Template: v1.PodTemplateSpec{
|
Template: v1.PodTemplateSpec{
|
||||||
ObjectMeta: v1.ObjectMeta{Labels: l},
|
ObjectMeta: v1.ObjectMeta{Labels: l},
|
||||||
Spec: podSpec,
|
Spec: podSpec,
|
||||||
@ -142,7 +142,7 @@ func NewDeployment(deploymentName string, replicas int32, podSpec v1.PodSpec) *e
|
|||||||
ObjectMeta: v1.ObjectMeta{Name: deploymentName},
|
ObjectMeta: v1.ObjectMeta{Name: deploymentName},
|
||||||
Spec: extensions.DeploymentSpec{
|
Spec: extensions.DeploymentSpec{
|
||||||
Replicas: &replicas,
|
Replicas: &replicas,
|
||||||
Selector: &unversionedapi.LabelSelector{MatchLabels: l},
|
Selector: &metav1.LabelSelector{MatchLabels: l},
|
||||||
Template: v1.PodTemplateSpec{
|
Template: v1.PodTemplateSpec{
|
||||||
ObjectMeta: v1.ObjectMeta{Labels: l},
|
ObjectMeta: v1.ObjectMeta{Labels: l},
|
||||||
Spec: podSpec,
|
Spec: podSpec,
|
||||||
@ -171,7 +171,7 @@ func attemptToUpdateMasterRoleLabelsAndTaints(client *clientset.Clientset, sched
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
n.ObjectMeta.Labels[unversionedapi.NodeLabelKubeadmAlphaRole] = unversionedapi.NodeLabelRoleMaster
|
n.ObjectMeta.Labels[metav1.NodeLabelKubeadmAlphaRole] = metav1.NodeLabelRoleMaster
|
||||||
|
|
||||||
if !schedulable {
|
if !schedulable {
|
||||||
taintsAnnotation, _ := json.Marshal([]v1.Taint{{Key: "dedicated", Value: "master", Effect: "NoSchedule"}})
|
taintsAnnotation, _ := json.Marshal([]v1.Taint{{Key: "dedicated", Value: "master", Effect: "NoSchedule"}})
|
||||||
@ -225,9 +225,9 @@ func SetNodeAffinity(meta *v1.ObjectMeta, expr ...v1.NodeSelectorRequirement) {
|
|||||||
// MasterNodeAffinity returns v1.NodeSelectorRequirement to be used with SetNodeAffinity to set affinity to master node
|
// MasterNodeAffinity returns v1.NodeSelectorRequirement to be used with SetNodeAffinity to set affinity to master node
|
||||||
func MasterNodeAffinity() v1.NodeSelectorRequirement {
|
func MasterNodeAffinity() v1.NodeSelectorRequirement {
|
||||||
return v1.NodeSelectorRequirement{
|
return v1.NodeSelectorRequirement{
|
||||||
Key: unversionedapi.NodeLabelKubeadmAlphaRole,
|
Key: metav1.NodeLabelKubeadmAlphaRole,
|
||||||
Operator: v1.NodeSelectorOpIn,
|
Operator: v1.NodeSelectorOpIn,
|
||||||
Values: []string{unversionedapi.NodeLabelRoleMaster},
|
Values: []string{metav1.NodeLabelRoleMaster},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ import (
|
|||||||
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
|
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
|
||||||
"k8s.io/kubernetes/cmd/kubeadm/app/images"
|
"k8s.io/kubernetes/cmd/kubeadm/app/images"
|
||||||
"k8s.io/kubernetes/pkg/api/resource"
|
"k8s.io/kubernetes/pkg/api/resource"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
api "k8s.io/kubernetes/pkg/api/v1"
|
api "k8s.io/kubernetes/pkg/api/v1"
|
||||||
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
||||||
"k8s.io/kubernetes/pkg/util/intstr"
|
"k8s.io/kubernetes/pkg/util/intstr"
|
||||||
@ -201,7 +201,7 @@ func componentProbe(port int, path string) *api.Probe {
|
|||||||
|
|
||||||
func componentPod(container api.Container, volumes ...api.Volume) api.Pod {
|
func componentPod(container api.Container, volumes ...api.Volume) api.Pod {
|
||||||
return api.Pod{
|
return api.Pod{
|
||||||
TypeMeta: unversioned.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: "v1",
|
APIVersion: "v1",
|
||||||
Kind: "Pod",
|
Kind: "Pod",
|
||||||
},
|
},
|
||||||
|
@ -45,7 +45,7 @@ go_test(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//cmd/kubeadm/app/apis/kubeadm:go_default_library",
|
"//cmd/kubeadm/app/apis/kubeadm:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/client/clientset_generated/release_1_5:go_default_library",
|
"//pkg/client/clientset_generated/release_1_5:go_default_library",
|
||||||
"//pkg/client/clientset_generated/release_1_5/typed/certificates/v1alpha1:go_default_library",
|
"//pkg/client/clientset_generated/release_1_5/typed/certificates/v1alpha1:go_default_library",
|
||||||
"//pkg/client/restclient:go_default_library",
|
"//pkg/client/restclient:go_default_library",
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
|
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5"
|
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5"
|
||||||
"k8s.io/kubernetes/pkg/client/restclient"
|
"k8s.io/kubernetes/pkg/client/restclient"
|
||||||
"k8s.io/kubernetes/pkg/client/typed/discovery"
|
"k8s.io/kubernetes/pkg/client/typed/discovery"
|
||||||
@ -40,7 +40,7 @@ func TestEstablishMasterConnection(t *testing.T) {
|
|||||||
var obj interface{}
|
var obj interface{}
|
||||||
switch req.URL.Path {
|
switch req.URL.Path {
|
||||||
case "/api":
|
case "/api":
|
||||||
obj = &unversioned.APIVersions{
|
obj = &metav1.APIVersions{
|
||||||
Versions: []string{
|
Versions: []string{
|
||||||
"v1.4",
|
"v1.4",
|
||||||
},
|
},
|
||||||
@ -54,11 +54,11 @@ func TestEstablishMasterConnection(t *testing.T) {
|
|||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
w.Write(output)
|
w.Write(output)
|
||||||
case "/apis":
|
case "/apis":
|
||||||
obj = &unversioned.APIGroupList{
|
obj = &metav1.APIGroupList{
|
||||||
Groups: []unversioned.APIGroup{
|
Groups: []metav1.APIGroup{
|
||||||
{
|
{
|
||||||
Name: "certificates.k8s.io",
|
Name: "certificates.k8s.io",
|
||||||
Versions: []unversioned.GroupVersionForDiscovery{
|
Versions: []metav1.GroupVersionForDiscovery{
|
||||||
{GroupVersion: "extensions/v1beta1"},
|
{GroupVersion: "extensions/v1beta1"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -165,7 +165,7 @@ func TestCheckAPIEndpoint(t *testing.T) {
|
|||||||
var obj interface{}
|
var obj interface{}
|
||||||
switch req.URL.Path {
|
switch req.URL.Path {
|
||||||
case "/api":
|
case "/api":
|
||||||
obj = &unversioned.APIVersions{
|
obj = &metav1.APIVersions{
|
||||||
Versions: []string{
|
Versions: []string{
|
||||||
"v1.4",
|
"v1.4",
|
||||||
},
|
},
|
||||||
@ -196,7 +196,7 @@ func TestCheckAPIEndpoint(t *testing.T) {
|
|||||||
var obj interface{}
|
var obj interface{}
|
||||||
switch req.URL.Path {
|
switch req.URL.Path {
|
||||||
case "/api":
|
case "/api":
|
||||||
obj = &unversioned.APIVersions{
|
obj = &metav1.APIVersions{
|
||||||
Versions: []string{
|
Versions: []string{
|
||||||
"v1.4",
|
"v1.4",
|
||||||
},
|
},
|
||||||
@ -210,11 +210,11 @@ func TestCheckAPIEndpoint(t *testing.T) {
|
|||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
w.Write(output)
|
w.Write(output)
|
||||||
case "/apis":
|
case "/apis":
|
||||||
obj = &unversioned.APIGroupList{
|
obj = &metav1.APIGroupList{
|
||||||
Groups: []unversioned.APIGroup{
|
Groups: []metav1.APIGroup{
|
||||||
{
|
{
|
||||||
Name: "certificates.k8s.io",
|
Name: "certificates.k8s.io",
|
||||||
Versions: []unversioned.GroupVersionForDiscovery{
|
Versions: []metav1.GroupVersionForDiscovery{
|
||||||
{GroupVersion: "extensions/v1beta1"},
|
{GroupVersion: "extensions/v1beta1"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -19,6 +19,6 @@ go_library(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//cmd/kubernetes-discovery/discoverysummarizer/apis/config/v1alpha1:go_default_library",
|
"//cmd/kubernetes-discovery/discoverysummarizer/apis/config/v1alpha1:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -38,6 +38,6 @@ type GroupVersionDiscoveryPath struct {
|
|||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
|
|
||||||
// True if the path is for legacy group version.
|
// True if the path is for legacy group version.
|
||||||
// (i.e the path returns unversioned.APIVersions instead of unversioned.APIGroupList)
|
// (i.e the path returns metav1.APIVersions instead of metav1.APIGroupList)
|
||||||
IsLegacy bool `json:"isLegacy"`
|
IsLegacy bool `json:"isLegacy"`
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
config "k8s.io/kubernetes/cmd/kubernetes-discovery/discoverysummarizer/apis/config/v1alpha1"
|
config "k8s.io/kubernetes/cmd/kubernetes-discovery/discoverysummarizer/apis/config/v1alpha1"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DiscoverySummarizer interface {
|
type DiscoverySummarizer interface {
|
||||||
@ -101,13 +101,13 @@ func (ds *discoverySummarizerServer) indexHandler(w http.ResponseWriter, r *http
|
|||||||
// Handler for group versions summarizer.
|
// Handler for group versions summarizer.
|
||||||
func (ds *discoverySummarizerServer) summarizeGroupVersionsHandler(path string) func(http.ResponseWriter, *http.Request) {
|
func (ds *discoverySummarizerServer) summarizeGroupVersionsHandler(path string) func(http.ResponseWriter, *http.Request) {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
var apiGroupList *unversioned.APIGroupList
|
var apiGroupList *metav1.APIGroupList
|
||||||
// TODO: We can cache calls to all servers.
|
// TODO: We can cache calls to all servers.
|
||||||
groups := make(chan *unversioned.APIGroupList)
|
groups := make(chan *metav1.APIGroupList)
|
||||||
errorChannel := make(chan error)
|
errorChannel := make(chan error)
|
||||||
for _, serverAddress := range ds.groupVersionPaths[path] {
|
for _, serverAddress := range ds.groupVersionPaths[path] {
|
||||||
addr := serverAddress
|
addr := serverAddress
|
||||||
go func(groups chan *unversioned.APIGroupList, error_channel chan error) {
|
go func(groups chan *metav1.APIGroupList, error_channel chan error) {
|
||||||
groupList, err := ds.getAPIGroupList(addr + path)
|
groupList, err := ds.getAPIGroupList(addr + path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorChannel <- err
|
errorChannel <- err
|
||||||
@ -118,13 +118,13 @@ func (ds *discoverySummarizerServer) summarizeGroupVersionsHandler(path string)
|
|||||||
}(groups, errorChannel)
|
}(groups, errorChannel)
|
||||||
}
|
}
|
||||||
|
|
||||||
var groupList *unversioned.APIGroupList
|
var groupList *metav1.APIGroupList
|
||||||
var err error
|
var err error
|
||||||
for range ds.groupVersionPaths[path] {
|
for range ds.groupVersionPaths[path] {
|
||||||
select {
|
select {
|
||||||
case groupList = <-groups:
|
case groupList = <-groups:
|
||||||
if apiGroupList == nil {
|
if apiGroupList == nil {
|
||||||
apiGroupList = &unversioned.APIGroupList{}
|
apiGroupList = &metav1.APIGroupList{}
|
||||||
*apiGroupList = *groupList
|
*apiGroupList = *groupList
|
||||||
} else {
|
} else {
|
||||||
apiGroupList.Groups = append(apiGroupList.Groups, groupList.Groups...)
|
apiGroupList.Groups = append(apiGroupList.Groups, groupList.Groups...)
|
||||||
@ -158,7 +158,7 @@ func (ds *discoverySummarizerServer) summarizeLegacyVersionsHandler(path string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ds *discoverySummarizerServer) getAPIGroupList(serverAddress string) (*unversioned.APIGroupList, error) {
|
func (ds *discoverySummarizerServer) getAPIGroupList(serverAddress string) (*metav1.APIGroupList, error) {
|
||||||
response, err := http.Get(serverAddress)
|
response, err := http.Get(serverAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Error in fetching %s: %v", serverAddress, err)
|
return nil, fmt.Errorf("Error in fetching %s: %v", serverAddress, err)
|
||||||
@ -168,7 +168,7 @@ func (ds *discoverySummarizerServer) getAPIGroupList(serverAddress string) (*unv
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Error reading response from %s: %v", serverAddress, err)
|
return nil, fmt.Errorf("Error reading response from %s: %v", serverAddress, err)
|
||||||
}
|
}
|
||||||
var apiGroupList unversioned.APIGroupList
|
var apiGroupList metav1.APIGroupList
|
||||||
err = json.Unmarshal(contents, &apiGroupList)
|
err = json.Unmarshal(contents, &apiGroupList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Error in unmarshalling response from server %s: %v", serverAddress, err)
|
return nil, fmt.Errorf("Error in unmarshalling response from server %s: %v", serverAddress, err)
|
||||||
@ -176,7 +176,7 @@ func (ds *discoverySummarizerServer) getAPIGroupList(serverAddress string) (*unv
|
|||||||
return &apiGroupList, nil
|
return &apiGroupList, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ds *discoverySummarizerServer) getAPIVersions(serverAddress string) (*unversioned.APIVersions, error) {
|
func (ds *discoverySummarizerServer) getAPIVersions(serverAddress string) (*metav1.APIVersions, error) {
|
||||||
response, err := http.Get(serverAddress)
|
response, err := http.Get(serverAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Error in fetching %s: %v", serverAddress, err)
|
return nil, fmt.Errorf("Error in fetching %s: %v", serverAddress, err)
|
||||||
@ -186,7 +186,7 @@ func (ds *discoverySummarizerServer) getAPIVersions(serverAddress string) (*unve
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Error reading response from %s: %v", serverAddress, err)
|
return nil, fmt.Errorf("Error reading response from %s: %v", serverAddress, err)
|
||||||
}
|
}
|
||||||
var apiVersions unversioned.APIVersions
|
var apiVersions metav1.APIVersions
|
||||||
err = json.Unmarshal(contents, &apiVersions)
|
err = json.Unmarshal(contents, &apiVersions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Error in unmarshalling response from server %s: %v", serverAddress, err)
|
return nil, fmt.Errorf("Error in unmarshalling response from server %s: %v", serverAddress, err)
|
||||||
|
@ -21,7 +21,7 @@ go_library(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
"//pkg/types:go_default_library",
|
"//pkg/types:go_default_library",
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
codec1978 "github.com/ugorji/go/codec"
|
codec1978 "github.com/ugorji/go/codec"
|
||||||
pkg2_api "k8s.io/kubernetes/pkg/api"
|
pkg2_api "k8s.io/kubernetes/pkg/api"
|
||||||
pkg1_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
pkg1_unversioned "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
pkg3_types "k8s.io/kubernetes/pkg/types"
|
pkg3_types "k8s.io/kubernetes/pkg/types"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
@ -18,20 +18,20 @@ package testgroup
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// +genclient=true
|
// +genclient=true
|
||||||
|
|
||||||
type TestType struct {
|
type TestType struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
api.ObjectMeta `json:"metadata,omitempty"`
|
api.ObjectMeta `json:"metadata,omitempty"`
|
||||||
Status TestTypeStatus `json:"status,omitempty"`
|
Status TestTypeStatus `json:"status,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TestTypeList struct {
|
type TestTypeList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []TestType `json:"items"`
|
Items []TestType `json:"items"`
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,8 @@ go_library(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
"//pkg/types:go_default_library",
|
"//pkg/types:go_default_library",
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
@ -41,8 +41,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||||
&v1.ListOptions{},
|
&v1.ListOptions{},
|
||||||
&v1.DeleteOptions{},
|
&v1.DeleteOptions{},
|
||||||
&unversioned.Status{},
|
&metav1.Status{},
|
||||||
&unversioned.ExportOptions{},
|
&metav1.ExportOptions{},
|
||||||
)
|
)
|
||||||
versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
|
versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||||
return nil
|
return nil
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
codec1978 "github.com/ugorji/go/codec"
|
codec1978 "github.com/ugorji/go/codec"
|
||||||
pkg2_api "k8s.io/kubernetes/pkg/api"
|
pkg2_api "k8s.io/kubernetes/pkg/api"
|
||||||
pkg1_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
pkg1_unversioned "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
pkg3_types "k8s.io/kubernetes/pkg/types"
|
pkg3_types "k8s.io/kubernetes/pkg/types"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
@ -18,13 +18,13 @@ package v1
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// +genclient=true
|
// +genclient=true
|
||||||
|
|
||||||
type TestType struct {
|
type TestType struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// ---
|
// ---
|
||||||
// the next tag removes the field from openapi spec. Adding unversioned objectMeta bring in a whole set of
|
// the next tag removes the field from openapi spec. Adding unversioned objectMeta bring in a whole set of
|
||||||
// unversioned objects in the generate file that is not used anywhere other than this test type.
|
// unversioned objects in the generate file that is not used anywhere other than this test type.
|
||||||
@ -36,9 +36,9 @@ type TestType struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TestTypeList struct {
|
type TestTypeList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []TestType `json:"items"`
|
Items []TestType `json:"items"`
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ func New() *Generator {
|
|||||||
`k8s.io/kubernetes/pkg/apis/imagepolicy/v1alpha1`,
|
`k8s.io/kubernetes/pkg/apis/imagepolicy/v1alpha1`,
|
||||||
`k8s.io/kubernetes/pkg/apis/storage/v1beta1`,
|
`k8s.io/kubernetes/pkg/apis/storage/v1beta1`,
|
||||||
}, ","),
|
}, ","),
|
||||||
DropEmbeddedFields: "k8s.io/kubernetes/pkg/api/unversioned.TypeMeta",
|
DropEmbeddedFields: "k8s.io/kubernetes/pkg/apis/meta/v1.TypeMeta",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ go_library(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/fields:go_default_library",
|
"//pkg/fields:go_default_library",
|
||||||
"//pkg/labels:go_default_library",
|
"//pkg/labels:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
func addConversionFuncs(scheme *runtime.Scheme) error {
|
func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||||
// Add non-generated conversion functions
|
// Add non-generated conversion functions
|
||||||
return scheme.AddConversionFuncs(
|
return scheme.AddConversionFuncs(
|
||||||
api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta,
|
api.Convert_v1_TypeMeta_To_v1_TypeMeta,
|
||||||
api.Convert_unversioned_ListMeta_To_unversioned_ListMeta,
|
api.Convert_unversioned_ListMeta_To_unversioned_ListMeta,
|
||||||
api.Convert_intstr_IntOrString_To_intstr_IntOrString,
|
api.Convert_intstr_IntOrString_To_intstr_IntOrString,
|
||||||
api.Convert_unversioned_Time_To_unversioned_Time,
|
api.Convert_unversioned_Time_To_unversioned_Time,
|
||||||
|
@ -18,7 +18,7 @@ package core
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
"k8s.io/kubernetes/pkg/runtime/serializer"
|
"k8s.io/kubernetes/pkg/runtime/serializer"
|
||||||
@ -59,7 +59,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||||
if err := scheme.AddIgnoredConversionType(&unversioned.TypeMeta{}, &unversioned.TypeMeta{}); err != nil {
|
if err := scheme.AddIgnoredConversionType(&metav1.TypeMeta{}, &metav1.TypeMeta{}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||||
@ -79,12 +79,12 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
|
|
||||||
// Register Unversioned types under their own special group
|
// Register Unversioned types under their own special group
|
||||||
scheme.AddUnversionedTypes(Unversioned,
|
scheme.AddUnversionedTypes(Unversioned,
|
||||||
&unversioned.ExportOptions{},
|
&metav1.ExportOptions{},
|
||||||
&unversioned.Status{},
|
&metav1.Status{},
|
||||||
&unversioned.APIVersions{},
|
&metav1.APIVersions{},
|
||||||
&unversioned.APIGroupList{},
|
&metav1.APIGroupList{},
|
||||||
&unversioned.APIGroup{},
|
&metav1.APIGroup{},
|
||||||
&unversioned.APIResourceList{},
|
&metav1.APIResourceList{},
|
||||||
)
|
)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,8 @@ go_library(
|
|||||||
],
|
],
|
||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
"//pkg/watch/versioned:go_default_library",
|
"//pkg/watch/versioned:go_default_library",
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
@ -53,7 +53,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Add common types
|
// Add common types
|
||||||
scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.Status{})
|
scheme.AddKnownTypes(SchemeGroupVersion, &metav1.Status{})
|
||||||
|
|
||||||
// Add the watch version that applies
|
// Add the watch version that applies
|
||||||
versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
|
versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||||
|
@ -22,7 +22,7 @@ go_library(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/conversion:go_default_library",
|
"//pkg/conversion:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
|
@ -37,8 +37,8 @@ go_test(
|
|||||||
"//federation/apis/federation:go_default_library",
|
"//federation/apis/federation:go_default_library",
|
||||||
"//federation/apis/federation/v1beta1:go_default_library",
|
"//federation/apis/federation/v1beta1:go_default_library",
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/apimachinery/registered:go_default_library",
|
"//pkg/apimachinery/registered:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"k8s.io/kubernetes/federation/apis/federation"
|
"k8s.io/kubernetes/federation/apis/federation"
|
||||||
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
)
|
)
|
||||||
@ -38,7 +38,7 @@ func TestResourceVersioner(t *testing.T) {
|
|||||||
t.Errorf("unexpected version %v", version)
|
t.Errorf("unexpected version %v", version)
|
||||||
}
|
}
|
||||||
|
|
||||||
clusterList := federation.ClusterList{ListMeta: unversioned.ListMeta{ResourceVersion: "10"}}
|
clusterList := federation.ClusterList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}}
|
||||||
version, err = accessor.ResourceVersion(&clusterList)
|
version, err = accessor.ResourceVersion(&clusterList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected error: %v", err)
|
t.Fatalf("unexpected error: %v", err)
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
codec1978 "github.com/ugorji/go/codec"
|
codec1978 "github.com/ugorji/go/codec"
|
||||||
pkg1_api "k8s.io/kubernetes/pkg/api"
|
pkg1_api "k8s.io/kubernetes/pkg/api"
|
||||||
pkg2_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
pkg2_unversioned "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
pkg3_types "k8s.io/kubernetes/pkg/types"
|
pkg3_types "k8s.io/kubernetes/pkg/types"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
@ -18,7 +18,7 @@ package federation
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.
|
// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.
|
||||||
@ -64,10 +64,10 @@ type ClusterCondition struct {
|
|||||||
Status api.ConditionStatus `json:"status"`
|
Status api.ConditionStatus `json:"status"`
|
||||||
// Last time the condition was checked.
|
// Last time the condition was checked.
|
||||||
// +optional
|
// +optional
|
||||||
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"`
|
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"`
|
||||||
// Last time the condition transit from one status to another.
|
// Last time the condition transit from one status to another.
|
||||||
// +optional
|
// +optional
|
||||||
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
|
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||||
// (brief) reason for the condition's last transition.
|
// (brief) reason for the condition's last transition.
|
||||||
// +optional
|
// +optional
|
||||||
Reason string `json:"reason,omitempty"`
|
Reason string `json:"reason,omitempty"`
|
||||||
@ -95,7 +95,7 @@ type ClusterStatus struct {
|
|||||||
|
|
||||||
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
|
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
|
||||||
type Cluster struct {
|
type Cluster struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// Standard object's metadata.
|
// Standard object's metadata.
|
||||||
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
|
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
|
||||||
// +optional
|
// +optional
|
||||||
@ -111,11 +111,11 @@ type Cluster struct {
|
|||||||
|
|
||||||
// A list of all the kubernetes clusters registered to the federation
|
// A list of all the kubernetes clusters registered to the federation
|
||||||
type ClusterList struct {
|
type ClusterList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// Standard list metadata.
|
// Standard list metadata.
|
||||||
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
|
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
// List of Cluster objects.
|
// List of Cluster objects.
|
||||||
Items []Cluster `json:"items"`
|
Items []Cluster `json:"items"`
|
||||||
|
@ -28,8 +28,8 @@ go_library(
|
|||||||
deps = [
|
deps = [
|
||||||
"//federation/apis/federation:go_default_library",
|
"//federation/apis/federation:go_default_library",
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/conversion:go_default_library",
|
"//pkg/conversion:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package v1beta1
|
package v1beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
@ -41,7 +41,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
&ClusterList{},
|
&ClusterList{},
|
||||||
&v1.ListOptions{},
|
&v1.ListOptions{},
|
||||||
&v1.DeleteOptions{},
|
&v1.DeleteOptions{},
|
||||||
&unversioned.ExportOptions{},
|
&metav1.ExportOptions{},
|
||||||
)
|
)
|
||||||
versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
|
versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||||
return nil
|
return nil
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
codec1978 "github.com/ugorji/go/codec"
|
codec1978 "github.com/ugorji/go/codec"
|
||||||
pkg2_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
pkg2_unversioned "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
pkg1_v1 "k8s.io/kubernetes/pkg/api/v1"
|
pkg1_v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
pkg3_types "k8s.io/kubernetes/pkg/types"
|
pkg3_types "k8s.io/kubernetes/pkg/types"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package v1beta1
|
package v1beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -64,10 +64,10 @@ type ClusterCondition struct {
|
|||||||
Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"`
|
Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"`
|
||||||
// Last time the condition was checked.
|
// Last time the condition was checked.
|
||||||
// +optional
|
// +optional
|
||||||
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
|
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
|
||||||
// Last time the condition transit from one status to another.
|
// Last time the condition transit from one status to another.
|
||||||
// +optional
|
// +optional
|
||||||
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
|
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
|
||||||
// (brief) reason for the condition's last transition.
|
// (brief) reason for the condition's last transition.
|
||||||
// +optional
|
// +optional
|
||||||
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
|
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
|
||||||
@ -95,7 +95,7 @@ type ClusterStatus struct {
|
|||||||
|
|
||||||
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
|
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
|
||||||
type Cluster struct {
|
type Cluster struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// Standard object's metadata.
|
// Standard object's metadata.
|
||||||
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
|
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
|
||||||
// +optional
|
// +optional
|
||||||
@ -111,11 +111,11 @@ type Cluster struct {
|
|||||||
|
|
||||||
// A list of all the kubernetes clusters registered to the federation
|
// A list of all the kubernetes clusters registered to the federation
|
||||||
type ClusterList struct {
|
type ClusterList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// Standard list metadata.
|
// Standard list metadata.
|
||||||
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
|
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||||
|
|
||||||
// List of Cluster objects.
|
// List of Cluster objects.
|
||||||
Items []Cluster `json:"items" protobuf:"bytes,2,rep,name=items"`
|
Items []Cluster `json:"items" protobuf:"bytes,2,rep,name=items"`
|
||||||
|
2
federation/client/cache/cluster_cache.go
vendored
2
federation/client/cache/cluster_cache.go
vendored
@ -22,7 +22,7 @@ import (
|
|||||||
kubecache "k8s.io/kubernetes/pkg/client/cache"
|
kubecache "k8s.io/kubernetes/pkg/client/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StoreToClusterLister makes a Store have the List method of the unversioned.ClusterInterface
|
// StoreToClusterLister makes a Store have the List method of the metav1.ClusterInterface
|
||||||
// The Store must contain (only) clusters.
|
// The Store must contain (only) clusters.
|
||||||
type StoreToClusterLister struct {
|
type StoreToClusterLister struct {
|
||||||
kubecache.Store
|
kubecache.Store
|
||||||
|
@ -16,8 +16,8 @@ go_library(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//federation/pkg/dnsprovider:go_default_library",
|
"//federation/pkg/dnsprovider:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/apis/componentconfig:go_default_library",
|
"//pkg/apis/componentconfig:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/client/leaderelection:go_default_library",
|
"//pkg/client/leaderelection:go_default_library",
|
||||||
"//vendor:github.com/spf13/pflag",
|
"//vendor:github.com/spf13/pflag",
|
||||||
],
|
],
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
|
|
||||||
"k8s.io/kubernetes/federation/pkg/dnsprovider"
|
"k8s.io/kubernetes/federation/pkg/dnsprovider"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||||
"k8s.io/kubernetes/pkg/client/leaderelection"
|
"k8s.io/kubernetes/pkg/client/leaderelection"
|
||||||
)
|
)
|
||||||
@ -56,7 +56,7 @@ type ControllerManagerConfiguration struct {
|
|||||||
// management, but more CPU (and network) load.
|
// management, but more CPU (and network) load.
|
||||||
ConcurrentReplicaSetSyncs int `json:"concurrentReplicaSetSyncs"`
|
ConcurrentReplicaSetSyncs int `json:"concurrentReplicaSetSyncs"`
|
||||||
// clusterMonitorPeriod is the period for syncing ClusterStatus in cluster controller.
|
// clusterMonitorPeriod is the period for syncing ClusterStatus in cluster controller.
|
||||||
ClusterMonitorPeriod unversioned.Duration `json:"clusterMonitorPeriod"`
|
ClusterMonitorPeriod metav1.Duration `json:"clusterMonitorPeriod"`
|
||||||
// APIServerQPS is the QPS to use while talking with federation apiserver.
|
// APIServerQPS is the QPS to use while talking with federation apiserver.
|
||||||
APIServerQPS float32 `json:"federatedAPIQPS"`
|
APIServerQPS float32 `json:"federatedAPIQPS"`
|
||||||
// APIServerBurst is the burst to use while talking with federation apiserver.
|
// APIServerBurst is the burst to use while talking with federation apiserver.
|
||||||
@ -90,7 +90,7 @@ func NewCMServer() *CMServer {
|
|||||||
Address: "0.0.0.0",
|
Address: "0.0.0.0",
|
||||||
ConcurrentServiceSyncs: 10,
|
ConcurrentServiceSyncs: 10,
|
||||||
ConcurrentReplicaSetSyncs: 10,
|
ConcurrentReplicaSetSyncs: 10,
|
||||||
ClusterMonitorPeriod: unversioned.Duration{Duration: 40 * time.Second},
|
ClusterMonitorPeriod: metav1.Duration{Duration: 40 * time.Second},
|
||||||
APIServerQPS: 20.0,
|
APIServerQPS: 20.0,
|
||||||
APIServerBurst: 30,
|
APIServerBurst: 30,
|
||||||
LeaderElection: leaderelection.DefaultLeaderElectionConfiguration(),
|
LeaderElection: leaderelection.DefaultLeaderElectionConfiguration(),
|
||||||
|
@ -24,8 +24,8 @@ go_library(
|
|||||||
"//federation/client/clientset_generated/federation_release_1_5:go_default_library",
|
"//federation/client/clientset_generated/federation_release_1_5:go_default_library",
|
||||||
"//federation/pkg/federation-controller/util:go_default_library",
|
"//federation/pkg/federation-controller/util:go_default_library",
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/client/cache:go_default_library",
|
"//pkg/client/cache:go_default_library",
|
||||||
"//pkg/client/clientset_generated/internalclientset:go_default_library",
|
"//pkg/client/clientset_generated/internalclientset:go_default_library",
|
||||||
"//pkg/client/restclient:go_default_library",
|
"//pkg/client/restclient:go_default_library",
|
||||||
@ -50,8 +50,8 @@ go_test(
|
|||||||
"//federation/client/clientset_generated/federation_release_1_5:go_default_library",
|
"//federation/client/clientset_generated/federation_release_1_5:go_default_library",
|
||||||
"//federation/pkg/federation-controller/util:go_default_library",
|
"//federation/pkg/federation-controller/util:go_default_library",
|
||||||
"//pkg/api/testapi:go_default_library",
|
"//pkg/api/testapi:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/client/restclient:go_default_library",
|
"//pkg/client/restclient:go_default_library",
|
||||||
"//pkg/client/unversioned/clientcmd:go_default_library",
|
"//pkg/client/unversioned/clientcmd:go_default_library",
|
||||||
"//pkg/client/unversioned/clientcmd/api:go_default_library",
|
"//pkg/client/unversioned/clientcmd/api:go_default_library",
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
federation_v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
federation_v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
|
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
|
||||||
"k8s.io/kubernetes/pkg/client/restclient"
|
"k8s.io/kubernetes/pkg/client/restclient"
|
||||||
@ -66,7 +66,7 @@ func NewClusterClientSet(c *federation_v1beta1.Cluster) (*ClusterClient, error)
|
|||||||
// GetClusterHealthStatus gets the kubernetes cluster health status by requesting "/healthz"
|
// GetClusterHealthStatus gets the kubernetes cluster health status by requesting "/healthz"
|
||||||
func (self *ClusterClient) GetClusterHealthStatus() *federation_v1beta1.ClusterStatus {
|
func (self *ClusterClient) GetClusterHealthStatus() *federation_v1beta1.ClusterStatus {
|
||||||
clusterStatus := federation_v1beta1.ClusterStatus{}
|
clusterStatus := federation_v1beta1.ClusterStatus{}
|
||||||
currentTime := unversioned.Now()
|
currentTime := metav1.Now()
|
||||||
newClusterReadyCondition := federation_v1beta1.ClusterCondition{
|
newClusterReadyCondition := federation_v1beta1.ClusterCondition{
|
||||||
Type: federation_v1beta1.ClusterReady,
|
Type: federation_v1beta1.ClusterReady,
|
||||||
Status: v1.ConditionTrue,
|
Status: v1.ConditionTrue,
|
||||||
@ -120,23 +120,23 @@ func (self *ClusterClient) GetClusterZones() (zones []string, region string, err
|
|||||||
// Find the name of the zone in which a Node is running
|
// Find the name of the zone in which a Node is running
|
||||||
func getZoneNameForNode(node api.Node) (string, error) {
|
func getZoneNameForNode(node api.Node) (string, error) {
|
||||||
for key, value := range node.Labels {
|
for key, value := range node.Labels {
|
||||||
if key == unversioned.LabelZoneFailureDomain {
|
if key == metav1.LabelZoneFailureDomain {
|
||||||
return value, nil
|
return value, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "", fmt.Errorf("Zone name for node %s not found. No label with key %s",
|
return "", fmt.Errorf("Zone name for node %s not found. No label with key %s",
|
||||||
node.Name, unversioned.LabelZoneFailureDomain)
|
node.Name, metav1.LabelZoneFailureDomain)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the name of the region in which a Node is running
|
// Find the name of the region in which a Node is running
|
||||||
func getRegionNameForNode(node api.Node) (string, error) {
|
func getRegionNameForNode(node api.Node) (string, error) {
|
||||||
for key, value := range node.Labels {
|
for key, value := range node.Labels {
|
||||||
if key == unversioned.LabelZoneRegion {
|
if key == metav1.LabelZoneRegion {
|
||||||
return value, nil
|
return value, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "", fmt.Errorf("Region name for node %s not found. No label with key %s",
|
return "", fmt.Errorf("Region name for node %s not found. No label with key %s",
|
||||||
node.Name, unversioned.LabelZoneRegion)
|
node.Name, metav1.LabelZoneRegion)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the names of all zones and the region in which we have nodes in this cluster.
|
// Find the names of all zones and the region in which we have nodes in this cluster.
|
||||||
|
@ -27,7 +27,7 @@ import (
|
|||||||
federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_5"
|
federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_5"
|
||||||
controllerutil "k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
controllerutil "k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
||||||
"k8s.io/kubernetes/pkg/api/testapi"
|
"k8s.io/kubernetes/pkg/api/testapi"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/client/restclient"
|
"k8s.io/kubernetes/pkg/client/restclient"
|
||||||
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
|
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
|
||||||
@ -37,7 +37,7 @@ import (
|
|||||||
|
|
||||||
func newCluster(clusterName string, serverUrl string) *federationv1beta1.Cluster {
|
func newCluster(clusterName string, serverUrl string) *federationv1beta1.Cluster {
|
||||||
cluster := federationv1beta1.Cluster{
|
cluster := federationv1beta1.Cluster{
|
||||||
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()},
|
TypeMeta: metav1.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()},
|
||||||
ObjectMeta: v1.ObjectMeta{
|
ObjectMeta: v1.ObjectMeta{
|
||||||
UID: uuid.NewUUID(),
|
UID: uuid.NewUUID(),
|
||||||
Name: clusterName,
|
Name: clusterName,
|
||||||
@ -56,8 +56,8 @@ func newCluster(clusterName string, serverUrl string) *federationv1beta1.Cluster
|
|||||||
|
|
||||||
func newClusterList(cluster *federationv1beta1.Cluster) *federationv1beta1.ClusterList {
|
func newClusterList(cluster *federationv1beta1.Cluster) *federationv1beta1.ClusterList {
|
||||||
clusterList := federationv1beta1.ClusterList{
|
clusterList := federationv1beta1.ClusterList{
|
||||||
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()},
|
TypeMeta: metav1.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()},
|
||||||
ListMeta: unversioned.ListMeta{
|
ListMeta: metav1.ListMeta{
|
||||||
SelfLink: "foobar",
|
SelfLink: "foobar",
|
||||||
},
|
},
|
||||||
Items: []federationv1beta1.Cluster{},
|
Items: []federationv1beta1.Cluster{},
|
||||||
|
@ -48,9 +48,9 @@ go_test(
|
|||||||
"//federation/pkg/federation-controller/util:go_default_library",
|
"//federation/pkg/federation-controller/util:go_default_library",
|
||||||
"//federation/pkg/federation-controller/util/deletionhelper:go_default_library",
|
"//federation/pkg/federation-controller/util/deletionhelper:go_default_library",
|
||||||
"//federation/pkg/federation-controller/util/test:go_default_library",
|
"//federation/pkg/federation-controller/util/test:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
"//pkg/apis/extensions/v1beta1:go_default_library",
|
"//pkg/apis/extensions/v1beta1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/client/clientset_generated/release_1_5:go_default_library",
|
"//pkg/client/clientset_generated/release_1_5:go_default_library",
|
||||||
"//pkg/client/clientset_generated/release_1_5/fake:go_default_library",
|
"//pkg/client/clientset_generated/release_1_5/fake:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
|
@ -27,7 +27,7 @@ import (
|
|||||||
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
||||||
"k8s.io/kubernetes/federation/pkg/federation-controller/util/deletionhelper"
|
"k8s.io/kubernetes/federation/pkg/federation-controller/util/deletionhelper"
|
||||||
. "k8s.io/kubernetes/federation/pkg/federation-controller/util/test"
|
. "k8s.io/kubernetes/federation/pkg/federation-controller/util/test"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
apiv1 "k8s.io/kubernetes/pkg/api/v1"
|
apiv1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
extensionsv1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
extensionsv1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||||
kubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5"
|
kubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5"
|
||||||
@ -88,7 +88,7 @@ func TestDaemonSetController(t *testing.T) {
|
|||||||
SelfLink: "/api/v1/namespaces/ns/daemonsets/test-daemonset",
|
SelfLink: "/api/v1/namespaces/ns/daemonsets/test-daemonset",
|
||||||
},
|
},
|
||||||
Spec: extensionsv1.DaemonSetSpec{
|
Spec: extensionsv1.DaemonSetSpec{
|
||||||
Selector: &unversioned.LabelSelector{
|
Selector: &metav1.LabelSelector{
|
||||||
MatchLabels: make(map[string]string),
|
MatchLabels: make(map[string]string),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -46,9 +46,9 @@ go_test(
|
|||||||
"//federation/pkg/federation-controller/util:go_default_library",
|
"//federation/pkg/federation-controller/util:go_default_library",
|
||||||
"//federation/pkg/federation-controller/util/deletionhelper:go_default_library",
|
"//federation/pkg/federation-controller/util/deletionhelper:go_default_library",
|
||||||
"//federation/pkg/federation-controller/util/test:go_default_library",
|
"//federation/pkg/federation-controller/util/test:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
"//pkg/apis/extensions/v1beta1:go_default_library",
|
"//pkg/apis/extensions/v1beta1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/client/clientset_generated/release_1_5:go_default_library",
|
"//pkg/client/clientset_generated/release_1_5:go_default_library",
|
||||||
"//pkg/client/clientset_generated/release_1_5/fake:go_default_library",
|
"//pkg/client/clientset_generated/release_1_5/fake:go_default_library",
|
||||||
"//pkg/client/testing/core:go_default_library",
|
"//pkg/client/testing/core:go_default_library",
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
||||||
"k8s.io/kubernetes/federation/pkg/federation-controller/util/deletionhelper"
|
"k8s.io/kubernetes/federation/pkg/federation-controller/util/deletionhelper"
|
||||||
. "k8s.io/kubernetes/federation/pkg/federation-controller/util/test"
|
. "k8s.io/kubernetes/federation/pkg/federation-controller/util/test"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
apiv1 "k8s.io/kubernetes/pkg/api/v1"
|
apiv1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
extensionsv1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
extensionsv1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||||
kubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5"
|
kubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5"
|
||||||
@ -156,7 +156,7 @@ func TestNamespaceController(t *testing.T) {
|
|||||||
// in underlying clusters be as is).
|
// in underlying clusters be as is).
|
||||||
// TODO: Add a test without orphan finalizer.
|
// TODO: Add a test without orphan finalizer.
|
||||||
ns1.ObjectMeta.Finalizers = append(ns1.ObjectMeta.Finalizers, apiv1.FinalizerOrphan)
|
ns1.ObjectMeta.Finalizers = append(ns1.ObjectMeta.Finalizers, apiv1.FinalizerOrphan)
|
||||||
ns1.DeletionTimestamp = &unversioned.Time{Time: time.Now()}
|
ns1.DeletionTimestamp = &metav1.Time{Time: time.Now()}
|
||||||
namespaceWatch.Modify(&ns1)
|
namespaceWatch.Modify(&ns1)
|
||||||
assert.Equal(t, ns1.Name, GetStringFromChan(nsDeleteChan))
|
assert.Equal(t, ns1.Name, GetStringFromChan(nsDeleteChan))
|
||||||
assert.Equal(t, "all", GetStringFromChan(rsDeleteChan))
|
assert.Equal(t, "all", GetStringFromChan(rsDeleteChan))
|
||||||
|
@ -16,8 +16,8 @@ go_library(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//federation/pkg/federation-controller/util:go_default_library",
|
"//federation/pkg/federation-controller/util:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/labels:go_default_library",
|
"//pkg/labels:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@ -29,9 +29,9 @@ go_test(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//federation/pkg/federation-controller/util:go_default_library",
|
"//federation/pkg/federation-controller/util:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
"//pkg/apis/extensions/v1beta1:go_default_library",
|
"//pkg/apis/extensions/v1beta1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//vendor:github.com/stretchr/testify/assert",
|
"//vendor:github.com/stretchr/testify/assert",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
||||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
api_v1 "k8s.io/kubernetes/pkg/api/v1"
|
api_v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/labels"
|
"k8s.io/kubernetes/pkg/labels"
|
||||||
)
|
)
|
||||||
@ -45,8 +45,8 @@ const (
|
|||||||
// A function that calculates how many pods from the list are in one of
|
// A function that calculates how many pods from the list are in one of
|
||||||
// the meaningful (from the replica set perspective) states. This function is
|
// the meaningful (from the replica set perspective) states. This function is
|
||||||
// a temporary workaround against the current lack of ownerRef in pods.
|
// a temporary workaround against the current lack of ownerRef in pods.
|
||||||
func AnalysePods(selectorv1 *unversioned.LabelSelector, allPods []util.FederatedObject, currentTime time.Time) (map[string]PodAnalysisResult, error) {
|
func AnalysePods(selectorv1 *metav1.LabelSelector, allPods []util.FederatedObject, currentTime time.Time) (map[string]PodAnalysisResult, error) {
|
||||||
selector, err := unversioned.LabelSelectorAsSelector(selectorv1)
|
selector, err := metav1.LabelSelectorAsSelector(selectorv1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("invalid selector: %v", err)
|
return nil, fmt.Errorf("invalid selector: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
api_v1 "k8s.io/kubernetes/pkg/api/v1"
|
api_v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ func TestAnalyze(t *testing.T) {
|
|||||||
Type: api_v1.PodScheduled,
|
Type: api_v1.PodScheduled,
|
||||||
Status: api_v1.ConditionFalse,
|
Status: api_v1.ConditionFalse,
|
||||||
Reason: "Unschedulable",
|
Reason: "Unschedulable",
|
||||||
LastTransitionTime: unversioned.Time{Time: now.Add(-10 * time.Minute)},
|
LastTransitionTime: metav1.Time{Time: now.Add(-10 * time.Minute)},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -101,7 +101,7 @@ func newReplicaSet(selectorMap map[string]string) *v1beta1.ReplicaSet {
|
|||||||
},
|
},
|
||||||
Spec: v1beta1.ReplicaSetSpec{
|
Spec: v1beta1.ReplicaSetSpec{
|
||||||
Replicas: &replicas,
|
Replicas: &replicas,
|
||||||
Selector: &unversioned.LabelSelector{MatchLabels: selectorMap},
|
Selector: &metav1.LabelSelector{MatchLabels: selectorMap},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return rs
|
return rs
|
||||||
|
@ -55,8 +55,8 @@ go_test(
|
|||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/errors:go_default_library",
|
"//pkg/api/errors:go_default_library",
|
||||||
"//pkg/api/testapi:go_default_library",
|
"//pkg/api/testapi:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/client/restclient/fake:go_default_library",
|
"//pkg/client/restclient/fake:go_default_library",
|
||||||
"//pkg/client/typed/dynamic:go_default_library",
|
"//pkg/client/typed/dynamic:go_default_library",
|
||||||
"//pkg/client/unversioned/clientcmd:go_default_library",
|
"//pkg/client/unversioned/clientcmd:go_default_library",
|
||||||
|
@ -46,9 +46,9 @@ go_test(
|
|||||||
"//pkg/api/errors:go_default_library",
|
"//pkg/api/errors:go_default_library",
|
||||||
"//pkg/api/resource:go_default_library",
|
"//pkg/api/resource:go_default_library",
|
||||||
"//pkg/api/testapi:go_default_library",
|
"//pkg/api/testapi:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
"//pkg/apis/extensions/v1beta1:go_default_library",
|
"//pkg/apis/extensions/v1beta1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/client/restclient/fake:go_default_library",
|
"//pkg/client/restclient/fake:go_default_library",
|
||||||
"//pkg/client/typed/dynamic:go_default_library",
|
"//pkg/client/typed/dynamic:go_default_library",
|
||||||
"//pkg/client/unversioned/clientcmd:go_default_library",
|
"//pkg/client/unversioned/clientcmd:go_default_library",
|
||||||
|
@ -37,7 +37,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/api/errors"
|
"k8s.io/kubernetes/pkg/api/errors"
|
||||||
"k8s.io/kubernetes/pkg/api/resource"
|
"k8s.io/kubernetes/pkg/api/resource"
|
||||||
"k8s.io/kubernetes/pkg/api/testapi"
|
"k8s.io/kubernetes/pkg/api/testapi"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||||
"k8s.io/kubernetes/pkg/client/restclient/fake"
|
"k8s.io/kubernetes/pkg/client/restclient/fake"
|
||||||
@ -405,7 +405,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
|
|||||||
replicas := int32(1)
|
replicas := int32(1)
|
||||||
|
|
||||||
namespace := v1.Namespace{
|
namespace := v1.Namespace{
|
||||||
TypeMeta: unversioned.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "Namespace",
|
Kind: "Namespace",
|
||||||
APIVersion: testapi.Default.GroupVersion().String(),
|
APIVersion: testapi.Default.GroupVersion().String(),
|
||||||
},
|
},
|
||||||
@ -415,7 +415,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
svc := v1.Service{
|
svc := v1.Service{
|
||||||
TypeMeta: unversioned.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "Service",
|
Kind: "Service",
|
||||||
APIVersion: testapi.Default.GroupVersion().String(),
|
APIVersion: testapi.Default.GroupVersion().String(),
|
||||||
},
|
},
|
||||||
@ -450,7 +450,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
credSecret := v1.Secret{
|
credSecret := v1.Secret{
|
||||||
TypeMeta: unversioned.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "Secret",
|
Kind: "Secret",
|
||||||
APIVersion: testapi.Default.GroupVersion().String(),
|
APIVersion: testapi.Default.GroupVersion().String(),
|
||||||
},
|
},
|
||||||
@ -462,7 +462,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmKubeconfigSecret := v1.Secret{
|
cmKubeconfigSecret := v1.Secret{
|
||||||
TypeMeta: unversioned.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "Secret",
|
Kind: "Secret",
|
||||||
APIVersion: testapi.Default.GroupVersion().String(),
|
APIVersion: testapi.Default.GroupVersion().String(),
|
||||||
},
|
},
|
||||||
@ -474,7 +474,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
pvc := v1.PersistentVolumeClaim{
|
pvc := v1.PersistentVolumeClaim{
|
||||||
TypeMeta: unversioned.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "PersistentVolumeClaim",
|
Kind: "PersistentVolumeClaim",
|
||||||
APIVersion: testapi.Default.GroupVersion().String(),
|
APIVersion: testapi.Default.GroupVersion().String(),
|
||||||
},
|
},
|
||||||
@ -499,7 +499,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
apiserver := v1beta1.Deployment{
|
apiserver := v1beta1.Deployment{
|
||||||
TypeMeta: unversioned.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "Deployment",
|
Kind: "Deployment",
|
||||||
APIVersion: testapi.Extensions.GroupVersion().String(),
|
APIVersion: testapi.Extensions.GroupVersion().String(),
|
||||||
},
|
},
|
||||||
@ -592,7 +592,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
|
|||||||
|
|
||||||
cmName := federationName + "-controller-manager"
|
cmName := federationName + "-controller-manager"
|
||||||
cm := v1beta1.Deployment{
|
cm := v1beta1.Deployment{
|
||||||
TypeMeta: unversioned.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "Deployment",
|
Kind: "Deployment",
|
||||||
APIVersion: testapi.Extensions.GroupVersion().String(),
|
APIVersion: testapi.Extensions.GroupVersion().String(),
|
||||||
},
|
},
|
||||||
|
@ -29,7 +29,7 @@ import (
|
|||||||
"k8s.io/kubernetes/federation/pkg/kubefed/util"
|
"k8s.io/kubernetes/federation/pkg/kubefed/util"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/testapi"
|
"k8s.io/kubernetes/pkg/api/testapi"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/client/restclient/fake"
|
"k8s.io/kubernetes/pkg/client/restclient/fake"
|
||||||
"k8s.io/kubernetes/pkg/client/typed/dynamic"
|
"k8s.io/kubernetes/pkg/client/typed/dynamic"
|
||||||
@ -233,7 +233,7 @@ func fakeJoinHostFactory(clusterName, clusterCtx, secretName, server, token stri
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
secretObject := v1.Secret{
|
secretObject := v1.Secret{
|
||||||
TypeMeta: unversioned.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "Secret",
|
Kind: "Secret",
|
||||||
APIVersion: "v1",
|
APIVersion: "v1",
|
||||||
},
|
},
|
||||||
|
@ -28,7 +28,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/errors"
|
"k8s.io/kubernetes/pkg/api/errors"
|
||||||
"k8s.io/kubernetes/pkg/api/testapi"
|
"k8s.io/kubernetes/pkg/api/testapi"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/client/restclient/fake"
|
"k8s.io/kubernetes/pkg/client/restclient/fake"
|
||||||
"k8s.io/kubernetes/pkg/client/typed/dynamic"
|
"k8s.io/kubernetes/pkg/client/typed/dynamic"
|
||||||
cmdtesting "k8s.io/kubernetes/pkg/kubectl/cmd/testing"
|
cmdtesting "k8s.io/kubernetes/pkg/kubectl/cmd/testing"
|
||||||
@ -183,7 +183,7 @@ func testUnjoinFederationFactory(name, server, secret string) cmdutil.Factory {
|
|||||||
case http.MethodGet:
|
case http.MethodGet:
|
||||||
return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &cluster)}, nil
|
return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &cluster)}, nil
|
||||||
case http.MethodDelete:
|
case http.MethodDelete:
|
||||||
status := unversioned.Status{
|
status := metav1.Status{
|
||||||
Status: "Success",
|
Status: "Success",
|
||||||
}
|
}
|
||||||
return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &status)}, nil
|
return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &status)}, nil
|
||||||
@ -213,7 +213,7 @@ func fakeUnjoinHostFactory(name string) cmdutil.Factory {
|
|||||||
if got != name {
|
if got != name {
|
||||||
return nil, errors.NewNotFound(api.Resource("secrets"), got)
|
return nil, errors.NewNotFound(api.Resource("secrets"), got)
|
||||||
}
|
}
|
||||||
status := unversioned.Status{
|
status := metav1.Status{
|
||||||
Status: "Success",
|
Status: "Success",
|
||||||
}
|
}
|
||||||
return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &status)}, nil
|
return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &status)}, nil
|
||||||
|
@ -35,7 +35,7 @@ go_library(
|
|||||||
"//pkg/api/meta:go_default_library",
|
"//pkg/api/meta:go_default_library",
|
||||||
"//pkg/api/meta/metatypes:go_default_library",
|
"//pkg/api/meta/metatypes:go_default_library",
|
||||||
"//pkg/api/resource:go_default_library",
|
"//pkg/api/resource:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/auth/user:go_default_library",
|
"//pkg/auth/user:go_default_library",
|
||||||
"//pkg/conversion:go_default_library",
|
"//pkg/conversion:go_default_library",
|
||||||
"//pkg/fields:go_default_library",
|
"//pkg/fields:go_default_library",
|
||||||
@ -70,7 +70,7 @@ go_test(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api/resource:go_default_library",
|
"//pkg/api/resource:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/labels:go_default_library",
|
"//pkg/labels:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
@ -96,12 +96,12 @@ go_test(
|
|||||||
"//pkg/api/meta/metatypes:go_default_library",
|
"//pkg/api/meta/metatypes:go_default_library",
|
||||||
"//pkg/api/testapi:go_default_library",
|
"//pkg/api/testapi:go_default_library",
|
||||||
"//pkg/api/testing:go_default_library",
|
"//pkg/api/testing:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
"//pkg/apimachinery/registered:go_default_library",
|
"//pkg/apimachinery/registered:go_default_library",
|
||||||
"//pkg/apis/batch/v2alpha1:go_default_library",
|
"//pkg/apis/batch/v2alpha1:go_default_library",
|
||||||
"//pkg/apis/extensions:go_default_library",
|
"//pkg/apis/extensions:go_default_library",
|
||||||
"//pkg/apis/extensions/v1beta1:go_default_library",
|
"//pkg/apis/extensions/v1beta1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/conversion:go_default_library",
|
"//pkg/conversion:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api/resource"
|
"k8s.io/kubernetes/pkg/api/resource"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/conversion"
|
"k8s.io/kubernetes/pkg/conversion"
|
||||||
"k8s.io/kubernetes/pkg/fields"
|
"k8s.io/kubernetes/pkg/fields"
|
||||||
"k8s.io/kubernetes/pkg/labels"
|
"k8s.io/kubernetes/pkg/labels"
|
||||||
@ -32,7 +32,7 @@ import (
|
|||||||
|
|
||||||
func addConversionFuncs(scheme *runtime.Scheme) error {
|
func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||||
return scheme.AddConversionFuncs(
|
return scheme.AddConversionFuncs(
|
||||||
Convert_unversioned_TypeMeta_To_unversioned_TypeMeta,
|
Convert_v1_TypeMeta_To_v1_TypeMeta,
|
||||||
|
|
||||||
Convert_unversioned_ListMeta_To_unversioned_ListMeta,
|
Convert_unversioned_ListMeta_To_unversioned_ListMeta,
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ func Convert_bool_To_Pointer_bool(in *bool, out **bool, s conversion.Scope) erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
// +k8s:conversion-fn=drop
|
// +k8s:conversion-fn=drop
|
||||||
func Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(in, out *unversioned.TypeMeta, s conversion.Scope) error {
|
func Convert_v1_TypeMeta_To_v1_TypeMeta(in, out *metav1.TypeMeta, s conversion.Scope) error {
|
||||||
// These values are explicitly not copied
|
// These values are explicitly not copied
|
||||||
//out.APIVersion = in.APIVersion
|
//out.APIVersion = in.APIVersion
|
||||||
//out.Kind = in.Kind
|
//out.Kind = in.Kind
|
||||||
@ -162,7 +162,7 @@ func Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(in, out *unversioned.T
|
|||||||
}
|
}
|
||||||
|
|
||||||
// +k8s:conversion-fn=copy-only
|
// +k8s:conversion-fn=copy-only
|
||||||
func Convert_unversioned_ListMeta_To_unversioned_ListMeta(in, out *unversioned.ListMeta, s conversion.Scope) error {
|
func Convert_unversioned_ListMeta_To_unversioned_ListMeta(in, out *metav1.ListMeta, s conversion.Scope) error {
|
||||||
*out = *in
|
*out = *in
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -174,14 +174,14 @@ func Convert_intstr_IntOrString_To_intstr_IntOrString(in, out *intstr.IntOrStrin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// +k8s:conversion-fn=copy-only
|
// +k8s:conversion-fn=copy-only
|
||||||
func Convert_unversioned_Time_To_unversioned_Time(in *unversioned.Time, out *unversioned.Time, s conversion.Scope) error {
|
func Convert_unversioned_Time_To_unversioned_Time(in *metav1.Time, out *metav1.Time, s conversion.Scope) error {
|
||||||
// Cannot deep copy these, because time.Time has unexported fields.
|
// Cannot deep copy these, because time.Time has unexported fields.
|
||||||
*out = *in
|
*out = *in
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert_Slice_string_To_unversioned_Time allows converting a URL query parameter value
|
// Convert_Slice_string_To_unversioned_Time allows converting a URL query parameter value
|
||||||
func Convert_Slice_string_To_unversioned_Time(input *[]string, out *unversioned.Time, s conversion.Scope) error {
|
func Convert_Slice_string_To_unversioned_Time(input *[]string, out *metav1.Time, s conversion.Scope) error {
|
||||||
str := ""
|
str := ""
|
||||||
if len(*input) > 0 {
|
if len(*input) > 0 {
|
||||||
str = (*input)[0]
|
str = (*input)[0]
|
||||||
@ -229,20 +229,20 @@ func Convert_resource_Quantity_To_resource_Quantity(in *resource.Quantity, out *
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_map_to_unversioned_LabelSelector(in *map[string]string, out *unversioned.LabelSelector, s conversion.Scope) error {
|
func Convert_map_to_unversioned_LabelSelector(in *map[string]string, out *metav1.LabelSelector, s conversion.Scope) error {
|
||||||
if in == nil {
|
if in == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
out = new(unversioned.LabelSelector)
|
out = new(metav1.LabelSelector)
|
||||||
for labelKey, labelValue := range *in {
|
for labelKey, labelValue := range *in {
|
||||||
utillabels.AddLabelToSelector(out, labelKey, labelValue)
|
utillabels.AddLabelToSelector(out, labelKey, labelValue)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_unversioned_LabelSelector_to_map(in *unversioned.LabelSelector, out *map[string]string, s conversion.Scope) error {
|
func Convert_unversioned_LabelSelector_to_map(in *metav1.LabelSelector, out *map[string]string, s conversion.Scope) error {
|
||||||
var err error
|
var err error
|
||||||
*out, err = unversioned.LabelSelectorAsMap(in)
|
*out, err = metav1.LabelSelectorAsMap(in)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = field.Invalid(field.NewPath("labelSelector"), *in, fmt.Sprintf("cannot convert to old selector: %v", err))
|
err = field.Invalid(field.NewPath("labelSelector"), *in, fmt.Sprintf("cannot convert to old selector: %v", err))
|
||||||
}
|
}
|
||||||
|
@ -23,21 +23,21 @@ import (
|
|||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/testapi"
|
"k8s.io/kubernetes/pkg/api/testapi"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/types"
|
"k8s.io/kubernetes/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func parseTimeOrDie(ts string) unversioned.Time {
|
func parseTimeOrDie(ts string) metav1.Time {
|
||||||
t, err := time.Parse(time.RFC3339, ts)
|
t, err := time.Parse(time.RFC3339, ts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
return unversioned.Time{Time: t}
|
return metav1.Time{Time: t}
|
||||||
}
|
}
|
||||||
|
|
||||||
var benchmarkPod api.Pod = api.Pod{
|
var benchmarkPod api.Pod = api.Pod{
|
||||||
TypeMeta: unversioned.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "Pod",
|
Kind: "Pod",
|
||||||
APIVersion: "v1",
|
APIVersion: "v1",
|
||||||
},
|
},
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"github.com/google/gofuzz"
|
"github.com/google/gofuzz"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
apiv1 "k8s.io/kubernetes/pkg/api/v1"
|
apiv1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
batchv2alpha1 "k8s.io/kubernetes/pkg/apis/batch/v2alpha1"
|
batchv2alpha1 "k8s.io/kubernetes/pkg/apis/batch/v2alpha1"
|
||||||
extensionsv1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
extensionsv1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||||
@ -117,7 +117,7 @@ func TestDefaulting(t *testing.T) {
|
|||||||
f := fuzz.New().NilChance(.5).NumElements(1, 1).RandSource(rand.NewSource(1))
|
f := fuzz.New().NilChance(.5).NumElements(1, 1).RandSource(rand.NewSource(1))
|
||||||
f.Funcs(
|
f.Funcs(
|
||||||
func(s *runtime.RawExtension, c fuzz.Continue) {},
|
func(s *runtime.RawExtension, c fuzz.Continue) {},
|
||||||
func(s *unversioned.LabelSelector, c fuzz.Continue) {
|
func(s *metav1.LabelSelector, c fuzz.Continue) {
|
||||||
c.FuzzNoCustom(s)
|
c.FuzzNoCustom(s)
|
||||||
s.MatchExpressions = nil // need to fuzz this specially
|
s.MatchExpressions = nil // need to fuzz this specially
|
||||||
},
|
},
|
||||||
|
@ -18,7 +18,7 @@ go_library(
|
|||||||
],
|
],
|
||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
"//pkg/util/validation/field:go_default_library",
|
"//pkg/util/validation/field:go_default_library",
|
||||||
@ -32,7 +32,7 @@ go_test(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
"//pkg/util/validation/field:go_default_library",
|
"//pkg/util/validation/field:go_default_library",
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
"k8s.io/kubernetes/pkg/util/validation/field"
|
"k8s.io/kubernetes/pkg/util/validation/field"
|
||||||
@ -41,13 +41,13 @@ const (
|
|||||||
// StatusError is an error intended for consumption by a REST API server; it can also be
|
// StatusError is an error intended for consumption by a REST API server; it can also be
|
||||||
// reconstructed by clients from a REST response. Public to allow easy type switches.
|
// reconstructed by clients from a REST response. Public to allow easy type switches.
|
||||||
type StatusError struct {
|
type StatusError struct {
|
||||||
ErrStatus unversioned.Status
|
ErrStatus metav1.Status
|
||||||
}
|
}
|
||||||
|
|
||||||
// APIStatus is exposed by errors that can be converted to an api.Status object
|
// APIStatus is exposed by errors that can be converted to an api.Status object
|
||||||
// for finer grained details.
|
// for finer grained details.
|
||||||
type APIStatus interface {
|
type APIStatus interface {
|
||||||
Status() unversioned.Status
|
Status() metav1.Status
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ error = &StatusError{}
|
var _ error = &StatusError{}
|
||||||
@ -59,7 +59,7 @@ func (e *StatusError) Error() string {
|
|||||||
|
|
||||||
// Status allows access to e's status without having to know the detailed workings
|
// Status allows access to e's status without having to know the detailed workings
|
||||||
// of StatusError. Used by pkg/apiserver.
|
// of StatusError. Used by pkg/apiserver.
|
||||||
func (e *StatusError) Status() unversioned.Status {
|
func (e *StatusError) Status() metav1.Status {
|
||||||
return e.ErrStatus
|
return e.ErrStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,11 +81,11 @@ func (u *UnexpectedObjectError) Error() string {
|
|||||||
return fmt.Sprintf("unexpected object: %v", u.Object)
|
return fmt.Sprintf("unexpected object: %v", u.Object)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FromObject generates an StatusError from an unversioned.Status, if that is the type of obj; otherwise,
|
// FromObject generates an StatusError from an metav1.Status, if that is the type of obj; otherwise,
|
||||||
// returns an UnexpecteObjectError.
|
// returns an UnexpecteObjectError.
|
||||||
func FromObject(obj runtime.Object) error {
|
func FromObject(obj runtime.Object) error {
|
||||||
switch t := obj.(type) {
|
switch t := obj.(type) {
|
||||||
case *unversioned.Status:
|
case *metav1.Status:
|
||||||
return &StatusError{*t}
|
return &StatusError{*t}
|
||||||
}
|
}
|
||||||
return &UnexpectedObjectError{obj}
|
return &UnexpectedObjectError{obj}
|
||||||
@ -93,11 +93,11 @@ func FromObject(obj runtime.Object) error {
|
|||||||
|
|
||||||
// NewNotFound returns a new error which indicates that the resource of the kind and the name was not found.
|
// NewNotFound returns a new error which indicates that the resource of the kind and the name was not found.
|
||||||
func NewNotFound(qualifiedResource schema.GroupResource, name string) *StatusError {
|
func NewNotFound(qualifiedResource schema.GroupResource, name string) *StatusError {
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: http.StatusNotFound,
|
Code: http.StatusNotFound,
|
||||||
Reason: unversioned.StatusReasonNotFound,
|
Reason: metav1.StatusReasonNotFound,
|
||||||
Details: &unversioned.StatusDetails{
|
Details: &metav1.StatusDetails{
|
||||||
Group: qualifiedResource.Group,
|
Group: qualifiedResource.Group,
|
||||||
Kind: qualifiedResource.Resource,
|
Kind: qualifiedResource.Resource,
|
||||||
Name: name,
|
Name: name,
|
||||||
@ -108,11 +108,11 @@ func NewNotFound(qualifiedResource schema.GroupResource, name string) *StatusErr
|
|||||||
|
|
||||||
// NewAlreadyExists returns an error indicating the item requested exists by that identifier.
|
// NewAlreadyExists returns an error indicating the item requested exists by that identifier.
|
||||||
func NewAlreadyExists(qualifiedResource schema.GroupResource, name string) *StatusError {
|
func NewAlreadyExists(qualifiedResource schema.GroupResource, name string) *StatusError {
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: http.StatusConflict,
|
Code: http.StatusConflict,
|
||||||
Reason: unversioned.StatusReasonAlreadyExists,
|
Reason: metav1.StatusReasonAlreadyExists,
|
||||||
Details: &unversioned.StatusDetails{
|
Details: &metav1.StatusDetails{
|
||||||
Group: qualifiedResource.Group,
|
Group: qualifiedResource.Group,
|
||||||
Kind: qualifiedResource.Resource,
|
Kind: qualifiedResource.Resource,
|
||||||
Name: name,
|
Name: name,
|
||||||
@ -128,21 +128,21 @@ func NewUnauthorized(reason string) *StatusError {
|
|||||||
if len(message) == 0 {
|
if len(message) == 0 {
|
||||||
message = "not authorized"
|
message = "not authorized"
|
||||||
}
|
}
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: http.StatusUnauthorized,
|
Code: http.StatusUnauthorized,
|
||||||
Reason: unversioned.StatusReasonUnauthorized,
|
Reason: metav1.StatusReasonUnauthorized,
|
||||||
Message: message,
|
Message: message,
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewForbidden returns an error indicating the requested action was forbidden
|
// NewForbidden returns an error indicating the requested action was forbidden
|
||||||
func NewForbidden(qualifiedResource schema.GroupResource, name string, err error) *StatusError {
|
func NewForbidden(qualifiedResource schema.GroupResource, name string, err error) *StatusError {
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: http.StatusForbidden,
|
Code: http.StatusForbidden,
|
||||||
Reason: unversioned.StatusReasonForbidden,
|
Reason: metav1.StatusReasonForbidden,
|
||||||
Details: &unversioned.StatusDetails{
|
Details: &metav1.StatusDetails{
|
||||||
Group: qualifiedResource.Group,
|
Group: qualifiedResource.Group,
|
||||||
Kind: qualifiedResource.Resource,
|
Kind: qualifiedResource.Resource,
|
||||||
Name: name,
|
Name: name,
|
||||||
@ -153,11 +153,11 @@ func NewForbidden(qualifiedResource schema.GroupResource, name string, err error
|
|||||||
|
|
||||||
// NewConflict returns an error indicating the item can't be updated as provided.
|
// NewConflict returns an error indicating the item can't be updated as provided.
|
||||||
func NewConflict(qualifiedResource schema.GroupResource, name string, err error) *StatusError {
|
func NewConflict(qualifiedResource schema.GroupResource, name string, err error) *StatusError {
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: http.StatusConflict,
|
Code: http.StatusConflict,
|
||||||
Reason: unversioned.StatusReasonConflict,
|
Reason: metav1.StatusReasonConflict,
|
||||||
Details: &unversioned.StatusDetails{
|
Details: &metav1.StatusDetails{
|
||||||
Group: qualifiedResource.Group,
|
Group: qualifiedResource.Group,
|
||||||
Kind: qualifiedResource.Resource,
|
Kind: qualifiedResource.Resource,
|
||||||
Name: name,
|
Name: name,
|
||||||
@ -168,30 +168,30 @@ func NewConflict(qualifiedResource schema.GroupResource, name string, err error)
|
|||||||
|
|
||||||
// NewGone returns an error indicating the item no longer available at the server and no forwarding address is known.
|
// NewGone returns an error indicating the item no longer available at the server and no forwarding address is known.
|
||||||
func NewGone(message string) *StatusError {
|
func NewGone(message string) *StatusError {
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: http.StatusGone,
|
Code: http.StatusGone,
|
||||||
Reason: unversioned.StatusReasonGone,
|
Reason: metav1.StatusReasonGone,
|
||||||
Message: message,
|
Message: message,
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewInvalid returns an error indicating the item is invalid and cannot be processed.
|
// NewInvalid returns an error indicating the item is invalid and cannot be processed.
|
||||||
func NewInvalid(qualifiedKind schema.GroupKind, name string, errs field.ErrorList) *StatusError {
|
func NewInvalid(qualifiedKind schema.GroupKind, name string, errs field.ErrorList) *StatusError {
|
||||||
causes := make([]unversioned.StatusCause, 0, len(errs))
|
causes := make([]metav1.StatusCause, 0, len(errs))
|
||||||
for i := range errs {
|
for i := range errs {
|
||||||
err := errs[i]
|
err := errs[i]
|
||||||
causes = append(causes, unversioned.StatusCause{
|
causes = append(causes, metav1.StatusCause{
|
||||||
Type: unversioned.CauseType(err.Type),
|
Type: metav1.CauseType(err.Type),
|
||||||
Message: err.ErrorBody(),
|
Message: err.ErrorBody(),
|
||||||
Field: err.Field,
|
Field: err.Field,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: StatusUnprocessableEntity, // RFC 4918: StatusUnprocessableEntity
|
Code: StatusUnprocessableEntity, // RFC 4918: StatusUnprocessableEntity
|
||||||
Reason: unversioned.StatusReasonInvalid,
|
Reason: metav1.StatusReasonInvalid,
|
||||||
Details: &unversioned.StatusDetails{
|
Details: &metav1.StatusDetails{
|
||||||
Group: qualifiedKind.Group,
|
Group: qualifiedKind.Group,
|
||||||
Kind: qualifiedKind.Kind,
|
Kind: qualifiedKind.Kind,
|
||||||
Name: name,
|
Name: name,
|
||||||
@ -203,31 +203,31 @@ func NewInvalid(qualifiedKind schema.GroupKind, name string, errs field.ErrorLis
|
|||||||
|
|
||||||
// NewBadRequest creates an error that indicates that the request is invalid and can not be processed.
|
// NewBadRequest creates an error that indicates that the request is invalid and can not be processed.
|
||||||
func NewBadRequest(reason string) *StatusError {
|
func NewBadRequest(reason string) *StatusError {
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
Reason: unversioned.StatusReasonBadRequest,
|
Reason: metav1.StatusReasonBadRequest,
|
||||||
Message: reason,
|
Message: reason,
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewServiceUnavailable creates an error that indicates that the requested service is unavailable.
|
// NewServiceUnavailable creates an error that indicates that the requested service is unavailable.
|
||||||
func NewServiceUnavailable(reason string) *StatusError {
|
func NewServiceUnavailable(reason string) *StatusError {
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: http.StatusServiceUnavailable,
|
Code: http.StatusServiceUnavailable,
|
||||||
Reason: unversioned.StatusReasonServiceUnavailable,
|
Reason: metav1.StatusReasonServiceUnavailable,
|
||||||
Message: reason,
|
Message: reason,
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewMethodNotSupported returns an error indicating the requested action is not supported on this kind.
|
// NewMethodNotSupported returns an error indicating the requested action is not supported on this kind.
|
||||||
func NewMethodNotSupported(qualifiedResource schema.GroupResource, action string) *StatusError {
|
func NewMethodNotSupported(qualifiedResource schema.GroupResource, action string) *StatusError {
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: http.StatusMethodNotAllowed,
|
Code: http.StatusMethodNotAllowed,
|
||||||
Reason: unversioned.StatusReasonMethodNotAllowed,
|
Reason: metav1.StatusReasonMethodNotAllowed,
|
||||||
Details: &unversioned.StatusDetails{
|
Details: &metav1.StatusDetails{
|
||||||
Group: qualifiedResource.Group,
|
Group: qualifiedResource.Group,
|
||||||
Kind: qualifiedResource.Resource,
|
Kind: qualifiedResource.Resource,
|
||||||
},
|
},
|
||||||
@ -238,11 +238,11 @@ func NewMethodNotSupported(qualifiedResource schema.GroupResource, action string
|
|||||||
// NewServerTimeout returns an error indicating the requested action could not be completed due to a
|
// NewServerTimeout returns an error indicating the requested action could not be completed due to a
|
||||||
// transient error, and the client should try again.
|
// transient error, and the client should try again.
|
||||||
func NewServerTimeout(qualifiedResource schema.GroupResource, operation string, retryAfterSeconds int) *StatusError {
|
func NewServerTimeout(qualifiedResource schema.GroupResource, operation string, retryAfterSeconds int) *StatusError {
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: http.StatusInternalServerError,
|
Code: http.StatusInternalServerError,
|
||||||
Reason: unversioned.StatusReasonServerTimeout,
|
Reason: metav1.StatusReasonServerTimeout,
|
||||||
Details: &unversioned.StatusDetails{
|
Details: &metav1.StatusDetails{
|
||||||
Group: qualifiedResource.Group,
|
Group: qualifiedResource.Group,
|
||||||
Kind: qualifiedResource.Resource,
|
Kind: qualifiedResource.Resource,
|
||||||
Name: operation,
|
Name: operation,
|
||||||
@ -260,12 +260,12 @@ func NewServerTimeoutForKind(qualifiedKind schema.GroupKind, operation string, r
|
|||||||
|
|
||||||
// NewInternalError returns an error indicating the item is invalid and cannot be processed.
|
// NewInternalError returns an error indicating the item is invalid and cannot be processed.
|
||||||
func NewInternalError(err error) *StatusError {
|
func NewInternalError(err error) *StatusError {
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: http.StatusInternalServerError,
|
Code: http.StatusInternalServerError,
|
||||||
Reason: unversioned.StatusReasonInternalError,
|
Reason: metav1.StatusReasonInternalError,
|
||||||
Details: &unversioned.StatusDetails{
|
Details: &metav1.StatusDetails{
|
||||||
Causes: []unversioned.StatusCause{{Message: err.Error()}},
|
Causes: []metav1.StatusCause{{Message: err.Error()}},
|
||||||
},
|
},
|
||||||
Message: fmt.Sprintf("Internal error occurred: %v", err),
|
Message: fmt.Sprintf("Internal error occurred: %v", err),
|
||||||
}}
|
}}
|
||||||
@ -274,12 +274,12 @@ func NewInternalError(err error) *StatusError {
|
|||||||
// NewTimeoutError returns an error indicating that a timeout occurred before the request
|
// NewTimeoutError returns an error indicating that a timeout occurred before the request
|
||||||
// could be completed. Clients may retry, but the operation may still complete.
|
// could be completed. Clients may retry, but the operation may still complete.
|
||||||
func NewTimeoutError(message string, retryAfterSeconds int) *StatusError {
|
func NewTimeoutError(message string, retryAfterSeconds int) *StatusError {
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: StatusServerTimeout,
|
Code: StatusServerTimeout,
|
||||||
Reason: unversioned.StatusReasonTimeout,
|
Reason: metav1.StatusReasonTimeout,
|
||||||
Message: fmt.Sprintf("Timeout: %s", message),
|
Message: fmt.Sprintf("Timeout: %s", message),
|
||||||
Details: &unversioned.StatusDetails{
|
Details: &metav1.StatusDetails{
|
||||||
RetryAfterSeconds: int32(retryAfterSeconds),
|
RetryAfterSeconds: int32(retryAfterSeconds),
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
@ -287,43 +287,43 @@ func NewTimeoutError(message string, retryAfterSeconds int) *StatusError {
|
|||||||
|
|
||||||
// NewGenericServerResponse returns a new error for server responses that are not in a recognizable form.
|
// NewGenericServerResponse returns a new error for server responses that are not in a recognizable form.
|
||||||
func NewGenericServerResponse(code int, verb string, qualifiedResource schema.GroupResource, name, serverMessage string, retryAfterSeconds int, isUnexpectedResponse bool) *StatusError {
|
func NewGenericServerResponse(code int, verb string, qualifiedResource schema.GroupResource, name, serverMessage string, retryAfterSeconds int, isUnexpectedResponse bool) *StatusError {
|
||||||
reason := unversioned.StatusReasonUnknown
|
reason := metav1.StatusReasonUnknown
|
||||||
message := fmt.Sprintf("the server responded with the status code %d but did not return more information", code)
|
message := fmt.Sprintf("the server responded with the status code %d but did not return more information", code)
|
||||||
switch code {
|
switch code {
|
||||||
case http.StatusConflict:
|
case http.StatusConflict:
|
||||||
if verb == "POST" {
|
if verb == "POST" {
|
||||||
reason = unversioned.StatusReasonAlreadyExists
|
reason = metav1.StatusReasonAlreadyExists
|
||||||
} else {
|
} else {
|
||||||
reason = unversioned.StatusReasonConflict
|
reason = metav1.StatusReasonConflict
|
||||||
}
|
}
|
||||||
message = "the server reported a conflict"
|
message = "the server reported a conflict"
|
||||||
case http.StatusNotFound:
|
case http.StatusNotFound:
|
||||||
reason = unversioned.StatusReasonNotFound
|
reason = metav1.StatusReasonNotFound
|
||||||
message = "the server could not find the requested resource"
|
message = "the server could not find the requested resource"
|
||||||
case http.StatusBadRequest:
|
case http.StatusBadRequest:
|
||||||
reason = unversioned.StatusReasonBadRequest
|
reason = metav1.StatusReasonBadRequest
|
||||||
message = "the server rejected our request for an unknown reason"
|
message = "the server rejected our request for an unknown reason"
|
||||||
case http.StatusUnauthorized:
|
case http.StatusUnauthorized:
|
||||||
reason = unversioned.StatusReasonUnauthorized
|
reason = metav1.StatusReasonUnauthorized
|
||||||
message = "the server has asked for the client to provide credentials"
|
message = "the server has asked for the client to provide credentials"
|
||||||
case http.StatusForbidden:
|
case http.StatusForbidden:
|
||||||
reason = unversioned.StatusReasonForbidden
|
reason = metav1.StatusReasonForbidden
|
||||||
message = "the server does not allow access to the requested resource"
|
message = "the server does not allow access to the requested resource"
|
||||||
case http.StatusMethodNotAllowed:
|
case http.StatusMethodNotAllowed:
|
||||||
reason = unversioned.StatusReasonMethodNotAllowed
|
reason = metav1.StatusReasonMethodNotAllowed
|
||||||
message = "the server does not allow this method on the requested resource"
|
message = "the server does not allow this method on the requested resource"
|
||||||
case StatusUnprocessableEntity:
|
case StatusUnprocessableEntity:
|
||||||
reason = unversioned.StatusReasonInvalid
|
reason = metav1.StatusReasonInvalid
|
||||||
message = "the server rejected our request due to an error in our request"
|
message = "the server rejected our request due to an error in our request"
|
||||||
case StatusServerTimeout:
|
case StatusServerTimeout:
|
||||||
reason = unversioned.StatusReasonServerTimeout
|
reason = metav1.StatusReasonServerTimeout
|
||||||
message = "the server cannot complete the requested operation at this time, try again later"
|
message = "the server cannot complete the requested operation at this time, try again later"
|
||||||
case StatusTooManyRequests:
|
case StatusTooManyRequests:
|
||||||
reason = unversioned.StatusReasonTimeout
|
reason = metav1.StatusReasonTimeout
|
||||||
message = "the server has received too many requests and has asked us to try again later"
|
message = "the server has received too many requests and has asked us to try again later"
|
||||||
default:
|
default:
|
||||||
if code >= 500 {
|
if code >= 500 {
|
||||||
reason = unversioned.StatusReasonInternalError
|
reason = metav1.StatusReasonInternalError
|
||||||
message = fmt.Sprintf("an error on the server (%q) has prevented the request from succeeding", serverMessage)
|
message = fmt.Sprintf("an error on the server (%q) has prevented the request from succeeding", serverMessage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -333,22 +333,22 @@ func NewGenericServerResponse(code int, verb string, qualifiedResource schema.Gr
|
|||||||
case !qualifiedResource.Empty():
|
case !qualifiedResource.Empty():
|
||||||
message = fmt.Sprintf("%s (%s %s)", message, strings.ToLower(verb), qualifiedResource.String())
|
message = fmt.Sprintf("%s (%s %s)", message, strings.ToLower(verb), qualifiedResource.String())
|
||||||
}
|
}
|
||||||
var causes []unversioned.StatusCause
|
var causes []metav1.StatusCause
|
||||||
if isUnexpectedResponse {
|
if isUnexpectedResponse {
|
||||||
causes = []unversioned.StatusCause{
|
causes = []metav1.StatusCause{
|
||||||
{
|
{
|
||||||
Type: unversioned.CauseTypeUnexpectedServerResponse,
|
Type: metav1.CauseTypeUnexpectedServerResponse,
|
||||||
Message: serverMessage,
|
Message: serverMessage,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
causes = nil
|
causes = nil
|
||||||
}
|
}
|
||||||
return &StatusError{unversioned.Status{
|
return &StatusError{metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: int32(code),
|
Code: int32(code),
|
||||||
Reason: reason,
|
Reason: reason,
|
||||||
Details: &unversioned.StatusDetails{
|
Details: &metav1.StatusDetails{
|
||||||
Group: qualifiedResource.Group,
|
Group: qualifiedResource.Group,
|
||||||
Kind: qualifiedResource.Resource,
|
Kind: qualifiedResource.Resource,
|
||||||
Name: name,
|
Name: name,
|
||||||
@ -362,56 +362,56 @@ func NewGenericServerResponse(code int, verb string, qualifiedResource schema.Gr
|
|||||||
|
|
||||||
// IsNotFound returns true if the specified error was created by NewNotFound.
|
// IsNotFound returns true if the specified error was created by NewNotFound.
|
||||||
func IsNotFound(err error) bool {
|
func IsNotFound(err error) bool {
|
||||||
return reasonForError(err) == unversioned.StatusReasonNotFound
|
return reasonForError(err) == metav1.StatusReasonNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsAlreadyExists determines if the err is an error which indicates that a specified resource already exists.
|
// IsAlreadyExists determines if the err is an error which indicates that a specified resource already exists.
|
||||||
func IsAlreadyExists(err error) bool {
|
func IsAlreadyExists(err error) bool {
|
||||||
return reasonForError(err) == unversioned.StatusReasonAlreadyExists
|
return reasonForError(err) == metav1.StatusReasonAlreadyExists
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsConflict determines if the err is an error which indicates the provided update conflicts.
|
// IsConflict determines if the err is an error which indicates the provided update conflicts.
|
||||||
func IsConflict(err error) bool {
|
func IsConflict(err error) bool {
|
||||||
return reasonForError(err) == unversioned.StatusReasonConflict
|
return reasonForError(err) == metav1.StatusReasonConflict
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsInvalid determines if the err is an error which indicates the provided resource is not valid.
|
// IsInvalid determines if the err is an error which indicates the provided resource is not valid.
|
||||||
func IsInvalid(err error) bool {
|
func IsInvalid(err error) bool {
|
||||||
return reasonForError(err) == unversioned.StatusReasonInvalid
|
return reasonForError(err) == metav1.StatusReasonInvalid
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsMethodNotSupported determines if the err is an error which indicates the provided action could not
|
// IsMethodNotSupported determines if the err is an error which indicates the provided action could not
|
||||||
// be performed because it is not supported by the server.
|
// be performed because it is not supported by the server.
|
||||||
func IsMethodNotSupported(err error) bool {
|
func IsMethodNotSupported(err error) bool {
|
||||||
return reasonForError(err) == unversioned.StatusReasonMethodNotAllowed
|
return reasonForError(err) == metav1.StatusReasonMethodNotAllowed
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsBadRequest determines if err is an error which indicates that the request is invalid.
|
// IsBadRequest determines if err is an error which indicates that the request is invalid.
|
||||||
func IsBadRequest(err error) bool {
|
func IsBadRequest(err error) bool {
|
||||||
return reasonForError(err) == unversioned.StatusReasonBadRequest
|
return reasonForError(err) == metav1.StatusReasonBadRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsUnauthorized determines if err is an error which indicates that the request is unauthorized and
|
// IsUnauthorized determines if err is an error which indicates that the request is unauthorized and
|
||||||
// requires authentication by the user.
|
// requires authentication by the user.
|
||||||
func IsUnauthorized(err error) bool {
|
func IsUnauthorized(err error) bool {
|
||||||
return reasonForError(err) == unversioned.StatusReasonUnauthorized
|
return reasonForError(err) == metav1.StatusReasonUnauthorized
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsForbidden determines if err is an error which indicates that the request is forbidden and cannot
|
// IsForbidden determines if err is an error which indicates that the request is forbidden and cannot
|
||||||
// be completed as requested.
|
// be completed as requested.
|
||||||
func IsForbidden(err error) bool {
|
func IsForbidden(err error) bool {
|
||||||
return reasonForError(err) == unversioned.StatusReasonForbidden
|
return reasonForError(err) == metav1.StatusReasonForbidden
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsServerTimeout determines if err is an error which indicates that the request needs to be retried
|
// IsServerTimeout determines if err is an error which indicates that the request needs to be retried
|
||||||
// by the client.
|
// by the client.
|
||||||
func IsServerTimeout(err error) bool {
|
func IsServerTimeout(err error) bool {
|
||||||
return reasonForError(err) == unversioned.StatusReasonServerTimeout
|
return reasonForError(err) == metav1.StatusReasonServerTimeout
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsInternalError determines if err is an error which indicates an internal server error.
|
// IsInternalError determines if err is an error which indicates an internal server error.
|
||||||
func IsInternalError(err error) bool {
|
func IsInternalError(err error) bool {
|
||||||
return reasonForError(err) == unversioned.StatusReasonInternalError
|
return reasonForError(err) == metav1.StatusReasonInternalError
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsTooManyRequests determines if err is an error which indicates that there are too many requests
|
// IsTooManyRequests determines if err is an error which indicates that there are too many requests
|
||||||
@ -432,7 +432,7 @@ func IsUnexpectedServerError(err error) bool {
|
|||||||
case APIStatus:
|
case APIStatus:
|
||||||
if d := t.Status().Details; d != nil {
|
if d := t.Status().Details; d != nil {
|
||||||
for _, cause := range d.Causes {
|
for _, cause := range d.Causes {
|
||||||
if cause.Type == unversioned.CauseTypeUnexpectedServerResponse {
|
if cause.Type == metav1.CauseTypeUnexpectedServerResponse {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -454,7 +454,7 @@ func SuggestsClientDelay(err error) (int, bool) {
|
|||||||
case APIStatus:
|
case APIStatus:
|
||||||
if t.Status().Details != nil {
|
if t.Status().Details != nil {
|
||||||
switch t.Status().Reason {
|
switch t.Status().Reason {
|
||||||
case unversioned.StatusReasonServerTimeout, unversioned.StatusReasonTimeout:
|
case metav1.StatusReasonServerTimeout, metav1.StatusReasonTimeout:
|
||||||
return int(t.Status().Details.RetryAfterSeconds), true
|
return int(t.Status().Details.RetryAfterSeconds), true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -462,10 +462,10 @@ func SuggestsClientDelay(err error) (int, bool) {
|
|||||||
return 0, false
|
return 0, false
|
||||||
}
|
}
|
||||||
|
|
||||||
func reasonForError(err error) unversioned.StatusReason {
|
func reasonForError(err error) metav1.StatusReason {
|
||||||
switch t := err.(type) {
|
switch t := err.(type) {
|
||||||
case APIStatus:
|
case APIStatus:
|
||||||
return t.Status().Reason
|
return t.Status().Reason
|
||||||
}
|
}
|
||||||
return unversioned.StatusReasonUnknown
|
return metav1.StatusReasonUnknown
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
"k8s.io/kubernetes/pkg/util/validation/field"
|
"k8s.io/kubernetes/pkg/util/validation/field"
|
||||||
@ -32,118 +32,118 @@ import (
|
|||||||
func TestErrorNew(t *testing.T) {
|
func TestErrorNew(t *testing.T) {
|
||||||
err := NewAlreadyExists(api.Resource("tests"), "1")
|
err := NewAlreadyExists(api.Resource("tests"), "1")
|
||||||
if !IsAlreadyExists(err) {
|
if !IsAlreadyExists(err) {
|
||||||
t.Errorf("expected to be %s", unversioned.StatusReasonAlreadyExists)
|
t.Errorf("expected to be %s", metav1.StatusReasonAlreadyExists)
|
||||||
}
|
}
|
||||||
if IsConflict(err) {
|
if IsConflict(err) {
|
||||||
t.Errorf("expected to not be %s", unversioned.StatusReasonConflict)
|
t.Errorf("expected to not be %s", metav1.StatusReasonConflict)
|
||||||
}
|
}
|
||||||
if IsNotFound(err) {
|
if IsNotFound(err) {
|
||||||
t.Errorf(fmt.Sprintf("expected to not be %s", unversioned.StatusReasonNotFound))
|
t.Errorf(fmt.Sprintf("expected to not be %s", metav1.StatusReasonNotFound))
|
||||||
}
|
}
|
||||||
if IsInvalid(err) {
|
if IsInvalid(err) {
|
||||||
t.Errorf("expected to not be %s", unversioned.StatusReasonInvalid)
|
t.Errorf("expected to not be %s", metav1.StatusReasonInvalid)
|
||||||
}
|
}
|
||||||
if IsBadRequest(err) {
|
if IsBadRequest(err) {
|
||||||
t.Errorf("expected to not be %s", unversioned.StatusReasonBadRequest)
|
t.Errorf("expected to not be %s", metav1.StatusReasonBadRequest)
|
||||||
}
|
}
|
||||||
if IsForbidden(err) {
|
if IsForbidden(err) {
|
||||||
t.Errorf("expected to not be %s", unversioned.StatusReasonForbidden)
|
t.Errorf("expected to not be %s", metav1.StatusReasonForbidden)
|
||||||
}
|
}
|
||||||
if IsServerTimeout(err) {
|
if IsServerTimeout(err) {
|
||||||
t.Errorf("expected to not be %s", unversioned.StatusReasonServerTimeout)
|
t.Errorf("expected to not be %s", metav1.StatusReasonServerTimeout)
|
||||||
}
|
}
|
||||||
if IsMethodNotSupported(err) {
|
if IsMethodNotSupported(err) {
|
||||||
t.Errorf("expected to not be %s", unversioned.StatusReasonMethodNotAllowed)
|
t.Errorf("expected to not be %s", metav1.StatusReasonMethodNotAllowed)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !IsConflict(NewConflict(api.Resource("tests"), "2", errors.New("message"))) {
|
if !IsConflict(NewConflict(api.Resource("tests"), "2", errors.New("message"))) {
|
||||||
t.Errorf("expected to be conflict")
|
t.Errorf("expected to be conflict")
|
||||||
}
|
}
|
||||||
if !IsNotFound(NewNotFound(api.Resource("tests"), "3")) {
|
if !IsNotFound(NewNotFound(api.Resource("tests"), "3")) {
|
||||||
t.Errorf("expected to be %s", unversioned.StatusReasonNotFound)
|
t.Errorf("expected to be %s", metav1.StatusReasonNotFound)
|
||||||
}
|
}
|
||||||
if !IsInvalid(NewInvalid(api.Kind("Test"), "2", nil)) {
|
if !IsInvalid(NewInvalid(api.Kind("Test"), "2", nil)) {
|
||||||
t.Errorf("expected to be %s", unversioned.StatusReasonInvalid)
|
t.Errorf("expected to be %s", metav1.StatusReasonInvalid)
|
||||||
}
|
}
|
||||||
if !IsBadRequest(NewBadRequest("reason")) {
|
if !IsBadRequest(NewBadRequest("reason")) {
|
||||||
t.Errorf("expected to be %s", unversioned.StatusReasonBadRequest)
|
t.Errorf("expected to be %s", metav1.StatusReasonBadRequest)
|
||||||
}
|
}
|
||||||
if !IsForbidden(NewForbidden(api.Resource("tests"), "2", errors.New("reason"))) {
|
if !IsForbidden(NewForbidden(api.Resource("tests"), "2", errors.New("reason"))) {
|
||||||
t.Errorf("expected to be %s", unversioned.StatusReasonForbidden)
|
t.Errorf("expected to be %s", metav1.StatusReasonForbidden)
|
||||||
}
|
}
|
||||||
if !IsUnauthorized(NewUnauthorized("reason")) {
|
if !IsUnauthorized(NewUnauthorized("reason")) {
|
||||||
t.Errorf("expected to be %s", unversioned.StatusReasonUnauthorized)
|
t.Errorf("expected to be %s", metav1.StatusReasonUnauthorized)
|
||||||
}
|
}
|
||||||
if !IsServerTimeout(NewServerTimeout(api.Resource("tests"), "reason", 0)) {
|
if !IsServerTimeout(NewServerTimeout(api.Resource("tests"), "reason", 0)) {
|
||||||
t.Errorf("expected to be %s", unversioned.StatusReasonServerTimeout)
|
t.Errorf("expected to be %s", metav1.StatusReasonServerTimeout)
|
||||||
}
|
}
|
||||||
if time, ok := SuggestsClientDelay(NewServerTimeout(api.Resource("tests"), "doing something", 10)); time != 10 || !ok {
|
if time, ok := SuggestsClientDelay(NewServerTimeout(api.Resource("tests"), "doing something", 10)); time != 10 || !ok {
|
||||||
t.Errorf("expected to be %s", unversioned.StatusReasonServerTimeout)
|
t.Errorf("expected to be %s", metav1.StatusReasonServerTimeout)
|
||||||
}
|
}
|
||||||
if time, ok := SuggestsClientDelay(NewTimeoutError("test reason", 10)); time != 10 || !ok {
|
if time, ok := SuggestsClientDelay(NewTimeoutError("test reason", 10)); time != 10 || !ok {
|
||||||
t.Errorf("expected to be %s", unversioned.StatusReasonTimeout)
|
t.Errorf("expected to be %s", metav1.StatusReasonTimeout)
|
||||||
}
|
}
|
||||||
if !IsMethodNotSupported(NewMethodNotSupported(api.Resource("foos"), "delete")) {
|
if !IsMethodNotSupported(NewMethodNotSupported(api.Resource("foos"), "delete")) {
|
||||||
t.Errorf("expected to be %s", unversioned.StatusReasonMethodNotAllowed)
|
t.Errorf("expected to be %s", metav1.StatusReasonMethodNotAllowed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNewInvalid(t *testing.T) {
|
func TestNewInvalid(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
Err *field.Error
|
Err *field.Error
|
||||||
Details *unversioned.StatusDetails
|
Details *metav1.StatusDetails
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
field.Duplicate(field.NewPath("field[0].name"), "bar"),
|
field.Duplicate(field.NewPath("field[0].name"), "bar"),
|
||||||
&unversioned.StatusDetails{
|
&metav1.StatusDetails{
|
||||||
Kind: "Kind",
|
Kind: "Kind",
|
||||||
Name: "name",
|
Name: "name",
|
||||||
Causes: []unversioned.StatusCause{{
|
Causes: []metav1.StatusCause{{
|
||||||
Type: unversioned.CauseTypeFieldValueDuplicate,
|
Type: metav1.CauseTypeFieldValueDuplicate,
|
||||||
Field: "field[0].name",
|
Field: "field[0].name",
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field.Invalid(field.NewPath("field[0].name"), "bar", "detail"),
|
field.Invalid(field.NewPath("field[0].name"), "bar", "detail"),
|
||||||
&unversioned.StatusDetails{
|
&metav1.StatusDetails{
|
||||||
Kind: "Kind",
|
Kind: "Kind",
|
||||||
Name: "name",
|
Name: "name",
|
||||||
Causes: []unversioned.StatusCause{{
|
Causes: []metav1.StatusCause{{
|
||||||
Type: unversioned.CauseTypeFieldValueInvalid,
|
Type: metav1.CauseTypeFieldValueInvalid,
|
||||||
Field: "field[0].name",
|
Field: "field[0].name",
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field.NotFound(field.NewPath("field[0].name"), "bar"),
|
field.NotFound(field.NewPath("field[0].name"), "bar"),
|
||||||
&unversioned.StatusDetails{
|
&metav1.StatusDetails{
|
||||||
Kind: "Kind",
|
Kind: "Kind",
|
||||||
Name: "name",
|
Name: "name",
|
||||||
Causes: []unversioned.StatusCause{{
|
Causes: []metav1.StatusCause{{
|
||||||
Type: unversioned.CauseTypeFieldValueNotFound,
|
Type: metav1.CauseTypeFieldValueNotFound,
|
||||||
Field: "field[0].name",
|
Field: "field[0].name",
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field.NotSupported(field.NewPath("field[0].name"), "bar", nil),
|
field.NotSupported(field.NewPath("field[0].name"), "bar", nil),
|
||||||
&unversioned.StatusDetails{
|
&metav1.StatusDetails{
|
||||||
Kind: "Kind",
|
Kind: "Kind",
|
||||||
Name: "name",
|
Name: "name",
|
||||||
Causes: []unversioned.StatusCause{{
|
Causes: []metav1.StatusCause{{
|
||||||
Type: unversioned.CauseTypeFieldValueNotSupported,
|
Type: metav1.CauseTypeFieldValueNotSupported,
|
||||||
Field: "field[0].name",
|
Field: "field[0].name",
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field.Required(field.NewPath("field[0].name"), ""),
|
field.Required(field.NewPath("field[0].name"), ""),
|
||||||
&unversioned.StatusDetails{
|
&metav1.StatusDetails{
|
||||||
Kind: "Kind",
|
Kind: "Kind",
|
||||||
Name: "name",
|
Name: "name",
|
||||||
Causes: []unversioned.StatusCause{{
|
Causes: []metav1.StatusCause{{
|
||||||
Type: unversioned.CauseTypeFieldValueRequired,
|
Type: metav1.CauseTypeFieldValueRequired,
|
||||||
Field: "field[0].name",
|
Field: "field[0].name",
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
@ -154,7 +154,7 @@ func TestNewInvalid(t *testing.T) {
|
|||||||
expected.Causes[0].Message = vErr.ErrorBody()
|
expected.Causes[0].Message = vErr.ErrorBody()
|
||||||
err := NewInvalid(api.Kind("Kind"), "name", field.ErrorList{vErr})
|
err := NewInvalid(api.Kind("Kind"), "name", field.ErrorList{vErr})
|
||||||
status := err.ErrStatus
|
status := err.ErrStatus
|
||||||
if status.Code != 422 || status.Reason != unversioned.StatusReasonInvalid {
|
if status.Code != 422 || status.Reason != metav1.StatusReasonInvalid {
|
||||||
t.Errorf("%d: unexpected status: %#v", i, status)
|
t.Errorf("%d: unexpected status: %#v", i, status)
|
||||||
}
|
}
|
||||||
if !reflect.DeepEqual(expected, status.Details) {
|
if !reflect.DeepEqual(expected, status.Details) {
|
||||||
@ -164,7 +164,7 @@ func TestNewInvalid(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_reasonForError(t *testing.T) {
|
func Test_reasonForError(t *testing.T) {
|
||||||
if e, a := unversioned.StatusReasonUnknown, reasonForError(nil); e != a {
|
if e, a := metav1.StatusReasonUnknown, reasonForError(nil); e != a {
|
||||||
t.Errorf("unexpected reason type: %#v", a)
|
t.Errorf("unexpected reason type: %#v", a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ func TestFromObject(t *testing.T) {
|
|||||||
obj runtime.Object
|
obj runtime.Object
|
||||||
message string
|
message string
|
||||||
}{
|
}{
|
||||||
{&unversioned.Status{Message: "foobar"}, "foobar"},
|
{&metav1.Status{Message: "foobar"}, "foobar"},
|
||||||
{&TestType{}, "unexpected object: &{}"},
|
{&TestType{}, "unexpected object: &{}"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,6 @@ go_test(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSortableEvents(t *testing.T) {
|
func TestSortableEvents(t *testing.T) {
|
||||||
@ -31,24 +31,24 @@ func TestSortableEvents(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Source: api.EventSource{Component: "kubelet"},
|
Source: api.EventSource{Component: "kubelet"},
|
||||||
Message: "Item 1",
|
Message: "Item 1",
|
||||||
FirstTimestamp: unversioned.NewTime(time.Date(2014, time.January, 15, 0, 0, 0, 0, time.UTC)),
|
FirstTimestamp: metav1.NewTime(time.Date(2014, time.January, 15, 0, 0, 0, 0, time.UTC)),
|
||||||
LastTimestamp: unversioned.NewTime(time.Date(2014, time.January, 15, 0, 0, 0, 0, time.UTC)),
|
LastTimestamp: metav1.NewTime(time.Date(2014, time.January, 15, 0, 0, 0, 0, time.UTC)),
|
||||||
Count: 1,
|
Count: 1,
|
||||||
Type: api.EventTypeNormal,
|
Type: api.EventTypeNormal,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Source: api.EventSource{Component: "scheduler"},
|
Source: api.EventSource{Component: "scheduler"},
|
||||||
Message: "Item 2",
|
Message: "Item 2",
|
||||||
FirstTimestamp: unversioned.NewTime(time.Date(1987, time.June, 17, 0, 0, 0, 0, time.UTC)),
|
FirstTimestamp: metav1.NewTime(time.Date(1987, time.June, 17, 0, 0, 0, 0, time.UTC)),
|
||||||
LastTimestamp: unversioned.NewTime(time.Date(1987, time.June, 17, 0, 0, 0, 0, time.UTC)),
|
LastTimestamp: metav1.NewTime(time.Date(1987, time.June, 17, 0, 0, 0, 0, time.UTC)),
|
||||||
Count: 1,
|
Count: 1,
|
||||||
Type: api.EventTypeNormal,
|
Type: api.EventTypeNormal,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Source: api.EventSource{Component: "kubelet"},
|
Source: api.EventSource{Component: "kubelet"},
|
||||||
Message: "Item 3",
|
Message: "Item 3",
|
||||||
FirstTimestamp: unversioned.NewTime(time.Date(2002, time.December, 25, 0, 0, 0, 0, time.UTC)),
|
FirstTimestamp: metav1.NewTime(time.Date(2002, time.December, 25, 0, 0, 0, 0, time.UTC)),
|
||||||
LastTimestamp: unversioned.NewTime(time.Date(2002, time.December, 25, 0, 0, 0, 0, time.UTC)),
|
LastTimestamp: metav1.NewTime(time.Date(2002, time.December, 25, 0, 0, 0, 0, time.UTC)),
|
||||||
Count: 1,
|
Count: 1,
|
||||||
Type: api.EventTypeNormal,
|
Type: api.EventTypeNormal,
|
||||||
},
|
},
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api/resource"
|
"k8s.io/kubernetes/pkg/api/resource"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/conversion"
|
"k8s.io/kubernetes/pkg/conversion"
|
||||||
"k8s.io/kubernetes/pkg/fields"
|
"k8s.io/kubernetes/pkg/fields"
|
||||||
"k8s.io/kubernetes/pkg/labels"
|
"k8s.io/kubernetes/pkg/labels"
|
||||||
@ -61,7 +61,7 @@ var Semantic = conversion.EqualitiesOrDie(
|
|||||||
// Uninitialized quantities are equivalent to 0 quantities.
|
// Uninitialized quantities are equivalent to 0 quantities.
|
||||||
return a.Cmp(b) == 0
|
return a.Cmp(b) == 0
|
||||||
},
|
},
|
||||||
func(a, b unversioned.Time) bool {
|
func(a, b metav1.Time) bool {
|
||||||
return a.UTC() == b.UTC()
|
return a.UTC() == b.UTC()
|
||||||
},
|
},
|
||||||
func(a, b labels.Selector) bool {
|
func(a, b labels.Selector) bool {
|
||||||
@ -397,15 +397,15 @@ func containsAccessMode(modes []PersistentVolumeAccessMode, mode PersistentVolum
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ParseRFC3339 parses an RFC3339 date in either RFC3339Nano or RFC3339 format.
|
// ParseRFC3339 parses an RFC3339 date in either RFC3339Nano or RFC3339 format.
|
||||||
func ParseRFC3339(s string, nowFn func() unversioned.Time) (unversioned.Time, error) {
|
func ParseRFC3339(s string, nowFn func() metav1.Time) (metav1.Time, error) {
|
||||||
if t, timeErr := time.Parse(time.RFC3339Nano, s); timeErr == nil {
|
if t, timeErr := time.Parse(time.RFC3339Nano, s); timeErr == nil {
|
||||||
return unversioned.Time{Time: t}, nil
|
return metav1.Time{Time: t}, nil
|
||||||
}
|
}
|
||||||
t, err := time.Parse(time.RFC3339, s)
|
t, err := time.Parse(time.RFC3339, s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return unversioned.Time{}, err
|
return metav1.Time{}, err
|
||||||
}
|
}
|
||||||
return unversioned.Time{Time: t}, nil
|
return metav1.Time{Time: t}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NodeSelectorRequirementsAsSelector converts the []NodeSelectorRequirement api type into a struct that implements
|
// NodeSelectorRequirementsAsSelector converts the []NodeSelectorRequirement api type into a struct that implements
|
||||||
|
@ -34,8 +34,8 @@ go_test(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/apimachinery/registered:go_default_library",
|
"//pkg/apimachinery/registered:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
],
|
],
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
internal "k8s.io/kubernetes/pkg/api"
|
internal "k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
@ -38,7 +38,7 @@ func TestResourceVersioner(t *testing.T) {
|
|||||||
t.Errorf("unexpected version %v", version)
|
t.Errorf("unexpected version %v", version)
|
||||||
}
|
}
|
||||||
|
|
||||||
podList := internal.PodList{ListMeta: unversioned.ListMeta{ResourceVersion: "10"}}
|
podList := internal.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}}
|
||||||
version, err = accessor.ResourceVersion(&podList)
|
version, err = accessor.ResourceVersion(&podList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected error: %v", err)
|
t.Fatalf("unexpected error: %v", err)
|
||||||
@ -120,7 +120,7 @@ func TestRESTMapper(t *testing.T) {
|
|||||||
|
|
||||||
func TestUnversioned(t *testing.T) {
|
func TestUnversioned(t *testing.T) {
|
||||||
for _, obj := range []runtime.Object{
|
for _, obj := range []runtime.Object{
|
||||||
&unversioned.Status{},
|
&metav1.Status{},
|
||||||
} {
|
} {
|
||||||
if unversioned, ok := internal.Scheme.IsUnversioned(obj); !unversioned || !ok {
|
if unversioned, ok := internal.Scheme.IsUnversioned(obj); !unversioned || !ok {
|
||||||
t.Errorf("%v is expected to be unversioned", reflect.TypeOf(obj))
|
t.Errorf("%v is expected to be unversioned", reflect.TypeOf(obj))
|
||||||
|
@ -19,7 +19,7 @@ package api
|
|||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/meta"
|
"k8s.io/kubernetes/pkg/api/meta"
|
||||||
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/conversion"
|
"k8s.io/kubernetes/pkg/conversion"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/types"
|
"k8s.io/kubernetes/pkg/types"
|
||||||
@ -28,7 +28,7 @@ import (
|
|||||||
|
|
||||||
// FillObjectMetaSystemFields populates fields that are managed by the system on ObjectMeta.
|
// FillObjectMetaSystemFields populates fields that are managed by the system on ObjectMeta.
|
||||||
func FillObjectMetaSystemFields(ctx Context, meta *ObjectMeta) {
|
func FillObjectMetaSystemFields(ctx Context, meta *ObjectMeta) {
|
||||||
meta.CreationTimestamp = unversioned.Now()
|
meta.CreationTimestamp = metav1.Now()
|
||||||
// allows admission controllers to assign a UID earlier in the request processing
|
// allows admission controllers to assign a UID earlier in the request processing
|
||||||
// to support tracking resources pending creation.
|
// to support tracking resources pending creation.
|
||||||
uid, found := UIDFrom(ctx)
|
uid, found := UIDFrom(ctx)
|
||||||
@ -61,12 +61,12 @@ func ObjectMetaFor(obj runtime.Object) (*ObjectMeta, error) {
|
|||||||
// ListMetaFor returns a pointer to a provided object's ListMeta,
|
// ListMetaFor returns a pointer to a provided object's ListMeta,
|
||||||
// or an error if the object does not have that pointer.
|
// or an error if the object does not have that pointer.
|
||||||
// TODO: allow runtime.Unknown to extract this object
|
// TODO: allow runtime.Unknown to extract this object
|
||||||
func ListMetaFor(obj runtime.Object) (*unversioned.ListMeta, error) {
|
func ListMetaFor(obj runtime.Object) (*metav1.ListMeta, error) {
|
||||||
v, err := conversion.EnforcePtr(obj)
|
v, err := conversion.EnforcePtr(obj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var meta *unversioned.ListMeta
|
var meta *metav1.ListMeta
|
||||||
err = runtime.FieldPtr(v, "ListMeta", &meta)
|
err = runtime.FieldPtr(v, "ListMeta", &meta)
|
||||||
return meta, err
|
return meta, err
|
||||||
}
|
}
|
||||||
@ -87,12 +87,12 @@ func (meta *ObjectMeta) GetResourceVersion() string { return meta.Re
|
|||||||
func (meta *ObjectMeta) SetResourceVersion(version string) { meta.ResourceVersion = version }
|
func (meta *ObjectMeta) SetResourceVersion(version string) { meta.ResourceVersion = version }
|
||||||
func (meta *ObjectMeta) GetSelfLink() string { return meta.SelfLink }
|
func (meta *ObjectMeta) GetSelfLink() string { return meta.SelfLink }
|
||||||
func (meta *ObjectMeta) SetSelfLink(selfLink string) { meta.SelfLink = selfLink }
|
func (meta *ObjectMeta) SetSelfLink(selfLink string) { meta.SelfLink = selfLink }
|
||||||
func (meta *ObjectMeta) GetCreationTimestamp() unversioned.Time { return meta.CreationTimestamp }
|
func (meta *ObjectMeta) GetCreationTimestamp() metav1.Time { return meta.CreationTimestamp }
|
||||||
func (meta *ObjectMeta) SetCreationTimestamp(creationTimestamp unversioned.Time) {
|
func (meta *ObjectMeta) SetCreationTimestamp(creationTimestamp metav1.Time) {
|
||||||
meta.CreationTimestamp = creationTimestamp
|
meta.CreationTimestamp = creationTimestamp
|
||||||
}
|
}
|
||||||
func (meta *ObjectMeta) GetDeletionTimestamp() *unversioned.Time { return meta.DeletionTimestamp }
|
func (meta *ObjectMeta) GetDeletionTimestamp() *metav1.Time { return meta.DeletionTimestamp }
|
||||||
func (meta *ObjectMeta) SetDeletionTimestamp(deletionTimestamp *unversioned.Time) {
|
func (meta *ObjectMeta) SetDeletionTimestamp(deletionTimestamp *metav1.Time) {
|
||||||
meta.DeletionTimestamp = deletionTimestamp
|
meta.DeletionTimestamp = deletionTimestamp
|
||||||
}
|
}
|
||||||
func (meta *ObjectMeta) GetLabels() map[string]string { return meta.Labels }
|
func (meta *ObjectMeta) GetLabels() map[string]string { return meta.Labels }
|
||||||
|
@ -27,7 +27,7 @@ go_library(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api/meta/metatypes:go_default_library",
|
"//pkg/api/meta/metatypes:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/conversion:go_default_library",
|
"//pkg/conversion:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
@ -66,8 +66,8 @@ go_test(
|
|||||||
"//pkg/api/meta:go_default_library",
|
"//pkg/api/meta:go_default_library",
|
||||||
"//pkg/api/meta/metatypes:go_default_library",
|
"//pkg/api/meta/metatypes:go_default_library",
|
||||||
"//pkg/api/testapi:go_default_library",
|
"//pkg/api/testapi:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
"//pkg/types:go_default_library",
|
"//pkg/types:go_default_library",
|
||||||
|
@ -18,7 +18,7 @@ package meta
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
"k8s.io/kubernetes/pkg/types"
|
"k8s.io/kubernetes/pkg/types"
|
||||||
@ -51,10 +51,10 @@ type Object interface {
|
|||||||
SetResourceVersion(version string)
|
SetResourceVersion(version string)
|
||||||
GetSelfLink() string
|
GetSelfLink() string
|
||||||
SetSelfLink(selfLink string)
|
SetSelfLink(selfLink string)
|
||||||
GetCreationTimestamp() unversioned.Time
|
GetCreationTimestamp() metav1.Time
|
||||||
SetCreationTimestamp(timestamp unversioned.Time)
|
SetCreationTimestamp(timestamp metav1.Time)
|
||||||
GetDeletionTimestamp() *unversioned.Time
|
GetDeletionTimestamp() *metav1.Time
|
||||||
SetDeletionTimestamp(timestamp *unversioned.Time)
|
SetDeletionTimestamp(timestamp *metav1.Time)
|
||||||
GetLabels() map[string]string
|
GetLabels() map[string]string
|
||||||
SetLabels(labels map[string]string)
|
SetLabels(labels map[string]string)
|
||||||
GetAnnotations() map[string]string
|
GetAnnotations() map[string]string
|
||||||
@ -76,10 +76,10 @@ type ListMetaAccessor interface {
|
|||||||
// List lets you work with list metadata from any of the versioned or
|
// List lets you work with list metadata from any of the versioned or
|
||||||
// internal API objects. Attempting to set or retrieve a field on an object that does
|
// internal API objects. Attempting to set or retrieve a field on an object that does
|
||||||
// not support that field will be a no-op and return a default value.
|
// not support that field will be a no-op and return a default value.
|
||||||
type List unversioned.List
|
type List metav1.List
|
||||||
|
|
||||||
// Type exposes the type and APIVersion of versioned or internal API objects.
|
// Type exposes the type and APIVersion of versioned or internal API objects.
|
||||||
type Type unversioned.Type
|
type Type metav1.Type
|
||||||
|
|
||||||
// MetadataAccessor lets you work with object and list metadata from any of the versioned or
|
// MetadataAccessor lets you work with object and list metadata from any of the versioned or
|
||||||
// internal API objects. Attempting to set or retrieve a field on an object that does
|
// internal API objects. Attempting to set or retrieve a field on an object that does
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/conversion"
|
"k8s.io/kubernetes/pkg/conversion"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
@ -43,14 +43,14 @@ func ListAccessor(obj interface{}) (List, error) {
|
|||||||
switch t := obj.(type) {
|
switch t := obj.(type) {
|
||||||
case List:
|
case List:
|
||||||
return t, nil
|
return t, nil
|
||||||
case unversioned.List:
|
case metav1.List:
|
||||||
return t, nil
|
return t, nil
|
||||||
case ListMetaAccessor:
|
case ListMetaAccessor:
|
||||||
if m := t.GetListMeta(); m != nil {
|
if m := t.GetListMeta(); m != nil {
|
||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
return nil, errNotList
|
return nil, errNotList
|
||||||
case unversioned.ListMetaAccessor:
|
case metav1.ListMetaAccessor:
|
||||||
if m := t.GetListMeta(); m != nil {
|
if m := t.GetListMeta(); m != nil {
|
||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ func Accessor(obj interface{}) (Object, error) {
|
|||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
return nil, errNotObject
|
return nil, errNotObject
|
||||||
case List, unversioned.List, ListMetaAccessor, unversioned.ListMetaAccessor:
|
case List, metav1.List, ListMetaAccessor, metav1.ListMetaAccessor:
|
||||||
return nil, errNotObject
|
return nil, errNotObject
|
||||||
default:
|
default:
|
||||||
return nil, errNotObject
|
return nil, errNotObject
|
||||||
@ -372,8 +372,8 @@ type genericAccessor struct {
|
|||||||
kind *string
|
kind *string
|
||||||
resourceVersion *string
|
resourceVersion *string
|
||||||
selfLink *string
|
selfLink *string
|
||||||
creationTimestamp *unversioned.Time
|
creationTimestamp *metav1.Time
|
||||||
deletionTimestamp **unversioned.Time
|
deletionTimestamp **metav1.Time
|
||||||
labels *map[string]string
|
labels *map[string]string
|
||||||
annotations *map[string]string
|
annotations *map[string]string
|
||||||
ownerReferences reflect.Value
|
ownerReferences reflect.Value
|
||||||
@ -468,19 +468,19 @@ func (a genericAccessor) SetSelfLink(selfLink string) {
|
|||||||
*a.selfLink = selfLink
|
*a.selfLink = selfLink
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a genericAccessor) GetCreationTimestamp() unversioned.Time {
|
func (a genericAccessor) GetCreationTimestamp() metav1.Time {
|
||||||
return *a.creationTimestamp
|
return *a.creationTimestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a genericAccessor) SetCreationTimestamp(timestamp unversioned.Time) {
|
func (a genericAccessor) SetCreationTimestamp(timestamp metav1.Time) {
|
||||||
*a.creationTimestamp = timestamp
|
*a.creationTimestamp = timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a genericAccessor) GetDeletionTimestamp() *unversioned.Time {
|
func (a genericAccessor) GetDeletionTimestamp() *metav1.Time {
|
||||||
return *a.deletionTimestamp
|
return *a.deletionTimestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a genericAccessor) SetDeletionTimestamp(timestamp *unversioned.Time) {
|
func (a genericAccessor) SetDeletionTimestamp(timestamp *metav1.Time) {
|
||||||
*a.deletionTimestamp = timestamp
|
*a.deletionTimestamp = timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/meta"
|
"k8s.io/kubernetes/pkg/api/meta"
|
||||||
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
@ -34,7 +34,7 @@ import (
|
|||||||
|
|
||||||
func TestAPIObjectMeta(t *testing.T) {
|
func TestAPIObjectMeta(t *testing.T) {
|
||||||
j := &api.Pod{
|
j := &api.Pod{
|
||||||
TypeMeta: unversioned.TypeMeta{APIVersion: "/a", Kind: "b"},
|
TypeMeta: metav1.TypeMeta{APIVersion: "/a", Kind: "b"},
|
||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Namespace: "bar",
|
Namespace: "bar",
|
||||||
Name: "foo",
|
Name: "foo",
|
||||||
@ -148,7 +148,7 @@ func TestGenericTypeMeta(t *testing.T) {
|
|||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
GenerateName string `json:"generateName,omitempty"`
|
GenerateName string `json:"generateName,omitempty"`
|
||||||
UID string `json:"uid,omitempty"`
|
UID string `json:"uid,omitempty"`
|
||||||
CreationTimestamp unversioned.Time `json:"creationTimestamp,omitempty"`
|
CreationTimestamp metav1.Time `json:"creationTimestamp,omitempty"`
|
||||||
SelfLink string `json:"selfLink,omitempty"`
|
SelfLink string `json:"selfLink,omitempty"`
|
||||||
ResourceVersion string `json:"resourceVersion,omitempty"`
|
ResourceVersion string `json:"resourceVersion,omitempty"`
|
||||||
APIVersion string `json:"apiVersion,omitempty"`
|
APIVersion string `json:"apiVersion,omitempty"`
|
||||||
@ -198,7 +198,7 @@ type InternalTypeMeta struct {
|
|||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
GenerateName string `json:"generateName,omitempty"`
|
GenerateName string `json:"generateName,omitempty"`
|
||||||
UID string `json:"uid,omitempty"`
|
UID string `json:"uid,omitempty"`
|
||||||
CreationTimestamp unversioned.Time `json:"creationTimestamp,omitempty"`
|
CreationTimestamp metav1.Time `json:"creationTimestamp,omitempty"`
|
||||||
SelfLink string `json:"selfLink,omitempty"`
|
SelfLink string `json:"selfLink,omitempty"`
|
||||||
ResourceVersion string `json:"resourceVersion,omitempty"`
|
ResourceVersion string `json:"resourceVersion,omitempty"`
|
||||||
APIVersion string `json:"apiVersion,omitempty"`
|
APIVersion string `json:"apiVersion,omitempty"`
|
||||||
@ -217,7 +217,7 @@ type MyAPIObject struct {
|
|||||||
TypeMeta InternalTypeMeta `json:",inline"`
|
TypeMeta InternalTypeMeta `json:",inline"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (obj *MyAPIObject) GetListMeta() unversioned.List { return &obj.TypeMeta }
|
func (obj *MyAPIObject) GetListMeta() metav1.List { return &obj.TypeMeta }
|
||||||
|
|
||||||
func (obj *MyAPIObject) GetObjectKind() schema.ObjectKind { return obj }
|
func (obj *MyAPIObject) GetObjectKind() schema.ObjectKind { return obj }
|
||||||
func (obj *MyAPIObject) SetGroupVersionKind(gvk schema.GroupVersionKind) {
|
func (obj *MyAPIObject) SetGroupVersionKind(gvk schema.GroupVersionKind) {
|
||||||
@ -333,7 +333,7 @@ func TestTypeMetaSelfLinker(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type MyAPIObject2 struct {
|
type MyAPIObject2 struct {
|
||||||
unversioned.TypeMeta
|
metav1.TypeMeta
|
||||||
v1.ObjectMeta
|
v1.ObjectMeta
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,7 +396,7 @@ func TestAccessOwnerReferences(t *testing.T) {
|
|||||||
// BenchmarkAccessorSetFastPath shows the interface fast path
|
// BenchmarkAccessorSetFastPath shows the interface fast path
|
||||||
func BenchmarkAccessorSetFastPath(b *testing.B) {
|
func BenchmarkAccessorSetFastPath(b *testing.B) {
|
||||||
obj := &api.Pod{
|
obj := &api.Pod{
|
||||||
TypeMeta: unversioned.TypeMeta{APIVersion: "/a", Kind: "b"},
|
TypeMeta: metav1.TypeMeta{APIVersion: "/a", Kind: "b"},
|
||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Namespace: "bar",
|
Namespace: "bar",
|
||||||
Name: "foo",
|
Name: "foo",
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api/testapi"
|
"k8s.io/kubernetes/pkg/api/testapi"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/util/sets"
|
"k8s.io/kubernetes/pkg/util/sets"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -80,26 +80,26 @@ func TestListTypes(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type WithoutMetaDataList struct {
|
type WithoutMetaDataList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
unversioned.ListMeta
|
metav1.ListMeta
|
||||||
Items []interface{} `json:"items"`
|
Items []interface{} `json:"items"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type WithoutItemsList struct {
|
type WithoutItemsList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type WrongItemsJSONTagList struct {
|
type WrongItemsJSONTagList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
Items []interface{} `json:"items,omitempty"`
|
Items []interface{} `json:"items,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a type has Items, its name should end with "List"
|
// If a type has Items, its name should end with "List"
|
||||||
type ListWithWrongName struct {
|
type ListWithWrongName struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
Items []interface{} `json:"items"`
|
Items []interface{} `json:"items"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/meta"
|
"k8s.io/kubernetes/pkg/api/meta"
|
||||||
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
@ -166,7 +166,7 @@ func TestAccessorImplementations(t *testing.T) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if _, ok := obj.(unversioned.ListMetaAccessor); ok {
|
if _, ok := obj.(metav1.ListMetaAccessor); ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if _, ok := value.Elem().Type().FieldByName("ObjectMeta"); ok {
|
if _, ok := value.Elem().Type().FieldByName("ObjectMeta"); ok {
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
)
|
)
|
||||||
@ -30,7 +30,7 @@ type FakeAPIObject struct{}
|
|||||||
func (obj *FakeAPIObject) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind }
|
func (obj *FakeAPIObject) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind }
|
||||||
|
|
||||||
type ExtensionAPIObject struct {
|
type ExtensionAPIObject struct {
|
||||||
unversioned.TypeMeta
|
metav1.TypeMeta
|
||||||
ObjectMeta
|
ObjectMeta
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ func TestGetReference(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"serviceList": {
|
"serviceList": {
|
||||||
obj: &ServiceList{
|
obj: &ServiceList{
|
||||||
ListMeta: unversioned.ListMeta{
|
ListMeta: metav1.ListMeta{
|
||||||
ResourceVersion: "42",
|
ResourceVersion: "42",
|
||||||
SelfLink: "/api/version2/services",
|
SelfLink: "/api/version2/services",
|
||||||
},
|
},
|
||||||
@ -85,7 +85,7 @@ func TestGetReference(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"extensionAPIObject": {
|
"extensionAPIObject": {
|
||||||
obj: &ExtensionAPIObject{
|
obj: &ExtensionAPIObject{
|
||||||
TypeMeta: unversioned.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "ExtensionAPIObject",
|
Kind: "ExtensionAPIObject",
|
||||||
},
|
},
|
||||||
ObjectMeta: ObjectMeta{
|
ObjectMeta: ObjectMeta{
|
||||||
@ -105,7 +105,7 @@ func TestGetReference(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"badSelfLink": {
|
"badSelfLink": {
|
||||||
obj: &ServiceList{
|
obj: &ServiceList{
|
||||||
ListMeta: unversioned.ListMeta{
|
ListMeta: metav1.ListMeta{
|
||||||
ResourceVersion: "42",
|
ResourceVersion: "42",
|
||||||
SelfLink: "version2/services",
|
SelfLink: "version2/services",
|
||||||
},
|
},
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
"k8s.io/kubernetes/pkg/runtime/serializer"
|
"k8s.io/kubernetes/pkg/runtime/serializer"
|
||||||
@ -76,7 +76,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||||
if err := scheme.AddIgnoredConversionType(&unversioned.TypeMeta{}, &unversioned.TypeMeta{}); err != nil {
|
if err := scheme.AddIgnoredConversionType(&metav1.TypeMeta{}, &metav1.TypeMeta{}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||||
@ -129,11 +129,11 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
|
|
||||||
// Register Unversioned types under their own special group
|
// Register Unversioned types under their own special group
|
||||||
scheme.AddUnversionedTypes(Unversioned,
|
scheme.AddUnversionedTypes(Unversioned,
|
||||||
&unversioned.Status{},
|
&metav1.Status{},
|
||||||
&unversioned.APIVersions{},
|
&metav1.APIVersions{},
|
||||||
&unversioned.APIGroupList{},
|
&metav1.APIGroupList{},
|
||||||
&unversioned.APIGroup{},
|
&metav1.APIGroup{},
|
||||||
&unversioned.APIResourceList{},
|
&metav1.APIResourceList{},
|
||||||
)
|
)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api/resource"
|
"k8s.io/kubernetes/pkg/api/resource"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Returns string version of ResourceName.
|
// Returns string version of ResourceName.
|
||||||
@ -81,7 +81,7 @@ func GetExistingContainerStatus(statuses []ContainerStatus, name string) Contain
|
|||||||
// of that, there are two cases when a pod can be considered available:
|
// of that, there are two cases when a pod can be considered available:
|
||||||
// 1. minReadySeconds == 0, or
|
// 1. minReadySeconds == 0, or
|
||||||
// 2. LastTransitionTime (is set) + minReadySeconds < current time
|
// 2. LastTransitionTime (is set) + minReadySeconds < current time
|
||||||
func IsPodAvailable(pod *Pod, minReadySeconds int32, now unversioned.Time) bool {
|
func IsPodAvailable(pod *Pod, minReadySeconds int32, now metav1.Time) bool {
|
||||||
if !IsPodReady(pod) {
|
if !IsPodReady(pod) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ func GetNodeCondition(status *NodeStatus, conditionType NodeConditionType) (int,
|
|||||||
// status has changed.
|
// status has changed.
|
||||||
// Returns true if pod condition has changed or has been added.
|
// Returns true if pod condition has changed or has been added.
|
||||||
func UpdatePodCondition(status *PodStatus, condition *PodCondition) bool {
|
func UpdatePodCondition(status *PodStatus, condition *PodCondition) bool {
|
||||||
condition.LastTransitionTime = unversioned.Now()
|
condition.LastTransitionTime = metav1.Now()
|
||||||
// Try to find this pod condition.
|
// Try to find this pod condition.
|
||||||
conditionIndex, oldCondition := GetPodCondition(status, condition.Type)
|
conditionIndex, oldCondition := GetPodCondition(status, condition.Type)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api/resource"
|
"k8s.io/kubernetes/pkg/api/resource"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestResourceHelpers(t *testing.T) {
|
func TestResourceHelpers(t *testing.T) {
|
||||||
@ -64,7 +64,7 @@ func TestDefaultResourceHelpers(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func newPod(now unversioned.Time, ready bool, beforeSec int) *Pod {
|
func newPod(now metav1.Time, ready bool, beforeSec int) *Pod {
|
||||||
conditionStatus := ConditionFalse
|
conditionStatus := ConditionFalse
|
||||||
if ready {
|
if ready {
|
||||||
conditionStatus = ConditionTrue
|
conditionStatus = ConditionTrue
|
||||||
@ -74,7 +74,7 @@ func newPod(now unversioned.Time, ready bool, beforeSec int) *Pod {
|
|||||||
Conditions: []PodCondition{
|
Conditions: []PodCondition{
|
||||||
{
|
{
|
||||||
Type: PodReady,
|
Type: PodReady,
|
||||||
LastTransitionTime: unversioned.NewTime(now.Time.Add(-1 * time.Duration(beforeSec) * time.Second)),
|
LastTransitionTime: metav1.NewTime(now.Time.Add(-1 * time.Duration(beforeSec) * time.Second)),
|
||||||
Status: conditionStatus,
|
Status: conditionStatus,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -83,7 +83,7 @@ func newPod(now unversioned.Time, ready bool, beforeSec int) *Pod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestIsPodAvailable(t *testing.T) {
|
func TestIsPodAvailable(t *testing.T) {
|
||||||
now := unversioned.Now()
|
now := metav1.Now()
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
pod *Pod
|
pod *Pod
|
||||||
minReadySeconds int32
|
minReadySeconds int32
|
||||||
|
@ -26,9 +26,9 @@ go_library(
|
|||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/errors:go_default_library",
|
"//pkg/api/errors:go_default_library",
|
||||||
"//pkg/api/meta:go_default_library",
|
"//pkg/api/meta:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/validation:go_default_library",
|
"//pkg/api/validation:go_default_library",
|
||||||
"//pkg/api/validation/path:go_default_library",
|
"//pkg/api/validation/path:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/runtime/schema:go_default_library",
|
"//pkg/runtime/schema:go_default_library",
|
||||||
"//pkg/util/validation/field:go_default_library",
|
"//pkg/util/validation/field:go_default_library",
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/errors"
|
"k8s.io/kubernetes/pkg/api/errors"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
)
|
)
|
||||||
@ -98,7 +98,7 @@ func BeforeDelete(strategy RESTDeleteStrategy, ctx api.Context, obj runtime.Obje
|
|||||||
if period >= *objectMeta.DeletionGracePeriodSeconds {
|
if period >= *objectMeta.DeletionGracePeriodSeconds {
|
||||||
return false, true, nil
|
return false, true, nil
|
||||||
}
|
}
|
||||||
newDeletionTimestamp := unversioned.NewTime(
|
newDeletionTimestamp := metav1.NewTime(
|
||||||
objectMeta.DeletionTimestamp.Add(-time.Second * time.Duration(*objectMeta.DeletionGracePeriodSeconds)).
|
objectMeta.DeletionTimestamp.Add(-time.Second * time.Duration(*objectMeta.DeletionGracePeriodSeconds)).
|
||||||
Add(time.Second * time.Duration(*options.GracePeriodSeconds)))
|
Add(time.Second * time.Duration(*options.GracePeriodSeconds)))
|
||||||
objectMeta.DeletionTimestamp = &newDeletionTimestamp
|
objectMeta.DeletionTimestamp = &newDeletionTimestamp
|
||||||
@ -113,7 +113,7 @@ func BeforeDelete(strategy RESTDeleteStrategy, ctx api.Context, obj runtime.Obje
|
|||||||
if !gracefulStrategy.CheckGracefulDelete(ctx, obj, options) {
|
if !gracefulStrategy.CheckGracefulDelete(ctx, obj, options) {
|
||||||
return false, false, nil
|
return false, false, nil
|
||||||
}
|
}
|
||||||
now := unversioned.NewTime(unversioned.Now().Add(time.Second * time.Duration(*options.GracePeriodSeconds)))
|
now := metav1.NewTime(metav1.Now().Add(time.Second * time.Duration(*options.GracePeriodSeconds)))
|
||||||
objectMeta.DeletionTimestamp = &now
|
objectMeta.DeletionTimestamp = &now
|
||||||
objectMeta.DeletionGracePeriodSeconds = options.GracePeriodSeconds
|
objectMeta.DeletionGracePeriodSeconds = options.GracePeriodSeconds
|
||||||
// If it's the first graceful deletion we are going to set the DeletionTimestamp to non-nil.
|
// If it's the first graceful deletion we are going to set the DeletionTimestamp to non-nil.
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
"k8s.io/kubernetes/pkg/watch"
|
"k8s.io/kubernetes/pkg/watch"
|
||||||
@ -78,7 +78,7 @@ type Exporter interface {
|
|||||||
// Export an object. Fields that are not user specified (e.g. Status, ObjectMeta.ResourceVersion) are stripped out
|
// Export an object. Fields that are not user specified (e.g. Status, ObjectMeta.ResourceVersion) are stripped out
|
||||||
// Returns the stripped object. If 'exact' is true, fields that are specific to the cluster (e.g. namespace) are
|
// Returns the stripped object. If 'exact' is true, fields that are specific to the cluster (e.g. namespace) are
|
||||||
// retained, otherwise they are stripped also.
|
// retained, otherwise they are stripped also.
|
||||||
Export(ctx api.Context, name string, opts unversioned.ExportOptions) (runtime.Object, error)
|
Export(ctx api.Context, name string, opts metav1.ExportOptions) (runtime.Object, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getter is an object that can retrieve a named RESTful resource.
|
// Getter is an object that can retrieve a named RESTful resource.
|
||||||
|
@ -18,8 +18,8 @@ go_library(
|
|||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/errors:go_default_library",
|
"//pkg/api/errors:go_default_library",
|
||||||
"//pkg/api/rest:go_default_library",
|
"//pkg/api/rest:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/validation/path:go_default_library",
|
"//pkg/api/validation/path:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/conversion:go_default_library",
|
"//pkg/conversion:go_default_library",
|
||||||
"//pkg/fields:go_default_library",
|
"//pkg/fields:go_default_library",
|
||||||
"//pkg/labels:go_default_library",
|
"//pkg/labels:go_default_library",
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/errors"
|
"k8s.io/kubernetes/pkg/api/errors"
|
||||||
"k8s.io/kubernetes/pkg/api/rest"
|
"k8s.io/kubernetes/pkg/api/rest"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/validation/path"
|
"k8s.io/kubernetes/pkg/api/validation/path"
|
||||||
"k8s.io/kubernetes/pkg/conversion"
|
"k8s.io/kubernetes/pkg/conversion"
|
||||||
"k8s.io/kubernetes/pkg/fields"
|
"k8s.io/kubernetes/pkg/fields"
|
||||||
@ -415,7 +415,7 @@ func (t *Tester) testCreateRejectsMismatchedNamespace(valid runtime.Object) {
|
|||||||
|
|
||||||
func (t *Tester) testCreateResetsUserData(valid runtime.Object) {
|
func (t *Tester) testCreateResetsUserData(valid runtime.Object) {
|
||||||
objectMeta := t.getObjectMetaOrFail(valid)
|
objectMeta := t.getObjectMetaOrFail(valid)
|
||||||
now := unversioned.Now()
|
now := metav1.Now()
|
||||||
objectMeta.UID = "bad-uid"
|
objectMeta.UID = "bad-uid"
|
||||||
objectMeta.CreationTimestamp = now
|
objectMeta.CreationTimestamp = now
|
||||||
|
|
||||||
@ -761,9 +761,9 @@ func (t *Tester) testDeleteNoGraceful(obj runtime.Object, createFn CreateFunc, g
|
|||||||
t.Errorf("unexpected error: %v", err)
|
t.Errorf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
if !t.returnDeletedObject {
|
if !t.returnDeletedObject {
|
||||||
if status, ok := obj.(*unversioned.Status); !ok {
|
if status, ok := obj.(*metav1.Status); !ok {
|
||||||
t.Errorf("expected status of delete, got %v", status)
|
t.Errorf("expected status of delete, got %v", status)
|
||||||
} else if status.Status != unversioned.StatusSuccess {
|
} else if status.Status != metav1.StatusSuccess {
|
||||||
t.Errorf("expected success, got: %v", status.Status)
|
t.Errorf("expected success, got: %v", status.Status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -807,9 +807,9 @@ func (t *Tester) testDeleteWithUID(obj runtime.Object, createFn CreateFunc, getF
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !t.returnDeletedObject {
|
if !t.returnDeletedObject {
|
||||||
if status, ok := obj.(*unversioned.Status); !ok {
|
if status, ok := obj.(*metav1.Status); !ok {
|
||||||
t.Errorf("expected status of delete, got %v", status)
|
t.Errorf("expected status of delete, got %v", status)
|
||||||
} else if status.Status != unversioned.StatusSuccess {
|
} else if status.Status != metav1.StatusSuccess {
|
||||||
t.Errorf("expected success, got: %v", status.Status)
|
t.Errorf("expected success, got: %v", status.Status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/api/meta"
|
"k8s.io/kubernetes/pkg/api/meta"
|
||||||
"k8s.io/kubernetes/pkg/api/testapi"
|
"k8s.io/kubernetes/pkg/api/testapi"
|
||||||
apitesting "k8s.io/kubernetes/pkg/api/testing"
|
apitesting "k8s.io/kubernetes/pkg/api/testing"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||||
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||||
@ -365,11 +365,11 @@ func TestBadJSONRejection(t *testing.T) {
|
|||||||
|
|
||||||
func TestUnversionedTypes(t *testing.T) {
|
func TestUnversionedTypes(t *testing.T) {
|
||||||
testcases := []runtime.Object{
|
testcases := []runtime.Object{
|
||||||
&unversioned.Status{Status: "Failure", Message: "something went wrong"},
|
&metav1.Status{Status: "Failure", Message: "something went wrong"},
|
||||||
&unversioned.APIVersions{Versions: []string{"A", "B", "C"}},
|
&metav1.APIVersions{Versions: []string{"A", "B", "C"}},
|
||||||
&unversioned.APIGroupList{Groups: []unversioned.APIGroup{{Name: "mygroup"}}},
|
&metav1.APIGroupList{Groups: []metav1.APIGroup{{Name: "mygroup"}}},
|
||||||
&unversioned.APIGroup{Name: "mygroup"},
|
&metav1.APIGroup{Name: "mygroup"},
|
||||||
&unversioned.APIResourceList{GroupVersion: "mygroup/myversion"},
|
&metav1.APIResourceList{GroupVersion: "mygroup/myversion"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, obj := range testcases {
|
for _, obj := range testcases {
|
||||||
|
@ -57,7 +57,7 @@ go_test(
|
|||||||
library = "go_default_library",
|
library = "go_default_library",
|
||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -67,10 +67,10 @@ func TestResourcePath(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var status = &unversioned.Status{
|
var status = &metav1.Status{
|
||||||
Status: unversioned.StatusFailure,
|
Status: metav1.StatusFailure,
|
||||||
Code: 200,
|
Code: 200,
|
||||||
Reason: unversioned.StatusReasonUnknown,
|
Reason: metav1.StatusReasonUnknown,
|
||||||
Message: "",
|
Message: "",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ func TestV1EncodeDecodeStatus(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("unexpected error: %v", err)
|
t.Errorf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
typeMeta := unversioned.TypeMeta{}
|
typeMeta := metav1.TypeMeta{}
|
||||||
if err := json.Unmarshal(encoded, &typeMeta); err != nil {
|
if err := json.Unmarshal(encoded, &typeMeta); err != nil {
|
||||||
t.Errorf("unexpected error: %v", err)
|
t.Errorf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ func testEncodeDecodeStatus(t *testing.T, codec runtime.Codec) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("unexpected error: %v", err)
|
t.Errorf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
typeMeta := unversioned.TypeMeta{}
|
typeMeta := metav1.TypeMeta{}
|
||||||
if err := json.Unmarshal(encoded, &typeMeta); err != nil {
|
if err := json.Unmarshal(encoded, &typeMeta); err != nil {
|
||||||
t.Errorf("unexpected error: %v", err)
|
t.Errorf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -23,11 +23,11 @@ go_library(
|
|||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/resource:go_default_library",
|
"//pkg/api/resource:go_default_library",
|
||||||
"//pkg/api/testapi:go_default_library",
|
"//pkg/api/testapi:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
"//pkg/apis/autoscaling:go_default_library",
|
"//pkg/apis/autoscaling:go_default_library",
|
||||||
"//pkg/apis/batch:go_default_library",
|
"//pkg/apis/batch:go_default_library",
|
||||||
"//pkg/apis/extensions:go_default_library",
|
"//pkg/apis/extensions:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/apis/policy:go_default_library",
|
"//pkg/apis/policy:go_default_library",
|
||||||
"//pkg/apis/rbac:go_default_library",
|
"//pkg/apis/rbac:go_default_library",
|
||||||
"//pkg/fields:go_default_library",
|
"//pkg/fields:go_default_library",
|
||||||
|
@ -27,7 +27,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/resource"
|
"k8s.io/kubernetes/pkg/api/resource"
|
||||||
"k8s.io/kubernetes/pkg/api/testapi"
|
"k8s.io/kubernetes/pkg/api/testapi"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/apis/autoscaling"
|
"k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||||
"k8s.io/kubernetes/pkg/apis/batch"
|
"k8s.io/kubernetes/pkg/apis/batch"
|
||||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||||
@ -70,7 +70,7 @@ func FuzzerFor(t *testing.T, version schema.GroupVersion, src rand.Source) *fuzz
|
|||||||
j.APIVersion = ""
|
j.APIVersion = ""
|
||||||
j.Kind = ""
|
j.Kind = ""
|
||||||
},
|
},
|
||||||
func(j *unversioned.TypeMeta, c fuzz.Continue) {
|
func(j *metav1.TypeMeta, c fuzz.Continue) {
|
||||||
// We have to customize the randomization of TypeMetas because their
|
// We have to customize the randomization of TypeMetas because their
|
||||||
// APIVersion and Kind must remain blank in memory.
|
// APIVersion and Kind must remain blank in memory.
|
||||||
j.APIVersion = ""
|
j.APIVersion = ""
|
||||||
@ -86,7 +86,7 @@ func FuzzerFor(t *testing.T, version schema.GroupVersion, src rand.Source) *fuzz
|
|||||||
var sec, nsec int64
|
var sec, nsec int64
|
||||||
c.Fuzz(&sec)
|
c.Fuzz(&sec)
|
||||||
c.Fuzz(&nsec)
|
c.Fuzz(&nsec)
|
||||||
j.CreationTimestamp = unversioned.Unix(sec, nsec).Rfc3339Copy()
|
j.CreationTimestamp = metav1.Unix(sec, nsec).Rfc3339Copy()
|
||||||
},
|
},
|
||||||
func(j *api.ObjectReference, c fuzz.Continue) {
|
func(j *api.ObjectReference, c fuzz.Continue) {
|
||||||
// We have to customize the randomization of TypeMetas because their
|
// We have to customize the randomization of TypeMetas because their
|
||||||
@ -98,7 +98,7 @@ func FuzzerFor(t *testing.T, version schema.GroupVersion, src rand.Source) *fuzz
|
|||||||
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
||||||
j.FieldPath = c.RandString()
|
j.FieldPath = c.RandString()
|
||||||
},
|
},
|
||||||
func(j *unversioned.ListMeta, c fuzz.Continue) {
|
func(j *metav1.ListMeta, c fuzz.Continue) {
|
||||||
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
||||||
j.SelfLink = c.RandString()
|
j.SelfLink = c.RandString()
|
||||||
},
|
},
|
||||||
@ -488,14 +488,14 @@ func FuzzerFor(t *testing.T, version schema.GroupVersion, src rand.Source) *fuzz
|
|||||||
// TODO: Implement a fuzzer to generate valid keys, values and operators for
|
// TODO: Implement a fuzzer to generate valid keys, values and operators for
|
||||||
// selector requirements.
|
// selector requirements.
|
||||||
if s.Status.Selector != nil {
|
if s.Status.Selector != nil {
|
||||||
s.Status.Selector = &unversioned.LabelSelector{
|
s.Status.Selector = &metav1.LabelSelector{
|
||||||
MatchLabels: map[string]string{
|
MatchLabels: map[string]string{
|
||||||
"testlabelkey": "testlabelval",
|
"testlabelkey": "testlabelval",
|
||||||
},
|
},
|
||||||
MatchExpressions: []unversioned.LabelSelectorRequirement{
|
MatchExpressions: []metav1.LabelSelectorRequirement{
|
||||||
{
|
{
|
||||||
Key: "testkey",
|
Key: "testkey",
|
||||||
Operator: unversioned.LabelSelectorOpIn,
|
Operator: metav1.LabelSelectorOpIn,
|
||||||
Values: []string{"val1", "val2", "val3"},
|
Values: []string{"val1", "val2", "val3"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
codec1978 "github.com/ugorji/go/codec"
|
codec1978 "github.com/ugorji/go/codec"
|
||||||
pkg3_resource "k8s.io/kubernetes/pkg/api/resource"
|
pkg3_resource "k8s.io/kubernetes/pkg/api/resource"
|
||||||
pkg2_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
pkg2_unversioned "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
pkg6_fields "k8s.io/kubernetes/pkg/fields"
|
pkg6_fields "k8s.io/kubernetes/pkg/fields"
|
||||||
pkg5_labels "k8s.io/kubernetes/pkg/labels"
|
pkg5_labels "k8s.io/kubernetes/pkg/labels"
|
||||||
pkg7_runtime "k8s.io/kubernetes/pkg/runtime"
|
pkg7_runtime "k8s.io/kubernetes/pkg/runtime"
|
||||||
|
162
pkg/api/types.go
162
pkg/api/types.go
@ -18,7 +18,7 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/resource"
|
"k8s.io/kubernetes/pkg/api/resource"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/fields"
|
"k8s.io/kubernetes/pkg/fields"
|
||||||
"k8s.io/kubernetes/pkg/labels"
|
"k8s.io/kubernetes/pkg/labels"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
@ -112,7 +112,7 @@ type ObjectMeta struct {
|
|||||||
// created. It is not guaranteed to be set in happens-before order across separate operations.
|
// created. It is not guaranteed to be set in happens-before order across separate operations.
|
||||||
// Clients may not set this value. It is represented in RFC3339 form and is in UTC.
|
// Clients may not set this value. It is represented in RFC3339 form and is in UTC.
|
||||||
// +optional
|
// +optional
|
||||||
CreationTimestamp unversioned.Time `json:"creationTimestamp,omitempty"`
|
CreationTimestamp metav1.Time `json:"creationTimestamp,omitempty"`
|
||||||
|
|
||||||
// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This
|
// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This
|
||||||
// field is set by the server when a graceful deletion is requested by the user, and is not
|
// field is set by the server when a graceful deletion is requested by the user, and is not
|
||||||
@ -132,7 +132,7 @@ type ObjectMeta struct {
|
|||||||
// Read-only.
|
// Read-only.
|
||||||
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
|
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
|
||||||
// +optional
|
// +optional
|
||||||
DeletionTimestamp *unversioned.Time `json:"deletionTimestamp,omitempty"`
|
DeletionTimestamp *metav1.Time `json:"deletionTimestamp,omitempty"`
|
||||||
|
|
||||||
// DeletionGracePeriodSeconds records the graceful deletion value set when graceful deletion
|
// DeletionGracePeriodSeconds records the graceful deletion value set when graceful deletion
|
||||||
// was requested. Represents the most recent grace period, and may only be shortened once set.
|
// was requested. Represents the most recent grace period, and may only be shortened once set.
|
||||||
@ -368,7 +368,7 @@ type PersistentVolumeClaimVolumeSource struct {
|
|||||||
// +nonNamespaced=true
|
// +nonNamespaced=true
|
||||||
|
|
||||||
type PersistentVolume struct {
|
type PersistentVolume struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -429,9 +429,9 @@ type PersistentVolumeStatus struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PersistentVolumeList struct {
|
type PersistentVolumeList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
Items []PersistentVolume `json:"items"`
|
Items []PersistentVolume `json:"items"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ type PersistentVolumeList struct {
|
|||||||
|
|
||||||
// PersistentVolumeClaim is a user's request for and claim to a persistent volume
|
// PersistentVolumeClaim is a user's request for and claim to a persistent volume
|
||||||
type PersistentVolumeClaim struct {
|
type PersistentVolumeClaim struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -453,9 +453,9 @@ type PersistentVolumeClaim struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PersistentVolumeClaimList struct {
|
type PersistentVolumeClaimList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
Items []PersistentVolumeClaim `json:"items"`
|
Items []PersistentVolumeClaim `json:"items"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,7 +468,7 @@ type PersistentVolumeClaimSpec struct {
|
|||||||
// A label query over volumes to consider for binding. This selector is
|
// A label query over volumes to consider for binding. This selector is
|
||||||
// ignored when VolumeName is set
|
// ignored when VolumeName is set
|
||||||
// +optional
|
// +optional
|
||||||
Selector *unversioned.LabelSelector `json:"selector,omitempty"`
|
Selector *metav1.LabelSelector `json:"selector,omitempty"`
|
||||||
// Resources represents the minimum resources required
|
// Resources represents the minimum resources required
|
||||||
// +optional
|
// +optional
|
||||||
Resources ResourceRequirements `json:"resources,omitempty"`
|
Resources ResourceRequirements `json:"resources,omitempty"`
|
||||||
@ -1362,7 +1362,7 @@ type ContainerStateWaiting struct {
|
|||||||
|
|
||||||
type ContainerStateRunning struct {
|
type ContainerStateRunning struct {
|
||||||
// +optional
|
// +optional
|
||||||
StartedAt unversioned.Time `json:"startedAt,omitempty"`
|
StartedAt metav1.Time `json:"startedAt,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ContainerStateTerminated struct {
|
type ContainerStateTerminated struct {
|
||||||
@ -1374,9 +1374,9 @@ type ContainerStateTerminated struct {
|
|||||||
// +optional
|
// +optional
|
||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
// +optional
|
// +optional
|
||||||
StartedAt unversioned.Time `json:"startedAt,omitempty"`
|
StartedAt metav1.Time `json:"startedAt,omitempty"`
|
||||||
// +optional
|
// +optional
|
||||||
FinishedAt unversioned.Time `json:"finishedAt,omitempty"`
|
FinishedAt metav1.Time `json:"finishedAt,omitempty"`
|
||||||
// +optional
|
// +optional
|
||||||
ContainerID string `json:"containerID,omitempty"`
|
ContainerID string `json:"containerID,omitempty"`
|
||||||
}
|
}
|
||||||
@ -1454,9 +1454,9 @@ type PodCondition struct {
|
|||||||
Type PodConditionType `json:"type"`
|
Type PodConditionType `json:"type"`
|
||||||
Status ConditionStatus `json:"status"`
|
Status ConditionStatus `json:"status"`
|
||||||
// +optional
|
// +optional
|
||||||
LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"`
|
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"`
|
||||||
// +optional
|
// +optional
|
||||||
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
|
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||||
// +optional
|
// +optional
|
||||||
Reason string `json:"reason,omitempty"`
|
Reason string `json:"reason,omitempty"`
|
||||||
// +optional
|
// +optional
|
||||||
@ -1477,9 +1477,9 @@ const (
|
|||||||
|
|
||||||
// PodList is a list of Pods.
|
// PodList is a list of Pods.
|
||||||
type PodList struct {
|
type PodList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []Pod `json:"items"`
|
Items []Pod `json:"items"`
|
||||||
}
|
}
|
||||||
@ -1641,7 +1641,7 @@ type WeightedPodAffinityTerm struct {
|
|||||||
type PodAffinityTerm struct {
|
type PodAffinityTerm struct {
|
||||||
// A label query over a set of resources, in this case pods.
|
// A label query over a set of resources, in this case pods.
|
||||||
// +optional
|
// +optional
|
||||||
LabelSelector *unversioned.LabelSelector `json:"labelSelector,omitempty"`
|
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||||
// namespaces specifies which namespaces the labelSelector applies to (matches against);
|
// namespaces specifies which namespaces the labelSelector applies to (matches against);
|
||||||
// nil list means "this pod's namespace," empty list means "all namespaces"
|
// nil list means "this pod's namespace," empty list means "all namespaces"
|
||||||
// The json tag here is not "omitempty" since we need to distinguish nil and empty.
|
// The json tag here is not "omitempty" since we need to distinguish nil and empty.
|
||||||
@ -1916,7 +1916,7 @@ type PodStatus struct {
|
|||||||
// Date and time at which the object was acknowledged by the Kubelet.
|
// Date and time at which the object was acknowledged by the Kubelet.
|
||||||
// This is before the Kubelet pulled the container image(s) for the pod.
|
// This is before the Kubelet pulled the container image(s) for the pod.
|
||||||
// +optional
|
// +optional
|
||||||
StartTime *unversioned.Time `json:"startTime,omitempty"`
|
StartTime *metav1.Time `json:"startTime,omitempty"`
|
||||||
|
|
||||||
// The list has one entry per init container in the manifest. The most recent successful
|
// The list has one entry per init container in the manifest. The most recent successful
|
||||||
// init container will have ready = true, the most recently started container will have
|
// init container will have ready = true, the most recently started container will have
|
||||||
@ -1934,7 +1934,7 @@ type PodStatus struct {
|
|||||||
|
|
||||||
// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded
|
// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded
|
||||||
type PodStatusResult struct {
|
type PodStatusResult struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
// Status represents the current information about a pod. This data may not be up
|
// Status represents the current information about a pod. This data may not be up
|
||||||
@ -1947,7 +1947,7 @@ type PodStatusResult struct {
|
|||||||
|
|
||||||
// Pod is a collection of containers, used as either input (create, update) or as output (list, get).
|
// Pod is a collection of containers, used as either input (create, update) or as output (list, get).
|
||||||
type Pod struct {
|
type Pod struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -1976,7 +1976,7 @@ type PodTemplateSpec struct {
|
|||||||
|
|
||||||
// PodTemplate describes a template for creating copies of a predefined pod.
|
// PodTemplate describes a template for creating copies of a predefined pod.
|
||||||
type PodTemplate struct {
|
type PodTemplate struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -1987,9 +1987,9 @@ type PodTemplate struct {
|
|||||||
|
|
||||||
// PodTemplateList is a list of PodTemplates.
|
// PodTemplateList is a list of PodTemplates.
|
||||||
type PodTemplateList struct {
|
type PodTemplateList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []PodTemplate `json:"items"`
|
Items []PodTemplate `json:"items"`
|
||||||
}
|
}
|
||||||
@ -2068,7 +2068,7 @@ type ReplicationControllerCondition struct {
|
|||||||
Status ConditionStatus `json:"status"`
|
Status ConditionStatus `json:"status"`
|
||||||
// The last time the condition transitioned from one status to another.
|
// The last time the condition transitioned from one status to another.
|
||||||
// +optional
|
// +optional
|
||||||
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
|
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||||
// The reason for the condition's last transition.
|
// The reason for the condition's last transition.
|
||||||
// +optional
|
// +optional
|
||||||
Reason string `json:"reason,omitempty"`
|
Reason string `json:"reason,omitempty"`
|
||||||
@ -2081,7 +2081,7 @@ type ReplicationControllerCondition struct {
|
|||||||
|
|
||||||
// ReplicationController represents the configuration of a replication controller.
|
// ReplicationController represents the configuration of a replication controller.
|
||||||
type ReplicationController struct {
|
type ReplicationController struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -2097,9 +2097,9 @@ type ReplicationController struct {
|
|||||||
|
|
||||||
// ReplicationControllerList is a collection of replication controllers.
|
// ReplicationControllerList is a collection of replication controllers.
|
||||||
type ReplicationControllerList struct {
|
type ReplicationControllerList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []ReplicationController `json:"items"`
|
Items []ReplicationController `json:"items"`
|
||||||
}
|
}
|
||||||
@ -2112,9 +2112,9 @@ const (
|
|||||||
|
|
||||||
// ServiceList holds a list of services.
|
// ServiceList holds a list of services.
|
||||||
type ServiceList struct {
|
type ServiceList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []Service `json:"items"`
|
Items []Service `json:"items"`
|
||||||
}
|
}
|
||||||
@ -2286,7 +2286,7 @@ type ServicePort struct {
|
|||||||
// (for example 3306) that the proxy listens on, and the selector that determines which pods
|
// (for example 3306) that the proxy listens on, and the selector that determines which pods
|
||||||
// will answer requests sent through the proxy.
|
// will answer requests sent through the proxy.
|
||||||
type Service struct {
|
type Service struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -2306,7 +2306,7 @@ type Service struct {
|
|||||||
// * a principal that can be authenticated and authorized
|
// * a principal that can be authenticated and authorized
|
||||||
// * a set of secrets
|
// * a set of secrets
|
||||||
type ServiceAccount struct {
|
type ServiceAccount struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -2322,9 +2322,9 @@ type ServiceAccount struct {
|
|||||||
|
|
||||||
// ServiceAccountList is a list of ServiceAccount objects
|
// ServiceAccountList is a list of ServiceAccount objects
|
||||||
type ServiceAccountList struct {
|
type ServiceAccountList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []ServiceAccount `json:"items"`
|
Items []ServiceAccount `json:"items"`
|
||||||
}
|
}
|
||||||
@ -2344,7 +2344,7 @@ type ServiceAccountList struct {
|
|||||||
// },
|
// },
|
||||||
// ]
|
// ]
|
||||||
type Endpoints struct {
|
type Endpoints struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -2401,9 +2401,9 @@ type EndpointPort struct {
|
|||||||
|
|
||||||
// EndpointsList is a list of endpoints.
|
// EndpointsList is a list of endpoints.
|
||||||
type EndpointsList struct {
|
type EndpointsList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []Endpoints `json:"items"`
|
Items []Endpoints `json:"items"`
|
||||||
}
|
}
|
||||||
@ -2537,7 +2537,7 @@ type PreferAvoidPodsEntry struct {
|
|||||||
PodSignature PodSignature `json:"podSignature"`
|
PodSignature PodSignature `json:"podSignature"`
|
||||||
// Time at which this entry was added to the list.
|
// Time at which this entry was added to the list.
|
||||||
// +optional
|
// +optional
|
||||||
EvictionTime unversioned.Time `json:"evictionTime,omitempty"`
|
EvictionTime metav1.Time `json:"evictionTime,omitempty"`
|
||||||
// (brief) reason why this entry was added to the list.
|
// (brief) reason why this entry was added to the list.
|
||||||
// +optional
|
// +optional
|
||||||
Reason string `json:"reason,omitempty"`
|
Reason string `json:"reason,omitempty"`
|
||||||
@ -2598,9 +2598,9 @@ type NodeCondition struct {
|
|||||||
Type NodeConditionType `json:"type"`
|
Type NodeConditionType `json:"type"`
|
||||||
Status ConditionStatus `json:"status"`
|
Status ConditionStatus `json:"status"`
|
||||||
// +optional
|
// +optional
|
||||||
LastHeartbeatTime unversioned.Time `json:"lastHeartbeatTime,omitempty"`
|
LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime,omitempty"`
|
||||||
// +optional
|
// +optional
|
||||||
LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
|
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||||
// +optional
|
// +optional
|
||||||
Reason string `json:"reason,omitempty"`
|
Reason string `json:"reason,omitempty"`
|
||||||
// +optional
|
// +optional
|
||||||
@ -2666,7 +2666,7 @@ type ResourceList map[ResourceName]resource.Quantity
|
|||||||
// Node is a worker node in Kubernetes
|
// Node is a worker node in Kubernetes
|
||||||
// The name of the node according to etcd is in ObjectMeta.Name.
|
// The name of the node according to etcd is in ObjectMeta.Name.
|
||||||
type Node struct {
|
type Node struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -2681,9 +2681,9 @@ type Node struct {
|
|||||||
|
|
||||||
// NodeList is a list of nodes.
|
// NodeList is a list of nodes.
|
||||||
type NodeList struct {
|
type NodeList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []Node `json:"items"`
|
Items []Node `json:"items"`
|
||||||
}
|
}
|
||||||
@ -2725,7 +2725,7 @@ const (
|
|||||||
// A namespace provides a scope for Names.
|
// A namespace provides a scope for Names.
|
||||||
// Use of multiple namespaces is optional
|
// Use of multiple namespaces is optional
|
||||||
type Namespace struct {
|
type Namespace struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -2740,16 +2740,16 @@ type Namespace struct {
|
|||||||
|
|
||||||
// NamespaceList is a list of Namespaces.
|
// NamespaceList is a list of Namespaces.
|
||||||
type NamespaceList struct {
|
type NamespaceList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []Namespace `json:"items"`
|
Items []Namespace `json:"items"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Binding ties one object to another - for example, a pod is bound to a node by a scheduler.
|
// Binding ties one object to another - for example, a pod is bound to a node by a scheduler.
|
||||||
type Binding struct {
|
type Binding struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// ObjectMeta describes the object that is being bound.
|
// ObjectMeta describes the object that is being bound.
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
@ -2767,7 +2767,7 @@ type Preconditions struct {
|
|||||||
|
|
||||||
// DeleteOptions may be provided when deleting an API object
|
// DeleteOptions may be provided when deleting an API object
|
||||||
type DeleteOptions struct {
|
type DeleteOptions struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
// Optional duration in seconds before the object should be deleted. Value must be non-negative integer.
|
// Optional 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
|
// The value zero indicates delete immediately. If this value is nil, the default grace period for the
|
||||||
@ -2789,7 +2789,7 @@ type DeleteOptions struct {
|
|||||||
// ListOptions is the query options to a standard REST list call, and has future support for
|
// ListOptions is the query options to a standard REST list call, and has future support for
|
||||||
// watch calls.
|
// watch calls.
|
||||||
type ListOptions struct {
|
type ListOptions struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
// A selector based on labels
|
// A selector based on labels
|
||||||
LabelSelector labels.Selector
|
LabelSelector labels.Selector
|
||||||
@ -2809,7 +2809,7 @@ type ListOptions struct {
|
|||||||
|
|
||||||
// PodLogOptions is the query options for a Pod's logs REST call
|
// PodLogOptions is the query options for a Pod's logs REST call
|
||||||
type PodLogOptions struct {
|
type PodLogOptions struct {
|
||||||
unversioned.TypeMeta
|
metav1.TypeMeta
|
||||||
|
|
||||||
// Container for which to return logs
|
// Container for which to return logs
|
||||||
Container string
|
Container string
|
||||||
@ -2826,7 +2826,7 @@ type PodLogOptions struct {
|
|||||||
// precedes the time a pod was started, only logs since the pod start will be returned.
|
// precedes the time a pod was started, only logs since the pod start will be returned.
|
||||||
// If this value is in the future, no logs will be returned.
|
// If this value is in the future, no logs will be returned.
|
||||||
// Only one of sinceSeconds or sinceTime may be specified.
|
// Only one of sinceSeconds or sinceTime may be specified.
|
||||||
SinceTime *unversioned.Time
|
SinceTime *metav1.Time
|
||||||
// If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line
|
// If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line
|
||||||
// of log output.
|
// of log output.
|
||||||
Timestamps bool
|
Timestamps bool
|
||||||
@ -2842,7 +2842,7 @@ type PodLogOptions struct {
|
|||||||
// PodAttachOptions is the query options to a Pod's remote attach call
|
// PodAttachOptions is the query options to a Pod's remote attach call
|
||||||
// TODO: merge w/ PodExecOptions below for stdin, stdout, etc
|
// TODO: merge w/ PodExecOptions below for stdin, stdout, etc
|
||||||
type PodAttachOptions struct {
|
type PodAttachOptions struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
// Stdin if true indicates that stdin is to be redirected for the attach call
|
// Stdin if true indicates that stdin is to be redirected for the attach call
|
||||||
// +optional
|
// +optional
|
||||||
@ -2867,7 +2867,7 @@ type PodAttachOptions struct {
|
|||||||
|
|
||||||
// PodExecOptions is the query options to a Pod's remote exec call
|
// PodExecOptions is the query options to a Pod's remote exec call
|
||||||
type PodExecOptions struct {
|
type PodExecOptions struct {
|
||||||
unversioned.TypeMeta
|
metav1.TypeMeta
|
||||||
|
|
||||||
// Stdin if true indicates that stdin is to be redirected for the exec call
|
// Stdin if true indicates that stdin is to be redirected for the exec call
|
||||||
Stdin bool
|
Stdin bool
|
||||||
@ -2890,7 +2890,7 @@ type PodExecOptions struct {
|
|||||||
|
|
||||||
// PodProxyOptions is the query options to a Pod's proxy call
|
// PodProxyOptions is the query options to a Pod's proxy call
|
||||||
type PodProxyOptions struct {
|
type PodProxyOptions struct {
|
||||||
unversioned.TypeMeta
|
metav1.TypeMeta
|
||||||
|
|
||||||
// Path is the URL path to use for the current proxy request
|
// Path is the URL path to use for the current proxy request
|
||||||
Path string
|
Path string
|
||||||
@ -2898,7 +2898,7 @@ type PodProxyOptions struct {
|
|||||||
|
|
||||||
// NodeProxyOptions is the query options to a Node's proxy call
|
// NodeProxyOptions is the query options to a Node's proxy call
|
||||||
type NodeProxyOptions struct {
|
type NodeProxyOptions struct {
|
||||||
unversioned.TypeMeta
|
metav1.TypeMeta
|
||||||
|
|
||||||
// Path is the URL path to use for the current proxy request
|
// Path is the URL path to use for the current proxy request
|
||||||
Path string
|
Path string
|
||||||
@ -2906,7 +2906,7 @@ type NodeProxyOptions struct {
|
|||||||
|
|
||||||
// ServiceProxyOptions is the query options to a Service's proxy call.
|
// ServiceProxyOptions is the query options to a Service's proxy call.
|
||||||
type ServiceProxyOptions struct {
|
type ServiceProxyOptions struct {
|
||||||
unversioned.TypeMeta
|
metav1.TypeMeta
|
||||||
|
|
||||||
// Path is the part of URLs that include service endpoints, suffixes,
|
// Path is the part of URLs that include service endpoints, suffixes,
|
||||||
// and parameters to use for the current proxy request to service.
|
// and parameters to use for the current proxy request to service.
|
||||||
@ -2970,7 +2970,7 @@ type LocalObjectReference struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SerializedReference struct {
|
type SerializedReference struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
Reference ObjectReference `json:"reference,omitempty"`
|
Reference ObjectReference `json:"reference,omitempty"`
|
||||||
}
|
}
|
||||||
@ -2997,7 +2997,7 @@ const (
|
|||||||
// Event is a report of an event somewhere in the cluster.
|
// Event is a report of an event somewhere in the cluster.
|
||||||
// TODO: Decide whether to store these separately or with the object they apply to.
|
// TODO: Decide whether to store these separately or with the object they apply to.
|
||||||
type Event struct {
|
type Event struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -3023,11 +3023,11 @@ type Event struct {
|
|||||||
|
|
||||||
// The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)
|
// The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)
|
||||||
// +optional
|
// +optional
|
||||||
FirstTimestamp unversioned.Time `json:"firstTimestamp,omitempty"`
|
FirstTimestamp metav1.Time `json:"firstTimestamp,omitempty"`
|
||||||
|
|
||||||
// The time at which the most recent occurrence of this event was recorded.
|
// The time at which the most recent occurrence of this event was recorded.
|
||||||
// +optional
|
// +optional
|
||||||
LastTimestamp unversioned.Time `json:"lastTimestamp,omitempty"`
|
LastTimestamp metav1.Time `json:"lastTimestamp,omitempty"`
|
||||||
|
|
||||||
// The number of times this event has occurred.
|
// The number of times this event has occurred.
|
||||||
// +optional
|
// +optional
|
||||||
@ -3040,18 +3040,18 @@ type Event struct {
|
|||||||
|
|
||||||
// EventList is a list of events.
|
// EventList is a list of events.
|
||||||
type EventList struct {
|
type EventList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []Event `json:"items"`
|
Items []Event `json:"items"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List holds a list of objects, which may not be known by the server.
|
// List holds a list of objects, which may not be known by the server.
|
||||||
type List struct {
|
type List struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []runtime.Object `json:"items"`
|
Items []runtime.Object `json:"items"`
|
||||||
}
|
}
|
||||||
@ -3100,7 +3100,7 @@ type LimitRangeSpec struct {
|
|||||||
|
|
||||||
// LimitRange sets resource usage limits for each kind of resource in a Namespace
|
// LimitRange sets resource usage limits for each kind of resource in a Namespace
|
||||||
type LimitRange struct {
|
type LimitRange struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -3111,9 +3111,9 @@ type LimitRange struct {
|
|||||||
|
|
||||||
// LimitRangeList is a list of LimitRange items.
|
// LimitRangeList is a list of LimitRange items.
|
||||||
type LimitRangeList struct {
|
type LimitRangeList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
// Items is a list of LimitRange objects
|
// Items is a list of LimitRange objects
|
||||||
Items []LimitRange `json:"items"`
|
Items []LimitRange `json:"items"`
|
||||||
@ -3190,7 +3190,7 @@ type ResourceQuotaStatus struct {
|
|||||||
|
|
||||||
// ResourceQuota sets aggregate quota restrictions enforced per namespace
|
// ResourceQuota sets aggregate quota restrictions enforced per namespace
|
||||||
type ResourceQuota struct {
|
type ResourceQuota struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -3205,9 +3205,9 @@ type ResourceQuota struct {
|
|||||||
|
|
||||||
// ResourceQuotaList is a list of ResourceQuota items
|
// ResourceQuotaList is a list of ResourceQuota items
|
||||||
type ResourceQuotaList struct {
|
type ResourceQuotaList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
// Items is a list of ResourceQuota objects
|
// Items is a list of ResourceQuota objects
|
||||||
Items []ResourceQuota `json:"items"`
|
Items []ResourceQuota `json:"items"`
|
||||||
@ -3218,7 +3218,7 @@ type ResourceQuotaList struct {
|
|||||||
// Secret holds secret data of a certain type. The total bytes of the values in
|
// Secret holds secret data of a certain type. The total bytes of the values in
|
||||||
// the Data field must be less than MaxSecretSize bytes.
|
// the Data field must be less than MaxSecretSize bytes.
|
||||||
type Secret struct {
|
type Secret struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -3319,9 +3319,9 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type SecretList struct {
|
type SecretList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []Secret `json:"items"`
|
Items []Secret `json:"items"`
|
||||||
}
|
}
|
||||||
@ -3330,7 +3330,7 @@ type SecretList struct {
|
|||||||
|
|
||||||
// ConfigMap holds configuration data for components or applications to consume.
|
// ConfigMap holds configuration data for components or applications to consume.
|
||||||
type ConfigMap struct {
|
type ConfigMap struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -3342,9 +3342,9 @@ type ConfigMap struct {
|
|||||||
|
|
||||||
// ConfigMapList is a resource containing a list of ConfigMap objects.
|
// ConfigMapList is a resource containing a list of ConfigMap objects.
|
||||||
type ConfigMapList struct {
|
type ConfigMapList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
// Items is the list of ConfigMaps.
|
// Items is the list of ConfigMaps.
|
||||||
Items []ConfigMap `json:"items"`
|
Items []ConfigMap `json:"items"`
|
||||||
@ -3424,7 +3424,7 @@ type ComponentCondition struct {
|
|||||||
|
|
||||||
// ComponentStatus (and ComponentStatusList) holds the cluster validation info.
|
// ComponentStatus (and ComponentStatusList) holds the cluster validation info.
|
||||||
type ComponentStatus struct {
|
type ComponentStatus struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
@ -3433,9 +3433,9 @@ type ComponentStatus struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ComponentStatusList struct {
|
type ComponentStatusList struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
unversioned.ListMeta `json:"metadata,omitempty"`
|
metav1.ListMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Items []ComponentStatus `json:"items"`
|
Items []ComponentStatus `json:"items"`
|
||||||
}
|
}
|
||||||
@ -3503,7 +3503,7 @@ type SELinuxOptions struct {
|
|||||||
// data encoding hints). A range allocation should *ALWAYS* be recreatable at any time by observation
|
// data encoding hints). A range allocation should *ALWAYS* be recreatable at any time by observation
|
||||||
// of the cluster, thus the object is less strongly typed than most.
|
// of the cluster, thus the object is less strongly typed than most.
|
||||||
type RangeAllocation struct {
|
type RangeAllocation struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
// +optional
|
// +optional
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
// A string representing a unique label for a range of resources, such as a CIDR "10.0.0.0/8" or
|
// A string representing a unique label for a range of resources, such as a CIDR "10.0.0.0/8" or
|
||||||
@ -3529,5 +3529,5 @@ const (
|
|||||||
|
|
||||||
// When the --failure-domains scheduler flag is not specified,
|
// When the --failure-domains scheduler flag is not specified,
|
||||||
// DefaultFailureDomains defines the set of label keys used when TopologyKey is empty in PreferredDuringScheduling anti-affinity.
|
// DefaultFailureDomains defines the set of label keys used when TopologyKey is empty in PreferredDuringScheduling anti-affinity.
|
||||||
DefaultFailureDomains string = unversioned.LabelHostname + "," + unversioned.LabelZoneFailureDomain + "," + unversioned.LabelZoneRegion
|
DefaultFailureDomains string = metav1.LabelHostname + "," + metav1.LabelZoneFailureDomain + "," + metav1.LabelZoneRegion
|
||||||
)
|
)
|
||||||
|
26
pkg/api/unversioned/BUILD
Normal file
26
pkg/api/unversioned/BUILD
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
|
licenses(["notice"])
|
||||||
|
|
||||||
|
load(
|
||||||
|
"@io_bazel_rules_go//go:def.bzl",
|
||||||
|
"go_binary",
|
||||||
|
"go_library",
|
||||||
|
"go_test",
|
||||||
|
"cgo_library",
|
||||||
|
)
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = [
|
||||||
|
"duration.go",
|
||||||
|
"time.go",
|
||||||
|
"types.go",
|
||||||
|
],
|
||||||
|
tags = ["automanaged"],
|
||||||
|
deps = [
|
||||||
|
"//pkg/genericapiserver/openapi/common:go_default_library",
|
||||||
|
"//vendor:github.com/go-openapi/spec",
|
||||||
|
"//vendor:github.com/google/gofuzz",
|
||||||
|
],
|
||||||
|
)
|
47
pkg/api/unversioned/duration.go
Normal file
47
pkg/api/unversioned/duration.go
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package unversioned
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Duration is a wrapper around time.Duration which supports correct
|
||||||
|
// marshaling to YAML and JSON. In particular, it marshals into strings, which
|
||||||
|
// can be used as map keys in json.
|
||||||
|
type Duration struct {
|
||||||
|
time.Duration `protobuf:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON implements the json.Unmarshaller interface.
|
||||||
|
func (d *Duration) UnmarshalJSON(b []byte) error {
|
||||||
|
var str string
|
||||||
|
json.Unmarshal(b, &str)
|
||||||
|
|
||||||
|
pd, err := time.ParseDuration(str)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
d.Duration = pd
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON implements the json.Marshaler interface.
|
||||||
|
func (d Duration) MarshalJSON() ([]byte, error) {
|
||||||
|
return json.Marshal(d.Duration.String())
|
||||||
|
}
|
176
pkg/api/unversioned/time.go
Normal file
176
pkg/api/unversioned/time.go
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package unversioned
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"k8s.io/kubernetes/pkg/genericapiserver/openapi/common"
|
||||||
|
|
||||||
|
"github.com/go-openapi/spec"
|
||||||
|
"github.com/google/gofuzz"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Time is a wrapper around time.Time which supports correct
|
||||||
|
// marshaling to YAML and JSON. Wrappers are provided for many
|
||||||
|
// of the factory methods that the time package offers.
|
||||||
|
type Time struct {
|
||||||
|
time.Time `protobuf:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy returns a deep-copy of the Time value. The underlying time.Time
|
||||||
|
// type is effectively immutable in the time API, so it is safe to
|
||||||
|
// copy-by-assign, despite the presence of (unexported) Pointer fields.
|
||||||
|
func (t Time) DeepCopy() Time {
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns the representation of the time.
|
||||||
|
func (t Time) String() string {
|
||||||
|
return t.Time.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewTime returns a wrapped instance of the provided time
|
||||||
|
func NewTime(time time.Time) Time {
|
||||||
|
return Time{time}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Date returns the Time corresponding to the supplied parameters
|
||||||
|
// by wrapping time.Date.
|
||||||
|
func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Time {
|
||||||
|
return Time{time.Date(year, month, day, hour, min, sec, nsec, loc)}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now returns the current local time.
|
||||||
|
func Now() Time {
|
||||||
|
return Time{time.Now()}
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsZero returns true if the value is nil or time is zero.
|
||||||
|
func (t *Time) IsZero() bool {
|
||||||
|
if t == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return t.Time.IsZero()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Before reports whether the time instant t is before u.
|
||||||
|
func (t Time) Before(u Time) bool {
|
||||||
|
return t.Time.Before(u.Time)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Equal reports whether the time instant t is equal to u.
|
||||||
|
func (t Time) Equal(u Time) bool {
|
||||||
|
return t.Time.Equal(u.Time)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unix returns the local time corresponding to the given Unix time
|
||||||
|
// by wrapping time.Unix.
|
||||||
|
func Unix(sec int64, nsec int64) Time {
|
||||||
|
return Time{time.Unix(sec, nsec)}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rfc3339Copy returns a copy of the Time at second-level precision.
|
||||||
|
func (t Time) Rfc3339Copy() Time {
|
||||||
|
copied, _ := time.Parse(time.RFC3339, t.Format(time.RFC3339))
|
||||||
|
return Time{copied}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON implements the json.Unmarshaller interface.
|
||||||
|
func (t *Time) UnmarshalJSON(b []byte) error {
|
||||||
|
if len(b) == 4 && string(b) == "null" {
|
||||||
|
t.Time = time.Time{}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var str string
|
||||||
|
json.Unmarshal(b, &str)
|
||||||
|
|
||||||
|
pt, err := time.Parse(time.RFC3339, str)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Time = pt.Local()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalQueryParameter converts from a URL query parameter value to an object
|
||||||
|
func (t *Time) UnmarshalQueryParameter(str string) error {
|
||||||
|
if len(str) == 0 {
|
||||||
|
t.Time = time.Time{}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
// Tolerate requests from older clients that used JSON serialization to build query params
|
||||||
|
if len(str) == 4 && str == "null" {
|
||||||
|
t.Time = time.Time{}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
pt, err := time.Parse(time.RFC3339, str)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Time = pt.Local()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON implements the json.Marshaler interface.
|
||||||
|
func (t Time) MarshalJSON() ([]byte, error) {
|
||||||
|
if t.IsZero() {
|
||||||
|
// Encode unset/nil objects as JSON's "null".
|
||||||
|
return []byte("null"), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return json.Marshal(t.UTC().Format(time.RFC3339))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_ Time) OpenAPIDefinition() common.OpenAPIDefinition {
|
||||||
|
return common.OpenAPIDefinition{
|
||||||
|
Schema: spec.Schema{
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"string"},
|
||||||
|
Format: "date-time",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalQueryParameter converts to a URL query parameter value
|
||||||
|
func (t Time) MarshalQueryParameter() (string, error) {
|
||||||
|
if t.IsZero() {
|
||||||
|
// Encode unset/nil objects as an empty string
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return t.UTC().Format(time.RFC3339), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fuzz satisfies fuzz.Interface.
|
||||||
|
func (t *Time) Fuzz(c fuzz.Continue) {
|
||||||
|
if t == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Allow for about 1000 years of randomness. Leave off nanoseconds
|
||||||
|
// because JSON doesn't represent them so they can't round-trip
|
||||||
|
// properly.
|
||||||
|
t.Time = time.Unix(c.Rand.Int63n(1000*365*24*60*60), 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ fuzz.Interface = &Time{}
|
60
pkg/api/unversioned/types.go
Normal file
60
pkg/api/unversioned/types.go
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Package unversioned is deprecated and has been replaced with pkg/apis/meta/v1
|
||||||
|
//
|
||||||
|
// DEPRECATED - Do not reference or add types to this package, it will be removed
|
||||||
|
// once Heapster is updated to use pkg/apis/meta/v1.
|
||||||
|
package unversioned
|
||||||
|
|
||||||
|
// TypeMeta describes an individual object in an API response or request
|
||||||
|
// with strings representing the type of the object and its API schema version.
|
||||||
|
// Structures that are versioned or persisted should inline TypeMeta.
|
||||||
|
type TypeMeta struct {
|
||||||
|
// 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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
|
||||||
|
// +optional
|
||||||
|
Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"`
|
||||||
|
|
||||||
|
// 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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources
|
||||||
|
// +optional
|
||||||
|
APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListMeta describes metadata that synthetic resources must have, including lists and
|
||||||
|
// various status objects. A resource may have only one of {ObjectMeta, ListMeta}.
|
||||||
|
type ListMeta struct {
|
||||||
|
// SelfLink is a URL representing this object.
|
||||||
|
// Populated by the system.
|
||||||
|
// Read-only.
|
||||||
|
// +optional
|
||||||
|
SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,1,opt,name=selfLink"`
|
||||||
|
|
||||||
|
// String that identifies the server's internal version of this object that
|
||||||
|
// can be used by clients to determine when objects have changed.
|
||||||
|
// Value must be treated as opaque by clients and passed unmodified back to the server.
|
||||||
|
// Populated by the system.
|
||||||
|
// Read-only.
|
||||||
|
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency
|
||||||
|
// +optional
|
||||||
|
ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"`
|
||||||
|
}
|
@ -36,8 +36,8 @@ go_library(
|
|||||||
"//pkg/api/meta:go_default_library",
|
"//pkg/api/meta:go_default_library",
|
||||||
"//pkg/api/meta/metatypes:go_default_library",
|
"//pkg/api/meta/metatypes:go_default_library",
|
||||||
"//pkg/api/resource:go_default_library",
|
"//pkg/api/resource:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/apis/extensions:go_default_library",
|
"//pkg/apis/extensions:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/conversion:go_default_library",
|
"//pkg/conversion:go_default_library",
|
||||||
"//pkg/fields:go_default_library",
|
"//pkg/fields:go_default_library",
|
||||||
"//pkg/labels:go_default_library",
|
"//pkg/labels:go_default_library",
|
||||||
@ -70,9 +70,9 @@ go_test(
|
|||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/resource:go_default_library",
|
"//pkg/api/resource:go_default_library",
|
||||||
"//pkg/api/testing/compat:go_default_library",
|
"//pkg/api/testing/compat:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
"//pkg/api/validation:go_default_library",
|
"//pkg/api/validation:go_default_library",
|
||||||
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/runtime:go_default_library",
|
"//pkg/runtime:go_default_library",
|
||||||
"//pkg/util/diff:go_default_library",
|
"//pkg/util/diff:go_default_library",
|
||||||
"//pkg/util/intstr:go_default_library",
|
"//pkg/util/intstr:go_default_library",
|
||||||
@ -91,7 +91,7 @@ go_test(
|
|||||||
deps = [
|
deps = [
|
||||||
"//pkg/api:go_default_library",
|
"//pkg/api:go_default_library",
|
||||||
"//pkg/api/resource:go_default_library",
|
"//pkg/api/resource:go_default_library",
|
||||||
"//pkg/api/unversioned:go_default_library",
|
"//pkg/apis/meta/v1:go_default_library",
|
||||||
"//pkg/labels:go_default_library",
|
"//pkg/labels:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/resource"
|
"k8s.io/kubernetes/pkg/api/resource"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
versioned "k8s.io/kubernetes/pkg/api/v1"
|
versioned "k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/util/diff"
|
"k8s.io/kubernetes/pkg/util/diff"
|
||||||
@ -32,7 +32,7 @@ import (
|
|||||||
|
|
||||||
func TestPodLogOptions(t *testing.T) {
|
func TestPodLogOptions(t *testing.T) {
|
||||||
sinceSeconds := int64(1)
|
sinceSeconds := int64(1)
|
||||||
sinceTime := unversioned.NewTime(time.Date(2000, 1, 1, 12, 34, 56, 0, time.UTC).Local())
|
sinceTime := metav1.NewTime(time.Date(2000, 1, 1, 12, 34, 56, 0, time.UTC).Local())
|
||||||
tailLines := int64(2)
|
tailLines := int64(2)
|
||||||
limitBytes := int64(3)
|
limitBytes := int64(3)
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ import fmt "fmt"
|
|||||||
import math "math"
|
import math "math"
|
||||||
|
|
||||||
import k8s_io_kubernetes_pkg_api_resource "k8s.io/kubernetes/pkg/api/resource"
|
import k8s_io_kubernetes_pkg_api_resource "k8s.io/kubernetes/pkg/api/resource"
|
||||||
import k8s_io_kubernetes_pkg_api_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
import k8s_io_kubernetes_pkg_api_unversioned "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
import k8s_io_kubernetes_pkg_runtime "k8s.io/kubernetes/pkg/runtime"
|
import k8s_io_kubernetes_pkg_runtime "k8s.io/kubernetes/pkg/runtime"
|
||||||
|
|
||||||
import k8s_io_kubernetes_pkg_types "k8s.io/kubernetes/pkg/types"
|
import k8s_io_kubernetes_pkg_types "k8s.io/kubernetes/pkg/types"
|
||||||
|
@ -19,7 +19,7 @@ package v1
|
|||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/meta"
|
"k8s.io/kubernetes/pkg/api/meta"
|
||||||
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
"k8s.io/kubernetes/pkg/api/meta/metatypes"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/types"
|
"k8s.io/kubernetes/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -39,12 +39,12 @@ func (meta *ObjectMeta) GetResourceVersion() string { return meta.Re
|
|||||||
func (meta *ObjectMeta) SetResourceVersion(version string) { meta.ResourceVersion = version }
|
func (meta *ObjectMeta) SetResourceVersion(version string) { meta.ResourceVersion = version }
|
||||||
func (meta *ObjectMeta) GetSelfLink() string { return meta.SelfLink }
|
func (meta *ObjectMeta) GetSelfLink() string { return meta.SelfLink }
|
||||||
func (meta *ObjectMeta) SetSelfLink(selfLink string) { meta.SelfLink = selfLink }
|
func (meta *ObjectMeta) SetSelfLink(selfLink string) { meta.SelfLink = selfLink }
|
||||||
func (meta *ObjectMeta) GetCreationTimestamp() unversioned.Time { return meta.CreationTimestamp }
|
func (meta *ObjectMeta) GetCreationTimestamp() metav1.Time { return meta.CreationTimestamp }
|
||||||
func (meta *ObjectMeta) SetCreationTimestamp(creationTimestamp unversioned.Time) {
|
func (meta *ObjectMeta) SetCreationTimestamp(creationTimestamp metav1.Time) {
|
||||||
meta.CreationTimestamp = creationTimestamp
|
meta.CreationTimestamp = creationTimestamp
|
||||||
}
|
}
|
||||||
func (meta *ObjectMeta) GetDeletionTimestamp() *unversioned.Time { return meta.DeletionTimestamp }
|
func (meta *ObjectMeta) GetDeletionTimestamp() *metav1.Time { return meta.DeletionTimestamp }
|
||||||
func (meta *ObjectMeta) SetDeletionTimestamp(deletionTimestamp *unversioned.Time) {
|
func (meta *ObjectMeta) SetDeletionTimestamp(deletionTimestamp *metav1.Time) {
|
||||||
meta.DeletionTimestamp = deletionTimestamp
|
meta.DeletionTimestamp = deletionTimestamp
|
||||||
}
|
}
|
||||||
func (meta *ObjectMeta) GetLabels() map[string]string { return meta.Labels }
|
func (meta *ObjectMeta) GetLabels() map[string]string { return meta.Labels }
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||||
versionedwatch "k8s.io/kubernetes/pkg/watch/versioned"
|
versionedwatch "k8s.io/kubernetes/pkg/watch/versioned"
|
||||||
@ -76,7 +76,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
&PersistentVolumeClaim{},
|
&PersistentVolumeClaim{},
|
||||||
&PersistentVolumeClaimList{},
|
&PersistentVolumeClaimList{},
|
||||||
&DeleteOptions{},
|
&DeleteOptions{},
|
||||||
&unversioned.ExportOptions{},
|
&metav1.ExportOptions{},
|
||||||
&ListOptions{},
|
&ListOptions{},
|
||||||
&PodAttachOptions{},
|
&PodAttachOptions{},
|
||||||
&PodLogOptions{},
|
&PodLogOptions{},
|
||||||
@ -91,7 +91,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Add common types
|
// Add common types
|
||||||
scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.Status{})
|
scheme.AddKnownTypes(SchemeGroupVersion, &metav1.Status{})
|
||||||
|
|
||||||
// Add the watch version that applies
|
// Add the watch version that applies
|
||||||
versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
|
versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user