util

package
v0.0.0-...-7a1d551 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArtifactBasePath = os.Getenv(artifactBasePathEnv)

ArtifactBasePath is default submarine path, We can use it instead of the yaml path to solve the relative path problem when testing

Functions

func CompareEnv

func CompareEnv(a, b []corev1.EnvVar) bool

CompareEnv will determine if two EnvVars are equal

func CompareInt64

func CompareInt64(a, b *int64) bool

CompareInt64 will determine if two int64 are equal

func CompareMap

func CompareMap(a, b map[string]string) bool

CompareMap will determine if two maps are equal

func ComparePullSecrets

func ComparePullSecrets(a, b []corev1.LocalObjectReference) bool

ComparePullSecrets will determine if two LocalObjectReferences are equal

func CompareSecret

func CompareSecret(oldSecret, newSecret *corev1.Secret) bool

CompareSecret will determine if two Secrets are equal

func CompareSlice

func CompareSlice(a, b []string) bool

CompareSlice will determine if two slices are equal

func CreateIstioSidecarSecurityContext

func CreateIstioSidecarSecurityContext(istioSidecarUid int64) *corev1.SecurityContext

CreateIstioSidecarSecurityContext will support runAsUser for sidecar proxy with istio, especially using istio CNI https://istio.io/latest/docs/setup/additional-setup/cni/#compatibility-with-application-init-containers

func GetSecretData

func GetSecretData(secret *corev1.Secret) map[string]string

GetSecretData will return secret data ( map[string]string )

func GetSubmarineCommon

GetSubmarineCommon will get `spec.common` and initialize it if it is nil to prevent NPE

func GetSubmarineCommonImage

func GetSubmarineCommonImage(submarine *submarineapacheorgv1.Submarine) *submarineapacheorgv1.CommonImage

GetSubmarineCommonImage will get `spec.common.image` and initialize it if it is nil to prevent NPE

func ParseDeploymentYaml

func ParseDeploymentYaml(relativePath string) (*appsv1.Deployment, error)

ParseDeploymentYaml parse Deployment from yaml file.

func ParsePersistentVolumeClaimYaml

func ParsePersistentVolumeClaimYaml(relativePath string) (*v1.PersistentVolumeClaim, error)

ParsePersistentVolumeClaimYaml parse PersistentVolumeClaimYaml from yaml file.

func ParseRoleBindingYaml

func ParseRoleBindingYaml(relativePath string) (*rbacv1.RoleBinding, error)

ParseRoleBindingYaml parse RoleBinding from yaml file.

func ParseRoleYaml

func ParseRoleYaml(relativePath string) (*rbacv1.Role, error)

ParseRoleYaml parse Role from yaml file.

func ParseSecretYaml

func ParseSecretYaml(relativePath string) (*v1.Secret, error)

ParseSecretYaml parse Secret from yaml file.

func ParseServiceAccountYaml

func ParseServiceAccountYaml(relativePath string) (*v1.ServiceAccount, error)

ParseServiceAccountYaml parse ServiceAccount from yaml file.

func ParseServiceYaml

func ParseServiceYaml(relativePath string) (*v1.Service, error)

ParseServiceYaml parse Service from yaml file.

func ParseStatefulSetYaml

func ParseStatefulSetYaml(relativePath string) (*appsv1.StatefulSet, error)

ParseStatefulSetYaml parse StatefulSets from yaml file.

func ParseVirtualService

func ParseVirtualService(relativePath string) (*istiov1alpha3.VirtualService, error)

ParseVirtualService parse VirtualService from yaml file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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