Documentation
¶
Overview ¶
Package util provides common utility functions and constants for test operations
Package util provides common utility functions and constants for test operations
Index ¶
- Constants
- func AppendCACertsVolume(volumes []corev1.Volume) []corev1.Volume
- func AppendExtraConfigmapsVolumeMounts(volumeMounts []corev1.VolumeMount, ...) []corev1.VolumeMount
- func AppendExtraConfigmapsVolumes(volumes []corev1.Volume, extraConfigmaps []testv1beta1.ExtraConfigmapsMounts, ...) []corev1.Volume
- func AppendExtraMountsVolumeMounts(volumeMounts []corev1.VolumeMount, extraMounts []testv1beta1.ExtraVolMounts, ...) []corev1.VolumeMount
- func AppendExtraMountsVolumes(volumes []corev1.Volume, extraMounts []testv1beta1.ExtraVolMounts, ...) []corev1.Volume
- func AppendKubeconfigVolume(volumes []corev1.Volume, secretName string) []corev1.Volume
- func AppendSSHKeyVolume(volumes []corev1.Volume, volumeName, secretName string) []corev1.Volume
- func AppendSSHKeyVolumeWithPath(volumes []corev1.Volume, volumeName, secretName, keyName, keyPath string) []corev1.Volume
- func BuildTestPod(annotations map[string]string, capabilities []corev1.Capability, ...) *corev1.Pod
- func CreateCACertVolumeMount(mountPath string) corev1.VolumeMount
- func CreateConfigMapVolume(volumeName string, configMapName string, mode int32) corev1.Volume
- func CreateLogsPVCVolume(logsPVCName string) corev1.Volume
- func CreateOpenstackConfigMapVolume(configMapName string) corev1.Volume
- func CreateOpenstackConfigSecretVolume(secretName string) corev1.Volume
- func CreateOpenstackConfigSecretVolumeMount(secretName string, mountPath string) corev1.VolumeMount
- func CreateOpenstackConfigVolumeMount(configMapName string, mountPath string) corev1.VolumeMount
- func CreateTestOperatorCloudsConfigVolumeMount(mountPath string) corev1.VolumeMount
- func CreateTmpVolume() corev1.Volume
- func CreateVolumeMount(name string, mountPath string, readOnly bool) corev1.VolumeMount
- func CreateVolumeMountWithSubPath(name string, mountPath string, subPath string, readOnly bool) corev1.VolumeMount
- func CreateWorkdirVolume() corev1.Volume
- func GetSecurityContext(runAsUser int64, addCapabilities []corev1.Capability, privileged bool) corev1.SecurityContext
Constants ¶
const ( // TestOperatorCloudsConfigMapName is the name of the ConfigMap which contains // modified clouds.yaml obtained from openstack-config ConfigMap. The modified // CM is needed by some test frameworks (e.g., HorizonTest and Tobiko) TestOperatorCloudsConfigMapName = "test-operator-clouds-config" // TestOperatorEphemeralVolumeNameWorkdir is the name of the ephemeral workdir volume TestOperatorEphemeralVolumeNameWorkdir = "test-operator-ephemeral-workdir" // TestOperatorEphemeralVolumeNameTmp is the name of the ephemeral temporary volume TestOperatorEphemeralVolumeNameTmp = "test-operator-ephemeral-temporary" // TestOperatorLogsVolumeName is the name of logs volume TestOperatorLogsVolumeName = "test-operator-logs" // ExtraVolTypeUndefined can be used to label an extraMount which is // not associated to anything in particular ExtraVolTypeUndefined storage.ExtraVolType = "Undefined" )
const ( // ScriptsVolumeDefaultMode is the default permission for script volumes ScriptsVolumeDefaultMode int32 = 0755 // ScriptsVolumeConfidentialMode is the permission for confidential volumes ScriptsVolumeConfidentialMode int32 = 0420 // TLSCertificateMode is the permission for TLS certificates TLSCertificateMode int32 = 0444 // PrivateKeyMode is the permission for private keys PrivateKeyMode int32 = 0600 // PublicKeyMode is the permission for public keys PublicKeyMode int32 = 0644 // PublicInfoMode is the permission for public information PublicInfoMode int32 = 0744 )
Variables ¶
This section is empty.
Functions ¶
func AppendCACertsVolume ¶
AppendCACertsVolume appends the CA certificates volume
func AppendExtraConfigmapsVolumeMounts ¶
func AppendExtraConfigmapsVolumeMounts( volumeMounts []corev1.VolumeMount, extraConfigmaps []testv1beta1.ExtraConfigmapsMounts, ) []corev1.VolumeMount
AppendExtraConfigmapsVolumeMounts appends volume mounts from ExtraConfigmapsMounts spec
func AppendExtraConfigmapsVolumes ¶
func AppendExtraConfigmapsVolumes( volumes []corev1.Volume, extraConfigmaps []testv1beta1.ExtraConfigmapsMounts, defaultMode int32, ) []corev1.Volume
AppendExtraConfigmapsVolumes appends volumes from ExtraConfigmapsMounts spec
func AppendExtraMountsVolumeMounts ¶
func AppendExtraMountsVolumeMounts( volumeMounts []corev1.VolumeMount, extraMounts []testv1beta1.ExtraVolMounts, svc []storage.PropagationType, ) []corev1.VolumeMount
AppendExtraMountsVolumeMounts appends volume mounts from ExtraMounts spec
func AppendExtraMountsVolumes ¶
func AppendExtraMountsVolumes( volumes []corev1.Volume, extraMounts []testv1beta1.ExtraVolMounts, svc []storage.PropagationType, ) []corev1.Volume
AppendExtraMountsVolumes appends volumes from ExtraMounts spec
func AppendKubeconfigVolume ¶
AppendKubeconfigVolume appends a kubeconfig volume from a secret
func AppendSSHKeyVolume ¶
AppendSSHKeyVolume appends an SSH key volume from a secret
func AppendSSHKeyVolumeWithPath ¶
func AppendSSHKeyVolumeWithPath(volumes []corev1.Volume, volumeName, secretName, keyName, keyPath string) []corev1.Volume
AppendSSHKeyVolumeWithPath appends an SSH key volume from a secret with key path
func BuildTestPod ¶
func BuildTestPod( annotations map[string]string, capabilities []corev1.Capability, containerImage string, containerName string, envFromSource []corev1.EnvFromSource, envVars map[string]env.Setter, labels map[string]string, namespace string, nodeSelector map[string]string, podName string, privileged bool, resources corev1.ResourceRequirements, runAsGroup int64, runAsUser int64, seLinuxLevel string, tolerations []corev1.Toleration, volumeMounts []corev1.VolumeMount, volumes []corev1.Volume, ) *corev1.Pod
BuildTestPod creates a pod with common structure used by all test frameworks
func CreateCACertVolumeMount ¶
func CreateCACertVolumeMount(mountPath string) corev1.VolumeMount
CreateCACertVolumeMount creates a CA certificate volume mount
func CreateConfigMapVolume ¶
CreateConfigMapVolume creates a ConfigMap volume with the specified name and mode
func CreateLogsPVCVolume ¶
CreateLogsPVCVolume creates the test-operator-logs PVC volume
func CreateOpenstackConfigMapVolume ¶
CreateOpenstackConfigMapVolume creates the openstack-config ConfigMap volume
func CreateOpenstackConfigSecretVolume ¶
CreateOpenstackConfigSecretVolume creates the openstack-config-secret volume
func CreateOpenstackConfigSecretVolumeMount ¶
func CreateOpenstackConfigSecretVolumeMount(secretName string, mountPath string) corev1.VolumeMount
CreateOpenstackConfigSecretVolumeMount creates an openstack config secret volume mount
func CreateOpenstackConfigVolumeMount ¶
func CreateOpenstackConfigVolumeMount(configMapName string, mountPath string) corev1.VolumeMount
CreateOpenstackConfigVolumeMount creates an openstack config volume mount
func CreateTestOperatorCloudsConfigVolumeMount ¶
func CreateTestOperatorCloudsConfigVolumeMount(mountPath string) corev1.VolumeMount
CreateTestOperatorCloudsConfigVolumeMount creates a test-operator-clouds-config volume mount
func CreateTmpVolume ¶
CreateTmpVolume creates the ephemeral tmp volume
func CreateVolumeMount ¶
func CreateVolumeMount(name string, mountPath string, readOnly bool) corev1.VolumeMount
CreateVolumeMount creates a basic VolumeMount
func CreateVolumeMountWithSubPath ¶
func CreateVolumeMountWithSubPath(name string, mountPath string, subPath string, readOnly bool) corev1.VolumeMount
CreateVolumeMountWithSubPath creates a VolumeMount with a SubPath
func CreateWorkdirVolume ¶
CreateWorkdirVolume creates the ephemeral workdir volume
func GetSecurityContext ¶
func GetSecurityContext( runAsUser int64, addCapabilities []corev1.Capability, privileged bool, ) corev1.SecurityContext
GetSecurityContext returns a security context with the specified configuration
Types ¶
This section is empty.