utils

package
v0.0.0-...-afcdff5 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// OmniURL is the URL for the Omni API
	OmniURL string
	// OmniAuth is the authentication token for the Omni API
	OmniAuth string
)

Functions

func ApplyCluster

func ApplyCluster(environment Environment)

ApplyCluster applies the cluster

func DeleteNodes

func DeleteNodes(name string)

DeleteNodes Deletes for the managed nodes

func DeleteOmniCluster

func DeleteOmniCluster(name string)

DeleteOmniCluster deletes the cluster

func DeleteOmniMachine

func DeleteOmniMachine(name string)

DeleteOmniMachine deletes the machine

func GenerateRandomString

func GenerateRandomString(length int) (string, error)

GenerateRandomString generates a random string

func ListClusters

func ListClusters() ([]string, error)

ListClusters lists the clusters

func Setup

func Setup()

Setup sets up the logging

func WaitForCluster

func WaitForCluster(environment Environment)

WaitForCluster waits for the managed cluster to be ready

func WaitForReady

func WaitForReady(envname string)

WaitForReady waits for the managed nodes to be ready

Types

type Environment

type Environment struct {
	Name                  string
	ControlPlane          string
	Workers               string
	Gpus                  string
	TailScaleClientID     string
	TailScaleClientSecret string
	GitHubToken           string
	Gpu                   bool
}

Environment struct to hold the environment variables

type Machine

type Machine struct {
	Metadata struct {
		ID     string            `json:"id"`
		Labels map[string]string `json:"labels"`
	} `json:"metadata"`
	Spec struct {
		Connected        bool `json:"connected"`
		Platformmetadata struct {
			Hostname     string `json:"hostname"`
			Instanceid   string `json:"instanceid"`
			Instancetype string `json:"instancetype"`
			Platform     string `json:"platform"`
			Providerid   string `json:"providerid"`
			Region       string `json:"region"`
		} `json:"platformmetadata"`
	} `json:"spec"`
}

Machine is the struct for the machine

func FindReadyNodes

func FindReadyNodes(environment string) ([]Machine, error)

FindReadyNodes finds the ready nodes

type Machines

type Machines struct {
	Machines []Machine `json:"machines"`
}

Machines is the struct for the machines

Jump to

Keyboard shortcuts

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