-
Notifications
You must be signed in to change notification settings - Fork 252
Store context type in metadata to make retrocompatibility with previous contexts easier (potentially switching back and forth) #200
Conversation
context/store/store.go
Outdated
// ContextMetadata is represtentation of the data we put in a context | ||
// metadata | ||
type ContextMetadata struct { | ||
Type string `json:",omitempty"` |
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.
This might provoke the same issue in the future as what we had in the previous CLI. See docker/cli#2572 for the classic CLI fix
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.
Yes, thx !
…us contexts easier (potentially switching back and forth)
97d4bb1
to
e768268
Compare
"encoding/json" | ||
"testing" | ||
|
||
. "github.com/onsi/gomega" |
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.
nit: We should decide as a team if we want to use gomega or testify/{require,assert}. Not at all urgent but a bit jarring to have two different libraries depending on where we are in the code
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.
We also have gotest.tools
, so there's three now?
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.
Yes.. gotest.tools doesn't have all the functionality we need. e.g.: Test suites with setup and teardown functions. It also doesn't have something like testify's require
which continues testing even if a failure is encountered.
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.
LGTM
An e2e test that tests the backward compatibility would be good in a follow up
What I did
Related issue
Needed to ensure backward compatibility if users switch back and forth, to avoid loosing the type info.
Also required to ensure context sync between HyperV and WSL2 environments, allowing to use the /docker/cli code to read/write contexts. cc @simonferquel
(not mandatory) A picture of a cute animal, if possible in relation with what you did
![image](https://camo.githubusercontent.com/146ec113a7a3c40a0d4e35530483ec42879a2f7f1634175df6d6d374a3012add/68747470733a2f2f692e70696e696d672e636f6d2f6f726967696e616c732f39662f35312f33632f39663531336335346334323265346262313332363566643939646530303038372e6a7067)