File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,10 @@ import (
13
13
"github.com/spf13/pflag"
14
14
crd_cs "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1"
15
15
"k8s.io/client-go/kubernetes"
16
+ "kmodules.xyz/client-go/discovery"
16
17
appcatalog_cs "kmodules.xyz/custom-resources/client/clientset/versioned"
18
+ ocapps "kmodules.xyz/openshift/apis/apps/v1"
19
+ oc_cs "kmodules.xyz/openshift/client/clientset/versioned"
17
20
)
18
21
19
22
type ExtraOptions struct {
@@ -91,5 +94,13 @@ func (s *ExtraOptions) ApplyTo(cfg *controller.Config) error {
91
94
if cfg .AppCatalogClient , err = appcatalog_cs .NewForConfig (cfg .ClientConfig ); err != nil {
92
95
return err
93
96
}
97
+
98
+ // if cluster has OpenShift DeploymentConfig then generate OcClient
99
+ if discovery .IsPreferredAPIResource (cfg .KubeClient .Discovery (), ocapps .GroupVersion .String (), apis .KindDeploymentConfig ) {
100
+ if cfg .OcClient , err = oc_cs .NewForConfig (cfg .ClientConfig ); err != nil {
101
+ return err
102
+ }
103
+ }
104
+
94
105
return nil
95
106
}
You can’t perform that action at this time.
0 commit comments