-
Notifications
You must be signed in to change notification settings - Fork 265
Add flag to specify alternative default git ref #83
Conversation
@@ -145,6 +145,7 @@ spec: | |||
{{- end }} | |||
- --git-timeout={{ .Values.git.timeout }} | |||
- --git-poll-interval={{ .Values.git.pollInterval }} | |||
- --git-default-chart-ref={{ .Values.git.defaultChartRef }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap this in an if
to maintain backwards compatibility:
{{- if .Values.git.defaultChartRef }}
- --git-default-chart-ref={{ .Values.git.defaultChartRef }}
{{- end }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanprodan sure. Would you prefer the entire PR in one commit, or are you fine with me adding the review changes on top of the original commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One commit is fine, amend your commit and force push it. Thanks
pkg/apis/helm.fluxcd.io/v1/types.go
Outdated
@@ -5,7 +5,7 @@ import ( | |||
"strings" | |||
|
|||
"github.com/ghodss/yaml" | |||
"k8s.io/api/core/v1" | |||
v1 "k8s.io/api/core/v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this alias, it has no effect since it's the same with the package name.
@stefanprodan the changes should be good to go now - thanks for the review. |
@stefanprodan do you have any further updates on this? Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cmd/helm-operator/main.go
Outdated
@@ -112,6 +113,7 @@ func init() { | |||
|
|||
gitTimeout = fs.Duration("git-timeout", 20*time.Second, "duration after which git operations time out") | |||
gitPollInterval = fs.Duration("git-poll-interval", 5*time.Minute, "period on which to poll git chart sources for changes") | |||
gitDefaultChartRef = fs.String("git-default-chart-ref", "master", "ref to clone chart from if ref is unspecified in a HelmRelease") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the length of the flag can be reduced to --git-default-ref
, as the only Git thing the operator does is syncing charts.
Add the `--git-default-ref` flag which enables the modification of the ref used to clone a chart if the `.spec.git.ref` field is unspecified. The original default of `master` is maintained. Related issue: fluxcd#80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @niall-weedon 🥇
No problem @hiddeco, thanks for the review! :) |
Add the
--git-default-chart-ref
flag which enables the modificationof the ref used to clone a chart if the
.spec.git.ref
field isunspecified. The original default of
master
is maintained.Related issue: #80