Skip to content

Commit

Permalink
Check for setting two different source secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilata committed Nov 11, 2015
1 parent 12861c5 commit d0f8b70
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions osbs/build/build_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ def set_secret_for_plugin(self, plugin, secret):
if 'sourceSecret' not in self.template['spec']['source']:
raise OsbsValidationException("JSON template does not allow secrets")

old_secret = self.template['spec']['source']['sourceSecret'].get('name')
if old_secret and old_secret != secret and not old_secret.startswith("{{"):
raise OsbsValidationException("Not possible to set two different source secrets")

self.template['spec']['source']['sourceSecret']['name'] = secret

elif has_plugin_conf:
Expand Down

0 comments on commit d0f8b70

Please sign in to comment.