pkg/api: move HasObjectMetaSystemFieldValues into apimachinery

This commit is contained in:
Dr. Stefan Schimanski
2017-01-29 22:15:52 +01:00
parent 96cfe7b938
commit d6adb51e6c
5 changed files with 11 additions and 32 deletions

View File

@@ -226,3 +226,9 @@ func NewUIDPreconditions(uid string) *Preconditions {
u := types.UID(uid)
return &Preconditions{UID: &u}
}
// HasObjectMetaSystemFieldValues returns true if fields that are managed by the system on ObjectMeta have values.
func HasObjectMetaSystemFieldValues(meta *ObjectMeta) bool {
return !meta.CreationTimestamp.Time.IsZero() ||
len(meta.UID) != 0
}