-
Notifications
You must be signed in to change notification settings - Fork 104
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
Namespace Package Verify #1536
Namespace Package Verify #1536
Conversation
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.
Lgtm. However, we should mark one of these KEP-31 related PRs as release/highlight
to get the changelog visibility with a lengthy description of the feature and with release/breaking
because this is sort-of breaking: using namespaces resources used to work and now it doesn't.
labels: | ||
app: my-app` | ||
|
||
pf := packages.Files{ |
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.
This could be a table test and you would "save" ~50 slocs 😉
} | ||
ns, err := renderer.YamlToObject(val) | ||
if err != nil { | ||
res.AddErrors(fmt.Sprintf("Unable to marshal NamespaceManifest %q ", pf.Operator.NamespaceManifest)) |
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.
res.AddErrors(fmt.Sprintf("Unable to marshal NamespaceManifest %q ", pf.Operator.NamespaceManifest)) | |
res.AddErrors(fmt.Sprintf("Unable to marshal NamespaceManifest %q ", pf.Operator.NamespaceManifest)) | |
return |
We probably want to abort checking here, right?
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.
agree! thank you!
// it would be great if we could marshal the templates into an unstructured runtime.Object to confirm Namespace | ||
// however with templating we don't have the ability to have all required information to do so. | ||
// best effort is to confirm that "kind: Namespace" is not used. |
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.
It might be an idea in the future to let the operator developer to provide an example-params.yaml
in the operator development that provides values for all required parameters so we can render the templates and verify more thoroughly...
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 like that idea... however :). in cases where there are conditional branches in the templates... you would only be able to evaluate the one in the example :( which still has the likelihood of missing constraints like this.
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Package Verify now includes namespace checks
kind: Namespace
allowed in an operatorkind: Namespace
Signed-off-by: Ken Sipe kensipe@gmail.com
Fixes #