Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
- name: etcdImageTag
required: true
# This metadata has just been added to verify that we can set metadata.
metadata:
deprecatedV1Beta1Metadata:
labels:
testLabelKey: testLabelValue
annotations:
Expand Down
4 changes: 4 additions & 0 deletions test/framework/cluster_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ func (p *clusterProxy) GetCache(ctx context.Context) cache.Cache {
}

// CreateOrUpdate creates or updates objects using the clusterProxy client.
// Defaults to use FieldValidation: strict, which can be overwritten with CreateOrUpdateOptions.
func (p *clusterProxy) CreateOrUpdate(ctx context.Context, resources []byte, opts ...CreateOrUpdateOption) error {
Expect(ctx).NotTo(BeNil(), "ctx is required for CreateOrUpdate")
Expect(resources).NotTo(BeNil(), "resources is required for CreateOrUpdate")
Expand All @@ -318,6 +319,9 @@ func (p *clusterProxy) CreateOrUpdate(ctx context.Context, resources []byte, opt
if config.labelSelector != nil {
labelSelector = config.labelSelector
}
// Prepending field validation strict so that it is used per default, but can still be overwritten.
config.createOpts = append([]client.CreateOption{client.FieldValidation("Strict")}, config.createOpts...)
config.updateOpts = append([]client.UpdateOption{client.FieldValidation("Strict")}, config.updateOpts...)
objs, err := yaml.ToUnstructured(resources)
if err != nil {
return err
Expand Down