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

Update golang to 1.20.5 #319

Closed
wants to merge 2 commits into from
Closed

Conversation

awels
Copy link
Member

@awels awels commented Jun 15, 2023

What this PR does / why we need it:
Update k8s libraries to 1.27 to match golang version. Fixed unit tests to be compatible with latest fake kubernetes client. In particular updates to some core resources (such as daemonset) no longer support updating the status fields of those objects. Instead of updating in the test, delete and create with the wanted status.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XXL labels Jun 15, 2023
@kubevirt-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from awels. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Update k8s libraries to 1.27 to match golang version.
Fixed unit tests to be compatible with latest fake
kubernetes client. In particular updates to some core
resources (such as daemonset) no longer support updating
the status fields of those objects. Instead of updating
in the test, delete and create with the wanted status.

Signed-off-by: Alexander Wels <awels@redhat.com>
@awels awels changed the title Updated golang to 1.20.5 Update golang to 1.20.5 Jun 15, 2023
Signed-off-by: Alexander Wels <awels@redhat.com>
@@ -45,7 +45,8 @@ func (r *ReconcileHostPathProvisioner) reconcileSecurityContextConstraints(reqLo
}
} else {
if err := r.deleteSCC(MultiPurposeHostPathProvisionerName); err != nil {
return reconcile.Result{}, err
reqLogger.Error(err, "unable to delete SCC")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we not error out anymore when the delete fails? maybe just IgnoreNotFound?

@@ -213,7 +214,7 @@ func (r *ReconcileHostPathProvisioner) checkSCCUsed() (bool, error) {
// not using SCCs
return false, nil
}
return false, err
return false, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

same q as above, am I missing something obvious? do we not care about SCCs anymore with CSI?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah this is the main issue I have. @awels says that is NoMatchError is no longer returned and I think that is something we should dig into and find out exactly what changed and if this is either 1) a bug 2) we should be doing something differently or 3) the new normal

Copy link
Contributor

@akalenyu akalenyu Jun 18, 2023

Choose a reason for hiding this comment

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

Sounds like this kubernetes-sigs/controller-runtime#2354 (comment)

BTW, did you see the disclaimer on latest controller runtime release?
https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0

@@ -439,7 +439,7 @@ func (r *ReconcileHostPathProvisioner) checkPrometheusUsed() (bool, error) {
// prometheus not deployed
return false, nil
}
return false, err
return false, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is not just about SCCs
my worry with this is that we miss isErrCacheNotStarted which can cause a watch to not be set up..

I also see we ignore transient errors here in calls to checkPrometheusUsed so that
may be a problem

@@ -90,7 +89,7 @@ func main() {
// Create a new Cmd to provide shared dependencies and start components
mgr, err := manager.New(cfg, manager.Options{
Namespace: namespace,
MapperProvider: restmapper.NewDynamicRESTMapper,
MapperProvider: apiutil.NewDynamicRESTMapper,
Copy link
Contributor

Choose a reason for hiding this comment

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

People are working around issues by using this mapperprovider:
https://github.com/statnett/image-scanner-operator/pull/394/files#diff-4ddb9905d3f2a223cd9c0ccbe71976ff5ab27898b7464052462724c0c0634b2bR120
Which I think is worse than what we had before, just something to consider

@awels
Copy link
Member Author

awels commented Jun 22, 2023

/hold
We reverted the update to controller runtime 0.15.0 and thus we don't need this for now. Holding.

@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. labels Jun 22, 2023
@kubevirt-bot
Copy link

PR needs rebase.

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.

@awels awels closed this Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. 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. release-note-none Denotes a PR that doesn't merit a release note. size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants