-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix(kubernetes): Add to nested resources on k8s graph inherit namespace #6912
base: main
Are you sure you want to change the base?
Conversation
ec870e7
to
6331d90
Compare
6331d90
to
20a54a0
Compare
20a54a0
to
3ebb59e
Compare
3ebb59e
to
a7a2548
Compare
@@ -171,6 +171,12 @@ def _extract_nested_resources_recursive(conf: Dict[str, Any], all_resources: Lis | |||
template['apiVersion'] = conf.get('apiVersion') | |||
|
|||
template_metadata = template.get('metadata') | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
template_namespace = template_metadata.get('namespace') | ||
metadata_namespace = metadata.get('namespace') | ||
if template_namespace is None and metadata_namespace is not None: | ||
template_metadata['namespace'] = metadata.get('namespace') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template_metadata['namespace'] = metadata.get('namespace') | |
template_metadata['namespace'] = metadata_namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right!
Fixed
a7a2548
to
3d57e74
Compare
User description
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
I fixed the k8s build graph to inherit namespace for nested resources
Fixes # (issue)
New/Edited policies (Delete if not relevant)
Description
Include a description of what makes it a violation and any relevant external links.
Fix
How does someone fix the issue in code and/or in runtime?
Checklist:
Generated description
Below is a concise technical summary of the changes proposed in this PR:
This pull request introduces changes to the Kubernetes graph builder to inherit namespaces for nested resources and implements a new check to ensure Kubernetes resources are not in the default namespace. Additionally, it includes a new check for privilege escalation.
Modified files (1)
Latest Contributors(2)
Modified files (5)
Latest Contributors(2)
Modified files (1)
Latest Contributors(2)