Skip to content

Commit 01e5a1b

Browse files
Merge pull request #15676 from deads2k/tsb-10-enable
Automatic merge from submit-queue enable the TSB storage and controller by default This enables the basic storage and controllers (but not the broker) in the apiserver by default.
2 parents 9bf7f60 + 541a760 commit 01e5a1b

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

hack/update-generated-swagger-spec.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ os::cleanup::tmpdir
2222
os::util::environment::setup_all_server_vars
2323
os::start::configure_server
2424

25-
cp "${SERVER_CONFIG_DIR}/master/master-config.yaml" "${SERVER_CONFIG_DIR}/master/master-config.orig2.yaml"
26-
openshift ex config patch "${SERVER_CONFIG_DIR}/master/master-config.orig2.yaml" --patch="{\"templateServiceBrokerConfig\": {\"templateNamespaces\": [\"openshift\"]}}" > "${SERVER_CONFIG_DIR}/master/master-config.yaml"
27-
2825
SWAGGER_SPEC_REL_DIR="${1:-}"
2926
SWAGGER_SPEC_OUT_DIR="${OS_ROOT}/${SWAGGER_SPEC_REL_DIR}/api/swagger-spec"
3027
mkdir -p "${SWAGGER_SPEC_OUT_DIR}"

pkg/cmd/server/bootstrappolicy/policy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ func GetOpenshiftBootstrapClusterRoles() []authorizationapi.ClusterRole {
216216
authorizationapi.NewRule(read...).Groups(securityGroup, legacySecurityGroup).Resources("securitycontextconstraints").RuleOrDie(),
217217

218218
authorizationapi.NewRule(read...).Groups(templateGroup, legacyTemplateGroup).Resources("templates", "templateconfigs", "processedtemplates", "templateinstances").RuleOrDie(),
219+
authorizationapi.NewRule(read...).Groups(templateGroup).Resources("brokertemplateinstances", "templateinstances/status").RuleOrDie(),
219220

220221
authorizationapi.NewRule(read...).Groups(userGroup, legacyUserGroup).Resources("groups", "identities", "useridentitymappings", "users").RuleOrDie(),
221222

pkg/cmd/server/origin/storage.go

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -473,20 +473,18 @@ func (c OpenshiftAPIConfig) GetRestStorage() (map[schema.GroupVersion]map[string
473473
"routes/status": routeStatusStorage,
474474
}
475475

476-
if c.EnableTemplateServiceBroker {
477-
templateInstanceStorage, templateInstanceStatusStorage, err := templateinstanceetcd.NewREST(c.GenericConfig.RESTOptionsGetter, c.KubeClientInternal)
478-
if err != nil {
479-
return nil, fmt.Errorf("error building REST storage: %v", err)
480-
}
481-
brokerTemplateInstanceStorage, err := brokertemplateinstanceetcd.NewREST(c.GenericConfig.RESTOptionsGetter)
482-
if err != nil {
483-
return nil, fmt.Errorf("error building REST storage: %v", err)
484-
}
485-
486-
storage[templateapiv1.SchemeGroupVersion]["templateinstances"] = templateInstanceStorage
487-
storage[templateapiv1.SchemeGroupVersion]["templateinstances/status"] = templateInstanceStatusStorage
488-
storage[templateapiv1.SchemeGroupVersion]["brokertemplateinstances"] = brokerTemplateInstanceStorage
476+
templateInstanceStorage, templateInstanceStatusStorage, err := templateinstanceetcd.NewREST(c.GenericConfig.RESTOptionsGetter, c.KubeClientInternal)
477+
if err != nil {
478+
return nil, fmt.Errorf("error building REST storage: %v", err)
489479
}
480+
brokerTemplateInstanceStorage, err := brokertemplateinstanceetcd.NewREST(c.GenericConfig.RESTOptionsGetter)
481+
if err != nil {
482+
return nil, fmt.Errorf("error building REST storage: %v", err)
483+
}
484+
485+
storage[templateapiv1.SchemeGroupVersion]["templateinstances"] = templateInstanceStorage
486+
storage[templateapiv1.SchemeGroupVersion]["templateinstances/status"] = templateInstanceStatusStorage
487+
storage[templateapiv1.SchemeGroupVersion]["brokertemplateinstances"] = brokerTemplateInstanceStorage
490488

491489
if c.EnableBuilds {
492490
storage[buildapiv1.SchemeGroupVersion] = map[string]rest.Storage{

pkg/cmd/server/start/start_master.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,6 @@ func getExcludedControllers(options configapi.MasterConfig) sets.String {
751751
excludedControllers.Insert("openshift.io/build")
752752
excludedControllers.Insert("openshift.io/build-config-change")
753753
}
754-
if options.TemplateServiceBrokerConfig == nil {
755-
excludedControllers.Insert("openshift.io/templateinstance")
756-
}
757754

758755
return excludedControllers
759756
}

test/testdata/bootstrappolicy/bootstrap_cluster_roles.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,16 @@ items:
382382
- get
383383
- list
384384
- watch
385+
- apiGroups:
386+
- template.openshift.io
387+
attributeRestrictions: null
388+
resources:
389+
- brokertemplateinstances
390+
- templateinstances/status
391+
verbs:
392+
- get
393+
- list
394+
- watch
385395
- apiGroups:
386396
- user.openshift.io
387397
- ""

0 commit comments

Comments
 (0)