-
Notifications
You must be signed in to change notification settings - Fork 117
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 NodeJS Helm v3 to use native client #1279
Conversation
3408c3e
to
b0028b5
Compare
b0028b5
to
b5b07af
Compare
...config, | ||
releaseName, | ||
|
||
toJSON() { |
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.
Not sure if there's a simpler way to handle the translation from the input interfaces to the JSON string, but I had to add cases for all of the camelCase fields.
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.
I had to add cases for all of the camelCase fields.
camelCase and snake_case are both conventions that are valid JSON.
What is the need for the translation?
Would we have to manually support these entries for future options, or can we avoid that all together?
Also, TIL about toJSON()
. The embedding of logic on the config props like this is stylistically new to me.
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.
The invoke call is expecting a JSON string that it unmarshals to the Helm structs in the provider, so I need the keys to match. I'm not sure if there's a better way to handle this, but the data was complex enough that I thought JSON was nicer than using individual fields.
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.
Also, TIL about toJSON(). The embedding of logic on the config props like this is stylistically new to me.
Courtesy of https://www.executeprogram.com/courses/modern-javascript/lessons/customizing-json-serialization
|
||
const allConfig = pulumi.output(config); | ||
|
||
(<any>allConfig).isKnown.then((isKnown: boolean) => { |
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.
Since allConfig
is an output, why not use it in an apply like is done below with this.resources
?
Relatedly, using <any>
is loose on typing, can we preserve it by using it within the apply?
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.
Hmm, I'm not sure why it's like this. I copy-pasted this code from the original implementation. I'll leave it alone for this PR for the sake of not accidentally breaking something.
...config, | ||
releaseName, | ||
|
||
toJSON() { |
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.
I had to add cases for all of the camelCase fields.
camelCase and snake_case are both conventions that are valid JSON.
What is the need for the translation?
Would we have to manually support these entries for future options, or can we avoid that all together?
Also, TIL about toJSON()
. The embedding of logic on the config props like this is stylistically new to me.
} | ||
} | ||
|
||
interface BaseChartOpts { |
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.
Are BaseChartOpts
and ChartOpts
interfaces that could exist at the top of the Helm namespace given that the options are shared, or is it best to keep these versioned as we've done?
apiVersions
is new, so that's prob a case to keep them versioned.
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.
They could probably be shared, but I think I'll leave them separate in case we want to diverge in the future given the upcoming deprecation plan for v2.
9ec4593
to
b92c6a5
Compare
eedee40
to
c7fa145
Compare
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.
Overall LGTM.
Could use extra 👀 from @justinvp for good measure.
@@ -1,3 +1,4 @@ | |||
apiVersion: v2 |
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.
should these be v3?
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.
Apparently this is correct. v1
corresponds to Helm v2, and v2
corresponds to Helm v3. 🤷♂️
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.
LGTM
Proposed changes
Related issues (optional)
Part of #920