-
Notifications
You must be signed in to change notification settings - Fork 13
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
ROX-20450: Configure operator resources in chart #1417
Changes from all commits
162ff08
d510702
57aef6c
2597ad6
c96ee03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,13 +54,18 @@ func RenderChart(operators OperatorConfigs) ([]*unstructured.Unstructured, error | |
for _, operator := range operators.Configs { | ||
valuesArr = append(valuesArr, chartutil.Values(operator)) | ||
} | ||
|
||
resourcesChart, err := charts.GetChart("rhacs-operator", operators.CRDURLs) | ||
operatorValues := resourcesChart.Values["operator"].(map[string]interface{}) | ||
defaultValues := operatorValues["default"].(map[string]interface{}) | ||
|
||
chartVals := chartutil.Values{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an obvious room for improvement in how to chart values constructed but I would prefer a separate PR for this |
||
"operator": chartutil.Values{ | ||
"images": valuesArr, | ||
"images": valuesArr, | ||
"default": chartutil.Values(defaultValues), | ||
}, | ||
} | ||
|
||
resourcesChart, err := charts.GetChart("rhacs-operator", operators.CRDURLs) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed getting chart: %w", err) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ func validateCRDUrls(path *field.Path, urls []string) field.ErrorList { | |
|
||
func validateCRDURL(path *field.Path, urlStr string) field.ErrorList { | ||
var errs field.ErrorList | ||
if _, err := url.Parse(urlStr); err != nil { | ||
if _, err := url.ParseRequestURI(urlStr); err != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
errs = append(errs, field.Invalid(path, urlStr, fmt.Sprintf("invalid url: %s", err.Error()))) | ||
} | ||
return errs | ||
|
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 think it would be better to safe-cast here,
e.g