!2 修复编译失败问题
From: @caodongxia Reviewed-by: @jianminw Signed-off-by: @jianminw
This commit is contained in:
commit
85171f5c66
134
0002-Change-Base64-Path.patch
Normal file
134
0002-Change-Base64-Path.patch
Normal file
@ -0,0 +1,134 @@
|
||||
From 8a559fde19aaf4ef52fe082bd59fc89abe5b66ba Mon Sep 17 00:00:00 2001
|
||||
From: caodongxia <315816521@qq.com>
|
||||
Date: Mon, 28 Jun 2021 11:17:45 +0800
|
||||
Subject: [PATCH] patch
|
||||
|
||||
---
|
||||
.../docker/client/messages/RegistryAuth.java | 4 ++--
|
||||
.../docker/client/DefaultDockerClientTest.java | 6 +++---
|
||||
.../docker/client/DefaultDockerClientUnitTest.java | 14 +++++++-------
|
||||
3 files changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/com/spotify/docker/client/messages/RegistryAuth.java b/src/main/java/com/spotify/docker/client/messages/RegistryAuth.java
|
||||
index 0844c6b..0d9b115 100644
|
||||
--- a/src/main/java/com/spotify/docker/client/messages/RegistryAuth.java
|
||||
+++ b/src/main/java/com/spotify/docker/client/messages/RegistryAuth.java
|
||||
@@ -33,7 +33,7 @@ import com.spotify.docker.client.DockerConfigReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import javax.annotation.Nullable;
|
||||
-import org.glassfish.jersey.internal.util.Base64;
|
||||
+import java.util.Base64;
|
||||
|
||||
@AutoValue
|
||||
@JsonAutoDetect(fieldVisibility = ANY, getterVisibility = NONE, setterVisibility = NONE)
|
||||
@@ -162,7 +162,7 @@ public abstract class RegistryAuth {
|
||||
/** Construct a Builder based upon the "auth" field of the docker client config file. */
|
||||
public static Builder forAuth(final String auth) {
|
||||
// split with limit=2 to catch case where password contains a colon
|
||||
- final String[] authParams = Base64.decodeAsString(auth).split(":", 2);
|
||||
+ final String[] authParams = new String(Base64.getDecoder().decode(auth)).split(":", 2);
|
||||
|
||||
if (authParams.length != 2) {
|
||||
return builder();
|
||||
diff --git a/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java b/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java
|
||||
index 46c2612..6e3eff4 100644
|
||||
--- a/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java
|
||||
+++ b/src/test/java/com/spotify/docker/client/DefaultDockerClientTest.java
|
||||
@@ -271,7 +271,7 @@ import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
|
||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
import org.apache.http.pool.PoolStats;
|
||||
import org.glassfish.jersey.apache.connector.ApacheClientProperties;
|
||||
-import org.glassfish.jersey.internal.util.Base64;
|
||||
+import java.util.Base64;
|
||||
import org.hamcrest.CustomTypeSafeMatcher;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hamcrest.Matchers;
|
||||
@@ -5045,7 +5045,7 @@ public class DefaultDockerClientTest {
|
||||
}
|
||||
assertThat(sut.listSecrets().size(), equalTo(0));
|
||||
|
||||
- final String secretData = Base64.encodeAsString("testdata".getBytes());
|
||||
+ final String secretData = Base64.getEncoder().encodeToString("testdata".getBytes());
|
||||
|
||||
final Map<String, String> labels = ImmutableMap.of("foo", "bar", "1", "a");
|
||||
|
||||
@@ -5210,7 +5210,7 @@ public class DefaultDockerClientTest {
|
||||
}
|
||||
assertThat(sut.listSecrets().size(), equalTo(0));
|
||||
|
||||
- final String secretData = Base64.encodeAsString("testdata".getBytes());
|
||||
+ final String secretData = Base64.getEncoder().encodeToString("testdata".getBytes());
|
||||
|
||||
final Map<String, String> labels = ImmutableMap.of("foo", "bar", "1", "a");
|
||||
|
||||
diff --git a/src/test/java/com/spotify/docker/client/DefaultDockerClientUnitTest.java b/src/test/java/com/spotify/docker/client/DefaultDockerClientUnitTest.java
|
||||
index abbd095..02f0dcb 100644
|
||||
--- a/src/test/java/com/spotify/docker/client/DefaultDockerClientUnitTest.java
|
||||
+++ b/src/test/java/com/spotify/docker/client/DefaultDockerClientUnitTest.java
|
||||
@@ -98,7 +98,7 @@ import okhttp3.mockwebserver.RecordedRequest;
|
||||
import okio.Buffer;
|
||||
|
||||
import org.glassfish.jersey.client.RequestEntityProcessing;
|
||||
-import org.glassfish.jersey.internal.util.Base64;
|
||||
+import java.util.Base64;
|
||||
import org.hamcrest.core.IsNot;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -731,7 +731,7 @@ public class DefaultDockerClientUnitTest {
|
||||
|
||||
final ConfigSpec configSpec = ConfigSpec
|
||||
.builder()
|
||||
- .data(Base64.encodeAsString("foobar"))
|
||||
+ .data(Base64.getEncoder().encodeToString("foobar".getBytes()))
|
||||
.name("foo.yaml")
|
||||
.build();
|
||||
|
||||
@@ -811,7 +811,7 @@ public class DefaultDockerClientUnitTest {
|
||||
|
||||
final ConfigSpec configSpec = ConfigSpec
|
||||
.builder()
|
||||
- .data(Base64.encodeAsString("foobar"))
|
||||
+ .data(Base64.getEncoder().encodeToString("foobar".getBytes()))
|
||||
.name("foo.yaml")
|
||||
.build();
|
||||
|
||||
@@ -833,7 +833,7 @@ public class DefaultDockerClientUnitTest {
|
||||
|
||||
final ConfigSpec configSpec = ConfigSpec
|
||||
.builder()
|
||||
- .data(Base64.encodeAsString("foobar"))
|
||||
+ .data(Base64.getEncoder().encodeToString("foobar".getBytes()))
|
||||
.name("foo.yaml")
|
||||
.build();
|
||||
|
||||
@@ -853,7 +853,7 @@ public class DefaultDockerClientUnitTest {
|
||||
|
||||
final ConfigSpec configSpec = ConfigSpec
|
||||
.builder()
|
||||
- .data(Base64.encodeAsString("foobar"))
|
||||
+ .data(Base64.getEncoder().encodeToString("foobar".getBytes()))
|
||||
.name("foo.yaml")
|
||||
.build();
|
||||
|
||||
@@ -967,7 +967,7 @@ public class DefaultDockerClientUnitTest {
|
||||
|
||||
final ConfigSpec configSpec = ConfigSpec
|
||||
.builder()
|
||||
- .data(Base64.encodeAsString("foobar"))
|
||||
+ .data(Base64.getEncoder().encodeToString("foobar".getBytes()))
|
||||
.name("foo.yaml")
|
||||
.build();
|
||||
|
||||
@@ -987,7 +987,7 @@ public class DefaultDockerClientUnitTest {
|
||||
|
||||
final ConfigSpec configSpec = ConfigSpec
|
||||
.builder()
|
||||
- .data(Base64.encodeAsString("foobar"))
|
||||
+ .data(Base64.getEncoder().encodeToString("foobar".getBytes()))
|
||||
.name("foo.yaml")
|
||||
.build();
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: docker-client-java
|
||||
Version: 8.11.7
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: Docker Client
|
||||
Provides: docker-client = %{version}-%{release}
|
||||
Obsoletes: docker-client < %{version}-%{release}
|
||||
@ -8,6 +8,7 @@ License: ASL 2.0
|
||||
URL: https://github.com/spotify/docker-client
|
||||
Source0: https://github.com/spotify/docker-client/archive/v%{version}.tar.gz
|
||||
Patch0: 0001-Port-to-latest-version-of-Google-AutoValue.patch
|
||||
Patch1: 0002-Change-Base64-Path.patch
|
||||
BuildRequires: maven-local mvn(com.fasterxml.jackson.core:jackson-databind)
|
||||
BuildRequires: mvn(com.fasterxml.jackson.datatype:jackson-datatype-guava)
|
||||
BuildRequires: mvn(com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider)
|
||||
@ -32,6 +33,7 @@ The Docker Client is a Java API library for accessing a Docker daemon.
|
||||
%prep
|
||||
%setup -q -n docker-client-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%pom_remove_parent
|
||||
sed -i -e '/<packaging>/a<groupId>com.spotify</groupId>' pom.xml
|
||||
%pom_remove_plugin :maven-shade-plugin
|
||||
@ -74,5 +76,8 @@ rm -rf src/{main,test}/java/com/spotify/docker/client/auth/gcr
|
||||
%doc README.md
|
||||
|
||||
%changelog
|
||||
* Mon Jun 28 2021 caodongxia <caodongxia@huawei.com> - 8.11.7-2
|
||||
- Fix Base64 path
|
||||
|
||||
* Wed Aug 19 2020 yanan li <liyanan032@huawei.com> - 8.11.7-1
|
||||
- Package init
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user