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 @@
},
{
"ImportPath": "google.golang.org/api/cloudmonitoring/v2beta2",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/api/compute/v0.alpha",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/api/compute/v0.beta",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/api/compute/v1",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/api/container/v1",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/api/gensupport",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/api/googleapi",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/api/googleapi/internal/uritemplates",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/api/logging/v2beta1",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/api/monitoring/v3",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/api/pubsub/v1",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/api/tpu/v1alpha1",
"Rev": "ab90adb3efa287b869ecb698db42f923cc734972"
"Rev": "7f657476956314fee258816aaf81c0ff65cf8bee"
},
{
"ImportPath": "google.golang.org/genproto/googleapis/api/annotations",
......
......@@ -88,8 +88,8 @@ const (
// Defaults to 5 * 2 = 10 seconds before the LB will steer traffic away
gceHcUnhealthyThreshold = int64(5)
gceComputeAPIEndpoint = "https://www.googleapis.com/compute/v1/"
gceComputeAPIEndpointAlpha = "https://www.googleapis.com/compute/alpha/"
gceComputeAPIEndpoint = "https://www.googleapis.com/compute/v1/"
gceComputeAPIEndpointBeta = "https://www.googleapis.com/compute/beta/"
)
// gceObject is an abstraction of all GCE API object in go client
......@@ -878,10 +878,10 @@ func (manager *gceServiceManager) getProjectsAPIEndpoint() string {
return projectsApiEndpoint
}
func (manager *gceServiceManager) getProjectsAPIEndpointAlpha() string {
projectsApiEndpoint := gceComputeAPIEndpointAlpha + "projects/"
func (manager *gceServiceManager) getProjectsAPIEndpointBeta() string {
projectsApiEndpoint := gceComputeAPIEndpointBeta + "projects/"
if manager.gce.service != nil {
projectsApiEndpoint = manager.gce.serviceAlpha.BasePath
projectsApiEndpoint = manager.gce.serviceBeta.BasePath
}
return projectsApiEndpoint
......
......@@ -34,7 +34,7 @@ import (
volumeutil "k8s.io/kubernetes/pkg/volume/util"
"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"
"google.golang.org/api/googleapi"
utilfeature "k8s.io/apiserver/pkg/util/feature"
......@@ -123,7 +123,7 @@ func (manager *gceServiceManager) CreateDiskOnCloudProvider(
diskType string,
zone string) (gceObject, error) {
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 {
return nil, err
}
......@@ -147,7 +147,7 @@ func (manager *gceServiceManager) CreateRegionalDiskOnCloudProvider(
if utilfeature.DefaultFeatureGate.Enabled(features.GCERegionalPersistentDisk) {
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 {
return nil, err
}
......@@ -157,15 +157,15 @@ func (manager *gceServiceManager) CreateRegionalDiskOnCloudProvider(
fullyQualifiedReplicaZones, manager.getReplicaZoneURI(replicaZone, true))
}
diskToCreateAlpha := &computealpha.Disk{
diskToCreateBeta := &computebeta.Disk{
Name: name,
SizeGb: sizeGb,
Description: tagsStr,
Type: diskTypeURI,
ReplicaZones: fullyQualifiedReplicaZones,
}
return manager.gce.serviceAlpha.RegionDisks.Insert(
manager.gce.projectID, manager.gce.region, diskToCreateAlpha).Do()
return manager.gce.serviceBeta.RegionDisks.Insert(
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)
......@@ -241,24 +241,24 @@ func (manager *gceServiceManager) GetRegionalDiskFromCloudProvider(
diskName string) (*GCEDisk, error) {
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()
if err != nil {
return nil, err
}
zones := sets.NewString()
for _, zoneURI := range diskAlpha.ReplicaZones {
for _, zoneURI := range diskBeta.ReplicaZones {
zones.Insert(lastComponent(zoneURI))
}
return &GCEDisk{
ZoneInfo: multiZone{zones},
Region: lastComponent(diskAlpha.Region),
Name: diskAlpha.Name,
Kind: diskAlpha.Kind,
Type: diskAlpha.Type,
SizeGb: diskAlpha.SizeGb,
Region: lastComponent(diskBeta.Region),
Name: diskBeta.Name,
Kind: diskBeta.Kind,
Type: diskBeta.Type,
SizeGb: diskBeta.SizeGb,
}, nil
}
......@@ -275,7 +275,7 @@ func (manager *gceServiceManager) DeleteDiskOnCloudProvider(
func (manager *gceServiceManager) DeleteRegionalDiskOnCloudProvider(
diskName string) (gceObject, error) {
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()
}
......@@ -327,11 +327,11 @@ func (manager *gceServiceManager) getDiskSourceURI(disk *GCEDisk) (string, error
}
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
if useAlphaAPI {
getProjectsAPIEndpoint = manager.getProjectsAPIEndpointAlpha()
if useBetaAPI {
getProjectsAPIEndpoint = manager.getProjectsAPIEndpointBeta()
} else {
getProjectsAPIEndpoint = manager.getProjectsAPIEndpoint()
}
......@@ -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
if useAlphaAPI {
getProjectsAPIEndpoint = manager.getProjectsAPIEndpointAlpha()
if useBetaAPI {
getProjectsAPIEndpoint = manager.getProjectsAPIEndpointBeta()
} else {
getProjectsAPIEndpoint = manager.getProjectsAPIEndpoint()
}
......@@ -420,10 +420,10 @@ func (manager *gceServiceManager) ResizeDiskOnCloudProvider(disk *GCEDisk, sizeG
func (manager *gceServiceManager) RegionalResizeDiskOnCloudProvider(disk *GCEDisk, sizeGb int64) (gceObject, error) {
if utilfeature.DefaultFeatureGate.Enabled(features.GCERegionalPersistentDisk) {
resizeServiceRequest := &computealpha.RegionDisksResizeRequest{
resizeServiceRequest := &computebeta.RegionDisksResizeRequest{
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)
}
......
......@@ -116,7 +116,7 @@ func TestCreateRegionalDisk_Basic(t *testing.T) {
tags := make(map[string]string)
tags["test-tag"] = "test-value"
expectedDiskTypeURI := gceComputeAPIEndpointAlpha + "projects/" + fmt.Sprintf(
expectedDiskTypeURI := gceComputeAPIEndpointBeta + "projects/" + fmt.Sprintf(
diskTypeURITemplateRegional, gceProjectId, gceRegion, diskType)
expectedDescription := "{\"test-tag\":\"test-value\"}"
......@@ -753,7 +753,7 @@ func (manager *FakeServiceManager) CreateDiskOnCloudProvider(
return manager.opBeta, nil
case targetAlpha:
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{
Name: name,
SizeGb: sizeGb,
......@@ -779,7 +779,7 @@ func (manager *FakeServiceManager) CreateRegionalDiskOnCloudProvider(
diskType string,
zones sets.String) (gceObject, error) {
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 {
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 @@
}
}
},
"revision": "20180108",
"revision": "20180213",
"rootUrl": "https://container.googleapis.com/",
"schemas": {
"AcceleratorConfig": {
......@@ -2022,7 +2022,7 @@
"additionalProperties": {
"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"
},
"minCpuPlatform": {
......
......@@ -1523,6 +1523,7 @@ type NodeConfig struct {
// Additionally, to avoid ambiguity, keys must not conflict with any
// other
// metadata keys for the project or be one of the reserved keys:
// "cluster-location"
// "cluster-name"
// "cluster-uid"
// "configure-sh"
......
......@@ -964,7 +964,7 @@
}
}
},
"revision": "20180205",
"revision": "20180225",
"rootUrl": "https://monitoring.googleapis.com/",
"schemas": {
"BasicAuthentication": {
......@@ -1125,7 +1125,7 @@
"id": "ContentMatcher",
"properties": {
"content": {
"description": "String content to match",
"description": "String content to match (max 1024 bytes)",
"type": "string"
}
},
......
......@@ -450,7 +450,7 @@ func (s *CollectdValueError) MarshalJSON() ([]byte, error) {
// matches on the exact content. In the future, it can be expanded to
// allow for regular expressions and more complex matching.
type ContentMatcher struct {
// Content: String content to match
// Content: String content to match (max 1024 bytes)
Content string `json:"content,omitempty"`
// 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