Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip creation of products if they are already defined within another portfolio #337

Open
RobBrazier opened this issue Apr 5, 2023 · 0 comments

Comments

@RobBrazier
Copy link
Contributor

Please ensure you are using the latest version and have tried to run a validate command on your source files

As in #335, unfortunately unable to use the latest version - this issue is hopefully the last blocker.

I'm not sure if this is just because it's not recommended configuration, however we are still defining our service catalog configuration via a list of products underneath a portfolio.yaml file

We have a couple of products that are shared between two portfolios - this configuration works up to version 0.88.0, however from 0.89.0 we are seeing

Exception: Product productname defined within portfolioname ./portfolios/portfolioname.yaml has already been declared

Looking at the code, this block is responsible for defining the tasks to create a product - could this be skipped instead of an error being raised if the product is already in that dictionary?
https://github.com/awslabs/aws-service-catalog-factory/blob/master/servicecatalog_factory/commands/task_reference.py#L311-L313

example config:

Schema: factory-2019-04-01
Portfolios:
- DisplayName: Common
  # metadata info
  Components:
    - Name: productname
      # ... rest of product config
- DisplayName: Common-other
  # metadata info
  Components:
    - Name: productname
      # ... rest of product config

I am aware that there's a bunch of duplication here and could have unexpected side effects, however in this case the rest of product config is identical between the two portfolios, so the product would be identical

Also, apologies for being 'that guy', but it did work fine before in 0.88.0, could we just add a warning message to say it's a risk if the component info is different, only one will be picked?

Steps to reproduce

  1. Use portfolio configuration mentioned above
  2. run factory build

Expected results

pipelines created with only pipeline called products--productname-v1-pipeline etc.

Actual results

servicecatalog-factory throws the above error when pipeline is started

Worth noting: for the initial runs as I'm trying to upgrade from a very old version, validation is disabled - I'm unsure whether this would have been picked up by validation in the first place though - probably not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant