// GetAnnotation returns the value of the annotation from the runtime.Object
// or an error if either is missing.
GetAnnotation returns the value of the annotation from the runtime.Object
or an error if either is missing.
// GetAnnotation returns the value of the annotation from the runtime . Object // or an error if either is missing .
func GetAnnotation(object runtime.Object, annotation string) (value string, err error) {
	if len(annotation) == 0 {
		return "", fmt.Errorf("annotation parameter must be set")
	}
	var accessor = meta.NewAccessor()
	annotations, err := accessor.Annotations(object)
	if err != nil {
		return "", fmt.Errorf("failed to get annotations for object: %v", err)
	}
	value, ok := annotations[annotation]
	if !ok {
		return "", fmt.Errorf("annotation %q not found", annotation)
	}
	return value, nil
}
func GetAnnotation ( object runtime . Object , annotation string ) ( value string , err error ) { if len ( annotation ) == 0 { return " " , fmt . Errorf ( " " ) } var accessor = meta . NewAccessor ( ) annotations , err := accessor . Annotations ( object ) if err != nil { return " " , fmt . Errorf ( " " , err ) } value , ok := annotations [ annotation ] if ! ok { return " " , fmt . Errorf ( " " , annotation ) } return value , nil }
GetAnnotation returns the value of the annotation from the runtime.Object
or an error if either is missing.
GetAnnotation returns the value of the annotation from the runtime . Object or an error if either is missing .