Adding default StorageClass annotation printout for resource_printer

This commit is contained in:
Scott Creeley
2016-10-12 15:49:16 -04:00
parent f39e86c0a5
commit 86f1a94be5
16 changed files with 274 additions and 164 deletions

View File

@@ -236,6 +236,20 @@ var standardFinalizers = sets.NewString(
FinalizerOrphan,
)
// HasAnnotation returns a bool if passed in annotation exists
func HasAnnotation(obj ObjectMeta, ann string) bool {
_, found := obj.Annotations[ann]
return found
}
// SetMetaDataAnnotation sets the annotation and value
func SetMetaDataAnnotation(obj *ObjectMeta, ann string, value string) {
if obj.Annotations == nil {
obj.Annotations = make(map[string]string)
}
obj.Annotations[ann] = value
}
func IsStandardFinalizerName(str string) bool {
return standardFinalizers.Has(str)
}