Skip to content

Conversation

ldoktor
Copy link
Contributor

@ldoktor ldoktor commented May 15, 2025

Playing around with gatekeeper might be tedious with all the GH requests, let's add a way to record/provide some files instead.

ldoktor added 2 commits May 15, 2025 10:32
to avoid manual curling to analyze GK issues let's add a way to dump all
GK requests in a directory when the use specifies "DEBUG" env variable.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
to simplify gatekeeper development add support for DEBUG_INPUT which can
be used to report content from files gathered in DEBUG run.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Copy link
Member

@stevenhorsman stevenhorsman left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me and would have helped when I was debugging the gatekeeper issue. Thanks @ldoktor!

response = requests.get(url, headers=_GH_HEADERS, params=params,
timeout=60)
response.raise_for_status()
output = response.json()
if DEBUG_DIR:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit? if you have DEBUG_DIR and DEBUG_INPUT exported then it should ignore DEBUG_DIR? i.e., save the output json only if downloaded from internet?

Copy link
Contributor Author

@ldoktor ldoktor May 26, 2025

Choose a reason for hiding this comment

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

Originally I thought about it and then decided not to try to make the script smart and simply rely on users to use them as they want. So do you want me to put here if not DEBUG_INPUT and DEBUG_DIR: or can it stay as is?

Copy link
Contributor

Choose a reason for hiding this comment

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

I just wanted to bring it to your attention in case you hadn't noticed. But since it was a deliberated decision (not try to make it super smart) and it is debug code (not super critical); I'm fine to keep it as is.

Copy link
Contributor

@wainersm wainersm left a comment

Choose a reason for hiding this comment

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

Thanks @ldoktor !

@wainersm wainersm merged commit c249769 into kata-containers:main May 26, 2025
346 of 365 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test size/medium Average sized task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants