Use ksonnet CLI instead of ksonnet libs (#590)#626
Use ksonnet CLI instead of ksonnet libs (#590)#626merenbach merged 12 commits intoargoproj:masterfrom merenbach:590-use-ksonnet-cli
Conversation
util/ksonnet/ksonnet.go
Outdated
There was a problem hiding this comment.
Let's not mix yaml packages, everything else is using ghodss/yaml.
util/ksonnet/ksonnet.go
Outdated
There was a problem hiding this comment.
I still prefer keeping around the ksonnet interface, especially for mocking, and consistency with the helm and kustomize implementations. It can have a reduced method list, but theres value in having it defined as an interface.
Gopkg.toml
Outdated
There was a problem hiding this comment.
Please don't add dependencies here -- it's stated clearly in the comment.
|
@merenbach i blew away my vendor directory, ran dep ensure and was able to build everything. I'm not sure what the problem could be. |
|
@jessesuen that's really interesting! Seems that @dthomson25 and I have some difference between our local setups and yours. I'm using the following Go version: This is installed with Homebrew ( |
util/ksonnet/ksonnet.go
Outdated
There was a problem hiding this comment.
It seems all of the ksonnet methods have been switching to use a new package level ksCmd which accepts the ksonnet root as the first argument. The point of having a method-level ksCmd was so that the callers didn't have to keep passing the root dir. I don't think the package level ksCmd is necessary if the only reason it was made package-level was to be able to run ksonnet version without an app, in which case the KsonnetVersion() function could have been implemented using a throwaway app. e.g.:
ksApp := ksonnetApp{}
ksApp.ksCmd("version")
|
Testing update: am able to do a basic sync on the Ksonnet guestbook. I am also able set a JSON parameter override, e.g.: Also able to override images, e.g.,: Output: |
alexmt
left a comment
There was a problem hiding this comment.
One minor comment. LGTM after fixing it
util/argo/argo.go
Outdated
There was a problem hiding this comment.
Default revision should be set before executing repoClient.GetFile (line 328)
* chore: avoid unnecessary json marshal Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * more tests Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * refactor test to satisfy sonarcloud Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Closes #590.
Major points:
ksonnetAppstruct andKsonnetAppinterface types and replaces with utility functions that accept a root dir path.Other points:
pathlib withfilepathsince we're working with file paths, not just serialized object paths.