-
Notifications
You must be signed in to change notification settings - Fork 504
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
update helm default chart name and namespace values #589
Conversation
williepaul
commented
Mar 6, 2021
- this changes the helm chart default name/namespace values to match a default deployment of a given helm chart
- this changes the helm chart default name/namespace values to match a default deployment of a given helm chart
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Codecov Report
@@ Coverage Diff @@
## master #589 +/- ##
==========================================
+ Coverage 77.65% 79.45% +1.79%
==========================================
Files 102 104 +2
Lines 2524 2964 +440
==========================================
+ Hits 1960 2355 +395
- Misses 420 446 +26
- Partials 144 163 +19
|
Name: defaultChartName, | ||
Namespace: chartName + "-namespace", | ||
Name: chartName, | ||
Namespace: defaultNamespaceName, |
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.
Would Namespace
always be default
? Why did we previously have this value equal to chartName + "-namespace"
? I am just trying to understand how is this change affecting terrascan? and what are the repercussions of not having this.
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.
Good question. When first adding Helm support, I was not sure where the name field was being pulled from. I remember wanting to use the original chart name, but from the usage in some of their unit tests, it looked arbitrary. While working on some drift mapping fixes, I noticed Helm really was using the Chart name in this field, and hence the name change.
As for the namespace change, "default" is just used by default. However, as you might have wondered, it may be set to something else. Helm takes a namespace command as input, and that namespace specified on the command line is what is fed into this value. We don't currently have a way of passing variables into our provider implementations, but I think we should add some option to do so, for example -Dkey=value, where in this case a user could specify something like -Dnamespace=mynamespace. It's important to us, since without a way to do this, we will not be able to map resources in custom namespaces correctly.
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.
@williepaul , I am wondering, is PR partially fixing the problem? And the complete solution would be to accept options from the user and to exact mappings?
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.
What Willie and I were trying to figure out when looking at this last week: helm
by default will use the namespace of the current kubernetes context. So how do we map that into a static scan?
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.
@kanchwala-yusuf that is correct. A complete solution should take in command line input with data to replace the chart name and namespace as needed. However, these values are suitable defaults, and are currently needed and used by the k8s scan and drift mapping...
Let's put it this way--these defaults are more suitable than the current ones, up until we have implemented the optional overrides from the command line