Documentation ¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the kne v1alpha1 API group +kubebuilder:object:generate=true +groupName=kne.srlinux.dev
Index ¶
- Constants
- Variables
- type CertificateCfg
- type NodeConfig
- type SrlVersion
- type Srlinux
- type SrlinuxList
- type SrlinuxSpec
- func (in *SrlinuxSpec) DeepCopy() *SrlinuxSpec
- func (in *SrlinuxSpec) DeepCopyInto(out *SrlinuxSpec)
- func (s *SrlinuxSpec) GetConfig() *NodeConfig
- func (s *SrlinuxSpec) GetConstraints() map[string]string
- func (s *SrlinuxSpec) GetImage() string
- func (s *SrlinuxSpec) GetImageVersion() (*SrlVersion, error)
- func (s *SrlinuxSpec) GetModel() string
- type SrlinuxStatus
Constants ¶
const ( GroupName = "kne.srlinux.dev" GroupVersion = "v1alpha1" )
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: GroupVersion} )
nolint: gochecknoglobals
var ErrVersionParse = errors.New("version parsing failed")
ErrVersionParse is an error which is raised when srlinux version is failed to parse.
Functions ¶
This section is empty.
Types ¶
type CertificateCfg ¶
type CertificateCfg struct { // Certificate name on the node. CertName string `json:"cert_name,omitempty"` // Key name on the node. KeyName string `json:"key_name,omitempty"` // RSA keysize to use for key generation. KeySize uint32 `json:"key_size,omitempty"` // Common name to set in the cert. CommonName string `json:"common_name,omitempty"` }
CertificateCfg represents srlinux certificate configuration parameters.
func (*CertificateCfg) DeepCopy ¶
func (in *CertificateCfg) DeepCopy() *CertificateCfg
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateCfg.
func (*CertificateCfg) DeepCopyInto ¶
func (in *CertificateCfg) DeepCopyInto(out *CertificateCfg)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NodeConfig ¶
type NodeConfig struct { Command []string `json:"command,omitempty"` // Command to pass into pod. Args []string `json:"args,omitempty"` // Command args to pass into the pod. Image string `json:"image,omitempty"` // Docker image to use with pod. // Map of environment variables to pass into the pod. Env map[string]string `json:"env,omitempty"` // Specific entry point command for accessing the pod. EntryCommand string `json:"entry_command,omitempty"` // Mount point for configuration inside the pod. Should point to a dir that contains ConfigFile ConfigPath string `json:"config_path,omitempty"` // Startup configuration file name for the pod. Set in the kne topo and created by kne as a config map ConfigFile string `json:"config_file,omitempty"` // When set to true by kne, srlinux controller will attempt to mount the file with startup config to the pod ConfigDataPresent bool `json:"config_data_present,omitempty"` Cert *CertificateCfg `json:"cert,omitempty"` Sleep uint32 `json:"sleep,omitempty"` // Sleep time before starting the pod. }
NodeConfig represents srlinux node configuration parameters.
func (*NodeConfig) DeepCopy ¶
func (in *NodeConfig) DeepCopy() *NodeConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeConfig.
func (*NodeConfig) DeepCopyInto ¶
func (in *NodeConfig) DeepCopyInto(out *NodeConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*NodeConfig) GetArgs ¶
func (n *NodeConfig) GetArgs() []string
GetArgs gets arguments from srlinux node configuration.
func (*NodeConfig) GetCommand ¶
func (n *NodeConfig) GetCommand() []string
GetCommand gets command from srlinux node configuration.
type SrlVersion ¶ added in v0.4.0
type SrlVersion struct { Major string `json:"major,omitempty"` Minor string `json:"minor,omitempty"` Patch string `json:"patch,omitempty"` Build string `json:"build,omitempty"` Commit string `json:"commit,omitempty"` }
SrlVersion represents an sr linux version as a set of fields.
func (*SrlVersion) DeepCopy ¶ added in v0.4.0
func (in *SrlVersion) DeepCopy() *SrlVersion
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SrlVersion.
func (*SrlVersion) DeepCopyInto ¶ added in v0.4.0
func (in *SrlVersion) DeepCopyInto(out *SrlVersion)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Srlinux ¶
type Srlinux struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec SrlinuxSpec `json:"spec,omitempty"` Status SrlinuxStatus `json:"status,omitempty"` // license key from license secret that contains a license file for this Srlinux LicenseKey string `json:"license_key,omitempty"` }
Srlinux is the Schema for the srlinuxes API +kubebuilder:printcolumn:name="Image",type="string",JSONPath=".status.image" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
func (*Srlinux) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Srlinux.
func (*Srlinux) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Srlinux) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Srlinux) InitLicenseKey ¶ added in v0.4.0
InitLicenseKey sets the Srlinux.LicenseKey to a value of a key that matches MAJOR-MINOR.key of a passed secret. Where MAJOR-MINOR is retrieved from the image version. If such key doesn't exist, it checks if a wildcard `all.key` is found in that secret, if nothing found, LicenseKey stays empty, which denotes that no license was found for Srlinux.
type SrlinuxList ¶
type SrlinuxList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Srlinux `json:"items"` }
SrlinuxList contains a list of Srlinux.
func (*SrlinuxList) DeepCopy ¶
func (in *SrlinuxList) DeepCopy() *SrlinuxList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SrlinuxList.
func (*SrlinuxList) DeepCopyInto ¶
func (in *SrlinuxList) DeepCopyInto(out *SrlinuxList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SrlinuxList) DeepCopyObject ¶
func (in *SrlinuxList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type SrlinuxSpec ¶
type SrlinuxSpec struct { Config *NodeConfig `json:"config,omitempty"` NumInterfaces int `json:"num-interfaces,omitempty"` Constraints map[string]string `json:"constraints,omitempty"` // Model encodes SR Linux variant (ixr-d3, ixr-6e, etc) Model string `json:"model,omitempty"` // Version may be set in kne topology as a mean to explicitly provide version information // in case it is not encoded in the image tag Version string `json:"version,omitempty"` }
SrlinuxSpec defines the desired state of Srlinux.
func (*SrlinuxSpec) DeepCopy ¶
func (in *SrlinuxSpec) DeepCopy() *SrlinuxSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SrlinuxSpec.
func (*SrlinuxSpec) DeepCopyInto ¶
func (in *SrlinuxSpec) DeepCopyInto(out *SrlinuxSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SrlinuxSpec) GetConfig ¶
func (s *SrlinuxSpec) GetConfig() *NodeConfig
GetConfig gets config from srlinux spec.
func (*SrlinuxSpec) GetConstraints ¶
func (s *SrlinuxSpec) GetConstraints() map[string]string
GetConstraints gets constraints from srlinux spec, default constraints are returned if none are present in the spec.
func (*SrlinuxSpec) GetImage ¶
func (s *SrlinuxSpec) GetImage() string
GetImage returns the srlinux container image name that is used in pod spec if Config.Image is provided it takes precedence over all other option if not, the Spec.Version is used as a tag for public container image ghcr.io/nokia/srlinux.
func (*SrlinuxSpec) GetImageVersion ¶ added in v0.4.0
func (s *SrlinuxSpec) GetImageVersion() (*SrlVersion, error)
GetImageVersion finds an srlinux image version by looking at the Image field of the spec as well as at Version field. When Version field is set it is returned. In other cases, Image string is evaluated and it's tag substring is parsed. If no tag is present, or tag is latest, the 0.0 version is assumed to be in use.
func (*SrlinuxSpec) GetModel ¶
func (s *SrlinuxSpec) GetModel() string
GetModel gets srlinux model (aka variant) from srlinux spec, default srlinux variant is returned if none present in the spec.
type SrlinuxStatus ¶
type SrlinuxStatus struct { // Image used to run srlinux pod Image string `json:"image,omitempty"` }
SrlinuxStatus defines the observed state of Srlinux.
func (*SrlinuxStatus) DeepCopy ¶
func (in *SrlinuxStatus) DeepCopy() *SrlinuxStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SrlinuxStatus.
func (*SrlinuxStatus) DeepCopyInto ¶
func (in *SrlinuxStatus) DeepCopyInto(out *SrlinuxStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.