Skip to content

Conversation

@IvanovOleg
Copy link
Contributor

What this PR does / why we need it:
Use /etc/os-release instead of /etc/issue as a source for the osInfo because /etc/issue contains completely different lines depending on the linux distributive and fails on the CoreOS.
Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #108

Special notes for your reviewer:
Split PRs as required
Release note:

Fixed the osinfo source.

osInfoArr := make(map[string]string)

for i := range linesArr {
s := strings.Split(linesArr[i], "=")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we check if split succeeds by checking the length of s?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check if the latest commit is what you want.

Copy link
Member

@tamilmani1989 tamilmani1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the comment that I added


for i := range linesArr {
s := strings.Split(linesArr[i], "=")
if len(s) = 2 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be len(s)==2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry!

Copy link
Contributor Author

@IvanovOleg IvanovOleg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the typo


for i := range linesArr {
s := strings.Split(linesArr[i], "=")
if len(s) = 2 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry!

@tamilmani1989 tamilmani1989 merged commit f2aac20 into Azure:master Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CNI plugins show "index out of range" on CentOS 7.4 for kubernetes 1.8.9

2 participants