Skip to content

Commit

Permalink
chore: warn when using bind_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
killme2008 committed Jun 25, 2024
1 parent 1b5ee58 commit f58ed88
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/servers/src/addrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use common_telemetry::warn;

/// Resolves hostname:port address for meta registration.
/// If `hostname_addr` is present, prefer to use it, `bind_addr` otherwise.
///
pub fn resolve_addr(bind_addr: &str, hostname_addr: Option<&str>) -> String {
match hostname_addr {
Some(hostname_addr) => {
Expand All @@ -28,7 +29,10 @@ pub fn resolve_addr(bind_addr: &str, hostname_addr: Option<&str>) -> String {
format!("{hostname_addr}:{port}")
}
}
None => bind_addr.to_string(),
None => {
warn!("hostname not set, using bind_addr: {bind_addr} instead.");
bind_addr.to_string()
}
}
}

Expand Down

0 comments on commit f58ed88

Please sign in to comment.