Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix node hostip issue #3986

Merged
merged 1 commit into from
Jan 30, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions pkg/registry/minion/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,18 @@ func (rs *REST) Update(ctx api.Context, obj runtime.Object) (<-chan apiserver.RE
// Clear out the self link, if specified, since it's not in the registry either.
minion.SelfLink = ""

// TODO: GetMinion will health check the minion, but we shouldn't require the minion to be
// running for updating labels.
oldMinion, err := rs.registry.GetMinion(ctx, minion.Name)
if err != nil {
return nil, err
}

// This is hacky, but minion HostIP has been moved from spec to status since v1beta2. When updating
// minion from older client, HostIP will be lost. Fix it here temporarily until we strip out status
// info from user input.
if minion.Status.HostIP == "" {
minion.Status.HostIP = oldMinion.Status.HostIP
}

if errs := validation.ValidateMinionUpdate(oldMinion, minion); len(errs) > 0 {
return nil, kerrors.NewInvalid("minion", minion.Name, errs)
}
Expand Down