Skip to content

Change the log message "Skipping cache lookup" from Ansible operator to debug level#4511

Merged
estroz merged 16 commits into
operator-framework:masterfrom
kandaaaaa:remove-log
Feb 12, 2021
Merged

Change the log message "Skipping cache lookup" from Ansible operator to debug level#4511
estroz merged 16 commits into
operator-framework:masterfrom
kandaaaaa:remove-log

Conversation

@kandaaaaa
Copy link
Copy Markdown
Contributor

@kandaaaaa kandaaaaa commented Feb 11, 2021

Description of the change:
When we have too many resources to watch, this log message flushing the log and provides no value to us. We lower the log level

If you disagree, please suggest a different way to change

Checklist

If the pull request includes user-facing changes, extra documentation is required:

}

if c.skipCacheLookup(r, k, req) {
log.Info("Skipping cache lookup", "resource", r)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

imo we should not remove the log. We need to change its level.

Copy link
Copy Markdown
Contributor Author

@kandaaaaa kandaaaaa Feb 11, 2021

Choose a reason for hiding this comment

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

I tried but seems log does not support debug level. Only Info and Error

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can add debug logging like

log.V(1).Info("Skipping cache lookup", "resource", r)

That 1 indicates a log message that only gets logged when a development logger is used.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I have put to V(2) to align with other lines in the same function. If 1 is really you want. I can make the change again.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think 2 is ok, although there is a mix of 1's and 2's that should probably be made 1's (helm-operator only uses 1's).

@kandaaaaa kandaaaaa changed the title Remove the log message "Skipping cache lookup" from Ansible operator Change the log message "Skipping cache lookup" from Ansible operator to debug level Feb 11, 2021
Copy link
Copy Markdown
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 11, 2021
@estroz
Copy link
Copy Markdown
Member

estroz commented Feb 11, 2021

/ok-to-test

@openshift-ci-robot openshift-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Feb 11, 2021
@kandaaaaa
Copy link
Copy Markdown
Contributor Author

@estroz thanks for getting this approved promptly

@estroz
Copy link
Copy Markdown
Member

estroz commented Feb 11, 2021

/retest

@estroz
Copy link
Copy Markdown
Member

estroz commented Feb 11, 2021

@kandaaaaa these lines are failing in ansible e2e. Debug logging needs to be enabled by passing --zap-devel to the manager, something like the following in test/e2e/ansible/suite_test.go:

var _ = BeforeSuite(func() {

	...

	By("copying sample to a temporary e2e directory")
	Expect(exec.Command("cp", "-r", "../../../testdata/ansible/memcached-operator", tc.Dir).Run()).To(Succeed())

	By("enabling debug logging in the manager")
	err = testutils.ReplaceInFile(filepath.Join(tc.Dir, "config", "manager", "manager.yaml"),
		`- "--leader-election-id=memcached-operator"`,
		"- --leader-election-id=memcached-operator\n            - --zap-devel")
	Expect(err).NotTo(HaveOccurred())

	...
}

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 12, 2021
@openshift-ci-robot
Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2021
Kanda Zhang added 2 commits February 11, 2021 21:56
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2021
Kanda Zhang added 10 commits February 11, 2021 22:09
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Comment thread test/e2e/ansible/suite_test.go
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
@kandaaaaa
Copy link
Copy Markdown
Contributor Author

@estroz @camilamacedo86 Fixed the failed test case and update the changelog. Please review again. Thanks

Comment thread changelog/fragments/00-template.yaml Outdated
Kanda Zhang added 2 commits February 12, 2021 15:29
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
Signed-off-by: Kanda Zhang <kanda.zhang@ibm.com>
@estroz
Copy link
Copy Markdown
Member

estroz commented Feb 12, 2021

@kandaaaaa there's a broken link that is not the result of your changes. I'll fix it in a separate PR then merge this one.

@kandaaaaa
Copy link
Copy Markdown
Contributor Author

@estroz thanks

@estroz
Copy link
Copy Markdown
Member

estroz commented Feb 12, 2021

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants