Skip to content

Commit

Permalink
Merge pull request #15486 from bparees/ose_sc
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 15486, 15482)

respect --image flag value for service catalog image name

bug 1475219
https://bugzilla.redhat.com/show_bug.cgi?id=1475219
  • Loading branch information
openshift-merge-robot authored Jul 28, 2017
2 parents dfb5026 + 7c8cb15 commit ea2c299
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
12 changes: 6 additions & 6 deletions examples/service-catalog/service-catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ objects:
- "10"
- --cors-allowed-origins
- ${CORS_ALLOWED_ORIGIN}
image: openshift/origin-service-catalog:${SERVICE_CATALOG_TAG}
image: ${SERVICE_CATALOG_IMAGE}
imagePullPolicy: IfNotPresent
name: apiserver
ports:
Expand Down Expand Up @@ -312,7 +312,7 @@ objects:
- service-catalog
- --broker-relist-interval
- "5m"
image: openshift/origin-service-catalog:${SERVICE_CATALOG_TAG}
image: ${SERVICE_CATALOG_IMAGE}
imagePullPolicy: IfNotPresent
name: controller-manager
ports:
Expand Down Expand Up @@ -356,11 +356,11 @@ parameters:
name: CORS_ALLOWED_ORIGIN
required: true
value: 10.192.213.116
- description: Tag of the service catalog images to use for apiserver and controller-manager
displayName: Service catalog image tag
name: SERVICE_CATALOG_TAG
- description: Name of the service catalog image to use for apiserver and controller-manager
displayName: Service catalog image name
name: SERVICE_CATALOG_IMAGE
required: true
value: latest
value: openshift/origin-service-catalog:latest
- description: Cluster ip address for the service catalog service
displayName: Service Catalog Service IP
name: SERVICE_CATALOG_SERVICE_IP
Expand Down
12 changes: 6 additions & 6 deletions pkg/oc/bootstrap/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions pkg/oc/bootstrap/docker/openshift/servicecatalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
authzapi "github.com/openshift/origin/pkg/authorization/apis/authorization"

"github.com/openshift/origin/pkg/cmd/util/clientcmd"
"github.com/openshift/origin/pkg/cmd/util/variable"
"github.com/openshift/origin/pkg/oc/bootstrap/docker/errors"
)

Expand All @@ -31,7 +32,7 @@ const (
)

// InstallServiceCatalog checks whether the service catalog is installed and installs it if not already installed
func (h *Helper) InstallServiceCatalog(f *clientcmd.Factory, configDir, publicMaster, catalogHost string, tag string) error {
func (h *Helper) InstallServiceCatalog(f *clientcmd.Factory, configDir, publicMaster, catalogHost string, imageFormat string) error {
osClient, kubeClient, err := f.Clients()
if err != nil {
return errors.NewError("cannot obtain API clients").WithCause(err).WithDetails(h.OriginLog())
Expand Down Expand Up @@ -80,10 +81,14 @@ func (h *Helper) InstallServiceCatalog(f *clientcmd.Factory, configDir, publicMa
}

// Instantiate service catalog
imageTemplate := variable.NewDefaultImageTemplate()
imageTemplate.Format = imageFormat
imageTemplate.Latest = false

params := map[string]string{
"SERVICE_CATALOG_SERVICE_IP": ServiceCatalogServiceIP,
"CORS_ALLOWED_ORIGIN": publicMaster,
"SERVICE_CATALOG_TAG": tag,
"SERVICE_CATALOG_IMAGE": imageTemplate.ExpandOrDie("service-catalog"),
}
glog.V(2).Infof("instantiating service catalog template with parameters %v", params)

Expand Down
3 changes: 1 addition & 2 deletions pkg/oc/bootstrap/docker/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -1033,8 +1033,7 @@ func (c *ClientStartConfig) InstallServiceCatalog(out io.Writer) error {
if len(publicMaster) == 0 {
publicMaster = c.ServerIP
}
tag := c.ImageVersion
return c.OpenShiftHelper().InstallServiceCatalog(f, c.LocalConfigDir, publicMaster, openshift.CatalogHost(c.RoutingSuffix, c.ServerIP), tag)
return c.OpenShiftHelper().InstallServiceCatalog(f, c.LocalConfigDir, publicMaster, openshift.CatalogHost(c.RoutingSuffix, c.ServerIP), c.imageFormat())
}

// Login logs into the new server and sets up a default user and project
Expand Down

0 comments on commit ea2c299

Please sign in to comment.