-
Notifications
You must be signed in to change notification settings - Fork 51
pods: setupConfig: merge config from config store #889
Conversation
By the RC. It's fine, they'll be available. Next question. Given that a pod has some labels L, with which subset of those labels should we query for a matching pod cluster?
|
851e310
to
61a6eb6
Compare
Oooookay, I think we now merge the config in on install time. If the code works on the first try. |
8b0d8e5
to
9e40554
Compare
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 think we are good to go on this, but I haven't bothered doing watches yet.
Note the TODOs and advise whether something should be done about them!
bin/p2-install-hook/main.go
Outdated
@@ -53,7 +53,9 @@ func main() { | |||
pod := hookFactory.NewHookPod(manifest.ID()) | |||
|
|||
// for now use noop verifier in this CLI | |||
err = pod.Install(manifest, auth.NopVerifier(), artifact.NewRegistry(*registryURI, uri.DefaultFetcher, osversion.DefaultDetector)) | |||
// TODO: should this have config store/labeler to merge hook configs? |
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.
a TODO I was concerned about, but less so
bin/p2-launch/main.go
Outdated
@@ -88,7 +88,8 @@ func main() { | |||
podFactory := pods.NewFactory(*podRoot, types.NodeName(*nodeName), fetcher, "") | |||
pod := podFactory.NewLegacyPod(manifest.ID()) | |||
|
|||
err = pod.Install(manifest, auth.NopVerifier(), artifact.NewRegistry(*artifactRegistryURL, fetcher, osversion.DefaultDetector)) | |||
// TODO: config store/labeler? Otherwise, p2-launch ignores the config store, which doesn't seem ideal. |
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.
a TODO I was concerned about, more so
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.
hmmmmmmmmmmmmmmmmmmmmmm yeah we're really hampering p2-launch
here because now the manifest isn't all the info you need to run a pod
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.
Passing nil arguments to a function we control is a smell. Can you write a function with a more descriptive name and a more correct arity?
I need #896 for this. I should probably just rebase off that branch... |
temporarily cherry picking it in to make sure the build would pass with it, I didn't rebase directly because #896 is itself out of date, but maybe it's not missing any commit I need, so maybe not necessary |
Hmm. |
3a8c280
to
56131d4
Compare
This will allow labeling config values with information that can be used to identify the pod cluster that the config value corresponds to.
Golang's JSON marshal doesn't support arbitrary types as keys, probably because JSON itself does not support this.
Will be useful when we are merging configs
The type of map used by pkg/manifest is map[interface{}]interface{} so it behooves us to match that. The map[string]interface{} change was to support JSON marshalling of config stanzas, which seems less important now than it once did.
This will make it easier to initialize a config store
This will allow callers to switch on the special error type the labels library returns when there are no labels for a type (NoLabelsFound)
We intend to backfill config in which case it will become an error
--- FAIL: TestDeleteConfigTxn (0.44s) |
--- FAIL: TestDeleteConfig (0.00s) |
2017/07/26 01:54:55 Bootstrapping complete |
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.
Hey there. It looks like this is pretty old and we haven't had a need to roll it out widely. As a result I'd like to close it to get it out of the queue.
"encoding/json" | ||
"path" | ||
|
||
"github.com/square/p2/pkg/util" // TODO this is wrong |
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 no longer remember why this is wrong
No need to review yet, just letting Travis build this because I'm too lazy to do it locally nor make my own fork do Travis.
Advice requested on the question "When do the pod labels get set? Will they be available when the preparer is installing the pod?"