Use Clientset interface instead of type for Fission/kubernetes clients (#2416)
Using interface makes it easy to create a fake client and unit test a specific portion of the code. We should be able to more write unit test and increase coverage of code with this change. Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -62,7 +62,7 @@ type HealthChecker struct {
|
||||
categories []*Category
|
||||
*Options
|
||||
|
||||
kubeAPI *kubernetes.Clientset
|
||||
kubeAPI kubernetes.Interface
|
||||
fissionNamespace string
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ func isCompatibleVersion(minimalRequirementVersion [3]int, actualVersion [3]int)
|
||||
|
||||
func (hc *HealthChecker) CheckKubeVersion() (err error) {
|
||||
|
||||
version, err := hc.kubeAPI.ServerVersion()
|
||||
version, err := hc.kubeAPI.Discovery().ServerVersion()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user