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 bug in apiserver service cidr split #85968

Merged
merged 2 commits into from
Dec 5, 2019

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Dec 5, 2019

What type of PR is this?
/kind bug

Based on #85937 with #85937 (comment) addressed

What this PR does / why we need it:
Fix bug where kube-apiserver would fail to start when not providing service CIDR

Which issue(s) this PR fixes:
NA

Special notes for your reviewer:
The strings.Split documentation states:

// If s does not contain sep and sep is not empty, Split returns a
// slice of length 1 whose only element is s.

import (
	"fmt"
	"strings"
)

func main() {
	serviceClusterIPRanges := ""
	serviceClusterIPRangeList := strings.Split(serviceClusterIPRanges, ",")
	fmt.Printf("len: %d, value: %+v", len(serviceClusterIPRangeList), serviceClusterIPRangeList)

}

// Output
// len: 1, value: []

playground link

This would fail the if check here and apiserver wouldn't start. This PR fixes this bug.

Does this PR introduce a user-facing change?:
NA

Release note:

NONE

Signed-off-by: darshanime <deathbullet@gmail.com>
Signed-off-by: darshanime <deathbullet@gmail.com>
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 5, 2019
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 5, 2019
@liggitt liggitt added priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. sig/network Categorizes an issue or PR as relevant to SIG Network. labels Dec 5, 2019
@k8s-ci-robot k8s-ci-robot added area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 5, 2019
@liggitt liggitt added this to the v1.17 milestone Dec 5, 2019
@BenTheElder
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 5, 2019
@justaugustus
Copy link
Member

Thanks for the carry, @liggitt!

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justaugustus, liggitt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 6a4216b into kubernetes:master Dec 5, 2019
@k8s-ci-robot k8s-ci-robot modified the milestones: v1.17, v1.18 Dec 5, 2019
k8s-ci-robot added a commit that referenced this pull request Dec 6, 2019
…8-upstream-release-1.17

Automated cherry pick of #85968: Fix bug in apiserver service cluster cidr split
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/network Categorizes an issue or PR as relevant to SIG Network. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants