Skip to content

Commit

Permalink
refactor: rename apiKey -> accessKey
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Apr 22, 2024
1 parent f147570 commit 2977ac4
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
20 changes: 10 additions & 10 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1985,9 +1985,9 @@
},
"Platform": {
"properties": {
"apiKey": {
"$ref": "#/$defs/PlatformAPIKey",
"description": "APIKey defines how vCluster can find the api key used for the platform."
"accessKey": {
"$ref": "#/$defs/PlatformAccessKey",
"description": "AccessKey defines how vCluster can find the access key used for the platform."
},
"name": {
"type": "string",
Expand All @@ -2005,34 +2005,34 @@
"additionalProperties": false,
"type": "object"
},
"PlatformAPIKey": {
"PlatformAccessKey": {
"properties": {
"value": {
"type": "string",
"description": "Value specifies the api key as a regular text value."
},
"secretRef": {
"$ref": "#/$defs/PlatformAPIKeySecretReference",
"description": "SecretRef defines where to find the platform api key. By default vCluster will search in the following locations in this precedence:\n* platform.apiKey.value\n* environment variable called LICENSE\n* secret specified under platform.secret.name\n* secret called \"vcluster-platform-api-key\" in the vCluster namespace"
"$ref": "#/$defs/PlatformAccessKeySecretReference",
"description": "SecretRef defines where to find the platform access key. By default vCluster will search in the following locations in this precedence:\n* platform.apiKey.value\n* environment variable called LICENSE\n* secret specified under platform.secret.name\n* secret called \"vcluster-platform-api-key\" in the vCluster namespace"
}
},
"additionalProperties": false,
"type": "object"
},
"PlatformAPIKeySecretReference": {
"PlatformAccessKeySecretReference": {
"properties": {
"name": {
"type": "string",
"description": "Name is the name of the secret where the platform api key is stored. This defaults to vcluster-platform-api-key if undefined."
"description": "Name is the name of the secret where the platform access key is stored. This defaults to vcluster-platform-api-key if undefined."
},
"namespace": {
"type": "string",
"description": "Namespace defines the namespace where the api key secret should be retrieved from. If this is not equal to the namespace\nwhere the vCluster instance is deployed, you need to make sure vCluster has access to this other namespace."
"description": "Namespace defines the namespace where the access key secret should be retrieved from. If this is not equal to the namespace\nwhere the vCluster instance is deployed, you need to make sure vCluster has access to this other namespace."
}
},
"additionalProperties": false,
"type": "object",
"description": "PlatformAPIKeySecretReference defines where to find the platform api key."
"description": "PlatformAccessKeySecretReference defines where to find the platform access key."
},
"PlatformOwner": {
"properties": {
Expand Down
10 changes: 5 additions & 5 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -844,19 +844,19 @@ experimental:

# Platform holds options for connecting to vCluster Platform.
platform:
# APIKey defines how vCluster can find the api key used for the platform.
apiKey:
# AccessKey defines how vCluster can find the access key used for the platform.
accessKey:
# Value specifies the api key as a regular text value.
value: ""
# SecretRef defines where to find the platform api key. By default vCluster will search in the following locations in this precedence:
# SecretRef defines where to find the platform access key. By default vCluster will search in the following locations in this precedence:
# * platform.apiKey.value
# * environment variable called LICENSE
# * secret specified under platform.secret.name
# * secret called "vcluster-platform-api-key" in the vCluster namespace
secretRef:
# Name is the name of the secret where the platform api key is stored. This defaults to vcluster-platform-api-key if undefined.
# Name is the name of the secret where the platform access key is stored. This defaults to vcluster-platform-api-key if undefined.
name: ""
# Namespace defines the namespace where the api key secret should be retrieved from. If this is not equal to the namespace
# Namespace defines the namespace where the access key secret should be retrieved from. If this is not equal to the namespace
# where the vCluster instance is deployed, you need to make sure vCluster has access to this other namespace.
namespace: ""

Expand Down
2 changes: 1 addition & 1 deletion cmd/vclusterctl/cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"github.com/loft-sh/log"
"github.com/loft-sh/vcluster/cmd/vclusterctl/cmd/find"
"github.com/loft-sh/vcluster/pkg/cli/find"
"github.com/loft-sh/vcluster/pkg/cli/flags"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion cmd/vclusterctl/cmd/platform/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/loft-sh/log"
"github.com/loft-sh/log/survey"
"github.com/loft-sh/log/terminal"
"github.com/loft-sh/vcluster/cmd/vclusterctl/cmd/find"
"github.com/loft-sh/vcluster/config"
"github.com/loft-sh/vcluster/pkg/cli/find"
"github.com/loft-sh/vcluster/pkg/platform"
"github.com/spf13/cobra"
"k8s.io/client-go/tools/clientcmd"
Expand Down
18 changes: 9 additions & 9 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1651,8 +1651,8 @@ type ExperimentalDeployHelmChart struct {
}

type Platform struct {
// APIKey defines how vCluster can find the api key used for the platform.
APIKey PlatformAPIKey `json:"apiKey,omitempty"`
// AccessKey defines how vCluster can find the access key used for the platform.
AccessKey PlatformAccessKey `json:"accessKey,omitempty"`

// Name is the name of the vCluster instance in the vCluster platform
Name string `json:"name,omitempty"`
Expand All @@ -1672,24 +1672,24 @@ type PlatformOwner struct {
Team string `json:"team,omitempty"`
}

type PlatformAPIKey struct {
type PlatformAccessKey struct {
// Value specifies the api key as a regular text value.
Value string `json:"value,omitempty"`

// SecretRef defines where to find the platform api key. By default vCluster will search in the following locations in this precedence:
// SecretRef defines where to find the platform access key. By default vCluster will search in the following locations in this precedence:
// * platform.apiKey.value
// * environment variable called LICENSE
// * secret specified under platform.secret.name
// * secret called "vcluster-platform-api-key" in the vCluster namespace
SecretRef PlatformAPIKeySecretReference `json:"secretRef,omitempty"`
SecretRef PlatformAccessKeySecretReference `json:"secretRef,omitempty"`
}

// PlatformAPIKeySecretReference defines where to find the platform api key. The secret key name doesn't matter as long as the secret only contains a single key.
type PlatformAPIKeySecretReference struct {
// Name is the name of the secret where the platform api key is stored. This defaults to vcluster-platform-api-key if undefined.
// PlatformAccessKeySecretReference defines where to find the platform access key. The secret key name doesn't matter as long as the secret only contains a single key.
type PlatformAccessKeySecretReference struct {
// Name is the name of the secret where the platform access key is stored. This defaults to vcluster-platform-api-key if undefined.
Name string `json:"name,omitempty"`

// Namespace defines the namespace where the api key secret should be retrieved from. If this is not equal to the namespace
// Namespace defines the namespace where the access key secret should be retrieved from. If this is not equal to the namespace
// where the vCluster instance is deployed, you need to make sure vCluster has access to this other namespace.
Namespace string `json:"namespace,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ experimental:
extraRules: []

platform:
apiKey:
accessKey:
value: ""
secretRef:
name: ""
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/find/find_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/loft-sh/vcluster/cmd/vclusterctl/cmd/find"
"github.com/loft-sh/vcluster/pkg/cli/find"
)

func TestVClusterFromContext(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/config/legacyconfig/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ func convertBaseValues(oldConfig BaseHelm, newConfig *config.Config) error {
newConfig.Pro = oldConfig.Pro
if strings.Contains(oldConfig.ProLicenseSecret, "/") {
splitted := strings.Split(oldConfig.ProLicenseSecret, "/")
newConfig.Platform.APIKey.SecretRef.Namespace = splitted[0]
newConfig.Platform.APIKey.SecretRef.Name = splitted[1]
newConfig.Platform.AccessKey.SecretRef.Namespace = splitted[0]
newConfig.Platform.AccessKey.SecretRef.Name = splitted[1]
} else {
newConfig.Platform.APIKey.SecretRef.Name = oldConfig.ProLicenseSecret
newConfig.Platform.AccessKey.SecretRef.Name = oldConfig.ProLicenseSecret
}

newConfig.Experimental.IsolatedControlPlane.Headless = oldConfig.Headless
Expand Down

0 comments on commit 2977ac4

Please sign in to comment.