Skip to content

add helm get manifest [RELEASE-NAME] - #369

Open
whipfeng wants to merge 1 commit into
manusa:mainfrom
whipfeng:pullrequest
Open

whipfeng wants to merge 1 commit into
manusa:mainfrom
whipfeng:pullrequest

Conversation

@whipfeng

Copy link
Copy Markdown

Add helm command

@manusa manusa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Pull Request Review: #369

Thanks for contributing helm get manifest, and sorry this sat so long without a review! The command is missing from helm-java today: GetCommand only offers values(). Other helm get subcommands came up in #322, and Helm.get(release).manifest() slots naturally next to values().

The Go side is right. It mirrors GetValues and does what the CLI's helm get manifest does (action.NewGet, an optional Version, then rel.Manifest). The branch is quite far behind main (78 commits), but it applies cleanly on top of current main, and with it the native library builds, go vet passes and the Java sources compile on Java 8. I couldn't exercise it against a cluster.

To get it merged:

1. Tests (required)

The PR adds no tests. The existing get values coverage gives you a template for both layers:

  • Go: add envtest-based tests next to TestGetValues* in native/internal/helm/envtest_test.go. Install a chart, call GetManifest, and assert that the output contains the rendered Deployment / Service. Also cover Revision, KubeConfigContents, and a non-existent release (expect a not found error).
  • Java: add black-box tests through the public API in HelmKubernetesTest, next to the Helm.get(...).values() tests. Cover the latest revision, withRevision, withNamespace, withKubeConfigContents, and the non-existent release case.

2. Project conventions

  • GetManifestOptions.java is missing the Apache 2.0 license header (make license adds it).
  • The new code uses 4-space indentation, while the rest of the codebase uses 2 spaces (GetCommand.java, GetManifestOptions.java). The new manifest() method is also indented one level deeper than values().
  • Please add your @author tag to the Java files you touched (make check-authors).
  • The builder methods' Javadoc is missing @param / @return, unlike the neighbouring GetValuesSubcommand.
  • The commit's author name and email are both =. Could you amend it with your real name and email so the contribution is attributed to you?

3. Docs

The README has a "Get" section with "Get values". A short "Get manifest" entry would document the new API.

Nit

There is a doubled blank line after struct GetManifestOptions in native/main.go.

Once rebased with tests, this should be a nice small addition. Happy to take another look then.

@@ -0,0 +1,27 @@
package com.marcnuri.helm.jni;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This file needs the Apache 2.0 license header, like the other *Options.java files (make license adds it), plus an @author Javadoc tag. Indentation in this project is 2 spaces.

*
* @return the GetManifestSubcommand subcommand.
*/
public GetManifestSubcommand manifest() {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Small style point: this method is indented one level deeper than values() above, and the class uses 4-space indentation where the rest of the codebase uses 2. Please also add @author to the class Javadoc.

* Get the named release with revision.
* If not specified, the latest release is returned.
*/
public GetManifestSubcommand withRevision(int revision) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Could these builder methods get @param / @return tags, like the ones in GetValuesSubcommand?

KubeConfigContents string
}

func GetManifest(options *GetManifestOptions) (string, error) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This matches what helm get manifest does in the CLI. Please add envtest coverage next to TestGetValues* in envtest_test.go: install, then GetManifest, asserting on the rendered resources, plus the revision, kube config contents and non-existent release cases. Add matching Java tests in HelmKubernetesTest, next to the Helm.get(...).values() ones.

Comment thread native/main.go
char* kubeConfigContents;
};


Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Nit: doubled blank line here.

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.

2 participants