utils

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 18 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 CloneHub added in v0.1.0

func CloneHub(hub *v1beta1.Hub, dest *v1beta1.Hub) error

CloneHub clones a Hub

func CloneSpoke added in v0.1.0

func CloneSpoke(spoke *v1beta1.Spoke, dest *v1beta1.Spoke) error

CloneSpoke clones a Spoke

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, profile 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 GetHub added in v0.1.0

func GetHub(ctx context.Context, kClient client.Client, nn ktypes.NamespacedName) (*v1beta1.Hub, error)

GetHub gets a Hub

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 GetSpoke added in v0.1.0

func GetSpoke(ctx context.Context, kClient client.Client, nn ktypes.NamespacedName) (*v1beta1.Spoke, error)

GetSpoke gets a Spoke

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 PatchHub added in v0.1.0

func PatchHub(ctx context.Context, kClient client.Client, original *v1beta1.Hub, patch *v1beta1.Hub) error

PatchHub patches a Hub

func PatchSpoke added in v0.1.0

func PatchSpoke(ctx context.Context, kClient client.Client, original *v1beta1.Spoke, patch *v1beta1.Spoke) error

PatchSpoke patches a Spoke

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 UpdateHubFeatureGates added in v0.1.0

func UpdateHubFeatureGates(ctx context.Context, kClient client.Client, hub *v1beta1.Hub, featureGates string) error

UpdateHubFeatureGates updates a Hub'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