-
Notifications
You must be signed in to change notification settings - Fork 102
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
KEP31: Template Support for Namespace Manifest #1535
Conversation
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
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.
Nice, that looks a lot less code than I expected :)
Would like to see the setting of the template variables a bit more unified, but that might be a bit weird.
pkg/kudoctl/util/kudo/install.go
Outdated
configs["OperatorName"] = resources.Operator.Name | ||
configs["Name"] = instanceName | ||
configs["Namespace"] = namespace | ||
configs["Params"] = parameters | ||
configs["AppVersion"] = resources.OperatorVersion.Spec.AppVersion | ||
configs["OperatorVersion"] = resources.OperatorVersion.Spec.Version |
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 wonder if we could somehow put these and the assignments from render.go:15-25
together. Or maybe at least define constants for the strings here.
Reason is that when at some point we add some more variables for templating, it might be easy to miss one of the places.
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.
we actually have in 3 parts of code I discovered... makes sense to me
pkg/kudoctl/util/kudo/install.go
Outdated
var err error | ||
manifest, err = render("namespace", template, resources, instanceName, namespace, parameters) | ||
if err != nil { | ||
return err |
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.
return err | |
return fmt.Errorf("failed to render namespace manifest %s: %v", resources.Operator.Spec.NamespaceManifest, err) |
Might be good to add some context to the error here?
Signed-off-by: Ken Sipe <kensipe@gmail.com>
…ce in code Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe kensipe@gmail.com
Fixes #