Repository navigation
klient: enable autoupdate for connected vms - #8515
Conversation
There was a problem hiding this comment.
i would probably set this to true instead of passing -autoupdate everywhere, with this way we would also set this config for old running klients. if one do not want autoupdate they could set it to false
There was a problem hiding this comment.
If I set it to true here, then I need to pass -no-autoupdate (or -autoupdate=false) everywhere in klientctl/install-kd.sh instead.
There was a problem hiding this comment.
Either kd or non-kd klients are going to be setting the flag everywhere. Sort of a toss up which is worse, having to pass -autoupdate or -no-autoupdate in a lot of places.
From my perspective, klient has always auto updated, kd is the weird kid on the block for not auto updating, imo stick with the klient standard/previous practice as the default.
There was a problem hiding this comment.
@leeola I choose to update klient with -autoupdate as it's not currently possible to execute "migration code" for the kd upon update - so if I add -no-autoupdate to klientctl/install.go it won't be executed on update and thus suddently all existing kd+klient installations will have autoupdate enabled till the next update.
Ok for having temporary autoupdate for kd in this case as described above?
There was a problem hiding this comment.
Ah good call, 👍 with above. I'm opening a issue for the kd update thing now, it's clear we need that feature. Related issue: #8517
There was a problem hiding this comment.
@leeola What about if instead of -autoupdate/-no-autoupdate I just make a check that kd binary exists in $PATH - if it does, I disable autoupdate? Probably less invasive change.
There was a problem hiding this comment.
It seems hacky, but it also feels like a temporary implementation of what we have talked about, making autoupdate work for kd as long as no mounts exist. Roughly the same feature, just with slightly different behaviors, but the same UX.
It's a bit scary, but i think 👍
Enables automatic updates when no kd binary is present on the system. If the binary is present, but we want to have automatic updates, they can be enabled with -autoupdate flag.
There was a problem hiding this comment.
Might want to add a note to the version command that if the prefix is changed (for whatever reasons), it would interfere with this. Would be quite the unexpected result
There was a problem hiding this comment.
The kd version string is generated by codegangsta/cli (the built-in -version flag).
There was a problem hiding this comment.
👍
Lee
On Thu, Jul 21, 2016 at 11:23 AM, Rafal Jeczalik notifications@github.com
wrote:
In go/src/koding/klient/app/klient.go
#8515 (comment):} k.kite.Run()}
+var kdPrefix = []byte("kd version")
+
+func (k *Klient) autoupdateEnabled() bool {
- if k.config.Autoupdate {
return true- }
- p, err := exec.Command("kd", "-version").Output()
- if err != nil {
return true- }
- return !bytes.HasPrefix(bytes.TrimSpace(p), kdPrefix)
The kd version string is generated by codegangsta/cli (the built-in
-version flag).—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/koding/koding/pull/8515/files/e36a0cda3f78ac87ca979b77d1e2fc50758a5621#r71759718,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAC5xKV4CQFBWOOwQ6h-npodn4HepUzAks5qX7k_gaJpZM4JRp-J
.

related for autoupdate: #8514
related for kontrolUrl defensive overwrite: https://app.intercom.io/a/apps/zm3w0570/inbox/rafal@koding.com/conversations/5425539512