From 952e02c06dbc7ab8af5a43d134e45df2927234cf Mon Sep 17 00:00:00 2001 From: travis Date: Tue, 26 Oct 2021 13:34:03 +0530 Subject: [PATCH 1/5] Remove usage of IKS token exchange and container route --- .secrets.baseline | 26 +-- common/auth/factory.go | 8 - common/iam/token_exchange_iks.go | 185 ---------------- common/iam/token_exchange_iks_test.go | 298 -------------------------- etc/libconfig.toml | 7 +- 5 files changed, 10 insertions(+), 514 deletions(-) delete mode 100644 common/iam/token_exchange_iks.go delete mode 100644 common/iam/token_exchange_iks_test.go diff --git a/.secrets.baseline b/.secrets.baseline index 4dddf283..bd0a0521 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.sum|^.secrets.baseline$", "lines": null }, - "generated_at": "2021-10-06T08:20:51Z", + "generated_at": "2021-10-26T08:03:35Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -28,8 +28,12 @@ "name": "CloudantDetector" }, { + "ghe_instance": "github.ibm.com", "name": "GheDetector" }, + { + "name": "GitHubTokenDetector" + }, { "hex_limit": 3, "name": "HexHighEntropyString" @@ -78,15 +82,7 @@ "hashed_secret": "9b1063f01e32a5729e6281b5dc1db55078c4df8d", "is_secret": false, "is_verified": false, - "line_number": 32, - "type": "Secret Keyword", - "verified_result": null - }, - { - "hashed_secret": "27d02fc04a86255089839385ea0785c3f03256cf", - "is_secret": false, - "is_verified": false, - "line_number": 37, + "line_number": 31, "type": "Secret Keyword", "verified_result": null } @@ -157,16 +153,6 @@ "verified_result": null } ], - "etc/libconfig.toml": [ - { - "hashed_secret": "857638591e4d4d006c2069db2ffce07d9b02d608", - "is_secret": false, - "is_verified": false, - "line_number": 9, - "type": "Hex High Entropy String", - "verified_result": null - } - ], "file/provider/provider.go": [ { "hashed_secret": "ffe250680b01d69c9853a97e17675a4f60405e17", diff --git a/common/auth/factory.go b/common/auth/factory.go index 0b0a8349..ce3e0995 100644 --- a/common/auth/factory.go +++ b/common/auth/factory.go @@ -18,7 +18,6 @@ package auth import ( - vpciam "github.com/IBM/ibmcloud-volume-file-vpc/common/iam" vpcfileconfig "github.com/IBM/ibmcloud-volume-file-vpc/file/vpcconfig" "github.com/IBM/ibmcloud-volume-interface/provider/auth" "github.com/IBM/ibmcloud-volume-interface/provider/iam" @@ -32,13 +31,6 @@ func NewVPCContextCredentialsFactory(config *vpcfileconfig.VPCFileConfig) (*auth IamClientSecret: config.VPCConfig.IamClientSecret, } ccf, err := auth.NewContextCredentialsFactory(authConfig) - if config.VPCConfig.IKSTokenExchangePrivateURL != "" { - authIKSConfig := &vpciam.IksAuthConfiguration{ - IamAPIKey: config.VPCConfig.APIKey, - PrivateAPIRoute: config.VPCConfig.IKSTokenExchangePrivateURL, // Only for private cluster - } - ccf.TokenExchangeService, err = vpciam.NewTokenExchangeIKSService(authIKSConfig) - } if err != nil { return nil, err } diff --git a/common/iam/token_exchange_iks.go b/common/iam/token_exchange_iks.go deleted file mode 100644 index 7ff2fbfa..00000000 --- a/common/iam/token_exchange_iks.go +++ /dev/null @@ -1,185 +0,0 @@ -/** - * Copyright 2021 IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Package iam ... -package iam - -import ( - "errors" - "fmt" - "net/http" - "time" - - "github.com/IBM-Cloud/ibm-cloud-cli-sdk/common/rest" - "github.com/IBM/ibmcloud-volume-interface/config" - util "github.com/IBM/ibmcloud-volume-interface/lib/utils" - "github.com/IBM/ibmcloud-volume-interface/provider/iam" - "go.uber.org/zap" -) - -// tokenExchangeIKSService ... -type tokenExchangeIKSService struct { - iksAuthConfig *IksAuthConfiguration - httpClient *http.Client -} - -// IksAuthConfiguration ... -type IksAuthConfiguration struct { - PrivateAPIRoute string - IamAPIKey string - CSRFToken string -} - -// TokenExchangeService ... -var _ iam.TokenExchangeService = &tokenExchangeIKSService{} - -// NewTokenExchangeIKSService ... -func NewTokenExchangeIKSService(iksAuthConfig *IksAuthConfiguration) (iam.TokenExchangeService, error) { - httpClient, err := config.GeneralCAHttpClient() - if err != nil { - return nil, err - } - return &tokenExchangeIKSService{ - iksAuthConfig: iksAuthConfig, - httpClient: httpClient, - }, nil -} - -// tokenExchangeIKSRequest ... -type tokenExchangeIKSRequest struct { - tes *tokenExchangeIKSService - request *rest.Request - client *rest.Client - logger *zap.Logger - errorRetrier *util.ErrorRetrier -} - -// tokenExchangeIKSResponse ... -type tokenExchangeIKSResponse struct { - AccessToken string `json:"token"` - //ImsToken string `json:"ims_token"` -} - -// ExchangeRefreshTokenForAccessToken ... -func (tes *tokenExchangeIKSService) ExchangeRefreshTokenForAccessToken(refreshToken string, logger *zap.Logger) (*iam.AccessToken, error) { - r := tes.newTokenExchangeRequest(logger) - return r.exchangeForAccessToken() -} - -// ExchangeIAMAPIKeyForAccessToken ... -func (tes *tokenExchangeIKSService) ExchangeIAMAPIKeyForAccessToken(iamAPIKey string, logger *zap.Logger) (*iam.AccessToken, error) { - r := tes.newTokenExchangeRequest(logger) - return r.exchangeForAccessToken() -} - -// newTokenExchangeRequest ... -func (tes *tokenExchangeIKSService) newTokenExchangeRequest(logger *zap.Logger) *tokenExchangeIKSRequest { - client := rest.NewClient() - client.HTTPClient = tes.httpClient - retyrInterval, _ := time.ParseDuration("3s") - return &tokenExchangeIKSRequest{ - tes: tes, - request: rest.PostRequest(fmt.Sprintf("%s/v1/iam/apikey", tes.iksAuthConfig.PrivateAPIRoute)), - client: client, - logger: logger, - errorRetrier: util.NewErrorRetrier(40, retyrInterval, logger), - } -} - -// ExchangeAccessTokenForIMSToken ... -func (tes *tokenExchangeIKSService) ExchangeAccessTokenForIMSToken(accessToken iam.AccessToken, logger *zap.Logger) (*iam.IMSToken, error) { - return nil, nil -} - -// ExchangeIAMAPIKeyForIMSToken ... -func (tes *tokenExchangeIKSService) ExchangeIAMAPIKeyForIMSToken(iamAPIKey string, logger *zap.Logger) (*iam.IMSToken, error) { - return nil, nil -} - -func (tes *tokenExchangeIKSService) GetIAMAccountIDFromAccessToken(accessToken iam.AccessToken, logger *zap.Logger) (accountID string, err error) { - return "Not required to implement", nil -} - -// exchangeForAccessToken ... -func (r *tokenExchangeIKSRequest) exchangeForAccessToken() (*iam.AccessToken, error) { - var iamResp *tokenExchangeIKSResponse - var err error - err = r.errorRetrier.ErrorRetry(func() (error, bool) { - iamResp, err = r.sendTokenExchangeRequest() - return err, !iam.IsConnectionError(err) // Skip retry if its not connection error - }) - if err != nil { - return nil, err - } - return &iam.AccessToken{Token: iamResp.AccessToken}, nil -} - -// sendTokenExchangeRequest ... -func (r *tokenExchangeIKSRequest) sendTokenExchangeRequest() (*tokenExchangeIKSResponse, error) { - r.logger.Info("In tokenExchangeIKSRequest's sendTokenExchangeRequest()") - // Set headers - r.request = r.request.Add("X-CSRF-TOKEN", r.tes.iksAuthConfig.CSRFToken) - // Setting body - var apikey = struct { - APIKey string `json:"apikey"` - }{ - APIKey: r.tes.iksAuthConfig.IamAPIKey, - } - r.request = r.request.Body(&apikey) - - var successV tokenExchangeIKSResponse - var errorV = struct { - ErrorCode string `json:"code"` - ErrorDescription string `json:"description"` - ErrorType string `json:"type"` - IncidentID string `json:"incidentID"` - }{} - - r.logger.Info("Sending IAM token exchange request to container api server") - resp, err := r.client.Do(r.request, &successV, &errorV) - if err != nil { - r.logger.Error("IAM token exchange request failed", zap.Reflect("Response", resp), zap.Error(err)) - return nil, - util.NewError("ErrorUnclassified", - "IAM token exchange request failed", err) - } - - if resp != nil && resp.StatusCode == 200 { - r.logger.Debug("IAM token exchange request successful") - return &successV, nil - } - // closing resp body only when some issues, in case of success its not required - // to close here - defer resp.Body.Close() - - if errorV.ErrorDescription != "" { - r.logger.Error("IAM token exchange request failed with message", - zap.Int("StatusCode", resp.StatusCode), zap.Reflect("API IncidentID", errorV.IncidentID), - zap.Reflect("Error", errorV)) - - err := util.NewError("ErrorFailedTokenExchange", - "IAM token exchange request failed: "+errorV.ErrorDescription, - errors.New(errorV.ErrorCode+" "+errorV.ErrorType+", Description: "+errorV.ErrorDescription+", API IncidentID:"+errorV.IncidentID)) - return nil, err - } - - r.logger.Error("Unexpected IAM token exchange response", - zap.Int("StatusCode", resp.StatusCode), zap.Reflect("Response", resp)) - - return nil, - util.NewError("ErrorUnclassified", - "Unexpected IAM token exchange response") -} diff --git a/common/iam/token_exchange_iks_test.go b/common/iam/token_exchange_iks_test.go deleted file mode 100644 index b4ed71f9..00000000 --- a/common/iam/token_exchange_iks_test.go +++ /dev/null @@ -1,298 +0,0 @@ -/** - * Copyright 2021 IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Package iam ... -package iam - -import ( - "fmt" - "net/http" - "net/http/httptest" - "os" - "testing" - - "github.com/stretchr/testify/assert" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - - util "github.com/IBM/ibmcloud-volume-interface/lib/utils" - "github.com/IBM/ibmcloud-volume-interface/lib/utils/reasoncode" - "github.com/IBM/ibmcloud-volume-interface/provider/iam" -) - -var ( - mux *http.ServeMux - server *httptest.Server - logger *zap.Logger - lowPriority zap.LevelEnablerFunc - consoleDebugging zapcore.WriteSyncer -) - -func TestMain(m *testing.M) { - // Logging - lowPriority = zap.LevelEnablerFunc(func(lvl zapcore.Level) bool { - return lvl < zapcore.ErrorLevel - }) - consoleDebugging = zapcore.Lock(os.Stdout) - logger = zap.New(zapcore.NewCore(zapcore.NewJSONEncoder(zap.NewDevelopmentEncoderConfig()), consoleDebugging, lowPriority), zap.AddCaller()) - - os.Exit(m.Run()) -} - -func Test_IKSExchangeRefreshTokenForAccessToken_Success(t *testing.T) { - logger := zap.New( - zapcore.NewCore(zapcore.NewJSONEncoder(zap.NewDevelopmentEncoderConfig()), consoleDebugging, lowPriority), - zap.AddCaller(), - ) - httpSetup() - - // IAM endpoint - mux.HandleFunc("/v1/iam/apikey", - func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(200) - fmt.Fprint(w, `{"token": "at_success"}`) - }, - ) - - iksAuthConfig := &IksAuthConfiguration{ - PrivateAPIRoute: server.URL, - } - - tes, err := NewTokenExchangeIKSService(iksAuthConfig) - assert.NoError(t, err) - - r, err := tes.ExchangeRefreshTokenForAccessToken("testrefreshtoken", logger) - assert.Nil(t, err) - if assert.NotNil(t, r) { - assert.Equal(t, (*r).Token, "at_success") - } -} - -func httpSetup() { - // test server - mux = http.NewServeMux() - server = httptest.NewServer(mux) -} - -func Test_IKSExchangeRefreshTokenForAccessToken_FailedDuringRequest(t *testing.T) { - logger := zap.New( - zapcore.NewCore(zapcore.NewJSONEncoder(zap.NewDevelopmentEncoderConfig()), consoleDebugging, lowPriority), - zap.AddCaller(), - ) - - httpSetup() - mux.HandleFunc("/v1/iam/apikey", - func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusUnauthorized) - fmt.Fprint(w, `{"description": "did not work", - "code": "bad news", - "type" : "more details", - "incidentID" : "1000" - }`) - }, - ) - - iksAuthConfig := &IksAuthConfiguration{ - PrivateAPIRoute: server.URL, - } - - tes, err := NewTokenExchangeIKSService(iksAuthConfig) - assert.NoError(t, err) - - r, err := tes.ExchangeRefreshTokenForAccessToken("badrefreshtoken", logger) - assert.Nil(t, r) - if assert.NotNil(t, err) { - assert.Equal(t, "IAM token exchange request failed: did not work", err.Error()) - assert.Equal(t, reasoncode.ReasonCode("ErrorFailedTokenExchange"), util.ErrorReasonCode(err)) - } -} - -func Test_IKSExchangeRefreshTokenForAccessToken_FailedDuringRequest_no_message(t *testing.T) { - logger := zap.New( - zapcore.NewCore(zapcore.NewJSONEncoder(zap.NewDevelopmentEncoderConfig()), consoleDebugging, lowPriority), - zap.AddCaller(), - ) - - httpSetup() - mux.HandleFunc("/v1/iam/apikey", - func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusUnauthorized) - fmt.Fprint(w, `{}`) - }, - ) - - iksAuthConfig := &IksAuthConfiguration{ - PrivateAPIRoute: server.URL, - } - - tes, err := NewTokenExchangeIKSService(iksAuthConfig) - assert.NoError(t, err) - - r, err := tes.ExchangeRefreshTokenForAccessToken("badrefreshtoken", logger) - assert.Nil(t, r) - if assert.NotNil(t, err) { - assert.Equal(t, "Unexpected IAM token exchange response", err.Error()) - assert.Equal(t, reasoncode.ReasonCode("ErrorUnclassified"), util.ErrorReasonCode(err)) - } -} - -func Test_IKSExchangeRefreshTokenForAccessToken_FailedWrongApiUrl(t *testing.T) { - logger := zap.New( - zapcore.NewCore(zapcore.NewJSONEncoder(zap.NewDevelopmentEncoderConfig()), consoleDebugging, lowPriority), - zap.AddCaller(), - ) - - httpSetup() - - mux.HandleFunc("/v1/iam/apikey", - func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusUnauthorized) - fmt.Fprint(w, `{}`) - }, - ) - - iksAuthConfig := &IksAuthConfiguration{ - PrivateAPIRoute: "wrongProtocolURL", - } - - tes, err := NewTokenExchangeIKSService(iksAuthConfig) - assert.NoError(t, err) - - r, err := tes.ExchangeRefreshTokenForAccessToken("testrefreshtoken", logger) - assert.Nil(t, r) - - if assert.NotNil(t, err) { - assert.Equal(t, "IAM token exchange request failed", err.Error()) - assert.Equal(t, reasoncode.ReasonCode("ErrorUnclassified"), util.ErrorReasonCode(err)) - assert.Equal(t, []string{"Post \"wrongProtocolURL/v1/iam/apikey\": unsupported protocol scheme \"\""}, - util.ErrorDeepUnwrapString(err)) - } -} - -func Test_IKSExchangeRefreshTokenForAccessToken_FailedRequesting_unclassified_error(t *testing.T) { - logger := zap.New( - zapcore.NewCore(zapcore.NewJSONEncoder(zap.NewDevelopmentEncoderConfig()), consoleDebugging, lowPriority), - zap.AddCaller(), - ) - - httpSetup() - - mux.HandleFunc("/v1/iam/apikey", - func(w http.ResponseWriter, r *http.Request) { - // Leave response empty - }, - ) - - iksAuthConfig := &iam.AuthConfiguration{ - //PrivateAPIRoute: server.URL, - } - - tes, err := iam.NewTokenExchangeService(iksAuthConfig) - assert.NoError(t, err) - - r, err := tes.ExchangeRefreshTokenForAccessToken("badrefreshtoken", logger) - assert.Nil(t, r) - - if assert.NotNil(t, err) { - assert.Equal(t, "IAM token exchange request failed", err.Error()) - assert.Equal(t, reasoncode.ReasonCode("ErrorUnclassified"), util.ErrorReasonCode(err)) - } -} - -func Test_IKSExchangeIAMAPIKeyForAccessToken(t *testing.T) { - var testCases = []struct { - name string - apiHandler func(w http.ResponseWriter, r *http.Request) - expectedToken string - expectedError *string - expectedReasonCode string - }{ - { - name: "client error", - apiHandler: func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(400) - }, - expectedError: iam.String("IAM token exchange request failed"), - expectedReasonCode: "ErrorUnclassified", - }, - { - name: "success 200", - apiHandler: func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(200) - fmt.Fprint(w, `{ "token": "access_token_123" }`) - }, - expectedToken: "access_token_123", - expectedError: nil, - }, - { - name: "unauthorised", - apiHandler: func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(401) - fmt.Fprint(w, `{"description": "not authorised", - "code": "authorisation", - "type" : "more details", - "incidentID" : "1000" - }`) - }, - expectedError: iam.String("IAM token exchange request failed: not authorised"), - expectedReasonCode: "ErrorFailedTokenExchange", - }, - { - name: "no error message", - apiHandler: func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(400) - fmt.Fprint(w, `{"code" : "ErrorUnclassified", - "incidentID" : "10000" - }`) - }, - expectedError: iam.String("Unexpected IAM token exchange response"), - expectedReasonCode: "ErrorUnclassified", - }, - } - for _, testCase := range testCases { - t.Run(testCase.name, func(t *testing.T) { - logger := zap.New( - zapcore.NewCore(zapcore.NewJSONEncoder(zap.NewDevelopmentEncoderConfig()), consoleDebugging, lowPriority), - zap.AddCaller(), - ) - httpSetup() - - // ResourceController endpoint - mux.HandleFunc("/v1/iam/apikey", testCase.apiHandler) - - iksAuthConfig := &IksAuthConfiguration{ - PrivateAPIRoute: server.URL, - } - - tes, err := NewTokenExchangeIKSService(iksAuthConfig) - assert.NoError(t, err) - - r, actualError := tes.ExchangeIAMAPIKeyForAccessToken("apikey1", logger) - if testCase.expectedError == nil { - assert.NoError(t, actualError) - if assert.NotNil(t, r) { - assert.Equal(t, testCase.expectedToken, r.Token) - } - } else { - if assert.Error(t, actualError) { - assert.Equal(t, *testCase.expectedError, actualError.Error()) - assert.Equal(t, reasoncode.ReasonCode(testCase.expectedReasonCode), util.ErrorReasonCode(actualError)) - } - assert.Nil(t, r) - } - }) - } -} diff --git a/etc/libconfig.toml b/etc/libconfig.toml index 12f8521b..09f2e89f 100644 --- a/etc/libconfig.toml +++ b/etc/libconfig.toml @@ -2,17 +2,18 @@ debug_trace = false [vpc] + iam_client_id = "bx" + iam_client_secret = "" vpc_enabled = true + vpc_volume_type="vpc-share" g2_token_exchange_endpoint_url = "https://iam.bluemix.net" g2_riaas_endpoint_url = "https://us-south.iaas.cloud.ibm.com" g2_riaas_endpoint_private_url = "https://us-south.iaas.cloud.ibm.com" - g2_resource_group_id = "832b3da0130e4a78a2d5a6c62e79a745" + g2_resource_group_id = "" g2_api_key = "" provider_type = "g2" vpc_provider_type = "vpc-share" encryption = false - iks_token_exchange_endpoint_private_url = "https://us-south.containers.cloud.ibm.com" - containers_api_csrf_token = "" max_retry_attempt = 2 # 10 times with exponential re-try with max gap max_retry_gap max_retry_gap = 120 # 2 minutes api_version = "2021-04-24" #"2019-07-02" From 55a8736173f5444e372b606018a23fa3bc64cc47 Mon Sep 17 00:00:00 2001 From: travis Date: Tue, 26 Oct 2021 13:35:09 +0530 Subject: [PATCH 2/5] Remove usage of IKS token exchange and container route --- etc/libconfig.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/libconfig.toml b/etc/libconfig.toml index 09f2e89f..9c22649f 100644 --- a/etc/libconfig.toml +++ b/etc/libconfig.toml @@ -2,7 +2,7 @@ debug_trace = false [vpc] - iam_client_id = "bx" + iam_client_id = "" iam_client_secret = "" vpc_enabled = true vpc_volume_type="vpc-share" From 32c5c8cfeef1923c7ff3d3c755d083ac624c2e95 Mon Sep 17 00:00:00 2001 From: travis Date: Tue, 26 Oct 2021 13:37:00 +0530 Subject: [PATCH 3/5] Remove usage of IKS token exchange and container route --- .secrets.baseline | 1 - 1 file changed, 1 deletion(-) diff --git a/.secrets.baseline b/.secrets.baseline index bd0a0521..a17c225d 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -28,7 +28,6 @@ "name": "CloudantDetector" }, { - "ghe_instance": "github.ibm.com", "name": "GheDetector" }, { From 98b2797b7ec17be838cc594abf7716c7d1c79f86 Mon Sep 17 00:00:00 2001 From: travis Date: Tue, 30 Nov 2021 15:04:29 +0530 Subject: [PATCH 4/5] Remove usage of IKS token exchange and container route --- README.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a048ee1c..99c3f5b0 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,67 @@ [![Coverage](https://github.com/IBM/ibmcloud-volume-file-vpc/blob/gh-pages/coverage/master/badge.svg)](https://github.com/IBM/ibmcloud-volume-file-vpc/tree/gh-pages/coverage/master/cover.html) -This is an implementation of code which is used in file storage from vpc providers for IBM Cloud Kubernetes Service and Red Hat OpenShift on IBM Cloud \ No newline at end of file +This is an implementation of code which is used in file storage from vpc providers for IBM Cloud Kubernetes Service and Red Hat OpenShift on IBM Cloud + +# Build the library + +For building the library `GO` should be installed on the system + +1. On your local machine, install [`Go`](https://golang.org/doc/install). +2. GO version should be >=1.16 +3. Set the [`GOPATH` environment variable](https://github.com/golang/go/wiki/SettingGOPATH). +4. Build the library + + ## Clone the repo or your forked repo + + ``` + $ mkdir -p $GOPATH/src/github.com/IBM + $ cd $GOPATH/src/github.com/IBM/ + $ git clone https://github.com/IBM/ibmcloud-volume-file-vpc.git + $ cd ibmcloud-volume-file-vpc + ``` + ## Build project and runs testcases + + ``` + $ make + + ``` + ## Build test program + + ``` + $ cd cd samples + $ go build + + ``` + +## Testing + +- Test the all the possible operations via sample program this will act as RIAAS client + - `cd samples` + - `./samples` + +# E2E Tests + +Please follow the detail steps [ here ](https://github.com/IBM/ibmcloud-storage-volume-lib/blob/samdev/e2e-final/README.md) + +# How to contribute + +If you have any questions or issues you can create a new issue [ here ](https://github.com/IBM/ibmcloud-volume-file-vpc/issues/new). + +Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example: + +1. Fork the repo + +2. Create your feature branch (git checkout -b my-new-feature) + +3. Commit your changes (git commit -am 'Added some feature') + +4. Push to the branch (git push origin my-new-feature) + +5. Create new Pull Request + +6. Add the test results in the PR + + +# For more details on support of CLI and VPC IAAS layer please refer below documentation +https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-vpc-about \ No newline at end of file From 39471872ca3336655026c7e7d62a63699974c739 Mon Sep 17 00:00:00 2001 From: travis Date: Tue, 30 Nov 2021 15:08:44 +0530 Subject: [PATCH 5/5] Remove usage of IKS token exchange and container route --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99c3f5b0..97f0e604 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ For building the library `GO` should be installed on the system ## Build test program ``` - $ cd cd samples + $ cd samples $ go build ```