Documentation
¶
Overview ¶
Package client is a generated GoMock package.
Index ¶
- Constants
- Variables
- func ComposeVolumeName(appName, volumeName string) string
- func IsCommandAvailable(cmdName string) bool
- func IsComposeAvailable() bool
- func IsPodmanRootless() bool
- func NewComposeID(input string) string
- func NewFromConfig(config *baseclient.Config, log *log.PrefixLogger, opts ...HTTPClientOption) (*client.ClientWithResponses, error)
- func ParseComposeFromSpec(contents []v1beta1.ApplicationContent) (*common.ComposeSpec, error)
- func ParseComposeSpecFromDir(reader fileio.Reader, dir string) (*common.ComposeSpec, error)
- func ParseQuadletReferencesFromDir(reader fileio.Reader, dir string) (map[string]*common.QuadletReferences, error)
- func ParseQuadletReferencesFromSpec(contents []v1beta1.ApplicationContent) (map[string]*common.QuadletReferences, error)
- func SanitizePodmanLabel(name string) string
- func WithResponseHook(hook ResponseHook) func(ctx context.Context, req *http.Request) error
- type ArtifactInspect
- type ArtifactLayer
- type ArtifactManifest
- type Bootc
- type ClientOption
- type Compose
- type Enrollment
- type HTTPClientOption
- type Journalctl
- type LogOptions
- type Management
- type MockBootc
- func (m *MockBootc) Apply(ctx context.Context) error
- func (m *MockBootc) EXPECT() *MockBootcMockRecorder
- func (m *MockBootc) Status(ctx context.Context) (*container.BootcHost, error)
- func (m *MockBootc) Switch(ctx context.Context, image string) error
- func (m *MockBootc) UsrOverlay(ctx context.Context) error
- type MockBootcMockRecorder
- type MockEnrollment
- func (m *MockEnrollment) CreateEnrollmentRequest(ctx context.Context, req v1beta1.EnrollmentRequest, ...) (*v1beta1.EnrollmentRequest, error)
- func (m *MockEnrollment) EXPECT() *MockEnrollmentMockRecorder
- func (m *MockEnrollment) GetEnrollmentRequest(ctx context.Context, id string, cb ...client.RequestEditorFn) (*v1beta1.EnrollmentRequest, error)
- func (m *MockEnrollment) SetRPCMetricsCallback(cb RPCMetricsCallback)
- type MockEnrollmentMockRecorder
- type MockManagement
- func (m *MockManagement) CreateCertificateSigningRequest(ctx context.Context, csr v1beta1.CertificateSigningRequest, ...) (*v1beta1.CertificateSigningRequest, int, error)
- func (m *MockManagement) EXPECT() *MockManagementMockRecorder
- func (m *MockManagement) GetCertificateSigningRequest(ctx context.Context, name string, rcb ...client.RequestEditorFn) (*v1beta1.CertificateSigningRequest, int, error)
- func (m *MockManagement) GetRenderedDevice(ctx context.Context, name string, params *v1beta1.GetRenderedDeviceParams, ...) (*v1beta1.Device, int, error)
- func (m *MockManagement) PatchDeviceStatus(ctx context.Context, name string, patch v1beta1.PatchRequest, ...) error
- func (m *MockManagement) SetRPCMetricsCallback(cb RPCMetricsCallback)
- func (m *MockManagement) UpdateDeviceStatus(ctx context.Context, name string, device v1beta1.Device, ...) error
- type MockManagementMockRecorder
- func (mr *MockManagementMockRecorder) CreateCertificateSigningRequest(ctx, csr any, rcb ...any) *gomock.Call
- func (mr *MockManagementMockRecorder) GetCertificateSigningRequest(ctx, name any, rcb ...any) *gomock.Call
- func (mr *MockManagementMockRecorder) GetRenderedDevice(ctx, name, params any, rcb ...any) *gomock.Call
- func (mr *MockManagementMockRecorder) PatchDeviceStatus(ctx, name, patch any, rcb ...any) *gomock.Call
- func (mr *MockManagementMockRecorder) SetRPCMetricsCallback(cb any) *gomock.Call
- func (mr *MockManagementMockRecorder) UpdateDeviceStatus(ctx, name, device any, rcb ...any) *gomock.Call
- type OCIDescriptor
- type OCIManifest
- type Podman
- func (p *Podman) ArtifactDigest(ctx context.Context, reference string) (string, error)
- func (p *Podman) ArtifactExists(ctx context.Context, artifact string) bool
- func (p *Podman) Compose() *Compose
- func (p *Podman) Copy(ctx context.Context, src, dst string) error
- func (p *Podman) CopyContainerData(ctx context.Context, image, destPath string) error
- func (p *Podman) CreateVolume(ctx context.Context, name string, labels []string) (string, error)
- func (p *Podman) EnsureArtifactSupport(ctx context.Context) error
- func (p *Podman) EventsSinceCmd(ctx context.Context, events []string, sinceTime string) *exec.Cmd
- func (p *Podman) ExtractArtifact(ctx context.Context, artifact, destination string) (string, error)
- func (p *Podman) GetImageCopyTmpDir(ctx context.Context) (string, error)
- func (p *Podman) ImageDigest(ctx context.Context, image string) (string, error)
- func (p *Podman) ImageExists(ctx context.Context, image string) bool
- func (p *Podman) Inspect(ctx context.Context, image string) (string, error)
- func (p *Podman) InspectArtifactAnnotations(ctx context.Context, reference string) (map[string]string, error)
- func (p *Podman) InspectLabels(ctx context.Context, image string) (map[string]string, error)
- func (p *Podman) InspectVolumeDriver(ctx context.Context, name string) (string, error)
- func (p *Podman) InspectVolumeMount(ctx context.Context, name string) (string, error)
- func (p *Podman) ListNetworks(ctx context.Context, labels []string, filters []string) ([]string, error)
- func (p *Podman) ListPods(ctx context.Context, labels []string) ([]string, error)
- func (p *Podman) ListVolumes(ctx context.Context, labels []string, filters []string) ([]string, error)
- func (p *Podman) Mount(ctx context.Context, image string) (string, error)
- func (p *Podman) Pull(ctx context.Context, image string, opts ...ClientOption) (string, error)
- func (p *Podman) PullArtifact(ctx context.Context, artifact string, opts ...ClientOption) (string, error)
- func (p *Podman) RemoveContainer(ctx context.Context, labels []string) error
- func (p *Podman) RemoveNetworks(ctx context.Context, networks ...string) error
- func (p *Podman) RemovePods(ctx context.Context, pods ...string) error
- func (p *Podman) RemoveVolumes(ctx context.Context, volumes ...string) error
- func (p *Podman) StopContainers(ctx context.Context, labels []string) error
- func (p *Podman) Unmount(ctx context.Context, image string) error
- func (p *Podman) Unshare(ctx context.Context, args ...string) (string, error)
- func (p *Podman) Version(ctx context.Context) (*PodmanVersion, error)
- func (p *Podman) VolumeExists(ctx context.Context, name string) bool
- type PodmanContainerConfig
- type PodmanContainerState
- type PodmanEvent
- type PodmanInspect
- type PodmanVersion
- type PullSecret
- type RPCMetricsCallback
- type RPMOSTree
- func (c *RPMOSTree) Apply(ctx context.Context) error
- func (c *RPMOSTree) RemoveRollback(_ context.Context) error
- func (c *RPMOSTree) RemoveStaged(_ context.Context) error
- func (c *RPMOSTree) Status(_ context.Context) (*container.BootcHost, error)
- func (c *RPMOSTree) Switch(_ context.Context, target string) error
- type ResponseHook
- type RetryTransport
- type Skopeo
- type SystemDUnitListEntry
- type Systemd
- func (s *Systemd) DaemonReload(ctx context.Context) error
- func (s *Systemd) Disable(ctx context.Context, name string) error
- func (s *Systemd) Enable(ctx context.Context, name string) error
- func (s *Systemd) ListJobs(ctx context.Context) ([]SystemdJob, error)
- func (s *Systemd) ListUnitsByMatchPattern(ctx context.Context, matchPatterns []string) ([]SystemDUnitListEntry, error)
- func (s *Systemd) Reboot(ctx context.Context) error
- func (s *Systemd) Reload(ctx context.Context, name string) error
- func (s *Systemd) ResetFailed(ctx context.Context, units ...string) error
- func (s *Systemd) Restart(ctx context.Context, name string) error
- func (s *Systemd) ShowByMatchPattern(ctx context.Context, matchPatterns []string) ([]map[string]string, error)
- func (s *Systemd) Start(ctx context.Context, units ...string) error
- func (s *Systemd) Stop(ctx context.Context, units ...string) error
- type SystemdJob
Constants ¶
const ( ComposeOverrideFilename = "99-compose-flightctl-agent.override.yaml" ComposeDockerProjectLabelKey = "com.docker.compose.project" )
const (
BootcCmd = "bootc"
)
const (
QuadletProjectLabelKey = "io.flightctl.quadlet.project"
)
Variables ¶
var ( BaseComposeFiles = []string{ "docker-compose.yaml", "docker-compose.yml", "podman-compose.yaml", "podman-compose.yml", } OverrideComposeFiles = []string{ "docker-compose.override.yaml", "docker-compose.override.yml", "podman-compose.override.yaml", "podman-compose.override.yml", } )
var ( ErrEmptyResponse = errors.New("empty response") ErrDeviceNotFound = errors.New("device not found - certificate should be wiped and agent restarted") )
var (
ErrNoSystemDUnits = errors.New("no units defined")
)
Functions ¶
func ComposeVolumeName ¶ added in v0.8.1
ComposeVolumeName generates a unique Compose-compatible volume name based on the application and volume names.
func IsCommandAvailable ¶ added in v0.3.0
IsCommandAvailable checks if a command is available in the PATH.
func IsComposeAvailable ¶ added in v0.3.0
func IsComposeAvailable() bool
func IsPodmanRootless ¶ added in v0.3.0
func IsPodmanRootless() bool
func NewComposeID ¶ added in v0.8.1
NewComposeID generates a deterministic, lowercase, DNS-compatible ID with a fixed-length hash suffix.
func NewFromConfig ¶
func NewFromConfig(config *baseclient.Config, log *log.PrefixLogger, opts ...HTTPClientOption) (*client.ClientWithResponses, error)
NewFromConfig returns a new Flight Control API client from the given config.
func ParseComposeFromSpec ¶ added in v0.9.0
func ParseComposeFromSpec(contents []v1beta1.ApplicationContent) (*common.ComposeSpec, error)
ParseComposeSpecFromSpec parses a Compose specification from a slice of inline application content, as used in inline application providers.
func ParseComposeSpecFromDir ¶ added in v0.4.0
ParseComposeSpecFromDir reads a compose spec from the given directory and will perform a merge of the base {docker,podman}-compose.yaml and -override.yaml files.
func ParseQuadletReferencesFromDir ¶ added in v1.0.0
func ParseQuadletReferencesFromDir(reader fileio.Reader, dir string) (map[string]*common.QuadletReferences, error)
ParseQuadletReferencesFromDir reads quadlet specs from the given directory. It returns a map where the key is the filename and the value is the parsed QuadletSpec.
func ParseQuadletReferencesFromSpec ¶ added in v1.0.0
func ParseQuadletReferencesFromSpec(contents []v1beta1.ApplicationContent) (map[string]*common.QuadletReferences, error)
ParseQuadletReferencesFromSpec parses Quadlet specifications from a slice of inline application content. Drop-in overrides are applied to ensure that the specs It returns a map where the key is the filename and the value is the parsed QuadletSpec.
func SanitizePodmanLabel ¶ added in v0.4.0
SanitizePodmanLabel sanitizes a string to be used as a label in Podman. Podman labels must be lowercase and can only contain alpha numeric characters, hyphens, and underscores. Any other characters are replaced with an underscore.
func WithResponseHook ¶ added in v0.10.0
WithResponseHook creates a RequestEditorFn that adds a response hook to the request context The hook will be called before retry decisions are made
Types ¶
type ArtifactInspect ¶ added in v1.0.0
type ArtifactInspect struct {
Manifest ArtifactManifest `json:"Manifest"`
Name string `json:"Name"`
Digest string `json:"Digest"`
}
ArtifactInspect represents the structure of artifact inspect output
type ArtifactLayer ¶ added in v1.0.0
type ArtifactManifest ¶ added in v1.0.0
type ArtifactManifest struct {
Layers []ArtifactLayer `json:"layers"`
}
type Bootc ¶ added in v0.4.0
type Bootc interface {
// Status returns the current bootc status.
Status(ctx context.Context) (*container.BootcHost, error)
// Switch targets a new container image reference to boot.
Switch(ctx context.Context, image string) error
// UsrOverlay adds a transient writable overlayfs on `/usr` that will be discarded on reboot.
UsrOverlay(ctx context.Context) error
// Apply restart or reboot into the new target image.
Apply(ctx context.Context) error
}
type ClientOption ¶ added in v0.4.0
type ClientOption func(*clientOptions)
ClientOption is a functional option for configuring the client.
func Timeout ¶ added in v0.9.0
func Timeout(timeout time.Duration) ClientOption
Timeout sets a custom timeout for the client operation. When defined, this value overrides the default client timeout.
func WithPullSecret ¶ added in v0.5.0
func WithPullSecret(path string) ClientOption
WithPullSecret sets the path to the pull secret. If unset uses the default path for the runtime.
type Compose ¶ added in v0.3.0
type Compose struct {
*Podman
}
func (*Compose) UpFromWorkDir ¶ added in v0.3.0
func (p *Compose) UpFromWorkDir(ctx context.Context, workDir, projectName string, noRecreate bool) error
UpFromWorkDir runs `podman compose up -d` from the given workDir using Compose file layering.
It searches for Compose files in the following order:
- One base file (required), chosen from BaseComposeFiles.
- One standard override file (optional), chosen from OverrideComposeFiles.
- An optional flightctl override file (ComposeOverrideFilename) if present.
The method builds the final compose command by layering the discovered files in order. The noRecreate flag, if true, adds `--no-recreate` to prevent recreating existing containers.
type Enrollment ¶
type Enrollment interface {
SetRPCMetricsCallback(cb RPCMetricsCallback)
CreateEnrollmentRequest(ctx context.Context, req v1beta1.EnrollmentRequest, cb ...client.RequestEditorFn) (*v1beta1.EnrollmentRequest, error)
GetEnrollmentRequest(ctx context.Context, id string, cb ...client.RequestEditorFn) (*v1beta1.EnrollmentRequest, error)
}
Enrollment is client the interface for managing device enrollment.
func NewEnrollment ¶
func NewEnrollment( client *client.ClientWithResponses, cb RPCMetricsCallback, ) Enrollment
type HTTPClientOption ¶ added in v0.10.0
type HTTPClientOption func(*httpClientOptions)
HTTPClientOption is a functional option for configuring the HTTP client
func WithHTTPRetry ¶ added in v0.10.0
func WithHTTPRetry(config poll.Config) HTTPClientOption
WithHTTPRetry configures custom retry settings for the HTTP client
func WithHeader ¶ added in v1.0.0
func WithHeader(key, value string) HTTPClientOption
WithHeader returns an HTTPClientOption that sets the given HTTP header for outgoing requests.
func WithUserAgent ¶ added in v1.0.0
func WithUserAgent() HTTPClientOption
WithUserAgent returns an HTTPClientOption that sets the User-Agent header for outgoing requests using the flightctl-agent version and runtime information.
type Journalctl ¶ added in v1.0.0
type Journalctl struct {
// contains filtered or unexported fields
}
func NewJournalctl ¶ added in v1.0.0
func NewJournalctl(exec executer.Executer) *Journalctl
func (*Journalctl) Logs ¶ added in v1.0.0
func (j *Journalctl) Logs(ctx context.Context, options ...LogOptions) ([]string, error)
type LogOptions ¶ added in v1.0.0
type LogOptions func(*logOptions)
func WithLogSince ¶ added in v1.0.0
func WithLogSince(t time.Time) LogOptions
func WithLogTag ¶ added in v1.0.0
func WithLogTag(tag string) LogOptions
func WithLogUnit ¶ added in v1.0.0
func WithLogUnit(unit string) LogOptions
type Management ¶
type Management interface {
UpdateDeviceStatus(ctx context.Context, name string, device v1beta1.Device, rcb ...client.RequestEditorFn) error
GetRenderedDevice(ctx context.Context, name string, params *v1beta1.GetRenderedDeviceParams, rcb ...client.RequestEditorFn) (*v1beta1.Device, int, error)
PatchDeviceStatus(ctx context.Context, name string, patch v1beta1.PatchRequest, rcb ...client.RequestEditorFn) error
SetRPCMetricsCallback(cb RPCMetricsCallback)
CreateCertificateSigningRequest(ctx context.Context, csr v1beta1.CertificateSigningRequest, rcb ...client.RequestEditorFn) (*v1beta1.CertificateSigningRequest, int, error)
GetCertificateSigningRequest(ctx context.Context, name string, rcb ...client.RequestEditorFn) (*v1beta1.CertificateSigningRequest, int, error)
}
Management is the client interface for managing devices.
func NewManagement ¶
func NewManagement( client *client.ClientWithResponses, cb RPCMetricsCallback, ) Management
type MockBootc ¶ added in v0.4.0
type MockBootc struct {
// contains filtered or unexported fields
}
MockBootc is a mock of Bootc interface.
func NewMockBootc ¶ added in v0.4.0
func NewMockBootc(ctrl *gomock.Controller) *MockBootc
NewMockBootc creates a new mock instance.
func (*MockBootc) EXPECT ¶ added in v0.4.0
func (m *MockBootc) EXPECT() *MockBootcMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockBootcMockRecorder ¶ added in v0.4.0
type MockBootcMockRecorder struct {
// contains filtered or unexported fields
}
MockBootcMockRecorder is the mock recorder for MockBootc.
func (*MockBootcMockRecorder) Apply ¶ added in v0.4.0
func (mr *MockBootcMockRecorder) Apply(ctx any) *gomock.Call
Apply indicates an expected call of Apply.
func (*MockBootcMockRecorder) Status ¶ added in v0.4.0
func (mr *MockBootcMockRecorder) Status(ctx any) *gomock.Call
Status indicates an expected call of Status.
func (*MockBootcMockRecorder) Switch ¶ added in v0.4.0
func (mr *MockBootcMockRecorder) Switch(ctx, image any) *gomock.Call
Switch indicates an expected call of Switch.
func (*MockBootcMockRecorder) UsrOverlay ¶ added in v0.4.0
func (mr *MockBootcMockRecorder) UsrOverlay(ctx any) *gomock.Call
UsrOverlay indicates an expected call of UsrOverlay.
type MockEnrollment ¶
type MockEnrollment struct {
// contains filtered or unexported fields
}
MockEnrollment is a mock of Enrollment interface.
func NewMockEnrollment ¶
func NewMockEnrollment(ctrl *gomock.Controller) *MockEnrollment
NewMockEnrollment creates a new mock instance.
func (*MockEnrollment) CreateEnrollmentRequest ¶
func (m *MockEnrollment) CreateEnrollmentRequest(ctx context.Context, req v1beta1.EnrollmentRequest, cb ...client.RequestEditorFn) (*v1beta1.EnrollmentRequest, error)
CreateEnrollmentRequest mocks base method.
func (*MockEnrollment) EXPECT ¶
func (m *MockEnrollment) EXPECT() *MockEnrollmentMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockEnrollment) GetEnrollmentRequest ¶
func (m *MockEnrollment) GetEnrollmentRequest(ctx context.Context, id string, cb ...client.RequestEditorFn) (*v1beta1.EnrollmentRequest, error)
GetEnrollmentRequest mocks base method.
func (*MockEnrollment) SetRPCMetricsCallback ¶
func (m *MockEnrollment) SetRPCMetricsCallback(cb RPCMetricsCallback)
SetRPCMetricsCallback mocks base method.
type MockEnrollmentMockRecorder ¶
type MockEnrollmentMockRecorder struct {
// contains filtered or unexported fields
}
MockEnrollmentMockRecorder is the mock recorder for MockEnrollment.
func (*MockEnrollmentMockRecorder) CreateEnrollmentRequest ¶
func (mr *MockEnrollmentMockRecorder) CreateEnrollmentRequest(ctx, req any, cb ...any) *gomock.Call
CreateEnrollmentRequest indicates an expected call of CreateEnrollmentRequest.
func (*MockEnrollmentMockRecorder) GetEnrollmentRequest ¶
func (mr *MockEnrollmentMockRecorder) GetEnrollmentRequest(ctx, id any, cb ...any) *gomock.Call
GetEnrollmentRequest indicates an expected call of GetEnrollmentRequest.
func (*MockEnrollmentMockRecorder) SetRPCMetricsCallback ¶
func (mr *MockEnrollmentMockRecorder) SetRPCMetricsCallback(cb any) *gomock.Call
SetRPCMetricsCallback indicates an expected call of SetRPCMetricsCallback.
type MockManagement ¶
type MockManagement struct {
// contains filtered or unexported fields
}
MockManagement is a mock of Management interface.
func NewMockManagement ¶
func NewMockManagement(ctrl *gomock.Controller) *MockManagement
NewMockManagement creates a new mock instance.
func (*MockManagement) CreateCertificateSigningRequest ¶ added in v0.10.0
func (m *MockManagement) CreateCertificateSigningRequest(ctx context.Context, csr v1beta1.CertificateSigningRequest, rcb ...client.RequestEditorFn) (*v1beta1.CertificateSigningRequest, int, error)
CreateCertificateSigningRequest mocks base method.
func (*MockManagement) EXPECT ¶
func (m *MockManagement) EXPECT() *MockManagementMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockManagement) GetCertificateSigningRequest ¶ added in v0.10.0
func (m *MockManagement) GetCertificateSigningRequest(ctx context.Context, name string, rcb ...client.RequestEditorFn) (*v1beta1.CertificateSigningRequest, int, error)
GetCertificateSigningRequest mocks base method.
func (*MockManagement) GetRenderedDevice ¶ added in v0.5.0
func (m *MockManagement) GetRenderedDevice(ctx context.Context, name string, params *v1beta1.GetRenderedDeviceParams, rcb ...client.RequestEditorFn) (*v1beta1.Device, int, error)
GetRenderedDevice mocks base method.
func (*MockManagement) PatchDeviceStatus ¶ added in v0.6.0
func (m *MockManagement) PatchDeviceStatus(ctx context.Context, name string, patch v1beta1.PatchRequest, rcb ...client.RequestEditorFn) error
PatchDeviceStatus mocks base method.
func (*MockManagement) SetRPCMetricsCallback ¶ added in v0.9.0
func (m *MockManagement) SetRPCMetricsCallback(cb RPCMetricsCallback)
SetRPCMetricsCallback mocks base method.
func (*MockManagement) UpdateDeviceStatus ¶
func (m *MockManagement) UpdateDeviceStatus(ctx context.Context, name string, device v1beta1.Device, rcb ...client.RequestEditorFn) error
UpdateDeviceStatus mocks base method.
type MockManagementMockRecorder ¶
type MockManagementMockRecorder struct {
// contains filtered or unexported fields
}
MockManagementMockRecorder is the mock recorder for MockManagement.
func (*MockManagementMockRecorder) CreateCertificateSigningRequest ¶ added in v0.10.0
func (mr *MockManagementMockRecorder) CreateCertificateSigningRequest(ctx, csr any, rcb ...any) *gomock.Call
CreateCertificateSigningRequest indicates an expected call of CreateCertificateSigningRequest.
func (*MockManagementMockRecorder) GetCertificateSigningRequest ¶ added in v0.10.0
func (mr *MockManagementMockRecorder) GetCertificateSigningRequest(ctx, name any, rcb ...any) *gomock.Call
GetCertificateSigningRequest indicates an expected call of GetCertificateSigningRequest.
func (*MockManagementMockRecorder) GetRenderedDevice ¶ added in v0.5.0
func (mr *MockManagementMockRecorder) GetRenderedDevice(ctx, name, params any, rcb ...any) *gomock.Call
GetRenderedDevice indicates an expected call of GetRenderedDevice.
func (*MockManagementMockRecorder) PatchDeviceStatus ¶ added in v0.6.0
func (mr *MockManagementMockRecorder) PatchDeviceStatus(ctx, name, patch any, rcb ...any) *gomock.Call
PatchDeviceStatus indicates an expected call of PatchDeviceStatus.
func (*MockManagementMockRecorder) SetRPCMetricsCallback ¶ added in v0.9.0
func (mr *MockManagementMockRecorder) SetRPCMetricsCallback(cb any) *gomock.Call
SetRPCMetricsCallback indicates an expected call of SetRPCMetricsCallback.
func (*MockManagementMockRecorder) UpdateDeviceStatus ¶
func (mr *MockManagementMockRecorder) UpdateDeviceStatus(ctx, name, device any, rcb ...any) *gomock.Call
UpdateDeviceStatus indicates an expected call of UpdateDeviceStatus.
type OCIDescriptor ¶ added in v1.0.0
type OCIDescriptor struct {
MediaType string `json:"mediaType"`
Digest string `json:"digest"`
Size int64 `json:"size"`
}
OCIDescriptor represents a content descriptor in an OCI manifest
type OCIManifest ¶ added in v1.0.0
type OCIManifest struct {
MediaType string `json:"mediaType"`
ArtifactType string `json:"artifactType,omitempty"`
Config *OCIDescriptor `json:"config,omitempty"`
Manifests json.RawMessage `json:"manifests,omitempty"`
}
OCIManifest represents the minimal OCI manifest structure needed for type detection
type Podman ¶ added in v0.3.0
type Podman struct {
// contains filtered or unexported fields
}
func NewPodman ¶ added in v0.3.0
func NewPodman(log *log.PrefixLogger, exec executer.Executer, readWriter fileio.ReadWriter, backoff poll.Config) *Podman
func (*Podman) ArtifactDigest ¶ added in v1.0.0
ArtifactDigest returns the digest of the specified artifact.
func (*Podman) ArtifactExists ¶ added in v0.9.0
ArtifactExists returns true if the artifact exists in storage otherwise false.
func (*Podman) CopyContainerData ¶ added in v0.6.0
func (*Podman) CreateVolume ¶ added in v0.8.1
func (*Podman) EnsureArtifactSupport ¶ added in v1.0.0
EnsureArtifactSupport verifies the local podman version can execute artifact commands.
func (*Podman) EventsSinceCmd ¶ added in v0.3.0
EventsSinceCmd returns a command to get podman events since the given time. After creating the command, it should be started with exec.Start(). When the events are in sync with the current time a sync event is emitted.
func (*Podman) ExtractArtifact ¶ added in v0.8.1
ExtractArtifact to the given destination, which should be an already existing directory if the artifact contains multiple layers, otherwise podman will extract a single layer in the artifact to the destination path directly as a file.
See https://github.com/opencontainers/image-spec/blob/main/manifest.md#guidelines-for-artifact-usage for details on the expected structure of artifacts. Regular images are considered artifacts by podman due to the intentional looseness of the spec.
func (*Podman) GetImageCopyTmpDir ¶ added in v0.9.0
GetImageCopyTmpDir returns the image copy tmp dir exposed by the podman info API.
func (*Podman) ImageDigest ¶ added in v1.0.0
ImageDigest returns the digest of the specified image. Returns empty string and error if the image does not exist or cannot be inspected.
func (*Podman) ImageExists ¶ added in v0.3.0
func (*Podman) Inspect ¶ added in v0.3.0
Inspect returns the JSON output of the image inspection. The expectation is that the image exists in local container storage.
func (*Podman) InspectArtifactAnnotations ¶ added in v1.0.0
func (p *Podman) InspectArtifactAnnotations(ctx context.Context, reference string) (map[string]string, error)
InspectArtifactAnnotations inspects an OCI artifact and returns its annotations map.
func (*Podman) InspectLabels ¶ added in v0.3.0
func (*Podman) InspectVolumeDriver ¶ added in v1.0.0
func (*Podman) InspectVolumeMount ¶ added in v0.8.1
func (*Podman) ListNetworks ¶ added in v0.3.0
func (*Podman) ListVolumes ¶ added in v1.0.0
func (*Podman) Pull ¶ added in v0.3.0
Pull pulls an image from the registry with optional retry and authentication via a pull secret. Logs progress periodically while the operation is in progress.
func (*Podman) PullArtifact ¶ added in v0.8.1
func (p *Podman) PullArtifact(ctx context.Context, artifact string, opts ...ClientOption) (string, error)
PullArtifact pulls an artifact from the registry with optional retry and authentication via a pull secret. Logs progress periodically while the operation is in progress.
func (*Podman) RemoveContainer ¶ added in v0.3.0
func (*Podman) RemoveNetworks ¶ added in v0.3.0
func (*Podman) RemovePods ¶ added in v1.0.0
func (*Podman) RemoveVolumes ¶ added in v0.3.0
func (*Podman) StopContainers ¶ added in v0.3.0
type PodmanContainerConfig ¶ added in v0.6.0
type PodmanContainerState ¶ added in v0.6.0
type PodmanContainerState struct {
OciVersion string `json:"OciVersion"`
Status string `json:"Status"`
Running bool `json:"Running"`
Paused bool `json:"Paused"`
Restarting bool `json:"Restarting"`
OOMKilled bool `json:"OOMKilled"`
Dead bool `json:"Dead"`
Pid int `json:"Pid"`
ExitCode int `json:"ExitCode"`
Error string `json:"Error"`
StartedAt string `json:"StartedAt"`
FinishedAt string `json:"FinishedAt"`
Healthcheck string `json:"Healthcheck"`
}
ContainerState represents the container state part of the podman inspect output
type PodmanEvent ¶ added in v0.6.0
type PodmanEvent struct {
ContainerExitCode int `json:"ContainerExitCode,omitempty"`
ID string `json:"ID"`
Image string `json:"Image"`
Name string `json:"Name"`
Status string `json:"Status"`
Type string `json:"Type"`
TimeNano int64 `json:"timeNano"`
Attributes map[string]string `json:"Attributes"`
}
PodmanEvent represents the structure of a podman event as produced via a CLI events command. It should be noted that the CLI represents events differently from libpod. (notably the time properties) https://github.com/containers/podman/blob/main/cmd/podman/system/events.go#L81-L96
type PodmanInspect ¶ added in v0.6.0
type PodmanInspect struct {
Restarts int `json:"RestartCount"`
State PodmanContainerState `json:"State"`
Config PodmanContainerConfig `json:"Config"`
}
PodmanInspect represents the overall structure of podman inspect output
type PodmanVersion ¶ added in v0.8.1
func (PodmanVersion) GreaterOrEqual ¶ added in v0.8.1
func (v PodmanVersion) GreaterOrEqual(major, minor int) bool
type PullSecret ¶ added in v0.9.0
type PullSecret struct {
// Absolute path to the pull secret
Path string
// Cleanup function for temporary files, or no-op
Cleanup func()
}
func ResolvePullSecret ¶ added in v0.9.0
func ResolvePullSecret( log *log.PrefixLogger, rw fileio.ReadWriter, desired *v1beta1.DeviceSpec, authPath string, ) (*PullSecret, bool, error)
ResolvePullSecret returns the image pull secret path, preferring inline spec auth then falling back to on disk. Cleanup removes tmp files generated from inline spec if found and is otherwise a no-op.
type RPCMetricsCallback ¶ added in v0.9.0
RPCMetricsCallback defines the signature for RPC metrics callback functions.
type RPMOSTree ¶ added in v0.4.0
type RPMOSTree struct {
// contains filtered or unexported fields
}
func NewRPMOSTree ¶ added in v0.4.0
NewRPMOSTree creates a new rpm-ostree client.
func (*RPMOSTree) RemoveRollback ¶ added in v0.4.0
func (*RPMOSTree) RemoveStaged ¶ added in v0.4.0
type ResponseHook ¶ added in v0.10.0
ResponseHook is called before retry decision is made Return true to continue with retry logic, false to stop retrying
type RetryTransport ¶ added in v0.10.0
type RetryTransport struct {
// contains filtered or unexported fields
}
func NewRetryTransport ¶ added in v0.10.0
func NewRetryTransport(transport http.RoundTripper, log *log.PrefixLogger, pollConfig poll.Config) *RetryTransport
type Skopeo ¶ added in v1.0.0
type Skopeo struct {
// contains filtered or unexported fields
}
func NewSkopeo ¶ added in v1.0.0
func NewSkopeo(log *log.PrefixLogger, exec executer.Executer, readWriter fileio.ReadWriter) *Skopeo
func (*Skopeo) InspectManifest ¶ added in v1.0.0
func (s *Skopeo) InspectManifest(ctx context.Context, image string, opts ...ClientOption) (*OCIManifest, error)
InspectManifest inspects an OCI image or artifact and returns the deserialized manifest. This is used to determine if a reference is an image or an artifact.
type SystemDUnitListEntry ¶ added in v1.0.0
type Systemd ¶
type Systemd struct {
// contains filtered or unexported fields
}
func NewSystemd ¶
func (*Systemd) ListJobs ¶ added in v0.10.0
func (s *Systemd) ListJobs(ctx context.Context) ([]SystemdJob, error)
ListJobs lists current systemd jobs in progress This is more reliable than is-active for detecting pending shutdown/reboot