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

Make sure corev1 schema is registered #1518

Merged

Conversation

zregvart
Copy link
Contributor

When upgrading 4.2.16 to 4.2.18 I noticed that the machine-config
cluster operator remained at 4.2.16. Looking at the logs of the
machine-config-operator I noticed the following:

I0227 20:34:38.428822       1 start.go:42] Version: v4.2.15-202001171551-dirty (31fed93186c9f84708f5cdfd0227ffe4f79b31cd)
E0227 20:34:38.458532       1 event.go:247] Could not construct reference to: '&v1.ConfigMap{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"machine-config", GenerateName:"", Namespace:"openshift-machine-config-operator", SelfLink:"/api/v1/namespaces/openshift-machine-config-operator/configmaps/machine-config", UID:"9305be83-59a0-11ea-a084-064dd2f0c578", ResourceVersion:"42279333", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:63718432478, loc:(*time.Location)(0x23664a0)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string{"control-plane.alpha.kubernetes.io/leader":"{\"holderIdentity\":\"machine-config-operator-596785879d-qsb4k_9302eaa1-59a0-11ea-923a-0a580a810191\",\"leaseDurationSeconds\":90,\"acquireTime\":\"2020-02-27T20:34:38Z\",\"renewTime\":\"2020-02-27T20:34:38Z\",\"leaderTransitions\":0}"}, OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, Data:map[string]string(nil), BinaryData:map[string][]uint8(nil)}' due to: 'no kind is registered for the type v1.ConfigMap in scheme "github.com/openshift/machine-config-operator/cmd/common/helpers.go:30"'. Will not report event: 'Normal' 'LeaderElection' 'machine-config-operator-596785879d-qsb4k_9302eaa1-59a0-11ea-923a-0a580a810191 became leader'
I0227 20:34:38.786752       1 operator.go:246] Starting MachineConfigOperator

It seemed to me that the corev1 schema was not registered so I added
corev1.AddToScheme(scheme) for the schema used by the recorder.

- What I did

Run the upgrade from 4.2.16 to 4.2.18, looked at the logs of the machine-config-operator, so added corev1.AddToScheme(scheme) for the schema used by the recorder in cmd/common/helpers.go.

- How to verify it

Not sure if this has anything to do with the upgrade. Perhaps just running the operator and seeing that the message Could not construct reference to... is not logged.

- Description for the changelog

Fixed recording of LeaderElection event

When upgrading 4.2.16 to 4.2.18 I noticed that the `machine-config`
cluster operator remained at 4.2.16. Looking at the logs of the
`machine-config-operator` I noticed the following:

```
I0227 20:34:38.428822       1 start.go:42] Version: v4.2.15-202001171551-dirty (31fed93)
E0227 20:34:38.458532       1 event.go:247] Could not construct reference to: '&v1.ConfigMap{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"machine-config", GenerateName:"", Namespace:"openshift-machine-config-operator", SelfLink:"/api/v1/namespaces/openshift-machine-config-operator/configmaps/machine-config", UID:"9305be83-59a0-11ea-a084-064dd2f0c578", ResourceVersion:"42279333", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:63718432478, loc:(*time.Location)(0x23664a0)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string{"control-plane.alpha.kubernetes.io/leader":"{\"holderIdentity\":\"machine-config-operator-596785879d-qsb4k_9302eaa1-59a0-11ea-923a-0a580a810191\",\"leaseDurationSeconds\":90,\"acquireTime\":\"2020-02-27T20:34:38Z\",\"renewTime\":\"2020-02-27T20:34:38Z\",\"leaderTransitions\":0}"}, OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, Data:map[string]string(nil), BinaryData:map[string][]uint8(nil)}' due to: 'no kind is registered for the type v1.ConfigMap in scheme "github.com/openshift/machine-config-operator/cmd/common/helpers.go:30"'. Will not report event: 'Normal' 'LeaderElection' 'machine-config-operator-596785879d-qsb4k_9302eaa1-59a0-11ea-923a-0a580a810191 became leader'
I0227 20:34:38.786752       1 operator.go:246] Starting MachineConfigOperator
```

It seemed to me that the corev1 schema was not registered so I added
`corev1.AddToScheme(scheme)` for the schema used by the `recorder`.
@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 27, 2020
@openshift-ci-robot
Copy link
Contributor

Hi @zregvart. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 27, 2020
@sinnykumari
Copy link
Contributor

/ok-to-test

@openshift-ci-robot openshift-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 28, 2020
@sinnykumari
Copy link
Contributor

Thanks for the patch!
I see this error message in latest upgrade in CI runs too

@sinnykumari
Copy link
Contributor

/retest

@zregvart
Copy link
Contributor Author

Thanks @sinnykumari looks like the error is no longer present on this PRs build.

@ericavonb
Copy link
Contributor

Does this need a bugzilla? And do we want to backport this?

@sinnykumari
Copy link
Contributor

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 2, 2020
@kikisdeliveryservice
Copy link
Contributor

@runcom could you PTAL are we missing something here or is it good to go?

@zregvart
Copy link
Contributor Author

zregvart commented May 7, 2020

Just checking if there is something I need to do on my end to get this merged?

@kikisdeliveryservice
Copy link
Contributor

Just checking if there is something I need to do on my end to get this merged?

We will review and merge once master reopens. 🙂

@runcom
Copy link
Member

runcom commented Jun 3, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: runcom, sinnykumari, zregvart

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

/retest

Please review the full test history for this PR and help us cut down flakes.

7 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit a9868c8 into openshift:master Jun 4, 2020
@zregvart zregvart deleted the pr/add-corev1-schema branch June 5, 2020 19:25
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants