client

package
v0.0.0-...-72a33e8 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a handle for interacting with an rpm-ostree based system.

func NewClient

func NewClient(id string) Client

NewClient creates a new rpm-ostree client. The client identifier should be a short, unique and ideally machine-readable string. This could be as simple as `examplecorp-management-agent`. If you want to be more verbose, you could use a URL, e.g. `https://gitlab.com/examplecorp/management-agent`.

func (*Client) ChangeKernelArguments

func (client *Client) ChangeKernelArguments(toAdd []string, toRemove []string) error

ChangeKernelArguments adjusts the kernel arguments.

func (*Client) ChangePackages

func (client *Client) ChangePackages(toAdd []string, toRemove []string) error

ChangePackages installs or removes packages.

func (*Client) OverrideRemove

func (client *Client) OverrideRemove(toRemove []string, toInstall []string) error

OverrideRemove uninstalls base packages, optionally installing new ones at the same time.

func (*Client) OverrideReset

func (client *Client) OverrideReset(toReset []string, toUninstall []string) error

OverrideRemove drops overrides, optionally uninstalling new ones at the same time.

func (*Client) QueryPreviousDeploymentError

func (client *Client) QueryPreviousDeploymentError() (*string, error)

QueryPreviousDeploymentError searches from an error message

func (*Client) QueryStatus

func (client *Client) QueryStatus() (*Status, error)

QueryStatus loads the current system state.

func (*Client) RebaseToContainerImage

func (client *Client) RebaseToContainerImage(target reference.Reference) error

RebaseToContainerImage switches to the target container image

func (*Client) RebaseToContainerImageAllowUnsigned

func (client *Client) RebaseToContainerImageAllowUnsigned(target reference.Reference) error

RebaseToContainerImageAllowUnsigned switches to the target container image, ignoring lack of image signatures.

func (*Client) RemovePendingDeployment

func (client *Client) RemovePendingDeployment() error

Remove the pending deployment.

func (*Client) RemoveRollbackDeployment

func (client *Client) RemoveRollbackDeployment() error

Remove the rollback deployment.

func (*Client) RpmOstreeVersion

func (client *Client) RpmOstreeVersion() (*VersionData, error)

RpmOstreeVersion returns the running rpm-ostree version number

func (*Client) RpmOstreeVersionEqualOrGreater

func (client *Client) RpmOstreeVersionEqualOrGreater(required string) (bool, error)

RpmOstreeVersionEqualOrGreater checks whether the version of rpm-ostree is new enough.

type Deployment

type Deployment struct {
	ID                                 string                 `json:"id"`
	OSName                             string                 `json:"osname"`
	Serial                             int32                  `json:"serial"`
	BaseChecksum                       *string                `json:"base-checksum"`
	Checksum                           string                 `json:"checksum"`
	Version                            string                 `json:"version"`
	Timestamp                          uint64                 `json:"timestamp"`
	Booted                             bool                   `json:"booted"`
	Pinned                             bool                   `json:"pinned"`
	RegenerateInitramfs                bool                   `json:"regenerate-initramfs"`
	Staged                             bool                   `json:"staged"`
	LiveReplaced                       string                 `json:"live-replaced,omitempty"`
	Origin                             string                 `json:"origin"`
	CustomOrigin                       []string               `json:"custom-origin"`
	ContainerImageReference            string                 `json:"container-image-reference"`
	ContainerImageReferenceDigest      string                 `json:"container-image-reference-digest"`
	Packages                           []string               `json:"packages"`
	RequestedPackages                  []string               `json:"requested-packages"`
	RequestedLocalPackages             []string               `json:"requested-local-packages"`
	RequestedBaseRemovals              []string               `json:"requested-base-removals"`
	RequestedBaseLocalReplacements     []interface{}          `json:"requested-base-local-replacements"`
	RequestedLocalFileOverridePackages []string               `json:"requested-local-file-override-packages"`
	BaseLocalReplacements              []interface{}          `json:"base-local-replacements"`
	Unlocked                           string                 `json:"unlocked"`
	BaseCommitMeta                     map[string]interface{} `json:"base-commit-meta"`
}

Deployment represents a bootable filesystem tree

func (*Deployment) GetBaseChecksum

func (s *Deployment) GetBaseChecksum() string

GetBaseChecksum returns the ostree commit used as a base.

func (*Deployment) RequireContainerImage

func (d *Deployment) RequireContainerImage() (*imgref.OstreeImageReference, error)

Parse the deployment's container image reference.

type Status

type Status struct {
	// Deployments is the list of bootable filesystem trees.
	Deployments []Deployment
	// Transaction is the active transaction, if any.
	Transaction *[]string
}

Status summarizes the current worldview of the rpm-ostree daemon. The deployment list is the primary data.

func (*Status) GetBootedDeployment

func (s *Status) GetBootedDeployment() (*Deployment, error)

GetBootedDeployment finds the booted deployment, or returns an error if none is found.

func (*Status) GetRollbackDeployment

func (s *Status) GetRollbackDeployment() *Deployment

GetRollbackDeployment finds the rollback deployment, or returns nil if none is found.

func (*Status) GetStagedDeployment

func (s *Status) GetStagedDeployment() *Deployment

GetStagedDeployment finds the staged deployment, or returns nil if none is found.

type VersionData

type VersionData struct {
	Version  string   `yaml:"Version"`
	Features []string `yaml:"Features"`
	Git      string   `yaml:"Git"`
}

VersionData represents the static information about rpm-ostree.

Jump to

Keyboard shortcuts

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