Skip to content

Commit 6f083bc

Browse files
authored
Keep artifact registry dry run off for policy changes (#8419)
* fix to unset the boolean cleanupPolicyDryRun on ar repos * adding changelog
1 parent e26c0d7 commit 6f083bc

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
- Fixed an issue in the extensions emulator where parameter default values would not be substitued into resource definitions.
2+
- Keep artifact registry dry run off for policy changes #8419

src/functions/artifacts.ts

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export async function setCleanupPolicy(
173173
...repository.cleanupPolicies,
174174
...generateCleanupPolicy(daysToKeep),
175175
},
176+
cleanupPolicyDryRun: false,
176177
labels,
177178
};
178179
await exports.updateRepository(update);

src/gcp/artifactregistry.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface Repository {
2323
createTime: string;
2424
updateTime: string;
2525
cleanupPolicies?: Record<string, CleanupPolicy | undefined>;
26+
cleanupPolicyDryRun?: boolean;
2627
labels?: Record<string, string>;
2728
}
2829

@@ -84,7 +85,7 @@ export async function getRepository(repoPath: string): Promise<Repository> {
8485
* Update an Artifact Registry repository.
8586
*/
8687
export async function updateRepository(repo: RepositoryInput): Promise<Repository> {
87-
const updateMask = proto.fieldMasks(repo, "cleanupPolicies", "labels");
88+
const updateMask = proto.fieldMasks(repo, "cleanupPolicies", "cleanupPolicyDryRun", "labels");
8889
if (updateMask.length === 0) {
8990
const res = await client.get<Repository>(repo.name!);
9091
return res.body;

0 commit comments

Comments
 (0)