internal

package
v0.0.0-...-f2a3559 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationPrefix       = "k8s.score.dev/"
	WorkloadKindAnnotation = AnnotationPrefix + "kind"
)

Variables

View Source
var K8sCodecFactory = serializer.CodecFactory{}
View Source
var YamlSerializerInfo = runtime.SerializerInfo{}

Functions

func DerefOr

func DerefOr[k any](input *k, def k) k

func EncodeSecretReference

func EncodeSecretReference(secret, key string) string

func FindAnnotation

func FindAnnotation(metadata map[string]interface{}, annotation string) (string, bool)

func FindFirstUnresolvedSecretRef

func FindFirstUnresolvedSecretRef(path string, v interface{}) (string, bool)

func ListAnnotations

func ListAnnotations(metadata map[string]interface{}) []string

func PatchMap

func PatchMap(current map[string]interface{}, patch map[string]interface{}) map[string]interface{}

PatchMap performs a JSON Merge Patch as defined in https://datatracker.ietf.org/doc/html/rfc7386.

This should return a new map without modifying the current or patch inputs. Notes:

  • if new is nil, the output is an empty object - this allows for in-place
  • if a key is not a map, it will be treated as scalar according to the JSON Merge Patch strategy. This includes structs and slices.

func Ref

func Ref[k any](input k) *k

Types

type SecretRef

type SecretRef struct {
	Name string
	Key  string
}

func DecodeSecretReferences

func DecodeSecretReferences(source string) ([]string, []SecretRef, error)

DecodeSecretReferences resolves a string in a kubernetes manifest that may contain secret references into a useful string or reference to the real secret itself. These can be embedded in: - environment variables - file mounts where the file contains only the secret

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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