Skip to content

Commit

Permalink
feat: [run] Adding support for encryption_key_revocation_action and e…
Browse files Browse the repository at this point in the history
…ncryption_key_shutdown_duration for RevisionTemplate and ExecutionTemplate (#9013)

- [ ] Regenerate this pull request now.

docs: Documentation improvements, including clarification that v1 labels/annotations are rejected in v2 API

PiperOrigin-RevId: 503293343

Source-Link: https://togithub.com/googleapis/googleapis/commit/e3d3d63275d13364cc986e100faff16b2cf510f5

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/f401f99dd0e2bfe7fbe6b190d3381ba648f21227
Copy-Tag: eyJwIjoiamF2YS1ydW4vLk93bEJvdC55YW1sIiwiaCI6ImY0MDFmOTlkZDBlMmJmZTdmYmU2YjE5MGQzMzgxYmE2NDhmMjEyMjcifQ==
  • Loading branch information
gcf-owl-bot[bot] committed Jan 20, 2023
1 parent 265cc10 commit af47cbc
Show file tree
Hide file tree
Showing 97 changed files with 8,259 additions and 5,136 deletions.
6 changes: 3 additions & 3 deletions java-run/README.md
Expand Up @@ -22,20 +22,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-run</artifactId>
<version>0.7.0</version>
<version>0.8.0</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-run:0.7.0'
implementation 'com.google.cloud:google-cloud-run:0.8.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-run" % "0.7.0"
libraryDependencies += "com.google.cloud" % "google-cloud-run" % "0.8.0"
```

## Authentication
Expand Down
Expand Up @@ -509,7 +509,7 @@ public final UnaryCallable<GetServiceRequest, Service> getServiceCallable() {
* }</pre>
*
* @param parent Required. The location and project to list resources on. Location must be a valid
* GCP region, and cannot be the "-" wildcard. Format:
* Google Cloud region, and cannot be the "-" wildcard. Format:
* projects/{project}/locations/{location}, where {project} can be project id or number.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down Expand Up @@ -542,7 +542,7 @@ public final ListServicesPagedResponse listServices(LocationName parent) {
* }</pre>
*
* @param parent Required. The location and project to list resources on. Location must be a valid
* GCP region, and cannot be the "-" wildcard. Format:
* Google Cloud region, and cannot be the "-" wildcard. Format:
* projects/{project}/locations/{location}, where {project} can be project id or number.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down
Expand Up @@ -107,6 +107,9 @@ public void getExecutionTest() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
mockService.addResponse(expectedResponse);
Expand Down Expand Up @@ -173,6 +176,9 @@ public void getExecutionTest2() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
mockService.addResponse(expectedResponse);
Expand Down Expand Up @@ -341,6 +347,9 @@ public void deleteExecutionTest() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
Operation resultOperation =
Expand Down Expand Up @@ -412,6 +421,9 @@ public void deleteExecutionTest2() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
Operation resultOperation =
Expand Down
Expand Up @@ -115,6 +115,9 @@ public void getExecutionTest() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
mockExecutions.addResponse(expectedResponse);
Expand Down Expand Up @@ -175,6 +178,9 @@ public void getExecutionTest2() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
mockExecutions.addResponse(expectedResponse);
Expand Down Expand Up @@ -323,6 +329,9 @@ public void deleteExecutionTest() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
Operation resultOperation =
Expand Down Expand Up @@ -391,6 +400,9 @@ public void deleteExecutionTest2() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
Operation resultOperation =
Expand Down
Expand Up @@ -762,6 +762,9 @@ public void runJobTest() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
Operation resultOperation =
Expand Down Expand Up @@ -833,6 +836,9 @@ public void runJobTest2() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
Operation resultOperation =
Expand Down
Expand Up @@ -684,6 +684,9 @@ public void runJobTest() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
Operation resultOperation =
Expand Down Expand Up @@ -752,6 +755,9 @@ public void runJobTest2() throws Exception {
.setRunningCount(261439119)
.setSucceededCount(633694641)
.setFailedCount(-2013829491)
.setCancelledCount(1921113249)
.setRetriedCount(-1654679545)
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
Operation resultOperation =
Expand Down
Expand Up @@ -107,6 +107,8 @@ public void getRevisionTest() throws Exception {
.addAllVolumes(new ArrayList<Volume>())
.setExecutionEnvironment(ExecutionEnvironment.forNumber(0))
.setEncryptionKey("encryptionKey-36224036")
.setEncryptionKeyRevocationAction(EncryptionKeyRevocationAction.forNumber(0))
.setEncryptionKeyShutdownDuration(Duration.newBuilder().build())
.setReconciling(true)
.addAllConditions(new ArrayList<Condition>())
.setObservedGeneration(900833007)
Expand Down Expand Up @@ -176,6 +178,8 @@ public void getRevisionTest2() throws Exception {
.addAllVolumes(new ArrayList<Volume>())
.setExecutionEnvironment(ExecutionEnvironment.forNumber(0))
.setEncryptionKey("encryptionKey-36224036")
.setEncryptionKeyRevocationAction(EncryptionKeyRevocationAction.forNumber(0))
.setEncryptionKeyShutdownDuration(Duration.newBuilder().build())
.setReconciling(true)
.addAllConditions(new ArrayList<Condition>())
.setObservedGeneration(900833007)
Expand Down Expand Up @@ -347,6 +351,8 @@ public void deleteRevisionTest() throws Exception {
.addAllVolumes(new ArrayList<Volume>())
.setExecutionEnvironment(ExecutionEnvironment.forNumber(0))
.setEncryptionKey("encryptionKey-36224036")
.setEncryptionKeyRevocationAction(EncryptionKeyRevocationAction.forNumber(0))
.setEncryptionKeyShutdownDuration(Duration.newBuilder().build())
.setReconciling(true)
.addAllConditions(new ArrayList<Condition>())
.setObservedGeneration(900833007)
Expand Down Expand Up @@ -421,6 +427,8 @@ public void deleteRevisionTest2() throws Exception {
.addAllVolumes(new ArrayList<Volume>())
.setExecutionEnvironment(ExecutionEnvironment.forNumber(0))
.setEncryptionKey("encryptionKey-36224036")
.setEncryptionKeyRevocationAction(EncryptionKeyRevocationAction.forNumber(0))
.setEncryptionKeyShutdownDuration(Duration.newBuilder().build())
.setReconciling(true)
.addAllConditions(new ArrayList<Condition>())
.setObservedGeneration(900833007)
Expand Down
Expand Up @@ -115,6 +115,8 @@ public void getRevisionTest() throws Exception {
.addAllVolumes(new ArrayList<Volume>())
.setExecutionEnvironment(ExecutionEnvironment.forNumber(0))
.setEncryptionKey("encryptionKey-36224036")
.setEncryptionKeyRevocationAction(EncryptionKeyRevocationAction.forNumber(0))
.setEncryptionKeyShutdownDuration(Duration.newBuilder().build())
.setReconciling(true)
.addAllConditions(new ArrayList<Condition>())
.setObservedGeneration(900833007)
Expand Down Expand Up @@ -178,6 +180,8 @@ public void getRevisionTest2() throws Exception {
.addAllVolumes(new ArrayList<Volume>())
.setExecutionEnvironment(ExecutionEnvironment.forNumber(0))
.setEncryptionKey("encryptionKey-36224036")
.setEncryptionKeyRevocationAction(EncryptionKeyRevocationAction.forNumber(0))
.setEncryptionKeyShutdownDuration(Duration.newBuilder().build())
.setReconciling(true)
.addAllConditions(new ArrayList<Condition>())
.setObservedGeneration(900833007)
Expand Down Expand Up @@ -329,6 +333,8 @@ public void deleteRevisionTest() throws Exception {
.addAllVolumes(new ArrayList<Volume>())
.setExecutionEnvironment(ExecutionEnvironment.forNumber(0))
.setEncryptionKey("encryptionKey-36224036")
.setEncryptionKeyRevocationAction(EncryptionKeyRevocationAction.forNumber(0))
.setEncryptionKeyShutdownDuration(Duration.newBuilder().build())
.setReconciling(true)
.addAllConditions(new ArrayList<Condition>())
.setObservedGeneration(900833007)
Expand Down Expand Up @@ -400,6 +406,8 @@ public void deleteRevisionTest2() throws Exception {
.addAllVolumes(new ArrayList<Volume>())
.setExecutionEnvironment(ExecutionEnvironment.forNumber(0))
.setEncryptionKey("encryptionKey-36224036")
.setEncryptionKeyRevocationAction(EncryptionKeyRevocationAction.forNumber(0))
.setEncryptionKeyShutdownDuration(Duration.newBuilder().build())
.setReconciling(true)
.addAllConditions(new ArrayList<Condition>())
.setObservedGeneration(900833007)
Expand Down
Expand Up @@ -111,6 +111,7 @@ public void getTaskTest() throws Exception {
.setLastAttemptResult(TaskAttemptResult.newBuilder().build())
.setEncryptionKey("encryptionKey-36224036")
.setVpcAccess(VpcAccess.newBuilder().build())
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
mockService.addResponse(expectedResponse);
Expand Down Expand Up @@ -184,6 +185,7 @@ public void getTaskTest2() throws Exception {
.setLastAttemptResult(TaskAttemptResult.newBuilder().build())
.setEncryptionKey("encryptionKey-36224036")
.setVpcAccess(VpcAccess.newBuilder().build())
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
mockService.addResponse(expectedResponse);
Expand Down
Expand Up @@ -117,6 +117,7 @@ public void getTaskTest() throws Exception {
.setLastAttemptResult(TaskAttemptResult.newBuilder().build())
.setEncryptionKey("encryptionKey-36224036")
.setVpcAccess(VpcAccess.newBuilder().build())
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
mockTasks.addResponse(expectedResponse);
Expand Down Expand Up @@ -184,6 +185,7 @@ public void getTaskTest2() throws Exception {
.setLastAttemptResult(TaskAttemptResult.newBuilder().build())
.setEncryptionKey("encryptionKey-36224036")
.setVpcAccess(VpcAccess.newBuilder().build())
.setLogUri("logUri-1097354360")
.setEtag("etag3123477")
.build();
mockTasks.addResponse(expectedResponse);
Expand Down
Expand Up @@ -149,7 +149,9 @@ public boolean getUseDefault() {
}

public static final int BREAKGLASS_JUSTIFICATION_FIELD_NUMBER = 2;
private volatile java.lang.Object breakglassJustification_;

@SuppressWarnings("serial")
private volatile java.lang.Object breakglassJustification_ = "";
/**
*
*
Expand Down Expand Up @@ -424,8 +426,8 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
breakglassJustification_ = "";

binauthzMethodCase_ = 0;
binauthzMethod_ = null;
return this;
Expand Down Expand Up @@ -455,15 +457,26 @@ public com.google.cloud.run.v2.BinaryAuthorization build() {
public com.google.cloud.run.v2.BinaryAuthorization buildPartial() {
com.google.cloud.run.v2.BinaryAuthorization result =
new com.google.cloud.run.v2.BinaryAuthorization(this);
if (binauthzMethodCase_ == 1) {
result.binauthzMethod_ = binauthzMethod_;
if (bitField0_ != 0) {
buildPartial0(result);
}
result.breakglassJustification_ = breakglassJustification_;
result.binauthzMethodCase_ = binauthzMethodCase_;
buildPartialOneofs(result);
onBuilt();
return result;
}

private void buildPartial0(com.google.cloud.run.v2.BinaryAuthorization result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.breakglassJustification_ = breakglassJustification_;
}
}

private void buildPartialOneofs(com.google.cloud.run.v2.BinaryAuthorization result) {
result.binauthzMethodCase_ = binauthzMethodCase_;
result.binauthzMethod_ = this.binauthzMethod_;
}

@java.lang.Override
public Builder clone() {
return super.clone();
Expand Down Expand Up @@ -511,6 +524,7 @@ public Builder mergeFrom(com.google.cloud.run.v2.BinaryAuthorization other) {
if (other == com.google.cloud.run.v2.BinaryAuthorization.getDefaultInstance()) return this;
if (!other.getBreakglassJustification().isEmpty()) {
breakglassJustification_ = other.breakglassJustification_;
bitField0_ |= 0x00000002;
onChanged();
}
switch (other.getBinauthzMethodCase()) {
Expand Down Expand Up @@ -559,7 +573,7 @@ public Builder mergeFrom(
case 18:
{
breakglassJustification_ = input.readStringRequireUtf8();

bitField0_ |= 0x00000002;
break;
} // case 18
default:
Expand Down Expand Up @@ -593,6 +607,8 @@ public Builder clearBinauthzMethod() {
return this;
}

private int bitField0_;

/**
*
*
Expand Down Expand Up @@ -640,6 +656,7 @@ public boolean getUseDefault() {
* @return This builder for chaining.
*/
public Builder setUseDefault(boolean value) {

binauthzMethodCase_ = 1;
binauthzMethod_ = value;
onChanged();
Expand Down Expand Up @@ -736,8 +753,8 @@ public Builder setBreakglassJustification(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}

breakglassJustification_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
Expand All @@ -756,8 +773,8 @@ public Builder setBreakglassJustification(java.lang.String value) {
* @return This builder for chaining.
*/
public Builder clearBreakglassJustification() {

breakglassJustification_ = getDefaultInstance().getBreakglassJustification();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
Expand All @@ -781,8 +798,8 @@ public Builder setBreakglassJustificationBytes(com.google.protobuf.ByteString va
throw new NullPointerException();
}
checkByteStringIsUtf8(value);

breakglassJustification_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
Expand Down

0 comments on commit af47cbc

Please sign in to comment.