Documentation ¶
Index ¶
- Variables
- func ApplyOptions(dest any, opts ...Option) error
- func CopyRevision[T Revisioner](dst, src T)
- func DiffStat(diff string, opts ...jsondiff.Options) string
- func GetRevisionFieldIndex[T Revisioner]() int
- func MarshalConfigJson(t proto.Message) []byte
- func RenderJsonDiff[T proto.Message](old, new T, opts jsondiff.Options) (string, bool)
- func SetRevision[T Revisioner](t T, value int64, maybeTimestamp ...time.Time)
- func UnsetRevision[T Revisioner](t T)
- type Action
- type ApplicationState
- func (ApplicationState) Descriptor() protoreflect.EnumDescriptor
- func (x ApplicationState) Enum() *ApplicationState
- func (ApplicationState) EnumDescriptor() ([]byte, []int)deprecated
- func (x ApplicationState) Number() protoreflect.EnumNumber
- func (x ApplicationState) String() string
- func (ApplicationState) Type() protoreflect.EnumType
- type BaseConfigServer
- func (s *BaseConfigServer[R, HR, T]) ConfigurationHistory(ctx context.Context, req *ConfigurationHistoryRequest) (HR, error)
- func (s *BaseConfigServer[R, HR, T]) GetConfiguration(ctx context.Context, in *GetRequest) (T, error)
- func (s *BaseConfigServer[R, HR, T]) GetDefaultConfiguration(ctx context.Context, in *GetRequest) (T, error)
- func (s *BaseConfigServer[R, HR, T]) Install(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- func (s *BaseConfigServer[R, HR, T]) ResetConfiguration(ctx context.Context, in R) (*emptypb.Empty, error)
- func (s *BaseConfigServer[R, HR, T]) ResetDefaultConfiguration(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- func (s *BaseConfigServer[R, HR, T]) SetConfiguration(ctx context.Context, t T) (*emptypb.Empty, error)
- func (s *BaseConfigServer[R, HR, T]) SetDefaultConfiguration(ctx context.Context, t T) (*emptypb.Empty, error)
- func (s *BaseConfigServer[R, HR, T]) Tracker() *DefaultingConfigTracker[T]
- func (s *BaseConfigServer[R, HR, T]) Uninstall(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- type BasicClientInterface
- type BasicServer
- type Client
- type ConfigServer
- type ConfigType
- type ConfigurationHistoryRequest
- func (*ConfigurationHistoryRequest) Descriptor() ([]byte, []int)deprecated
- func (in *ConfigurationHistoryRequest) FlagSet(prefix ...string) *pflag.FlagSet
- func (x *ConfigurationHistoryRequest) GetIncludeValues() bool
- func (x *ConfigurationHistoryRequest) GetRevision() *v1.Revision
- func (x *ConfigurationHistoryRequest) GetTarget() Target
- func (*ConfigurationHistoryRequest) ProtoMessage()
- func (x *ConfigurationHistoryRequest) ProtoReflect() protoreflect.Message
- func (x *ConfigurationHistoryRequest) Reset()
- func (x *ConfigurationHistoryRequest) String() string
- type ConfigurationState
- func (ConfigurationState) Descriptor() protoreflect.EnumDescriptor
- func (x ConfigurationState) Enum() *ConfigurationState
- func (ConfigurationState) EnumDescriptor() ([]byte, []int)deprecated
- func (x ConfigurationState) Number() protoreflect.EnumNumber
- func (x ConfigurationState) String() string
- func (ConfigurationState) Type() protoreflect.EnumType
- type DefaultLoaderFunc
- type DefaultingConfigTracker
- func (ct *DefaultingConfigTracker[T]) ApplyConfig(ctx context.Context, newConfig T) error
- func (ct *DefaultingConfigTracker[T]) DryRun(ctx context.Context, req DryRunRequestType[T]) (*DryRunResults[T], error)
- func (ct *DefaultingConfigTracker[T]) DryRunApplyConfig(ctx context.Context, newConfig T) (DryRunResults[T], error)
- func (ct *DefaultingConfigTracker[T]) DryRunResetConfig(ctx context.Context, mask *fieldmaskpb.FieldMask, patch T, ...) (DryRunResults[T], error)
- func (ct *DefaultingConfigTracker[T]) DryRunResetDefaultConfig(ctx context.Context, atRevision ...*corev1.Revision) (DryRunResults[T], error)
- func (ct *DefaultingConfigTracker[T]) DryRunSetDefaultConfig(ctx context.Context, newDefault T) (DryRunResults[T], error)
- func (ct *DefaultingConfigTracker[T]) GetConfig(ctx context.Context, atRevision ...*corev1.Revision) (T, error)
- func (ct *DefaultingConfigTracker[T]) GetConfigOrDefault(ctx context.Context, atRevision ...*corev1.Revision) (T, error)
- func (ct *DefaultingConfigTracker[T]) GetDefaultConfig(ctx context.Context, atRevision ...*corev1.Revision) (T, error)
- func (ct *DefaultingConfigTracker[T]) History(ctx context.Context, target Target, opts ...storage.HistoryOpt) ([]storage.KeyRevision[T], error)
- func (ct *DefaultingConfigTracker[T]) ResetConfig(ctx context.Context, mask *fieldmaskpb.FieldMask, patch T, ...) error
- func (ct *DefaultingConfigTracker[T]) ResetDefaultConfig(ctx context.Context, atRevision ...*corev1.Revision) error
- func (ct *DefaultingConfigTracker[T]) SetDefaultConfig(ctx context.Context, newDefault T) error
- type Driver
- type DriverBuilder
- type DriverCache
- type DryRunClientInterface
- type DryRunConfigServer
- type DryRunRequestType
- type DryRunResponseType
- type DryRunResults
- type DryRunServer
- type GetRequest
- func (*GetRequest) Descriptor() ([]byte, []int)deprecated
- func (in *GetRequest) FlagSet(prefix ...string) *pflag.FlagSet
- func (x *GetRequest) GetRevision() *v1.Revision
- func (*GetRequest) ProtoMessage()
- func (x *GetRequest) ProtoReflect() protoreflect.Message
- func (x *GetRequest) Reset()
- func (x *GetRequest) String() string
- type HistoryClientInterface
- type HistoryResponseType
- type HistoryServer
- type InstallState
- func (InstallState) Descriptor() protoreflect.EnumDescriptor
- func (x InstallState) Enum() *InstallState
- func (InstallState) EnumDescriptor() ([]byte, []int)deprecated
- func (x InstallState) Number() protoreflect.EnumNumber
- func (x InstallState) String() string
- func (InstallState) Type() protoreflect.EnumType
- type InstallStatus
- func (*InstallStatus) Descriptor() ([]byte, []int)deprecated
- func (x *InstallStatus) GetAppState() ApplicationState
- func (x *InstallStatus) GetConfigState() ConfigurationState
- func (x *InstallStatus) GetInstallState() InstallState
- func (x *InstallStatus) GetMetadata() map[string]string
- func (x *InstallStatus) GetVersion() string
- func (x *InstallStatus) GetWarnings() []string
- func (*InstallStatus) ProtoMessage()
- func (x *InstallStatus) ProtoReflect() protoreflect.Message
- func (s *InstallStatus) RenderText(out cli.Writer)
- func (x *InstallStatus) Reset()
- func (x *InstallStatus) String() string
- type InstallableConfigType
- type InstallerClient
- type InstallerServer
- type ListType
- type NoopSecretsRedactor
- type Option
- type PresetMetadata
- func (*PresetMetadata) Descriptor() ([]byte, []int)deprecated
- func (x *PresetMetadata) GetDescription() string
- func (x *PresetMetadata) GetDisplayName() string
- func (x *PresetMetadata) GetNotes() []string
- func (*PresetMetadata) ProtoMessage()
- func (x *PresetMetadata) ProtoReflect() protoreflect.Message
- func (x *PresetMetadata) Reset()
- func (x *PresetMetadata) String() string
- type PresetType
- type ResetRequestType
- type ResetServer
- type Revisioner
- type SecretsRedactor
- type Target
- type ValidationError
- func (*ValidationError) Descriptor() ([]byte, []int)deprecated
- func (x *ValidationError) GetMessage() string
- func (x *ValidationError) GetSeverity() ValidationError_Severity
- func (x *ValidationError) GetSource() string
- func (*ValidationError) ProtoMessage()
- func (x *ValidationError) ProtoReflect() protoreflect.Message
- func (x *ValidationError) Reset()
- func (x *ValidationError) String() string
- type ValidationError_Severity
- func (ValidationError_Severity) Descriptor() protoreflect.EnumDescriptor
- func (x ValidationError_Severity) Enum() *ValidationError_Severity
- func (ValidationError_Severity) EnumDescriptor() ([]byte, []int)deprecated
- func (x ValidationError_Severity) Number() protoreflect.EnumNumber
- func (x ValidationError_Severity) String() string
- func (ValidationError_Severity) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( Target_name = map[int32]string{ 0: "ActiveConfiguration", 1: "DefaultConfiguration", } Target_value = map[string]int32{ "ActiveConfiguration": 0, "DefaultConfiguration": 1, } )
Enum value maps for Target.
var ( Action_name = map[int32]string{ 0: "NoAction", 1: "Set", 2: "Reset", } Action_value = map[string]int32{ "NoAction": 0, "Set": 1, "Reset": 2, } )
Enum value maps for Action.
var ( InstallState_name = map[int32]string{ 0: "NotInstalled", 1: "Installed", 2: "Uninstalling", } InstallState_value = map[string]int32{ "NotInstalled": 0, "Installed": 1, "Uninstalling": 2, } )
Enum value maps for InstallState.
var ( ConfigurationState_name = map[int32]string{ 0: "NotConfigured", 1: "Configured", } ConfigurationState_value = map[string]int32{ "NotConfigured": 0, "Configured": 1, } )
Enum value maps for ConfigurationState.
var ( ApplicationState_name = map[int32]string{ 0: "NotRunning", 1: "Pending", 2: "Running", 3: "Failed", } ApplicationState_value = map[string]int32{ "NotRunning": 0, "Pending": 1, "Running": 2, "Failed": 3, } )
Enum value maps for ApplicationState.
var ( ValidationError_Severity_name = map[int32]string{ 0: "Unknown", 1: "Warning", 2: "Error", } ValidationError_Severity_value = map[string]int32{ "Unknown": 0, "Warning": 1, "Error": 2, } )
Enum value maps for ValidationError_Severity.
var File_github_com_rancher_opni_pkg_plugins_driverutil_types_proto protoreflect.FileDescriptor
Functions ¶
func ApplyOptions ¶
func CopyRevision ¶ added in v0.12.0
func CopyRevision[T Revisioner](dst, src T)
func GetRevisionFieldIndex ¶ added in v0.12.0
func GetRevisionFieldIndex[T Revisioner]() int
func MarshalConfigJson ¶ added in v0.12.0
func RenderJsonDiff ¶ added in v0.12.0
func SetRevision ¶ added in v0.12.0
func SetRevision[T Revisioner](t T, value int64, maybeTimestamp ...time.Time)
func UnsetRevision ¶ added in v0.12.0
func UnsetRevision[T Revisioner](t T)
Types ¶
type Action ¶ added in v0.12.0
type Action int32
func (Action) Descriptor ¶ added in v0.12.0
func (Action) Descriptor() protoreflect.EnumDescriptor
func (Action) EnumDescriptor
deprecated
added in
v0.12.0
func (Action) Number ¶ added in v0.12.0
func (x Action) Number() protoreflect.EnumNumber
func (Action) Type ¶ added in v0.12.0
func (Action) Type() protoreflect.EnumType
type ApplicationState ¶ added in v0.12.0
type ApplicationState int32
const ( ApplicationState_NotRunning ApplicationState = 0 ApplicationState_Pending ApplicationState = 1 ApplicationState_Running ApplicationState = 2 ApplicationState_Failed ApplicationState = 3 )
func (ApplicationState) Descriptor ¶ added in v0.12.0
func (ApplicationState) Descriptor() protoreflect.EnumDescriptor
func (ApplicationState) Enum ¶ added in v0.12.0
func (x ApplicationState) Enum() *ApplicationState
func (ApplicationState) EnumDescriptor
deprecated
added in
v0.12.0
func (ApplicationState) EnumDescriptor() ([]byte, []int)
Deprecated: Use ApplicationState.Descriptor instead.
func (ApplicationState) Number ¶ added in v0.12.0
func (x ApplicationState) Number() protoreflect.EnumNumber
func (ApplicationState) String ¶ added in v0.12.0
func (x ApplicationState) String() string
func (ApplicationState) Type ¶ added in v0.12.0
func (ApplicationState) Type() protoreflect.EnumType
type BaseConfigServer ¶ added in v0.12.0
type BaseConfigServer[ R ResetRequestType[T], HR HistoryResponseType[T], T InstallableConfigType[T], ] struct { // contains filtered or unexported fields }
func NewBaseConfigServer ¶ added in v0.12.0
func NewBaseConfigServer[ R ResetRequestType[T], HR HistoryResponseType[T], T InstallableConfigType[T], ]( defaultStore, activeStore storage.ValueStoreT[T], loadDefaultsFunc DefaultLoaderFunc[T], ) *BaseConfigServer[R, HR, T]
Implements a subset of methods usually required by a driver which uses a DefaultingConfigTracker to manage its configuration. These implementations should not vary between drivers, so they are provided here as a convenience.
Usage example:
type Driver struct { foo.UnsafeFooServer // package foo; // message GetRequest { // core.Revision revision = 1; // } *driverutil.BaseConfigServer[*foo.ResetRequest, *foo.HistoryResponse, T] } func NewDriver() *Driver { defaultStore := ... activeStore := ... return &Driver{ BaseConfigServer: driverutil.NewBaseConfigServer[*foo.ResetRequest, *foo.HistoryResponse](defaultStore, activeStore, flagutil.LoadDefaults) } }
func (*BaseConfigServer[R, HR, T]) ConfigurationHistory ¶ added in v0.12.0
func (s *BaseConfigServer[R, HR, T]) ConfigurationHistory(ctx context.Context, req *ConfigurationHistoryRequest) (HR, error)
func (*BaseConfigServer[R, HR, T]) GetConfiguration ¶ added in v0.12.0
func (s *BaseConfigServer[R, HR, T]) GetConfiguration(ctx context.Context, in *GetRequest) (T, error)
GetConfiguration implements ConfigurableServerInterface.
func (*BaseConfigServer[R, HR, T]) GetDefaultConfiguration ¶ added in v0.12.0
func (s *BaseConfigServer[R, HR, T]) GetDefaultConfiguration(ctx context.Context, in *GetRequest) (T, error)
GetDefaultConfiguration implements ConfigurableServerInterface.
func (*BaseConfigServer[R, HR, T]) Install ¶ added in v0.12.0
func (s *BaseConfigServer[R, HR, T]) Install(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
Install implements ConfigurableServerInterface.
func (*BaseConfigServer[R, HR, T]) ResetConfiguration ¶ added in v0.12.0
func (s *BaseConfigServer[R, HR, T]) ResetConfiguration(ctx context.Context, in R) (*emptypb.Empty, error)
ResetConfiguration implements ConfigurableServerInterface.
func (*BaseConfigServer[R, HR, T]) ResetDefaultConfiguration ¶ added in v0.12.0
func (s *BaseConfigServer[R, HR, T]) ResetDefaultConfiguration(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
ResetDefaultConfiguration implements ConfigurableServerInterface.
func (*BaseConfigServer[R, HR, T]) SetConfiguration ¶ added in v0.12.0
func (s *BaseConfigServer[R, HR, T]) SetConfiguration(ctx context.Context, t T) (*emptypb.Empty, error)
SetConfiguration implements ConfigurableServerInterface.
func (*BaseConfigServer[R, HR, T]) SetDefaultConfiguration ¶ added in v0.12.0
func (s *BaseConfigServer[R, HR, T]) SetDefaultConfiguration(ctx context.Context, t T) (*emptypb.Empty, error)
SetDefaultConfiguration implements ConfigurableServerInterface.
func (*BaseConfigServer[R, HR, T]) Tracker ¶ added in v0.12.0
func (s *BaseConfigServer[R, HR, T]) Tracker() *DefaultingConfigTracker[T]
type BasicClientInterface ¶ added in v0.12.0
type BasicClientInterface[ T ConfigType[T], R ResetRequestType[T], ] interface { GetDefaultConfiguration(context.Context, *GetRequest, ...grpc.CallOption) (T, error) SetDefaultConfiguration(context.Context, T, ...grpc.CallOption) (*emptypb.Empty, error) ResetDefaultConfiguration(context.Context, *emptypb.Empty, ...grpc.CallOption) (*emptypb.Empty, error) GetConfiguration(context.Context, *GetRequest, ...grpc.CallOption) (T, error) SetConfiguration(context.Context, T, ...grpc.CallOption) (*emptypb.Empty, error) ResetConfiguration(context.Context, R, ...grpc.CallOption) (*emptypb.Empty, error) }
type BasicServer ¶ added in v0.12.0
type BasicServer[ T ConfigType[T], ] interface { GetDefaultConfiguration(context.Context, *GetRequest) (T, error) SetDefaultConfiguration(context.Context, T) (*emptypb.Empty, error) GetConfiguration(context.Context, *GetRequest) (T, error) SetConfiguration(context.Context, T) (*emptypb.Empty, error) }
type Client ¶ added in v0.12.0
type Client[ T ConfigType[T], R ResetRequestType[T], D DryRunRequestType[T], DR DryRunResponseType[T], HR HistoryResponseType[T], ] interface { BasicClientInterface[T, R] DryRunClientInterface[T, D, DR] HistoryClientInterface[T, HR] }
type ConfigServer ¶ added in v0.12.0
type ConfigServer[ T ConfigType[T], R ResetRequestType[T], HR HistoryResponseType[T], ] interface { BasicServer[T] ResetServer[T, R] HistoryServer[T, HR] }
type ConfigType ¶ added in v0.12.0
type ConfigType[T any] interface { proto.Message Revisioner SecretsRedactor[T] }
func WithNoopSecretsRedactor ¶ added in v0.12.0
func WithNoopSecretsRedactor[U Revisioner, T any](partial U) ConfigType[T]
type ConfigurationHistoryRequest ¶ added in v0.12.0
type ConfigurationHistoryRequest struct { // The configuration type to return history for. Target Target `protobuf:"varint,1,opt,name=target,proto3,enum=driverutil.Target" json:"target,omitempty"` // The latest modification revision to include in the returned history. Revision *v1.Revision `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` // If set, will include the values of the configuration in the response. // Otherwise, only the revision field of each entry will be populated. IncludeValues bool `protobuf:"varint,3,opt,name=includeValues,proto3" json:"includeValues,omitempty"` // contains filtered or unexported fields }
History request options. See also: pkg/storage.HistoryOptions
func (*ConfigurationHistoryRequest) Descriptor
deprecated
added in
v0.12.0
func (*ConfigurationHistoryRequest) Descriptor() ([]byte, []int)
Deprecated: Use ConfigurationHistoryRequest.ProtoReflect.Descriptor instead.
func (*ConfigurationHistoryRequest) FlagSet ¶ added in v0.12.0
func (in *ConfigurationHistoryRequest) FlagSet(prefix ...string) *pflag.FlagSet
func (*ConfigurationHistoryRequest) GetIncludeValues ¶ added in v0.12.0
func (x *ConfigurationHistoryRequest) GetIncludeValues() bool
func (*ConfigurationHistoryRequest) GetRevision ¶ added in v0.12.0
func (x *ConfigurationHistoryRequest) GetRevision() *v1.Revision
func (*ConfigurationHistoryRequest) GetTarget ¶ added in v0.12.0
func (x *ConfigurationHistoryRequest) GetTarget() Target
func (*ConfigurationHistoryRequest) ProtoMessage ¶ added in v0.12.0
func (*ConfigurationHistoryRequest) ProtoMessage()
func (*ConfigurationHistoryRequest) ProtoReflect ¶ added in v0.12.0
func (x *ConfigurationHistoryRequest) ProtoReflect() protoreflect.Message
func (*ConfigurationHistoryRequest) Reset ¶ added in v0.12.0
func (x *ConfigurationHistoryRequest) Reset()
func (*ConfigurationHistoryRequest) String ¶ added in v0.12.0
func (x *ConfigurationHistoryRequest) String() string
type ConfigurationState ¶ added in v0.12.0
type ConfigurationState int32
const ( ConfigurationState_NotConfigured ConfigurationState = 0 ConfigurationState_Configured ConfigurationState = 1 )
func (ConfigurationState) Descriptor ¶ added in v0.12.0
func (ConfigurationState) Descriptor() protoreflect.EnumDescriptor
func (ConfigurationState) Enum ¶ added in v0.12.0
func (x ConfigurationState) Enum() *ConfigurationState
func (ConfigurationState) EnumDescriptor
deprecated
added in
v0.12.0
func (ConfigurationState) EnumDescriptor() ([]byte, []int)
Deprecated: Use ConfigurationState.Descriptor instead.
func (ConfigurationState) Number ¶ added in v0.12.0
func (x ConfigurationState) Number() protoreflect.EnumNumber
func (ConfigurationState) String ¶ added in v0.12.0
func (x ConfigurationState) String() string
func (ConfigurationState) Type ¶ added in v0.12.0
func (ConfigurationState) Type() protoreflect.EnumType
type DefaultLoaderFunc ¶ added in v0.12.0
type DefaultLoaderFunc[T any] func(T)
type DefaultingConfigTracker ¶ added in v0.12.0
type DefaultingConfigTracker[T ConfigType[T]] struct { // contains filtered or unexported fields }
func NewDefaultingConfigTracker ¶ added in v0.12.0
func NewDefaultingConfigTracker[T ConfigType[T]]( defaultStore, activeStore storage.ValueStoreT[T], loadDefaultsFunc DefaultLoaderFunc[T], ) *DefaultingConfigTracker[T]
func (*DefaultingConfigTracker[T]) ApplyConfig ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) ApplyConfig(ctx context.Context, newConfig T) error
ApplyConfig sets the active config by merging the given config onto the existing active config, or onto the default config if no active config has been set.
func (*DefaultingConfigTracker[T]) DryRun ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) DryRun(ctx context.Context, req DryRunRequestType[T]) (*DryRunResults[T], error)
func (*DefaultingConfigTracker[T]) DryRunApplyConfig ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) DryRunApplyConfig(ctx context.Context, newConfig T) (DryRunResults[T], error)
func (*DefaultingConfigTracker[T]) DryRunResetConfig ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) DryRunResetConfig(ctx context.Context, mask *fieldmaskpb.FieldMask, patch T, atRevision ...*corev1.Revision) (DryRunResults[T], error)
func (*DefaultingConfigTracker[T]) DryRunResetDefaultConfig ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) DryRunResetDefaultConfig(ctx context.Context, atRevision ...*corev1.Revision) (DryRunResults[T], error)
func (*DefaultingConfigTracker[T]) DryRunSetDefaultConfig ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) DryRunSetDefaultConfig(ctx context.Context, newDefault T) (DryRunResults[T], error)
func (*DefaultingConfigTracker[T]) GetConfig ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) GetConfig(ctx context.Context, atRevision ...*corev1.Revision) (T, error)
Returns the active config if it has been set, otherwise returns a "not found" error. An optional revision can be provided to get the config at a specific revision.
func (*DefaultingConfigTracker[T]) GetConfigOrDefault ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) GetConfigOrDefault(ctx context.Context, atRevision ...*corev1.Revision) (T, error)
Returns the active config if it has been set, otherwise returns the default config. The optional revision only applies to the active config; if it does not exist, the default config will always be at the latest revision.
func (*DefaultingConfigTracker[T]) GetDefaultConfig ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) GetDefaultConfig(ctx context.Context, atRevision ...*corev1.Revision) (T, error)
Gets the default config if one has been set, otherwise returns a new default config as defined by the type.
func (*DefaultingConfigTracker[T]) History ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) History(ctx context.Context, target Target, opts ...storage.HistoryOpt) ([]storage.KeyRevision[T], error)
func (*DefaultingConfigTracker[T]) ResetConfig ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) ResetConfig(ctx context.Context, mask *fieldmaskpb.FieldMask, patch T, atRevision ...*corev1.Revision) error
Restores the active config to match the default config. An optional field mask can be provided to specify which fields to keep from the current config. If a nil mask is given, the active config (potentially including history) is deleted from the underlying store. If a non-nil mask is given, the active config is only modified (preserving history), not deleted.
func (*DefaultingConfigTracker[T]) ResetDefaultConfig ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) ResetDefaultConfig(ctx context.Context, atRevision ...*corev1.Revision) error
Deletes the default config, leaving it unset. Subsequent calls to GetDefaultConfig will return a new default config as defined by the type.
func (*DefaultingConfigTracker[T]) SetDefaultConfig ¶ added in v0.12.0
func (ct *DefaultingConfigTracker[T]) SetDefaultConfig(ctx context.Context, newDefault T) error
Sets the default config directly. No merging is performed.
type DriverBuilder ¶
type DriverCache ¶
type DriverCache[D Driver] interface { Register(name string, builder DriverBuilder[D]) Unregister(name string) Get(name string) (DriverBuilder[D], bool) List() []string }
func NewDriverCache ¶
func NewDriverCache[D Driver]() DriverCache[D]
type DryRunClientInterface ¶ added in v0.12.0
type DryRunClientInterface[ T ConfigType[T], D DryRunRequestType[T], DR DryRunResponseType[T], ] interface { DryRun(context.Context, D, ...grpc.CallOption) (DR, error) }
type DryRunConfigServer ¶ added in v0.12.0
type DryRunConfigServer[ T ConfigType[T], R ResetRequestType[T], HR HistoryResponseType[T], D DryRunRequestType[T], DR DryRunResponseType[T], ] interface { ConfigServer[T, R, HR] DryRunServer[T, D, DR] }
type DryRunRequestType ¶ added in v0.12.0
type DryRunRequestType[ T ConfigType[T], ] interface { proto.Message GetAction() Action GetTarget() Target GetSpec() T GetRevision() *corev1.Revision GetPatch() T GetMask() *fieldmaskpb.FieldMask }
type DryRunResponseType ¶ added in v0.12.0
type DryRunResponseType[T ConfigType[T]] interface { proto.Message GetCurrent() T GetModified() T GetValidationErrors() []*ValidationError }
type DryRunResults ¶ added in v0.12.0
type DryRunResults[T any] struct { Current T Modified T }
type DryRunServer ¶ added in v0.12.0
type DryRunServer[ T ConfigType[T], D DryRunRequestType[T], DR DryRunResponseType[T], ] interface { DryRun(context.Context, D) (DR, error) }
type GetRequest ¶ added in v0.12.0
type GetRequest struct { // If set, will return the config at the specified revision instead of // the current config. // This revision value can be obtained from the revision field of a // typed GetConfiguration/GetDefaultConfiguration response, or from one of // the history entries in a typed ConfigurationHistory response. Revision *v1.Revision `protobuf:"bytes,1,opt,name=revision,proto3" json:"revision,omitempty"` // contains filtered or unexported fields }
Get request options. See also: pkg/storage.GetOptions
func (*GetRequest) Descriptor
deprecated
added in
v0.12.0
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) FlagSet ¶ added in v0.12.0
func (in *GetRequest) FlagSet(prefix ...string) *pflag.FlagSet
func (*GetRequest) GetRevision ¶ added in v0.12.0
func (x *GetRequest) GetRevision() *v1.Revision
func (*GetRequest) ProtoMessage ¶ added in v0.12.0
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶ added in v0.12.0
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶ added in v0.12.0
func (x *GetRequest) Reset()
func (*GetRequest) String ¶ added in v0.12.0
func (x *GetRequest) String() string
type HistoryClientInterface ¶ added in v0.12.0
type HistoryClientInterface[ T ConfigType[T], HR HistoryResponseType[T], ] interface { ConfigurationHistory(context.Context, *ConfigurationHistoryRequest, ...grpc.CallOption) (HR, error) }
type HistoryResponseType ¶ added in v0.12.0
type HistoryResponseType[T ConfigType[T]] interface { proto.Message GetEntries() []T }
type HistoryServer ¶ added in v0.12.0
type HistoryServer[ T ConfigType[T], HR HistoryResponseType[T], ] interface { ConfigurationHistory(context.Context, *ConfigurationHistoryRequest) (HR, error) }
type InstallState ¶ added in v0.12.0
type InstallState int32
const ( InstallState_NotInstalled InstallState = 0 InstallState_Installed InstallState = 1 InstallState_Uninstalling InstallState = 2 )
func (InstallState) Descriptor ¶ added in v0.12.0
func (InstallState) Descriptor() protoreflect.EnumDescriptor
func (InstallState) Enum ¶ added in v0.12.0
func (x InstallState) Enum() *InstallState
func (InstallState) EnumDescriptor
deprecated
added in
v0.12.0
func (InstallState) EnumDescriptor() ([]byte, []int)
Deprecated: Use InstallState.Descriptor instead.
func (InstallState) Number ¶ added in v0.12.0
func (x InstallState) Number() protoreflect.EnumNumber
func (InstallState) String ¶ added in v0.12.0
func (x InstallState) String() string
func (InstallState) Type ¶ added in v0.12.0
func (InstallState) Type() protoreflect.EnumType
type InstallStatus ¶ added in v0.12.0
type InstallStatus struct { ConfigState ConfigurationState `protobuf:"varint,1,opt,name=configState,proto3,enum=driverutil.ConfigurationState" json:"configState,omitempty"` InstallState InstallState `protobuf:"varint,2,opt,name=installState,proto3,enum=driverutil.InstallState" json:"installState,omitempty"` AppState ApplicationState `protobuf:"varint,3,opt,name=appState,proto3,enum=driverutil.ApplicationState" json:"appState,omitempty"` Warnings []string `protobuf:"bytes,4,rep,name=warnings,proto3" json:"warnings,omitempty"` Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` Metadata map[string]string `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
func (*InstallStatus) Descriptor
deprecated
added in
v0.12.0
func (*InstallStatus) Descriptor() ([]byte, []int)
Deprecated: Use InstallStatus.ProtoReflect.Descriptor instead.
func (*InstallStatus) GetAppState ¶ added in v0.12.0
func (x *InstallStatus) GetAppState() ApplicationState
func (*InstallStatus) GetConfigState ¶ added in v0.12.0
func (x *InstallStatus) GetConfigState() ConfigurationState
func (*InstallStatus) GetInstallState ¶ added in v0.12.0
func (x *InstallStatus) GetInstallState() InstallState
func (*InstallStatus) GetMetadata ¶ added in v0.12.0
func (x *InstallStatus) GetMetadata() map[string]string
func (*InstallStatus) GetVersion ¶ added in v0.12.0
func (x *InstallStatus) GetVersion() string
func (*InstallStatus) GetWarnings ¶ added in v0.12.0
func (x *InstallStatus) GetWarnings() []string
func (*InstallStatus) ProtoMessage ¶ added in v0.12.0
func (*InstallStatus) ProtoMessage()
func (*InstallStatus) ProtoReflect ¶ added in v0.12.0
func (x *InstallStatus) ProtoReflect() protoreflect.Message
func (*InstallStatus) RenderText ¶ added in v0.12.0
func (s *InstallStatus) RenderText(out cli.Writer)
func (*InstallStatus) Reset ¶ added in v0.12.0
func (x *InstallStatus) Reset()
func (*InstallStatus) String ¶ added in v0.12.0
func (x *InstallStatus) String() string
type InstallableConfigType ¶ added in v0.12.0
type InstallableConfigType[T any] interface { ConfigType[T] GetEnabled() bool }
type InstallerClient ¶ added in v0.12.0
type InstallerServer ¶ added in v0.12.0
type NoopSecretsRedactor ¶ added in v0.12.0
type NoopSecretsRedactor[T any] struct{}
func (NoopSecretsRedactor[T]) RedactSecrets ¶ added in v0.12.0
func (NoopSecretsRedactor[T]) RedactSecrets()
func (NoopSecretsRedactor[T]) UnredactSecrets ¶ added in v0.12.0
func (NoopSecretsRedactor[T]) UnredactSecrets(T) error
type PresetMetadata ¶ added in v0.12.0
type PresetMetadata struct { // A display name for the preset. DisplayName string `protobuf:"bytes,1,opt,name=displayName,proto3" json:"displayName,omitempty"` // Longer description of the preset. Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // Optional list of messages that should be displayed to the user when the // preset is used (determined at the client's discretion). // For example, this may contain additional information about requirements // or next steps that the user should be aware of. Notes []string `protobuf:"bytes,3,rep,name=notes,proto3" json:"notes,omitempty"` // contains filtered or unexported fields }
func (*PresetMetadata) Descriptor
deprecated
added in
v0.12.0
func (*PresetMetadata) Descriptor() ([]byte, []int)
Deprecated: Use PresetMetadata.ProtoReflect.Descriptor instead.
func (*PresetMetadata) GetDescription ¶ added in v0.12.0
func (x *PresetMetadata) GetDescription() string
func (*PresetMetadata) GetDisplayName ¶ added in v0.12.0
func (x *PresetMetadata) GetDisplayName() string
func (*PresetMetadata) GetNotes ¶ added in v0.12.0
func (x *PresetMetadata) GetNotes() []string
func (*PresetMetadata) ProtoMessage ¶ added in v0.12.0
func (*PresetMetadata) ProtoMessage()
func (*PresetMetadata) ProtoReflect ¶ added in v0.12.0
func (x *PresetMetadata) ProtoReflect() protoreflect.Message
func (*PresetMetadata) Reset ¶ added in v0.12.0
func (x *PresetMetadata) Reset()
func (*PresetMetadata) String ¶ added in v0.12.0
func (x *PresetMetadata) String() string
type PresetType ¶ added in v0.12.0
type ResetRequestType ¶ added in v0.12.0
type ResetRequestType[T ConfigType[T]] interface { proto.Message GetMask() *fieldmaskpb.FieldMask GetPatch() T }
type ResetServer ¶ added in v0.12.0
type Revisioner ¶ added in v0.12.0
type SecretsRedactor ¶ added in v0.12.0
type Target ¶ added in v0.12.0
type Target int32
func (Target) Descriptor ¶ added in v0.12.0
func (Target) Descriptor() protoreflect.EnumDescriptor
func (Target) EnumDescriptor
deprecated
added in
v0.12.0
func (Target) Number ¶ added in v0.12.0
func (x Target) Number() protoreflect.EnumNumber
func (Target) Type ¶ added in v0.12.0
func (Target) Type() protoreflect.EnumType
type ValidationError ¶ added in v0.12.0
type ValidationError struct { Severity ValidationError_Severity `protobuf:"varint,1,opt,name=severity,proto3,enum=driverutil.ValidationError_Severity" json:"severity,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` // contains filtered or unexported fields }
func (*ValidationError) Descriptor
deprecated
added in
v0.12.0
func (*ValidationError) Descriptor() ([]byte, []int)
Deprecated: Use ValidationError.ProtoReflect.Descriptor instead.
func (*ValidationError) GetMessage ¶ added in v0.12.0
func (x *ValidationError) GetMessage() string
func (*ValidationError) GetSeverity ¶ added in v0.12.0
func (x *ValidationError) GetSeverity() ValidationError_Severity
func (*ValidationError) GetSource ¶ added in v0.12.0
func (x *ValidationError) GetSource() string
func (*ValidationError) ProtoMessage ¶ added in v0.12.0
func (*ValidationError) ProtoMessage()
func (*ValidationError) ProtoReflect ¶ added in v0.12.0
func (x *ValidationError) ProtoReflect() protoreflect.Message
func (*ValidationError) Reset ¶ added in v0.12.0
func (x *ValidationError) Reset()
func (*ValidationError) String ¶ added in v0.12.0
func (x *ValidationError) String() string
type ValidationError_Severity ¶ added in v0.12.0
type ValidationError_Severity int32
const ( ValidationError_Unknown ValidationError_Severity = 0 ValidationError_Warning ValidationError_Severity = 1 ValidationError_Error ValidationError_Severity = 2 )
func (ValidationError_Severity) Descriptor ¶ added in v0.12.0
func (ValidationError_Severity) Descriptor() protoreflect.EnumDescriptor
func (ValidationError_Severity) Enum ¶ added in v0.12.0
func (x ValidationError_Severity) Enum() *ValidationError_Severity
func (ValidationError_Severity) EnumDescriptor
deprecated
added in
v0.12.0
func (ValidationError_Severity) EnumDescriptor() ([]byte, []int)
Deprecated: Use ValidationError_Severity.Descriptor instead.
func (ValidationError_Severity) Number ¶ added in v0.12.0
func (x ValidationError_Severity) Number() protoreflect.EnumNumber
func (ValidationError_Severity) String ¶ added in v0.12.0
func (x ValidationError_Severity) String() string
func (ValidationError_Severity) Type ¶ added in v0.12.0
func (ValidationError_Severity) Type() protoreflect.EnumType