util

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateApplyAnnotation

func CreateApplyAnnotation(obj runtime.Object) error

func FormatTime

func FormatTime(t time.Time) string

func GetGroupVersionKind

func GetGroupVersionKind(obj runtime.Object) (*schema.GroupVersionKind, error)

func GetModifiedConfiguration

func GetModifiedConfiguration(obj runtime.Object) ([]byte, error)

func GetOriginalConfiguration

func GetOriginalConfiguration(obj runtime.Object) ([]byte, error)

GetOriginalConfiguration retrieves the original configuration of the object from the annotation, or nil if no annotation was found.

func GetSvcNamesFromManifest

func GetSvcNamesFromManifest(manifest string) ([]string, error)

func IgnoreNotFoundError

func IgnoreNotFoundError(err error) error

func MergeLabels

func MergeLabels(from, to map[string]string) map[string]string

MergeLabels 新扩展的label 合并到之前的

func NewDecoder

func NewDecoder(rs *runtime.Scheme) *decoder

func NewResources

func NewResources(parsedYaml string, rs *runtime.Scheme) ([]*unstructured.Unstructured, error)

func ParseTime

func ParseTime(s string) (time.Time, error)

func SetFieldValueIsNotExist

func SetFieldValueIsNotExist(obj map[string]interface{}, value interface{}, fields ...string) map[string]interface{}

func SetGroupVersionKind

func SetGroupVersionKind(obj runtime.Object, gvk *schema.GroupVersionKind) (runtime.Object, error)

func Verify

func Verify(yamlStr string) ([]*unstructured.Unstructured, []error)

Types

type ObjGVK

type ObjGVK struct {
	Object runtime.Object
	GVK    *schema.GroupVersionKind
}

func ParseManifest

func ParseManifest(manifest string) ([]ObjGVK, error)

Jump to

Keyboard shortcuts

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