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

Output to stderr when no log file path is passed #1365

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

couralex6
Copy link
Contributor

@couralex6 couralex6 commented Jan 29, 2021

Cherry picked PR #1275 :

What type of PR is this?
Bug fix

Which issue does this PR fix:
#1265

What does this PR do / Why do we need it:
Customers using Cilium in chaining mode were unable to create new pods after upgrading to CNI v1.7.x. Because no log file path was passed, zaplogger.go would default to stdout.
This change ensures that logs are being written to stderr when no log file path is passed.

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:

Testing done on this change:
This was tested on a cluster with Cilium enabled in chaining mode . I reproduced the bug by installing CNI v1.7.5, which prevented new pods from being created. Pods were able to come up with this fix.

Automation added to e2e:
Added Unit Tests to test the following scenarios:

  • Empty log file path > log to zapcore.Lock(os.Stderr)
  • Actual file path > log to file path
  • String set to 'stdout' > log to zapcore.Lock(os.Stdout)

Will this break upgrades or downgrades. Has updating a running cluster been tested?:
No

Does this change require updates to the CNI daemonset config files to work?:
No

Does this PR introduce any user-facing change?:
No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@fawadkhaliq
Copy link

In the PR description, let's please link the PR being backported and also consider copy-pasta of the description from the original PR

(same comment applies to all the other backport PRs authored for 1.7.9)

@jayanthvn
Copy link
Contributor

I agree with Fawad, also please indicate if the PR is cherrypicked or modified. Maybe in the subject line we can add as "Cherry-pick # for rel 1.7.9"

@jayanthvn jayanthvn merged commit 6f1f37a into aws:release-1.7 Feb 1, 2021
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.

3 participants