Documentation ¶
Index ¶
- Constants
- func AddOwnerRefToObject(object metav1.Object, ownerRef metav1.OwnerReference)
- func AreMapsSame(lhs, rhs map[string]string) bool
- func AreTolerationsSame(lhs, rhs []corev1.Toleration) bool
- func CalculateMD5Hash(text string) (string, error)
- func CompareResources(current, desired v1.ResourceRequirements) (bool, v1.ResourceRequirements)
- func ContainerSecurityContext() *corev1.SecurityContext
- func Contains(list []string, s string) bool
- func ContainsString(slice []string, s string) bool
- func EnsureLinuxNodeSelector(selectors map[string]string) map[string]string
- func EnvValueEqual(env1, env2 []corev1.EnvVar) bool
- func EnvVarResourceFieldSelectorEqual(resource1, resource2 corev1.ResourceFieldSelector) bool
- func EnvVarSourceEqual(esource1, esource2 corev1.EnvVarSource) bool
- func GetInt32(value int32) *int32
- func GetInt64(value int64) *int64
- func GetMajorVersion(v string) string
- func GetWorkingDirFilePath(toFile string) string
- func LookupEnvWithDefault(envName, defaultValue string) string
- func PodSecurityContext() corev1.PodSecurityContext
- func RandStringBytes(length uint) (string, error)
- func RemoveString(slice []string, s string) (result []string)
- func SetProxyEnvVars(proxyConfig *configv1.Proxy) []corev1.EnvVar
- func ToJSON(obj interface{}) (string, error)
- func WriteToWorkingDirFile(toFile string, value []byte) error
Constants ¶
const ( DefaultWorkingDir = "/tmp/ocp-eo" OsNodeLabel = "kubernetes.io/os" LinuxValue = "linux" )
Variables ¶
This section is empty.
Functions ¶
func AddOwnerRefToObject ¶
func AddOwnerRefToObject(object metav1.Object, ownerRef metav1.OwnerReference)
AddOwnerRefToObject adds the parent as an owner to the child
func AreMapsSame ¶
func AreTolerationsSame ¶
func AreTolerationsSame(lhs, rhs []corev1.Toleration) bool
func CalculateMD5Hash ¶
CalculateMD5Hash returns a MD5 hash of the give text
func CompareResources ¶
func CompareResources(current, desired v1.ResourceRequirements) (bool, v1.ResourceRequirements)
func ContainerSecurityContext ¶
func ContainerSecurityContext() *corev1.SecurityContext
func ContainsString ¶
func EnsureLinuxNodeSelector ¶
EnsureLinuxNodeSelector takes given selector map and returns a selector map with linux node selector added into it. If there is already a node type selector and is different from "linux" then it is overridden. See https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#interlude-built-in-node-labels
func EnvValueEqual ¶
* EnvValueEqual - check if 2 EnvValues are equal or not Notes: - reflect.DeepEqual does not return expected results if the to-be-compared value is a pointer. - needs to adjust with k8s.io/api/core/v#/types.go when the types are updated. *
func EnvVarResourceFieldSelectorEqual ¶
func EnvVarResourceFieldSelectorEqual(resource1, resource2 corev1.ResourceFieldSelector) bool
func EnvVarSourceEqual ¶
func EnvVarSourceEqual(esource1, esource2 corev1.EnvVarSource) bool
func GetMajorVersion ¶
func GetWorkingDirFilePath ¶
func LookupEnvWithDefault ¶
func PodSecurityContext ¶
func PodSecurityContext() corev1.PodSecurityContext
func RandStringBytes ¶
func RemoveString ¶
func WriteToWorkingDirFile ¶
Types ¶
This section is empty.