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 kanister build v0.0.20 #1676

Merged
merged 7 commits into from
Oct 17, 2022
Merged

Update kanister build v0.0.20 #1676

merged 7 commits into from
Oct 17, 2022

Conversation

bathina2
Copy link
Contributor

@bathina2 bathina2 commented Oct 13, 2022

Change Overview

update kanister build to v0.0.19 v0.0.20. This updates to go 1.19. It also updates the linter and as leads to several changes across all packages.

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

  • fixes #issue-number

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@github-actions
Copy link
Contributor

Thanks for submitting this pull request 🎉. The team will review it soon and get back to you.

If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document.

@infraq infraq added this to In Progress in Kanister Oct 13, 2022
Kanister automation moved this from In Progress to Reviewer approved Oct 13, 2022
@bathina2 bathina2 removed the kueue label Oct 14, 2022
@bathina2 bathina2 changed the title update makefile to use kanister build v0.0.19 Update kanister build v0.0.20 Oct 14, 2022
@@ -124,7 +124,7 @@ func (s *ibmCloud) volumeParse(ctx context.Context, vol *ibmprov.Volume) (*block
}
attribs[LunIDAttName] = vol.LunID

if len(vol.IscsiTargetIPAddresses) < 0 {
if len(vol.IscsiTargetIPAddresses) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a bug fix that shouldn't be hidden in a tooling bump commit. Can we split this out into a separate PR, please?

Copy link
Contributor Author

@bathina2 bathina2 Oct 14, 2022

Choose a reason for hiding this comment

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

@@ -791,6 +791,7 @@ func (ge govmomiError) Format() string {
return fmt.Sprintf("[%s]", strings.Join(msgs, "; "))
}

// nolint:gocognit
Copy link
Contributor

Choose a reason for hiding this comment

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

"Directive" type comments shouldn't have a space after the //.

Suggested change
// nolint:gocognit
//nolint:gocognit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

heh, theres a bunch of places where this needs to be fixed

Comment on lines 36 to 43
fis := make([]fs.FileInfo, 0, len(entries))
for _, entry := range entries {
fi, err := entry.Info()
if err != nil {
return nil, errors.Wrap(err, "failed to read info from entry:"+entry.Name())
}
fis = append(fis, fi)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why we're making this change? I don't quite understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This deprecation note explains it - https://pkg.go.dev/io/ioutil#ReadDir

Copy link
Contributor Author

Choose a reason for hiding this comment

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

However I blindly converted. After looking at the code more, I can probably use the response from ReadDir directly.

pkg/kube/pod.go Outdated
Comment on lines 237 to 239
// 1. if PVC is present then check the status of PVC
// 1.1 if PVC is pending then check if the PV status is VolumeFailed return error if so. if not then wait for timeout.
// 2. if PVC not present then wait for timeout
Copy link
Contributor

Choose a reason for hiding this comment

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

This reformatting is showing that Go doesn't recognize the nested "1.1" item (Go doesn't support nested lists at all). The way this is formatted, it's actually treating it as a continuation of the 1. list item — "… the status of PVC 1.1 if PVC is …".

We should probably reformat this to not use a nested list (i.e. move "1.1" to be a top-level item in the list, renumbering the items or switching to an unordered list).

pkg/kube/pod.go Outdated
Comment on lines 250 to 252
// 1. if PVC is present then check the status of PVC
// 1.1 if PVC is pending then check if the PV status is VolumeFailed return error if so. if not then wait for timeout.
// 2. if PVC not present then wait for timeout
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto, as above.

@julio-lopez
Copy link
Contributor

@bathina2 other than Mark's comments, LGTM.

Copy link
Contributor

@julio-lopez julio-lopez left a comment

Choose a reason for hiding this comment

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

@miquella had additional comments. Please follow up in separate PRs.

Copy link
Contributor

@miquella miquella left a comment

Choose a reason for hiding this comment

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

LGTM, just a few tiny Go Doc Comment nits

Comment on lines +237 to +239
// - if PVC is present then check the status of PVC
// - if PVC is pending then check if the PV status is VolumeFailed return error if so. if not then wait for timeout.
// - if PVC not present then wait for timeout
Copy link
Contributor

Choose a reason for hiding this comment

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

tiny nit: Go Doc Comments says that bullet lists should be indented, so this should be:

Suggested change
// - if PVC is present then check the status of PVC
// - if PVC is pending then check if the PV status is VolumeFailed return error if so. if not then wait for timeout.
// - if PVC not present then wait for timeout
// - if PVC is present then check the status of PVC
// - if PVC is pending then check if the PV status is VolumeFailed return error if so. if not then wait for timeout.
// - if PVC not present then wait for timeout

Comment on lines +250 to +252
// - if PVC is present then check the status of PVC
// - if PVC is pending then check if the PV status is VolumeFailed return error if so. if not then wait for timeout.
// - if PVC not present then wait for timeout
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto:

Suggested change
// - if PVC is present then check the status of PVC
// - if PVC is pending then check if the PV status is VolumeFailed return error if so. if not then wait for timeout.
// - if PVC not present then wait for timeout
// - if PVC is present then check the status of PVC
// - if PVC is pending then check if the PV status is VolumeFailed return error if so. if not then wait for timeout.
// - if PVC not present then wait for timeout

Comment on lines 473 to +475
// Verbosef("will delete %d packs and rewrite %d packs, this frees %s\n",
// len(removePacks), len(rewritePacks), formatBytes(uint64(removeBytes)))
//
// len(removePacks), len(rewritePacks), formatBytes(uint64(removeBytes)))
Copy link
Contributor

Choose a reason for hiding this comment

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

tiny nit: this looks like it's supposed to be formatted:

Suggested change
// Verbosef("will delete %d packs and rewrite %d packs, this frees %s\n",
// len(removePacks), len(rewritePacks), formatBytes(uint64(removeBytes)))
//
// len(removePacks), len(rewritePacks), formatBytes(uint64(removeBytes)))
//
// Verbosef("will delete %d packs and rewrite %d packs, this frees %s\n",
// len(removePacks), len(rewritePacks), formatBytes(uint64(removeBytes)))

@mergify mergify bot merged commit db036d5 into master Oct 17, 2022
Kanister automation moved this from Reviewer approved to Done Oct 17, 2022
@mergify mergify bot deleted the update_kanister_build_v0.0.19 branch October 17, 2022 20:52
@bathina2 bathina2 mentioned this pull request Oct 17, 2022
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants