Skip to content

Commit

Permalink
fix interface assertions in example/mutatingwebhook.go such that podA…
Browse files Browse the repository at this point in the history
…nnotator is required to implement both inject.Client and inject.Decoder interfaces
  • Loading branch information
perryao committed Jan 5, 2019
1 parent 5aed6d6 commit a169108
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions example/mutatingwebhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ func (a *podAnnotator) mutatePodsFn(ctx context.Context, pod *corev1.Pod) error
return nil
}

// podValidator implements inject.Client.
// podAnnotator implements inject.Client.
// A client will be automatically injected.
var _ inject.Client = &podValidator{}
var _ inject.Client = &podAnnotator{}

// InjectClient injects the client.
func (v *podAnnotator) InjectClient(c client.Client) error {
v.client = c
return nil
}

// podValidator implements inject.Decoder.
// podAnnotator implements inject.Decoder.
// A decoder will be automatically injected.
var _ inject.Decoder = &podValidator{}
var _ inject.Decoder = &podAnnotator{}

// InjectDecoder injects the decoder.
func (v *podAnnotator) InjectDecoder(d types.Decoder) error {
Expand Down

0 comments on commit a169108

Please sign in to comment.