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, manifests []string) (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 IsCRD(u *unstructured.Unstructured) bool
- func IsNullList(obj *unstructured.Unstructured) bool
- 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." + v1alpha1.ComponentPlanKey, "spec.template.metadata.labels." + v1alpha1.ComponentPlanKey, "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, manifests []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 IsCRD ¶
func IsCRD(u *unstructured.Unstructured) bool
IsCRD returns true if the supplied object is a CRD inspire by github.com/argoproj/gitops-engine/pkg/utils/kube
func IsNullList ¶
func IsNullList(obj *unstructured.Unstructured) bool
IsNullList checks if the object is a "List" type where items is null instead of an empty list. Handles a corner case where obj.IsList() returns false when a manifest is like: --- apiVersion: v1 items: null kind: ConfigMapList copy from https://github.com/argoproj/argo-cd/blob/50b2f03657026a0987e4910eca4778e8950e6d87/reposerver/repository/repository.go#L1525
func ParseContainerImage ¶
func ParseValues ¶
func ParseValues(dir string, reference *apiextensionsv1.JSON) (fileName string, err error)
func ParseValuesReference ¶
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.