utils

package
v0.4.0-prerelease.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterExists

func ClusterExists(ctx context.Context, apiClient SKEClient, projectId, clusterName string) (bool, error)

func ConvertToSeconds

func ConvertToSeconds(timeStr string) (*string, error)

ConvertToSeconds converts a time string to seconds. The time string must be in the format of <value><unit>, where unit is one of s, m, h, d, M.

func GetDefaultKubeconfigPath

func GetDefaultKubeconfigPath() (string, error)

GetDefaultKubeconfigPath returns the default location for the kubeconfig file.

func GetDefaultPayload

func GetDefaultPayload(ctx context.Context, apiClient SKEClient) (*ske.CreateOrUpdateClusterPayload, error)

func ProjectEnabled

func ProjectEnabled(ctx context.Context, apiClient SKEClient, projectId string) (bool, error)

func WriteConfigFile

func WriteConfigFile(configPath, data string) error

WriteConfigFile writes the given data to the given path. The directory is created if it does not exist.

Types

type SKEClient

type SKEClient interface {
	GetServiceStatusExecute(ctx context.Context, projectId string) (*ske.ProjectResponse, error)
	ListClustersExecute(ctx context.Context, projectId string) (*ske.ListClustersResponse, error)
	ListProviderOptionsExecute(ctx context.Context) (*ske.ProviderOptions, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL