Skip to content

Commit

Permalink
Disallow unknown fields from resources struct
Browse files Browse the repository at this point in the history
Before this change, it is possible to passe any additionnal field (in
the yaml/json form) with Tekton resources. This is now disallowed.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
  • Loading branch information
vdemeester committed Jul 16, 2019
1 parent 0ee3b14 commit 44d5041
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func main() {
v1alpha1.SchemeGroupVersion.WithKind("TaskRun"): &v1alpha1.TaskRun{},
v1alpha1.SchemeGroupVersion.WithKind("PipelineRun"): &v1alpha1.PipelineRun{},
},
Logger: logger,

Logger: logger,
DisallowUnknownFields: true,
// Decorate contexts with the current state of the config.
WithContext: func(ctx context.Context) context.Context {
return v1alpha1.WithDefaultConfigurationName(store.ToContext(ctx))
Expand Down

0 comments on commit 44d5041

Please sign in to comment.