Open ukulililixl opened 5 years ago
The problem is fixed. I just use ~/.wskprop
and set AUTH
as well as APIHOST
in it. Then I can access openwhisk using the following codes:
client, _ := whisk.NewClient(http.DefaultClient, nil)
options := &whisk.ActionListOptions{
Limit: 30,
Skip: 0,
}
actions, resp, err := client.Actions.List("", options)
New question is, why there is no need to specify something like "--insecure"?
Hello. The first comment shows you’re using http as your app host. Is that correct? If so the insecure option has no effect.
The second comment is puzzling to me as you should be able to use the client without a WskProps file at all.
Hello. The first comment shows you’re using http as your app host. Is that correct? If so the insecure option has no effect.
The second comment is puzzling to me as you should be able to use the client without a WskProps file at all.
For the first comment, when I remove the configuration of Insecure: true
in config
, I get the following error:
Get https://172.17.0.1/api/v1/namespaces/_/actions?limit=30&skip=0: x509: cannot validate certificate for 172.17.0.1 because it doesn't contain any IP SANs
I don't know why it is still trying to access openwhisk via https even if I configure http in Host
.
For the second comment, I try to remove ~/.wskprops
and re-run the program and it fails. It seems that when we create a new client, GetDefaultConfig
is called to load default configurations. I guess this function will load data from ~/.wskprops
by default.
I install openwhisk in ubuntu in my own computer and I can access it using
wsk -i ......
. However, I have problems using this library to access openwhisk.For example: I can run the following command to list all the actions I have created in openwhisk.
wsk -i action list
The output isHowever, when I try to do the same thing in a GO program using this library, something wrong happens. Here are my codes:
The error message is:
I wonder if I did something wrong in the GO program. Thanks!