Skip to content

Commit

Permalink
Merge pull request #34 from TykTechnologies/TT-13173/add-operator-lic…
Browse files Browse the repository at this point in the history
…ense-key

Store operator license key in the operator secret
  • Loading branch information
buraksekili authored Oct 3, 2024
2 parents 5fe65db + 161b07c commit 1262c51
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
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

0 comments on commit 1262c51

Please sign in to comment.