Skip to content

Commit

Permalink
feat: [container] add etags for cluster and node pool update operatio…
Browse files Browse the repository at this point in the history
…ns (#8930)

- [ ] Regenerate this pull request now.

Clients may now optionally specify the previously read etag for a cluster or node pool during update requests. The etag is regenerated every time the object is updated. If an etag is provided, it will be checked against the current etag, and the request will be rejected on mismatch. This is particularly useful for allowing two clients to concurrently update a repeated field without overwriting each other.

PiperOrigin-RevId: 498249600

Source-Link: https://togithub.com/googleapis/googleapis/commit/9a294bf14b3343b3f144aa6e80fa858332d21274

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/f0f0e1ffc3e28e203e7c233af4936688c9b2b07f
Copy-Tag: eyJwIjoiamF2YS1jb250YWluZXIvLk93bEJvdC55YW1sIiwiaCI6ImYwZjBlMWZmYzNlMjhlMjAzZTdjMjMzYWY0OTM2Njg4YzliMmIwN2YifQ==
  • Loading branch information
gcf-owl-bot[bot] authored Dec 29, 2022
1 parent a4d2cf0 commit bcd0111
Show file tree
Hide file tree
Showing 74 changed files with 2,571 additions and 1,653 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ public final UnaryCallable<UpdateClusterRequest, Operation> updateClusterCallabl
* .setGcfsConfig(GcfsConfig.newBuilder().build())
* .setConfidentialNodes(ConfidentialNodes.newBuilder().build())
* .setGvnic(VirtualNIC.newBuilder().build())
* .setEtag("etag3123477")
* .setFastSocket(FastSocket.newBuilder().build())
* .setLoggingConfig(NodePoolLoggingConfig.newBuilder().build())
* .setResourceLabels(ResourceLabels.newBuilder().build())
Expand Down Expand Up @@ -853,6 +854,7 @@ public final Operation updateNodePool(UpdateNodePoolRequest request) {
* .setGcfsConfig(GcfsConfig.newBuilder().build())
* .setConfidentialNodes(ConfidentialNodes.newBuilder().build())
* .setGvnic(VirtualNIC.newBuilder().build())
* .setEtag("etag3123477")
* .setFastSocket(FastSocket.newBuilder().build())
* .setLoggingConfig(NodePoolLoggingConfig.newBuilder().build())
* .setResourceLabels(ResourceLabels.newBuilder().build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ public void getClusterTest() throws Exception {
.setLoggingConfig(LoggingConfig.newBuilder().build())
.setMonitoringConfig(MonitoringConfig.newBuilder().build())
.setNodePoolAutoConfig(NodePoolAutoConfig.newBuilder().build())
.setEtag("etag3123477")
.build();
mockClusterManager.addResponse(expectedResponse);

Expand Down Expand Up @@ -418,6 +419,7 @@ public void getClusterTest2() throws Exception {
.setLoggingConfig(LoggingConfig.newBuilder().build())
.setMonitoringConfig(MonitoringConfig.newBuilder().build())
.setNodePoolAutoConfig(NodePoolAutoConfig.newBuilder().build())
.setEtag("etag3123477")
.build();
mockClusterManager.addResponse(expectedResponse);

Expand Down Expand Up @@ -719,6 +721,7 @@ public void updateNodePoolTest() throws Exception {
.setGcfsConfig(GcfsConfig.newBuilder().build())
.setConfidentialNodes(ConfidentialNodes.newBuilder().build())
.setGvnic(VirtualNIC.newBuilder().build())
.setEtag("etag3123477")
.setFastSocket(FastSocket.newBuilder().build())
.setLoggingConfig(NodePoolLoggingConfig.newBuilder().build())
.setResourceLabels(ResourceLabels.newBuilder().build())
Expand Down Expand Up @@ -752,6 +755,7 @@ public void updateNodePoolTest() throws Exception {
Assert.assertEquals(request.getGcfsConfig(), actualRequest.getGcfsConfig());
Assert.assertEquals(request.getConfidentialNodes(), actualRequest.getConfidentialNodes());
Assert.assertEquals(request.getGvnic(), actualRequest.getGvnic());
Assert.assertEquals(request.getEtag(), actualRequest.getEtag());
Assert.assertEquals(request.getFastSocket(), actualRequest.getFastSocket());
Assert.assertEquals(request.getLoggingConfig(), actualRequest.getLoggingConfig());
Assert.assertEquals(request.getResourceLabels(), actualRequest.getResourceLabels());
Expand Down Expand Up @@ -789,6 +793,7 @@ public void updateNodePoolExceptionTest() throws Exception {
.setGcfsConfig(GcfsConfig.newBuilder().build())
.setConfidentialNodes(ConfidentialNodes.newBuilder().build())
.setGvnic(VirtualNIC.newBuilder().build())
.setEtag("etag3123477")
.setFastSocket(FastSocket.newBuilder().build())
.setLoggingConfig(NodePoolLoggingConfig.newBuilder().build())
.setResourceLabels(ResourceLabels.newBuilder().build())
Expand Down Expand Up @@ -2059,6 +2064,7 @@ public void getNodePoolTest() throws Exception {
.setUpgradeSettings(NodePool.UpgradeSettings.newBuilder().build())
.setPlacementPolicy(NodePool.PlacementPolicy.newBuilder().build())
.setUpdateInfo(NodePool.UpdateInfo.newBuilder().build())
.setEtag("etag3123477")
.build();
mockClusterManager.addResponse(expectedResponse);

Expand Down Expand Up @@ -2113,6 +2119,7 @@ public void getNodePoolTest2() throws Exception {
.setUpgradeSettings(NodePool.UpgradeSettings.newBuilder().build())
.setPlacementPolicy(NodePool.PlacementPolicy.newBuilder().build())
.setUpdateInfo(NodePool.UpdateInfo.newBuilder().build())
.setEtag("etag3123477")
.build();
mockClusterManager.addResponse(expectedResponse);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public com.google.container.v1.NodeManagementOrBuilder getManagementOrBuilder()
* <code>string min_cpu_platform = 5 [deprecated = true];</code>
*
* @deprecated google.container.v1.AutoprovisioningNodePoolDefaults.min_cpu_platform is
* deprecated. See google/container/v1/cluster_service.proto;l=3461
* deprecated. See google/container/v1/cluster_service.proto;l=3481
* @return The minCpuPlatform.
*/
@java.lang.Override
Expand Down Expand Up @@ -340,7 +340,7 @@ public java.lang.String getMinCpuPlatform() {
* <code>string min_cpu_platform = 5 [deprecated = true];</code>
*
* @deprecated google.container.v1.AutoprovisioningNodePoolDefaults.min_cpu_platform is
* deprecated. See google/container/v1/cluster_service.proto;l=3461
* deprecated. See google/container/v1/cluster_service.proto;l=3481
* @return The bytes for minCpuPlatform.
*/
@java.lang.Override
Expand Down Expand Up @@ -1842,7 +1842,7 @@ public com.google.container.v1.NodeManagementOrBuilder getManagementOrBuilder()
* <code>string min_cpu_platform = 5 [deprecated = true];</code>
*
* @deprecated google.container.v1.AutoprovisioningNodePoolDefaults.min_cpu_platform is
* deprecated. See google/container/v1/cluster_service.proto;l=3461
* deprecated. See google/container/v1/cluster_service.proto;l=3481
* @return The minCpuPlatform.
*/
@java.lang.Deprecated
Expand Down Expand Up @@ -1878,7 +1878,7 @@ public java.lang.String getMinCpuPlatform() {
* <code>string min_cpu_platform = 5 [deprecated = true];</code>
*
* @deprecated google.container.v1.AutoprovisioningNodePoolDefaults.min_cpu_platform is
* deprecated. See google/container/v1/cluster_service.proto;l=3461
* deprecated. See google/container/v1/cluster_service.proto;l=3481
* @return The bytes for minCpuPlatform.
*/
@java.lang.Deprecated
Expand Down Expand Up @@ -1914,7 +1914,7 @@ public com.google.protobuf.ByteString getMinCpuPlatformBytes() {
* <code>string min_cpu_platform = 5 [deprecated = true];</code>
*
* @deprecated google.container.v1.AutoprovisioningNodePoolDefaults.min_cpu_platform is
* deprecated. See google/container/v1/cluster_service.proto;l=3461
* deprecated. See google/container/v1/cluster_service.proto;l=3481
* @param value The minCpuPlatform to set.
* @return This builder for chaining.
*/
Expand Down Expand Up @@ -1949,7 +1949,7 @@ public Builder setMinCpuPlatform(java.lang.String value) {
* <code>string min_cpu_platform = 5 [deprecated = true];</code>
*
* @deprecated google.container.v1.AutoprovisioningNodePoolDefaults.min_cpu_platform is
* deprecated. See google/container/v1/cluster_service.proto;l=3461
* deprecated. See google/container/v1/cluster_service.proto;l=3481
* @return This builder for chaining.
*/
@java.lang.Deprecated
Expand Down Expand Up @@ -1980,7 +1980,7 @@ public Builder clearMinCpuPlatform() {
* <code>string min_cpu_platform = 5 [deprecated = true];</code>
*
* @deprecated google.container.v1.AutoprovisioningNodePoolDefaults.min_cpu_platform is
* deprecated. See google/container/v1/cluster_service.proto;l=3461
* deprecated. See google/container/v1/cluster_service.proto;l=3481
* @param value The bytes for minCpuPlatform to set.
* @return This builder for chaining.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public interface AutoprovisioningNodePoolDefaultsOrBuilder
* <code>string min_cpu_platform = 5 [deprecated = true];</code>
*
* @deprecated google.container.v1.AutoprovisioningNodePoolDefaults.min_cpu_platform is
* deprecated. See google/container/v1/cluster_service.proto;l=3461
* deprecated. See google/container/v1/cluster_service.proto;l=3481
* @return The minCpuPlatform.
*/
@java.lang.Deprecated
Expand All @@ -216,7 +216,7 @@ public interface AutoprovisioningNodePoolDefaultsOrBuilder
* <code>string min_cpu_platform = 5 [deprecated = true];</code>
*
* @deprecated google.container.v1.AutoprovisioningNodePoolDefaults.min_cpu_platform is
* deprecated. See google/container/v1/cluster_service.proto;l=3461
* deprecated. See google/container/v1/cluster_service.proto;l=3481
* @return The bytes for minCpuPlatform.
*/
@java.lang.Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
* <code>string project_id = 1 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.project_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2672
* google/container/v1/cluster_service.proto;l=2687
* @return The projectId.
*/
@java.lang.Override
Expand Down Expand Up @@ -112,7 +112,7 @@ public java.lang.String getProjectId() {
* <code>string project_id = 1 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.project_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2672
* google/container/v1/cluster_service.proto;l=2687
* @return The bytes for projectId.
*/
@java.lang.Override
Expand Down Expand Up @@ -144,7 +144,7 @@ public com.google.protobuf.ByteString getProjectIdBytes() {
* <code>string zone = 2 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.zone is deprecated. See
* google/container/v1/cluster_service.proto;l=2678
* google/container/v1/cluster_service.proto;l=2693
* @return The zone.
*/
@java.lang.Override
Expand Down Expand Up @@ -173,7 +173,7 @@ public java.lang.String getZone() {
* <code>string zone = 2 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.zone is deprecated. See
* google/container/v1/cluster_service.proto;l=2678
* google/container/v1/cluster_service.proto;l=2693
* @return The bytes for zone.
*/
@java.lang.Override
Expand Down Expand Up @@ -203,7 +203,7 @@ public com.google.protobuf.ByteString getZoneBytes() {
* <code>string operation_id = 3 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.operation_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2682
* google/container/v1/cluster_service.proto;l=2697
* @return The operationId.
*/
@java.lang.Override
Expand All @@ -230,7 +230,7 @@ public java.lang.String getOperationId() {
* <code>string operation_id = 3 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.operation_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2682
* google/container/v1/cluster_service.proto;l=2697
* @return The bytes for operationId.
*/
@java.lang.Override
Expand Down Expand Up @@ -706,7 +706,7 @@ public Builder mergeFrom(
* <code>string project_id = 1 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.project_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2672
* google/container/v1/cluster_service.proto;l=2687
* @return The projectId.
*/
@java.lang.Deprecated
Expand All @@ -733,7 +733,7 @@ public java.lang.String getProjectId() {
* <code>string project_id = 1 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.project_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2672
* google/container/v1/cluster_service.proto;l=2687
* @return The bytes for projectId.
*/
@java.lang.Deprecated
Expand All @@ -760,7 +760,7 @@ public com.google.protobuf.ByteString getProjectIdBytes() {
* <code>string project_id = 1 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.project_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2672
* google/container/v1/cluster_service.proto;l=2687
* @param value The projectId to set.
* @return This builder for chaining.
*/
Expand All @@ -786,7 +786,7 @@ public Builder setProjectId(java.lang.String value) {
* <code>string project_id = 1 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.project_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2672
* google/container/v1/cluster_service.proto;l=2687
* @return This builder for chaining.
*/
@java.lang.Deprecated
Expand All @@ -808,7 +808,7 @@ public Builder clearProjectId() {
* <code>string project_id = 1 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.project_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2672
* google/container/v1/cluster_service.proto;l=2687
* @param value The bytes for projectId to set.
* @return This builder for chaining.
*/
Expand Down Expand Up @@ -838,7 +838,7 @@ public Builder setProjectIdBytes(com.google.protobuf.ByteString value) {
* <code>string zone = 2 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.zone is deprecated. See
* google/container/v1/cluster_service.proto;l=2678
* google/container/v1/cluster_service.proto;l=2693
* @return The zone.
*/
@java.lang.Deprecated
Expand Down Expand Up @@ -866,7 +866,7 @@ public java.lang.String getZone() {
* <code>string zone = 2 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.zone is deprecated. See
* google/container/v1/cluster_service.proto;l=2678
* google/container/v1/cluster_service.proto;l=2693
* @return The bytes for zone.
*/
@java.lang.Deprecated
Expand Down Expand Up @@ -894,7 +894,7 @@ public com.google.protobuf.ByteString getZoneBytes() {
* <code>string zone = 2 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.zone is deprecated. See
* google/container/v1/cluster_service.proto;l=2678
* google/container/v1/cluster_service.proto;l=2693
* @param value The zone to set.
* @return This builder for chaining.
*/
Expand All @@ -921,7 +921,7 @@ public Builder setZone(java.lang.String value) {
* <code>string zone = 2 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.zone is deprecated. See
* google/container/v1/cluster_service.proto;l=2678
* google/container/v1/cluster_service.proto;l=2693
* @return This builder for chaining.
*/
@java.lang.Deprecated
Expand All @@ -944,7 +944,7 @@ public Builder clearZone() {
* <code>string zone = 2 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.zone is deprecated. See
* google/container/v1/cluster_service.proto;l=2678
* google/container/v1/cluster_service.proto;l=2693
* @param value The bytes for zone to set.
* @return This builder for chaining.
*/
Expand Down Expand Up @@ -972,7 +972,7 @@ public Builder setZoneBytes(com.google.protobuf.ByteString value) {
* <code>string operation_id = 3 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.operation_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2682
* google/container/v1/cluster_service.proto;l=2697
* @return The operationId.
*/
@java.lang.Deprecated
Expand All @@ -998,7 +998,7 @@ public java.lang.String getOperationId() {
* <code>string operation_id = 3 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.operation_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2682
* google/container/v1/cluster_service.proto;l=2697
* @return The bytes for operationId.
*/
@java.lang.Deprecated
Expand All @@ -1024,7 +1024,7 @@ public com.google.protobuf.ByteString getOperationIdBytes() {
* <code>string operation_id = 3 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.operation_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2682
* google/container/v1/cluster_service.proto;l=2697
* @param value The operationId to set.
* @return This builder for chaining.
*/
Expand All @@ -1049,7 +1049,7 @@ public Builder setOperationId(java.lang.String value) {
* <code>string operation_id = 3 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.operation_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2682
* google/container/v1/cluster_service.proto;l=2697
* @return This builder for chaining.
*/
@java.lang.Deprecated
Expand All @@ -1070,7 +1070,7 @@ public Builder clearOperationId() {
* <code>string operation_id = 3 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.operation_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2682
* google/container/v1/cluster_service.proto;l=2697
* @param value The bytes for operationId to set.
* @return This builder for chaining.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface CancelOperationRequestOrBuilder
* <code>string project_id = 1 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.project_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2672
* google/container/v1/cluster_service.proto;l=2687
* @return The projectId.
*/
@java.lang.Deprecated
Expand All @@ -52,7 +52,7 @@ public interface CancelOperationRequestOrBuilder
* <code>string project_id = 1 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.project_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2672
* google/container/v1/cluster_service.proto;l=2687
* @return The bytes for projectId.
*/
@java.lang.Deprecated
Expand All @@ -71,7 +71,7 @@ public interface CancelOperationRequestOrBuilder
* <code>string zone = 2 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.zone is deprecated. See
* google/container/v1/cluster_service.proto;l=2678
* google/container/v1/cluster_service.proto;l=2693
* @return The zone.
*/
@java.lang.Deprecated
Expand All @@ -89,7 +89,7 @@ public interface CancelOperationRequestOrBuilder
* <code>string zone = 2 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.zone is deprecated. See
* google/container/v1/cluster_service.proto;l=2678
* google/container/v1/cluster_service.proto;l=2693
* @return The bytes for zone.
*/
@java.lang.Deprecated
Expand All @@ -106,7 +106,7 @@ public interface CancelOperationRequestOrBuilder
* <code>string operation_id = 3 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.operation_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2682
* google/container/v1/cluster_service.proto;l=2697
* @return The operationId.
*/
@java.lang.Deprecated
Expand All @@ -122,7 +122,7 @@ public interface CancelOperationRequestOrBuilder
* <code>string operation_id = 3 [deprecated = true];</code>
*
* @deprecated google.container.v1.CancelOperationRequest.operation_id is deprecated. See
* google/container/v1/cluster_service.proto;l=2682
* google/container/v1/cluster_service.proto;l=2697
* @return The bytes for operationId.
*/
@java.lang.Deprecated
Expand Down
Loading

0 comments on commit bcd0111

Please sign in to comment.