Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit f2cc312

Browse files
feat: added a flag to enable/disable gvnic on a node pool (#577)
* feat: added a flag to enable/disable gvnic on a node pool feat: added node pool level network config feat: added update support for node pool labels, taints and network tags feat: added configuration for workload certificates and identity service component feat: added configuration for node pool defaults, autopilot, logging and monitoring feat: added the option to specify L4 load balancer configuration and IP v6 configuration feat: added the option to list supported windows versions fix: deprecated KALM addon config option fix: deprecated cluster status condition code docs: clarified SetNodePoolSize API behavior PiperOrigin-RevId: 396762326 Source-Link: googleapis/googleapis@1f1d09d Source-Link: https://github.com/googleapis/googleapis-gen/commit/4bed2d46a5e5a6d537ebc15115cfe4cce5fc0405 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGJlZDJkNDZhNWU1YTZkNTM3ZWJjMTUxMTVjZmU0Y2NlNWZjMDQwNSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f1042bb commit f2cc312

File tree

79 files changed

+29305
-2089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+29305
-2089
lines changed

google-cloud-container/src/main/java/com/google/cloud/container/v1/stub/ClusterManagerStubSettings.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ public static List<String> getDefaultServiceScopes() {
446446

447447
/** Returns a builder for the default credentials for this service. */
448448
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
449-
return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
449+
return GoogleCredentialsProvider.newBuilder()
450+
.setScopesToApply(DEFAULT_SERVICE_SCOPES)
451+
.setUseJwtAccessWithScope(true);
450452
}
451453

452454
/** Returns a builder for the default ChannelProvider for this service. */

google-cloud-container/src/main/java/com/google/cloud/container/v1beta1/ClusterManagerClient.java

+14-2
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,12 @@ public final UnaryCallable<UpdateClusterRequest, Operation> updateClusterCallabl
596596
* .setWorkloadMetadataConfig(WorkloadMetadataConfig.newBuilder().build())
597597
* .setName("name3373707")
598598
* .setUpgradeSettings(NodePool.UpgradeSettings.newBuilder().build())
599+
* .setTags(NetworkTags.newBuilder().build())
600+
* .setTaints(NodeTaints.newBuilder().build())
601+
* .setLabels(NodeLabels.newBuilder().build())
599602
* .setLinuxNodeConfig(LinuxNodeConfig.newBuilder().build())
600603
* .setKubeletConfig(NodeKubeletConfig.newBuilder().build())
604+
* .setGvnic(VirtualNIC.newBuilder().build())
601605
* .build();
602606
* Operation response = clusterManagerClient.updateNodePool(request);
603607
* }
@@ -630,8 +634,12 @@ public final Operation updateNodePool(UpdateNodePoolRequest request) {
630634
* .setWorkloadMetadataConfig(WorkloadMetadataConfig.newBuilder().build())
631635
* .setName("name3373707")
632636
* .setUpgradeSettings(NodePool.UpgradeSettings.newBuilder().build())
637+
* .setTags(NetworkTags.newBuilder().build())
638+
* .setTaints(NodeTaints.newBuilder().build())
639+
* .setLabels(NodeLabels.newBuilder().build())
633640
* .setLinuxNodeConfig(LinuxNodeConfig.newBuilder().build())
634641
* .setKubeletConfig(NodeKubeletConfig.newBuilder().build())
642+
* .setGvnic(VirtualNIC.newBuilder().build())
635643
* .build();
636644
* ApiFuture<Operation> future =
637645
* clusterManagerClient.updateNodePoolCallable().futureCall(request);
@@ -2703,7 +2711,9 @@ public final UnaryCallable<CompleteIPRotationRequest, Operation> completeIPRotat
27032711

27042712
// AUTO-GENERATED DOCUMENTATION AND METHOD.
27052713
/**
2706-
* Sets the size for a specific node pool.
2714+
* SetNodePoolSizeRequest sets the size of a node pool. The new size will be used for all
2715+
* replicas, including future replicas created by modifying
2716+
* [NodePool.locations][google.container.v1beta1.NodePool.locations].
27072717
*
27082718
* <p>Sample code:
27092719
*
@@ -2731,7 +2741,9 @@ public final Operation setNodePoolSize(SetNodePoolSizeRequest request) {
27312741

27322742
// AUTO-GENERATED DOCUMENTATION AND METHOD.
27332743
/**
2734-
* Sets the size for a specific node pool.
2744+
* SetNodePoolSizeRequest sets the size of a node pool. The new size will be used for all
2745+
* replicas, including future replicas created by modifying
2746+
* [NodePool.locations][google.container.v1beta1.NodePool.locations].
27352747
*
27362748
* <p>Sample code:
27372749
*

google-cloud-container/src/main/java/com/google/cloud/container/v1beta1/stub/ClusterManagerStubSettings.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,9 @@ public static List<String> getDefaultServiceScopes() {
456456

457457
/** Returns a builder for the default credentials for this service. */
458458
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
459-
return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
459+
return GoogleCredentialsProvider.newBuilder()
460+
.setScopesToApply(DEFAULT_SERVICE_SCOPES)
461+
.setUseJwtAccessWithScope(true);
460462
}
461463

462464
/** Returns a builder for the default ChannelProvider for this service. */

google-cloud-container/src/test/java/com/google/cloud/container/v1beta1/ClusterManagerClientTest.java

+33
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.google.common.collect.Lists;
2929
import com.google.container.v1beta1.AddonsConfig;
3030
import com.google.container.v1beta1.AuthenticatorGroupsConfig;
31+
import com.google.container.v1beta1.Autopilot;
3132
import com.google.container.v1beta1.BinaryAuthorization;
3233
import com.google.container.v1beta1.CancelOperationRequest;
3334
import com.google.container.v1beta1.Cluster;
@@ -48,6 +49,7 @@
4849
import com.google.container.v1beta1.GetOperationRequest;
4950
import com.google.container.v1beta1.GetServerConfigRequest;
5051
import com.google.container.v1beta1.IPAllocationPolicy;
52+
import com.google.container.v1beta1.IdentityServiceConfig;
5153
import com.google.container.v1beta1.Jwk;
5254
import com.google.container.v1beta1.LegacyAbac;
5355
import com.google.container.v1beta1.LinuxNodeConfig;
@@ -62,18 +64,25 @@
6264
import com.google.container.v1beta1.ListUsableSubnetworksRequest;
6365
import com.google.container.v1beta1.ListUsableSubnetworksResponse;
6466
import com.google.container.v1beta1.Location;
67+
import com.google.container.v1beta1.LoggingConfig;
6568
import com.google.container.v1beta1.MaintenancePolicy;
6669
import com.google.container.v1beta1.Master;
6770
import com.google.container.v1beta1.MasterAuth;
6871
import com.google.container.v1beta1.MasterAuthorizedNetworksConfig;
6972
import com.google.container.v1beta1.MaxPodsConstraint;
73+
import com.google.container.v1beta1.MonitoringConfig;
7074
import com.google.container.v1beta1.NetworkConfig;
7175
import com.google.container.v1beta1.NetworkPolicy;
76+
import com.google.container.v1beta1.NetworkTags;
7277
import com.google.container.v1beta1.NodeConfig;
7378
import com.google.container.v1beta1.NodeKubeletConfig;
79+
import com.google.container.v1beta1.NodeLabels;
7480
import com.google.container.v1beta1.NodeManagement;
81+
import com.google.container.v1beta1.NodeNetworkConfig;
7582
import com.google.container.v1beta1.NodePool;
7683
import com.google.container.v1beta1.NodePoolAutoscaling;
84+
import com.google.container.v1beta1.NodePoolDefaults;
85+
import com.google.container.v1beta1.NodeTaints;
7786
import com.google.container.v1beta1.NotificationConfig;
7887
import com.google.container.v1beta1.Operation;
7988
import com.google.container.v1beta1.OperationProgress;
@@ -104,6 +113,9 @@
104113
import com.google.container.v1beta1.UpdateNodePoolRequest;
105114
import com.google.container.v1beta1.UsableSubnetwork;
106115
import com.google.container.v1beta1.VerticalPodAutoscaling;
116+
import com.google.container.v1beta1.VirtualNIC;
117+
import com.google.container.v1beta1.WindowsVersions;
118+
import com.google.container.v1beta1.WorkloadCertificates;
107119
import com.google.container.v1beta1.WorkloadIdentityConfig;
108120
import com.google.container.v1beta1.WorkloadMetadataConfig;
109121
import com.google.protobuf.AbstractMessage;
@@ -244,10 +256,12 @@ public void getClusterTest() throws Exception {
244256
.setShieldedNodes(ShieldedNodes.newBuilder().build())
245257
.setReleaseChannel(ReleaseChannel.newBuilder().build())
246258
.setWorkloadIdentityConfig(WorkloadIdentityConfig.newBuilder().build())
259+
.setWorkloadCertificates(WorkloadCertificates.newBuilder().build())
247260
.setClusterTelemetry(ClusterTelemetry.newBuilder().build())
248261
.setTpuConfig(TpuConfig.newBuilder().build())
249262
.setNotificationConfig(NotificationConfig.newBuilder().build())
250263
.setConfidentialNodes(ConfidentialNodes.newBuilder().build())
264+
.setIdentityServiceConfig(IdentityServiceConfig.newBuilder().build())
251265
.setSelfLink("selfLink1191800166")
252266
.setZone("zone3744684")
253267
.setEndpoint("endpoint1741102485")
@@ -267,6 +281,11 @@ public void getClusterTest() throws Exception {
267281
.setDatabaseEncryption(DatabaseEncryption.newBuilder().build())
268282
.addAllConditions(new ArrayList<StatusCondition>())
269283
.setMaster(Master.newBuilder().build())
284+
.setAutopilot(Autopilot.newBuilder().build())
285+
.setId("id3355")
286+
.setNodePoolDefaults(NodePoolDefaults.newBuilder().build())
287+
.setLoggingConfig(LoggingConfig.newBuilder().build())
288+
.setMonitoringConfig(MonitoringConfig.newBuilder().build())
270289
.build();
271290
mockClusterManager.addResponse(expectedResponse);
272291

@@ -453,8 +472,12 @@ public void updateNodePoolTest() throws Exception {
453472
.setWorkloadMetadataConfig(WorkloadMetadataConfig.newBuilder().build())
454473
.setName("name3373707")
455474
.setUpgradeSettings(NodePool.UpgradeSettings.newBuilder().build())
475+
.setTags(NetworkTags.newBuilder().build())
476+
.setTaints(NodeTaints.newBuilder().build())
477+
.setLabels(NodeLabels.newBuilder().build())
456478
.setLinuxNodeConfig(LinuxNodeConfig.newBuilder().build())
457479
.setKubeletConfig(NodeKubeletConfig.newBuilder().build())
480+
.setGvnic(VirtualNIC.newBuilder().build())
458481
.build();
459482

460483
Operation actualResponse = client.updateNodePool(request);
@@ -475,8 +498,12 @@ public void updateNodePoolTest() throws Exception {
475498
request.getWorkloadMetadataConfig(), actualRequest.getWorkloadMetadataConfig());
476499
Assert.assertEquals(request.getName(), actualRequest.getName());
477500
Assert.assertEquals(request.getUpgradeSettings(), actualRequest.getUpgradeSettings());
501+
Assert.assertEquals(request.getTags(), actualRequest.getTags());
502+
Assert.assertEquals(request.getTaints(), actualRequest.getTaints());
503+
Assert.assertEquals(request.getLabels(), actualRequest.getLabels());
478504
Assert.assertEquals(request.getLinuxNodeConfig(), actualRequest.getLinuxNodeConfig());
479505
Assert.assertEquals(request.getKubeletConfig(), actualRequest.getKubeletConfig());
506+
Assert.assertEquals(request.getGvnic(), actualRequest.getGvnic());
480507
Assert.assertTrue(
481508
channelProvider.isHeaderSent(
482509
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -501,8 +528,12 @@ public void updateNodePoolExceptionTest() throws Exception {
501528
.setWorkloadMetadataConfig(WorkloadMetadataConfig.newBuilder().build())
502529
.setName("name3373707")
503530
.setUpgradeSettings(NodePool.UpgradeSettings.newBuilder().build())
531+
.setTags(NetworkTags.newBuilder().build())
532+
.setTaints(NodeTaints.newBuilder().build())
533+
.setLabels(NodeLabels.newBuilder().build())
504534
.setLinuxNodeConfig(LinuxNodeConfig.newBuilder().build())
505535
.setKubeletConfig(NodeKubeletConfig.newBuilder().build())
536+
.setGvnic(VirtualNIC.newBuilder().build())
506537
.build();
507538
client.updateNodePool(request);
508539
Assert.fail("No exception raised");
@@ -1153,6 +1184,7 @@ public void getServerConfigTest() throws Exception {
11531184
.addAllValidImageTypes(new ArrayList<String>())
11541185
.addAllValidMasterVersions(new ArrayList<String>())
11551186
.addAllChannels(new ArrayList<ServerConfig.ReleaseChannelConfig>())
1187+
.putAllWindowsVersionMaps(new HashMap<String, WindowsVersions>())
11561188
.build();
11571189
mockClusterManager.addResponse(expectedResponse);
11581190

@@ -1277,6 +1309,7 @@ public void getNodePoolTest() throws Exception {
12771309
.setConfig(NodeConfig.newBuilder().build())
12781310
.setInitialNodeCount(1682564205)
12791311
.addAllLocations(new ArrayList<String>())
1312+
.setNetworkConfig(NodeNetworkConfig.newBuilder().build())
12801313
.setSelfLink("selfLink1191800166")
12811314
.setVersion("version351608024")
12821315
.addAllInstanceGroupUrls(new ArrayList<String>())

grpc-google-cloud-container-v1beta1/src/main/java/com/google/container/v1beta1/ClusterManagerGrpc.java

+12-4
Original file line numberDiff line numberDiff line change
@@ -2019,7 +2019,9 @@ public void completeIPRotation(
20192019
*
20202020
*
20212021
* <pre>
2022-
* Sets the size for a specific node pool.
2022+
* SetNodePoolSizeRequest sets the size of a node pool. The new size will be
2023+
* used for all replicas, including future replicas created by modifying
2024+
* [NodePool.locations][google.container.v1beta1.NodePool.locations].
20232025
* </pre>
20242026
*/
20252027
public void setNodePoolSize(
@@ -2800,7 +2802,9 @@ public void completeIPRotation(
28002802
*
28012803
*
28022804
* <pre>
2803-
* Sets the size for a specific node pool.
2805+
* SetNodePoolSizeRequest sets the size of a node pool. The new size will be
2806+
* used for all replicas, including future replicas created by modifying
2807+
* [NodePool.locations][google.container.v1beta1.NodePool.locations].
28042808
* </pre>
28052809
*/
28062810
public void setNodePoolSize(
@@ -3293,7 +3297,9 @@ public com.google.container.v1beta1.Operation completeIPRotation(
32933297
*
32943298
*
32953299
* <pre>
3296-
* Sets the size for a specific node pool.
3300+
* SetNodePoolSizeRequest sets the size of a node pool. The new size will be
3301+
* used for all replicas, including future replicas created by modifying
3302+
* [NodePool.locations][google.container.v1beta1.NodePool.locations].
32973303
* </pre>
32983304
*/
32993305
public com.google.container.v1beta1.Operation setNodePoolSize(
@@ -3795,7 +3801,9 @@ protected ClusterManagerFutureStub build(
37953801
*
37963802
*
37973803
* <pre>
3798-
* Sets the size for a specific node pool.
3804+
* SetNodePoolSizeRequest sets the size of a node pool. The new size will be
3805+
* used for all replicas, including future replicas created by modifying
3806+
* [NodePool.locations][google.container.v1beta1.NodePool.locations].
37993807
* </pre>
38003808
*/
38013809
public com.google.common.util.concurrent.ListenableFuture<

0 commit comments

Comments
 (0)