Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cleanup for gcp cli mirroring #133

Merged
merged 3 commits into from
Nov 19, 2022
Merged

Add cleanup for gcp cli mirroring #133

merged 3 commits into from
Nov 19, 2022

Conversation

AHarmlessPyro
Copy link
Contributor

No description provided.

if (metloRegexResp.length != 2) {
throw new Error("Packet Mirroring policy didn't match expected pattern. Please try manual deletion.")
}
let metloId = regexPattern.exec(mirrorInstance.name)[1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validate that this is a uuid

// Delete GCP Packet Mirroring
try {
let resp_pack = await conn.stop_packet_mirroring({
packetMirroringURL: mirrorInstance.selfLink.split("/").at(-1),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pull out and validate uuid

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

spinner.succeed("Deleted Forwarding Rule")

spinner.start("Deleting Load Balancer")
const [backends, ,] = await conn.list_backend_service()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check whole name


spinner.start("Deleting Health Check")
const [healthChecks, ,] = await conn.list_health_checks()
const check = healthChecks.find((_check) => _check.name.includes(metloId))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check whole name

@AHarmlessPyro AHarmlessPyro merged commit 52e8c6a into develop Nov 19, 2022
@AHarmlessPyro AHarmlessPyro deleted the gcp_cli_cleanup branch November 27, 2022 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants