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

refactor: replace getEnv with cmp.or & make fmt #1042

Closed
wants to merge 1 commit into from

Conversation

izturn
Copy link
Contributor

@izturn izturn commented Mar 26, 2024

πŸ“‘ Description

replace getEnv with cmp.Or & make fmt

βœ… Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

β„Ή Additional Information

Signed-off-by: Gang Liu gang.liu@daocloud.io

Signed-off-by: gang.liu <gang.liu@daocloud.io>
@izturn izturn requested review from a team as code owners March 26, 2024 08:33
ChartName = getEnv("TRIVY_CHART_NAME", "trivy-operator")
RepoShortName = getEnv("TRIVY_REPO_SHORT_NAME", "aqua")
ReleaseName = getEnv("TRIVY_RELEASE_NAME", "trivy-operator-k8sgpt")
Repo = cmp.Or("TRIVY_REPO", "https://aquasecurity.github.io/helm-charts/")
Copy link
Member

Choose a reason for hiding this comment

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

I think that doesn't look right,
the desired behavior is to see if an env variable is populated.

cmp.Or function in this implementation will make Repo's value to TRIVY_REPO string

I also don't see the value of using cmp to replace a small function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it

@izturn izturn closed this Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants