Documentation ¶
Index ¶
- Constants
- Variables
- func APIServerCertificate(cfg *rest.Config) (*x509.Certificate, error)
- func AlreadyObserved(o interface{}, enableStatusSubresource bool) bool
- func AlreadyObserved2(old, nu interface{}, enableStatusSubresource bool) bool
- func BuildArgumentListFromMap(baseArguments map[string]string, overrideArguments map[string]string) []string
- func CreateJSONMergePatch(cur interface{}, mod interface{}, fns ...mergepatch.PreconditionFunc) ([]byte, error)
- func CreateJSONPatch(cur interface{}, mod interface{}) ([]byte, error)
- func CreateStrategicPatch(cur interface{}, mod interface{}, fns ...mergepatch.PreconditionFunc) ([]byte, error)
- func Decode(input interface{}, output interface{}) error
- func DeepHashObject(hasher hash.Hash, objectToWrite interface{})
- func DeleteInBackground() *metav1.DeleteOptions
- func Diff(x, y interface{}) string
- func Equal(x, y interface{}) bool
- func EqualAnnotation(x, y map[string]string) bool
- func FilterKeys(domainKey string, out, in map[string]string) map[string]string
- func GenerationHash(in metav1.Object) string
- func GetBool(m map[string]string, key string) (interface{}, error)
- func GetBoolValue(m map[string]string, key string) (bool, error)
- func GetDuration(m map[string]string, key string) (interface{}, error)
- func GetDurationValue(m map[string]string, key string) (time.Duration, error)
- func GetFloat(m map[string]string, key string) (interface{}, error)
- func GetFloatValue(m map[string]string, key string) (float64, error)
- func GetInt(m map[string]string, key string) (interface{}, error)
- func GetIntValue(m map[string]string, key string) (int, error)
- func GetKind(v interface{}) string
- func GetList(m map[string]string, key string) (interface{}, error)
- func GetListValue(m map[string]string, key string) ([]string, error)
- func GetMap(m map[string]string, key string) (interface{}, error)
- func GetMapValue(m map[string]string, key string) (map[string]string, error)
- func GetString(m map[string]string, key string) (interface{}, error)
- func GetStringValue(m map[string]string, key string) (string, error)
- func HasKey(m map[string]string, key string) bool
- func JsonDiff(old, new interface{}) (string, error)
- func MarshalToJson(obj runtime.Object, gv schema.GroupVersion) ([]byte, error)
- func MarshalToYAML(obj runtime.Object, gv schema.GroupVersion) ([]byte, error)
- func Namespace() string
- func ObjectHash(in metav1.Object) string
- func ParseArgumentListToMap(arguments []string) map[string]string
- func PossiblyInCluster() bool
- func RemoveKey(m map[string]string, key string) map[string]string
- func ReplaceArgument(command []string, argMutateFunc func(map[string]string) map[string]string) []string
- func RequireChainKeyUnchanged(key string) mergepatch.PreconditionFunc
- func StringToQuantityHookFunc() mapstructure.DecodeHookFunc
- func TestAKS(cert *x509.Certificate) (string, error)
- func TestEKS(cert *x509.Certificate) (string, error)
- func TestGKE() (string, error)
- func UnmarshalFromJSON(data []byte, gv schema.GroupVersion) (runtime.Object, error)
- func UnmarshalFromYAML(data []byte, gv schema.GroupVersion) (runtime.Object, error)
- func UpsertArgumentList(baseArgs []string, overrideArgs []string, protectedFlags ...string) []string
- type Codec
- type GetFunc
- type ParserFunc
Constants ¶
const LastAppliedConfigAnnotation = "kubectl.kubernetes.io/last-applied-configuration"
Variables ¶
var JSONSerializer = func() *Codec { mediaType := "application/json" info, ok := runtime.SerializerInfoForMediaType(scheme.Codecs.SupportedMediaTypes(), mediaType) if !ok { panic("unsupported media type " + mediaType) } return &Codec{&codec{info.Serializer}} }()
var YAMLSerializer = func() *Codec { mediaType := "application/yaml" info, ok := runtime.SerializerInfoForMediaType(scheme.Codecs.SupportedMediaTypes(), mediaType) if !ok { panic("unsupported media type " + mediaType) } return &Codec{&codec{info.Serializer}} }()
Functions ¶
func APIServerCertificate ¶
func APIServerCertificate(cfg *rest.Config) (*x509.Certificate, error)
func AlreadyObserved ¶
func AlreadyObserved2 ¶
func BuildArgumentListFromMap ¶
func BuildArgumentListFromMap(baseArguments map[string]string, overrideArguments map[string]string) []string
BuildArgumentListFromMap takes two string-string maps, one with the base arguments and one with optional override arguments
func CreateJSONMergePatch ¶
func CreateJSONMergePatch(cur interface{}, mod interface{}, fns ...mergepatch.PreconditionFunc) ([]byte, error)
func CreateJSONPatch ¶
func CreateStrategicPatch ¶
func CreateStrategicPatch(cur interface{}, mod interface{}, fns ...mergepatch.PreconditionFunc) ([]byte, error)
func Decode ¶
func Decode(input interface{}, output interface{}) error
Decode takes an input structure and uses reflection to translate it to the output structure. output must be a pointer to a map or struct.
func DeepHashObject ¶
DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.
func DeleteInBackground ¶
func DeleteInBackground() *metav1.DeleteOptions
func EqualAnnotation ¶
EqualAnnotation checks equality of annotations skipping `kubectl.kubernetes.io/last-applied-configuration` key
func GenerationHash ¶
func GetDurationValue ¶
func MarshalToJson ¶
MarshalToJson marshals an object into json.
func MarshalToYAML ¶
MarshalToYAML marshals an object into yaml.
func ObjectHash ¶
ObjectHash includes all top label fields (like data, spec) except TypeMeta, ObjectMeta and Status also includes Generation, Annotation and Labels form ObjectMeta
func ParseArgumentListToMap ¶
ParseArgumentListToMap parses a CLI argument list in the form "--foo=bar" to a string-string map
func PossiblyInCluster ¶
func PossiblyInCluster() bool
PossiblyInCluster returns true if loading an inside-kubernetes-cluster is possible.
func ReplaceArgument ¶
func ReplaceArgument(command []string, argMutateFunc func(map[string]string) map[string]string) []string
ReplaceArgument gets a command list; converts it to a map for easier modification, runs the provided function that returns a new modified map, and then converts the map back to a command string slice
func RequireChainKeyUnchanged ¶
func RequireChainKeyUnchanged(key string) mergepatch.PreconditionFunc
func StringToQuantityHookFunc ¶
func StringToQuantityHookFunc() mapstructure.DecodeHookFunc
StringToQuantityHookFunc returns a DecodeHookFunc that converts string to resource.Quantity
func UnmarshalFromJSON ¶
UnmarshalFromJSON unmarshals an object into json.
func UnmarshalFromYAML ¶
UnmarshalFromYAML unmarshals an object into yaml.