utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultReleaseName constant
	DefaultReleaseName = "<DriverDefaultReleaseName>"
	// DefaultReleaseNamespace constant
	DefaultReleaseNamespace = "<DriverDefaultReleaseNamespace>"
	// DefaultImagePullPolicy constant
	DefaultImagePullPolicy = "IfNotPresent"
	//KubeletConfigDir path
	KubeletConfigDir = "<KUBELET_CONFIG_DIR>"
)

Variables

This section is empty.

Functions

func CalculateState

func CalculateState(ctx context.Context, instance *csmv1.ContainerStorageModule, r ReconcileCSM, newStatus *csmv1.ContainerStorageModuleStatus) (bool, error)

CalculateState of pods

func GetDriverYaml

func GetDriverYaml(YamlString, kind string) (interface{}, error)

GetDriverYaml -

func GetModuleDefaultVersion

func GetModuleDefaultVersion(driverConfigVersion string, driverType csmv1.DriverType, moduleType csmv1.ModuleType, path string) (string, error)

GetModuleDefaultVersion -

func HandleSuccess

func HandleSuccess(ctx context.Context, instance *csmv1.ContainerStorageModule, r ReconcileCSM, newStatus, oldStatus *csmv1.ContainerStorageModuleStatus) (reconcile.Result, error)

HandleSuccess for csm

func HandleValidationError

func HandleValidationError(ctx context.Context, instance *csmv1.ContainerStorageModule, r ReconcileCSM,
	validationError error) (reconcile.Result, error)

HandleValidationError for csm

func LogBannerAndReturn

func LogBannerAndReturn(result reconcile.Result, err error) (reconcile.Result, error)

LogBannerAndReturn -

func ModifyCommonCR

func ModifyCommonCR(YamlString string, cr csmv1.ContainerStorageModule) string

ModifyCommonCR -

func ReplaceAllApplyCustomEnvs

func ReplaceAllApplyCustomEnvs(driverEnv []acorev1.EnvVarApplyConfiguration,
	commonEnv []corev1.EnvVar,
	nrEnv []corev1.EnvVar) []acorev1.EnvVarApplyConfiguration

ReplaceAllApplyCustomEnvs -

func ReplaceAllArgs

func ReplaceAllArgs(defaultArgs, crArgs []string) []string

ReplaceAllArgs -

func ReplaceAllContainerImageApply

func ReplaceAllContainerImageApply(img K8sImagesConfig, c *acorev1.ContainerApplyConfiguration)

ReplaceAllContainerImageApply -

func SetStatus

SetStatus of csm

func SplitYaml

func SplitYaml(gaintYAML []byte) ([][]byte, error)

SplitYaml divides a big bytes of yaml files in individual yaml files.

func UpdateSideCarApply

func UpdateSideCarApply(sideCars []csmv1.ContainerTemplate, c *acorev1.ContainerApplyConfiguration)

UpdateSideCarApply -

func UpdateStatus

UpdateStatus of csm

Types

type ControllerYAML

type ControllerYAML struct {
	Deployment confv1.DeploymentApplyConfiguration
	Rbac       RbacYAML
}

ControllerYAML -

type K8sImagesConfig

type K8sImagesConfig struct {
	K8sVersion string `json:"kubeversion" yaml:"kubeversion"`
	Images     struct {
		Attacher              string `json:"attacher" yaml:"attacher"`
		Provisioner           string `json:"provisioner" yaml:"provisioner"`
		Snapshotter           string `json:"snapshotter" yaml:"snapshotter"`
		Registrar             string `json:"registrar" yaml:"registrar"`
		Resizer               string `json:"resizer" yaml:"resizer"`
		Externalhealthmonitor string `json:"externalhealthmonitorcontroller" yaml:"externalhealthmonitorcontroller"`
	} `json:"images" yaml:"images"`
}

K8sImagesConfig -

type NodeYAML

type NodeYAML struct {
	DaemonSetApplyConfig confv1.DaemonSetApplyConfiguration
	Rbac                 RbacYAML
}

NodeYAML -

type OperatorConfig

type OperatorConfig struct {
	IsOpenShift     bool
	K8sVersion      K8sImagesConfig
	ConfigDirectory string
}

OperatorConfig -

type RbacYAML

type RbacYAML struct {
	ServiceAccount     corev1.ServiceAccount
	ClusterRole        rbacv1.ClusterRole
	ClusterRoleBinding rbacv1.ClusterRoleBinding
}

RbacYAML -

type ReconcileCSM

type ReconcileCSM interface {
	reconcile.Reconciler
	GetClient() crclient.Client
	GetUpdateCount() int32
	IncrUpdateCount()
}

ReconcileCSM is the interface which extends each of the respective Reconcile interfaces for drivers

Jump to

Keyboard shortcuts

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