matrix: add bootstrapJob config flag to appservices

This allows us to bypass the issue where Kubernetes jobs cannot be
updated once completed, so bumping appservice image versions was
painful.

But really, though, this is probably someting that kubecfg/kartongips
should handle.

Change-Id: I2778c5433f699db89120a3c44e55d2fbe2a10015
diff --git a/app/matrix/lib/appservice-irc.libsonnet b/app/matrix/lib/appservice-irc.libsonnet
index b9e5b84..bc07305 100644
--- a/app/matrix/lib/appservice-irc.libsonnet
+++ b/app/matrix/lib/appservice-irc.libsonnet
@@ -6,6 +6,11 @@
         local cfg = bridge.cfg,
         cfg:: {
             metadata: {},
+            // Whether the bootstrap job should be created/updated. Kubernetes
+            // doesn't like changing the configuration of jobs, so once this
+            // appservice has been set up, this flag should be flipped to
+            // false.
+            bootstrapJob: true,
             config: std.native("parseYaml")(importstr "appservice/appservice-irc.yaml")[0] {
                 ircService+: {
                     [if cfg.passwordEncryptionKeySecret != null then "passwordEncryptionKeyPath"]: "/key/key.pem"
@@ -40,7 +45,7 @@
             },
         },
 
-        bootstrapJob: kube.Job("appservice-irc-%s-bootstrap" % [name]) {
+        bootstrapJob: if cfg.bootstrapJob then (kube.Job("appservice-irc-%s-bootstrap" % [name]) {
             metadata+: cfg.metadata {
                 labels: {
                     "job-name": "appservice-irc-%s-bootstrap" % [name],
@@ -64,7 +69,7 @@
                     },
                 },
             },
-        },
+        }) else {},
 
         deployment: kube.Deployment("appservice-irc-%s" % [name]) {
             metadata+: cfg.metadata,