Documentation
¶
Index ¶
- Constants
- type CNIPluginsManifestRenderData
- type Group
- type InfoCatalog
- type InfoSource
- type InfoType
- type Manager
- type MultusManifestRenderData
- type Result
- type Results
- type State
- func NewStateCNIPlugins(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- func NewStateMacvlanNetwork(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- func NewStateMultusCNI(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- func NewStateNVPeer(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- func NewStateOFED(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- func NewStateSharedDp(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- func NewStateWhereaboutsCNI(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- type SyncState
- type WhereaboutsManifestRenderData
- type WhereaboutsRuntimeSpec
Constants ¶
const ( SyncStateReady = "ready" SyncStateNotReady = "notReady" SyncStateIgnore = "ignore" SyncStateReset = "reset" SyncStateError = "error" )
Represents the Sync state of a specific State or a collection of States
const (
InfoTypeNodeInfo = iota
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CNIPluginsManifestRenderData ¶ added in v0.2.0
type CNIPluginsManifestRenderData struct {
CrSpec *mellanoxv1alpha1.ImageSpec
RuntimeSpec *runtimeSpec
}
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group Represents a set of disjoint States that are Synced (Reconciled) together
func NewStateGroup ¶
NewStateGroup returns a new group of states
func (*Group) Sync ¶
func (sg *Group) Sync(customResource interface{}, infoCatalog InfoCatalog) (results []Result)
SyncGroup sync and update status for a list of states
type InfoCatalog ¶
type InfoCatalog interface {
// Add an infoSource of InfoType to the catalog
Add(InfoType, InfoSource)
// GetNodeInfoProvider returns a reference nodeinfo.Provider from catalog or nil if provider does not exist
GetNodeInfoProvider() nodeinfo.Provider
}
InfoCatalog is an information catalog to be used to retrieve infoSources. used for State implementation that require additional helping functionality to perfrom the Sync operation. As more States are added, more infoSources may be added to aid them. for any infoSource if not present in the catalog, nil will be returned.
func NewInfoCatalog ¶
func NewInfoCatalog() InfoCatalog
type InfoSource ¶
type InfoSource interface{}
InfoSource represents an object that is a souce of information
type Manager ¶
type Manager interface {
// GetWatchSources gets Resources that should be watched by a Controller for this state manager
GetWatchSources() []*source.Kind
// SyncState reconciles the state of the system and returns a list of status of the applied states
// InfoCatalog is provided to optionally provide a State additional information sources required for it to perform
// the Sync operation.
SyncState(customResource interface{}, infoCatalog InfoCatalog) (Results, error)
}
StateManager manages a collection of states and handles transitions from State to State. A state manager invokes states in order to get the system to its desired state
type MultusManifestRenderData ¶ added in v0.2.0
type MultusManifestRenderData struct {
CrSpec *mellanoxv1alpha1.MultusSpec
RuntimeSpec *runtimeSpec
}
type Result ¶
type Result struct {
StateName string
Status SyncState
// if SyncStateError then ErrInfo will contain additional error information
ErrInfo error
}
Represent a Result of a single State.Sync() invocation
type Results ¶
Represent the Results of a collection of State.Sync() invocations, Status reflects the global status of all states. If all are SyncStateReady then Status is SyncStateReady, if one is SyncStateNotReady, Status is SyncStateNotReady
type State ¶
type State interface {
// Name provides the State name
Name() string
// Description provides the State description
Description() string
// Sync attempt to get the system to match the desired state as depicted in the custom resource
// for the bits related to the specific state, State represents.
// a sync operation must be relatively short and must not block the execution thread.
// InfoCatalog is provided to optionally provide a State additional infoSources required for it to perform
// the Sync operation.
Sync(customResource interface{}, infoCatalog InfoCatalog) (SyncState, error)
// Get a map of source kinds that should be watched for the state keyed by the source kind name
GetWatchSources() map[string]*source.Kind
}
State Represents a single State that requires a set of k8s API operations to be performed. A state is associated with a set of resources, it checks the system state against the given set of resources and reconciles accordingly. It basically reconciles the system to the given state.
func NewStateCNIPlugins ¶ added in v0.2.0
func NewStateCNIPlugins(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
NewStateCNIPlugins creates a new state for secondary container networking CNI plugins
func NewStateMacvlanNetwork ¶ added in v0.2.0
func NewStateMacvlanNetwork(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
NewStateMacvlanNetwork creates a new state for MacvlanNetwork CR
func NewStateMultusCNI ¶ added in v0.2.0
func NewStateMultusCNI(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
NewStateMultusCNI creates a new state for Multus
func NewStateNVPeer ¶
func NewStateNVPeer(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
NewStateNVPeer creates a new NVPeer driver state
func NewStateOFED ¶
func NewStateOFED(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
NewStateOFED creates a new OFED driver state
type WhereaboutsManifestRenderData ¶ added in v0.2.0
type WhereaboutsManifestRenderData struct {
CrSpec *mellanoxv1alpha1.ImageSpec
RuntimeSpec *WhereaboutsRuntimeSpec
}
type WhereaboutsRuntimeSpec ¶ added in v0.2.0
type WhereaboutsRuntimeSpec struct {
Namespace string
}