IBM / ibmcloud-storage-volume-lib

A helper ibm cloud storage client library to assist in interacting with IBM Cloud storage. Provides access to key volume lifecycle operations
Apache License 2.0
6 stars 20 forks source link

Recent breaking change in IKS Softlayer config #171

Open depohmel opened 5 years ago

depohmel commented 5 years ago

IKS(Ibm Kubernetes service) recently was switched to use [Softlayer] encryption = true this change broke the current implementation of a https://github.com/IBM/ibmcloud-storage-volume-lib/blob/3ec50135ca49679fa3cb5748615dd7231ebf7f4e/config/config.go

Currently type SoftlayerConfig struct { doesn't support encryption field.

if you trying to use encryption = true you will receive following errors

"level":"info","ts":1568179589.4037242,"caller":"utils/init_provider.go:44","msg":"Block softlayer provider volume registry done!"}
{"level":"info","ts":1568179589.4037993,"caller":"utils/init_provider.go:93","msg":"Provider registration done!!!"}
{"level":"info","ts":1568179589.4038255,"caller":"utils/init_provider.go:133","msg":"Generating generateContextCredentials for ","Provider ID":"SOFTLAYER-BLOCK"}
{"level":"info","ts":1568179589.4038646,"caller":"iam/token_exchange.go:180","msg":"Sending IAM token exchange request"}
{"level":"error","ts":1568179589.823081,"caller":"iam/token_exchange.go:201","msg":"IAM token exchange request failed with message","StatusCode":400,"ErrorMessage:":"Provided API key could not be found","ErrorType:":"BXNIM0415E","Error":{"errorMessage":"Provided API key could not be found","errorCode":"BXNIM0415E","errorDetails":"","requirements":{"error":"","code":""}},"stacktrace":"github.com/IBM/ibmcloud-storage-volume-lib/volume-providers/iam.(*tokenExchangeRequest).sendTokenExchangeRequest\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/volume-providers/iam/token_exchange.go:201\ngithub.com/IBM/ibmcloud-storage-volume-lib/volume-providers/iam.(*tokenExchangeRequest).exchangeForIMSToken.func1\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/volume-providers/iam/token_exchange.go:134\ngithub.com/IBM/ibmcloud-storage-volume-lib/lib/utils.(*ErrorRetrier).ErrorRetry\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/lib/utils/error_utils.go:150\ngithub.com/IBM/ibmcloud-storage-volume-lib/volume-providers/iam.(*tokenExchangeRequest).exchangeForIMSToken\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/volume-providers/iam/token_exchange.go:133\ngithub.com/IBM/ibmcloud-storage-volume-lib/volume-providers/iam.(*tokenExchangeService).ExchangeIAMAPIKeyForIMSToken\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/volume-providers/iam/token_exchange.go:102\ngithub.com/IBM/ibmcloud-storage-volume-lib/volume-providers/auth.(*ContextCredentialsFactory).ForIAMAPIKey\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/volume-providers/auth/ims_token.go:54\ngithub.com/IBM/ibmcloud-storage-volume-lib/provider/utils.GenerateContextCredentials\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/provider/utils/init_provider.go:151\ngithub.com/IBM/ibmcloud-storage-volume-lib/provider/utils.OpenProviderSession\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/provider/utils/init_provider.go:119\ngithub.com/kanisterio/kanister/pkg/blockstorage/ibm.newClient\n\t/go/src/github.com/kanisterio/kanister/pkg/blockstorage/ibm/client.go:100\ngithub.com/kanisterio/kanister/pkg/blockstorage/ibm.(*ClientSuite).TestAPIClient\n\t/go/src/github.com/kanisterio/kanister/pkg/blockstorage/ibm/client_test.go:65\nreflect.Value.call\n\t/usr/local/go/src/reflect/value.go:447\nreflect.Value.Call\n\t/usr/local/go/src/reflect/value.go:308\ngopkg.in/check%2ev1.(*suiteRunner).forkTest.func1\n\t/go/pkg/mod/gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127/check.go:781\ngopkg.in/check%2ev1.(*suiteRunner).forkCall.func1\n\t/go/pkg/mod/gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127/check.go:675"}
{"level":"error","ts":1568179589.8233857,"caller":"auth/ims_token.go:57","msg":"Unable to retrieve IMS credentials from IAM API key","error":"IAM token exchange request failed: Provided API key could not be found","stacktrace":"github.com/IBM/ibmcloud-storage-volume-lib/volume-providers/auth.(*ContextCredentialsFactory).ForIAMAPIKey\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/volume-providers/auth/ims_token.go:57\ngithub.com/IBM/ibmcloud-storage-volume-lib/provider/utils.GenerateContextCredentials\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/provider/utils/init_provider.go:151\ngithub.com/IBM/ibmcloud-storage-volume-lib/provider/utils.OpenProviderSession\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/provider/utils/init_provider.go:119\ngithub.com/kanisterio/kanister/pkg/blockstorage/ibm.newClient\n\t/go/src/github.com/kanisterio/kanister/pkg/blockstorage/ibm/client.go:100\ngithub.com/kanisterio/kanister/pkg/blockstorage/ibm.(*ClientSuite).TestAPIClient\n\t/go/src/github.com/kanisterio/kanister/pkg/blockstorage/ibm/client_test.go:65\nreflect.Value.call\n\t/usr/local/go/src/reflect/value.go:447\nreflect.Value.Call\n\t/usr/local/go/src/reflect/value.go:308\ngopkg.in/check%2ev1.(*suiteRunner).forkTest.func1\n\t/go/pkg/mod/gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127/check.go:781\ngopkg.in/check%2ev1.(*suiteRunner).forkCall.func1\n\t/go/pkg/mod/gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127/check.go:675"}
{"level":"error","ts":1568179589.8235552,"caller":"utils/init_provider.go:126","msg":"Failed to open provider session","error":"IAM token exchange request failed: Provided API key could not be found","Fatal":true,"stacktrace":"github.com/IBM/ibmcloud-storage-volume-lib/provider/utils.OpenProviderSession\n\t/go/pkg/mod/github.com/!i!b!m/ibmcloud-storage-volume-lib@v0.0.0-20190705114640-e7a4b11c618c/provider/utils/init_provider.go:126\ngithub.com/kanisterio/kanister/pkg/blockstorage/ibm.newClient\n\t/go/src/github.com/kanisterio/kanister/pkg/blockstorage/ibm/client.go:100\ngithub.com/kanisterio/kanister/pkg/blockstorage/ibm.(*ClientSuite).TestAPIClient\n\t/go/src/github.com/kanisterio/kanister/pkg/blockstorage/ibm/client_test.go:65\nreflect.Value.call\n\t/usr/local/go/src/reflect/value.go:447\nreflect.Value.Call\n\t/usr/local/go/src/reflect/value.go:308\ngopkg.in/check%2ev1.(*suiteRunner).forkTest.func1\n\t/go/pkg/mod/gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127/check.go:781\ngopkg.in/check%2ev1.(*suiteRunner).forkCall.func1\n\t/go/pkg/mod/gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127/check.go:675"}
Collapse
arahamad-zz commented 5 years ago

@depohmel , this is due to encryption = true and decryption not done by library hence its failing.

We had a discussion with @pramodgavali on the same, he will let you know the process and solution on the same.