-
Notifications
You must be signed in to change notification settings - Fork 51
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
Logging Cleanup - Part 1 #410
Conversation
…stener synthesizer. Added e2e-test and e2e-clean to make help output.
Pull Request Test Coverage Report for Build 6288346348
💛 - Coveralls |
@@ -99,53 +109,46 @@ func (d *defaultListenerManager) Create(ctx context.Context, listener *latticemo | |||
} | |||
|
|||
resp, err := d.cloud.Lattice().CreateListener(&listenerInput) | |||
if err != nil { | |||
d.log.Errorf("Error during creation of Listener %s-%s", listenerSpec.Name, listenerSpec.Namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would return error here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like to avoid behavioural changes in this PR, just improving logging/readability of code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in general for refactoring you are right, but in this particular example resp is used as non-nil value few lines below, it will panic on nil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point, fixed next PR!
} | ||
|
||
return nil, errors.New("Listener does not exist") | ||
return nil, errors.New("listener does not exist") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to have listener details in error message, unless caller of this function wrap error with these details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed next PR!
@@ -95,19 +102,18 @@ func (l *listenerSynthesizer) getSDKListeners(ctx context.Context) ([]*latticemo | |||
var resService []*latticemodel.Service | |||
|
|||
err := l.stack.ListResources(&resService) | |||
glog.V(6).Infof("service: %v ignore err: %v \n", resService, err) | |||
l.log.Debugf("Ignoring error when listing services %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err then log error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do in part 2 PR, thanks for catching this!
What type of PR is this?
cleanup
Which issue does this PR fix:
#126 partially
What does this PR do / Why do we need it:
e2e-test
ande2e-clean
tomake help
output, which appear to have been inadvertently removed?If an issue # is not available please add repro steps and logs from aws-gateway-controller showing the issue:
Testing done on this change:
Automation added to e2e:
Will this PR introduce any new dependencies?:
No
Will this break upgrades or downgrades. Has updating a running cluster been tested?:
No
Does this PR introduce any user-facing change?:
No, only logging changes
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.