Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Trying to see...
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm committed Mar 5, 2024
1 parent 75f1ac9 commit bef94c5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/vcap/vcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package vcap

import (
"bytes"
"fmt"
"os"

"golang.org/x/exp/slices"
Expand Down Expand Up @@ -117,18 +118,19 @@ func GetUserProvidedCredentials(label string) (UserProvidedCredentials, error) {
return nil, errors.Errorf("No credentials found for '%s'", label)
}

func GetS3Credentials(label string) (*CredentialsS3, error) {
func GetS3Credentials(name string) (*CredentialsS3, error) {
var instanceSlice []InstanceS3
err := viper.UnmarshalKey("s3", &instanceSlice)
if err != nil {
logging.Logger.Println("Could not unmarshal aws-rds from VCAP_SERVICES")
logging.Logger.Println("Could not unmarshal s3 from VCAP_SERVICES")
}
for _, instance := range instanceSlice {
if instance.Name == label {
if instance.Name == name {
fmt.Println(instance)
return &instance.Credentials, nil
}
}
return nil, errors.Errorf("No credentials found for '%s'", label)
return nil, errors.Errorf("No credentials found for '%s'", name)
}

func GetRDSCreds(source_db string, dest_db string) (*CredentialsRDS, *CredentialsRDS) {
Expand Down

0 comments on commit bef94c5

Please sign in to comment.