diff --git a/.github/services/webhdfs/webhdfs_with_user_name/action.yml b/.github/services/webhdfs/webhdfs_with_user_name/action.yml new file mode 100644 index 000000000000..10d0f3867e21 --- /dev/null +++ b/.github/services/webhdfs/webhdfs_with_user_name/action.yml @@ -0,0 +1,37 @@ +# 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. + +name: webhdfs +description: "Behavior test for webhdfs with user name specified" + +runs: + using: "composite" + steps: + - name: Setup webhdfs + shell: bash + working-directory: fixtures/webhdfs + run: | + docker compose -f docker-compose-webhdfs.yml up -d --wait + - name: Setup + shell: bash + run: | + cat << EOF >> $GITHUB_ENV + OPENDAL_WEBHDFS_ROOT=/ + OPENDAL_WEBHDFS_ENDPOINT=http://127.0.0.1:9870 + OPENDAL_WEBHDFS_ATOMIC_WRITE_DIR=.opendal_tmp/ + OPENDAL_WEBHDFS_USER_NAME=opendal + EOF diff --git a/core/src/services/webhdfs/backend.rs b/core/src/services/webhdfs/backend.rs index 0b1961e5abb9..afd165afd045 100644 --- a/core/src/services/webhdfs/backend.rs +++ b/core/src/services/webhdfs/backend.rs @@ -104,9 +104,9 @@ impl WebhdfsBuilder { /// Set the username of this backend, /// used for authentication /// - pub fn username(mut self, username: &str) -> Self { - if !username.is_empty() { - self.config.user_name = Some(username.to_string()); + pub fn user_name(mut self, user_name: &str) -> Self { + if !user_name.is_empty() { + self.config.user_name = Some(user_name.to_string()); } self }