Multiple PubSub Topics


#1

I’m trying to configure spinnaker to subscribe to multiple pubsub topics, but seems that halyard only allows for one at a time. I am looking to create multiple pipelines, one triggered by GCS topic and the other by a GCR topic

$ hal config pubsub google subscription list
+ Get current deployment
  Success
+ Get the google pubsub
  Success
+ Subscriptions for google:
  - my-google-pubsub

which is my gcr topic

$ hal config pubsub google subscription get my-google-pubsub
+ Get current deployment
  Success
+ Get my-google-pubsub subscription
  Success
+ Subscription my-google-pubsub:
GoogleSubscription(super=Subscription(name=my-google-pubsub), project=esl-cicd-prod, subscriptionName=gcr-triggers, jsonPath=/home/spinnaker/.gcp/pubsub-account.json, templatePath=null, ackDeadlineSeconds=10, messageFormat=GCR)

When I try to create a second topic, it says “More than one subscription supplied”

$ hal config pubsub google subscription add my-google-pubsub-gcs     --subscription-name      --json-path /home/spinnaker/.gcp/pubsub-account.json     --project esl-cicd-prod     --message-format GCS
! ERROR More than one subscription supplied

My question, is it only possible for spinnaker to subscribe to one topic, or is this a check in halyard that shouldn’t actually be there?


#2

Hey @Eric_Lugo, is --subscription-name --json-path intentional or a typo? I’m guessing the command parsing framwork is throwing a weird error in response to a key/value flag not having an obvious value (it’s probably parsing the name as --json-path, /home/spinnaker/.gcp/pubsub-account.json.


#3
$ hal config pubsub google subscription add my-google-pubsub-gcs     --subscription-name   gcs-triggers   --json-path /home/spinnaker/.gcp/pubsub-account.json     --project esl-cicd-prod     --message-format GCS

That fixed it, thanks