Refactor Openshift detection

This commit is contained in:
waseem
2019-07-05 12:23:14 +02:00
parent ff5f28ba00
commit 878bc5c442
4 changed files with 23 additions and 19 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ func startReloader(cmd *cobra.Command, args []string) {
}
// create the clientset
clientset, err := kube.GetClient()
clientset, err := kube.GetKubernetesClient()
if err != nil {
logrus.Fatal(err)
}
+1 -1
View File
@@ -53,7 +53,7 @@ func TestMain(m *testing.M) {
// Perform rolling upgrade on deploymentConfig and create env var upon updating the configmap
func TestControllerUpdatingConfigmapShouldCreateEnvInDeploymentConfig(t *testing.T) {
// Don't run test on non-openshift environment
if !clients.IsOpenshift {
if !kube.IsOpenshift {
return
}
+1 -1
View File
@@ -68,7 +68,7 @@ func doRollingUpgrade(config util.Config) {
rollingUpgrade(clients, config, GetDaemonSetRollingUpgradeFuncs())
rollingUpgrade(clients, config, GetStatefulSetRollingUpgradeFuncs())
if clients.IsOpenshift {
if kube.IsOpenshift {
rollingUpgrade(clients, config, GetDeploymentConfigRollingUpgradeFuncs())
}
}