Skip to content

Commit 168a79c

Browse files
Removing constrain that makes no sense in general case (#4611)
1 parent 8af0fe8 commit 168a79c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

edgelet/iotedge/src/check/checks/hostname.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,12 @@ impl Hostname {
8686
//
8787
// Instead, we punt on this check and assume that everything's fine if config_hostname is identical to the device hostname,
8888
// or starts with it.
89-
if config_hostname != machine_hostname
90-
&& !config_hostname.starts_with(&format!("{}.", machine_hostname))
89+
//
90+
// Azure FQDN don't support capital letter so we lower case the hostname before doing the check.
91+
if config_hostname.to_lowercase() != machine_hostname.to_lowercase()
92+
&& !config_hostname
93+
.to_lowercase()
94+
.starts_with(&format!("{}.", machine_hostname.to_lowercase()))
9195
{
9296
return Err(Context::new(format!(
9397
"configuration has hostname {} but device reports hostname {}.\n\

0 commit comments

Comments
 (0)