Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De-nest docker registry auth and reformat related doc #445

Merged
merged 2 commits into from
Nov 18, 2015

Conversation

carlosdp
Copy link
Contributor

I'm not sure what happened here, but it looks like the Docker registry authentication parameters added in #390 aren't being decoded?

De-nesting the parameters seems to fix it. I'm guessing it's something to do with how mapstructure decodes the driver config struct.

I also removed the periods (.) from the related keys as they are awkward to type in HCL files as they have to be wrapped in quotes, and re-formatted the related docs a bit so that it's more clear the keys are at the same "level" as the rest of the driver config parameters. I can revert these though if there's a good reason they should be the way they were before.

@cbednarski
Copy link
Contributor

Thanks for the PR. I'm not sure the implementation here was completed. I think it should look something like below and thus not need dots or underscores, but this mapstructure needs to be pinned to the auth key. Labels are also expressed this way now but since they're arbitrary k/v pairs there's no mapstructure associated with them.

config {
  auth {
    username = "username"
    password = "password"
  }
}

@@ -392,6 +387,9 @@ func (d *DockerDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle
ServerAddress: driverConfig.ServerAddress,
}

d.logger.Printf("[DEBUG] TASKCONFIG: %v", task.Config)
d.logger.Printf("[DEBUG] DRIVERCONFIG: %v", driverConfig)
d.logger.Printf("[DEBUG] AUTH: %v", authOptions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes credential leakage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good catch (debugging cruft)

@carlosdp
Copy link
Contributor Author

I agree, that's how I originally thought it worked. I'll make that change.

@carlosdp
Copy link
Contributor Author

Updated to take keys under auth object.

@cbednarski
Copy link
Contributor

Looks good! Thanks for following up. Would you be able to add a test for this?

@carlosdp
Copy link
Contributor Author

Yep, was just thinking that this morning. Will add.

@cbednarski
Copy link
Contributor

@carlosdp I'm going to merge this now because we want to avoid a BC break in config syntax in the 0.2 release. If you're still working on the tests please open a follow-up PR. Otherwise I will get around to this later. Thanks!

cbednarski added a commit that referenced this pull request Nov 18, 2015
De-nest docker registry auth and reformat related doc
@cbednarski cbednarski merged commit 2e43ebf into hashicorp:master Nov 18, 2015
@carlosdp carlosdp deleted the fix-docker-auth branch November 18, 2015 18:38
benbuzbee pushed a commit to benbuzbee/nomad that referenced this pull request Jul 21, 2022
* Allow buffered applyCh

* comment
@github-actions
Copy link

github-actions bot commented May 3, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants