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

helm repo source #263

Merged
merged 3 commits into from
Jun 7, 2021
Merged

helm repo source #263

merged 3 commits into from
Jun 7, 2021

Conversation

J-Thompson12
Copy link
Contributor

@J-Thompson12 J-Thompson12 commented Jun 7, 2021

Added ability to add helm manifest through helm repo.

Unit tests and tested myself

Command looks like wego app add . --url=https://grafana.github.io/helm-charts --name=graf1 --chart=loki

pkg/cmdimpl/add.go Outdated Show resolved Hide resolved
if params.HelmRepository != "" {
source, err = generateSourceManifestHelm()
if err != nil {
return wrapError(err, "could not generate source manifest")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be possible to add something here to differentiate this error from the next one (both are the same) ?. Just for easy debugging in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean the error that happens depends on which path you choose. If you are adding a helm repo then you know the error was in helm.

return wrapError(err, "could not generate source manifest")
}
} else {
source, err = generateSourceManifestGit()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huge favor, could you please help me make this function to use the new Chart field instead of Path. When I created it, I used Path but it seems more accurate to use Chart now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked with @jrryjcksn at least on whether or not i should use path. We agreed for helm-repository chart made sense but I didnt really ask about using chart for github.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like Flux asks the user for "chart" in either case so we should probably follow that lead.

Copy link
Contributor

@jrryjcksn jrryjcksn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of nits, otherwise LGTM

Cmd.Flags().StringVar(&params.Path, "path", "./", "Path of files within git repository")
Cmd.Flags().StringVar(&params.Branch, "branch", "main", "Branch to watch within git repository")
Cmd.Flags().StringVar(&params.DeploymentType, "deployment-type", "kustomize", "deployment type [kustomize, helm]")
Cmd.Flags().StringVar(&params.Chart, "chart", "", "Specify chart for --helm-repository source")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this description is no longer accurate (at least the "--" part)

},
}

fluxops.SetFluxHandler(fakeHandler)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a change in the other helm test in my stuff to not set the fake handler directly (using WithOverrides instead) because it leaves the flux handler broken for other tests.

@J-Thompson12 J-Thompson12 merged commit 375aec5 into main Jun 7, 2021
@J-Thompson12 J-Thompson12 mentioned this pull request Jun 9, 2021
4 tasks
@J-Thompson12 J-Thompson12 deleted the helm-release branch July 6, 2021 16:52
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

Successfully merging this pull request may close these issues.

3 participants