Fix the compatibility with a new golang-github-azure-storage-blob 0.12
This commit is contained in:
parent
592b37af14
commit
fd647d22d7
31
fix-azure-dependency.patch
Normal file
31
fix-azure-dependency.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
diff --git a/internal/upload/azure/azure.go b/internal/upload/azure/azure.go
|
||||||
|
index 8e18fe78..a5d8f857 100644
|
||||||
|
--- a/internal/upload/azure/azure.go
|
||||||
|
+++ b/internal/upload/azure/azure.go
|
||||||
|
@@ -83,7 +83,7 @@ func UploadImage(credentials Credentials, metadata ImageMetadata, fileName strin
|
||||||
|
|
||||||
|
// Create page blob URL. Page blob is required for VM images
|
||||||
|
blobURL := containerURL.NewPageBlobURL(metadata.ImageName)
|
||||||
|
- _, err = blobURL.Create(ctx, stat.Size(), 0, azblob.BlobHTTPHeaders{}, azblob.Metadata{}, azblob.BlobAccessConditions{})
|
||||||
|
+ _, err = blobURL.Create(ctx, stat.Size(), 0, azblob.BlobHTTPHeaders{}, azblob.Metadata{}, azblob.BlobAccessConditions{}, azblob.PremiumPageBlobAccessTierNone, azblob.BlobTagsMap{}, azblob.ClientProvidedKeyOptions{})
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("cannot create the blob URL: %v", err)
|
||||||
|
}
|
||||||
|
@@ -122,7 +122,7 @@ func UploadImage(credentials Credentials, metadata ImageMetadata, fileName strin
|
||||||
|
semaphore <- 1
|
||||||
|
go func(counter int64, buffer []byte, n int) {
|
||||||
|
defer wg.Done()
|
||||||
|
- _, err = blobURL.UploadPages(ctx, counter*azblob.PageBlobMaxUploadPagesBytes, bytes.NewReader(buffer[:n]), azblob.PageBlobAccessConditions{}, nil)
|
||||||
|
+ _, err = blobURL.UploadPages(ctx, counter*azblob.PageBlobMaxUploadPagesBytes, bytes.NewReader(buffer[:n]), azblob.PageBlobAccessConditions{}, nil, azblob.ClientProvidedKeyOptions{})
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("uploading a page failed: %v", err)
|
||||||
|
// Send the error to the error channel in a non-blocking way. If there is already an error, just discard this one
|
||||||
|
@@ -144,7 +144,7 @@ func UploadImage(credentials Credentials, metadata ImageMetadata, fileName strin
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
// Check properties, specifically MD5 sum of the blob
|
||||||
|
- props, err := blobURL.GetProperties(ctx, azblob.BlobAccessConditions{})
|
||||||
|
+ props, err := blobURL.GetProperties(ctx, azblob.BlobAccessConditions{}, azblob.ClientProvidedKeyOptions{})
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("getting the properties of the new blob failed: %v", err)
|
||||||
|
}
|
@ -15,7 +15,7 @@ As such, it is a drop-in replacement.
|
|||||||
}
|
}
|
||||||
|
|
||||||
Name: osbuild-composer
|
Name: osbuild-composer
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: An image building service based on osbuild
|
Summary: An image building service based on osbuild
|
||||||
|
|
||||||
# osbuild-composer doesn't have support for building i686 images
|
# osbuild-composer doesn't have support for building i686 images
|
||||||
@ -26,7 +26,7 @@ ExcludeArch: i686
|
|||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
URL: %{gourl}
|
URL: %{gourl}
|
||||||
Source0: %{gosource}
|
Source0: %{gosource}
|
||||||
|
Patch0: fix-azure-dependency.patch
|
||||||
|
|
||||||
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
|
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd
|
||||||
@ -88,6 +88,7 @@ Obsoletes: osbuild-composer-koji <= 23
|
|||||||
%forgeautosetup -p1
|
%forgeautosetup -p1
|
||||||
%else
|
%else
|
||||||
%goprep
|
%goprep
|
||||||
|
%patch -p1
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?fedora} && 0%{?fedora} <= 32
|
%if 0%{?fedora} && 0%{?fedora} <= 32
|
||||||
@ -348,6 +349,9 @@ Integration tests to be run on a pristine-dedicated system to test the osbuild-c
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Dec 17 2020 Ondrej Budai <obudai@redhat.com> - 26-2
|
||||||
|
- Fix the compatibility with a new golang-github-azure-storage-blob 0.12
|
||||||
|
|
||||||
* Thu Dec 17 2020 Ondrej Budai <obudai@redhat.com> - 26-1
|
* Thu Dec 17 2020 Ondrej Budai <obudai@redhat.com> - 26-1
|
||||||
- New upstream release
|
- New upstream release
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user