Documentation
¶
Overview ¶
Package spec is a generated GoMock package.
Index ¶
- Variables
- func IsUpdating(current *v1alpha1.RenderedDeviceSpec, desired *v1alpha1.RenderedDeviceSpec) bool
- type Manager
- type MockManager
- func (m *MockManager) CheckOsReconciliation(ctx context.Context) (string, bool, error)
- func (m *MockManager) EXPECT() *MockManagerMockRecorder
- func (m *MockManager) Ensure() error
- func (m *MockManager) GetDesired(ctx context.Context, renderedVersion string) (*v1alpha1.RenderedDeviceSpec, error)
- func (m *MockManager) Initialize() error
- func (m *MockManager) IsOSUpdate() (bool, error)
- func (m *MockManager) IsRollingBack(ctx context.Context) (bool, error)
- func (m *MockManager) PrepareRollback(ctx context.Context) error
- func (m *MockManager) Read(specType Type) (*v1alpha1.RenderedDeviceSpec, error)
- func (m *MockManager) Rollback() error
- func (m *MockManager) SetClient(arg0 client.Management)
- func (m *MockManager) Upgrade() error
- type MockManagerMockRecorder
- func (mr *MockManagerMockRecorder) CheckOsReconciliation(ctx any) *gomock.Call
- func (mr *MockManagerMockRecorder) Ensure() *gomock.Call
- func (mr *MockManagerMockRecorder) GetDesired(ctx, renderedVersion any) *gomock.Call
- func (mr *MockManagerMockRecorder) Initialize() *gomock.Call
- func (mr *MockManagerMockRecorder) IsOSUpdate() *gomock.Call
- func (mr *MockManagerMockRecorder) IsRollingBack(ctx any) *gomock.Call
- func (mr *MockManagerMockRecorder) PrepareRollback(ctx any) *gomock.Call
- func (mr *MockManagerMockRecorder) Read(specType any) *gomock.Call
- func (mr *MockManagerMockRecorder) Rollback() *gomock.Call
- func (mr *MockManagerMockRecorder) SetClient(arg0 any) *gomock.Call
- func (mr *MockManagerMockRecorder) Upgrade() *gomock.Call
- type SpecManager
- func (s *SpecManager) CheckOsReconciliation(ctx context.Context) (string, bool, error)
- func (s *SpecManager) Ensure() error
- func (s *SpecManager) GetDesired(ctx context.Context, currentRenderedVersion string) (*v1alpha1.RenderedDeviceSpec, error)
- func (s *SpecManager) Initialize() error
- func (s *SpecManager) IsOSUpdate() (bool, error)
- func (s *SpecManager) IsRollingBack(ctx context.Context) (bool, error)
- func (s *SpecManager) PrepareRollback(ctx context.Context) error
- func (s *SpecManager) Read(specType Type) (*v1alpha1.RenderedDeviceSpec, error)
- func (s *SpecManager) Rollback() error
- func (s *SpecManager) SetClient(client client.Management)
- func (s *SpecManager) Upgrade() error
- type Type
Constants ¶
This section is empty.
Variables ¶
var ( ErrMissingRenderedSpec = fmt.Errorf("missing rendered spec") ErrReadingRenderedSpec = fmt.Errorf("reading rendered spec") ErrWritingRenderedSpec = fmt.Errorf("writing rendered spec") ErrNoContent = fmt.Errorf("no content") ErrCheckingFileExists = fmt.Errorf("checking if file exists") ErrUnmarshalSpec = fmt.Errorf("unmarshalling spec") ErrGettingBootcStatus = fmt.Errorf("getting current bootc status") )
Functions ¶
func IsUpdating ¶
func IsUpdating(current *v1alpha1.RenderedDeviceSpec, desired *v1alpha1.RenderedDeviceSpec) bool
Types ¶
type Manager ¶
type Manager interface {
// Initialize initializes the current, desired and rollback spec files on
// disk. If the files already exist, they are overwritten.
Initialize() error
// Ensure ensures that spec files exist on disk and re initializes them if they do not.
Ensure() error
// Read returns the rendered device spec of the specified type from disk.
Read(specType Type) (*v1alpha1.RenderedDeviceSpec, error)
// Upgrade updates the current rendered spec to the desired rendered spec
// and resets the rollback spec.
Upgrade() error
// IsOSUpdate returns true if an OS update is in progress by checking the current rendered spec.
IsOSUpdate() (bool, error)
// CheckOsReconciliation checks if the booted OS image matches the desired OS image.
CheckOsReconciliation(ctx context.Context) (string, bool, error)
// IsRollingBack returns true if the device is in a rollback state.
IsRollingBack(ctx context.Context) (bool, error)
// PrepareRollback creates a rollback version of the current rendered spec.
PrepareRollback(ctx context.Context) error
// Rollback reverts the device to the state of the rollback rendered spec.
Rollback() error
// SetClient sets the management API client.
SetClient(client.Management)
// GetDesired returns the desired rendered device spec from the management API.
GetDesired(ctx context.Context, renderedVersion string) (*v1alpha1.RenderedDeviceSpec, error)
}
type MockManager ¶
type MockManager struct {
// contains filtered or unexported fields
}
MockManager is a mock of Manager interface.
func NewMockManager ¶
func NewMockManager(ctrl *gomock.Controller) *MockManager
NewMockManager creates a new mock instance.
func (*MockManager) CheckOsReconciliation ¶
CheckOsReconciliation mocks base method.
func (*MockManager) EXPECT ¶
func (m *MockManager) EXPECT() *MockManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockManager) GetDesired ¶
func (m *MockManager) GetDesired(ctx context.Context, renderedVersion string) (*v1alpha1.RenderedDeviceSpec, error)
GetDesired mocks base method.
func (*MockManager) Initialize ¶
func (m *MockManager) Initialize() error
Initialize mocks base method.
func (*MockManager) IsOSUpdate ¶
func (m *MockManager) IsOSUpdate() (bool, error)
IsOSUpdate mocks base method.
func (*MockManager) IsRollingBack ¶
func (m *MockManager) IsRollingBack(ctx context.Context) (bool, error)
IsRollingBack mocks base method.
func (*MockManager) PrepareRollback ¶
func (m *MockManager) PrepareRollback(ctx context.Context) error
PrepareRollback mocks base method.
func (*MockManager) Read ¶
func (m *MockManager) Read(specType Type) (*v1alpha1.RenderedDeviceSpec, error)
Read mocks base method.
func (*MockManager) SetClient ¶
func (m *MockManager) SetClient(arg0 client.Management)
SetClient mocks base method.
type MockManagerMockRecorder ¶
type MockManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockManagerMockRecorder is the mock recorder for MockManager.
func (*MockManagerMockRecorder) CheckOsReconciliation ¶
func (mr *MockManagerMockRecorder) CheckOsReconciliation(ctx any) *gomock.Call
CheckOsReconciliation indicates an expected call of CheckOsReconciliation.
func (*MockManagerMockRecorder) Ensure ¶
func (mr *MockManagerMockRecorder) Ensure() *gomock.Call
Ensure indicates an expected call of Ensure.
func (*MockManagerMockRecorder) GetDesired ¶
func (mr *MockManagerMockRecorder) GetDesired(ctx, renderedVersion any) *gomock.Call
GetDesired indicates an expected call of GetDesired.
func (*MockManagerMockRecorder) Initialize ¶
func (mr *MockManagerMockRecorder) Initialize() *gomock.Call
Initialize indicates an expected call of Initialize.
func (*MockManagerMockRecorder) IsOSUpdate ¶
func (mr *MockManagerMockRecorder) IsOSUpdate() *gomock.Call
IsOSUpdate indicates an expected call of IsOSUpdate.
func (*MockManagerMockRecorder) IsRollingBack ¶
func (mr *MockManagerMockRecorder) IsRollingBack(ctx any) *gomock.Call
IsRollingBack indicates an expected call of IsRollingBack.
func (*MockManagerMockRecorder) PrepareRollback ¶
func (mr *MockManagerMockRecorder) PrepareRollback(ctx any) *gomock.Call
PrepareRollback indicates an expected call of PrepareRollback.
func (*MockManagerMockRecorder) Read ¶
func (mr *MockManagerMockRecorder) Read(specType any) *gomock.Call
Read indicates an expected call of Read.
func (*MockManagerMockRecorder) Rollback ¶
func (mr *MockManagerMockRecorder) Rollback() *gomock.Call
Rollback indicates an expected call of Rollback.
func (*MockManagerMockRecorder) SetClient ¶
func (mr *MockManagerMockRecorder) SetClient(arg0 any) *gomock.Call
SetClient indicates an expected call of SetClient.
func (*MockManagerMockRecorder) Upgrade ¶
func (mr *MockManagerMockRecorder) Upgrade() *gomock.Call
Upgrade indicates an expected call of Upgrade.
type SpecManager ¶
type SpecManager struct {
// contains filtered or unexported fields
}
Manager is responsible for managing the rendered device spec.
func NewManager ¶
func NewManager( deviceName string, dataDir string, deviceReadWriter fileio.ReadWriter, bootcClient container.BootcClient, backoff wait.Backoff, log *log.PrefixLogger, ) *SpecManager
NewManager creates a new device spec manager.
func (*SpecManager) CheckOsReconciliation ¶
func (*SpecManager) Ensure ¶
func (s *SpecManager) Ensure() error
func (*SpecManager) GetDesired ¶
func (s *SpecManager) GetDesired(ctx context.Context, currentRenderedVersion string) (*v1alpha1.RenderedDeviceSpec, error)
func (*SpecManager) Initialize ¶
func (s *SpecManager) Initialize() error
func (*SpecManager) IsOSUpdate ¶
func (s *SpecManager) IsOSUpdate() (bool, error)
func (*SpecManager) IsRollingBack ¶
func (s *SpecManager) IsRollingBack(ctx context.Context) (bool, error)
func (*SpecManager) PrepareRollback ¶
func (s *SpecManager) PrepareRollback(ctx context.Context) error
func (*SpecManager) Read ¶
func (s *SpecManager) Read(specType Type) (*v1alpha1.RenderedDeviceSpec, error)
func (*SpecManager) Rollback ¶
func (s *SpecManager) Rollback() error
func (*SpecManager) SetClient ¶
func (s *SpecManager) SetClient(client client.Management)
func (*SpecManager) Upgrade ¶
func (s *SpecManager) Upgrade() error