utils

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2020 IBM Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	CertManagerTimeRestartLabel string = "certmanager.k8s.io/time-restarted"
)

Variables

This section is empty.

Functions

func AppendAnnotations

func AppendAnnotations(lhsAnnotation, rhsAnnotation map[string]string) map[string]string

func AppendTolerations

func AppendTolerations(lhsTolerations, rhsTolerations []core.Toleration) []core.Toleration

func AreMapsSame

func AreMapsSame(lhs, rhs map[string]string) bool

func AreResourcesDifferent

func AreResourcesDifferent(current, desired interface{}) bool

func AreTolerationsSame

func AreTolerationsSame(lhs, rhs []core.Toleration) bool

func CompareResources

func CompareResources(current, desired v1.ResourceRequirements) (bool, v1.ResourceRequirements)

func ContainsString

func ContainsString(slice []string, s string) bool

func EnvValueEqual

func EnvValueEqual(env1, env2 []core.EnvVar) bool

* 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 core.ResourceFieldSelector) bool

func EnvVarSourceEqual

func EnvVarSourceEqual(esource1, esource2 core.EnvVarSource) bool

func GetAnnotation

func GetAnnotation(key string, meta metav1.ObjectMeta) (string, bool)

GetAnnotation returns the value of an annoation for a given key and true if the key was found

func GetBool

func GetBool(value bool) *bool

func GetInt32

func GetInt32(value int32) *int32

func GetInt64

func GetInt64(value int64) *int64

func IsDaemonsetDifferent

func IsDaemonsetDifferent(current *apps.DaemonSet, desired *apps.DaemonSet) (*apps.DaemonSet, bool)

func IsDeploymentDifferent

func IsDeploymentDifferent(current *apps.Deployment, desired *apps.Deployment) (*apps.Deployment, bool)

func IsServiceDifferent

func IsServiceDifferent(current *core.Service, desired *core.Service) (*core.Service, bool)

func PodVolumeEquivalent

func PodVolumeEquivalent(lhs, rhs []core.Volume) bool

func RemoveString

func RemoveString(slice []string, s string) (result []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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