Skip to content

Commit

Permalink
Merge pull request #16539 from jim-minter/tsb-test-spin
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Add NODE_SELECTOR parameter on TSB template

And set empty openshift.io/node-selector annotation on namespace during TSB tests
  • Loading branch information
openshift-merge-robot committed Sep 26, 2017
2 parents e647638 + eaf2a42 commit 09256f7
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion install/templateservicebroker/apiserver-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kind: TemplateServiceBrokerConfig
apiVersion: config.templateservicebroker.openshift.io/v1
templateNamespaces:
- openshift
- openshift
5 changes: 4 additions & 1 deletion install/templateservicebroker/apiserver-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ parameters:
apiVersion: config.templateservicebroker.openshift.io/v1
templateNamespaces:
- openshift
- name: NODE_SELECTOR
value: "{}"
objects:

# to create the tsb server
Expand Down Expand Up @@ -59,6 +61,7 @@ objects:
path: /healthz
port: 8443
scheme: HTTPS
nodeSelector: "${{NODE_SELECTOR}}"
volumes:
- name: serving-cert
secret:
Expand Down Expand Up @@ -101,7 +104,7 @@ objects:
targetPort: 8443

# This service account will be granted permission to call the TSB.
# The token for this SA will be provided to the service catalog for
# The token for this SA will be provided to the service catalog for
# use when calling the TSB.
- apiVersion: v1
kind: ServiceAccount
Expand Down
8 changes: 6 additions & 2 deletions pkg/oc/bootstrap/bindata.go

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

17 changes: 17 additions & 0 deletions test/extended/templates/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ func setUser(cli *exutil.CLI, user *userapi.User) {
}
}

func setEmptyNodeSelector(tsbOC *exutil.CLI) {
namespace, err := tsbOC.AdminKubeClient().CoreV1().Namespaces().Get(tsbOC.Namespace(), metav1.GetOptions{})
o.Expect(err).NotTo(o.HaveOccurred())

namespace.Annotations["openshift.io/node-selector"] = ""

_, err = tsbOC.AdminKubeClient().CoreV1().Namespaces().Update(namespace)
o.Expect(err).NotTo(o.HaveOccurred())
}

// EnsureTSB makes sure a TSB is present where expected and returns a client to
// speak to it and a close method which provides the proxy. The caller must
// call the close method, usually done in AfterEach
Expand All @@ -137,6 +147,13 @@ func EnsureTSB(tsbOC *exutil.CLI) (osbclient.Client, func() error) {
}
}

// Set an empty node selector on our namespace. For now this ensures we
// don't trigger a spinning state (see bz1494709) with the DaemonSet if
// projectConfig.defaultNodeSelector is set in the master config and some
// nodes don't match the nodeSelector. The spinning state wastes CPU and
// fills the node logs, but otherwise isn't particularly harmful.
setEmptyNodeSelector(tsbOC)

configPath := exutil.FixturePath("..", "..", "install", "templateservicebroker", "apiserver-template.yaml")

err := tsbOC.AsAdmin().Run("new-app").Args(configPath, "-p", "LOGLEVEL=4", "-p", "NAMESPACE="+tsbOC.Namespace()).Execute()
Expand Down
8 changes: 6 additions & 2 deletions test/extended/testdata/bindata.go

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

0 comments on commit 09256f7

Please sign in to comment.