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

feat(helm): add create command to 'helm dependency' #2041

Closed

Conversation

larryrensing
Copy link
Contributor

@larryrensing larryrensing commented Feb 28, 2017

When 'helm dependency create ' is run, it will create a new dependency in the requirements.yaml of the current chart path. If there is no requirements.yaml found, it will create the file and add the provided dependency to the file. Users can specify a version -v (default: 0.1.0) and a chart path -c (default: current directory)

Closes: #1947

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 28, 2017
@prydonius
Copy link
Member

This is really great, gave it a quick try. Couple of things I noticed:

  • Perhaps the default version should be "> 0" as I got a "could not get a valid version for redis" when I tried it out with specifying the version.
  • Currently creating a dependency with the same name creates a new entry, it would be useful (and perhaps more correct) if it updated the existing one
  • Maybe the command should be called add instead of create, similar to helm repo add?

Copy link
Contributor

@thomastaylor312 thomastaylor312 left a comment

Choose a reason for hiding this comment

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

This looks pretty good. I agree with all of @prydonius' points above. I definitely think the behavior should be to update the version of a chart instead of adding an extra one before we merge. Let me know what you think about the other feedback as well.

}

f := cmd.Flags()
f.StringVarP(&dcc.version, "version", "v", "0.1.0", "set the version")
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to have this get the latest version (like what helm get does)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, after some thought, I agree with you @thomastaylor312. Defaulting 'version' to a value that may not exist in the repository could result in unexpected behavior. I think latest does make sense here.

Copy link
Member

Choose a reason for hiding this comment

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

I think latest can be defined here by > 0

Copy link
Member

Choose a reason for hiding this comment

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

I am going to suggest not using -v for the short flag. Here are all the other cases where we define a --version:

⇒  ag "version" | grep String
fetch.go:87:	f.StringVar(&fch.version, "version", "", "specific version of a chart. Without this, the latest version is fetched")
inspect.go:135:	inspectCommand.Flags().StringVar(&insp.version, verflag, "", verdesc)
inspect.go:136:	valuesSubCmd.Flags().StringVar(&insp.version, verflag, "", verdesc)
inspect.go:137:	chartSubCmd.Flags().StringVar(&insp.version, verflag, "", verdesc)
install.go:173:	f.StringVar(&inst.version, "version", "", "specify the exact chart version to install. If this is not specified, the latest version is installed")
package.go:98:	f.StringVar(&pkg.version, "version", "", "set the version on the chart to this semver version")
upgrade.go:114:	f.StringVar(&upgrade.version, "version", "", "specify the exact chart version to use. If this is not specified, the latest version is used")

We chose not to use -v as a short notation because so many other programs use -v to mean verbose. If we collectively think using -v for version is a good idea, we should change it in all the above places too.

@larryrensing
Copy link
Contributor Author

larryrensing commented Mar 3, 2017

I agree with the updating an existing dependency - i'll add that. With regards to the default version, I chose 0.1.0 because it is the smallest semver version. It can be changed to be any value, but i'd like to get some more input as to what it should be.

Copy link
Contributor

@wilkers-steve wilkers-steve left a comment

Choose a reason for hiding this comment

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

This looks great @larryrensing. Just one comment inline

}

f := cmd.Flags()
f.StringVarP(&dcc.version, "version", "v", "0.1.0", "set the version")
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, after some thought, I agree with you @thomastaylor312. Defaulting 'version' to a value that may not exist in the repository could result in unexpected behavior. I think latest does make sense here.

@technosophos
Copy link
Member

Are we just waiting on the minor change to the --version flag at this point?

When 'helm dependency create <DEP NAME> <REPO>' is run, it will create
a new dependency in the requirements.yaml of the current chart path. If
there is no requirements.yaml found, it will create the file and add the
provided dependency to the file.  Users can specify a version 'v'
(default: 0.1.0) and a chart path -c (default: current directory)

Closes: helm#1947
@prydonius
Copy link
Member

Any thoughts on changing this to add instead of create?

@thomastaylor312
Copy link
Contributor

I think add would be a clearer verb, but I wouldn't have a problem with create either

@technosophos
Copy link
Member

add as a verb gets used in the helm repo * commands to indicate that a repository has been added to the index. That feels like the same sort of operation a user is doing here. So I agree.

@technosophos
Copy link
Member

@larryrensing Any update on this?

@technosophos
Copy link
Member

We're down to the wire on the 2.3.0 release, so I am going to bump this to 2.4.0.

@technosophos technosophos modified the milestones: 2.4.0, 2.3.0 Apr 3, 2017
@technosophos
Copy link
Member

Any word on this one?

@technosophos
Copy link
Member

Can we get a quick rebase of this before 2.4.0?

@technosophos
Copy link
Member

Bumped to 2.5.0. Should I close this out? Is anyone still working on it?

@thomastaylor312
Copy link
Contributor

@technosophos There hasn't been any motion on this for more than 30 days, so I am closing.

@larryrensing if you come back to this, feel free to reopen

MichaelMorrisEst pushed a commit to Nordix/helm that referenced this pull request Nov 17, 2023
helm-diff 3.3.1 adds a new option `HELM_DIFF_THREE_WAY_MERGE=true` which enables the use of there-way merge for diff, which is expected to fix helm#2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. feature in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants