Documentation ¶
Index ¶
- Constants
- func GetIngressHost(ctx context.Context, cl corev1client.ConfigMapsGetter) (host string, ca []byte, err error)
- func ParseMCPK8sURL(url string) (ctp types.NamespacedName, matches bool)
- func ParseSpacesK8sURL(url string) (base string, ctp types.NamespacedName, matches bool)
- func ToSpacesK8sURL(ingress string, ctp types.NamespacedName) string
- type Profile
- type Redacted
- type TokenType
Constants ¶
const ( NoSpacesContextMsg = "This cluster does not have spaces installed, use `up space init` to install spaces." NoGroupMsg = "The current kubeconfig context does not point to a group, use `up ctx` to select a group." )
Variables ¶
This section is empty.
Functions ¶
func GetIngressHost ¶ added in v0.29.0
func GetIngressHost(ctx context.Context, cl corev1client.ConfigMapsGetter) (host string, ca []byte, err error)
GetIngressHost returns the ingress host of the Spaces cfg points to. If the ingress is not configured, it returns an empty string.
func ParseMCPK8sURL ¶ added in v0.29.0
func ParseMCPK8sURL(url string) (ctp types.NamespacedName, matches bool)
ParseMCPK8sURL attempts to parse a legacy MCP URL and returns the name of the matching control plane if it matches
func ParseSpacesK8sURL ¶ added in v0.29.0
func ParseSpacesK8sURL(url string) (base string, ctp types.NamespacedName, matches bool)
ParseSpacesK8sURL parses a URL and returns the namespace and optionally the controlplane name (if specified).
func ToSpacesK8sURL ¶ added in v0.29.0
func ToSpacesK8sURL(ingress string, ctp types.NamespacedName) string
Types ¶
type Profile ¶
type Profile struct { // ID is the referencable name of the profile. ID string `json:"id,omitempty"` // TokenType is the type of token in the profile. TokenType TokenType `json:"type"` // Session is a session token used to authenticate to Upbound. Session string `json:"session,omitempty"` // Account is the default account to use when this profile is selected. Account string `json:"account,omitempty"` // BaseConfig represent persisted settings for this profile. // For example: // * flags // * environment variables BaseConfig map[string]string `json:"base,omitempty"` }
A Profile is a set of credentials
type Redacted ¶
type Redacted struct {
Profile
}
Redacted embeds a Upbound Profile for the sole purpose of redacting sensitive information.
func (Redacted) MarshalJSON ¶
MarshalJSON overrides the session field with `REDACTED` so as not to leak sensitive information. We're using an explicit copy here instead of updating the underlying Profile struct so as to not modifying the internal state of the struct by accident.