Skip to content

Commit

Permalink
deploy: annotate routes only if present (#47)
Browse files Browse the repository at this point in the history
`deploy` command tries to add a route annotation even if there isn't
any `route`. This cause deploy to fail in cases of multi-containers
where a deployment may not have any route associated.

This patch fixes the issue by adding the annotation only if route
is present.
This patch makes `route` and `service` an optional parameter as
there are instance such as penfold talking to mattermost service
which does not require any service or route to be defined.

Fixes #44
  • Loading branch information
sthaha authored and Hrishikesh Shinde committed Oct 8, 2018
1 parent 229a896 commit 923c6a2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vars/deploy.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def call(Map args = [:]) {
error "Missing manadatory parameter: resources"
}

def required = ['ImageStream', 'DeploymentConfig', 'Service', 'Route', 'meta']
// can pass single or multiple maps
def required = ['ImageStream', 'DeploymentConfig', 'meta']
def res = Utils.mergeResources(args.resources)

def found = res.keySet()
def missing = required - found
if (missing) {
Expand Down Expand Up @@ -92,6 +92,10 @@ def verifyDeployments(ns, dcs) {
}

def annotateRoutes(ns, env, routes, version) {
if (!routes) {
return
}

def svcURLs = routes.inject(''){ acc, r -> acc + "\n ${r.metadata.name}: ${displayRouteURL(ns, r)}" }
def depVersions = routes.inject(''){ acc, r -> acc + "\n ${r.metadata.name}: $version" }

Expand Down

0 comments on commit 923c6a2

Please sign in to comment.