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

Unable to promote to dev #401

Open
chrislovecnm opened this issue Jun 16, 2022 · 2 comments
Open

Unable to promote to dev #401

chrislovecnm opened this issue Jun 16, 2022 · 2 comments

Comments

@chrislovecnm
Copy link

chrislovecnm commented Jun 16, 2022

I am trying to run jx promote command I am getting error: failed to lazy load the EnvironmentContext: no dev environment in namespace foo.

Do a need unique environments for each namespace I am deploying applications to? Do I need to edit jx requirements to add a different namespace, or the .jx/gitops/source-config.yaml file?

Some examples or more info is appreciated. I read through the documentation for jx promote, and I am confused a bit by the helmfile examples as well, and I am wondering if using a helmfile or other configuration would help.

I am running

jx promote -e dev -n apps --timeout 1h --no-poll --interactive -a jx-python-demo -v 0.0.2

My environments (which I think I need to change)

$ k get environments.jenkins.io
NAME         NAMESPACE       KIND          PROMOTION   ORDER   GIT URL                                          GIT BRANCH
demo         jx-demo         Permanent     Manual      500     https://gitlab.com/foo/foo-demo.git    master
dev          jx              Development   Never               https://gitlab.com/foo/foo-dev.git     master
production   jx-production   Permanent     Manual      500     https://gitlab.com/foo/foo-prod.git    master
staging      jx-staging      Permanent     Manual      100     https://gitlab.com/foo/foo.git   master

Can I run different environments off of the same repo? Also dev, demo, stage and production are on different clusters.

@chrislovecnm
Copy link
Author

So the problem is that you are not allowed to promote to dev. Also we are keying off of the string named dev, which could cause problems.

func envIsPermanent(env *jxcore.EnvironmentConfig) bool {
return env.Key != "dev"
}

Are there any reasons that I should not deploy to dev?

@chrislovecnm chrislovecnm changed the title Promote to various namespaces Unable to promote to dev Jun 21, 2022
@chrislovecnm
Copy link
Author

To get around this I added another environment on the same cluster. I would recommend documenting this.

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

No branches or pull requests

1 participant