utils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HubClusterName   string
	SpokeClusterName string
)

Functions

func AssertConditions

func AssertConditions(conditions []metav1.Condition, expected map[string]metav1.ConditionStatus) error

AssertConditions asserts that a resource's conditions match a set of expected conditions.

func CloneFleetConfig

func CloneFleetConfig(fc *v1alpha1.FleetConfig, dest *v1alpha1.FleetConfig) error

CloneFleetConfig clones a FleetConfig

func CreateKindCluster

func CreateKindCluster(name, kubeconfig string) error

CreateKindCluster creates a kind cluster

func DeleteKindCluster

func DeleteKindCluster(name string) error

DeleteKindCluster deletes a kind cluster

func DevspacePurge

func DevspacePurge(ctx context.Context, kubeconfig, namespace string) error

DevspacePurge purges all resources created by devspace

func DevspaceRunPipeline

func DevspaceRunPipeline(ctx context.Context, kubeconfig, pipeline, namespace string) error

DevspaceRunPipeline runs a devspace pipeline

func GetFleetConfig

func GetFleetConfig(ctx context.Context, kClient client.Client, nn ktypes.NamespacedName) (*v1alpha1.FleetConfig, error)

GetFleetConfig gets a FleetConfig

func GetKindNodeIP

func GetKindNodeIP(clusterName string) (string, error)

GetKindNodeIP extracts a kind cluster's node IP from the kind docker network by cluster name

func GetProjectDir

func GetProjectDir() (string, error)

GetProjectDir returns the project root directory

func GetSupportBundle

func GetSupportBundle(ctx context.Context, kubeconfig, bundleName string) error

GetSupportBundle gets a support bundle from a kind cluster.

func Info

func Info(format string, a ...any)

Info prints an info message to the GinkgoWriter

func NewClient

func NewClient(kubeconfig string, scheme *runtime.Scheme) (client.Client, error)

NewClient creates a new client for the given kubeconfig and scheme

func PatchFleetConfig

func PatchFleetConfig(ctx context.Context, kClient client.Client, original *v1alpha1.FleetConfig, patch *v1alpha1.FleetConfig) error

PatchFleetConfig patches a FleetConfig

func RunCommand

func RunCommand(cmd *exec.Cmd, subdir string, returnOutput bool) ([]byte, error)

RunCommand executes the provided command with various options. - If returnOutput is true, stdout is returned; otherwise, it's piped to GinkgoWriter. - If subdir is not empty, the command is executed in that subdirectory of the project. Stderr is always piped to the GinkgoWriter.

func UpdateFleetConfigFeatureGates

func UpdateFleetConfigFeatureGates(ctx context.Context, kClient client.Client, fc *v1alpha1.FleetConfig, featureGates string) error

UpdateFleetConfigFeatureGates updates a FleetConfig's feature gates

func WarnError

func WarnError(err error, format string, a ...any)

WarnError prints a warning message to the GinkgoWriter

Types

type DockerNetwork

type DockerNetwork struct {
	Containers map[string]struct {
		Name        string `json:"Name"`
		IPv4Address string `json:"IPv4Address"`
	} `json:"Containers"`
}

DockerNetwork represents a subset of the JSON structure from `docker network inspect`

Jump to

Keyboard shortcuts

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