util

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright 2020 The UnDistro authors

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

This section is empty.

Variables

This section is empty.

Functions

func ContainsStringInSlice

func ContainsStringInSlice(ss []string, str string) bool

func CreateOrUpdate

func CreateOrUpdate(ctx context.Context, r client.Client, o client.Object) (bool, error)

func GetMachinesForCluster

func GetMachinesForCluster(ctx context.Context, c client.Client, cluster *capi.Cluster) (cp *capi.MachineList, w *capi.MachineList, err error)

func GetProviderMachinesUnstructured

func GetProviderMachinesUnstructured(ctx context.Context, c client.Client, list *capi.MachineList) (*unstructured.UnstructuredList, error)

func IsControlPlaneMachine

func IsControlPlaneMachine(machine *capi.Machine) bool

func MergeMaps

func MergeMaps(a, b map[string]interface{}) map[string]interface{}

MergeMaps merges map b into given map a and returns the result. It allows overwrites of map values with flat values, and vice versa. This is copied from https://github.com/helm/helm/blob/v3.3.0/pkg/cli/values/options.go#L88, as the public chartutil.CoalesceTables function does not allow overwriting maps with flat values.

func ObjectKeyFromString

func ObjectKeyFromString(str string) client.ObjectKey

func Ordinalize

func Ordinalize(n int) string

Ordinalize takes an int and returns the ordinalized version of it. Eg. 1 --> 1st, 103 --> 103rd

func ReleaseRevision

func ReleaseRevision(rel *release.Release) int

ReleaseRevision returns the revision of the given release.Release.

func ToUnstructured

func ToUnstructured(rawyaml []byte) ([]unstructured.Unstructured, error)

ToUnstructured takes a YAML and converts it to a list of Unstructured objects

func ValuesChecksum

func ValuesChecksum(values chartutil.Values) string

ValuesChecksum calculates and returns the SHA1 checksum for the given chartutil.Values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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