Skip to content

Adds general label handling for GCP #430

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

Merged

Conversation

linguini-dev
Copy link
Collaborator

@linguini-dev linguini-dev commented Feb 6, 2025

Summary

This PR adds general label handling for Google Cloud objects.

There is an added check in _delete_resource so it affects all objects that have labels. Because of this I have removed the logic from disks and images as it's no longer needed.

Progress

Run logs

2025-02-06 08:17:24,689 ocw.lib.gce  DEBUG    [ccoe] 2 disks found
2025-02-06 08:17:24,846 ocw.lib.gce  DEBUG    [ccoe] Resource disk/gke-qe-c-testing-default-pool-20255a71-00de has these labels: {<REDACTED>, 'pcw_ignore': '1'}
2025-02-06 08:17:24,846 ocw.lib.gce  INFO     [ccoe] Skipping deletion of disk gke-qe-c-testing-default-pool-20255a71-00de due to 'pcw_ignore' label set to 1
2025-02-06 08:17:24,986 ocw.lib.gce  DEBUG    [ccoe] Resource disk/gke-qe-c-testing-default-pool-20255a71-r2k9 has these labels: {<REDACTED>, 'pcw_ignore': '1'}
2025-02-06 08:17:24,986 ocw.lib.gce  INFO     [ccoe] Skipping deletion of disk gke-qe-c-testing-default-pool-20255a71-r2k9 due to 'pcw_ignore' label set to 1

@linguini-dev linguini-dev marked this pull request as ready for review February 6, 2025 08:43
@linguini-dev linguini-dev force-pushed the feature/gcp-general-label-handling branch from 2b19ef9 to bc678a0 Compare February 12, 2025 13:19
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.

Project coverage is 79.47%. Comparing base (e9f5e2f) to head (f7aa90c).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
ocw/lib/gce.py 55.56% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #430      +/-   ##
==========================================
- Coverage   79.60%   79.47%   -0.13%     
==========================================
  Files          21       21              
  Lines        1632     1631       -1     
==========================================
- Hits         1299     1296       -3     
- Misses        333      335       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@asmorodskyi asmorodskyi left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@ricardobranco777 ricardobranco777 left a comment

Choose a reason for hiding this comment

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

This is great!

@asmorodskyi asmorodskyi merged commit 1b3b49a into SUSE:master Feb 12, 2025
9 checks passed
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.

3 participants