v1alpha1

package
v1.0.1-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package v1alpha1 contains PodFilesystemSync +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/riotkit-org/volume-syncing-controller/pkg/apis/riotkit.org +k8s:defaulter-gen=TypeMeta +groupName=riotkit.org

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeBuilder collects functions that add things to a scheme.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme applies all the stored functions to the scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: riotkitorg.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AllowedDirectionsSpec

type AllowedDirectionsSpec struct {
	// +kubebuilder:default:=true
	ToRemote bool `json:"toRemote,omitempty"`

	// +kubebuilder:default:=true
	FromRemote bool `json:"fromRemote,omitempty"`
}

AllowedDirectionsSpec is describing if we can upload or download files

func (*AllowedDirectionsSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllowedDirectionsSpec.

func (*AllowedDirectionsSpec) DeepCopyInto

func (in *AllowedDirectionsSpec) DeepCopyInto(out *AllowedDirectionsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AutomaticEncryptionSpec

type AutomaticEncryptionSpec struct {
	// +kubebuilder:default:=false
	Enabled    bool   `json:"enabled,omitempty"`
	SecretName string `json:"secretName"`
}

AutomaticEncryptionSpec enables automatic encryption

func (*AutomaticEncryptionSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutomaticEncryptionSpec.

func (*AutomaticEncryptionSpec) DeepCopyInto

func (in *AutomaticEncryptionSpec) DeepCopyInto(out *AutomaticEncryptionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ChangesWatchingMethod

type ChangesWatchingMethod string

+kubebuilder:validation:Enum=scheduler;fsnotify

type CleanUpSpec

type CleanUpSpec struct {
	// +kubebuilder:default:=true
	Remote bool `json:"remote,omitempty"`
	// +kubebuilder:default:=true
	Local bool `json:"local,omitempty"`
	// +kubebuilder:default:=false
	ForceRemote bool `json:"forceRemote,omitempty"`
	// +kubebuilder:default:=false
	ForceLocal bool `json:"forceLocal,omitempty"`
}

func (*CleanUpSpec) DeepCopy

func (in *CleanUpSpec) DeepCopy() *CleanUpSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanUpSpec.

func (*CleanUpSpec) DeepCopyInto

func (in *CleanUpSpec) DeepCopyInto(out *CleanUpSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ContainerPlacement

type ContainerPlacement string

+kubebuilder:validation:Enum=before;after;first;last

type InitContainerPlacementSpec

type InitContainerPlacementSpec struct {
	ContainerReference string             `json:"containerReference,omitempty"`
	Placement          ContainerPlacement `json:"placement,omitempty"`
}

InitContainerPlacementSpec allows to define, where initContainer should be placed

func (*InitContainerPlacementSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitContainerPlacementSpec.

func (*InitContainerPlacementSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*InitContainerPlacementSpec) GetPlacement

func (*InitContainerPlacementSpec) Validate

func (ic *InitContainerPlacementSpec) Validate() error

type LocationStatus

type LocationStatus struct {
	Directory            string `json:"directory"`
	SynchronizedToRemote bool   `json:"synchronizedToRemote"`
}

func (*LocationStatus) DeepCopy

func (in *LocationStatus) DeepCopy() *LocationStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocationStatus.

func (*LocationStatus) DeepCopyInto

func (in *LocationStatus) DeepCopyInto(out *LocationStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PermissionsSpec

type PermissionsSpec struct {
	UID string `json:"uid,omitempty"`
	GID string `json:"gid,omitempty"`
}

PermissionsSpec defines permissions to files inside Pod, to be able to run as non-root

func (*PermissionsSpec) DeepCopy

func (in *PermissionsSpec) DeepCopy() *PermissionsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PermissionsSpec.

func (*PermissionsSpec) DeepCopyInto

func (in *PermissionsSpec) DeepCopyInto(out *PermissionsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodEnvironment

type PodEnvironment map[string]string

func (PodEnvironment) DeepCopy

func (in PodEnvironment) DeepCopy() PodEnvironment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodEnvironment.

func (PodEnvironment) DeepCopyInto

func (in PodEnvironment) DeepCopyInto(out *PodEnvironment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodEnvironmentFromSecrets

type PodEnvironmentFromSecrets []v1.SecretReference

func (PodEnvironmentFromSecrets) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodEnvironmentFromSecrets.

func (PodEnvironmentFromSecrets) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodFilesystemSync

type PodFilesystemSync struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PodFilesystemSyncSpec `json:"spec"`
	Status SynchronizationStatus `json:"status,omitempty"`
}

PodFilesystemSync represents a filesystem/volume synchronization specification for given Pod +kubebuilder:subresource:status

func NewPodFilesystemSync

func NewPodFilesystemSync() PodFilesystemSync

NewPodFilesystemSync is making a new instance of a resource making sure that defaults will be respected

func (*PodFilesystemSync) ClaimDirectoryByPod

func (in *PodFilesystemSync) ClaimDirectoryByPod(pod *v1.Pod) error

ClaimDirectoryByPod mark target directory claimed by Pod as synchronized

func (*PodFilesystemSync) DeepCopy

func (in *PodFilesystemSync) DeepCopy() *PodFilesystemSync

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodFilesystemSync.

func (*PodFilesystemSync) DeepCopyInto

func (in *PodFilesystemSync) DeepCopyInto(out *PodFilesystemSync)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PodFilesystemSync) DeepCopyObject

func (in *PodFilesystemSync) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*PodFilesystemSync) IsPodMatching

func (in *PodFilesystemSync) IsPodMatching(pod *v1.Pod) bool

IsPodMatching is `kind: Pod` matching .spec.podSelector of `kind: PodFilesystemSync`?

func (*PodFilesystemSync) ResolveRemoteDirectoryForPod

func (in *PodFilesystemSync) ResolveRemoteDirectoryForPod(pod *v1.Pod) (string, error)

ResolveRemoteDirectoryForPod is building remote path that will be used for given Pod. Depending on the configuration the `.Spec.RemotePath` may be a JINJA2 template

and this method allows to use syntax like {% pod.metadata.labels["directoryName"] %}

func (*PodFilesystemSync) ShouldRestoreFilesFromRemote

func (in *PodFilesystemSync) ShouldRestoreFilesFromRemote(pod *v1.Pod) (bool, error)

ShouldRestoreFilesFromRemote decides if files could be restored from remote

func (*PodFilesystemSync) ShouldSynchronizeToRemote

func (in *PodFilesystemSync) ShouldSynchronizeToRemote() bool

func (*PodFilesystemSync) WasAlreadySynchronized

func (in *PodFilesystemSync) WasAlreadySynchronized(pod *v1.Pod) (bool, error)

WasAlreadySynchronized tells if Pod's filesystem was already at least one time synchronized

type PodFilesystemSyncList

type PodFilesystemSyncList struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PodFilesystemSync `json:"items"`
}

PodFilesystemSyncList represents a list

func (*PodFilesystemSyncList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodFilesystemSyncList.

func (*PodFilesystemSyncList) DeepCopyInto

func (in *PodFilesystemSyncList) DeepCopyInto(out *PodFilesystemSyncList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PodFilesystemSyncList) DeepCopyObject

func (in *PodFilesystemSyncList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PodFilesystemSyncSpec

type PodFilesystemSyncSpec struct {
	PodSelector *metav1.LabelSelector `json:"podSelector"`

	LocalPath  string `json:"localPath"`
	RemotePath string `json:"remotePath"`

	SyncOptions            SyncOptionsSpec            `json:"syncOptions"`
	InitContainerPlacement InitContainerPlacementSpec `json:"initContainerPlacement,omitempty"`

	// use environment to configure remotes and encryption
	// values can contain Go-Template syntax e.g. {{ .pod.metadata.labels["some-label"] }}
	Env            PodEnvironment            `json:"env,omitempty"`
	EnvFromSecrets PodEnvironmentFromSecrets `json:"envFromSecrets,omitempty"`

	// automatic encryption is creating a `kind: Secret` if not exists and configuring encryption automatically
	AutomaticEncryption AutomaticEncryptionSpec `json:"automaticEncryption,omitempty"`
	// +kubebuilder:default:=false
	Debug bool `json:"debug,omitempty"`
}

PodFilesystemSyncSpec represents .spec

func (*PodFilesystemSyncSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodFilesystemSyncSpec.

func (*PodFilesystemSyncSpec) DeepCopyInto

func (in *PodFilesystemSyncSpec) DeepCopyInto(out *PodFilesystemSyncSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SyncOptionsSpec

type SyncOptionsSpec struct {
	// +kubebuilder:default:=@every 15m
	Schedule string `json:"schedule,omitempty"` // will default to every 15 minutes
	// +kubebuilder:default:=scheduler
	Method               ChangesWatchingMethod `json:"method,omitempty"` // scheduler or fsnotify
	MaxOneSyncPerMinutes string                `json:"maxOneSyncPerMinutes,omitempty"`
	Permissions          PermissionsSpec       `json:"permissions,omitempty"`

	// +kubebuilder:default:=true
	RestoreRemoteOnFirstRun bool `json:"restoreRemoteOnFirstRun,omitempty"`

	CleanUp           CleanUpSpec           `json:"cleanUp,omitempty"`
	AllowedDirections AllowedDirectionsSpec `json:"allowedDirections,omitempty"`
}

SyncOptionsSpec .spec.syncOptions, synchronization detailed options

func (*SyncOptionsSpec) DeepCopy

func (in *SyncOptionsSpec) DeepCopy() *SyncOptionsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SyncOptionsSpec.

func (*SyncOptionsSpec) DeepCopyInto

func (in *SyncOptionsSpec) DeepCopyInto(out *SyncOptionsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SynchronizationStatus

type SynchronizationStatus struct {
	Locations []LocationStatus `json:"locations"`
}

func (*SynchronizationStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SynchronizationStatus.

func (*SynchronizationStatus) DeepCopyInto

func (in *SynchronizationStatus) DeepCopyInto(out *SynchronizationStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL