Skip to content

Commit

Permalink
Merge pull request #62242 from feiskyer/pod-cidr
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 63314, 63884, 63799, 63521, 62242). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Check CIDR before updating node status

**What this PR does / why we need it**:

Check CIDR before updating node status.  See #62164.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #62164

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
  • Loading branch information
Kubernetes Submit Queue committed May 16, 2018
2 parents 6934c4f + 91c6cfe commit 792832b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/kubelet/apis/cri/runtime/v1alpha2/api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/kubelet/apis/cri/runtime/v1alpha2/api.proto
Expand Up @@ -1047,7 +1047,8 @@ message RemoveImageRequest {
message RemoveImageResponse {}

message NetworkConfig {
// CIDR to use for pod IP addresses.
// CIDR to use for pod IP addresses. If the CIDR is empty, runtimes
// should omit it.
string pod_cidr = 1;
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/kubelet/kubelet_node_status.go
Expand Up @@ -384,7 +384,9 @@ func (kl *Kubelet) tryUpdateNodeStatus(tryNumber int) error {
return fmt.Errorf("nil %q node object", kl.nodeName)
}

kl.updatePodCIDR(node.Spec.PodCIDR)
if node.Spec.PodCIDR != "" {
kl.updatePodCIDR(node.Spec.PodCIDR)
}

kl.setNodeStatus(node)
// Patch the current status on the API server
Expand Down

0 comments on commit 792832b

Please sign in to comment.