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

[resource-scraper] introduce utility integration #2304

Merged
merged 4 commits into from
Apr 18, 2022

Conversation

maorfr
Copy link
Contributor

@maorfr maorfr commented Mar 30, 2022

this is a utility integration that collects resources from specific namespaces of clusters and stores them in vault.

this utility can be used for different purposes, such as disaster recovery.
the current use case is https://issues.redhat.com/browse/OSD-10326

@maorfr
Copy link
Contributor Author

maorfr commented Mar 30, 2022

error:

reconcile/resource_scraper.py:57: error: "VaultClient" has no attribute "write"  [attr-defined]

VaultClient indeed doesn't have a write method, _VaultClient has it. what would be the best way to overcome this?
perhaps this?

$ git diff
diff --git a/reconcile/utils/vault.py b/reconcile/utils/vault.py
index 4106c2f..2e4b989 100644
--- a/reconcile/utils/vault.py
+++ b/reconcile/utils/vault.py
@@ -301,3 +301,6 @@ class VaultClient:
             return cls._instance
 
         return cls._instance
+
+    def write(cls, *args, **kwargs):
+        return cls._instance.write(*args, **kwargs)

@maorfr maorfr force-pushed the resource-scraper branch from 3fdd943 to 01ef9e1 Compare March 30, 2022 15:18
@maorfr
Copy link
Contributor Author

maorfr commented Mar 30, 2022

QONTRACT_INTEGRATION = "resource-scraper"


def run(dry_run, namespace_name, resource_kind, vault_output_path):

Choose a reason for hiding this comment

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

Thanks for adding this Maor! Can you also add support for filtering on labels? The way we were scraping the secrets was to filter on the label:

oc get secret ... -l app=openshift-sre-token-scraper

Copy link
Contributor Author

Choose a reason for hiding this comment

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

contributions are welcome? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

After discussing with Dustin we are going to merge as-is, and Dustin will contribute a patch to add filtering on a later MR.

@TGPSKI TGPSKI force-pushed the resource-scraper branch from 0d2edde to fff3d5f Compare April 13, 2022 22:50
@TGPSKI TGPSKI force-pushed the resource-scraper branch from 0578924 to 8c5a813 Compare April 18, 2022 23:20
@TGPSKI TGPSKI merged commit d9b9727 into app-sre:master Apr 18, 2022
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