Skip to content

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Feb 27, 2019

Improve logging and add events for the operator cluster status
Conventions:

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 27, 2019
@enxebre enxebre changed the title Logging events Logging and events Feb 27, 2019
@@ -67,7 +67,7 @@ func runStartCmd(cmd *cobra.Command, args []string) {
Callbacks: leaderelection.LeaderCallbacks{
OnStartedLeading: run,
OnStoppedLeading: func() {
glog.Fatalf("leaderelection lost")
glog.Fatalf("leader election lost")
Copy link
Member

Choose a reason for hiding this comment

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

uppercase Leader

Copy link
Contributor

Choose a reason for hiding this comment

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

@frobware
Copy link
Contributor

frobware commented Feb 27, 2019

I think the "rules" would be simpler if it was lower always. With that simple rule there's no ambiguity. Code reviews go faster because there's only 1 rule. Error message and Warning messages and Info messages are consistently formatted. It is also idiomatic Go [1].

[1] - https://github.com/golang/go/wiki/CodeReviewComments#error-strings

@enxebre
Copy link
Member Author

enxebre commented Feb 27, 2019

/test integration

@enxebre
Copy link
Member Author

enxebre commented Feb 27, 2019

/test integration
for debugging

@enxebre
Copy link
Member Author

enxebre commented Feb 27, 2019

/test integration

@enxebre
Copy link
Member Author

enxebre commented Feb 27, 2019

fixes integration #233

@enxebre
Copy link
Member Author

enxebre commented Feb 27, 2019

/test integration

var message string
if !reflect.DeepEqual(desiredVersions, currentVersions) {
glog.V(2).Info("Syncing status: progressing")
message = fmt.Sprintf("Progressing towards %s", optr.printOperandVersions())
optr.eventRecorder.Eventf(co, v1.EventTypeNormal, "Status upgrade", message)
Copy link
Member

Choose a reason for hiding this comment

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

Status upgraded or Status upgraging maybe?

@ingvagabund
Copy link
Member

Does it make sense to report Status successfully updated as well?

modNode.Labels[k] = v
}

addTaintsToNode(modNode, matchingMachine)

if !reflect.DeepEqual(node, modNode) {
glog.V(3).Infof("node has changed, updating")
glog.V(3).Infof("Node has changed, updating")
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're going to log we might as well indicate which node.

@frobware
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 28, 2019
@ingvagabund
Copy link
Member

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ingvagabund

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 28, 2019
@openshift-merge-robot openshift-merge-robot merged commit 62f99df into openshift:master Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants