Path: blob/main/install/installer/pkg/components/usage/stripe.go
2501 views
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.1/// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package usage56import (7"github.com/gitpod-io/gitpod/installer/pkg/config/v1/experimental"8corev1 "k8s.io/api/core/v1"9"path/filepath"10)1112func getStripeConfig(cfg *experimental.Config) (corev1.Volume, corev1.VolumeMount, string, bool) {13var volume corev1.Volume14var mount corev1.VolumeMount15var path string1617if cfg == nil || cfg.WebApp == nil || cfg.WebApp.Server == nil || cfg.WebApp.Server.StripeSecret == "" {18return volume, mount, path, false19}2021stripeSecret := cfg.WebApp.Server.StripeSecret2223volume = corev1.Volume{24Name: "stripe-secret",25VolumeSource: corev1.VolumeSource{26Secret: &corev1.SecretVolumeSource{27SecretName: stripeSecret,28},29},30}3132mount = corev1.VolumeMount{33Name: "stripe-secret",34MountPath: stripeSecretMountPath,35ReadOnly: true,36}3738path = filepath.Join(stripeSecretMountPath, stripeKeyFilename)3940return volume, mount, path, true41}424344