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

Windows: Add CredentialSpec #814

Merged
merged 1 commit into from
May 18, 2017
Merged

Conversation

lowenna
Copy link
Contributor

@lowenna lowenna commented May 12, 2017

Signed-off-by: John Howard jhoward@microsoft.com

The Windows implementation of the docker daemon still passes a number of fields out of band from the OCI runtime spec. This PR addresses the CredentialSpec field by adding it to the runtime spec. (https://github.com/moby/moby/blob/master/libcontainerd/client_windows.go#L177-L178)


## <a name="configWindowsCredentialSpec" />Credential Spec

You can configure a container's group Managed Service Accounts (gMSAs) via the OPTIONAL `credentialspec` field of the Windows configuration. For more information about gMSAs, see [Active Directory Service Accounts for Windows Containers][gMSAOverview]. For more information about tooling to generate a gMSA, see [Deployment Overview][gMSATooling].
Copy link
Contributor

Choose a reason for hiding this comment

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

Travis doesn't like the trailing whitespace here (or after "GroupManagedServiceAccounts": [ below).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yes, fixing.


```json
"windows": {
"credentialspec": {
Copy link
Contributor

@wking wking May 12, 2017

Choose a reason for hiding this comment

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

This value is a JSON object. Your current docs don't have much to say on the value type (using the “credentialspec (object, OPTIONAL) …” pattern would help with this), but your current Go type has it listed as a string (which will break if you try to read in your example here).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's an opaque JSON blob passed as a string. I should have escaped the example and will shortly. The actual contents are very independent from the spec and implementation specific which is why I referred to the tooling to create such an example. I really don't believe the contents should be described in this spec.

@lowenna lowenna force-pushed the credentialspec branch 2 times, most recently from a7b7359 to 93a4dce Compare May 13, 2017 03:47
@lowenna
Copy link
Contributor Author

lowenna commented May 13, 2017

Added matching change to schema\config-windows.json


## <a name="configWindowsCredentialSpec" />Credential Spec

You can configure a container's group Managed Service Accounts (gMSAs) via the OPTIONAL `credentialspec` field of the Windows configuration. For more information about gMSAs, see [Active Directory Service Accounts for Windows Containers][gMSAOverview]. For more information about tooling to generate a gMSA, see [Deployment Overview][gMSATooling]. The `credentialspec` MUST be a string containing an escaped JSON object.
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of making this a string with serialized JSON, can you make it a JSON object, say the object properties are implementation-defined, and use an interface{} in the Go type? That should get you the same flexibility while still letting you (de)serialize in a single pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I can change this to be interface{}. (Done). I'm not sure what this should be in schema\config-windows.json though if not type string? This is unique - no similar example exists in the spec to duplicate.

I have also updated the description in config-windows.md to indicate it's implementation-defined.

To be clear though - you are recommending to remove the example (even though technically accurate)? And what about the links? Should they stay (I think they should...)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what this should be in schema\config-windows.json though if not type string?

You can just declare it an object and leave it at that (backing RFC drafts here and here):

"credentialspec": {
    "id": "https://opencontainers.org/schema/bundle/windows/credentialspec",
    "type": "object"
}

To be clear though - you are recommending to remove the example (even though technically accurate)?

Ideally we'd link to the backing Windows docs (which are necessary to satisfy “implementation-defined”. Lacking that, I'm in favor of including as much information as we can as long as we're reasonably confident that it won't go stale during the useful lifetime of the next spec release. If you expect the links and example you have now to be current for the lifetime of the 1.0 runtime spec, I'm fine with them. If you expect they will go stale before runtime-spec 1.0 is archaic, I'd rather replace them with something generic enough to stay current.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can just declare it an object and leave it at that

Thanks. Done.

While I don't believe there's any reason that the example will be invalid (as it's already in a released Microsoft product that customers are using), on reflection, it probably is cleaner to remove the example and refer readers back to the source of knowledge, that being the Microsoft documentation. Update done and pushed.

For the links, @PatrickLang is going to arrange a couple of aka.ms redirects, and I'll update the PR with them once I have them.

Signed-off-by: John Howard <jhoward@microsoft.com>
@lowenna
Copy link
Contributor Author

lowenna commented May 15, 2017

Updated to aka.ms links. Thanks @PatrickLang 😸

@TomSweeneyRedHat
Copy link

LGTM

@mrunalp
Copy link
Contributor

mrunalp commented May 18, 2017

LGTM

Approved with PullApprove

@tianon
Copy link
Member

tianon commented May 18, 2017

LGTM

Approved with PullApprove

@tianon tianon merged commit 5753194 into opencontainers:master May 18, 2017
@vbatts vbatts mentioned this pull request Jul 5, 2017
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Jul 10, 2017
Through f4d221c (Merge pull request opencontainers#880 from
dqminh/wking-linux-only-capabilities-again, 2017-07-05).  The rc6
release picked up an earlier version of these notes, and those entries
are mostly unchanged except for:

* The credentialSpec entry, which was opencontainers#814 for credentialspec and now
  also includes opencontainers#859 for credentialSpec.

* The root(.path) Hyper-V entry, which was opencontainers#820 for root.path and now
  also includes opencontainers#838 for root.  I also moved this into the "breaking
  changes" section, because rc5 Hyper-V configs required root to be
  set, and rc6 Hyper-V configs require it to not be set.  Although
  whether rc5 allowed Hyper-V configs at all is not clear to me.

* Fixed indenting for the typo-fixes entry, as well as a number of
  more recent typo-fix PRs.

Signed-off-by: W. Trevor King <wking@tremily.us>
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Jul 11, 2017
Through f4d221c (Merge pull request opencontainers#880 from
dqminh/wking-linux-only-capabilities-again, 2017-07-05).  The rc6
release picked up an earlier version of these notes, and those entries
are mostly unchanged except for:

* The credentialSpec entry, which was opencontainers#814 for credentialspec and now
  also includes opencontainers#859 for credentialSpec.

* The root(.path) Hyper-V entry, which was opencontainers#820 for root.path and now
  also includes opencontainers#838 for root.  I also moved this into the "breaking
  changes" section, because rc5 Hyper-V configs required root to be
  set, and rc6 Hyper-V configs require it to not be set.  Although
  whether rc5 allowed Hyper-V configs at all is not clear to me.

* Fixed indenting for the typo-fixes entry, as well as a number of
  more recent typo-fix PRs.

Signed-off-by: W. Trevor King <wking@tremily.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants