Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store operator license key in the operator secret #34

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions k8s/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import (
)

const (
tykModePro = "pro"
tykModeKey = "TYK_MODE"
tykAuthKey = "TYK_AUTH"
tykOrgKey = "TYK_ORG"
tykURLKey = "TYK_URL"
tykModePro = "pro"
tykModeKey = "TYK_MODE"
tykAuthKey = "TYK_AUTH"
tykOrgKey = "TYK_ORG"
tykURLKey = "TYK_URL"
tykOperatorLicenseKey = "TYK_OPERATOR_LICENSEKEY"
)

// BootstrapTykOperatorSecret bootstrap a Kubernetes Secret utilized by Tyk Operator.
Expand All @@ -24,10 +25,11 @@ func (c *Client) BootstrapTykOperatorSecret() error {
}

secretData := map[string][]byte{
tykAuthKey: []byte(c.appArgs.Tyk.Admin.Auth),
tykOrgKey: []byte(c.appArgs.Tyk.Org.ID),
tykModeKey: []byte(tykModePro),
tykURLKey: []byte(c.appArgs.K8s.DashboardSvcUrl),
tykAuthKey: []byte(c.appArgs.Tyk.Admin.Auth),
tykOrgKey: []byte(c.appArgs.Tyk.Org.ID),
tykModeKey: []byte(tykModePro),
tykURLKey: []byte(c.appArgs.K8s.DashboardSvcUrl),
tykOperatorLicenseKey: []byte(c.appArgs.OperatorLicenseKey),
}

objectMeta := metav1.ObjectMeta{Name: c.appArgs.OperatorKubernetesSecretName}
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ type Config struct {
// OperatorKubernetesSecretName corresponds to the Kubernetes secret name that will be created for Tyk Operator.
// Set it to an empty string to disable bootstrapping Kubernetes secret for Tyk Operator.
OperatorKubernetesSecretName string
// OperatorLicenseKey corresponds to Operator license key
OperatorLicenseKey string
// DevPortalKubernetesSecretName corresponds to the Kubernetes secret name that will be created for
// Tyk Developer Portal. Set it to an empty to string to disable bootstrapping Kubernetes
// secret for Tyk Developer Portal.
Expand Down
Loading