utils

package
v0.0.0-...-a6598b8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeserializeToStruct

func DeserializeToStruct(filename string, pointerToStructInstance any) error

DeserializeToStruct deserializes the given file into the given struct. It returns an error if the file is not accessible or if the file does not contain all the necessary fields (those that are marked as mandatory="true" in the struct definition).

func GetVolumeFormat

func GetVolumeFormat(log *base.LogObject, fileLocation string) (config.Format, error)

GetVolumeFormat returns format of the volume

func GetZipArchive

func GetZipArchive(root string, pe types.PatchEnvelopeInfo) (string, error)

GetZipArchive archives list of patch envelopes in a given path and returns full path to zip archive

func LookupDatastoreConfig

func LookupDatastoreConfig(sub pubsub.Subscription, dsID uuid.UUID) (*types.DatastoreConfig, error)

LookupDatastoreConfig get a datastore config based on uuid

func MaybeInsertSha

func MaybeInsertSha(name string, sha string) string

MaybeInsertSha Check if the OCI name does not include an explicit sha and if not return the name with the sha inserted. Note that the sha must be lower case in the OCI reference.

func PkillArgs

func PkillArgs(log *base.LogObject, match string, printOnError bool, kill bool)

PkillArgs does a pkill

func RemoteAccessDisabled

func RemoteAccessDisabled() bool

RemoteAccessDisabled checks if remote access is enabled/disabled by checking if the file /config/remote_access_disabled exists or not.

func RoundToMbytes

func RoundToMbytes(byteCount uint64) uint64

RoundToMbytes - Byts convert to Mbytes with round-off

func UpdateLedManagerConfig

func UpdateLedManagerConfig(log *base.LogObject, count types.LedBlinkCount)

UpdateLedManagerConfig is used by callers to change the behavior or the LED

func WaitForOnboarded

func WaitForOnboarded(ps *pubsub.PubSub, log *base.LogObject, agentName string, warningTime, errorTime time.Duration) error

WaitForOnboarded waits until it receives a types.OnboardingStatus msg with a non-zero UUID

func WaitForUserContainerd

func WaitForUserContainerd(ps *pubsub.PubSub, log *base.LogObject, agentName string, warningTime, errorTime time.Duration) error

WaitForUserContainerd waits until user containerd started

func WaitForVault

func WaitForVault(ps *pubsub.PubSub, log *base.LogObject, agentName string, warningTime, errorTime time.Duration) error

WaitForVault waits until it receives a types.VaultStatus msg, for types.DefaultVaultName and the status does not indicate any error

Types

type Context

type Context struct {
	Initialized bool
}

Context is a helper struct used to pass around in pubsub handlers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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