Documentation
¶
Overview ¶
Copyright 2020-2021 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.
Copyright 2020-2021 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 ¶
- func ChartNameByFile(name string) string
- func ContainsIntInSlice(numbers []int, number int) bool
- func ContainsStringInSlice(ss []string, str string) bool
- func CreateOrUpdate(ctx context.Context, r client.Client, o client.Object) (bool, error)
- func GetCaFromSecret(ctx context.Context, c client.Client, secretName, dataField, ns string) (crt []byte, err error)
- func GetFromConfigMap(ctx context.Context, c client.Client, name, ns, dataField string, ...) (interface{}, error)
- func IsMgmtCluster(clusterName string) bool
- func LastCondition(conditons []metav1.Condition) metav1.Condition
- func MergeMaps(a, b map[string]interface{}) map[string]interface{}
- func ObjectKeyFromString(str string) client.ObjectKey
- func Ordinalize(n int) string
- func RandomString(length int) string
- func ReleaseRevision(rel *release.Release) int
- func RemoveDuplicateTaints(taints []corev1.Taint) []corev1.Taint
- func Slugify(text string) string
- func Slugifyf(format string, a ...interface{}) string
- func ToUnstructured(rawyaml []byte) ([]unstructured.Unstructured, error)
- func ValuesChecksum(values chartutil.Values) string
- type LocalClusterType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChartNameByFile ¶ added in v0.32.0
func ContainsIntInSlice ¶ added in v0.36.24
func ContainsStringInSlice ¶
func CreateOrUpdate ¶
func GetCaFromSecret ¶ added in v0.34.0
func GetFromConfigMap ¶ added in v0.34.8
func IsMgmtCluster ¶ added in v0.34.0
func LastCondition ¶ added in v0.36.3
func MergeMaps ¶
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 Ordinalize ¶
Ordinalize takes an int and returns the ordinalized version of it. Eg. 1 --> 1st, 103 --> 103rd
func RandomString ¶ added in v0.34.0
func ReleaseRevision ¶
ReleaseRevision returns the revision of the given release.Release.
func RemoveDuplicateTaints ¶ added in v0.18.9
func Slugify ¶ added in v0.34.0
Slugify a string. The result will only contain lowercase letters, digits and dashes. It will not begin or end with a dash, and it will not contain runs of multiple dashes.
It is NOT forced into being ASCII, but may contain any Unicode characters, with the above restrictions.
func ToUnstructured ¶
func ToUnstructured(rawyaml []byte) ([]unstructured.Unstructured, error)
ToUnstructured takes a YAML and converts it to a list of Unstructured objects
func ValuesChecksum ¶
ValuesChecksum calculates and returns the SHA1 checksum for the given chartutil.Values.
Types ¶
type LocalClusterType ¶ added in v0.35.0
type LocalClusterType int8
const ( NonLocal LocalClusterType = iota NodeRetrieveError Kind Minikube )
func IsLocalCluster ¶ added in v0.32.0
// Asserts whether the current cluster is local, and the kind of local cluster. Each type is mapped to the enum <LocalClusterType>.