Skip to content

Commit

Permalink
feat: [gke-backup] added new restore scope options (#9586)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

feat: added transformation rules for restore
feat: added BackupPlan and RestorePlan state information

These features aim to do the following:
1. Improve flexibility of restore with new options to define new kinds of scope configurations.
2. Improve flexibility of restore by supporting Transformation Rules, which enable the removal and addition of spec fields of restored resources prior to their creation.
3. Improve observability by revealing the state information of BackupPlan and RestorePlan.

PiperOrigin-RevId: 543605700

Source-Link: https://github.com/googleapis/googleapis/commit/d39c91b3ac0abec1490ef00010107355a4dae317

Source-Link: https://github.com/googleapis/googleapis-gen/commit/0cf7f93d4a60fae7fbd1a9ab03f7da4c62fb1bd2
Copy-Tag: eyJwIjoiamF2YS1na2UtYmFja3VwLy5Pd2xCb3QueWFtbCIsImgiOiIwY2Y3ZjkzZDRhNjBmYWU3ZmJkMWE5YWIwM2Y3ZGE0YzYyZmIxYmQyIn0=
  • Loading branch information
gcf-owl-bot[bot] authored Jun 30, 2023
1 parent ef39c21 commit c35bd0b
Show file tree
Hide file tree
Showing 15 changed files with 11,756 additions and 2,912 deletions.
2 changes: 1 addition & 1 deletion java-gke-backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-gke-backup.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-gke-backup/0.18.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-gke-backup/0.19.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public void createBackupPlanTest() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -185,6 +186,7 @@ public void createBackupPlanTest2() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -351,6 +353,7 @@ public void getBackupPlanTest() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -407,6 +410,7 @@ public void getBackupPlanTest2() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -463,6 +467,7 @@ public void updateBackupPlanTest() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand All @@ -487,6 +492,7 @@ public void updateBackupPlanTest() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
FieldMask updateMask = FieldMask.newBuilder().build();

Expand Down Expand Up @@ -531,6 +537,7 @@ public void updateBackupPlanExceptionTest() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
FieldMask updateMask = FieldMask.newBuilder().build();
client.updateBackupPlanAsync(backupPlan, updateMask).get();
Expand Down Expand Up @@ -1471,6 +1478,7 @@ public void createRestorePlanTest() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1534,6 +1542,7 @@ public void createRestorePlanTest2() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1697,6 +1706,7 @@ public void getRestorePlanTest() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -1750,6 +1760,7 @@ public void getRestorePlanTest2() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -1803,6 +1814,7 @@ public void updateRestorePlanTest() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand All @@ -1824,6 +1836,7 @@ public void updateRestorePlanTest() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
FieldMask updateMask = FieldMask.newBuilder().build();

Expand Down Expand Up @@ -1866,6 +1879,7 @@ public void updateRestorePlanExceptionTest() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
FieldMask updateMask = FieldMask.newBuilder().build();
client.updateRestorePlanAsync(restorePlan, updateMask).get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void createBackupPlanTest() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -193,6 +194,7 @@ public void createBackupPlanTest2() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -346,6 +348,7 @@ public void getBackupPlanTest() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
mockBackupForGKE.addResponse(expectedResponse);

Expand Down Expand Up @@ -396,6 +399,7 @@ public void getBackupPlanTest2() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
mockBackupForGKE.addResponse(expectedResponse);

Expand Down Expand Up @@ -446,6 +450,7 @@ public void updateBackupPlanTest() throws Exception {
.setDeactivated(true)
.setBackupConfig(BackupPlan.BackupConfig.newBuilder().build())
.setProtectedPodCount(-1494678716)
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1298,6 +1303,7 @@ public void createRestorePlanTest() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1360,6 +1366,7 @@ public void createRestorePlanTest2() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1510,6 +1517,7 @@ public void getRestorePlanTest() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
mockBackupForGKE.addResponse(expectedResponse);

Expand Down Expand Up @@ -1557,6 +1565,7 @@ public void getRestorePlanTest2() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
mockBackupForGKE.addResponse(expectedResponse);

Expand Down Expand Up @@ -1604,6 +1613,7 @@ public void updateRestorePlanTest() throws Exception {
.setRestoreConfig(RestoreConfig.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setStateReason("stateReason1148834357")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down
Loading

0 comments on commit c35bd0b

Please sign in to comment.