kubescape / operator

Operator is an in-cluster component of the Kubescape security platform. It allows clients to connect to itself, listens for commands from the connected clients and controls other in-cluster components according to received commands.
Apache License 2.0
13 stars 20 forks source link

Get namespace name from config #186

Closed dwertent closed 1 year ago

dwertent commented 1 year ago

PR Type:

Bug fix


PR Description:

This PR addresses issue #173 by ensuring that the namespace configured in the application is used for all Kubernetes operations. Previously, the namespace was hardcoded as armotypes.KubescapeNamespace, which could lead to issues if the application was configured to use a different namespace. The changes involve replacing the hardcoded namespace with a call to config.Namespace(), which retrieves the currently configured namespace.


PR Main Files Walkthrough:

files: `mainhandler/imageregistryhandler.go`: Replaced hardcoded namespace with the configured one in various Kubernetes operations such as creating secrets, configmaps, and cronjobs, and getting registry scan secrets and workloads. `mainhandler/imageregistryhandlerhelper.go`: Updated the namespace used in operations like updating secrets, configmaps, and cronjobs, and deleting registry scan cronjobs. `mainhandler/vulnscan.go`: Adjusted the namespace used when getting registry scan secrets.

User Description:

Overview

This PR fixes #173

Signed Commits

codiumai-pr-agent-free[bot] commented 1 year ago

PR Analysis

How to use

To invoke the PR-Agent, add a comment using one of the following commands: /review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option. /describe: Modify the PR title and description based on the contents of the PR. /improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback. /ask \<QUESTION>: Pose a question about the PR. /update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value For example: /review --pr_reviewer.extra_instructions="focus on the file: ..." To list the possible configuration parameters, use the /config command.

github-actions[bot] commented 1 year ago

Summary: