@@ -13,7 +13,6 @@ import (
13
13
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
14
14
"k8s.io/apimachinery/pkg/util/wait"
15
15
kapi "k8s.io/kubernetes/pkg/api"
16
- "k8s.io/kubernetes/pkg/kubectl/resource"
17
16
18
17
"github.com/openshift/origin/pkg/cmd/util/clientcmd"
19
18
"github.com/openshift/origin/pkg/cmd/util/variable"
@@ -43,7 +42,7 @@ func (h *Helper) InstallTemplateServiceBroker(f *clientcmd.Factory, imageFormat
43
42
return errors .NewError ("cannot create template service broker project" ).WithCause (err )
44
43
}
45
44
46
- if err = instantiateTemplate (templateClient .Template (), clientcmd . ResourceMapper ( f ), nil , OpenshiftInfraNamespace , tsbRBACTemplateName , tsbNamespace , map [string ]string {}, true ); err != nil {
45
+ if err = instantiateTemplate (templateClient .Template (), f , OpenshiftInfraNamespace , tsbRBACTemplateName , tsbNamespace , map [string ]string {}, true ); err != nil {
47
46
return errors .NewError ("cannot instantiate template service broker permissions" ).WithCause (err )
48
47
}
49
48
@@ -59,7 +58,7 @@ func (h *Helper) InstallTemplateServiceBroker(f *clientcmd.Factory, imageFormat
59
58
}
60
59
glog .V (2 ).Infof ("instantiating template service broker template with parameters %v" , params )
61
60
62
- if err = instantiateTemplate (templateClient .Template (), clientcmd . ResourceMapper ( f ), nil , OpenshiftInfraNamespace , tsbAPIServerTemplateName , tsbNamespace , params , true ); err != nil {
61
+ if err = instantiateTemplate (templateClient .Template (), f , OpenshiftInfraNamespace , tsbAPIServerTemplateName , tsbNamespace , params , true ); err != nil {
63
62
return errors .NewError ("cannot instantiate template service broker resources" ).WithCause (err )
64
63
}
65
64
@@ -92,20 +91,12 @@ func (h *Helper) RegisterTemplateServiceBroker(f *clientcmd.Factory, configDir s
92
91
// Register the template broker with the service catalog
93
92
glog .V (2 ).Infof ("registering the template broker with the service catalog" )
94
93
95
- // dynamic mapper is needed to support the broker resource which isn't part of the api.
96
- dynamicMapper , dynamicTyper , err := f .UnstructuredObject ()
97
- dmapper := & resource.Mapper {
98
- RESTMapper : dynamicMapper ,
99
- ObjectTyper : dynamicTyper ,
100
- ClientMapper : resource .ClientMapperFunc (f .UnstructuredClientForMapping ),
101
- }
102
-
103
94
serviceCABytes , err := ioutil .ReadFile (filepath .Join (configDir , "master" , "service-signer.crt" ))
104
95
serviceCAString := base64 .StdEncoding .EncodeToString (serviceCABytes )
105
96
if err != nil {
106
97
return errors .NewError ("unable to read service signer cert" ).WithCause (err )
107
98
}
108
- if err = instantiateTemplate (templateClient .Template (), clientcmd . ResourceMapper ( f ), dmapper , OpenshiftInfraNamespace , tsbRegistrationTemplateName , tsbNamespace , map [string ]string {
99
+ if err = instantiateTemplate (templateClient .Template (), f , OpenshiftInfraNamespace , tsbRegistrationTemplateName , tsbNamespace , map [string ]string {
109
100
"TSB_NAMESPACE" : tsbNamespace ,
110
101
"CA_BUNDLE" : serviceCAString ,
111
102
}, true ); err != nil {
0 commit comments