Documentation ¶
Index ¶
- Constants
- Variables
- type CNIPluginsManifestRenderData
- type Group
- type HostDeviceManifestRenderData
- type IBKubernetesManifestRenderData
- type IBKubernetesSpec
- type IPoIBCNIRuntimeSpec
- type IPoIBManifestRenderData
- 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 NewStateHostDeviceNetwork(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- func NewStateIBKubernetes(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- func NewStateIPoIBCNI(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- func NewStateIPoIBNetwork(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 NewStatePodSecurityPolicy(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- func NewStateSharedDp(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
- func NewStateSriovDp(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
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 ¶
var CertConfigPathMap = map[string]string{
"ubuntu": "/etc/ssl/certs",
"rhcos": "/etc/pki/ca-trust/extracted/pem",
}
CertConfigPathMap indicates standard OS specific paths for ssl keys/certificates. Where Go looks for certs: https://golang.org/src/crypto/x509/root_linux.go Where OCP mounts proxy certs on RHCOS nodes: https://access.redhat.com/documentation/en-us/openshift_container_platform/4.3/html/authentication/ocp-certificates#proxy-certificates_ocp-certificates
var ConfigMapKeysOverride = map[string]map[string]string{ // contains filtered or unexported fields }
ConfigMapKeysOverride contains static key override rules for ConfigMaps now the only use-case is to override key name in the ConfigMap which automatically populated by Openshift format is the following: {"<configMapName>": {"<keyNameInConfigMap>": "<dstFileNameInContainer>"}}
var RepoConfigPathMap = map[string]string{
"ubuntu": "/etc/apt/sources.list.d",
"rhcos": "/etc/yum.repos.d",
}
RepoConfigPathMap indicates standard OS specific paths for repository configuration files
Functions ¶
This section is empty.
Types ¶
type CNIPluginsManifestRenderData ¶ added in v0.2.0
type CNIPluginsManifestRenderData struct { CrSpec *mellanoxv1alpha1.ImageSpec NodeAffinity *v1.NodeAffinity 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 HostDeviceManifestRenderData ¶ added in v0.4.0
type HostDeviceManifestRenderData struct { HostDeviceNetworkName string CrSpec mellanoxv1alpha1.HostDeviceNetworkSpec RuntimeSpec *runtimeSpec ResourceName string }
type IBKubernetesManifestRenderData ¶ added in v1.4.0
type IBKubernetesManifestRenderData struct { CrSpec *mellanoxv1alpha1.IBKubernetesSpec PeriodicUpdateSecondsString string NodeAffinity *v1.NodeAffinity DeployInitContainer bool RuntimeSpec *IBKubernetesSpec }
type IBKubernetesSpec ¶ added in v1.4.0
type IBKubernetesSpec struct { OSName string // contains filtered or unexported fields }
type IPoIBCNIRuntimeSpec ¶ added in v1.4.0
type IPoIBCNIRuntimeSpec struct { OSName string // contains filtered or unexported fields }
type IPoIBManifestRenderData ¶ added in v1.3.0
type IPoIBManifestRenderData struct { CrSpec *mellanoxv1alpha1.ImageSpec NodeAffinity *v1.NodeAffinity RuntimeSpec *IPoIBCNIRuntimeSpec }
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 NodeAffinity *v1.NodeAffinity 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 NewStateHostDeviceNetwork ¶ added in v0.4.0
func NewStateHostDeviceNetwork(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
NewStateHostDeviceNetwork creates a new state for HostDeviceNetwork CR
func NewStateIBKubernetes ¶ added in v1.4.0
func NewStateIBKubernetes(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
NewStateIBKubernetes creates a new ib-kubernetes state
func NewStateIPoIBCNI ¶ added in v1.3.0
func NewStateIPoIBCNI(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
NewStateIPoIBCNI creates a new state for IPoIB NI
func NewStateIPoIBNetwork ¶ added in v1.3.0
func NewStateIPoIBNetwork(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
NewStateIPoIBNetwork creates a new state for IPoIBNetwork CR
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
func NewStatePodSecurityPolicy ¶ added in v1.1.0
func NewStatePodSecurityPolicy(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
NewStatePodSecurityPolicy creates a new pod security policy state
func NewStateSharedDp ¶
func NewStateSharedDp(k8sAPIClient client.Client, scheme *runtime.Scheme, manifestDir string) (State, error)
NewStateSharedDp creates a new shared device plugin state
type WhereaboutsManifestRenderData ¶ added in v0.2.0
type WhereaboutsManifestRenderData struct { CrSpec *mellanoxv1alpha1.ImageSpec NodeAffinity *v1.NodeAffinity RuntimeSpec *runtimeSpec }
Source Files ¶
- factory.go
- fake_manager.go
- fake_state.go
- group.go
- info_source.go
- manager.go
- state.go
- state_cni_plugins.go
- state_hostdevice_network.go
- state_ib_kubernetes.go
- state_ipoib_cni.go
- state_ipoib_network.go
- state_macvlan_network.go
- state_multus_cni.go
- state_nv_peer.go
- state_ofed.go
- state_pod_security_policy.go
- state_shared_dp.go
- state_skel.go
- state_sriov_dp.go
- state_test_common.go
- state_whereabouts_cni.go