litmuschaos / admission-controllers

Admission Controllers used in LitmusChaos
Apache License 2.0
7 stars 6 forks source link

Use abstract types in webhook to support testing #19

Closed christopherfriedrich closed 4 years ago

christopherfriedrich commented 4 years ago

In the webhook struct we are currently using kubernetes.Clientset as type for the kubeClient field instead of its abstraction kubernetes.Interface

Due to that testing (#2) with injecting fake.Clientset from https://godoc.org/k8s.io/client-go/kubernetes/fake is not possible because of a type mismatch.

rahulchheda commented 4 years ago

Great, would you like to create a PR for this, or I could go ahead with this.

christopherfriedrich commented 4 years ago

You can go ahead.

christopherfriedrich commented 4 years ago

@rahulchheda wouldn't it be even better to completely switch to dynamic client / dynamic interface as of #4 to also support OpenShift?

rahulchheda commented 4 years ago

Right, that makes a lot of sense, let me spend some time on it.