From 545091cf2fcbaf0c0dfbb713e464ac612e426524 Mon Sep 17 00:00:00 2001 From: Malte Poll Date: Fri, 17 Mar 2023 09:54:15 +0100 Subject: [PATCH] bootstrapper: insert helm values for OpenStack --- bootstrapper/internal/kubernetes/BUILD.bazel | 1 + bootstrapper/internal/kubernetes/kubernetes.go | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/bootstrapper/internal/kubernetes/BUILD.bazel b/bootstrapper/internal/kubernetes/BUILD.bazel index 368b68196..649fcc861 100644 --- a/bootstrapper/internal/kubernetes/BUILD.bazel +++ b/bootstrapper/internal/kubernetes/BUILD.bazel @@ -18,6 +18,7 @@ go_library( "//internal/cloud/cloudprovider", "//internal/cloud/gcpshared", "//internal/cloud/metadata", + "//internal/cloud/openstack", "//internal/constants", "//internal/deploy/helm", "//internal/kubernetes", diff --git a/bootstrapper/internal/kubernetes/kubernetes.go b/bootstrapper/internal/kubernetes/kubernetes.go index 646c831fb..715c819fa 100644 --- a/bootstrapper/internal/kubernetes/kubernetes.go +++ b/bootstrapper/internal/kubernetes/kubernetes.go @@ -24,6 +24,7 @@ import ( "github.com/edgelesssys/constellation/v2/internal/cloud/azureshared" "github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider" "github.com/edgelesssys/constellation/v2/internal/cloud/gcpshared" + "github.com/edgelesssys/constellation/v2/internal/cloud/openstack" "github.com/edgelesssys/constellation/v2/internal/constants" "github.com/edgelesssys/constellation/v2/internal/deploy/helm" "github.com/edgelesssys/constellation/v2/internal/kubernetes" @@ -507,6 +508,17 @@ func (k *KubeWrapper) setupExtraVals(ctx context.Context, serviceConfig constell "tenantID": creds.TenantID, }, } + case cloudprovider.OpenStack: + creds, err := openstack.AccountKeyFromURI(serviceConfig.cloudServiceAccountURI) + if err != nil { + return nil, err + } + credsIni := creds.CloudINI().String() + extraVals["ccm"] = map[string]any{ + "OpenStack": map[string]any{ + "secretData": credsIni, + }, + } } return extraVals, nil