Skip to content

Commit

Permalink
setup providerconfig secret parse
Browse files Browse the repository at this point in the history
Signed-off-by: I534922 <[email protected]>
  • Loading branch information
jaylevin committed Sep 11, 2023
1 parent b6721d6 commit 669cd04
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions internal/clients/confluent.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ import (
"context"
"encoding/json"

"github.com/crossplane-contrib/provider-confluent/apis/v1beta1"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/pkg/errors"
"github.com/upbound/upjet/pkg/terraform"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/upbound/upjet/pkg/terraform"

"github.com/crossplane-contrib/provider-confluent/apis/v1beta1"
)

const (
// ProviderConfig secret keys
cloudAPIKey = "cloud_api_key"
cloudAPISecret = "cloud_api_secret"

// error messages
errNoProviderConfig = "no providerConfigRef provided"
errGetProviderConfig = "cannot get referenced ProviderConfig"
Expand Down Expand Up @@ -63,10 +65,10 @@ func TerraformSetupBuilder(version, providerSource, providerVersion string) terr
}

// Set credentials in Terraform provider configuration.
/*ps.Configuration = map[string]any{
"username": creds["username"],
"password": creds["password"],
}*/
ps.Configuration = map[string]any{
cloudAPIKey: creds[cloudAPIKey],
cloudAPISecret: creds[cloudAPISecret],
}
return ps, nil
}
}

0 comments on commit 669cd04

Please sign in to comment.