metadata

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AWSOIDCDeployServiceInstallMethod

func AWSOIDCDeployServiceInstallMethod() bool

AWSOIDCDeployServiceInstallMethod returns true if the instance was installed using the DeployService action of the AWS OIDC integration. This install method uses Amazon ECS with Fargate deployment method.

Types

type Metadata

type Metadata struct {
	// OS advertises the instance OS ("darwin" or "linux").
	OS string
	// OSVersion advertises the instance OS version (e.g. "ubuntu 22.04").
	OSVersion string
	// HostArchitecture advertises the instance host architecture (e.g. "x86_64" or "arm64").
	HostArchitecture string
	// GlibcVersion advertises the instance glibc version of linux instances (e.g. "2.35").
	GlibcVersion string
	// InstallMethods advertises the install methods used for the instance (e.g. "dockerfile").
	InstallMethods []string
	// ContainerRuntime advertises the container runtime for the instance, if any (e.g. "docker").
	ContainerRuntime string
	// ContainerOrchestrator advertises the container orchestrator for the instance, if any
	// (e.g. "kubernetes-v1.24.8-eks-ffeb93d").
	ContainerOrchestrator string
	// CloudEnvironment advertises the cloud environment for the instance, if any (e.g. "aws").
	CloudEnvironment string
	// CloudMetadata contains extra metadata about the instance's cloud environment, if any.
	CloudMetadata *types.CloudMetadata
}

Metadata contains the instance "system" metadata. We expect each of these values to not change for the lifetime of the instance.

func Get

func Get(ctx context.Context) (*Metadata, error)

Get fetches the instance metadata. The first call can take some time as all metadata will be retrieved. The resulting metadata is cached, so subsequent calls will be fast. The return value of Get might be shared between callers and should not be modified. If the cached metadata is ready, it will be returned successfully even if the context is done.

Jump to

Keyboard shortcuts

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