Skip to content
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

Merged
merged 5 commits into from
May 26, 2020
Merged

Conversation

kensipe
Copy link
Member

@kensipe kensipe commented May 21, 2020

Signed-off-by: Ken Sipe kensipe@gmail.com

Fixes #

Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Copy link
Member

@ANeumann82 ANeumann82 left a 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.

Comment on lines 157 to 162
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
Copy link
Member

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.

Copy link
Member Author

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

var err error
manifest, err = render("namespace", template, resources, instanceName, namespace, parameters)
if err != nil {
return err
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>
@kensipe kensipe merged commit f3e6f9d into master May 26, 2020
@kensipe kensipe deleted the ken/ns-template branch May 26, 2020 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants