Bumping k8s dependencies to 1.13
This commit is contained in:
34
vendor/k8s.io/kubernetes/cmd/controller-manager/app/options/kubecloudshared.go
generated
vendored
34
vendor/k8s.io/kubernetes/cmd/controller-manager/app/options/kubecloudshared.go
generated
vendored
@@ -18,15 +18,16 @@ package options
|
||||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
|
||||
)
|
||||
|
||||
// KubeCloudSharedOptions holds the options shared between kube-controller-manager
|
||||
// and cloud-controller-manager.
|
||||
type KubeCloudSharedOptions struct {
|
||||
Port int32
|
||||
Address string
|
||||
CloudProvider *CloudProviderOptions
|
||||
ExternalCloudVolumePlugin string
|
||||
UseServiceAccountCredentials bool
|
||||
AllowUntaggedCloud bool
|
||||
RouteReconciliationPeriod metav1.Duration
|
||||
@@ -42,14 +43,15 @@ type KubeCloudSharedOptions struct {
|
||||
// NewKubeCloudSharedOptions returns common/default configuration values for both
|
||||
// the kube-controller-manager and the cloud-contoller-manager. Any common changes should
|
||||
// be made here. Any individual changes should be made in that controller.
|
||||
func NewKubeCloudSharedOptions(cfg componentconfig.KubeCloudSharedConfiguration) *KubeCloudSharedOptions {
|
||||
func NewKubeCloudSharedOptions(cfg kubectrlmgrconfig.KubeCloudSharedConfiguration) *KubeCloudSharedOptions {
|
||||
o := &KubeCloudSharedOptions{
|
||||
Port: cfg.Port,
|
||||
Address: cfg.Address,
|
||||
RouteReconciliationPeriod: cfg.RouteReconciliationPeriod,
|
||||
NodeMonitorPeriod: cfg.NodeMonitorPeriod,
|
||||
ClusterName: cfg.ClusterName,
|
||||
ConfigureCloudRoutes: cfg.ConfigureCloudRoutes,
|
||||
CloudProvider: &CloudProviderOptions{},
|
||||
ExternalCloudVolumePlugin: cfg.ExternalCloudVolumePlugin,
|
||||
UseServiceAccountCredentials: cfg.UseServiceAccountCredentials,
|
||||
RouteReconciliationPeriod: cfg.RouteReconciliationPeriod,
|
||||
NodeMonitorPeriod: cfg.NodeMonitorPeriod,
|
||||
ClusterName: cfg.ClusterName,
|
||||
ConfigureCloudRoutes: cfg.ConfigureCloudRoutes,
|
||||
}
|
||||
|
||||
return o
|
||||
@@ -61,6 +63,8 @@ func (o *KubeCloudSharedOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
return
|
||||
}
|
||||
|
||||
o.CloudProvider.AddFlags(fs)
|
||||
fs.StringVar(&o.ExternalCloudVolumePlugin, "external-cloud-volume-plugin", o.ExternalCloudVolumePlugin, "The plugin to use when cloud provider is set to external. Can be empty, should only be set when cloud-provider is external. Currently used to allow node and volume controllers to work for in tree cloud providers.")
|
||||
fs.BoolVar(&o.UseServiceAccountCredentials, "use-service-account-credentials", o.UseServiceAccountCredentials, "If true, use individual service account credentials for each controller.")
|
||||
fs.BoolVar(&o.AllowUntaggedCloud, "allow-untagged-cloud", false, "Allow the cluster to run without the cluster-id on cloud instances. This is a legacy mode of operation and a cluster-id will be required in the future.")
|
||||
fs.MarkDeprecated("allow-untagged-cloud", "This flag is deprecated and will be removed in a future release. A cluster-id will be required on cloud instances.")
|
||||
@@ -80,13 +84,15 @@ func (o *KubeCloudSharedOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
}
|
||||
|
||||
// ApplyTo fills up KubeCloudShared config with options.
|
||||
func (o *KubeCloudSharedOptions) ApplyTo(cfg *componentconfig.KubeCloudSharedConfiguration) error {
|
||||
func (o *KubeCloudSharedOptions) ApplyTo(cfg *kubectrlmgrconfig.KubeCloudSharedConfiguration) error {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
cfg.Port = o.Port
|
||||
cfg.Address = o.Address
|
||||
if err := o.CloudProvider.ApplyTo(&cfg.CloudProvider); err != nil {
|
||||
return err
|
||||
}
|
||||
cfg.ExternalCloudVolumePlugin = o.ExternalCloudVolumePlugin
|
||||
cfg.UseServiceAccountCredentials = o.UseServiceAccountCredentials
|
||||
cfg.AllowUntaggedCloud = o.AllowUntaggedCloud
|
||||
cfg.RouteReconciliationPeriod = o.RouteReconciliationPeriod
|
||||
@@ -108,5 +114,7 @@ func (o *KubeCloudSharedOptions) Validate() []error {
|
||||
}
|
||||
|
||||
errs := []error{}
|
||||
errs = append(errs, o.CloudProvider.Validate()...)
|
||||
|
||||
return errs
|
||||
}
|
||||
|
Reference in New Issue
Block a user