Skip to content
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

Merged
merged 1 commit into from
Dec 18, 2018

Conversation

sanchezl
Copy link
Contributor

No description provided.

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 14, 2018
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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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 {
Copy link
Contributor

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

Copy link
Contributor Author

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.

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))
Copy link
Contributor

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))
Copy link
Contributor

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()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

panics already fail tests

@deads2k
Copy link
Contributor

deads2k commented Dec 17, 2018

nits, then lgtm

@sanchezl
Copy link
Contributor Author

/test e2e-aws

@deads2k
Copy link
Contributor

deads2k commented Dec 18, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 18, 2018
@openshift-ci-robot
Copy link

[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 /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 Dec 18, 2018
@openshift-merge-robot openshift-merge-robot merged commit 053a0c4 into openshift:master Dec 18, 2018
@sanchezl sanchezl deleted the statusgeneration branch March 19, 2019 18:18
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.

None yet

4 participants