-
Notifications
You must be signed in to change notification settings - Fork 880
Conversation
8e5e987
to
b9c93ed
Compare
@jonboulle @alban @krnowak PTAL; stage1 is not ready yet, learning that part right now. |
I suggest implementing stage1 in a different PR in case this is lgtm. |
``` | ||
$ rkt config | ||
{ | ||
"stage0": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OOB notes:
- define top-level struct, as this is new
- explain why we are printing each entry separately (even if the input config was deduplicated)
- explain oauth/basic mutual incompatibility and override semantics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, please capture everything from the design doc in here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed OOB notes. I could not reproduce the oauth/basic mutual incompatibility, I mixed up the already documented override semantics of system/user directories.
/cc @josephschorr |
} | ||
``` | ||
|
||
And the follwong user configuration: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/follwong/following
@alban @krnowak @jonboulle PTAL |
|
||
The entries "stage0" and "stage1" refer to stage-specific configuration. The generated output are valid configuration entries as specified in the configuration documentation. | ||
|
||
The "stage0" entry contains entries of rktKind "auth", "dockerAuth", and "paths". Note that the `config` subcommand will output separate entries per "auth" domain and separate entries per "dockerAuth" registry. While it is possible to specify an array of strings in the input configuration rkt internally merges configuration state from different directories potentially creating multiple entries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make my plans about configuration clear here.
stage0
configuration is the configuration read by the rkt
binary. So, rkt
needs to know the credentials for fetching images (auth
and dockerAuth
kinds), needs to know where to store the fetched images (paths
kind) and needs to know which stage1 image should be used by default and where to look for it (stage1
kind).
stage1
configuration will keep the configuration read by the binaries inside stage1 image (in our case init
, enter
and so on). So in this entry, we would put networking configuration and other stage1 specific settings.
So, in the current PR, stage1 entry should be empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, about the multiple auth
entries - that's an implementation detail. We may change the code later to be smarter and merge the blocks with the same credentials. So I would keep quiet about it to avoid giving an impression that "domains" key is always a table with only one element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm .. not sure about this, @jonboulle suggested to be transparent about it but you have a point, it's an implementation detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's partly an implementation detail, but it's also unintuitive why there's an asymmetry if I feed in a config with multiple entries and get back multiple stanzas with single entries. I think we can strike a balance explaining that they are semantically identical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The asymmetry is only because of the implementation. Anyway, this can stay for now, but I'd like to have a warning or something that one should not assume that it will stay like that (means - one entry for each domain). "domains" key is an array for a reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I addressed this by adding a statement that the current merged/non-merged output behavior is subject to change.
e699eeb
to
76d4023
Compare
@alban @krnowak @jonboulle PTAL; if looks good, I'll squash being ready for the release. |
@@ -0,0 +1,125 @@ | |||
# rkt config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paging @joshix for doc review.
What's with the test failure? https://semaphoreci.com/coreos/rkt/branches/pull-request-2405/builds/17 |
Since this becomes API, I'd like to see a test that this outputs what we expect (and is consumable again, if that's what we're promising), rather than just a successful marshalling. In the interests of getting this in 1.4.0 I'm okay with that being a follow-up, but we need some guarantees to avoid future breakage. |
@jonboulle issue already created, xref'ing here: #2410 |
Looks good from a usage perspective; excited to add support. |
@@ -0,0 +1,125 @@ | |||
# rkt config | |||
|
|||
This command prints the rkt configuration per stage in JSON format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config
subcommand prints the configuration of each rkt stage in JSON on the standard output.
(have to break reviewing this until later today)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks @joshix!
a55d1f5
to
3fab112
Compare
cmdRkt.AddCommand(cmdConfig) | ||
} | ||
|
||
func runConfig(cmd *cobra.Command, args []string) (exit int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that (exit int)
is a copy-pasta from other commands, you don't use it here, so just simplify it to int
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Two final nits, otherwise LFAD. |
This adds the config subcommand. Currently only stage0 configuration is supported. Fixes rkt#2368
This command adds the config subcommand.
TODOs:
add(removed)paths
entriesstage0
auth
entriesstage0
paths
entriesstage1
entries (currently only one)Fixes #2368