Bumping k8s dependencies to 1.13
This commit is contained in:
53
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/BUILD
generated
vendored
Normal file
53
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/BUILD
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"conversion.go",
|
||||
"defaults.go",
|
||||
"doc.go",
|
||||
"register.go",
|
||||
"zz_generated.conversion.go",
|
||||
"zz_generated.deepcopy.go",
|
||||
"zz_generated.defaults.go",
|
||||
],
|
||||
importpath = "k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//pkg/controller/apis/config:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
"//staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1:go_default_library",
|
||||
"//staging/src/k8s.io/kube-controller-manager/config/v1alpha1:go_default_library",
|
||||
"//vendor/k8s.io/utils/pointer:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
srcs = ["defaults_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
deps = [
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//staging/src/k8s.io/kube-controller-manager/config/v1alpha1:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
60
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/conversion.go
generated
vendored
Normal file
60
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/conversion.go
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/controller/apis/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this generic
|
||||
// package with ComponentConfig types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(in *v1alpha1.GenericControllerManagerConfiguration, out *config.GenericControllerManagerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in *config.GenericControllerManagerConfiguration, out *v1alpha1.GenericControllerManagerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in *v1alpha1.KubeCloudSharedConfiguration, out *config.KubeCloudSharedConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in *config.KubeCloudSharedConfiguration, out *v1alpha1.KubeCloudSharedConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in *v1alpha1.ServiceControllerConfiguration, out *config.ServiceControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in *config.ServiceControllerConfiguration, out *v1alpha1.ServiceControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in, out, s)
|
||||
}
|
270
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/defaults.go
generated
vendored
Normal file
270
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/defaults.go
generated
vendored
Normal file
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
apimachineryconfigv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
kruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1"
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
func addDefaultingFuncs(scheme *kruntime.Scheme) error {
|
||||
return RegisterDefaults(scheme)
|
||||
}
|
||||
|
||||
func SetDefaults_KubeControllerManagerConfiguration(obj *kubectrlmgrconfigv1alpha1.KubeControllerManagerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.AttachDetachController.ReconcilerSyncLoopPeriod == zero {
|
||||
obj.AttachDetachController.ReconcilerSyncLoopPeriod = metav1.Duration{Duration: 60 * time.Second}
|
||||
}
|
||||
if obj.DeprecatedController.RegisterRetryCount == 0 {
|
||||
obj.DeprecatedController.RegisterRetryCount = 10
|
||||
}
|
||||
if obj.NodeIPAMController.NodeCIDRMaskSize == 0 {
|
||||
obj.NodeIPAMController.NodeCIDRMaskSize = 24
|
||||
}
|
||||
if obj.PersistentVolumeBinderController.PVClaimBinderSyncPeriod == zero {
|
||||
obj.PersistentVolumeBinderController.PVClaimBinderSyncPeriod = metav1.Duration{Duration: 15 * time.Second}
|
||||
}
|
||||
if obj.SAController.ConcurrentSATokenSyncs == 0 {
|
||||
obj.SAController.ConcurrentSATokenSyncs = 5
|
||||
}
|
||||
if obj.TTLAfterFinishedController.ConcurrentTTLSyncs <= 0 {
|
||||
obj.TTLAfterFinishedController.ConcurrentTTLSyncs = 5
|
||||
}
|
||||
|
||||
// These defaults override the recommended defaults from the apimachineryconfigv1alpha1 package that are applied automatically
|
||||
// These client-connection defaults are specific to the kube-controller-manager
|
||||
if obj.Generic.ClientConnection.QPS == 0.0 {
|
||||
obj.Generic.ClientConnection.QPS = 20.0
|
||||
}
|
||||
if obj.Generic.ClientConnection.Burst == 0 {
|
||||
obj.Generic.ClientConnection.Burst = 30
|
||||
}
|
||||
|
||||
// Use the default RecommendedDefaultGenericControllerManagerConfiguration options
|
||||
RecommendedDefaultGenericControllerManagerConfiguration(&obj.Generic)
|
||||
}
|
||||
|
||||
func RecommendedDefaultGenericControllerManagerConfiguration(obj *kubectrlmgrconfigv1alpha1.GenericControllerManagerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.Address == "" {
|
||||
obj.Address = "0.0.0.0"
|
||||
}
|
||||
if obj.MinResyncPeriod == zero {
|
||||
obj.MinResyncPeriod = metav1.Duration{Duration: 12 * time.Hour}
|
||||
}
|
||||
if obj.ControllerStartInterval == zero {
|
||||
obj.ControllerStartInterval = metav1.Duration{Duration: 0 * time.Second}
|
||||
}
|
||||
if len(obj.Controllers) == 0 {
|
||||
obj.Controllers = []string{"*"}
|
||||
}
|
||||
|
||||
// Use the default ClientConnectionConfiguration and LeaderElectionConfiguration options
|
||||
apimachineryconfigv1alpha1.RecommendedDefaultClientConnectionConfiguration(&obj.ClientConnection)
|
||||
apiserverconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection)
|
||||
}
|
||||
|
||||
func SetDefaults_KubeCloudSharedConfiguration(obj *kubectrlmgrconfigv1alpha1.KubeCloudSharedConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.NodeMonitorPeriod == zero {
|
||||
obj.NodeMonitorPeriod = metav1.Duration{Duration: 5 * time.Second}
|
||||
}
|
||||
if obj.ClusterName == "" {
|
||||
obj.ClusterName = "kubernetes"
|
||||
}
|
||||
if obj.ConfigureCloudRoutes == nil {
|
||||
obj.ConfigureCloudRoutes = utilpointer.BoolPtr(true)
|
||||
}
|
||||
if obj.RouteReconciliationPeriod == zero {
|
||||
obj.RouteReconciliationPeriod = metav1.Duration{Duration: 10 * time.Second}
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_ServiceControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ServiceControllerConfiguration) {
|
||||
if obj.ConcurrentServiceSyncs == 0 {
|
||||
obj.ConcurrentServiceSyncs = 1
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_CSRSigningControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.CSRSigningControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ClusterSigningCertFile == "" {
|
||||
obj.ClusterSigningCertFile = "/etc/kubernetes/ca/ca.pem"
|
||||
}
|
||||
if obj.ClusterSigningKeyFile == "" {
|
||||
obj.ClusterSigningKeyFile = "/etc/kubernetes/ca/ca.key"
|
||||
}
|
||||
if obj.ClusterSigningDuration == zero {
|
||||
obj.ClusterSigningDuration = metav1.Duration{Duration: 365 * 24 * time.Hour}
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_DeploymentControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.DeploymentControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ConcurrentDeploymentSyncs == 0 {
|
||||
obj.ConcurrentDeploymentSyncs = 5
|
||||
}
|
||||
if obj.DeploymentControllerSyncPeriod == zero {
|
||||
obj.DeploymentControllerSyncPeriod = metav1.Duration{Duration: 30 * time.Second}
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_DaemonSetControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.DaemonSetControllerConfiguration) {
|
||||
if obj.ConcurrentDaemonSetSyncs == 0 {
|
||||
obj.ConcurrentDaemonSetSyncs = 2
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_EndpointControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.EndpointControllerConfiguration) {
|
||||
if obj.ConcurrentEndpointSyncs == 0 {
|
||||
obj.ConcurrentEndpointSyncs = 5
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_GarbageCollectorControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.GarbageCollectorControllerConfiguration) {
|
||||
if obj.EnableGarbageCollector == nil {
|
||||
obj.EnableGarbageCollector = utilpointer.BoolPtr(true)
|
||||
}
|
||||
if obj.ConcurrentGCSyncs == 0 {
|
||||
obj.ConcurrentGCSyncs = 20
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_HPAControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.HPAControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.HorizontalPodAutoscalerUseRESTClients == nil {
|
||||
obj.HorizontalPodAutoscalerUseRESTClients = utilpointer.BoolPtr(true)
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerSyncPeriod == zero {
|
||||
obj.HorizontalPodAutoscalerSyncPeriod = metav1.Duration{Duration: 15 * time.Second}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerUpscaleForbiddenWindow == zero {
|
||||
obj.HorizontalPodAutoscalerUpscaleForbiddenWindow = metav1.Duration{Duration: 3 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerDownscaleStabilizationWindow == zero {
|
||||
obj.HorizontalPodAutoscalerDownscaleStabilizationWindow = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerCPUInitializationPeriod == zero {
|
||||
obj.HorizontalPodAutoscalerCPUInitializationPeriod = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerInitialReadinessDelay == zero {
|
||||
obj.HorizontalPodAutoscalerInitialReadinessDelay = metav1.Duration{Duration: 30 * time.Second}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerDownscaleForbiddenWindow == zero {
|
||||
obj.HorizontalPodAutoscalerDownscaleForbiddenWindow = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerTolerance == 0 {
|
||||
obj.HorizontalPodAutoscalerTolerance = 0.1
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_JobControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.JobControllerConfiguration) {
|
||||
if obj.ConcurrentJobSyncs == 0 {
|
||||
obj.ConcurrentJobSyncs = 5
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_NamespaceControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.NamespaceControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ConcurrentNamespaceSyncs == 0 {
|
||||
obj.ConcurrentNamespaceSyncs = 10
|
||||
}
|
||||
if obj.NamespaceSyncPeriod == zero {
|
||||
obj.NamespaceSyncPeriod = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_NodeLifecycleControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.NodeLifecycleControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.PodEvictionTimeout == zero {
|
||||
obj.PodEvictionTimeout = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.NodeMonitorGracePeriod == zero {
|
||||
obj.NodeMonitorGracePeriod = metav1.Duration{Duration: 40 * time.Second}
|
||||
}
|
||||
if obj.NodeStartupGracePeriod == zero {
|
||||
obj.NodeStartupGracePeriod = metav1.Duration{Duration: 60 * time.Second}
|
||||
}
|
||||
if obj.EnableTaintManager == nil {
|
||||
obj.EnableTaintManager = utilpointer.BoolPtr(true)
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_PodGCControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.PodGCControllerConfiguration) {
|
||||
if obj.TerminatedPodGCThreshold == 0 {
|
||||
obj.TerminatedPodGCThreshold = 12500
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_ReplicaSetControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ReplicaSetControllerConfiguration) {
|
||||
if obj.ConcurrentRSSyncs == 0 {
|
||||
obj.ConcurrentRSSyncs = 5
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_ReplicationControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ReplicationControllerConfiguration) {
|
||||
if obj.ConcurrentRCSyncs == 0 {
|
||||
obj.ConcurrentRCSyncs = 5
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_ResourceQuotaControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ResourceQuotaControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ConcurrentResourceQuotaSyncs == 0 {
|
||||
obj.ConcurrentResourceQuotaSyncs = 5
|
||||
}
|
||||
if obj.ResourceQuotaSyncPeriod == zero {
|
||||
obj.ResourceQuotaSyncPeriod = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_PersistentVolumeRecyclerConfiguration(obj *kubectrlmgrconfigv1alpha1.PersistentVolumeRecyclerConfiguration) {
|
||||
if obj.MaximumRetry == 0 {
|
||||
obj.MaximumRetry = 3
|
||||
}
|
||||
if obj.MinimumTimeoutNFS == 0 {
|
||||
obj.MinimumTimeoutNFS = 300
|
||||
}
|
||||
if obj.IncrementTimeoutNFS == 0 {
|
||||
obj.IncrementTimeoutNFS = 30
|
||||
}
|
||||
if obj.MinimumTimeoutHostPath == 0 {
|
||||
obj.MinimumTimeoutHostPath = 60
|
||||
}
|
||||
if obj.IncrementTimeoutHostPath == 0 {
|
||||
obj.IncrementTimeoutHostPath = 30
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_VolumeConfiguration(obj *kubectrlmgrconfigv1alpha1.VolumeConfiguration) {
|
||||
if obj.EnableHostPathProvisioning == nil {
|
||||
obj.EnableHostPathProvisioning = utilpointer.BoolPtr(false)
|
||||
}
|
||||
if obj.EnableDynamicProvisioning == nil {
|
||||
obj.EnableDynamicProvisioning = utilpointer.BoolPtr(true)
|
||||
}
|
||||
if obj.FlexVolumePluginDir == "" {
|
||||
obj.FlexVolumePluginDir = "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/"
|
||||
}
|
||||
}
|
64
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/defaults_test.go
generated
vendored
Normal file
64
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/defaults_test.go
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
func TestKubeControllerDefaultsRoundTrip(t *testing.T) {
|
||||
ks1 := &kubectrlmgrconfigv1alpha1.KubeControllerManagerConfiguration{}
|
||||
SetDefaults_KubeControllerManagerConfiguration(ks1)
|
||||
cm, err := convertObjToConfigMap("KubeControllerManagerConfiguration", ks1)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected ConvertObjToConfigMap error %v", err)
|
||||
}
|
||||
|
||||
ks2 := &kubectrlmgrconfigv1alpha1.KubeControllerManagerConfiguration{}
|
||||
if err = json.Unmarshal([]byte(cm.Data["KubeControllerManagerConfiguration"]), ks2); err != nil {
|
||||
t.Errorf("unexpected error unserializing controller manager config %v", err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(ks2, ks1) {
|
||||
t.Errorf("Expected:\n%#v\n\nGot:\n%#v", ks1, ks2)
|
||||
}
|
||||
}
|
||||
|
||||
// convertObjToConfigMap converts an object to a ConfigMap.
|
||||
// This is specifically meant for ComponentConfigs.
|
||||
func convertObjToConfigMap(name string, obj runtime.Object) (*v1.ConfigMap, error) {
|
||||
eJSONBytes, err := json.Marshal(obj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cm := &v1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
},
|
||||
Data: map[string]string{
|
||||
name: string(eJSONBytes[:]),
|
||||
},
|
||||
}
|
||||
return cm, nil
|
||||
}
|
24
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/doc.go
generated
vendored
Normal file
24
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/doc.go
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/apis/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +k8s:defaulter-gen-input=../../../../../vendor/k8s.io/kube-controller-manager/config/v1alpha1
|
||||
// +groupName=kubecontrollermanager.config.k8s.io
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1"
|
43
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/register.go
generated
vendored
Normal file
43
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/register.go
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
const GroupName = "kubecontrollermanager.config.k8s.io"
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
|
||||
|
||||
var (
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &kubectrlmgrconfigv1alpha1.SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func init() {
|
||||
// We only register manually written functions here. The registration of the
|
||||
// generated functions takes place in the generated files. The separation
|
||||
// makes the code compile even when the generated files are missing.
|
||||
localSchemeBuilder.Register(addDefaultingFuncs)
|
||||
}
|
1145
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/zz_generated.conversion.go
generated
vendored
Normal file
1145
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/zz_generated.conversion.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
21
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/zz_generated.deepcopy.go
generated
vendored
Normal file
21
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/zz_generated.deepcopy.go
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
57
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/zz_generated.defaults.go
generated
vendored
Normal file
57
vendor/k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1/zz_generated.defaults.go
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by defaulter-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
v1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
// All generated defaulters are covering - they call all nested defaulters.
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
scheme.AddTypeDefaultingFunc(&v1alpha1.KubeControllerManagerConfiguration{}, func(obj interface{}) {
|
||||
SetObjectDefaults_KubeControllerManagerConfiguration(obj.(*v1alpha1.KubeControllerManagerConfiguration))
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetObjectDefaults_KubeControllerManagerConfiguration(in *v1alpha1.KubeControllerManagerConfiguration) {
|
||||
SetDefaults_KubeControllerManagerConfiguration(in)
|
||||
SetDefaults_KubeCloudSharedConfiguration(&in.KubeCloudShared)
|
||||
SetDefaults_CSRSigningControllerConfiguration(&in.CSRSigningController)
|
||||
SetDefaults_DaemonSetControllerConfiguration(&in.DaemonSetController)
|
||||
SetDefaults_DeploymentControllerConfiguration(&in.DeploymentController)
|
||||
SetDefaults_EndpointControllerConfiguration(&in.EndpointController)
|
||||
SetDefaults_GarbageCollectorControllerConfiguration(&in.GarbageCollectorController)
|
||||
SetDefaults_HPAControllerConfiguration(&in.HPAController)
|
||||
SetDefaults_JobControllerConfiguration(&in.JobController)
|
||||
SetDefaults_NamespaceControllerConfiguration(&in.NamespaceController)
|
||||
SetDefaults_NodeLifecycleControllerConfiguration(&in.NodeLifecycleController)
|
||||
SetDefaults_VolumeConfiguration(&in.PersistentVolumeBinderController.VolumeConfiguration)
|
||||
SetDefaults_PersistentVolumeRecyclerConfiguration(&in.PersistentVolumeBinderController.VolumeConfiguration.PersistentVolumeRecyclerConfiguration)
|
||||
SetDefaults_PodGCControllerConfiguration(&in.PodGCController)
|
||||
SetDefaults_ReplicaSetControllerConfiguration(&in.ReplicaSetController)
|
||||
SetDefaults_ReplicationControllerConfiguration(&in.ReplicationController)
|
||||
SetDefaults_ResourceQuotaControllerConfiguration(&in.ResourceQuotaController)
|
||||
SetDefaults_ServiceControllerConfiguration(&in.ServiceController)
|
||||
}
|
Reference in New Issue
Block a user