MartijnVisser commented on code in PR #30039:
URL: https://github.com/apache/flink/pull/30039#discussion_r4738806266
##########
flink-filesystems/flink-gs-fs-hadoop/src/main/java/org/apache/flink/fs/gs/utils/ConfigUtils.java:
##########
@@ -149,6 +159,15 @@ public static Optional<GoogleCredentials>
getStorageCredentials(
LOGGER.info(
"Creating GSRecoverableWriter using credentials from {}",
credentialsPath.get());
+ if (!isConnectorAuthTypeSet(hadoopConfig)) {
Review Comment:
Yes, but it now defaults to what 2.2.18 picked rather than
`matchingAuthType`. The two differ when both the keyfile and
`GOOGLE_APPLICATION_CREDENTIALS` are set: 2.2.18 used the keyfile.
##########
flink-filesystems/flink-gs-fs-hadoop/src/test/java/org/apache/flink/fs/gs/utils/ConfigUtilsAuthTypeTest.java:
##########
@@ -0,0 +1,214 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.fs.gs.utils;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.fs.gs.TestUtils;
+import org.apache.flink.testutils.logging.LoggerAuditingExtension;
+
+import com.google.auth.oauth2.GoogleCredentials;
+import com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystemConfiguration;
+import com.google.cloud.hadoop.util.HadoopCredentialsConfiguration;
+import
com.google.cloud.hadoop.util.HadoopCredentialsConfiguration.AuthenticationType;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.slf4j.event.Level;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Tests that the two documented credential setups give gcs-connector and the
RecoverableWriter the
+ * same credentials, and that Flink warns when they don't.
+ */
+class ConfigUtilsAuthTypeTest {
+
+ private static final String CONF_DIR = "/hadoop/conf";
+
+ private static final String APPLICATION_CREDENTIALS =
"/opt/application.json";
+
+ private static final String KEYFILE = "/opt/keyfile.json";
+
+ @RegisterExtension
+ private final LoggerAuditingExtension warnings =
+ new LoggerAuditingExtension(ConfigUtils.class, Level.WARN);
+
+ @Test
+ void warnsForApplicationCredentialsWithoutAuthType() {
+ final org.apache.hadoop.conf.Configuration hadoopConfig =
+ loadCredentials(
+ Collections.emptyMap(),
+ Collections.emptyMap(),
+ APPLICATION_CREDENTIALS,
+ APPLICATION_CREDENTIALS);
+
+ assertThat(hadoopConfig.get("fs.gs.auth.type")).isNull();
+
assertThat(connectorAuthType(hadoopConfig)).isEqualTo(AuthenticationType.COMPUTE_ENGINE);
Review Comment:
It was, but a warning isn't enough. Without a metadata server, 2.2.18 used
the file and the previous head failed. Flink now keeps the 2.2.18 choice, and
`ConfigUtilsAuthTypeTest` covers the 2.2.18 cases.
##########
flink-filesystems/flink-gs-fs-hadoop/pom.xml:
##########
@@ -34,11 +34,11 @@ under the License.
<properties>
<!-- If updating these dependency versions, please also update
the corresponding links -->
<!-- in the GCS file system documentation. -->
- <fs.gs.sdk.version>2.68.0</fs.gs.sdk.version>
-
<fs.gs.connector.version>hadoop3-2.2.18</fs.gs.connector.version>
- <fs.gs.cloud.nio.version>0.128.7</fs.gs.cloud.nio.version>
+ <fs.gs.sdk.version>2.79.0</fs.gs.sdk.version>
+ <fs.gs.connector.version>3.1.22</fs.gs.connector.version>
Review Comment:
Yes, moved to 3.1.23. Besides a User-Agent header fix, its only change is
the dot-segment fix for rename, and its POMs differ from 3.1.22's only in the
version.
##########
flink-filesystems/flink-gs-fs-hadoop/src/main/resources/META-INF/NOTICE:
##########
@@ -11,104 +11,113 @@ This project bundles the following dependencies under the
Apache Software Licens
- com.fasterxml.jackson.core:jackson-databind:2.22.2
- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.22.2
- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.22.2
-- com.fasterxml.woodstox:woodstox-core:7.0.0
+- com.fasterxml.woodstox:woodstox-core:7.2.0
- com.google.android:annotations:4.1.1.4
-- com.google.api-client:google-api-client-jackson2:2.0.1
-- com.google.api-client:google-api-client:2.7.2
-- com.google.api.grpc:gapic-google-cloud-storage-v2:2.68.0
-- com.google.api.grpc:grpc-google-cloud-storage-v2:2.68.0
+- com.google.api-client:google-api-client-gson:2.9.2
+- com.google.api-client:google-api-client:2.9.2
+- com.google.api.grpc:gapic-google-cloud-storage-v2:2.79.0
+- com.google.api.grpc:grpc-google-cloud-storage-control-v2:2.49.0
+- com.google.api.grpc:grpc-google-cloud-storage-v2:2.79.0
+- com.google.api.grpc:proto-google-cloud-logging-v2:0.110.4
- com.google.api.grpc:proto-google-cloud-monitoring-v3:3.52.0
-- com.google.api.grpc:proto-google-cloud-storage-v2:2.68.0
-- com.google.api.grpc:proto-google-common-protos:2.71.0
-- com.google.api.grpc:proto-google-iam-v1:1.66.0
+- com.google.api.grpc:proto-google-cloud-storage-control-v2:2.49.0
+- com.google.api.grpc:proto-google-cloud-storage-v2:2.79.0
+- com.google.api.grpc:proto-google-common-protos:2.82.0
+- com.google.api.grpc:proto-google-iam-v1:1.77.0
- com.google.apis:google-api-services-iamcredentials:v1-rev20211203-2.0.0
-- com.google.apis:google-api-services-storage:v1-rev20260204-2.0.0
+- com.google.apis:google-api-services-storage:v1-rev20260524-2.0.0
- com.google.auto.value:auto-value-annotations:1.11.0
-- com.google.cloud.bigdataoss:gcs-connector:hadoop3-2.2.18
-- com.google.cloud.bigdataoss:gcsio:2.2.18
-- com.google.cloud.bigdataoss:util-hadoop:hadoop3-2.2.18
-- com.google.cloud.bigdataoss:util:2.2.18
-- com.google.cloud.opentelemetry:detector-resources-support:0.33.0
+- com.google.cloud.bigdataoss:gcs-connector:3.1.22
+- com.google.cloud.bigdataoss:gcsio:3.1.22
+- com.google.cloud.bigdataoss:util-hadoop:3.1.22
+- com.google.cloud.bigdataoss:util:3.1.22
+- com.google.cloud.opentelemetry:detector-resources-support:0.31.0
- com.google.cloud.opentelemetry:exporter-metrics:0.33.0
- com.google.cloud.opentelemetry:shared-resourcemapping:0.33.0
-- com.google.cloud:google-cloud-core-grpc:2.70.0
-- com.google.cloud:google-cloud-core-http:2.70.0
-- com.google.cloud:google-cloud-core:2.70.0
+- com.google.cloud:google-cloud-core-grpc:2.81.0
+- com.google.cloud:google-cloud-core-http:2.81.0
+- com.google.cloud:google-cloud-core:2.81.0
+- com.google.cloud:google-cloud-logging:3.21.4
- com.google.cloud:google-cloud-monitoring:3.52.0
-- com.google.cloud:google-cloud-storage:2.68.0
-- com.google.code.gson:gson:2.13.2
-- com.google.flogger:flogger-system-backend:0.7.1
-- com.google.flogger:flogger:0.7.1
-- com.google.flogger:google-extensions:0.7.1
+- com.google.cloud:google-cloud-storage-control:2.49.0
Review Comment:
Not intended. gcsio declares 2.49.0 from libraries-bom 26.56.0, and we
override google-cloud-storage to 2.79.0. Importing `google-cloud-storage-bom`
now moves storage-control to 2.79.0 as well.
##########
flink-filesystems/flink-gs-fs-hadoop/src/main/java/org/apache/flink/fs/gs/utils/ConfigUtils.java:
##########
Review Comment:
Yes, changed. Without a file it sets no credentials, so the Storage client
uses the application default credentials.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]