Use versioned taint annotations

The json annotations were removed from the unversioned types.
This commit is contained in:
Justin Santa Barbara 2017-01-12 23:52:54 -05:00
parent 5f0964c4b3
commit 9d6fddfa3e
1 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ func ApplyMasterTaints(kubeContext *KubernetesContext) error {
return fmt.Errorf("error querying nodes: %v", err)
}
taint := []api.Taint{{Key: "dedicated", Value: "master", Effect: "NoSchedule"}}
taint := []v1.Taint{{Key: "dedicated", Value: "master", Effect: "NoSchedule"}}
taintJSON, err := json.Marshal(taint)
if err != nil {
return fmt.Errorf("error serializing taint: %v", err)
@ -65,7 +65,7 @@ func ApplyMasterTaints(kubeContext *KubernetesContext) error {
for i := range nodes.Items {
node := &nodes.Items[i]
nodeTaintJSON := node.Annotations[api.TaintsAnnotationKey]
nodeTaintJSON := node.Annotations[v1.TaintsAnnotationKey]
if nodeTaintJSON != "" {
if nodeTaintJSON != string(taintJSON) {
glog.Infof("Node %q had unexpected taint: %v", node.Name, nodeTaintJSON)
@ -74,7 +74,7 @@ func ApplyMasterTaints(kubeContext *KubernetesContext) error {
}
nodePatchMetadata := &nodePatchMetadata{
Annotations: map[string]string{api.TaintsAnnotationKey: string(taintJSON)},
Annotations: map[string]string{v1.TaintsAnnotationKey: string(taintJSON)},
}
unschedulable := false
nodePatchSpec := &nodePatchSpec{