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

PR always goes to main #834

Closed
7 tasks
steveww opened this issue Oct 5, 2021 · 4 comments
Closed
7 tasks

PR always goes to main #834

steveww opened this issue Oct 5, 2021 · 4 comments

Comments

@steveww
Copy link

steveww commented Oct 5, 2021

Describe the bug
gitops app add --branch foo .
The PR created on GitHub wants to merge to main not foo

Environment

  • gitops: [e.g. v0.1.0]
  • kubernetes: [e.g. 1.20.4]
    • [X ] KinD - version]
    • [X ] k3s - version
    • [ X] cloud [e.g., EKS, AKS] version
    • other - name version
  • Browser + version: [e.g. chrome 74, safari 12, firefox 87]

Affects versions

To Reproduce

Expected behavior
The PR on GitHub should merge to the specified branch e.g. foo.

Config and Logs
If applicable, add logs to help explain your problem. please compress the output before attaching

  • gitops config
  • gitops cli call output (and parameters)
  • gitops-controller logs
  • Events from wego-* namespaces
  • kubectl cluster-info dump
  • Prometheus alerts

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@jpellizzari
Copy link
Contributor

This is working as intended. The --branch flag is for the source repository, not the destination "Config" repo.

@steveww
Copy link
Author

steveww commented Oct 5, 2021

--branch string Branch to watch within git repository (default "main")

So if I want gitops to watch my branch foo I pass it --branch foo. It creates a PR to merge its changes into main. Why not foo? Does it matter that the .wego files are in a different branch to the watched branch?

If it always uses the main branch, is it possible to use one repo with two branches for staging and prod?

@jpellizzari
Copy link
Contributor

So if I want gitops to watch my branch foo I pass it --branch foo

@steveww Correct. The --branch argument only applies to the Source of the manifests. All config files get written to the default branch of the configuration repo.

We do have this issue: #380 , but we are waiting for a larger refactor around the config repo directory structure.

It creates a PR to merge its changes into main. Why not foo?

The configuration repo is separate from the Source repo.

Does it matter that the .wego files are in a different branch to the watched branch?

No, they are (logically) separate repositories in the system.

If it always uses the main branch, is it possible to use one repo with two branches for staging and prod?

They will be treated as two different Applications.

Happy to hop on a call to discuss.

@steveww
Copy link
Author

steveww commented Oct 5, 2021

Thanks for the tips. I think I'm getting the hang of it now.

IMHO the docs could be improved around how it works with the repos and to detail some more advanced use cases.

@steveww steveww closed this as completed Oct 5, 2021
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

2 participants