Unverified Commit 8f820169 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #60450 from verult/repd-beta-integration

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Change regional PD cloud provider references to use the beta API **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #59988 **Special notes for your reviewer**: Depends on a version of the GCP Go beta compute client that is not yet available. Also need to rebase with #60337 once it's merged. /hold /cc @abgworrall /assign @saad-ali
parents 71b40cbc df3d8bcb
...@@ -3033,51 +3033,51 @@ ...@@ -3033,51 +3033,51 @@
}, },
{ {
"ImportPath": "google.golang.org/api/cloudmonitoring/v2beta2", "ImportPath": "google.golang.org/api/cloudmonitoring/v2beta2",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/api/compute/v0.alpha", "ImportPath": "google.golang.org/api/compute/v0.alpha",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/api/compute/v0.beta", "ImportPath": "google.golang.org/api/compute/v0.beta",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/api/compute/v1", "ImportPath": "google.golang.org/api/compute/v1",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/api/container/v1", "ImportPath": "google.golang.org/api/container/v1",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/api/gensupport", "ImportPath": "google.golang.org/api/gensupport",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/api/googleapi", "ImportPath": "google.golang.org/api/googleapi",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/api/googleapi/internal/uritemplates", "ImportPath": "google.golang.org/api/googleapi/internal/uritemplates",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/api/logging/v2beta1", "ImportPath": "google.golang.org/api/logging/v2beta1",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/api/monitoring/v3", "ImportPath": "google.golang.org/api/monitoring/v3",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/api/pubsub/v1", "ImportPath": "google.golang.org/api/pubsub/v1",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/api/tpu/v1alpha1", "ImportPath": "google.golang.org/api/tpu/v1alpha1",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972" "Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
}, },
{ {
"ImportPath": "google.golang.org/genproto/googleapis/api/annotations", "ImportPath": "google.golang.org/genproto/googleapis/api/annotations",
......
...@@ -89,7 +89,7 @@ const ( ...@@ -89,7 +89,7 @@ const (
gceHcUnhealthyThreshold = int64(5) gceHcUnhealthyThreshold = int64(5)
gceComputeAPIEndpoint = "https://www.googleapis.com/compute/v1/" gceComputeAPIEndpoint = "https://www.googleapis.com/compute/v1/"
gceComputeAPIEndpointAlpha = "https://www.googleapis.com/compute/alpha/" gceComputeAPIEndpointBeta = "https://www.googleapis.com/compute/beta/"
) )
// gceObject is an abstraction of all GCE API object in go client // gceObject is an abstraction of all GCE API object in go client
...@@ -878,10 +878,10 @@ func (manager *gceServiceManager) getProjectsAPIEndpoint() string { ...@@ -878,10 +878,10 @@ func (manager *gceServiceManager) getProjectsAPIEndpoint() string {
return projectsApiEndpoint return projectsApiEndpoint
} }
func (manager *gceServiceManager) getProjectsAPIEndpointAlpha() string { func (manager *gceServiceManager) getProjectsAPIEndpointBeta() string {
projectsApiEndpoint := gceComputeAPIEndpointAlpha + "projects/" projectsApiEndpoint := gceComputeAPIEndpointBeta + "projects/"
if manager.gce.service != nil { if manager.gce.service != nil {
projectsApiEndpoint = manager.gce.serviceAlpha.BasePath projectsApiEndpoint = manager.gce.serviceBeta.BasePath
} }
return projectsApiEndpoint return projectsApiEndpoint
......
...@@ -34,7 +34,7 @@ import ( ...@@ -34,7 +34,7 @@ import (
volumeutil "k8s.io/kubernetes/pkg/volume/util" volumeutil "k8s.io/kubernetes/pkg/volume/util"
"github.com/golang/glog" "github.com/golang/glog"
computealpha "google.golang.org/api/compute/v0.alpha" computebeta "google.golang.org/api/compute/v0.beta"
compute "google.golang.org/api/compute/v1" compute "google.golang.org/api/compute/v1"
"google.golang.org/api/googleapi" "google.golang.org/api/googleapi"
utilfeature "k8s.io/apiserver/pkg/util/feature" utilfeature "k8s.io/apiserver/pkg/util/feature"
...@@ -123,7 +123,7 @@ func (manager *gceServiceManager) CreateDiskOnCloudProvider( ...@@ -123,7 +123,7 @@ func (manager *gceServiceManager) CreateDiskOnCloudProvider(
diskType string, diskType string,
zone string) (gceObject, error) { zone string) (gceObject, error) {
diskTypeURI, err := manager.getDiskTypeURI( diskTypeURI, err := manager.getDiskTypeURI(
manager.gce.region /* diskRegion */, singleZone{zone}, diskType, false /* useAlphaAPI */) manager.gce.region /* diskRegion */, singleZone{zone}, diskType, false /* useBetaAPI */)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -147,7 +147,7 @@ func (manager *gceServiceManager) CreateRegionalDiskOnCloudProvider( ...@@ -147,7 +147,7 @@ func (manager *gceServiceManager) CreateRegionalDiskOnCloudProvider(
if utilfeature.DefaultFeatureGate.Enabled(features.GCERegionalPersistentDisk) { if utilfeature.DefaultFeatureGate.Enabled(features.GCERegionalPersistentDisk) {
diskTypeURI, err := manager.getDiskTypeURI( diskTypeURI, err := manager.getDiskTypeURI(
manager.gce.region /* diskRegion */, multiZone{replicaZones}, diskType, true /* useAlphaAPI */) manager.gce.region /* diskRegion */, multiZone{replicaZones}, diskType, true /* useBetaAPI */)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -157,15 +157,15 @@ func (manager *gceServiceManager) CreateRegionalDiskOnCloudProvider( ...@@ -157,15 +157,15 @@ func (manager *gceServiceManager) CreateRegionalDiskOnCloudProvider(
fullyQualifiedReplicaZones, manager.getReplicaZoneURI(replicaZone, true)) fullyQualifiedReplicaZones, manager.getReplicaZoneURI(replicaZone, true))
} }
diskToCreateAlpha := &computealpha.Disk{ diskToCreateBeta := &computebeta.Disk{
Name: name, Name: name,
SizeGb: sizeGb, SizeGb: sizeGb,
Description: tagsStr, Description: tagsStr,
Type: diskTypeURI, Type: diskTypeURI,
ReplicaZones: fullyQualifiedReplicaZones, ReplicaZones: fullyQualifiedReplicaZones,
} }
return manager.gce.serviceAlpha.RegionDisks.Insert( return manager.gce.serviceBeta.RegionDisks.Insert(
manager.gce.projectID, manager.gce.region, diskToCreateAlpha).Do() manager.gce.projectID, manager.gce.region, diskToCreateBeta).Do()
} }
return nil, fmt.Errorf("the regional PD feature is only available with the %s Kubernetes feature gate enabled", features.GCERegionalPersistentDisk) return nil, fmt.Errorf("the regional PD feature is only available with the %s Kubernetes feature gate enabled", features.GCERegionalPersistentDisk)
...@@ -241,24 +241,24 @@ func (manager *gceServiceManager) GetRegionalDiskFromCloudProvider( ...@@ -241,24 +241,24 @@ func (manager *gceServiceManager) GetRegionalDiskFromCloudProvider(
diskName string) (*GCEDisk, error) { diskName string) (*GCEDisk, error) {
if utilfeature.DefaultFeatureGate.Enabled(features.GCERegionalPersistentDisk) { if utilfeature.DefaultFeatureGate.Enabled(features.GCERegionalPersistentDisk) {
diskAlpha, err := manager.gce.serviceAlpha.RegionDisks.Get( diskBeta, err := manager.gce.serviceBeta.RegionDisks.Get(
manager.gce.projectID, manager.gce.region, diskName).Do() manager.gce.projectID, manager.gce.region, diskName).Do()
if err != nil { if err != nil {
return nil, err return nil, err
} }
zones := sets.NewString() zones := sets.NewString()
for _, zoneURI := range diskAlpha.ReplicaZones { for _, zoneURI := range diskBeta.ReplicaZones {
zones.Insert(lastComponent(zoneURI)) zones.Insert(lastComponent(zoneURI))
} }
return &GCEDisk{ return &GCEDisk{
ZoneInfo: multiZone{zones}, ZoneInfo: multiZone{zones},
Region: lastComponent(diskAlpha.Region), Region: lastComponent(diskBeta.Region),
Name: diskAlpha.Name, Name: diskBeta.Name,
Kind: diskAlpha.Kind, Kind: diskBeta.Kind,
Type: diskAlpha.Type, Type: diskBeta.Type,
SizeGb: diskAlpha.SizeGb, SizeGb: diskBeta.SizeGb,
}, nil }, nil
} }
...@@ -275,7 +275,7 @@ func (manager *gceServiceManager) DeleteDiskOnCloudProvider( ...@@ -275,7 +275,7 @@ func (manager *gceServiceManager) DeleteDiskOnCloudProvider(
func (manager *gceServiceManager) DeleteRegionalDiskOnCloudProvider( func (manager *gceServiceManager) DeleteRegionalDiskOnCloudProvider(
diskName string) (gceObject, error) { diskName string) (gceObject, error) {
if utilfeature.DefaultFeatureGate.Enabled(features.GCERegionalPersistentDisk) { if utilfeature.DefaultFeatureGate.Enabled(features.GCERegionalPersistentDisk) {
return manager.gce.serviceAlpha.RegionDisks.Delete( return manager.gce.serviceBeta.RegionDisks.Delete(
manager.gce.projectID, manager.gce.region, diskName).Do() manager.gce.projectID, manager.gce.region, diskName).Do()
} }
...@@ -327,11 +327,11 @@ func (manager *gceServiceManager) getDiskSourceURI(disk *GCEDisk) (string, error ...@@ -327,11 +327,11 @@ func (manager *gceServiceManager) getDiskSourceURI(disk *GCEDisk) (string, error
} }
func (manager *gceServiceManager) getDiskTypeURI( func (manager *gceServiceManager) getDiskTypeURI(
diskRegion string, diskZoneInfo zoneType, diskType string, useAlphaAPI bool) (string, error) { diskRegion string, diskZoneInfo zoneType, diskType string, useBetaAPI bool) (string, error) {
var getProjectsAPIEndpoint string var getProjectsAPIEndpoint string
if useAlphaAPI { if useBetaAPI {
getProjectsAPIEndpoint = manager.getProjectsAPIEndpointAlpha() getProjectsAPIEndpoint = manager.getProjectsAPIEndpointBeta()
} else { } else {
getProjectsAPIEndpoint = manager.getProjectsAPIEndpoint() getProjectsAPIEndpoint = manager.getProjectsAPIEndpoint()
} }
...@@ -363,10 +363,10 @@ func (manager *gceServiceManager) getDiskTypeURI( ...@@ -363,10 +363,10 @@ func (manager *gceServiceManager) getDiskTypeURI(
} }
} }
func (manager *gceServiceManager) getReplicaZoneURI(zone string, useAlphaAPI bool) string { func (manager *gceServiceManager) getReplicaZoneURI(zone string, useBetaAPI bool) string {
var getProjectsAPIEndpoint string var getProjectsAPIEndpoint string
if useAlphaAPI { if useBetaAPI {
getProjectsAPIEndpoint = manager.getProjectsAPIEndpointAlpha() getProjectsAPIEndpoint = manager.getProjectsAPIEndpointBeta()
} else { } else {
getProjectsAPIEndpoint = manager.getProjectsAPIEndpoint() getProjectsAPIEndpoint = manager.getProjectsAPIEndpoint()
} }
...@@ -420,10 +420,10 @@ func (manager *gceServiceManager) ResizeDiskOnCloudProvider(disk *GCEDisk, sizeG ...@@ -420,10 +420,10 @@ func (manager *gceServiceManager) ResizeDiskOnCloudProvider(disk *GCEDisk, sizeG
func (manager *gceServiceManager) RegionalResizeDiskOnCloudProvider(disk *GCEDisk, sizeGb int64) (gceObject, error) { func (manager *gceServiceManager) RegionalResizeDiskOnCloudProvider(disk *GCEDisk, sizeGb int64) (gceObject, error) {
if utilfeature.DefaultFeatureGate.Enabled(features.GCERegionalPersistentDisk) { if utilfeature.DefaultFeatureGate.Enabled(features.GCERegionalPersistentDisk) {
resizeServiceRequest := &computealpha.RegionDisksResizeRequest{ resizeServiceRequest := &computebeta.RegionDisksResizeRequest{
SizeGb: sizeGb, SizeGb: sizeGb,
} }
return manager.gce.serviceAlpha.RegionDisks.Resize(manager.gce.projectID, disk.Region, disk.Name, resizeServiceRequest).Do() return manager.gce.serviceBeta.RegionDisks.Resize(manager.gce.projectID, disk.Region, disk.Name, resizeServiceRequest).Do()
} }
return nil, fmt.Errorf("the regional PD feature is only available with the %s Kubernetes feature gate enabled", features.GCERegionalPersistentDisk) return nil, fmt.Errorf("the regional PD feature is only available with the %s Kubernetes feature gate enabled", features.GCERegionalPersistentDisk)
} }
......
...@@ -116,7 +116,7 @@ func TestCreateRegionalDisk_Basic(t *testing.T) { ...@@ -116,7 +116,7 @@ func TestCreateRegionalDisk_Basic(t *testing.T) {
tags := make(map[string]string) tags := make(map[string]string)
tags["test-tag"] = "test-value" tags["test-tag"] = "test-value"
expectedDiskTypeURI := gceComputeAPIEndpointAlpha + "projects/" + fmt.Sprintf( expectedDiskTypeURI := gceComputeAPIEndpointBeta + "projects/" + fmt.Sprintf(
diskTypeURITemplateRegional, gceProjectId, gceRegion, diskType) diskTypeURITemplateRegional, gceProjectId, gceRegion, diskType)
expectedDescription := "{\"test-tag\":\"test-value\"}" expectedDescription := "{\"test-tag\":\"test-value\"}"
...@@ -753,7 +753,7 @@ func (manager *FakeServiceManager) CreateDiskOnCloudProvider( ...@@ -753,7 +753,7 @@ func (manager *FakeServiceManager) CreateDiskOnCloudProvider(
return manager.opBeta, nil return manager.opBeta, nil
case targetAlpha: case targetAlpha:
manager.opAlpha = &computealpha.Operation{} manager.opAlpha = &computealpha.Operation{}
diskTypeURI := gceComputeAPIEndpointAlpha + "projects/" + fmt.Sprintf(diskTypeURITemplateSingleZone, manager.gceProjectID, zone, diskType) diskTypeURI := gceComputeAPIEndpointBeta + "projects/" + fmt.Sprintf(diskTypeURITemplateSingleZone, manager.gceProjectID, zone, diskType)
diskToCreateAlpha := &computealpha.Disk{ diskToCreateAlpha := &computealpha.Disk{
Name: name, Name: name,
SizeGb: sizeGb, SizeGb: sizeGb,
...@@ -779,7 +779,7 @@ func (manager *FakeServiceManager) CreateRegionalDiskOnCloudProvider( ...@@ -779,7 +779,7 @@ func (manager *FakeServiceManager) CreateRegionalDiskOnCloudProvider(
diskType string, diskType string,
zones sets.String) (gceObject, error) { zones sets.String) (gceObject, error) {
manager.createDiskCalled = true manager.createDiskCalled = true
diskTypeURI := gceComputeAPIEndpointAlpha + "projects/" + fmt.Sprintf(diskTypeURITemplateRegional, manager.gceProjectID, manager.gceRegion, diskType) diskTypeURI := gceComputeAPIEndpointBeta + "projects/" + fmt.Sprintf(diskTypeURITemplateRegional, manager.gceProjectID, manager.gceRegion, diskType)
switch t := manager.targetAPI; t { switch t := manager.targetAPI; t {
case targetStable: case targetStable:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -1364,7 +1364,7 @@ ...@@ -1364,7 +1364,7 @@
} }
} }
}, },
"revision": "20180108", "revision": "20180213",
"rootUrl": "https://container.googleapis.com/", "rootUrl": "https://container.googleapis.com/",
"schemas": { "schemas": {
"AcceleratorConfig": { "AcceleratorConfig": {
...@@ -2022,7 +2022,7 @@ ...@@ -2022,7 +2022,7 @@
"additionalProperties": { "additionalProperties": {
"type": "string" "type": "string"
}, },
"description": "The metadata key/value pairs assigned to instances in the cluster.\n\nKeys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes\nin length. These are reflected as part of a URL in the metadata server.\nAdditionally, to avoid ambiguity, keys must not conflict with any other\nmetadata keys for the project or be one of the reserved keys:\n \"cluster-name\"\n \"cluster-uid\"\n \"configure-sh\"\n \"gci-update-strategy\"\n \"gci-ensure-gke-docker\"\n \"instance-template\"\n \"kube-env\"\n \"startup-script\"\n \"user-data\"\n\nValues are free-form strings, and only have meaning as interpreted by\nthe image running in the instance. The only restriction placed on them is\nthat each value's size must be less than or equal to 32 KB.\n\nThe total size of all keys and values must be less than 512 KB.", "description": "The metadata key/value pairs assigned to instances in the cluster.\n\nKeys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes\nin length. These are reflected as part of a URL in the metadata server.\nAdditionally, to avoid ambiguity, keys must not conflict with any other\nmetadata keys for the project or be one of the reserved keys:\n \"cluster-location\"\n \"cluster-name\"\n \"cluster-uid\"\n \"configure-sh\"\n \"gci-update-strategy\"\n \"gci-ensure-gke-docker\"\n \"instance-template\"\n \"kube-env\"\n \"startup-script\"\n \"user-data\"\n\nValues are free-form strings, and only have meaning as interpreted by\nthe image running in the instance. The only restriction placed on them is\nthat each value's size must be less than or equal to 32 KB.\n\nThe total size of all keys and values must be less than 512 KB.",
"type": "object" "type": "object"
}, },
"minCpuPlatform": { "minCpuPlatform": {
......
...@@ -1523,6 +1523,7 @@ type NodeConfig struct { ...@@ -1523,6 +1523,7 @@ type NodeConfig struct {
// Additionally, to avoid ambiguity, keys must not conflict with any // Additionally, to avoid ambiguity, keys must not conflict with any
// other // other
// metadata keys for the project or be one of the reserved keys: // metadata keys for the project or be one of the reserved keys:
// "cluster-location"
// "cluster-name" // "cluster-name"
// "cluster-uid" // "cluster-uid"
// "configure-sh" // "configure-sh"
......
...@@ -964,7 +964,7 @@ ...@@ -964,7 +964,7 @@
} }
} }
}, },
"revision": "20180205", "revision": "20180225",
"rootUrl": "https://monitoring.googleapis.com/", "rootUrl": "https://monitoring.googleapis.com/",
"schemas": { "schemas": {
"BasicAuthentication": { "BasicAuthentication": {
...@@ -1125,7 +1125,7 @@ ...@@ -1125,7 +1125,7 @@
"id": "ContentMatcher", "id": "ContentMatcher",
"properties": { "properties": {
"content": { "content": {
"description": "String content to match", "description": "String content to match (max 1024 bytes)",
"type": "string" "type": "string"
} }
}, },
......
...@@ -450,7 +450,7 @@ func (s *CollectdValueError) MarshalJSON() ([]byte, error) { ...@@ -450,7 +450,7 @@ func (s *CollectdValueError) MarshalJSON() ([]byte, error) {
// matches on the exact content. In the future, it can be expanded to // matches on the exact content. In the future, it can be expanded to
// allow for regular expressions and more complex matching. // allow for regular expressions and more complex matching.
type ContentMatcher struct { type ContentMatcher struct {
// Content: String content to match // Content: String content to match (max 1024 bytes)
Content string `json:"content,omitempty"` Content string `json:"content,omitempty"`
// ForceSendFields is a list of field names (e.g. "Content") to // ForceSendFields is a list of field names (e.g. "Content") to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment