Move APIs and core code to use metav1.ObjectMeta

This commit is contained in:
Clayton Coleman
2017-01-11 15:28:46 -05:00
parent 54d8ed001d
commit 36acd90aba
104 changed files with 486 additions and 865 deletions

View File

@@ -510,7 +510,7 @@ func (ctrl *PersistentVolumeController) setClaimProvisioner(claim *v1.Persistent
if !ok {
return nil, fmt.Errorf("Unexpected claim cast error : %v", claimClone)
}
v1.SetMetaDataAnnotation(&claimClone.ObjectMeta, annStorageProvisioner, class.Provisioner)
metav1.SetMetaDataAnnotation(&claimClone.ObjectMeta, annStorageProvisioner, class.Provisioner)
newClaim, err := ctrl.kubeClient.Core().PersistentVolumeClaims(claim.Namespace).Update(claimClone)
if err != nil {
return newClaim, err
@@ -525,14 +525,14 @@ func (ctrl *PersistentVolumeController) setClaimProvisioner(claim *v1.Persistent
// Stateless functions
func getClaimStatusForLogging(claim *v1.PersistentVolumeClaim) string {
bound := v1.HasAnnotation(claim.ObjectMeta, annBindCompleted)
boundByController := v1.HasAnnotation(claim.ObjectMeta, annBoundByController)
bound := metav1.HasAnnotation(claim.ObjectMeta, annBindCompleted)
boundByController := metav1.HasAnnotation(claim.ObjectMeta, annBoundByController)
return fmt.Sprintf("phase: %s, bound to: %q, bindCompleted: %v, boundByController: %v", claim.Status.Phase, claim.Spec.VolumeName, bound, boundByController)
}
func getVolumeStatusForLogging(volume *v1.PersistentVolume) string {
boundByController := v1.HasAnnotation(volume.ObjectMeta, annBoundByController)
boundByController := metav1.HasAnnotation(volume.ObjectMeta, annBoundByController)
claimName := ""
if volume.Spec.ClaimRef != nil {
claimName = fmt.Sprintf("%s/%s (uid: %s)", volume.Spec.ClaimRef.Namespace, volume.Spec.ClaimRef.Name, volume.Spec.ClaimRef.UID)