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

Get namespace from config file #140

Merged
merged 2 commits into from
Oct 25, 2023
Merged

Get namespace from config file #140

merged 2 commits into from
Oct 25, 2023

Conversation

dwertent
Copy link

@dwertent dwertent commented Oct 25, 2023

PR Type:

Refactoring


PR Description:

This pull request refactors the way the namespace is retrieved from the configuration file. Instead of hardcoding the default namespace and using an environment variable, the namespace is now passed as an argument to the CreateStorageNoCache and CreateFakeStorageNoCache functions. This change improves the flexibility and maintainability of the code.


PR Main Files Walkthrough:

files:

main.go: The namespace is now passed as an argument to the CreateStorageNoCache function.
pkg/storage/v1/storage_nocache.go: The CreateStorageNoCache and CreateFakeStorageNoCache functions now accept the namespace as an argument. The getNamespace function and the defaultNamespace constant have been removed.
pkg/storage/v1/storage_test.go: The tests have been updated to pass the namespace as an argument to the CreateFakeStorageNoCache function. The hardcoded namespace in the tests has been replaced with a string literal "kubescape".


User Description:

Overview

Signed-off-by: David Wertenteil <[email protected]>
@dwertent dwertent changed the title get namespace from config file Get namespace from config file Oct 25, 2023
@dwertent dwertent added the release Create release label Oct 25, 2023
@codiumai-pr-agent-free
Copy link

PR Analysis

  • 🎯 Main theme: Refactoring the way the namespace is retrieved from the configuration file
  • 📝 PR summary: This PR refactors the way the namespace is retrieved from the configuration file. Instead of hardcoding the default namespace and using an environment variable, the namespace is now passed as an argument to the CreateStorageNoCache and CreateFakeStorageNoCache functions. This change improves the flexibility and maintainability of the code.
  • 📌 Type of PR: Refactoring
  • 🧪 Relevant tests added: Yes
  • ⏱️ Estimated effort to review [1-5]: 2

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.

vladklokun
vladklokun previously approved these changes Oct 25, 2023
matthyx
matthyx previously approved these changes Oct 25, 2023
Copy link
Contributor

@matthyx matthyx left a comment

Choose a reason for hiding this comment

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

just a nit

Signed-off-by: David Wertenteil <[email protected]>
@dwertent dwertent dismissed stale reviews from matthyx and vladklokun via c2a8a91 October 25, 2023 10:53
@github-actions
Copy link

Summary:

  • License scan: success
  • Credentials scan: success
  • Vulnerabilities scan: failure
  • Unit test: success
  • Go linting: success

@dwertent dwertent merged commit b3866e3 into main Oct 25, 2023
6 checks passed
@dwertent dwertent deleted the default-namespace branch October 26, 2023 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants