-
Notifications
You must be signed in to change notification settings - Fork 87
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
add progressing status unit test and updated messages #94
add progressing status unit test and updated messages #94
Conversation
24f1d49
to
40ff4eb
Compare
operatorConfig.ObjectMeta.Generation == operatorConfig.Status.ObservedGeneration { | ||
var progressingMessages []string | ||
if actualDaemonSet.ObjectMeta.Generation != actualDaemonSet.Status.ObservedGeneration { | ||
glog.Warningf("daemonset/apiserver.openshift-operator: observed generation is %d, actual generation is %d.", actualDaemonSet.Status.ObservedGeneration, actualDaemonSet.ObjectMeta.Generation) |
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 it's important enough to log, its important enough for an event.
operatorConfig.ObjectMeta.Generation == operatorConfig.Status.ObservedGeneration { | ||
var progressingMessages []string | ||
if actualDaemonSet.ObjectMeta.Generation != actualDaemonSet.Status.ObservedGeneration { | ||
glog.Warningf("daemonset/apiserver.openshift-operator: observed generation is %d, actual generation is %d.", actualDaemonSet.Status.ObservedGeneration, actualDaemonSet.ObjectMeta.Generation) |
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.
this isn't a warning. V(2) at best.
progressingMessages = append(progressingMessages, "The operator is process of updating a DaemonSet") | ||
} | ||
if operatorConfig.ObjectMeta.Generation != operatorConfig.Status.ObservedGeneration { | ||
glog.Warningf("openshiftapiserveroperatorconfigs/instance: observed generation is %d, actual generation is %d.", operatorConfig.Status.ObservedGeneration, operatorConfig.ObjectMeta.Generation) |
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.
V(2)
f() | ||
} | ||
|
||
type mockRecorder struct { |
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.
Move this to a subpackage under spot where the in memory one is. TestingEventRecorder
and NewTestingEventRecorder
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.
Opened issue and will use InMemoryRecorder
for now.
1e0c348
to
dce3d83
Compare
operatorConfig.ObjectMeta.Generation == operatorConfig.Status.ObservedGeneration { | ||
var progressingMessages []string | ||
if actualDaemonSet.ObjectMeta.Generation != actualDaemonSet.Status.ObservedGeneration { | ||
progressingMessages = append(progressingMessages, fmt.Sprintf("daemonset/apiserver.openshift-operator: observed generation is %d, actual generation is %d.", actualDaemonSet.Status.ObservedGeneration, actualDaemonSet.ObjectMeta.Generation)) |
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.
observed generation is, desired generation is
progressingMessages = append(progressingMessages, fmt.Sprintf("daemonset/apiserver.openshift-operator: observed generation is %d, actual generation is %d.", actualDaemonSet.Status.ObservedGeneration, actualDaemonSet.ObjectMeta.Generation)) | ||
} | ||
if operatorConfig.ObjectMeta.Generation != operatorConfig.Status.ObservedGeneration { | ||
progressingMessages = append(progressingMessages, fmt.Sprintf("openshiftapiserveroperatorconfigs/instance: observed generation is %d, actual generation is %d.", operatorConfig.Status.ObservedGeneration, operatorConfig.ObjectMeta.Generation)) |
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.
observed and desired, not actual. They are both actual
|
||
} | ||
|
||
func assertNotPanic(t *testing.T, f func()) { |
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.
panics already fail tests
nits, then lgtm |
dce3d83
to
d46671f
Compare
/test e2e-aws |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, sanchezl 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 |
No description provided.