Skip to content

Conversation

@xWink
Copy link
Member

@xWink xWink commented Sep 26, 2023

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:

  • Removes use of glog in dnsendpoint, listener, and service network managers, and listener synthesizer
  • Removes unnecessary logs, such as in the case of log and throw
  • Add checks for errors before logging errors
  • Cleans output of logs so that they contain less clutter, are grammatically correct, and specify more useful information
  • General code cleanliness

If an issue # is not available please add repro steps and logs from aws-gateway-controller showing the issue:

Testing done on this change:

Ran 32 of 32 Specs in 2170.862 seconds
SUCCESS! -- 32 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestIntegration (2172.09s)
PASS
ok      github.com/aws/aws-application-networking-k8s/test/suites/integration   2172.843s

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?:

Only logging changes


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

Copy link
Member Author

Choose a reason for hiding this comment

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

Not entirely sure what generated these files, are we meant to add them to .gitignore?

Copy link
Contributor

Choose a reason for hiding this comment

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

it seems code generation was interrupted and left temp files, you need to remove them

@coveralls
Copy link

Pull Request Test Coverage Report for Build 6319136235

  • 108 of 147 (73.47%) changed or added relevant lines in 8 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.2%) to 38.554%

Changes Missing Coverage Covered Lines Changed/Added Lines %
controllers/gateway_controller.go 0 1 0.0%
pkg/deploy/lattice/listener_manager.go 1 2 50.0%
pkg/deploy/lattice/listener_synthesizer.go 1 3 33.33%
pkg/deploy/stack_deployer.go 0 3 0.0%
pkg/deploy/lattice/service_network_manager.go 72 81 88.89%
pkg/deploy/lattice/rule_synthesizer.go 18 41 43.9%
Files with Coverage Reduction New Missed Lines %
pkg/deploy/lattice/service_network_manager.go 1 87.43%
pkg/deploy/lattice/rule_synthesizer.go 3 65.69%
Totals Coverage Status
Change from base Build 6306421716: -0.2%
Covered Lines: 3946
Relevant Lines: 10235

💛 - Coveralls

}
if service.Spec.CustomerDomainName == "" {
glog.V(2).Infof("Skipping creation of %s: detected no custom domain", namespacedName.String())
s.log.Debugf("Skipping creation of %s: detected no custom domain", namespacedName.String())
Copy link
Contributor

Choose a reason for hiding this comment

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

%s will use Stringer interface and call String(), no need to explicitly call String()

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, will include this in part 3!

Comment on lines +232 to 233
m.log.Debugf("Failed to delete service network %s due to %s", snName, resp)
return errors.New(LATTICE_RETRY)
Copy link
Contributor

Choose a reason for hiding this comment

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

you can return wrapped retry error, it will trigger retry also will print error cause to log in Retry handler

return fmt.Errorf("%w: failed to delete service network: %s: %s", RetryErr, snName, resp.Status)

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you, will include in part 3!

@xWink xWink merged commit 2348b15 into aws:main Sep 27, 2023
@xWink xWink deleted the logging-2 branch September 27, 2023 12:00
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