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

Repo bootstrap should fail if cannot commit to repo before creating any resources on the cluster #410

Closed
roi-codefresh opened this issue Jan 11, 2023 · 6 comments · Fixed by #409 or #443
Labels
bug Something isn't working

Comments

@roi-codefresh
Copy link
Contributor

Today if you try to bootstrap on an existing repo without proper write permissions or if the repository has branch protection rules we will only fail when trying to commit the manifests to the repository, which happens after we apply them to the cluster.

We need to fail early to prevent applying things to the cluster when we know we are going to fail to commit them later to the repository.

@roi-codefresh roi-codefresh added the bug Something isn't working label Jan 11, 2023
@roi-codefresh roi-codefresh mentioned this issue Jan 11, 2023
@roi-codefresh roi-codefresh linked a pull request Jan 11, 2023 that will close this issue
@aperullo
Copy link

aperullo commented Mar 17, 2023

@roi-codefresh If I use bootstrap --recover to recover from the repo containing the --app manifests then it still fails because of this check, despite not needing to write anything to the repo. Is there a workaround for this behavior?

@roi-codefresh
Copy link
Contributor Author

@aperullo the --recover flag should run on the installation repo, where you have the bootstrap directory. Are you running it on the correct repository?

Do you mean it should allow to --recover even if you don't have write permissions on that repo because --recover should theoretically not commit anything?

@aperullo
Copy link

aperullo commented Mar 19, 2023

@roi-codefresh thanks for responding. Yes in my case I've already bootstrapped a repo with installation-mode flat. So repo and app are the same repository.

Giving it a token with write repository permission is a security concern for us because the autopilot secret becomes a credential template for the rest of the git source. (Which is still desirable, since we can then add other repos to watch after recover, we just don't want the token to have write permission over all of the git-server).

@roi-codefresh
Copy link
Contributor Author

Got you! I think that makes sense that we wouldn't need to commit anything when recovering. So I guess it we should skip that write permission check there. I will reopen this issue to track and fix this.

Thanks for pointing that out :)

@roi-codefresh roi-codefresh reopened this Mar 19, 2023
@aperullo
Copy link

You're the best! Thank you so much!

@roi-codefresh roi-codefresh linked a pull request Mar 19, 2023 that will close this issue
@roi-codefresh
Copy link
Contributor Author

will be release with version v0.4.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants