cloudinit

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Status

type Status string

Status defines different possible values for the status of cloud-init in an instance.

const (
	// StatusUnknown means that it was impossible to retrieve the status of cloud-init,
	// perhaps because the "cloud-init status" command was not successful.
	StatusUnknown Status = "Unknown"

	// StatusDone means that cloud-init completed successfully.
	StatusDone Status = "Done"

	// StatusRunning means that cloud-init is stil running on the instance.
	StatusRunning Status = "Running"

	// StatusError means that cloud-init failed.
	StatusError Status = "Error"
)

func ParseStatus

func ParseStatus(reader io.Reader) (Status, error)

ParseStatus checks the cloud-init status of an instance. It accepts a reader that fetches the /run/cloud-init/status.json file contents.

ParseStatus returns one of the following:

- (StatusDone, nil) - (StatusRunning, nil) - (StatusError, nil) - (StatusUnknown, <error describing why status is unknown>)

Jump to

Keyboard shortcuts

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