Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Can't add app/service to a third environment via kam #140

Closed
keithchong opened this issue Jan 11, 2021 · 3 comments
Closed

Can't add app/service to a third environment via kam #140

keithchong opened this issue Jan 11, 2021 · 3 comments

Comments

@keithchong
Copy link
Contributor

This does not appear to be the same issue as #102

Describe the bug
After running the bootstrap command to create the two environments, dev and stage, with the taxi app already added to dev, I wanted to:

  1. add the taxi app to a new environment called prod.
  2. add the taxi app to the existing environment stage.
    The goal being that in the dev console, I would have the app-taxi app in three environments.

I noticed that the error happens also if step 1 and 2 above were reversed.

The error is:

duplicate source http://github.com/keithchong/taxi.git: environments.prod.apps.app-taxi.services.taxi, environments.stage.apps.app-taxi.services.taxi

To Reproduce
See screenshot below that shows the steps

Expected behavior
I should be able to add the app to the environment with no issue or error.

Screenshots
Here is the output of the kam commands:

kchong@Keiths-MacBook-Pro kamcli % ./kam bootstrap \
  --service-repo-url https://github.com/keithchong/taxi.git \
  --gitops-repo-url https://github.com/keithchong/gitops5.git \
  --image-repo quay.io/keithchong/taxi \
  --dockercfgjson ~/Downloads/keithchong-robot-auth.json \
  --git-host-access-token <myGitAccessToken> \
  --output /Users/kchong/wrh/kamcli/resources5 \
  --push-to-git=true

  
Checking dependencies

 ✓  Checking if Sealed Secrets is installed with the default configuration [720ms]
 ✓  Checking if ArgoCD Operator is installed with the default configuration [935ms]
 ✓  Checking if OpenShift Pipelines Operator is installed with the default configuration [1s]
  
Completing Bootstrap process

 ✓  Authentication tokens encrypted in secrets
 ✓  Pipelines tracker has been configured
 ✓  OpenShift Pipelines resources created
 ✓  Openshift Route for EventListener created
 ✓  Created dev, stage and CICD environments
 ✓  Created repository
 ✓  Bootstrapped OpenShift resources successfully

 Next Steps:
 Please refer to https://github.com/redhat-developer/kam/tree/master/docs to get started.
kchong@Keiths-MacBook-Pro kamcli % ./kam environment add \
  --env-name prod \
  --pipelines-folder /Users/kchong/wrh/kamcli/resources5
 ✓  Created Environment prod successfully.
kchong@Keiths-MacBook-Pro kamcli % ./kam service add \
  --env-name prod \
  --app-name app-taxi \
  --service-name taxi \
  --git-repo-url http://github.com/keithchong/taxi.git \
  --pipelines-folder /Users/kchong/wrh/kamcli/resources5
 ✓  Created Service taxi successfully at environment prod.
kchong@Keiths-MacBook-Pro kamcli % ./kam service add \
  --env-name stage \
  --app-name app-taxi \
  --service-name taxi \
  --git-repo-url http://github.com/keithchong/taxi.git \
  --pipelines-folder /Users/kchong/wrh/kamcli/resources5
 ✗  1 errors occurred:
duplicate source http://github.com/keithchong/taxi.git: environments.prod.apps.app-taxi.services.taxi, environments.stage.apps.app-taxi.services.taxi
@keithchong keithchong changed the title Can't add app/service to a third environment via KAM Can't add app/service to a third environment via kam Jan 12, 2021
@bigkevmcd
Copy link
Contributor

I suspect we could improve that error message, but it's fairly unambiguous.

It feels in some ways like a duplicate of #107 what would you like to happen when you add the same source repo across multiple environments?

Do you want to trigger a build of the application code across all environments in parallel?

@keithchong
Copy link
Contributor Author

Hi Kevin, the OS cluster has just been set up. My goal is to set up the taxi application to be in 3 environments. Is there a different set of kam command sequences that allows me to do this without error? (I couldn't figure that out, outside the description of the Day 2 operations, AFAIK). So, yes, I don't mind if the build of the application code is done in parallel initially. Note that I had to do some manual edits and copy and paste of the generated files to finally get the three environments to show properly in dev console and in ArgoCD.

@bigkevmcd
Copy link
Contributor

I'm going to close this, as we almost always don't want to rebuild images across different images.

That's not to say there aren't a couple of use-cases that don't involve rebuilding for production, but that isn't what this issue is about.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants