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

Consume operator-sdk 1.1.0 #898

Merged
merged 1 commit into from
Nov 4, 2020
Merged

Consume operator-sdk 1.1.0 #898

merged 1 commit into from
Nov 4, 2020

Conversation

tiraboschi
Copy link
Member

@tiraboschi tiraboschi commented Oct 23, 2020

operator-sdk >= v1.0.0 introduces various not backward
compatible changes.
Aligning with that.

See:
https://v1-1-x.sdk.operatorframework.io/docs/upgrading-sdk-version/v1.0.0/
https://v1-1-x.sdk.operatorframework.io/docs/upgrading-sdk-version/v1.1.0/
for the migrations guides.

Relevant changes in the operator sdk:

  • Removed package pkg/k8sutil
  • Removed packages pkg/kube-metrics and pkg/metrics
  • Removed package pkg/ready
  • Package version is no longer public
  • pkg/log/zap is no longer a public API

Moving from Leader-for-life to Leader-with-lease from
controller runtime to avoid a deadlock on rolling upgrades.

Signed-off-by: Simone Tiraboschi [email protected]

Release note:

Consume operator-sdk 1.1.0

@kubevirt-bot kubevirt-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XXL labels Oct 23, 2020
@kubevirt-bot kubevirt-bot requested a review from sradco October 23, 2020 09:18
@ovirt-infra
Copy link

All tests passed

1 similar comment
@ovirt-infra
Copy link

All tests passed

@tiraboschi
Copy link
Member Author

/hold

@kubevirt-bot kubevirt-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 23, 2020
@ovirt-infra
Copy link

All tests passed

@hco-bot
Copy link
Collaborator

hco-bot commented Oct 29, 2020

hco-e2e-image-index-gcp, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-azure

In response to this:

hco-e2e-image-index-gcp, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-azure

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.

@ovirt-infra
Copy link

All tests passed

8 similar comments
@ovirt-infra
Copy link

All tests passed

@ovirt-infra
Copy link

All tests passed

@ovirt-infra
Copy link

All tests passed

@ovirt-infra
Copy link

All tests passed

@ovirt-infra
Copy link

All tests passed

@ovirt-infra
Copy link

All tests passed

@ovirt-infra
Copy link

All tests passed

@ovirt-infra
Copy link

All tests passed

@tiraboschi
Copy link
Member Author

/retest

@ovirt-infra
Copy link

All tests passed

@tiraboschi
Copy link
Member Author

/retest

1 similar comment
@tiraboschi
Copy link
Member Author

/retest

@tiraboschi
Copy link
Member Author

/retest

1 similar comment
@tiraboschi
Copy link
Member Author

/retest

@ovirt-infra
Copy link

All tests passed

2 similar comments
@ovirt-infra
Copy link

All tests passed

@ovirt-infra
Copy link

All tests passed

@tiraboschi
Copy link
Member Author

I'd expect openshift/release#13355 to fix the issues with hco-e2e-image-index-* lanes
/retest

@tiraboschi
Copy link
Member Author

tiraboschi commented Nov 3, 2020

hco-e2e-image-index-* got indeed fixed by openshift/release#13355
I fear that we instead have a real bug on the upgrade

on https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/kubevirt_hyperconverged-cluster-operator/898/pull-ci-kubevirt-hyperconverged-cluster-operator-master-hco-e2e-upgrade-prev-aws/1323644550668881920

for instance, we ended up with the old version of the operator and the new one running at the same time:

hco-operator-5d9547f8b-rhd7k 1/1 Running 0 13m
hco-operator-9b4c8c688-kr6pq 0/1 Running 0 8m31s

With the new version not really able to start due to:

{"level":"info","ts":1604419697.3071926,"logger":"leader","msg":"Found existing lock","LockOwner":"hco-operator-5d9547f8b-rhd7k"}
{"level":"info","ts":1604419697.328862,"logger":"leader","msg":"Not the leader. Waiting."}

@ovirt-infra
Copy link

All tests passed

2 similar comments
@ovirt-infra
Copy link

All tests passed

@ovirt-infra
Copy link

All tests passed

@tiraboschi tiraboschi changed the title WIP: Consume operator-sdk 1.1.0 Consume operator-sdk 1.1.0 Nov 4, 2020
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 4, 2020
@tiraboschi
Copy link
Member Author

/unhold

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2020
Copy link
Collaborator

@nunnatsa nunnatsa left a comment

Choose a reason for hiding this comment

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

Two small comments/questions

@@ -73,15 +59,16 @@ func main() {
// implementing the logr.Logger interface. This logger will
// be propagated through the whole operator, generating
// uniform and structured logs.
logf.SetLogger(zap.Logger())
development_mode_logger := false // use a production logger
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need this variable? what about using an environment variable (default = false) for that?

Copy link
Member Author

Choose a reason for hiding this comment

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

sigs.k8s.io/controller-runtime/pkg/log already provides CLI options, using them instead of an hardcoded value

Copy link
Collaborator

Choose a reason for hiding this comment

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

But why use a boolean parameter just in order to use it as a value in the next line?

Why not just

logf.SetLogger(zap.New(zap.UseDevMode(false)))

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry, I commented before pushing.
the last version is just logf.SetLogger(zap.New(zap.UseFlagOptions(zopts))) to consume the CLI flags parsed on zopts

cmd/hyperconverged-cluster-operator/main.go Outdated Show resolved Hide resolved
operator-sdk >= v1.0.0 introduces various not backward
compatible changes.
Aligning with that.

See:
https://v1-1-x.sdk.operatorframework.io/docs/upgrading-sdk-version/v1.0.0/
https://v1-1-x.sdk.operatorframework.io/docs/upgrading-sdk-version/v1.1.0/
for the migrations guides.

Relevant changes in the operator sdk:
- Removed package pkg/k8sutil
- Removed packages pkg/kube-metrics and pkg/metrics
- Removed package pkg/ready
- Package version is no longer public
- pkg/log/zap is no longer a public API

Moving from Leader-for-life to Leader-with-lease from
controller runtime to avoid a deadlock on rolling upgrades.

Signed-off-by: Simone Tiraboschi <[email protected]>
@ovirt-infra
Copy link

All tests passed

@openshift-merge-robot
Copy link
Collaborator

@tiraboschi: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/hco-e2e-upgrade-azure 8683d27bfa793f80ed42702c593f7eff50376a1e link /test hco-e2e-upgrade-azure
ci/prow/hco-e2e-aws 79800a0 link /test hco-e2e-aws

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@nunnatsa
Copy link
Collaborator

nunnatsa commented Nov 4, 2020

/override-bot

@hco-bot
Copy link
Collaborator

hco-bot commented Nov 4, 2020

hco-e2e-azure lane succeeded.
/override ci/prow/hco-e2e-aws
hco-e2e-image-index-gcp, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-azure
hco-e2e-upgrade-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-azure
hco-e2e-upgrade-prev-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-aws, ci/prow/hco-e2e-image-index-azure, ci/prow/hco-e2e-upgrade-azure, ci/prow/hco-e2e-upgrade-prev-azure

In response to this:

hco-e2e-azure lane succeeded.
/override ci/prow/hco-e2e-aws
hco-e2e-image-index-gcp, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-azure
hco-e2e-upgrade-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-azure
hco-e2e-upgrade-prev-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-azure

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.

@nunnatsa
Copy link
Collaborator

nunnatsa commented Nov 4, 2020

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2020
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nunnatsa

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 4, 2020
@kubevirt-bot kubevirt-bot merged commit b8c2a24 into kubevirt:master Nov 4, 2020
@tiraboschi tiraboschi mentioned this pull request Nov 4, 2020
kubevirt-bot pushed a commit that referenced this pull request Nov 5, 2020
Remove a small hack introduced only to be able
to easily test #898 on CI

Signed-off-by: Simone Tiraboschi <[email protected]>
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants