-
Notifications
You must be signed in to change notification settings - Fork 13
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 to cert-manager 1.7 #19
Conversation
wallrj
commented
Jan 25, 2022
•
edited
Loading
edited
- Updated to cert-manager 1.7.1
- Update to Go 1.17 to work around some go mod problems with transitive dependencies
- Adjusted code that uses logr which now uses structs instead of interfaces.
Signed-off-by: Richard Wall <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
7904dba
to
e7f5e5d
Compare
Signed-off-by: Richard Wall <[email protected]>
e7f5e5d
to
0df2ab9
Compare
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.
I'll need to update the testing repo to run these tests with Go 1.17
@@ -1,66 +0,0 @@ | |||
/* |
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.
There's a TestLogger in the go-logr package so I used that and removed this.
@@ -118,7 +119,7 @@ func RunTestDriver(t *testing.T, opts DriverOptions) (DriverOptions, csi.NodeCli | |||
WriteKeypair: opts.WriteKeypair, | |||
}) | |||
|
|||
d := driver.NewWithListener(lis, opts.Log, driver.Options{ | |||
d := driver.NewWithListener(lis, *opts.Log, driver.Options{ |
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.
Hm, previously it would be possible for a user to pass a nil pointer here. Now it isn't (and a user would need to create a Discard logger). Would it make sense to take a pointer here instead, and if it's nil, instantiate a discard logger automatically?
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.
(I don't mind either way on this ^ just conscious of the change in method signature/how the caller calls this)
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.
That's already handled above, right? We create a TestLogger if opts.Log
is nil.
I will leave it like this for now and you can improve it in a followup PR if necessary.
@@ -150,7 +150,7 @@ func NewManager(opts Options) (*Manager, error) { | |||
lister: lister, | |||
metadataReader: opts.MetadataReader, | |||
clock: opts.Clock, | |||
log: opts.Log, | |||
log: *opts.Log, |
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 will cause a panic if a user doesn't provide a logger (whereas the previous code would not). Can we initialise a logr.Discard()
here to pass to the Manager if it is nil?
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.
There's already a check for nil opts.Log
above on line 102 https://github.com/cert-manager/csi-lib/pull/19/files#diff-f679b61276b44dc3f4712950536707c0389ee4c536fc29837c0202c6e81c1bbfR102
/test pull-cert-manager-csi-lib-verify |
Signed-off-by: Richard Wall <[email protected]>
/unhold because we've updated to the latest 1.7.1 library and update the testing repo to use Go 1.17. |
/unhold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: munnerz, wallrj 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 |