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

Upgrade ABS client Go module to azure-sdk-for-go/sdk/storage/azblob #751

Merged
merged 4 commits into from
Sep 9, 2024

Conversation

renormalize
Copy link
Member

What this PR does / why we need it:

Upgrades the client Go modules for ABS to github.com/Azure/azure-sdk-for-go/sdk/storage/azblob from the deprecated github.com/Azure/azure-storage-blob-go

Which issue(s) this PR fixes:
Fixes #745

Release note:

Azure Blob Storage client Go module upgraded to github.com/Azure/azure-sdk-for-go/sdk/storage/azblob from the deprecated github.com/Azure/azure-storage-blob-go

@renormalize renormalize requested a review from a team as a code owner July 22, 2024 03:57
@gardener-robot gardener-robot added the needs/review Needs review label Jul 22, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jul 22, 2024
@gardener-robot gardener-robot added size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else labels Jul 22, 2024
@renormalize renormalize self-assigned this Jul 22, 2024
@renormalize renormalize added this to the v0.30.0 milestone Jul 22, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jul 22, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jul 23, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jul 23, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jul 23, 2024
@anveshreddy18
Copy link
Contributor

/assign

@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jul 26, 2024
@ishan16696
Copy link
Member

/assign

pkg/snapstore/abs_snapstore.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore_test.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore_test.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore_test.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore_test.go Show resolved Hide resolved
pkg/snapstore/abs_snapstore_test.go Outdated Show resolved Hide resolved
@gardener-robot gardener-robot added the needs/changes Needs (more) changes label Aug 7, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Aug 7, 2024
pkg/snapstore/abs_snapstore.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore_test.go Outdated Show resolved Hide resolved
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Aug 14, 2024
@renormalize
Copy link
Member Author

Thanks for your review @ishan16696!

Will let you know once the other PRs get merged and I resolve the conflicts.

…or-go`

* Elimiated usage of the old `Azure/azure-storage-blob-go` in `pkg/snapstore/abs_snapstore.go`.

* Used functionality provided by `Azure/azure-sdk-for-go` in `pkg/snapstore/abs_snapstore.go`.

* Methods on `ABSSnapStore` work as intended after the change.

Unit tests refactored for the new SDK.

`abs_snapstore_test.go` cleanup.

Ran `go mod tidy`, `go mod vendor`

Address review comments from @anveshreddy18.

Address review comments from @ishan16696 1.

* Remove variable names from interface type definitions

* Make use of `streaming.NopCloser()` to create a no-op `Close()` for a
  `ReadSeekCloser`, instead of redefining the type.

* Fix typo pointed out by @anveshreddy18

Address review comments from @ishan16696 2.

* Nit change: change `context.TODO()` to `context.Background()`.

Rebased on PR 759.
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Aug 19, 2024
@shreyas-s-rao shreyas-s-rao modified the milestones: v0.30.0, v0.31.0 Aug 21, 2024
Comment on lines +24 to +29
type fakeABSContainerClient struct {
objects map[string]*[]byte
prefix string
mutex sync.Mutex
// a map of blobClients so new clients created to a particular blob refer to the same blob
blobClients map[string]*fakeBlockBlobClient
Copy link
Member

@ishan16696 ishan16696 Aug 21, 2024

Choose a reason for hiding this comment

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

do you want to mock the AzureBlockBlob Client ?

//go:generate mockgen -package <name> -destination=mocks.go github.com/gardener/etcd-backup-restore/pkg/snapstore/ AzureBlockBlobClientI

you can take a look at this package:

//go:generate mockgen -package client -destination=mocks.go github.com/gardener/etcd-backup-restore/pkg/etcdutil/client Factory,ClusterCloser,KVCloser,MaintenanceCloser

Copy link
Member Author

Choose a reason for hiding this comment

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

I will leave this to another PR. Will create an issue to track this later.

Copy link
Member

Choose a reason for hiding this comment

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

can you create an issue for it and mentioned it here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've created an issue to track this. #772.

pkg/snapstore/abs_snapstore.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore.go Outdated Show resolved Hide resolved
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Sep 4, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Sep 5, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Sep 5, 2024
Copy link
Member

@ishan16696 ishan16696 left a comment

Choose a reason for hiding this comment

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

Thanks for all changes. LGTM!!

@ishan16696 ishan16696 removed their assignment Sep 5, 2024
pkg/snapstore/abs_snapstore.go Show resolved Hide resolved
pkg/snapstore/abs_snapstore_test.go Outdated Show resolved Hide resolved
pkg/snapstore/abs_snapstore_test.go Outdated Show resolved Hide resolved
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Sep 6, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Sep 6, 2024
Copy link
Contributor

@anveshreddy18 anveshreddy18 left a comment

Choose a reason for hiding this comment

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

LGTM

@renormalize renormalize merged commit 7e78860 into gardener:master Sep 9, 2024
9 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Sep 9, 2024
@renormalize renormalize deleted the azblob branch November 15, 2024 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/changes Needs (more) changes needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review needs/second-opinion Needs second review by someone else size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
9 participants