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

Improve template download logic #757

Closed
converge opened this issue Nov 17, 2022 · 5 comments
Closed

Improve template download logic #757

converge opened this issue Nov 17, 2022 · 5 comments
Assignees
Milestone

Comments

@converge
Copy link
Contributor

In order to simplify the logic to download the correct template based on the release, as a Kubefirst user I want to have the following logic to select the current template version:

    // "development" is the default value for kubefirst version
    // ldflag changes this variable configs.K1Version
	if configs.K1Version != "development" {
      // it means its a built/binary, and has a tag like 1.10.6
      // we can use this version(1.10.6) to download the templates
    }

    // if not a built/binary version ->
    // try to use gitops-branch flag, if not provided set gitops-branch to main as default
    // try to use metaphor-branch flag, if not provided set metaphor-branch to main as default

AC1: we unsure it works as expected for local development on (local, cloud github and cloud aws)
AC2: the logic works for local development using go run and using the binary/built version

@converge
Copy link
Contributor Author

implemented

@6za
Copy link
Contributor

6za commented Dec 7, 2022

Fixed the logic above on Release, to support people using LDflags to run using the gitops branch for "non-dev" mode as regular release similar to the way it work for the clouds.

--gitops-branch needs to be available always in the installer not only for "dev-mode" that is limited to some users flow of testing.

Builds with LDFLAGS set should also allow clone from branch. So, AC rules above should suppoort that.

AC X: Support --gitops-branch on all modes of running local installer. not just a sub-set of them.

@6za
Copy link
Contributor

6za commented Dec 7, 2022

Fix in the code provided at: #818

@6za
Copy link
Contributor

6za commented Dec 7, 2022

This mode should run an respect the flag to of gitops-branch if is provided, the branch should be cloned, not the tag:

go build -ldflags="-X github.com/kubefirst/kubefirst/configs.K1Version=1.10.11" .
./kubefirst local --gitops-branch add-ingress-localhost

@6za
Copy link
Contributor

6za commented Dec 7, 2022

The exiting implementation was preventing, developers that use the LDFLAGS to test from branches, as it was assuming that only developers not using LDFLAGs would like to use the branch selection flags, but that should be available always even for built releases.

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