Skip to content

Commit

Permalink
cloud_roles: Override credentials host if set
Browse files Browse the repository at this point in the history
The user can provide a credentials host to override the default value
set per cloud provider.
  • Loading branch information
abhijat committed Apr 18, 2023
1 parent dcb98f2 commit b1b7534
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/v/cloud_roles/refresh_credentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

#pragma once

#include "cloud_roles/logger.h"
#include "cloud_roles/probe.h"
#include "cloud_roles/signature.h"
#include "config/configuration.h"
#include "model/metadata.h"
#include "seastarx.h"

#include <seastar/core/future.hh>
#include <seastar/util/noncopyable_function.hh>
Expand Down Expand Up @@ -175,6 +176,16 @@ refresh_credentials make_refresh_credentials(
std::optional<net::unresolved_address> endpoint = std::nullopt,
retry_params retry_params = default_retry_params) {
auto host = endpoint ? endpoint->host() : CredentialsProvider::default_host;
if (auto cfg_host
= config::shard_local_cfg().cloud_storage_credentials_host();
cfg_host.has_value()) {
vlog(
clrl_log.info,
"overriding {} with {} from configuration",
host,
cfg_host.value());
host = cfg_host.value();
}
auto port = endpoint ? endpoint->port() : CredentialsProvider::default_port;
auto impl = std::make_unique<CredentialsProvider>(
net::unresolved_address{{host.data(), host.size()}, port},
Expand Down

0 comments on commit b1b7534

Please sign in to comment.