-
Notifications
You must be signed in to change notification settings - Fork 152
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
Always populate TemplateParams 'Object' #249
Conversation
//return cli.Resource(resource).Namespace(namespace).List(metav1.ListOptions{}) | ||
return cli.Resource(resource).List(metav1.ListOptions{}) | ||
// ListUnstructuredObjectWithCli returns the referenced API objects as a map[string]interface{} using the specified CLI | ||
// TODO: deprecate `ListUnstructuredObject` |
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.
👍
pkg/param/param_test.go
Outdated
@@ -543,6 +564,9 @@ func (s *ParamsSuite) TestPhaseParams(c *C) { | |||
c.Assert(err, IsNil) | |||
|
|||
crCli := crfake.NewSimpleClientset() |
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.
[nit] Create this closer to its use.
crCli := crfake.NewSimpleClientset() |
@@ -543,6 +564,9 @@ func (s *ParamsSuite) TestPhaseParams(c *C) { | |||
c.Assert(err, IsNil) | |||
|
|||
crCli := crfake.NewSimpleClientset() | |||
pvc, err := s.cli.CoreV1().PersistentVolumeClaims(s.namespace).Get(s.pvc, metav1.GetOptions{}) | |||
c.Assert(err, IsNil) | |||
dynCli := s.getDynamicClient(c, pvc) |
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.
[nit]
dynCli := s.getDynamicClient(c, pvc) | |
dynCli := s.getDynamicClient(c, pvc) | |
crCli := crfake.NewSimpleClientset() |
Change Overview
This commit modifies template params creation to always
populate the Object field with the unstructured representation
of the Kubernetes object that is the target of the actionset
This allows writing generic blueprints that can be re-used
across different types of Kubernetes resources and to reference
fields from within the object spec that we do not hoist into
TemplateParams e.g.
.Object.metadata.labels.<foo>
The change described is contained to
param.go
andparam_test.go
.The rest of the changes are to the
kube
pkg to allow testing witha fake dynamic client.
Pull request type
Please check the type of change your PR introduces:
Issues
Object
in TemplateParams with unstructured content for well-known types #247Test Plan