-
Notifications
You must be signed in to change notification settings - Fork 70
Gracefully fail if a Helm chart has missing values #287
Gracefully fail if a Helm chart has missing values #287
Conversation
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.
@jadengore should we add a test for this also?
pkg/lifecycle/daemon/routes_v1.go
Outdated
"event", "validate.fail", | ||
"errors", fmt.Sprintf("%+v", formattedErrors), | ||
) | ||
c.JSON(400, map[string]interface{}{ |
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.
400 http.StatusBadRequest
?
@@ -129,9 +136,15 @@ export default class HelmValuesEditor extends React.Component { | |||
values: specValue | |||
} | |||
if(payload.values !== "" && payload.values !== initialSpecValue) { | |||
this.setState({ saving: true }); | |||
this.setState({ saving: true, helmLintErrors: [] }); |
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'm surprised you didn't await
this but lgtm.
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'm not too concerned about the errors being cleared before we make the next request
} | ||
const body = await response.blob(); | ||
dispatch(loadingData(loaderType, false)); | ||
return body; |
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.
gonna defer to @GraysonNull on this pattern of returning the body directly vs dispatching another action
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.
@jadengore Ideally we dispatch a new action so things stay updated in the redux store and we maintain the data flow throughout the app. What's the is the context of this? I'm unable to click in to see this change in it's context....says it can't find the commits.
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.
Talked IRL, this is all good
} | ||
const body = await response.blob(); | ||
dispatch(loadingData(loaderType, false)); | ||
return body; |
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.
Talked IRL, this is all good
What I Did
saveHelmValues
if linting of Helm templates failHow I Did it
Incorporate Helm's linter as a dependency in the project, and run against Values passed from frontend in the
helm-values
route. I also updated the UI to properly halt and display a 400 error if it detects a failure.How to verify it
Try skipping values with this command:
It should fail with the error below:
Description for the Changelog
Picture of a Boat (not required but encouraged)