forked from Azure/iotedge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[k8s public preview] Pull in 1.0.9.4 fixes, update images and Helm ch…
…arts (Azure#3272) * Fix edge agent connection 1.0.9 (Azure#3172) * Recreate connection after every exception * Fix: Edgelet unable to pull using certain passwords - cherry-pick into 1.0.9. (Azure#3206) (Azure#3209) Some passwords (especially generated passwords) can be used by docker CLI, but not by Edgelet. There is a chance of this happening when passwords contain `?` or `~`. It's not explicitly stated in the [Docker API](https://docs.docker.com/engine/api/v1.40/#section/Authentication), but the [code](https://github.com/docker/cli/blob/master/cli/command/registry.go#L50) is written such that the `X-Registry-Auth` header is expected to be URL safe (RFC 4648) base64. * Agent reported state as "406" when modules are in backoff. (Azure#3244) To reproduce 1. create a deployment which has a module which fails to launch, like an incorrect image name, or some weird mount Docker doesn't like. 2. Look at the reported status of the edge runtime - If you are lucky, you will see the real error. 3. Let the runtime run for long enough that the "OrderedRetryPlanRunner" puts the module on backoff. 4. Look at the reported status of the edge runtime - You won't see the real error message from the failure - you will see a "406 -- The device is offline or not sending status reports" The root cause is that every reconcile starts with status=Unknown(406), and when a module is in backoff, the status doesn't update. So it goes: reconcile loop 1: module command fails, error is reported reconcile loop 2: module is in backoff now, Unknown is reported ... reconcile loop n: module command is attempted again, error is reported reconcile loop n+1: module is in backoff again, Unknown is reported. User is more likely to see "406 -- The device is offline or not sending status reports" which is not cool. This has been seen before, one example: Azure#2066 The fix here is to keep track of status in Agent and report current status until it changes (either via a new error * Update dockerfiles for arm32 & amd64, update Helm charts. * Fix teh edge agent tests. Co-authored-by: Anca Antochi <[email protected]>
- Loading branch information
1 parent
bfac673
commit fd36404
Showing
12 changed files
with
162 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -407,13 +407,13 @@ fn image_pull_with_invalid_creds_handler(req: Request<Body>) -> ResponseFuture { | |
.headers() | ||
.get_all("X-Registry-Auth") | ||
.into_iter() | ||
.map(|bytes| base64::decode(bytes).unwrap()) | ||
.map(|bytes| base64::decode_config(bytes, base64::URL_SAFE).unwrap()) | ||
.map(|raw| str::from_utf8(&raw).unwrap().to_owned()) | ||
.collect::<Vec<String>>() | ||
.join(""); | ||
let auth_config: AuthConfig = serde_json::from_str(&auth_str.to_string()).unwrap(); | ||
assert_eq!(auth_config.username(), Some("u1")); | ||
assert_eq!(auth_config.password(), Some("wrong_password")); | ||
let auth_config: AuthConfig = serde_json::from_str(&auth_str).unwrap(); | ||
assert_eq!(auth_config.username(), Some("us1")); | ||
assert_eq!(auth_config.password(), Some("ac?ac~aaac???")); | ||
assert_eq!(auth_config.email(), Some("[email protected]")); | ||
assert_eq!(auth_config.serveraddress(), Some("svr1")); | ||
|
||
|
@@ -460,9 +460,10 @@ fn image_pull_with_invalid_creds_fails() { | |
|
||
let task = DockerModuleRuntime::make_runtime(settings, provisioning_result(), crypto()) | ||
.and_then(|runtime| { | ||
// password is written to guarantee base64 encoding has '-' and/or '_' | ||
let auth = AuthConfig::new() | ||
.with_username("u1".to_string()) | ||
.with_password("wrong_password".to_string()) | ||
.with_username("us1".to_string()) | ||
.with_password("ac?ac~aaac???".to_string()) | ||
.with_email("[email protected]".to_string()) | ||
.with_serveraddress("svr1".to_string()); | ||
let config = DockerConfig::new( | ||
|
@@ -595,7 +596,7 @@ fn image_pull_with_creds_handler(req: Request<Body>) -> ResponseFuture { | |
.headers() | ||
.get_all("X-Registry-Auth") | ||
.into_iter() | ||
.map(|bytes| base64::decode(bytes).unwrap()) | ||
.map(|bytes| base64::decode_config(bytes, base64::URL_SAFE).unwrap()) | ||
.map(|raw| str::from_utf8(&raw).unwrap().to_owned()) | ||
.collect::<Vec<String>>() | ||
.join(""); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters