Bumping k8s dependencies to 1.13
This commit is contained in:
59
vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/gce.go
generated
vendored
59
vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/gce/gce.go
generated
vendored
@@ -114,6 +114,7 @@ type GCECloud struct {
|
||||
eventRecorder record.EventRecorder
|
||||
projectID string
|
||||
region string
|
||||
regional bool
|
||||
localZone string // The zone in which we are running
|
||||
// managedZones will be set to the 1 zone if running a single zone cluster
|
||||
// it will be set to ALL zones in region for any multi-zone cluster
|
||||
@@ -174,10 +175,14 @@ type ConfigGlobal struct {
|
||||
SecondaryRangeName string `gcfg:"secondary-range-name"`
|
||||
NodeTags []string `gcfg:"node-tags"`
|
||||
NodeInstancePrefix string `gcfg:"node-instance-prefix"`
|
||||
Regional bool `gcfg:"regional"`
|
||||
Multizone bool `gcfg:"multizone"`
|
||||
// ApiEndpoint is the GCE compute API endpoint to use. If this is blank,
|
||||
// then the default endpoint is used.
|
||||
ApiEndpoint string `gcfg:"api-endpoint"`
|
||||
// ContainerApiEndpoint is the GCE container API endpoint to use. If this is blank,
|
||||
// then the default endpoint is used.
|
||||
ContainerApiEndpoint string `gcfg:"container-api-endpoint"`
|
||||
// LocalZone specifies the GCE zone that gce cloud client instance is
|
||||
// located in (i.e. where the controller will be running). If this is
|
||||
// blank, then the local zone will be discovered via the metadata server.
|
||||
@@ -194,22 +199,24 @@ type ConfigFile struct {
|
||||
|
||||
// CloudConfig includes all the necessary configuration for creating GCECloud
|
||||
type CloudConfig struct {
|
||||
ApiEndpoint string
|
||||
ProjectID string
|
||||
NetworkProjectID string
|
||||
Region string
|
||||
Zone string
|
||||
ManagedZones []string
|
||||
NetworkName string
|
||||
NetworkURL string
|
||||
SubnetworkName string
|
||||
SubnetworkURL string
|
||||
SecondaryRangeName string
|
||||
NodeTags []string
|
||||
NodeInstancePrefix string
|
||||
TokenSource oauth2.TokenSource
|
||||
UseMetadataServer bool
|
||||
AlphaFeatureGate *AlphaFeatureGate
|
||||
ApiEndpoint string
|
||||
ContainerApiEndpoint string
|
||||
ProjectID string
|
||||
NetworkProjectID string
|
||||
Region string
|
||||
Regional bool
|
||||
Zone string
|
||||
ManagedZones []string
|
||||
NetworkName string
|
||||
NetworkURL string
|
||||
SubnetworkName string
|
||||
SubnetworkURL string
|
||||
SecondaryRangeName string
|
||||
NodeTags []string
|
||||
NodeInstancePrefix string
|
||||
TokenSource oauth2.TokenSource
|
||||
UseMetadataServer bool
|
||||
AlphaFeatureGate *AlphaFeatureGate
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -238,6 +245,11 @@ func (g *GCECloud) Compute() cloud.Cloud {
|
||||
return g.c
|
||||
}
|
||||
|
||||
// ContainerService returns the container service.
|
||||
func (g *GCECloud) ContainerService() *container.Service {
|
||||
return g.containerService
|
||||
}
|
||||
|
||||
// newGCECloud creates a new instance of GCECloud.
|
||||
func newGCECloud(config io.Reader) (gceCloud *GCECloud, err error) {
|
||||
var cloudConfig *CloudConfig
|
||||
@@ -278,6 +290,10 @@ func generateCloudConfig(configFile *ConfigFile) (cloudConfig *CloudConfig, err
|
||||
cloudConfig.ApiEndpoint = configFile.Global.ApiEndpoint
|
||||
}
|
||||
|
||||
if configFile.Global.ContainerApiEndpoint != "" {
|
||||
cloudConfig.ContainerApiEndpoint = configFile.Global.ContainerApiEndpoint
|
||||
}
|
||||
|
||||
if configFile.Global.TokenURL != "" {
|
||||
// if tokenURL is nil, set tokenSource to nil. This will force the OAuth client to fall
|
||||
// back to use DefaultTokenSource. This allows running gceCloud remotely.
|
||||
@@ -319,9 +335,14 @@ func generateCloudConfig(configFile *ConfigFile) (cloudConfig *CloudConfig, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Determine if its a regional cluster
|
||||
if configFile != nil && configFile.Global.Regional {
|
||||
cloudConfig.Regional = true
|
||||
}
|
||||
|
||||
// generate managedZones
|
||||
cloudConfig.ManagedZones = []string{cloudConfig.Zone}
|
||||
if configFile != nil && configFile.Global.Multizone {
|
||||
if configFile != nil && (configFile.Global.Multizone || configFile.Global.Regional) {
|
||||
cloudConfig.ManagedZones = nil // Use all zones in region
|
||||
}
|
||||
|
||||
@@ -419,6 +440,9 @@ func CreateGCECloud(config *CloudConfig) (*GCECloud, error) {
|
||||
return nil, err
|
||||
}
|
||||
containerService.UserAgent = userAgent
|
||||
if config.ContainerApiEndpoint != "" {
|
||||
containerService.BasePath = config.ContainerApiEndpoint
|
||||
}
|
||||
|
||||
tpuService, err := newTPUService(client)
|
||||
if err != nil {
|
||||
@@ -496,6 +520,7 @@ func CreateGCECloud(config *CloudConfig) (*GCECloud, error) {
|
||||
networkProjectID: netProjID,
|
||||
onXPN: onXPN,
|
||||
region: config.Region,
|
||||
regional: config.Regional,
|
||||
localZone: config.Zone,
|
||||
managedZones: config.ManagedZones,
|
||||
networkURL: networkURL,
|
||||
|
||||
Reference in New Issue
Block a user