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

Whisk Client Refactor including Platform Agnostic Home Dir location #1016

Open
pritidesai opened this issue Nov 28, 2018 · 2 comments
Open

Comments

@pritidesai
Copy link
Member

After go client is upgraded to use platform independent library to determine the home directory (see issue # apache/openwhisk-client-go#108), update whisk deploy to adopt those changes.

Also, @mrutkows and I discovered there is a discrepancy in initializing and creating whisk client object in whisk deploy. There are calls in multiple places which overrides the previous calls.

initConfig at https://github.com/apache/incubator-openwhisk-wskdeploy/blob/master/cmd/root.go#L102 reading .wskprops right when whisk deploy is invoked even before reading manifest file.

Again, while deploying openwhisk assets, new whisk config object is created at https://github.com/apache/incubator-openwhisk-wskdeploy/blob/master/cmd/root.go#L223

The same object is initialized while undeployment at https://github.com/apache/incubator-openwhisk-wskdeploy/blob/master/cmd/root.go#L278 and at https://github.com/apache/incubator-openwhisk-wskdeploy/blob/master/cmd/root.go#L335

Validate whether reading .wskprops in initConfig is of any use and document what is it used for. Discard it if not needed.

@mrutkows
Copy link
Contributor

mrutkows commented Nov 29, 2018

@pritidesai
In regard to the $HOME/~/UserProfile directory … after having slept on the issue, we may need to replicate what CLI has done in wskdeploy… basically I am wrestling with the issue that the go-client (all clients actually) should likely be agnostic of where they are run (OS/platform) … that info should be injected/provided by surrounding tooling (even if it means, for now CLI and wskdeploy must have duplicate/similar code). If indeed the go-client needs to still have some odd way of providing defaults (not injected by tool using it) then it should also use same lib as an import (edited).

With this in mind, both CLI and wskdeploy SHOULD use the same lib., (i.e, the https://github.com/mitchellh/go-homedir) and set default value to include '~' which the lib. will Expand() based upon OS.

I would think that the design should be that any IDE or app using REST directly should instantiate the go-client (or any client) with the values it needs for the target provider in general
that is just good OO design...

IMO, am 99% sure at least wskdeploy should use the same method CLI is using for consistency at least at our “layer” of tooling… and wskdeploy likely should adopt the ENV_ variable as well

@mrutkows
Copy link
Contributor

and of course we need to document the lib. and its MIT license wherever we import (verify in NOTICE file for CLI, wskdeploy and go-client) whenever we implement.

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

No branches or pull requests

2 participants