mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
rebase: update replaced k8s.io modules to v0.33.0
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
dd77e72800
commit
107407b44b
9
e2e/vendor/k8s.io/cloud-provider/CONTRIBUTING.md
generated
vendored
9
e2e/vendor/k8s.io/cloud-provider/CONTRIBUTING.md
generated
vendored
@ -1,9 +0,0 @@
|
||||
# Contributing guidelines
|
||||
|
||||
Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md).
|
||||
|
||||
Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. Changes to this repo should be discussed with [sig cloud-provider](https://github.com/kubernetes/community/tree/master/sig-cloud-provider).
|
||||
|
||||
This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/cloud-provider](https://git.k8s.io/kubernetes/staging/src/k8s.io/cloud-provider) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot).
|
||||
|
||||
Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/sig-architecture/staging.md) for more information
|
30
e2e/vendor/k8s.io/cloud-provider/OWNERS
generated
vendored
30
e2e/vendor/k8s.io/cloud-provider/OWNERS
generated
vendored
@ -1,30 +0,0 @@
|
||||
# See the OWNERS docs at https://go.k8s.io/owners
|
||||
|
||||
approvers:
|
||||
- mikedanese
|
||||
- dims
|
||||
- wlan0
|
||||
- andrewsykim
|
||||
- cheftako
|
||||
reviewers:
|
||||
- aojea
|
||||
- wojtek-t
|
||||
- deads2k
|
||||
- derekwaynecarr
|
||||
- mikedanese
|
||||
- liggitt
|
||||
- sttts
|
||||
- dchen1107
|
||||
- saad-ali
|
||||
- luxas
|
||||
- justinsb
|
||||
- jsafrane
|
||||
- dims
|
||||
- freehan
|
||||
- jingxu97
|
||||
- wlan0
|
||||
- cheftako
|
||||
- andrewsykim
|
||||
labels:
|
||||
- sig/cloud-provider
|
||||
- area/cloudprovider
|
33
e2e/vendor/k8s.io/cloud-provider/README.md
generated
vendored
33
e2e/vendor/k8s.io/cloud-provider/README.md
generated
vendored
@ -1,33 +0,0 @@
|
||||
# cloud-provider
|
||||
|
||||
This repository defines the cloud-provider interface and mechanism to initialize
|
||||
a cloud-provider implementation into Kubernetes. Currently multiple processes
|
||||
use this code although the intent is that it will eventually only be cloud
|
||||
controller manager.
|
||||
|
||||
**Note:** go-get or vendor this package as `k8s.io/cloud-provider`.
|
||||
|
||||
## Purpose
|
||||
|
||||
This library is a shared dependency for processes which need to be able to
|
||||
integrate with cloud-provider specific functionality.
|
||||
|
||||
## Compatibility
|
||||
|
||||
Cloud Providers are expected to keep the HEAD of their implementations in sync
|
||||
with the HEAD of this repository.
|
||||
|
||||
## Where does it come from?
|
||||
|
||||
`cloud-provider` is synced from
|
||||
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cloud-provider.
|
||||
Code changes are made in that location, merged into k8s.io/kubernetes and
|
||||
later synced here.
|
||||
|
||||
## Things you should NOT do
|
||||
|
||||
1. Add an cloud provider specific code to this repo.
|
||||
2. Directly modify anything under vendor/k8s.io/cloud-provider in this repo. Those are driven from `k8s.io/kubernetes/staging/src/k8s.io/cloud-provider`.
|
||||
3. Make interface changes without first discussing them with
|
||||
sig-cloudprovider.
|
||||
|
20
e2e/vendor/k8s.io/cloud-provider/SECURITY_CONTACTS
generated
vendored
20
e2e/vendor/k8s.io/cloud-provider/SECURITY_CONTACTS
generated
vendored
@ -1,20 +0,0 @@
|
||||
# Defined below are the security contacts for this repo.
|
||||
#
|
||||
# They are the contact point for the Product Security Committee to reach out
|
||||
# to for triaging and handling of incoming issues.
|
||||
#
|
||||
# The below names agree to abide by the
|
||||
# [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy)
|
||||
# and will be removed and replaced if they violate that agreement.
|
||||
#
|
||||
# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE
|
||||
# INSTRUCTIONS AT https://kubernetes.io/security/
|
||||
|
||||
cheftako
|
||||
andrewsykim
|
||||
dims
|
||||
cjcullen
|
||||
joelsmith
|
||||
liggitt
|
||||
philips
|
||||
tallclair
|
83
e2e/vendor/k8s.io/cloud-provider/app/config/config.go
generated
vendored
83
e2e/vendor/k8s.io/cloud-provider/app/config/config.go
generated
vendored
@ -1,83 +0,0 @@
|
||||
/*
|
||||
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 config
|
||||
|
||||
import (
|
||||
apiserver "k8s.io/apiserver/pkg/server"
|
||||
"k8s.io/client-go/informers"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/record"
|
||||
cloudprovider "k8s.io/cloud-provider"
|
||||
"k8s.io/cloud-provider/config"
|
||||
)
|
||||
|
||||
// Config is the main context object for the cloud controller manager.
|
||||
type Config struct {
|
||||
ComponentConfig config.CloudControllerManagerConfiguration
|
||||
|
||||
SecureServing *apiserver.SecureServingInfo
|
||||
// LoopbackClientConfig is a config for a privileged loopback connection
|
||||
LoopbackClientConfig *restclient.Config
|
||||
|
||||
Authentication apiserver.AuthenticationInfo
|
||||
Authorization apiserver.AuthorizationInfo
|
||||
|
||||
// WebhookSecureServing is a separate SecureServing configuration from
|
||||
// healthz, configz, and metrics.
|
||||
WebhookSecureServing *apiserver.SecureServingInfo
|
||||
|
||||
// the general kube client
|
||||
Client *clientset.Clientset
|
||||
|
||||
// the rest config for the master
|
||||
Kubeconfig *restclient.Config
|
||||
|
||||
// EventBroadcaster is broadcaster events to all sinks.
|
||||
EventBroadcaster record.EventBroadcaster
|
||||
|
||||
// EventRecord is a sink for events.
|
||||
EventRecorder record.EventRecorder
|
||||
|
||||
// ClientBuilder will provide a client for this controller to use
|
||||
ClientBuilder cloudprovider.ControllerClientBuilder
|
||||
|
||||
// VersionedClient will provide a client for informers
|
||||
VersionedClient clientset.Interface
|
||||
|
||||
// SharedInformers gives access to informers for the controller.
|
||||
SharedInformers informers.SharedInformerFactory
|
||||
}
|
||||
|
||||
type completedConfig struct {
|
||||
*Config
|
||||
}
|
||||
|
||||
// CompletedConfig same as Config, just to swap private object.
|
||||
type CompletedConfig struct {
|
||||
// Embed a private pointer that cannot be instantiated outside of this package.
|
||||
*completedConfig
|
||||
}
|
||||
|
||||
// Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.
|
||||
func (c *Config) Complete() *CompletedConfig {
|
||||
cc := completedConfig{c}
|
||||
|
||||
apiserver.AuthorizeClientBearerToken(c.LoopbackClientConfig, &c.Authentication, &c.Authorization)
|
||||
|
||||
return &CompletedConfig{&cc}
|
||||
}
|
335
e2e/vendor/k8s.io/cloud-provider/cloud.go
generated
vendored
335
e2e/vendor/k8s.io/cloud-provider/cloud.go
generated
vendored
@ -1,335 +0,0 @@
|
||||
/*
|
||||
Copyright 2014 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 cloudprovider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/client-go/informers"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// ControllerClientBuilder allows you to get clients and configs for controllers
|
||||
// Please note a copy also exists in pkg/controller/client_builder.go
|
||||
// TODO: Make this depend on the separate controller utilities repo (issues/68947)
|
||||
type ControllerClientBuilder interface {
|
||||
Config(name string) (*restclient.Config, error)
|
||||
ConfigOrDie(name string) *restclient.Config
|
||||
Client(name string) (clientset.Interface, error)
|
||||
ClientOrDie(name string) clientset.Interface
|
||||
}
|
||||
|
||||
// Interface is an abstract, pluggable interface for cloud providers.
|
||||
type Interface interface {
|
||||
// Initialize provides the cloud with a kubernetes client builder and may spawn goroutines
|
||||
// to perform housekeeping or run custom controllers specific to the cloud provider.
|
||||
// Any tasks started here should be cleaned up when the stop channel closes.
|
||||
Initialize(clientBuilder ControllerClientBuilder, stop <-chan struct{})
|
||||
// LoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise.
|
||||
LoadBalancer() (LoadBalancer, bool)
|
||||
// Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.
|
||||
Instances() (Instances, bool)
|
||||
// InstancesV2 is an implementation for instances and should only be implemented by external cloud providers.
|
||||
// Implementing InstancesV2 is behaviorally identical to Instances but is optimized to significantly reduce
|
||||
// API calls to the cloud provider when registering and syncing nodes. Implementation of this interface will
|
||||
// disable calls to the Zones interface. Also returns true if the interface is supported, false otherwise.
|
||||
InstancesV2() (InstancesV2, bool)
|
||||
// Zones returns a zones interface. Also returns true if the interface is supported, false otherwise.
|
||||
// DEPRECATED: Zones is deprecated in favor of retrieving zone/region information from InstancesV2.
|
||||
// This interface will not be called if InstancesV2 is enabled.
|
||||
Zones() (Zones, bool)
|
||||
// Clusters returns a clusters interface. Also returns true if the interface is supported, false otherwise.
|
||||
Clusters() (Clusters, bool)
|
||||
// Routes returns a routes interface along with whether the interface is supported.
|
||||
Routes() (Routes, bool)
|
||||
// ProviderName returns the cloud provider ID.
|
||||
ProviderName() string
|
||||
// HasClusterID returns true if a ClusterID is required and set
|
||||
HasClusterID() bool
|
||||
}
|
||||
|
||||
type InformerUser interface {
|
||||
// SetInformers sets the informer on the cloud object.
|
||||
SetInformers(informerFactory informers.SharedInformerFactory)
|
||||
}
|
||||
|
||||
// Clusters is an abstract, pluggable interface for clusters of containers.
|
||||
type Clusters interface {
|
||||
// ListClusters lists the names of the available clusters.
|
||||
ListClusters(ctx context.Context) ([]string, error)
|
||||
// Master gets back the address (either DNS name or IP address) of the master node for the cluster.
|
||||
Master(ctx context.Context, clusterName string) (string, error)
|
||||
}
|
||||
|
||||
// (DEPRECATED) DefaultLoadBalancerName is the default load balancer name that is called from
|
||||
// LoadBalancer.GetLoadBalancerName. Use this method to maintain backward compatible names for
|
||||
// LoadBalancers that were created prior to Kubernetes v1.12. In the future, each provider should
|
||||
// replace this method call in GetLoadBalancerName with a provider-specific implementation that
|
||||
// is less cryptic than the Service's UUID.
|
||||
func DefaultLoadBalancerName(service *v1.Service) string {
|
||||
//GCE requires that the name of a load balancer starts with a lower case letter.
|
||||
ret := "a" + string(service.UID)
|
||||
ret = strings.Replace(ret, "-", "", -1)
|
||||
//AWS requires that the name of a load balancer is shorter than 32 bytes.
|
||||
if len(ret) > 32 {
|
||||
ret = ret[:32]
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetInstanceProviderID builds a ProviderID for a node in a cloud.
|
||||
// Note that if the instance does not exist, we must return ("", cloudprovider.InstanceNotFound)
|
||||
// cloudprovider.InstanceNotFound should NOT be returned for instances that exist but are stopped/sleeping
|
||||
func GetInstanceProviderID(ctx context.Context, cloud Interface, nodeName types.NodeName) (string, error) {
|
||||
instances, ok := cloud.Instances()
|
||||
if !ok {
|
||||
return "", fmt.Errorf("failed to get instances from cloud provider")
|
||||
}
|
||||
instanceID, err := instances.InstanceID(ctx, nodeName)
|
||||
if err != nil {
|
||||
if err == NotImplemented {
|
||||
return "", err
|
||||
}
|
||||
if err == InstanceNotFound {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("failed to get instance ID from cloud provider: %w", err)
|
||||
}
|
||||
return cloud.ProviderName() + "://" + instanceID, nil
|
||||
}
|
||||
|
||||
// LoadBalancer is an abstract, pluggable interface for load balancers.
|
||||
//
|
||||
// Cloud provider may chose to implement the logic for
|
||||
// constructing/destroying specific kinds of load balancers in a
|
||||
// controller separate from the ServiceController. If this is the case,
|
||||
// then {Ensure,Update}LoadBalancer must return the ImplementedElsewhere error.
|
||||
// For the given LB service, the GetLoadBalancer must return "exists=True" if
|
||||
// there exists a LoadBalancer instance created by ServiceController.
|
||||
// In all other cases, GetLoadBalancer must return a NotFound error.
|
||||
// EnsureLoadBalancerDeleted must not return ImplementedElsewhere to ensure
|
||||
// proper teardown of resources that were allocated by the ServiceController.
|
||||
// This can happen if a user changes the type of LB via an update to the resource
|
||||
// or when migrating from ServiceController to alternate implementation.
|
||||
// The finalizer on the service will be added and removed by ServiceController
|
||||
// irrespective of the ImplementedElsewhere error. Additional finalizers for
|
||||
// LB services must be managed in the alternate implementation.
|
||||
type LoadBalancer interface {
|
||||
// GetLoadBalancer returns whether the specified load balancer exists, and
|
||||
// if so, what its status is.
|
||||
// Implementations must treat the *v1.Service parameter as read-only and not modify it.
|
||||
// Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager.
|
||||
// TODO: Break this up into different interfaces (LB, etc) when we have more than one type of service
|
||||
GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)
|
||||
// GetLoadBalancerName returns the name of the load balancer. Implementations must treat the
|
||||
// *v1.Service parameter as read-only and not modify it.
|
||||
GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string
|
||||
// EnsureLoadBalancer creates a new load balancer 'name', or updates the existing one. Returns the status of the balancer
|
||||
// Implementations must treat the *v1.Service and *v1.Node
|
||||
// parameters as read-only and not modify them.
|
||||
// Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager.
|
||||
//
|
||||
// Implementations may return a (possibly wrapped) api.RetryError to enforce
|
||||
// backing off at a fixed duration. This can be used for cases like when the
|
||||
// load balancer is not ready yet (e.g., it is still being provisioned) and
|
||||
// polling at a fixed rate is preferred over backing off exponentially in
|
||||
// order to minimize latency.
|
||||
EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
|
||||
// UpdateLoadBalancer updates hosts under the specified load balancer.
|
||||
// Implementations must treat the *v1.Service and *v1.Node
|
||||
// parameters as read-only and not modify them.
|
||||
// Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager
|
||||
UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error
|
||||
// EnsureLoadBalancerDeleted deletes the specified load balancer if it
|
||||
// exists, returning nil if the load balancer specified either didn't exist or
|
||||
// was successfully deleted.
|
||||
// This construction is useful because many cloud providers' load balancers
|
||||
// have multiple underlying components, meaning a Get could say that the LB
|
||||
// doesn't exist even if some part of it is still laying around.
|
||||
// Implementations must treat the *v1.Service parameter as read-only and not modify it.
|
||||
// Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager
|
||||
EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error
|
||||
}
|
||||
|
||||
// Instances is an abstract, pluggable interface for sets of instances.
|
||||
type Instances interface {
|
||||
// NodeAddresses returns the addresses of the specified instance.
|
||||
NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error)
|
||||
// NodeAddressesByProviderID returns the addresses of the specified instance.
|
||||
// The instance is specified using the providerID of the node. The
|
||||
// ProviderID is a unique identifier of the node. This will not be called
|
||||
// from the node whose nodeaddresses are being queried. i.e. local metadata
|
||||
// services cannot be used in this method to obtain nodeaddresses
|
||||
NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)
|
||||
// InstanceID returns the cloud provider ID of the node with the specified NodeName.
|
||||
// Note that if the instance does not exist, we must return ("", cloudprovider.InstanceNotFound)
|
||||
// cloudprovider.InstanceNotFound should NOT be returned for instances that exist but are stopped/sleeping
|
||||
InstanceID(ctx context.Context, nodeName types.NodeName) (string, error)
|
||||
// InstanceType returns the type of the specified instance.
|
||||
InstanceType(ctx context.Context, name types.NodeName) (string, error)
|
||||
// InstanceTypeByProviderID returns the type of the specified instance.
|
||||
InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error)
|
||||
// AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all instances
|
||||
// expected format for the key is standard ssh-keygen format: <protocol> <blob>
|
||||
AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error
|
||||
// CurrentNodeName returns the name of the node we are currently running on
|
||||
// On most clouds (e.g. GCE) this is the hostname, so we provide the hostname
|
||||
CurrentNodeName(ctx context.Context, hostname string) (types.NodeName, error)
|
||||
// InstanceExistsByProviderID returns true if the instance for the given provider exists.
|
||||
// If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
|
||||
// This method should still return true for instances that exist but are stopped/sleeping.
|
||||
InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error)
|
||||
// InstanceShutdownByProviderID returns true if the instance is shutdown in cloudprovider
|
||||
InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)
|
||||
}
|
||||
|
||||
// InstancesV2 is an abstract, pluggable interface for cloud provider instances.
|
||||
// Unlike the Instances interface, it is designed for external cloud providers and should only be used by them.
|
||||
// Implementation of this interface will disable calls to the Zones interface.
|
||||
type InstancesV2 interface {
|
||||
// InstanceExists returns true if the instance for the given node exists according to the cloud provider.
|
||||
// Use the node.name or node.spec.providerID field to find the node in the cloud provider.
|
||||
InstanceExists(ctx context.Context, node *v1.Node) (bool, error)
|
||||
// InstanceShutdown returns true if the instance is shutdown according to the cloud provider.
|
||||
// Use the node.name or node.spec.providerID field to find the node in the cloud provider.
|
||||
InstanceShutdown(ctx context.Context, node *v1.Node) (bool, error)
|
||||
// InstanceMetadata returns the instance's metadata. The values returned in InstanceMetadata are
|
||||
// translated into specific fields and labels in the Node object on registration.
|
||||
// Implementations should always check node.spec.providerID first when trying to discover the instance
|
||||
// for a given node. In cases where node.spec.providerID is empty, implementations can use other
|
||||
// properties of the node like its name, labels and annotations.
|
||||
InstanceMetadata(ctx context.Context, node *v1.Node) (*InstanceMetadata, error)
|
||||
}
|
||||
|
||||
// Route is a representation of an advanced routing rule.
|
||||
type Route struct {
|
||||
// Name is the name of the routing rule in the cloud-provider.
|
||||
// It will be ignored in a Create (although nameHint may influence it)
|
||||
Name string
|
||||
// TargetNode is the NodeName of the target instance.
|
||||
TargetNode types.NodeName
|
||||
// EnableNodeAddresses is a feature gate for TargetNodeAddresses. If false, ignore TargetNodeAddresses.
|
||||
// Without this, if users haven't updated their cloud-provider, reconcile() will delete and create same route every time.
|
||||
EnableNodeAddresses bool
|
||||
// TargetNodeAddresses are the Node IPs of the target Node.
|
||||
TargetNodeAddresses []v1.NodeAddress
|
||||
// DestinationCIDR is the CIDR format IP range that this routing rule
|
||||
// applies to.
|
||||
DestinationCIDR string
|
||||
// Blackhole is set to true if this is a blackhole route
|
||||
// The node controller will delete the route if it is in the managed range.
|
||||
Blackhole bool
|
||||
}
|
||||
|
||||
// Routes is an abstract, pluggable interface for advanced routing rules.
|
||||
type Routes interface {
|
||||
// ListRoutes lists all managed routes that belong to the specified clusterName
|
||||
ListRoutes(ctx context.Context, clusterName string) ([]*Route, error)
|
||||
// CreateRoute creates the described managed route
|
||||
// route.Name will be ignored, although the cloud-provider may use nameHint
|
||||
// to create a more user-meaningful name.
|
||||
CreateRoute(ctx context.Context, clusterName string, nameHint string, route *Route) error
|
||||
// DeleteRoute deletes the specified managed route
|
||||
// Route should be as returned by ListRoutes
|
||||
DeleteRoute(ctx context.Context, clusterName string, route *Route) error
|
||||
}
|
||||
|
||||
var (
|
||||
DiskNotFound = errors.New("disk is not found")
|
||||
ImplementedElsewhere = errors.New("implemented by alternate to cloud provider")
|
||||
InstanceNotFound = errors.New("instance not found")
|
||||
NotImplemented = errors.New("unimplemented")
|
||||
)
|
||||
|
||||
// Zone represents the location of a particular machine.
|
||||
type Zone struct {
|
||||
FailureDomain string
|
||||
Region string
|
||||
}
|
||||
|
||||
// Zones is an abstract, pluggable interface for zone enumeration.
|
||||
// DEPRECATED: Zones is deprecated in favor of retrieving zone/region information from InstancesV2.
|
||||
// This interface will not be called if InstancesV2 is enabled.
|
||||
type Zones interface {
|
||||
// GetZone returns the Zone containing the current failure zone and locality region that the program is running in
|
||||
// In most cases, this method is called from the kubelet querying a local metadata service to acquire its zone.
|
||||
// For the case of external cloud providers, use GetZoneByProviderID or GetZoneByNodeName since GetZone
|
||||
// can no longer be called from the kubelets.
|
||||
GetZone(ctx context.Context) (Zone, error)
|
||||
|
||||
// GetZoneByProviderID returns the Zone containing the current zone and locality region of the node specified by providerID
|
||||
// This method is particularly used in the context of external cloud providers where node initialization must be done
|
||||
// outside the kubelets.
|
||||
GetZoneByProviderID(ctx context.Context, providerID string) (Zone, error)
|
||||
|
||||
// GetZoneByNodeName returns the Zone containing the current zone and locality region of the node specified by node name
|
||||
// This method is particularly used in the context of external cloud providers where node initialization must be done
|
||||
// outside the kubelets.
|
||||
GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (Zone, error)
|
||||
}
|
||||
|
||||
// PVLabeler is an abstract, pluggable interface for fetching labels for volumes
|
||||
// DEPRECATED: PVLabeler is deprecated in favor of CSI topology feature.
|
||||
type PVLabeler interface {
|
||||
GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVolume) (map[string]string, error)
|
||||
}
|
||||
|
||||
// InstanceMetadata contains metadata about a specific instance.
|
||||
// Values returned in InstanceMetadata are translated into specific fields and labels for Node.
|
||||
type InstanceMetadata struct {
|
||||
// ProviderID is a unique ID used to identify an instance on the cloud provider.
|
||||
// The ProviderID set here will be set on the node's spec.providerID field.
|
||||
// The provider ID format can be set by the cloud provider but providers should
|
||||
// ensure the format does not change in any incompatible way.
|
||||
//
|
||||
// The provider ID format used by existing cloud provider has been:
|
||||
// <provider-name>://<instance-id>
|
||||
// Existing providers setting this field should preserve the existing format
|
||||
// currently being set in node.spec.providerID.
|
||||
ProviderID string
|
||||
// InstanceType is the instance's type.
|
||||
// The InstanceType set here will be set using the following labels on the node object:
|
||||
// * node.kubernetes.io/instance-type=<instance-type>
|
||||
// * beta.kubernetes.io/instance-type=<instance-type> (DEPRECATED)
|
||||
InstanceType string
|
||||
// NodeAddress contains information for the instance's address.
|
||||
// The node addresses returned here will be set on the node's status.addresses field.
|
||||
NodeAddresses []v1.NodeAddress
|
||||
|
||||
// Zone is the zone that the instance is in.
|
||||
// The value set here is applied as the following labels on the node:
|
||||
// * topology.kubernetes.io/zone=<zone>
|
||||
// * failure-domain.beta.kubernetes.io/zone=<zone> (DEPRECATED)
|
||||
Zone string
|
||||
// Region is the region that the instance is in.
|
||||
// The value set here is applied as the following labels on the node:
|
||||
// * topology.kubernetes.io/region=<region>
|
||||
// * failure-domain.beta.kubernetes.io/region=<region> (DEPRECATED)
|
||||
Region string
|
||||
|
||||
// AdditionalLabels is a map of additional labels provided by the cloud provider.
|
||||
// When provided, they will be applied to the node and enable cloud providers
|
||||
// to labels nodes with information that may be valuable to that provider.
|
||||
AdditionalLabels map[string]string
|
||||
}
|
3
e2e/vendor/k8s.io/cloud-provider/code-of-conduct.md
generated
vendored
3
e2e/vendor/k8s.io/cloud-provider/code-of-conduct.md
generated
vendored
@ -1,3 +0,0 @@
|
||||
# Kubernetes Community Code of Conduct
|
||||
|
||||
Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md)
|
20
e2e/vendor/k8s.io/cloud-provider/config/doc.go
generated
vendored
20
e2e/vendor/k8s.io/cloud-provider/config/doc.go
generated
vendored
@ -1,20 +0,0 @@
|
||||
/*
|
||||
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
|
||||
// +groupName=cloudcontrollermanager.config.k8s.io
|
||||
|
||||
package config
|
44
e2e/vendor/k8s.io/cloud-provider/config/install/install.go
generated
vendored
44
e2e/vendor/k8s.io/cloud-provider/config/install/install.go
generated
vendored
@ -1,44 +0,0 @@
|
||||
/*
|
||||
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 install
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/cloud-provider/config"
|
||||
"k8s.io/cloud-provider/config/v1alpha1"
|
||||
)
|
||||
|
||||
var (
|
||||
// Scheme defines methods for serializing and deserializing API objects.
|
||||
Scheme = runtime.NewScheme()
|
||||
// Codecs provides methods for retrieving codecs and serializers for specific
|
||||
// versions and content types.
|
||||
Codecs = serializer.NewCodecFactory(Scheme)
|
||||
)
|
||||
|
||||
func init() {
|
||||
Install(Scheme)
|
||||
}
|
||||
|
||||
// Install adds the types of this group into the given scheme.
|
||||
func Install(scheme *runtime.Scheme) {
|
||||
utilruntime.Must(config.AddToScheme(scheme))
|
||||
utilruntime.Must(v1alpha1.AddToScheme(scheme))
|
||||
utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion))
|
||||
}
|
42
e2e/vendor/k8s.io/cloud-provider/config/register.go
generated
vendored
42
e2e/vendor/k8s.io/cloud-provider/config/register.go
generated
vendored
@ -1,42 +0,0 @@
|
||||
/*
|
||||
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 config
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName is the group name used in this package
|
||||
const GroupName = "cloudcontrollermanager.config.k8s.io"
|
||||
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// addKnownTypes registers known types to the given scheme
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&CloudControllerManagerConfiguration{},
|
||||
)
|
||||
return nil
|
||||
}
|
103
e2e/vendor/k8s.io/cloud-provider/config/types.go
generated
vendored
103
e2e/vendor/k8s.io/cloud-provider/config/types.go
generated
vendored
@ -1,103 +0,0 @@
|
||||
/*
|
||||
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 config
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
nodeconfig "k8s.io/cloud-provider/controllers/node/config"
|
||||
serviceconfig "k8s.io/cloud-provider/controllers/service/config"
|
||||
cmconfig "k8s.io/controller-manager/config"
|
||||
)
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// CloudControllerManagerConfiguration contains elements describing cloud-controller manager.
|
||||
type CloudControllerManagerConfiguration struct {
|
||||
metav1.TypeMeta
|
||||
|
||||
// Generic holds configuration for a generic controller-manager
|
||||
Generic cmconfig.GenericControllerManagerConfiguration
|
||||
// KubeCloudSharedConfiguration holds configuration for shared related features
|
||||
// both in cloud controller manager and kube-controller manager.
|
||||
KubeCloudShared KubeCloudSharedConfiguration
|
||||
|
||||
// NodeController holds configuration for node controller
|
||||
// related features.
|
||||
NodeController nodeconfig.NodeControllerConfiguration
|
||||
|
||||
// ServiceControllerConfiguration holds configuration for ServiceController
|
||||
// related features.
|
||||
ServiceController serviceconfig.ServiceControllerConfiguration
|
||||
|
||||
// NodeStatusUpdateFrequency is the frequency at which the controller updates nodes' status
|
||||
NodeStatusUpdateFrequency metav1.Duration
|
||||
|
||||
// Webhook is the configuration for cloud-controller-manager hosted webhooks
|
||||
Webhook WebhookConfiguration
|
||||
}
|
||||
|
||||
// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager
|
||||
// and cloud-controller manager, but not genericconfig.
|
||||
type KubeCloudSharedConfiguration struct {
|
||||
// CloudProviderConfiguration holds configuration for CloudProvider related features.
|
||||
CloudProvider CloudProviderConfiguration
|
||||
// externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
|
||||
// It is currently used by the in repo cloud providers to handle node and volume control in the KCM.
|
||||
ExternalCloudVolumePlugin string
|
||||
// useServiceAccountCredentials indicates whether controllers should be run with
|
||||
// individual service account credentials.
|
||||
UseServiceAccountCredentials bool
|
||||
// run with untagged cloud instances
|
||||
AllowUntaggedCloud bool
|
||||
// routeReconciliationPeriod is the period for reconciling routes created for Nodes by cloud provider..
|
||||
RouteReconciliationPeriod metav1.Duration
|
||||
// nodeMonitorPeriod is the period for syncing NodeStatus in CloudNodeLifecycleController.
|
||||
NodeMonitorPeriod metav1.Duration
|
||||
// clusterName is the instance prefix for the cluster.
|
||||
ClusterName string
|
||||
// clusterCIDR is CIDR Range for Pods in cluster.
|
||||
ClusterCIDR string
|
||||
// AllocateNodeCIDRs enables CIDRs for Pods to be allocated and, if
|
||||
// ConfigureCloudRoutes is true, to be set on the cloud provider.
|
||||
AllocateNodeCIDRs bool
|
||||
// CIDRAllocatorType determines what kind of pod CIDR allocator will be used.
|
||||
CIDRAllocatorType string
|
||||
// configureCloudRoutes enables CIDRs allocated with allocateNodeCIDRs
|
||||
// to be configured on the cloud provider.
|
||||
ConfigureCloudRoutes bool
|
||||
// nodeSyncPeriod is the period for syncing nodes from cloudprovider. Longer
|
||||
// periods will result in fewer calls to cloud provider, but may delay addition
|
||||
// of new nodes to cluster.
|
||||
NodeSyncPeriod metav1.Duration
|
||||
}
|
||||
|
||||
// CloudProviderConfiguration contains basically elements about cloud provider.
|
||||
type CloudProviderConfiguration struct {
|
||||
// Name is the provider for cloud services.
|
||||
Name string
|
||||
// cloudConfigFile is the path to the cloud provider configuration file.
|
||||
CloudConfigFile string
|
||||
}
|
||||
|
||||
type WebhookConfiguration struct {
|
||||
// Webhooks is the list of webhooks to enable or disable
|
||||
// '*' means "all enabled by default webhooks"
|
||||
// 'foo' means "enable 'foo'"
|
||||
// '-foo' means "disable 'foo'"
|
||||
// first item for a particular name wins
|
||||
Webhooks []string
|
||||
}
|
49
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/conversion.go
generated
vendored
49
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/conversion.go
generated
vendored
@ -1,49 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 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"
|
||||
cpconfig "k8s.io/cloud-provider/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_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in *KubeCloudSharedConfiguration, out *cpconfig.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 *cpconfig.KubeCloudSharedConfiguration, out *KubeCloudSharedConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in *CloudProviderConfiguration, out *cpconfig.CloudProviderConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in *cpconfig.CloudProviderConfiguration, out *CloudProviderConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in, out, s)
|
||||
}
|
71
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/defaults.go
generated
vendored
71
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/defaults.go
generated
vendored
@ -1,71 +0,0 @@
|
||||
/*
|
||||
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"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
nodeconfigv1alpha1 "k8s.io/cloud-provider/controllers/node/config/v1alpha1"
|
||||
serviceconfigv1alpha1 "k8s.io/cloud-provider/controllers/service/config/v1alpha1"
|
||||
cmconfigv1alpha1 "k8s.io/controller-manager/config/v1alpha1"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
func addDefaultingFuncs(scheme *runtime.Scheme) error {
|
||||
return RegisterDefaults(scheme)
|
||||
}
|
||||
|
||||
func SetDefaults_CloudControllerManagerConfiguration(obj *CloudControllerManagerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.NodeStatusUpdateFrequency == zero {
|
||||
obj.NodeStatusUpdateFrequency = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
|
||||
// These defaults override the recommended defaults from the apimachineryconfigv1alpha1 package that are applied automatically
|
||||
// These client-connection defaults are specific to the cloud-controller-manager
|
||||
if obj.Generic.ClientConnection.QPS == 0 {
|
||||
obj.Generic.ClientConnection.QPS = 20
|
||||
}
|
||||
if obj.Generic.ClientConnection.Burst == 0 {
|
||||
obj.Generic.ClientConnection.Burst = 30
|
||||
}
|
||||
|
||||
// Use the default RecommendedDefaultGenericControllerManagerConfiguration options
|
||||
cmconfigv1alpha1.RecommendedDefaultGenericControllerManagerConfiguration(&obj.Generic)
|
||||
// Use the default RecommendedDefaultServiceControllerConfiguration options
|
||||
serviceconfigv1alpha1.RecommendedDefaultServiceControllerConfiguration(&obj.ServiceController)
|
||||
// Use the default RecommendedDefaultNodeControllerConfiguration options
|
||||
nodeconfigv1alpha1.RecommendedDefaultNodeControllerConfiguration(&obj.NodeController)
|
||||
}
|
||||
|
||||
func SetDefaults_KubeCloudSharedConfiguration(obj *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}
|
||||
}
|
||||
}
|
32
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/doc.go
generated
vendored
32
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/doc.go
generated
vendored
@ -1,32 +0,0 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
// Note: The referenced generic ComponentConfig packages with conversions
|
||||
// between the types (e.g. the external package) needs to be given as an
|
||||
// input to conversion-gen for it to find the native conversation funcs to
|
||||
// call.
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/component-base/config/v1alpha1
|
||||
// +k8s:conversion-gen=k8s.io/cloud-provider/config
|
||||
// +k8s:conversion-gen=k8s.io/cloud-provider/config/v1alpha1
|
||||
// +k8s:conversion-gen=k8s.io/cloud-provider/controllers/service/config/v1alpha1
|
||||
// +k8s:conversion-gen=k8s.io/controller-manager/config/v1alpha1
|
||||
// +k8s:openapi-gen=true
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +groupName=cloudcontrollermanager.config.k8s.io
|
||||
|
||||
package v1alpha1
|
52
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/register.go
generated
vendored
52
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/register.go
generated
vendored
@ -1,52 +0,0 @@
|
||||
/*
|
||||
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"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
const GroupName = "cloudcontrollermanager.config.k8s.io"
|
||||
|
||||
var (
|
||||
// GroupName is the group name use in this package
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||
// localSchemeBuilder ïs a pointer to SchemeBuilder instance. Using localSchemeBuilder
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &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)
|
||||
}
|
||||
|
||||
// addKnownTypes registers known types to the given scheme
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&CloudControllerManagerConfiguration{},
|
||||
)
|
||||
return nil
|
||||
}
|
101
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/types.go
generated
vendored
101
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/types.go
generated
vendored
@ -1,101 +0,0 @@
|
||||
/*
|
||||
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 (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
nodeconfigv1alpha1 "k8s.io/cloud-provider/controllers/node/config/v1alpha1"
|
||||
serviceconfigv1alpha1 "k8s.io/cloud-provider/controllers/service/config/v1alpha1"
|
||||
cmconfigv1alpha1 "k8s.io/controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// CloudControllerManagerConfiguration contains elements describing cloud-controller manager.
|
||||
type CloudControllerManagerConfiguration struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
|
||||
// Generic holds configuration for a generic controller-manager
|
||||
Generic cmconfigv1alpha1.GenericControllerManagerConfiguration
|
||||
// KubeCloudSharedConfiguration holds configuration for shared related features
|
||||
// both in cloud controller manager and kube-controller manager.
|
||||
KubeCloudShared KubeCloudSharedConfiguration
|
||||
// NodeController holds configuration for node controller
|
||||
// related features.
|
||||
NodeController nodeconfigv1alpha1.NodeControllerConfiguration
|
||||
// ServiceControllerConfiguration holds configuration for ServiceController
|
||||
// related features.
|
||||
ServiceController serviceconfigv1alpha1.ServiceControllerConfiguration
|
||||
// NodeStatusUpdateFrequency is the frequency at which the controller updates nodes' status
|
||||
NodeStatusUpdateFrequency metav1.Duration
|
||||
// Webhook is the configuration for cloud-controller-manager hosted webhooks
|
||||
Webhook WebhookConfiguration
|
||||
}
|
||||
|
||||
// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager
|
||||
// and cloud-controller manager, but not genericconfig.
|
||||
type KubeCloudSharedConfiguration struct {
|
||||
// CloudProviderConfiguration holds configuration for CloudProvider related features.
|
||||
CloudProvider CloudProviderConfiguration
|
||||
// externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
|
||||
// It is currently used by the in repo cloud providers to handle node and volume control in the KCM.
|
||||
ExternalCloudVolumePlugin string
|
||||
// useServiceAccountCredentials indicates whether controllers should be run with
|
||||
// individual service account credentials.
|
||||
UseServiceAccountCredentials bool
|
||||
// run with untagged cloud instances
|
||||
AllowUntaggedCloud bool
|
||||
// routeReconciliationPeriod is the period for reconciling routes created for Nodes by cloud provider..
|
||||
RouteReconciliationPeriod metav1.Duration
|
||||
// nodeMonitorPeriod is the period for syncing NodeStatus in NodeController.
|
||||
NodeMonitorPeriod metav1.Duration
|
||||
// clusterName is the instance prefix for the cluster.
|
||||
ClusterName string
|
||||
// clusterCIDR is CIDR Range for Pods in cluster.
|
||||
ClusterCIDR string
|
||||
// AllocateNodeCIDRs enables CIDRs for Pods to be allocated and, if
|
||||
// ConfigureCloudRoutes is true, to be set on the cloud provider.
|
||||
AllocateNodeCIDRs bool
|
||||
// CIDRAllocatorType determines what kind of pod CIDR allocator will be used.
|
||||
CIDRAllocatorType string
|
||||
// configureCloudRoutes enables CIDRs allocated with allocateNodeCIDRs
|
||||
// to be configured on the cloud provider.
|
||||
ConfigureCloudRoutes *bool
|
||||
// nodeSyncPeriod is the period for syncing nodes from cloudprovider. Longer
|
||||
// periods will result in fewer calls to cloud provider, but may delay addition
|
||||
// of new nodes to cluster.
|
||||
NodeSyncPeriod metav1.Duration
|
||||
}
|
||||
|
||||
// CloudProviderConfiguration contains basically elements about cloud provider.
|
||||
type CloudProviderConfiguration struct {
|
||||
// Name is the provider for cloud services.
|
||||
Name string
|
||||
// cloudConfigFile is the path to the cloud provider configuration file.
|
||||
CloudConfigFile string
|
||||
}
|
||||
|
||||
// WebhookConfiguration contains configuration related to
|
||||
// cloud-controller-manager hosted webhooks
|
||||
type WebhookConfiguration struct {
|
||||
// Webhooks is the list of webhooks to enable or disable
|
||||
// '*' means "all enabled by default webhooks"
|
||||
// 'foo' means "enable 'foo'"
|
||||
// '-foo' means "disable 'foo'"
|
||||
// first item for a particular name wins
|
||||
Webhooks []string
|
||||
}
|
206
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.conversion.go
generated
vendored
206
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.conversion.go
generated
vendored
@ -1,206 +0,0 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +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 conversion-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
unsafe "unsafe"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
config "k8s.io/cloud-provider/config"
|
||||
nodeconfigv1alpha1 "k8s.io/cloud-provider/controllers/node/config/v1alpha1"
|
||||
serviceconfigv1alpha1 "k8s.io/cloud-provider/controllers/service/config/v1alpha1"
|
||||
configv1alpha1 "k8s.io/controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
func init() {
|
||||
localSchemeBuilder.Register(RegisterConversions)
|
||||
}
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(s *runtime.Scheme) error {
|
||||
if err := s.AddGeneratedConversionFunc((*CloudControllerManagerConfiguration)(nil), (*config.CloudControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(a.(*CloudControllerManagerConfiguration), b.(*config.CloudControllerManagerConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*config.CloudControllerManagerConfiguration)(nil), (*CloudControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(a.(*config.CloudControllerManagerConfiguration), b.(*CloudControllerManagerConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*WebhookConfiguration)(nil), (*config.WebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration(a.(*WebhookConfiguration), b.(*config.WebhookConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*config.WebhookConfiguration)(nil), (*WebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration(a.(*config.WebhookConfiguration), b.(*WebhookConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*config.CloudProviderConfiguration)(nil), (*CloudProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(a.(*config.CloudProviderConfiguration), b.(*CloudProviderConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*config.KubeCloudSharedConfiguration)(nil), (*KubeCloudSharedConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(a.(*config.KubeCloudSharedConfiguration), b.(*KubeCloudSharedConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*CloudProviderConfiguration)(nil), (*config.CloudProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(a.(*CloudProviderConfiguration), b.(*config.CloudProviderConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*KubeCloudSharedConfiguration)(nil), (*config.KubeCloudSharedConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(a.(*KubeCloudSharedConfiguration), b.(*config.KubeCloudSharedConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration, out *config.CloudControllerManagerConfiguration, s conversion.Scope) error {
|
||||
if err := configv1alpha1.Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := nodeconfigv1alpha1.Convert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration(&in.NodeController, &out.NodeController, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := serviceconfigv1alpha1.Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency
|
||||
if err := Convert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration(&in.Webhook, &out.Webhook, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration, out *config.CloudControllerManagerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in *config.CloudControllerManagerConfiguration, out *CloudControllerManagerConfiguration, s conversion.Scope) error {
|
||||
if err := configv1alpha1.Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := nodeconfigv1alpha1.Convert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration(&in.NodeController, &out.NodeController, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := serviceconfigv1alpha1.Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency
|
||||
if err := Convert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration(&in.Webhook, &out.Webhook, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in *config.CloudControllerManagerConfiguration, out *CloudControllerManagerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in *CloudProviderConfiguration, out *config.CloudProviderConfiguration, s conversion.Scope) error {
|
||||
out.Name = in.Name
|
||||
out.CloudConfigFile = in.CloudConfigFile
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in *config.CloudProviderConfiguration, out *CloudProviderConfiguration, s conversion.Scope) error {
|
||||
out.Name = in.Name
|
||||
out.CloudConfigFile = in.CloudConfigFile
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in *KubeCloudSharedConfiguration, out *config.KubeCloudSharedConfiguration, s conversion.Scope) error {
|
||||
if err := Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin
|
||||
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
|
||||
out.AllowUntaggedCloud = in.AllowUntaggedCloud
|
||||
out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
|
||||
out.NodeMonitorPeriod = in.NodeMonitorPeriod
|
||||
out.ClusterName = in.ClusterName
|
||||
out.ClusterCIDR = in.ClusterCIDR
|
||||
out.AllocateNodeCIDRs = in.AllocateNodeCIDRs
|
||||
out.CIDRAllocatorType = in.CIDRAllocatorType
|
||||
if err := v1.Convert_Pointer_bool_To_bool(&in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.NodeSyncPeriod = in.NodeSyncPeriod
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in *config.KubeCloudSharedConfiguration, out *KubeCloudSharedConfiguration, s conversion.Scope) error {
|
||||
if err := Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin
|
||||
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
|
||||
out.AllowUntaggedCloud = in.AllowUntaggedCloud
|
||||
out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
|
||||
out.NodeMonitorPeriod = in.NodeMonitorPeriod
|
||||
out.ClusterName = in.ClusterName
|
||||
out.ClusterCIDR = in.ClusterCIDR
|
||||
out.AllocateNodeCIDRs = in.AllocateNodeCIDRs
|
||||
out.CIDRAllocatorType = in.CIDRAllocatorType
|
||||
if err := v1.Convert_bool_To_Pointer_bool(&in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.NodeSyncPeriod = in.NodeSyncPeriod
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration(in *WebhookConfiguration, out *config.WebhookConfiguration, s conversion.Scope) error {
|
||||
out.Webhooks = *(*[]string)(unsafe.Pointer(&in.Webhooks))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration(in *WebhookConfiguration, out *config.WebhookConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration(in *config.WebhookConfiguration, out *WebhookConfiguration, s conversion.Scope) error {
|
||||
out.Webhooks = *(*[]string)(unsafe.Pointer(&in.Webhooks))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration(in *config.WebhookConfiguration, out *WebhookConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration(in, out, s)
|
||||
}
|
119
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.deepcopy.go
generated
vendored
119
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.deepcopy.go
generated
vendored
@ -1,119 +0,0 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +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
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CloudControllerManagerConfiguration) DeepCopyInto(out *CloudControllerManagerConfiguration) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.Generic.DeepCopyInto(&out.Generic)
|
||||
in.KubeCloudShared.DeepCopyInto(&out.KubeCloudShared)
|
||||
out.NodeController = in.NodeController
|
||||
out.ServiceController = in.ServiceController
|
||||
out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency
|
||||
in.Webhook.DeepCopyInto(&out.Webhook)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudControllerManagerConfiguration.
|
||||
func (in *CloudControllerManagerConfiguration) DeepCopy() *CloudControllerManagerConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CloudControllerManagerConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *CloudControllerManagerConfiguration) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CloudProviderConfiguration) DeepCopyInto(out *CloudProviderConfiguration) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProviderConfiguration.
|
||||
func (in *CloudProviderConfiguration) DeepCopy() *CloudProviderConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CloudProviderConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) {
|
||||
*out = *in
|
||||
out.CloudProvider = in.CloudProvider
|
||||
out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
|
||||
out.NodeMonitorPeriod = in.NodeMonitorPeriod
|
||||
if in.ConfigureCloudRoutes != nil {
|
||||
in, out := &in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
out.NodeSyncPeriod = in.NodeSyncPeriod
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeCloudSharedConfiguration.
|
||||
func (in *KubeCloudSharedConfiguration) DeepCopy() *KubeCloudSharedConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KubeCloudSharedConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WebhookConfiguration) DeepCopyInto(out *WebhookConfiguration) {
|
||||
*out = *in
|
||||
if in.Webhooks != nil {
|
||||
in, out := &in.Webhooks, &out.Webhooks
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConfiguration.
|
||||
func (in *WebhookConfiguration) DeepCopy() *WebhookConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WebhookConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
41
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.defaults.go
generated
vendored
41
e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.defaults.go
generated
vendored
@ -1,41 +0,0 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +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"
|
||||
)
|
||||
|
||||
// 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(&CloudControllerManagerConfiguration{}, func(obj interface{}) {
|
||||
SetObjectDefaults_CloudControllerManagerConfiguration(obj.(*CloudControllerManagerConfiguration))
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetObjectDefaults_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration) {
|
||||
SetDefaults_CloudControllerManagerConfiguration(in)
|
||||
SetDefaults_KubeCloudSharedConfiguration(&in.KubeCloudShared)
|
||||
}
|
114
e2e/vendor/k8s.io/cloud-provider/config/zz_generated.deepcopy.go
generated
vendored
114
e2e/vendor/k8s.io/cloud-provider/config/zz_generated.deepcopy.go
generated
vendored
@ -1,114 +0,0 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +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 config
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CloudControllerManagerConfiguration) DeepCopyInto(out *CloudControllerManagerConfiguration) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.Generic.DeepCopyInto(&out.Generic)
|
||||
out.KubeCloudShared = in.KubeCloudShared
|
||||
out.NodeController = in.NodeController
|
||||
out.ServiceController = in.ServiceController
|
||||
out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency
|
||||
in.Webhook.DeepCopyInto(&out.Webhook)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudControllerManagerConfiguration.
|
||||
func (in *CloudControllerManagerConfiguration) DeepCopy() *CloudControllerManagerConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CloudControllerManagerConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *CloudControllerManagerConfiguration) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CloudProviderConfiguration) DeepCopyInto(out *CloudProviderConfiguration) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProviderConfiguration.
|
||||
func (in *CloudProviderConfiguration) DeepCopy() *CloudProviderConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CloudProviderConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) {
|
||||
*out = *in
|
||||
out.CloudProvider = in.CloudProvider
|
||||
out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
|
||||
out.NodeMonitorPeriod = in.NodeMonitorPeriod
|
||||
out.NodeSyncPeriod = in.NodeSyncPeriod
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeCloudSharedConfiguration.
|
||||
func (in *KubeCloudSharedConfiguration) DeepCopy() *KubeCloudSharedConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(KubeCloudSharedConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WebhookConfiguration) DeepCopyInto(out *WebhookConfiguration) {
|
||||
*out = *in
|
||||
if in.Webhooks != nil {
|
||||
in, out := &in.Webhooks, &out.Webhooks
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConfiguration.
|
||||
func (in *WebhookConfiguration) DeepCopy() *WebhookConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WebhookConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
24
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/types.go
generated
vendored
24
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/types.go
generated
vendored
@ -1,24 +0,0 @@
|
||||
/*
|
||||
Copyright 2022 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 config
|
||||
|
||||
// NodeControllerConfiguration contains elements describing NodeController.
|
||||
type NodeControllerConfiguration struct {
|
||||
// ConcurrentNodeSyncs is the number of workers
|
||||
// concurrently synchronizing nodes
|
||||
ConcurrentNodeSyncs int32
|
||||
}
|
39
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/conversion.go
generated
vendored
39
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/conversion.go
generated
vendored
@ -1,39 +0,0 @@
|
||||
/*
|
||||
Copyright 2022 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/cloud-provider/controllers/node/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_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration(in *config.NodeControllerConfiguration, out *NodeControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration(in *NodeControllerConfiguration, out *config.NodeControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration(in, out, s)
|
||||
}
|
23
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/defaults.go
generated
vendored
23
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/defaults.go
generated
vendored
@ -1,23 +0,0 @@
|
||||
/*
|
||||
Copyright 2022 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
|
||||
|
||||
func RecommendedDefaultNodeControllerConfiguration(obj *NodeControllerConfiguration) {
|
||||
if obj.ConcurrentNodeSyncs == 0 {
|
||||
obj.ConcurrentNodeSyncs = 1
|
||||
}
|
||||
}
|
21
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/doc.go
generated
vendored
21
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/doc.go
generated
vendored
@ -1,21 +0,0 @@
|
||||
/*
|
||||
Copyright 2022 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/cloud-provider/controllers/node/config
|
||||
// +k8s:conversion-gen=k8s.io/cloud-provider/controllers/node/config/v1alpha1
|
||||
|
||||
package v1alpha1
|
31
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/register.go
generated
vendored
31
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/register.go
generated
vendored
@ -1,31 +0,0 @@
|
||||
/*
|
||||
Copyright 2022 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"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
24
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/types.go
generated
vendored
24
e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/types.go
generated
vendored
@ -1,24 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 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
|
||||
|
||||
// NodeControllerConfiguration contains elements describing NodeController.
|
||||
type NodeControllerConfiguration struct {
|
||||
// ConcurrentNodeSyncs is the number of workers
|
||||
// concurrently synchronizing nodes
|
||||
ConcurrentNodeSyncs int32
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +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 conversion-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
config "k8s.io/cloud-provider/controllers/node/config"
|
||||
)
|
||||
|
||||
func init() {
|
||||
localSchemeBuilder.Register(RegisterConversions)
|
||||
}
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(s *runtime.Scheme) error {
|
||||
if err := s.AddConversionFunc((*config.NodeControllerConfiguration)(nil), (*NodeControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration(a.(*config.NodeControllerConfiguration), b.(*NodeControllerConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*NodeControllerConfiguration)(nil), (*config.NodeControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration(a.(*NodeControllerConfiguration), b.(*config.NodeControllerConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration(in *NodeControllerConfiguration, out *config.NodeControllerConfiguration, s conversion.Scope) error {
|
||||
out.ConcurrentNodeSyncs = in.ConcurrentNodeSyncs
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration(in *config.NodeControllerConfiguration, out *NodeControllerConfiguration, s conversion.Scope) error {
|
||||
out.ConcurrentNodeSyncs = in.ConcurrentNodeSyncs
|
||||
return nil
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +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
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NodeControllerConfiguration) DeepCopyInto(out *NodeControllerConfiguration) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeControllerConfiguration.
|
||||
func (in *NodeControllerConfiguration) DeepCopy() *NodeControllerConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NodeControllerConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
14
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/OWNERS
generated
vendored
14
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/OWNERS
generated
vendored
@ -1,14 +0,0 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
emeritus_approvers:
|
||||
- stewart-yu
|
19
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/doc.go
generated
vendored
19
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/doc.go
generated
vendored
@ -1,19 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 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
|
||||
|
||||
package config
|
25
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/types.go
generated
vendored
25
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/types.go
generated
vendored
@ -1,25 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 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 config
|
||||
|
||||
// ServiceControllerConfiguration contains elements describing ServiceController.
|
||||
type ServiceControllerConfiguration struct {
|
||||
// concurrentServiceSyncs is the number of services that are
|
||||
// allowed to sync concurrently. Larger number = more responsive service
|
||||
// management, but more CPU (and network) load.
|
||||
ConcurrentServiceSyncs int32
|
||||
}
|
39
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/conversion.go
generated
vendored
39
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/conversion.go
generated
vendored
@ -1,39 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 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"
|
||||
serviceconfig "k8s.io/cloud-provider/controllers/service/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_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in *ServiceControllerConfiguration, out *serviceconfig.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 *serviceconfig.ServiceControllerConfiguration, out *ServiceControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in, out, s)
|
||||
}
|
32
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/defaults.go
generated
vendored
32
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/defaults.go
generated
vendored
@ -1,32 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 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
|
||||
|
||||
// RecommendedDefaultServiceControllerConfiguration defaults a pointer to a
|
||||
// ServiceControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultServiceControllerConfiguration(obj *ServiceControllerConfiguration) {
|
||||
if obj.ConcurrentServiceSyncs == 0 {
|
||||
obj.ConcurrentServiceSyncs = 1
|
||||
}
|
||||
}
|
21
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/doc.go
generated
vendored
21
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/doc.go
generated
vendored
@ -1,21 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 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/cloud-provider/controllers/service/config
|
||||
// +k8s:conversion-gen=k8s.io/cloud-provider/controllers/service/config/v1alpha1
|
||||
|
||||
package v1alpha1
|
31
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/register.go
generated
vendored
31
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/register.go
generated
vendored
@ -1,31 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 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"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
25
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/types.go
generated
vendored
25
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/types.go
generated
vendored
@ -1,25 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 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
|
||||
|
||||
// ServiceControllerConfiguration contains elements describing ServiceController.
|
||||
type ServiceControllerConfiguration struct {
|
||||
// concurrentServiceSyncs is the number of services that are
|
||||
// allowed to sync concurrently. Larger number = more responsive service
|
||||
// management, but more CPU (and network) load.
|
||||
ConcurrentServiceSyncs int32
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +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 conversion-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
config "k8s.io/cloud-provider/controllers/service/config"
|
||||
)
|
||||
|
||||
func init() {
|
||||
localSchemeBuilder.Register(RegisterConversions)
|
||||
}
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(s *runtime.Scheme) error {
|
||||
if err := s.AddConversionFunc((*config.ServiceControllerConfiguration)(nil), (*ServiceControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(a.(*config.ServiceControllerConfiguration), b.(*ServiceControllerConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*ServiceControllerConfiguration)(nil), (*config.ServiceControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(a.(*ServiceControllerConfiguration), b.(*config.ServiceControllerConfiguration), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in *ServiceControllerConfiguration, out *config.ServiceControllerConfiguration, s conversion.Scope) error {
|
||||
out.ConcurrentServiceSyncs = in.ConcurrentServiceSyncs
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in *config.ServiceControllerConfiguration, out *ServiceControllerConfiguration, s conversion.Scope) error {
|
||||
out.ConcurrentServiceSyncs = in.ConcurrentServiceSyncs
|
||||
return nil
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +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
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ServiceControllerConfiguration) DeepCopyInto(out *ServiceControllerConfiguration) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceControllerConfiguration.
|
||||
func (in *ServiceControllerConfiguration) DeepCopy() *ServiceControllerConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ServiceControllerConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
38
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/zz_generated.deepcopy.go
generated
vendored
38
e2e/vendor/k8s.io/cloud-provider/controllers/service/config/zz_generated.deepcopy.go
generated
vendored
@ -1,38 +0,0 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +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 config
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ServiceControllerConfiguration) DeepCopyInto(out *ServiceControllerConfiguration) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceControllerConfiguration.
|
||||
func (in *ServiceControllerConfiguration) DeepCopy() *ServiceControllerConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ServiceControllerConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
18
e2e/vendor/k8s.io/cloud-provider/doc.go
generated
vendored
18
e2e/vendor/k8s.io/cloud-provider/doc.go
generated
vendored
@ -1,18 +0,0 @@
|
||||
/*
|
||||
Copyright 2014 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 cloudprovider supplies interfaces and implementations for cloud service providers.
|
||||
package cloudprovider
|
69
e2e/vendor/k8s.io/cloud-provider/names/controller_names.go
generated
vendored
69
e2e/vendor/k8s.io/cloud-provider/names/controller_names.go
generated
vendored
@ -1,69 +0,0 @@
|
||||
/*
|
||||
Copyright 2023 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 names
|
||||
|
||||
// Canonical controller names
|
||||
//
|
||||
// NAMING CONVENTIONS
|
||||
// 1. naming should be consistent across the controllers
|
||||
// 2. use of shortcuts should be avoided, unless they are well-known non-Kubernetes shortcuts
|
||||
// 3. Kubernetes' resources should be written together without a hyphen ("-")
|
||||
//
|
||||
// CHANGE POLICY
|
||||
// The controller names should be treated as IDs.
|
||||
// They can only be changed if absolutely necessary. For example if an inappropriate name was chosen in the past, or if the scope of the controller changes.
|
||||
// When a name is changed, the old name should be aliased in CCMControllerAliases, while preserving all old aliases.
|
||||
// This is done to achieve backwards compatibility
|
||||
//
|
||||
// USE CASES
|
||||
// The following places should use the controller name constants, when:
|
||||
// 1. registering a controller in app.DefaultInitFuncConstructors or sample main.controllerInitializers:
|
||||
// 1.1. disabling a controller by default in app.ControllersDisabledByDefault
|
||||
// 1.2. checking if IsControllerEnabled
|
||||
// 1.3. defining an alias in CCMControllerAliases (for backwards compatibility only)
|
||||
// 2. used anywhere inside the controller itself:
|
||||
// 2.1. [TODO] logger component should be configured with the controller name by calling LoggerWithName
|
||||
// 2.2. [TODO] logging should use a canonical controller name when referencing a controller (Eg. Starting X, Shutting down X)
|
||||
// 2.3. [TODO] emitted events should have an EventSource.Component set to the controller name (usually when initializing an EventRecorder)
|
||||
// 2.4. [TODO] registering ControllerManagerMetrics with ControllerStarted and ControllerStopped
|
||||
// 2.5. [TODO] calling WaitForNamedCacheSync
|
||||
// 3. defining controller options for "--help" command or generated documentation
|
||||
// 3.1. controller name should be used to create a pflag.FlagSet when registering controller options (the name is rendered in a controller flag group header)
|
||||
// 3.2. when defined flag's help mentions a controller name
|
||||
// 4. defining a new service account for a new controller (old controllers may have inconsistent service accounts to stay backwards compatible)
|
||||
// 5. anywhere these controllers are used outside of this module (kube-controller-manager, cloud-provider sample)
|
||||
const (
|
||||
CloudNodeController = "cloud-node-controller"
|
||||
ServiceLBController = "service-lb-controller"
|
||||
NodeRouteController = "node-route-controller"
|
||||
CloudNodeLifecycleController = "cloud-node-lifecycle-controller"
|
||||
)
|
||||
|
||||
// CCMControllerAliases returns a mapping of aliases to canonical controller names
|
||||
//
|
||||
// These aliases ensure backwards compatibility and should never be removed!
|
||||
// Only addition of new aliases is allowed, and only when a canonical name is changed (please see CHANGE POLICY of controller names)
|
||||
func CCMControllerAliases() map[string]string {
|
||||
// return a new reference to achieve immutability of the mapping
|
||||
return map[string]string{
|
||||
"cloud-node": CloudNodeController,
|
||||
"service": ServiceLBController,
|
||||
"route": NodeRouteController,
|
||||
"cloud-node-lifecycle": CloudNodeLifecycleController,
|
||||
}
|
||||
|
||||
}
|
54
e2e/vendor/k8s.io/cloud-provider/options/cloudprovider.go
generated
vendored
54
e2e/vendor/k8s.io/cloud-provider/options/cloudprovider.go
generated
vendored
@ -1,54 +0,0 @@
|
||||
/*
|
||||
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 options
|
||||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
cpconfig "k8s.io/cloud-provider/config"
|
||||
)
|
||||
|
||||
// CloudProviderOptions holds the cloudprovider options.
|
||||
type CloudProviderOptions struct {
|
||||
*cpconfig.CloudProviderConfiguration
|
||||
}
|
||||
|
||||
// Validate checks validation of cloudprovider options.
|
||||
func (s *CloudProviderOptions) Validate() []error {
|
||||
allErrors := []error{}
|
||||
return allErrors
|
||||
}
|
||||
|
||||
// AddFlags adds flags related to cloudprovider for controller manager to the specified FlagSet.
|
||||
func (s *CloudProviderOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.StringVar(&s.Name, "cloud-provider", s.Name,
|
||||
"The provider for cloud services. Empty string for no provider.")
|
||||
|
||||
fs.StringVar(&s.CloudConfigFile, "cloud-config", s.CloudConfigFile,
|
||||
"The path to the cloud provider configuration file. Empty string for no configuration file.")
|
||||
}
|
||||
|
||||
// ApplyTo fills up cloudprovider config with options.
|
||||
func (s *CloudProviderOptions) ApplyTo(cfg *cpconfig.CloudProviderConfiguration) error {
|
||||
if s == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
cfg.Name = s.Name
|
||||
cfg.CloudConfigFile = s.CloudConfigFile
|
||||
|
||||
return nil
|
||||
}
|
110
e2e/vendor/k8s.io/cloud-provider/options/kubecloudshared.go
generated
vendored
110
e2e/vendor/k8s.io/cloud-provider/options/kubecloudshared.go
generated
vendored
@ -1,110 +0,0 @@
|
||||
/*
|
||||
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 options
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
cpconfig "k8s.io/cloud-provider/config"
|
||||
"k8s.io/cloud-provider/names"
|
||||
)
|
||||
|
||||
// KubeCloudSharedOptions holds the options shared between kube-controller-manager
|
||||
// and cloud-controller-manager.
|
||||
type KubeCloudSharedOptions struct {
|
||||
*cpconfig.KubeCloudSharedConfiguration
|
||||
CloudProvider *CloudProviderOptions
|
||||
}
|
||||
|
||||
// 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 *cpconfig.KubeCloudSharedConfiguration) *KubeCloudSharedOptions {
|
||||
o := &KubeCloudSharedOptions{
|
||||
KubeCloudSharedConfiguration: cfg,
|
||||
CloudProvider: &CloudProviderOptions{
|
||||
CloudProviderConfiguration: &cpconfig.CloudProviderConfiguration{},
|
||||
},
|
||||
}
|
||||
|
||||
return o
|
||||
}
|
||||
|
||||
// AddFlags adds flags related to shared variable for controller manager to the specified FlagSet.
|
||||
func (o *KubeCloudSharedOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
if o == nil {
|
||||
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-ipam-controller, persistentvolume-binder-controller, persistentvolume-expander-controller and attach-detach-controller 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.")
|
||||
fs.DurationVar(&o.RouteReconciliationPeriod.Duration, "route-reconciliation-period", o.RouteReconciliationPeriod.Duration, "The period for reconciling routes created for Nodes by cloud provider.")
|
||||
fs.DurationVar(&o.NodeMonitorPeriod.Duration, "node-monitor-period", o.NodeMonitorPeriod.Duration,
|
||||
fmt.Sprintf("The period for syncing NodeStatus in %s.", names.CloudNodeLifecycleController))
|
||||
fs.StringVar(&o.ClusterName, "cluster-name", o.ClusterName, "The instance prefix for the cluster.")
|
||||
fs.StringVar(&o.ClusterCIDR, "cluster-cidr", o.ClusterCIDR, "CIDR Range for Pods in cluster. Only used when --allocate-node-cidrs=true; if false, this option will be ignored.")
|
||||
fs.BoolVar(&o.AllocateNodeCIDRs, "allocate-node-cidrs", false, "Should CIDRs for Pods be allocated and set on the cloud provider. Requires --cluster-cidr.")
|
||||
fs.StringVar(&o.CIDRAllocatorType, "cidr-allocator-type", "RangeAllocator", "Type of CIDR allocator to use")
|
||||
fs.BoolVar(&o.ConfigureCloudRoutes, "configure-cloud-routes", true, "Should CIDRs allocated by allocate-node-cidrs be configured on the cloud provider.")
|
||||
|
||||
fs.DurationVar(&o.NodeSyncPeriod.Duration, "node-sync-period", 0, ""+
|
||||
"This flag is deprecated and will be removed in future releases. See node-monitor-period for Node health checking or "+
|
||||
"route-reconciliation-period for cloud provider's route configuration settings.")
|
||||
fs.MarkDeprecated("node-sync-period", "This flag is currently no-op and will be deleted.")
|
||||
}
|
||||
|
||||
// ApplyTo fills up KubeCloudShared config with options.
|
||||
func (o *KubeCloudSharedOptions) ApplyTo(cfg *cpconfig.KubeCloudSharedConfiguration) error {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
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
|
||||
cfg.NodeMonitorPeriod = o.NodeMonitorPeriod
|
||||
cfg.ClusterName = o.ClusterName
|
||||
cfg.ClusterCIDR = o.ClusterCIDR
|
||||
cfg.AllocateNodeCIDRs = o.AllocateNodeCIDRs
|
||||
cfg.CIDRAllocatorType = o.CIDRAllocatorType
|
||||
cfg.ConfigureCloudRoutes = o.ConfigureCloudRoutes
|
||||
cfg.NodeSyncPeriod = o.NodeSyncPeriod
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Validate checks validation of KubeCloudSharedOptions.
|
||||
func (o *KubeCloudSharedOptions) Validate() []error {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
errs := []error{}
|
||||
errs = append(errs, o.CloudProvider.Validate()...)
|
||||
|
||||
return errs
|
||||
}
|
62
e2e/vendor/k8s.io/cloud-provider/options/nodecontroller.go
generated
vendored
62
e2e/vendor/k8s.io/cloud-provider/options/nodecontroller.go
generated
vendored
@ -1,62 +0,0 @@
|
||||
/*
|
||||
Copyright 2022 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 options
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
nodeconfig "k8s.io/cloud-provider/controllers/node/config"
|
||||
)
|
||||
|
||||
// NodeControllerOptions holds the ServiceController options.
|
||||
type NodeControllerOptions struct {
|
||||
*nodeconfig.NodeControllerConfiguration
|
||||
}
|
||||
|
||||
// AddFlags adds flags related to ServiceController for controller manager to the specified FlagSet.
|
||||
func (o *NodeControllerOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
if o == nil {
|
||||
return
|
||||
}
|
||||
|
||||
fs.Int32Var(&o.ConcurrentNodeSyncs, "concurrent-node-syncs", o.ConcurrentNodeSyncs, "Number of workers concurrently synchronizing nodes.")
|
||||
}
|
||||
|
||||
// ApplyTo fills up ServiceController config with options.
|
||||
func (o *NodeControllerOptions) ApplyTo(cfg *nodeconfig.NodeControllerConfiguration) error {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
cfg.ConcurrentNodeSyncs = o.ConcurrentNodeSyncs
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Validate checks validation of NodeControllerOptions.
|
||||
func (o *NodeControllerOptions) Validate() []error {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
var errors []error
|
||||
if o.ConcurrentNodeSyncs <= 0 {
|
||||
errors = append(errors, fmt.Errorf("concurrent-node-syncs must be a positive number"))
|
||||
}
|
||||
return errors
|
||||
}
|
308
e2e/vendor/k8s.io/cloud-provider/options/options.go
generated
vendored
308
e2e/vendor/k8s.io/cloud-provider/options/options.go
generated
vendored
@ -1,308 +0,0 @@
|
||||
/*
|
||||
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 options
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||
apiserveroptions "k8s.io/apiserver/pkg/server/options"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
"k8s.io/client-go/informers"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
"k8s.io/client-go/tools/record"
|
||||
cloudprovider "k8s.io/cloud-provider"
|
||||
"k8s.io/cloud-provider/app/config"
|
||||
ccmconfig "k8s.io/cloud-provider/config"
|
||||
ccmconfigscheme "k8s.io/cloud-provider/config/install"
|
||||
ccmconfigv1alpha1 "k8s.io/cloud-provider/config/v1alpha1"
|
||||
"k8s.io/cloud-provider/names"
|
||||
cliflag "k8s.io/component-base/cli/flag"
|
||||
cmoptions "k8s.io/controller-manager/options"
|
||||
"k8s.io/controller-manager/pkg/clientbuilder"
|
||||
netutils "k8s.io/utils/net"
|
||||
|
||||
// add the related feature gates
|
||||
_ "k8s.io/controller-manager/pkg/features/register"
|
||||
)
|
||||
|
||||
const (
|
||||
// CloudControllerManagerUserAgent is the userAgent name when starting cloud-controller managers.
|
||||
CloudControllerManagerUserAgent = "cloud-controller-manager"
|
||||
)
|
||||
|
||||
// CloudControllerManagerOptions is the main context object for the controller manager.
|
||||
type CloudControllerManagerOptions struct {
|
||||
Generic *cmoptions.GenericControllerManagerConfigurationOptions
|
||||
KubeCloudShared *KubeCloudSharedOptions
|
||||
ServiceController *ServiceControllerOptions
|
||||
NodeController *NodeControllerOptions
|
||||
|
||||
SecureServing *apiserveroptions.SecureServingOptionsWithLoopback
|
||||
Authentication *apiserveroptions.DelegatingAuthenticationOptions
|
||||
Authorization *apiserveroptions.DelegatingAuthorizationOptions
|
||||
|
||||
Master string
|
||||
|
||||
WebhookServing *WebhookServingOptions
|
||||
Webhook *WebhookOptions
|
||||
|
||||
// NodeStatusUpdateFrequency is the frequency at which the controller updates nodes' status
|
||||
NodeStatusUpdateFrequency metav1.Duration
|
||||
}
|
||||
|
||||
// ProviderDefaults are provided by the consumer when calling
|
||||
// NewCloudControllerManagerOptions(), so that they can customize certain flag
|
||||
// default values.
|
||||
type ProviderDefaults struct {
|
||||
// WebhookBindAddress is the default address. It can be overridden by "--webhook-bind-address".
|
||||
WebhookBindAddress *net.IP
|
||||
// WebhookBindPort is the default port. It can be overridden by "--webhook-bind-port".
|
||||
WebhookBindPort *int
|
||||
}
|
||||
|
||||
// NewCloudControllerManagerOptions creates a new ExternalCMServer with a default config.
|
||||
func NewCloudControllerManagerOptions() (*CloudControllerManagerOptions, error) {
|
||||
return NewCloudControllerManagerOptionsWithProviderDefaults(ProviderDefaults{})
|
||||
}
|
||||
|
||||
// NewCloudControllerManagerOptionsWithProviderDefaults creates a new
|
||||
// ExternalCMServer with a default config, but allows the cloud provider to
|
||||
// override a select number of default option values.
|
||||
func NewCloudControllerManagerOptionsWithProviderDefaults(defaults ProviderDefaults) (*CloudControllerManagerOptions, error) {
|
||||
componentConfig, err := NewDefaultComponentConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s := CloudControllerManagerOptions{
|
||||
Generic: cmoptions.NewGenericControllerManagerConfigurationOptions(&componentConfig.Generic),
|
||||
KubeCloudShared: NewKubeCloudSharedOptions(&componentConfig.KubeCloudShared),
|
||||
NodeController: &NodeControllerOptions{
|
||||
NodeControllerConfiguration: &componentConfig.NodeController,
|
||||
},
|
||||
ServiceController: &ServiceControllerOptions{
|
||||
ServiceControllerConfiguration: &componentConfig.ServiceController,
|
||||
},
|
||||
SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(),
|
||||
Webhook: NewWebhookOptions(),
|
||||
WebhookServing: NewWebhookServingOptions(defaults),
|
||||
Authentication: apiserveroptions.NewDelegatingAuthenticationOptions(),
|
||||
Authorization: apiserveroptions.NewDelegatingAuthorizationOptions(),
|
||||
NodeStatusUpdateFrequency: componentConfig.NodeStatusUpdateFrequency,
|
||||
}
|
||||
|
||||
s.Authentication.RemoteKubeConfigFileOptional = true
|
||||
s.Authorization.RemoteKubeConfigFileOptional = true
|
||||
|
||||
// Set the PairName but leave certificate directory blank to generate in-memory by default
|
||||
s.SecureServing.ServerCert.CertDirectory = ""
|
||||
s.SecureServing.ServerCert.PairName = "cloud-controller-manager"
|
||||
s.SecureServing.BindPort = cloudprovider.CloudControllerManagerPort
|
||||
|
||||
s.Generic.LeaderElection.ResourceName = "cloud-controller-manager"
|
||||
s.Generic.LeaderElection.ResourceNamespace = "kube-system"
|
||||
|
||||
return &s, nil
|
||||
}
|
||||
|
||||
// NewDefaultComponentConfig returns cloud-controller manager configuration object.
|
||||
func NewDefaultComponentConfig() (*ccmconfig.CloudControllerManagerConfiguration, error) {
|
||||
versioned := &ccmconfigv1alpha1.CloudControllerManagerConfiguration{}
|
||||
ccmconfigscheme.Scheme.Default(versioned)
|
||||
|
||||
internal := &ccmconfig.CloudControllerManagerConfiguration{}
|
||||
if err := ccmconfigscheme.Scheme.Convert(versioned, internal, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return internal, nil
|
||||
}
|
||||
|
||||
// Flags returns flags for a specific CloudController by section name
|
||||
func (o *CloudControllerManagerOptions) Flags(allControllers []string, disabledByDefaultControllers []string, controllerAliases map[string]string, allWebhooks, disabledByDefaultWebhooks []string) cliflag.NamedFlagSets {
|
||||
fss := cliflag.NamedFlagSets{}
|
||||
o.Generic.AddFlags(&fss, allControllers, disabledByDefaultControllers, controllerAliases)
|
||||
o.KubeCloudShared.AddFlags(fss.FlagSet("generic"))
|
||||
o.NodeController.AddFlags(fss.FlagSet(names.CloudNodeController))
|
||||
o.ServiceController.AddFlags(fss.FlagSet(names.ServiceLBController))
|
||||
if o.Webhook != nil {
|
||||
o.Webhook.AddFlags(fss.FlagSet("webhook"), allWebhooks, disabledByDefaultWebhooks)
|
||||
}
|
||||
if o.WebhookServing != nil {
|
||||
o.WebhookServing.AddFlags(fss.FlagSet("webhook serving"))
|
||||
}
|
||||
|
||||
o.SecureServing.AddFlags(fss.FlagSet("secure serving"))
|
||||
o.Authentication.AddFlags(fss.FlagSet("authentication"))
|
||||
o.Authorization.AddFlags(fss.FlagSet("authorization"))
|
||||
|
||||
fs := fss.FlagSet("misc")
|
||||
fs.StringVar(&o.Master, "master", o.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig).")
|
||||
fs.StringVar(&o.Generic.ClientConnection.Kubeconfig, "kubeconfig", o.Generic.ClientConnection.Kubeconfig, "Path to kubeconfig file with authorization and master location information (the master location can be overridden by the master flag).")
|
||||
fs.DurationVar(&o.NodeStatusUpdateFrequency.Duration, "node-status-update-frequency", o.NodeStatusUpdateFrequency.Duration, "Specifies how often the controller updates nodes' status.")
|
||||
utilfeature.DefaultMutableFeatureGate.AddFlag(fss.FlagSet("generic"))
|
||||
|
||||
return fss
|
||||
}
|
||||
|
||||
// ApplyTo fills up cloud controller manager config with options.
|
||||
func (o *CloudControllerManagerOptions) ApplyTo(c *config.Config, allControllers []string, disabledByDefaultControllers []string, controllerAliases map[string]string, userAgent string) error {
|
||||
var err error
|
||||
|
||||
// Build kubeconfig first to so that if it fails, it doesn't cause leaking
|
||||
// goroutines (started from initializing secure serving - which underneath
|
||||
// creates a queue which in its constructor starts a goroutine).
|
||||
c.Kubeconfig, err = clientcmd.BuildConfigFromFlags(o.Master, o.Generic.ClientConnection.Kubeconfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Kubeconfig.DisableCompression = true
|
||||
c.Kubeconfig.ContentConfig.AcceptContentTypes = o.Generic.ClientConnection.AcceptContentTypes
|
||||
c.Kubeconfig.ContentConfig.ContentType = o.Generic.ClientConnection.ContentType
|
||||
c.Kubeconfig.QPS = o.Generic.ClientConnection.QPS
|
||||
c.Kubeconfig.Burst = int(o.Generic.ClientConnection.Burst)
|
||||
|
||||
if err = o.Generic.ApplyTo(&c.ComponentConfig.Generic, allControllers, disabledByDefaultControllers, controllerAliases); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = o.KubeCloudShared.ApplyTo(&c.ComponentConfig.KubeCloudShared); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = o.ServiceController.ApplyTo(&c.ComponentConfig.ServiceController); err != nil {
|
||||
return err
|
||||
}
|
||||
if o.Webhook != nil {
|
||||
if err = o.Webhook.ApplyTo(&c.ComponentConfig.Webhook); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if o.WebhookServing != nil {
|
||||
if err = o.WebhookServing.ApplyTo(&c.WebhookSecureServing, c.ComponentConfig.Webhook); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err = o.SecureServing.ApplyTo(&c.SecureServing, &c.LoopbackClientConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
if o.SecureServing.BindPort != 0 || o.SecureServing.Listener != nil {
|
||||
if err = o.Authentication.ApplyTo(&c.Authentication, c.SecureServing, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = o.Authorization.ApplyTo(&c.Authorization); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
c.Client, err = clientset.NewForConfig(restclient.AddUserAgent(c.Kubeconfig, userAgent))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c.EventBroadcaster = record.NewBroadcaster(record.WithContext(context.TODO())) // TODO: move broadcaster construction to a place where there is a proper context.
|
||||
c.EventRecorder = c.EventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: userAgent})
|
||||
|
||||
rootClientBuilder := clientbuilder.SimpleControllerClientBuilder{
|
||||
ClientConfig: c.Kubeconfig,
|
||||
}
|
||||
if c.ComponentConfig.KubeCloudShared.UseServiceAccountCredentials {
|
||||
c.ClientBuilder = clientbuilder.NewDynamicClientBuilder(
|
||||
restclient.AnonymousClientConfig(c.Kubeconfig),
|
||||
c.Client.CoreV1(),
|
||||
metav1.NamespaceSystem)
|
||||
} else {
|
||||
c.ClientBuilder = rootClientBuilder
|
||||
}
|
||||
c.VersionedClient = rootClientBuilder.ClientOrDie("shared-informers")
|
||||
c.SharedInformers = informers.NewSharedInformerFactory(c.VersionedClient, resyncPeriod(c)())
|
||||
|
||||
// sync back to component config
|
||||
// TODO: find more elegant way than syncing back the values.
|
||||
c.ComponentConfig.NodeStatusUpdateFrequency = o.NodeStatusUpdateFrequency
|
||||
c.ComponentConfig.NodeController.ConcurrentNodeSyncs = o.NodeController.ConcurrentNodeSyncs
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Validate is used to validate config before launching the cloud controller manager
|
||||
func (o *CloudControllerManagerOptions) Validate(allControllers []string, disabledByDefaultControllers []string, controllerAliases map[string]string, allWebhooks, disabledByDefaultWebhooks []string) error {
|
||||
errors := []error{}
|
||||
|
||||
errors = append(errors, o.Generic.Validate(allControllers, disabledByDefaultControllers, controllerAliases)...)
|
||||
errors = append(errors, o.KubeCloudShared.Validate()...)
|
||||
errors = append(errors, o.ServiceController.Validate()...)
|
||||
errors = append(errors, o.SecureServing.Validate()...)
|
||||
errors = append(errors, o.Authentication.Validate()...)
|
||||
errors = append(errors, o.Authorization.Validate()...)
|
||||
|
||||
if o.Webhook != nil {
|
||||
errors = append(errors, o.Webhook.Validate(allWebhooks, disabledByDefaultWebhooks)...)
|
||||
}
|
||||
if o.WebhookServing != nil {
|
||||
errors = append(errors, o.WebhookServing.Validate()...)
|
||||
|
||||
if o.WebhookServing.BindPort == o.SecureServing.BindPort && o.WebhookServing.BindPort != 0 {
|
||||
errors = append(errors, fmt.Errorf("--webhook-secure-port cannot be the same value as --secure-port"))
|
||||
}
|
||||
}
|
||||
if len(o.KubeCloudShared.CloudProvider.Name) == 0 {
|
||||
errors = append(errors, fmt.Errorf("--cloud-provider cannot be empty"))
|
||||
}
|
||||
|
||||
return utilerrors.NewAggregate(errors)
|
||||
}
|
||||
|
||||
// resyncPeriod computes the time interval a shared informer waits before resyncing with the api server
|
||||
func resyncPeriod(c *config.Config) func() time.Duration {
|
||||
return func() time.Duration {
|
||||
factor := rand.Float64() + 1
|
||||
return time.Duration(float64(c.ComponentConfig.Generic.MinResyncPeriod.Nanoseconds()) * factor)
|
||||
}
|
||||
}
|
||||
|
||||
// Config return a cloud controller manager config objective
|
||||
func (o *CloudControllerManagerOptions) Config(allControllers []string, disabledByDefaultControllers []string, controllerAliases map[string]string, allWebhooks, disabledByDefaultWebhooks []string) (*config.Config, error) {
|
||||
if err := o.Validate(allControllers, disabledByDefaultControllers, controllerAliases, allWebhooks, disabledByDefaultWebhooks); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := o.SecureServing.MaybeDefaultWithSelfSignedCerts("localhost", nil, []net.IP{netutils.ParseIPSloppy("127.0.0.1")}); err != nil {
|
||||
return nil, fmt.Errorf("error creating self-signed certificates: %v", err)
|
||||
}
|
||||
|
||||
if o.WebhookServing != nil {
|
||||
if err := o.WebhookServing.MaybeDefaultWithSelfSignedCerts("localhost", nil, []net.IP{netutils.ParseIPSloppy("127.0.0.1")}); err != nil {
|
||||
return nil, fmt.Errorf("error creating self-signed certificates for webhook: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
c := &config.Config{}
|
||||
if err := o.ApplyTo(c, allControllers, disabledByDefaultControllers, controllerAliases, CloudControllerManagerUserAgent); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return c, nil
|
||||
}
|
57
e2e/vendor/k8s.io/cloud-provider/options/servicecontroller.go
generated
vendored
57
e2e/vendor/k8s.io/cloud-provider/options/servicecontroller.go
generated
vendored
@ -1,57 +0,0 @@
|
||||
/*
|
||||
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 options
|
||||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
serviceconfig "k8s.io/cloud-provider/controllers/service/config"
|
||||
)
|
||||
|
||||
// ServiceControllerOptions holds the ServiceController options.
|
||||
type ServiceControllerOptions struct {
|
||||
*serviceconfig.ServiceControllerConfiguration
|
||||
}
|
||||
|
||||
// AddFlags adds flags related to ServiceController for controller manager to the specified FlagSet.
|
||||
func (o *ServiceControllerOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
if o == nil {
|
||||
return
|
||||
}
|
||||
|
||||
fs.Int32Var(&o.ConcurrentServiceSyncs, "concurrent-service-syncs", o.ConcurrentServiceSyncs, "The number of services that are allowed to sync concurrently. Larger number = more responsive service management, but more CPU (and network) load")
|
||||
}
|
||||
|
||||
// ApplyTo fills up ServiceController config with options.
|
||||
func (o *ServiceControllerOptions) ApplyTo(cfg *serviceconfig.ServiceControllerConfiguration) error {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
cfg.ConcurrentServiceSyncs = o.ConcurrentServiceSyncs
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Validate checks validation of ServiceControllerOptions.
|
||||
func (o *ServiceControllerOptions) Validate() []error {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
errs := []error{}
|
||||
return errs
|
||||
}
|
210
e2e/vendor/k8s.io/cloud-provider/options/webhook.go
generated
vendored
210
e2e/vendor/k8s.io/cloud-provider/options/webhook.go
generated
vendored
@ -1,210 +0,0 @@
|
||||
/*
|
||||
Copyright 2022 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 options
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apiserver/pkg/server"
|
||||
"k8s.io/apiserver/pkg/server/dynamiccertificates"
|
||||
apiserveroptions "k8s.io/apiserver/pkg/server/options"
|
||||
"k8s.io/cloud-provider/config"
|
||||
netutils "k8s.io/utils/net"
|
||||
)
|
||||
|
||||
const (
|
||||
CloudControllerManagerWebhookPort = 10260
|
||||
)
|
||||
|
||||
type WebhookOptions struct {
|
||||
// Webhooks is the list of webhook names that should be enabled or disabled
|
||||
Webhooks []string
|
||||
}
|
||||
|
||||
func NewWebhookOptions() *WebhookOptions {
|
||||
o := &WebhookOptions{}
|
||||
return o
|
||||
}
|
||||
|
||||
func (o *WebhookOptions) AddFlags(fs *pflag.FlagSet, allWebhooks, disabledByDefaultWebhooks []string) {
|
||||
fs.StringSliceVar(&o.Webhooks, "webhooks", o.Webhooks, fmt.Sprintf(""+
|
||||
"A list of webhooks to enable. '*' enables all on-by-default webhooks, 'foo' enables the webhook "+
|
||||
"named 'foo', '-foo' disables the webhook named 'foo'.\nAll webhooks: %s\nDisabled-by-default webhooks: %s",
|
||||
strings.Join(allWebhooks, ", "), strings.Join(disabledByDefaultWebhooks, ", ")))
|
||||
}
|
||||
|
||||
func (o *WebhookOptions) Validate(allWebhooks, disabledByDefaultWebhooks []string) []error {
|
||||
allErrors := []error{}
|
||||
|
||||
allWebhooksSet := sets.NewString(allWebhooks...)
|
||||
toValidate := sets.NewString(o.Webhooks...)
|
||||
toValidate.Insert(disabledByDefaultWebhooks...)
|
||||
for _, webhook := range toValidate.List() {
|
||||
if webhook == "*" {
|
||||
continue
|
||||
}
|
||||
webhook = strings.TrimPrefix(webhook, "-")
|
||||
if !allWebhooksSet.Has(webhook) {
|
||||
allErrors = append(allErrors, fmt.Errorf("%q is not in the list of known webhooks", webhook))
|
||||
}
|
||||
}
|
||||
|
||||
return allErrors
|
||||
}
|
||||
|
||||
func (o *WebhookOptions) ApplyTo(cfg *config.WebhookConfiguration) error {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
cfg.Webhooks = o.Webhooks
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type WebhookServingOptions struct {
|
||||
*apiserveroptions.SecureServingOptions
|
||||
}
|
||||
|
||||
func NewWebhookServingOptions(defaults ProviderDefaults) *WebhookServingOptions {
|
||||
var (
|
||||
bindAddress net.IP
|
||||
bindPort int
|
||||
)
|
||||
|
||||
if defaults.WebhookBindAddress != nil {
|
||||
bindAddress = *defaults.WebhookBindAddress
|
||||
} else {
|
||||
bindAddress = netutils.ParseIPSloppy("0.0.0.0")
|
||||
}
|
||||
|
||||
if defaults.WebhookBindPort != nil {
|
||||
bindPort = *defaults.WebhookBindPort
|
||||
} else {
|
||||
bindPort = CloudControllerManagerWebhookPort
|
||||
}
|
||||
|
||||
return &WebhookServingOptions{
|
||||
SecureServingOptions: &apiserveroptions.SecureServingOptions{
|
||||
BindAddress: bindAddress,
|
||||
BindPort: bindPort,
|
||||
ServerCert: apiserveroptions.GeneratableKeyCert{
|
||||
CertDirectory: "",
|
||||
PairName: "cloud-controller-manager-webhook",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (o *WebhookServingOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.IPVar(&o.BindAddress, "webhook-bind-address", o.BindAddress, ""+
|
||||
"The IP address on which to listen for the --webhook-secure-port port. The "+
|
||||
"associated interface(s) must be reachable by the rest of the cluster, and by CLI/web "+
|
||||
fmt.Sprintf("clients. If set to an unspecified address (0.0.0.0 or ::), all interfaces will be used. If unset, defaults to %v.", o.BindAddress))
|
||||
|
||||
fs.IntVar(&o.BindPort, "webhook-secure-port", o.BindPort, "Secure port to serve cloud provider webhooks. If 0, don't serve webhooks at all.")
|
||||
|
||||
fs.StringVar(&o.ServerCert.CertDirectory, "webhook-cert-dir", o.ServerCert.CertDirectory, ""+
|
||||
"The directory where the TLS certs are located. "+
|
||||
"If --tls-cert-file and --tls-private-key-file are provided, this flag will be ignored.")
|
||||
|
||||
fs.StringVar(&o.ServerCert.CertKey.CertFile, "webhook-tls-cert-file", o.ServerCert.CertKey.CertFile, ""+
|
||||
"File containing the default x509 Certificate for HTTPS. (CA cert, if any, concatenated "+
|
||||
"after server cert). If HTTPS serving is enabled, and --tls-cert-file and "+
|
||||
"--tls-private-key-file are not provided, a self-signed certificate and key "+
|
||||
"are generated for the public address and saved to the directory specified by --cert-dir.")
|
||||
|
||||
fs.StringVar(&o.ServerCert.CertKey.KeyFile, "webhook-tls-private-key-file", o.ServerCert.CertKey.KeyFile,
|
||||
"File containing the default x509 private key matching --tls-cert-file.")
|
||||
}
|
||||
|
||||
func (o *WebhookServingOptions) Validate() []error {
|
||||
allErrors := []error{}
|
||||
if o.BindPort < 0 || o.BindPort > 65535 {
|
||||
allErrors = append(allErrors, fmt.Errorf("--webhook-secure-port %v must be between 0 and 65535, inclusive. A value of 0 disables the webhook endpoint entirely.", o.BindPort))
|
||||
}
|
||||
|
||||
if (len(o.ServerCert.CertKey.CertFile) != 0 || len(o.ServerCert.CertKey.KeyFile) != 0) && o.ServerCert.GeneratedCert != nil {
|
||||
allErrors = append(allErrors, fmt.Errorf("cert/key file and in-memory certificate cannot both be set"))
|
||||
}
|
||||
|
||||
return allErrors
|
||||
}
|
||||
|
||||
func (o *WebhookServingOptions) ApplyTo(cfg **server.SecureServingInfo, webhookCfg config.WebhookConfiguration) error {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if o.BindPort <= 0 {
|
||||
return nil
|
||||
}
|
||||
// no need to bind to the address if there are no webhook enabled.
|
||||
if len(webhookCfg.Webhooks) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
var err error
|
||||
var listener net.Listener
|
||||
addr := net.JoinHostPort(o.BindAddress.String(), strconv.Itoa(o.BindPort))
|
||||
|
||||
l := net.ListenConfig{}
|
||||
|
||||
listener, o.BindPort, err = createListener(addr, l)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create listener: %v", err)
|
||||
}
|
||||
|
||||
*cfg = &server.SecureServingInfo{
|
||||
Listener: listener,
|
||||
}
|
||||
|
||||
serverCertFile, serverKeyFile := o.ServerCert.CertKey.CertFile, o.ServerCert.CertKey.KeyFile
|
||||
if len(serverCertFile) != 0 || len(serverKeyFile) != 0 {
|
||||
var err error
|
||||
(*cfg).Cert, err = dynamiccertificates.NewDynamicServingContentFromFiles("serving-cert", serverCertFile, serverKeyFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else if o.ServerCert.GeneratedCert != nil {
|
||||
(*cfg).Cert = o.ServerCert.GeneratedCert
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func createListener(addr string, config net.ListenConfig) (net.Listener, int, error) {
|
||||
ln, err := config.Listen(context.TODO(), "tcp", addr)
|
||||
if err != nil {
|
||||
return nil, 0, fmt.Errorf("failed to listen on %v: %v", addr, err)
|
||||
}
|
||||
|
||||
// get port
|
||||
tcpAddr, ok := ln.Addr().(*net.TCPAddr)
|
||||
if !ok {
|
||||
ln.Close()
|
||||
return nil, 0, fmt.Errorf("invalid listen address: %q", ln.Addr().String())
|
||||
}
|
||||
|
||||
return ln, tcpAddr.Port, nil
|
||||
}
|
136
e2e/vendor/k8s.io/cloud-provider/plugins.go
generated
vendored
136
e2e/vendor/k8s.io/cloud-provider/plugins.go
generated
vendored
@ -1,136 +0,0 @@
|
||||
/*
|
||||
Copyright 2014 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 cloudprovider
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
// Factory is a function that returns a cloudprovider.Interface.
|
||||
// The config parameter provides an io.Reader handler to the factory in
|
||||
// order to load specific configurations. If no configuration is provided
|
||||
// the parameter is nil.
|
||||
type Factory func(config io.Reader) (Interface, error)
|
||||
|
||||
// All registered cloud providers.
|
||||
var (
|
||||
providersMutex sync.Mutex
|
||||
providers = make(map[string]Factory)
|
||||
)
|
||||
|
||||
const externalCloudProvider = "external"
|
||||
|
||||
// RegisterCloudProvider registers a cloudprovider.Factory by name. This
|
||||
// is expected to happen during app startup.
|
||||
func RegisterCloudProvider(name string, cloud Factory) {
|
||||
providersMutex.Lock()
|
||||
defer providersMutex.Unlock()
|
||||
if _, found := providers[name]; found {
|
||||
klog.Fatalf("Cloud provider %q was registered twice", name)
|
||||
}
|
||||
klog.V(1).Infof("Registered cloud provider %q", name)
|
||||
providers[name] = cloud
|
||||
}
|
||||
|
||||
// IsCloudProvider returns true if name corresponds to an already registered
|
||||
// cloud provider.
|
||||
func IsCloudProvider(name string) bool {
|
||||
providersMutex.Lock()
|
||||
defer providersMutex.Unlock()
|
||||
_, found := providers[name]
|
||||
return found
|
||||
}
|
||||
|
||||
// GetCloudProvider creates an instance of the named cloud provider, or nil if
|
||||
// the name is unknown. The error return is only used if the named provider
|
||||
// was known but failed to initialize. The config parameter specifies the
|
||||
// io.Reader handler of the configuration file for the cloud provider, or nil
|
||||
// for no configuration.
|
||||
func GetCloudProvider(name string, config io.Reader) (Interface, error) {
|
||||
providersMutex.Lock()
|
||||
defer providersMutex.Unlock()
|
||||
f, found := providers[name]
|
||||
if !found {
|
||||
return nil, nil
|
||||
}
|
||||
return f(config)
|
||||
}
|
||||
|
||||
// Detects if the string is an external cloud provider
|
||||
func IsExternal(name string) bool {
|
||||
return name == externalCloudProvider
|
||||
}
|
||||
|
||||
// DisableWarningForProvider logs information about disabled cloud provider state
|
||||
func DisableWarningForProvider(providerName string) {
|
||||
if !IsExternal(providerName) {
|
||||
klog.Infof("INFO: Please make sure you are running an external cloud controller manager binary for provider %q."+
|
||||
"In-tree cloud providers are disabled. Refer to https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/cloud-provider/sample "+
|
||||
"for an example implementation.", providerName)
|
||||
klog.Warningf("WARNING: built-in cloud providers are disabled. Please set \"--cloud-provider=external\" and migrate to an external cloud controller manager for provider %q", providerName)
|
||||
}
|
||||
}
|
||||
|
||||
// ErrorForDisabledProvider returns an error formatted with the supplied provider name
|
||||
func ErrorForDisabledProvider(providerName string) error {
|
||||
return fmt.Errorf("cloud provider %q was specified, but built-in cloud providers are disabled. Please set --cloud-provider=external and migrate to an external cloud provider", providerName)
|
||||
}
|
||||
|
||||
// InitCloudProvider creates an instance of the named cloud provider.
|
||||
func InitCloudProvider(name string, configFilePath string) (Interface, error) {
|
||||
var cloud Interface
|
||||
var err error
|
||||
|
||||
if name == "" {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if IsExternal(name) {
|
||||
klog.Info("External cloud provider specified")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if configFilePath != "" {
|
||||
var config *os.File
|
||||
config, err = os.Open(configFilePath)
|
||||
if err != nil {
|
||||
klog.Fatalf("Couldn't open cloud provider configuration %s: %#v",
|
||||
configFilePath, err)
|
||||
}
|
||||
|
||||
defer config.Close()
|
||||
cloud, err = GetCloudProvider(name, config)
|
||||
} else {
|
||||
// Pass explicit nil so plugins can actually check for nil. See
|
||||
// "Why is my nil error value not equal to nil?" in golang.org/doc/faq.
|
||||
cloud, err = GetCloudProvider(name, nil)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not init cloud provider %q: %v", name, err)
|
||||
}
|
||||
if cloud == nil {
|
||||
return nil, fmt.Errorf("unknown cloud provider %q", name)
|
||||
}
|
||||
|
||||
return cloud, nil
|
||||
}
|
23
e2e/vendor/k8s.io/cloud-provider/ports.go
generated
vendored
23
e2e/vendor/k8s.io/cloud-provider/ports.go
generated
vendored
@ -1,23 +0,0 @@
|
||||
/*
|
||||
Copyright 2014 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 cloudprovider
|
||||
|
||||
const (
|
||||
// CloudControllerManagerPort is the default port for the cloud controller manager server.
|
||||
// This value may be overridden by a flag at startup.
|
||||
CloudControllerManagerPort = 10258
|
||||
)
|
Reference in New Issue
Block a user