Documentation
¶
Index ¶
- Variables
- func AddOrSwapString(strings []string, str string) (bool, []string)
- func AddString(finalizers []string, f string) []string
- func ContainString(finalizers []string, f string) bool
- func Decode(b []byte) (res []string, err error)
- func GetCronJobImage(obj *unstructured.Unstructured) (image []string)
- func GetDeploymentImage(obj *unstructured.Unstructured) (image []string)
- func GetJobImage(obj *unstructured.Unstructured) (image []string)
- func GetPodImage(obj *unstructured.Unstructured) (image []string)
- func GetResourcesAndImages(ctx context.Context, logger logr.Logger, c client.Client, ...) (resources []v1alpha1.Resource, images []string, err error)
- func GetStatefulSetImage(obj *unstructured.Unstructured) (image []string)
- func GzipData(data string) ([]byte, error)
- func IgnoreNotFound(err error) error
- func OmitManagedFields(o runtime.Object) runtime.Object
- func ParseContainerImage(containers []corev1.Container) (image []string)
- func ParseValues(dir string, reference *apiextensionsv1.JSON) (fileName string, err error)
- func ParseValuesReference(ctx context.Context, cli client.Client, ns, dir string, ...) (fileName string, err error)
- func RemoveString(finalziers []string, f string) []string
- func ResourceDiffStr(ctx context.Context, source, exist *unstructured.Unstructured, ...) (string, error)
- func SplitYAML(yamlData []byte) ([]*unstructured.Unstructured, error)
- func SplitYAMLToString(yamlData []byte) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
var ComponentPlanDiffIgnorePaths = []string{
"metadata.generation",
"metadata.resourceVersion",
"metadata.labels.helm.sh/chart",
"spec.template.metadata.labels.helm.sh/chart",
}
ComponentPlanDiffIgnorePaths is the list of paths to ignore when comparing These fields will almost certainly change when componentplan is updated, and displaying these changes will only result in more invalid information, so they need to be ignored
Functions ¶
func AddOrSwapString ¶
AddOrSwapString Add an element to the string array, swap it with the last element if it is in the array, or append it directly to the end if it does not exist. Gives whether the array has changed
Example:
[], "a" -> true, []string{"a"}
["a"], "b" -> true, []string{"a", "b"}
["a", "b"], "a" -> true, []string{"b", "a"}
["a", "b", "a"], "a" -> false, []string{"a", "b", "a"}
func ContainString ¶
func Decode ¶
Decode decodes the bytes of data into string slice Data must contain a base64 encoded gzipped string of string slice, otherwise an error is returned.
func GetCronJobImage ¶
func GetCronJobImage(obj *unstructured.Unstructured) (image []string)
func GetDeploymentImage ¶
func GetDeploymentImage(obj *unstructured.Unstructured) (image []string)
func GetJobImage ¶
func GetJobImage(obj *unstructured.Unstructured) (image []string)
func GetPodImage ¶
func GetPodImage(obj *unstructured.Unstructured) (image []string)
func GetResourcesAndImages ¶
func GetResourcesAndImages(ctx context.Context, logger logr.Logger, c client.Client, data, namespace string) (resources []v1alpha1.Resource, images []string, err error)
GetResourcesAndImages get resource slices, image lists from manifests
func GetStatefulSetImage ¶
func GetStatefulSetImage(obj *unstructured.Unstructured) (image []string)
func IgnoreNotFound ¶
IgnoreNotFound returns the supplied error, or nil if the error indicates a Kubernetes resource was not found.
func ParseContainerImage ¶
func ParseValues ¶
func ParseValues(dir string, reference *apiextensionsv1.JSON) (fileName string, err error)
ParseValues parses Values
func ParseValuesReference ¶
func ParseValuesReference(ctx context.Context, cli client.Client, ns, dir string, reference *v1alpha1.ValuesReference) (fileName string, err error)
ParseValuesReference parses ValuesReference
func RemoveString ¶
func ResourceDiffStr ¶
func ResourceDiffStr(ctx context.Context, source, exist *unstructured.Unstructured, ignorePaths []string, c client.Client) (string, error)
func SplitYAML ¶
func SplitYAML(yamlData []byte) ([]*unstructured.Unstructured, error)
SplitYAML splits a YAML file into unstructured objects. Returns list of all unstructured objects found in the yaml. If an error occurs, returns objects that have been parsed so far too. inspire by github.com/argoproj/gitops-engine/pkg/utils/kube
func SplitYAMLToString ¶
SplitYAMLToString splits a YAML file into strings. Returns list of yamls found in the yaml. If an error occurs, returns objects that have been parsed so far too. inspire by github.com/argoproj/gitops-engine/pkg/utils/kube
Types ¶
This section is empty.