utils

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotInferShoot = errors.New("cannot infer shoot")

ErrCannotInferShoot is an error which is returned when a shoot cannot be inferred from the specified instance name.

Functions

func Decode added in v0.1.14

func Decode(decoder runtime.Decoder, data []byte, into runtime.Object) error

Decode takes a `decoder` and decodes the provided `data` into the provided object. The underlying `into` address is used to assign the decoded object.

func GetProjectsFromDB added in v0.1.8

func GetProjectsFromDB(ctx context.Context) ([]models.Project, error)

GetProjectsFromDB fetches the models.Project items from the database.

func GetSeedsFromDB

func GetSeedsFromDB(ctx context.Context) ([]models.Seed, error)

GetSeedsFromDB fetches the models.Seed items from the database.

func InferShootFromInstanceName added in v0.1.6

func InferShootFromInstanceName(ctx context.Context, name string) (*models.Shoot, error)

InferShootFromInstanceName infers the shoot from a Virtual Machine instance name.

The GCP, AWS and Azure extension providers follow the same naming convention when creating a new Virtual Machine, which is:

Convention: <shoot-namespace>-<worker-pool>-z<zone-index>-<pool-hash>-<vm-hash>

Example: shoot--myproject--myshoot-mypool-z1-abcde-12345

The <pool-hash> and <vm-hash> represent the first 5 bytes from a SHA-256 digest.

Use this utility function to infer shoot details for Virtual Machines provisioned by the GCP, AWS, Azure or OpenStack extensions only.

Types

This section is empty.

Jump to

Keyboard shortcuts

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