Handle multiple stack api versions - #899
Conversation
Codecov Report
@@ Coverage Diff @@
## master #899 +/- ##
=========================================
Coverage ? 53.51%
=========================================
Files ? 266
Lines ? 16891
Branches ? 0
=========================================
Hits ? 9040
Misses ? 7248
Partials ? 603 |
vdemeester
left a comment
There was a problem hiding this comment.
- I think we can clean more code. There is quite a few code in the
kubernetesapi package that are dead code (in terms of client's code) — like all theClonefunctions,Discovery, etc.. - We should re-enable linters of
kubernetespackage(s) - I wonder what is bringing
golang-lruand the other new vendoring code 🤔
|
|
||
| fileName := path.Base(config.File) | ||
| content, err := ioutil.ReadFile(config.File) | ||
| if err != nil { |
There was a problem hiding this comment.
- Do we want to group errors ?
- If a file can't read (but not the first one), a configMap will be created in k8s and not used (orphan) — and will probably cause errors next time we do the
docker stack deploy, right ?
I think we should "read all", and if there is no error, "create all". Then, if one of the creation fails, what should we do with the previous one created ?
There was a problem hiding this comment.
Right, I'll fix that.
There was a problem hiding this comment.
I propose to fix this in a follow-up, as we may remove all configmaps and secrets if any error occurs, even while deploying the stack.
|
|
||
| fileName := path.Base(secret.File) | ||
| content, err := ioutil.ReadFile(secret.File) | ||
| if err != nil { |
There was a problem hiding this comment.
I'll fix that too.
| stacks composev1beta2.StackInterface | ||
| } | ||
|
|
||
| func (c *KubeCli) newStackV1Beta2() (stackClient, error) { |
There was a problem hiding this comment.
I would rather have func newStackV1Beta2(config *rest.Config, namespace string) … here (not tying it up with KubeCli)
| stacks composev1beta1.StackInterface | ||
| } | ||
|
|
||
| func (c *KubeCli) newStackV1Beta1() (stackClient, error) { |
There was a problem hiding this comment.
I would rather have func newStackV1Beta1(config *rest.Config, namespace string) … here (not tying it up with KubeCli)
| @@ -1,4 +0,0 @@ | |||
| # Kubernetes client libraries | |||
There was a problem hiding this comment.
Can we keep the README ? 👼
| ) |
- What I did
I integrated the new version of the Stack API (v1beta2). The CLI can now communicates with both versions.
- How I did it
I added a common interface between v1beta1 and v1beta2 stack clients and one common object stack, so the code in the commands remains the same.
- How to verify it
Execute a
docker versioncommand against latestdocker for mac, it should output at the end:- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)