klient: enable autoupdate for connected vms by rjeczalik · Pull Request #8515 · koding/koding · GitHub
Skip to content
This repository was archived by the owner on Aug 15, 2022. It is now read-only.

klient: enable autoupdate for connected vms - #8515

Merged
rjeczalik merged 1 commit into
koding:masterfrom
rjeczalik:connected-vm
Jul 26, 2016
Merged

rjeczalik merged 1 commit into
koding:masterfrom
rjeczalik:connected-vm

Conversation

@rjeczalik

@rjeczalik rjeczalik commented Jul 21, 2016 •

Copy link
Copy Markdown
Contributor

related for autoupdate: #8514

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

Comment thread go/src/koding/klient/main.go Outdated

@cihangir cihangir Jul 21, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rjeczalik rjeczalik Jul 21, 2016 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I set it to true here, then I need to pass -no-autoupdate (or -autoupdate=false) everywhere in klientctl/install-kd.sh instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

@leeola leeola Jul 21, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cihangir: wdyt?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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.
@rjeczalik

Copy link
Copy Markdown
Contributor Author

@leeola @cihangir Autoupdates are enabled by default when no kd binary is present on the system. To force autoupdate new -autoupdate flag was added - ptal.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kd version string is generated by codegangsta/cli (the built-in -version flag).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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
.

@rjeczalik
rjeczalik merged commit 6071b26 into koding:master Jul 26, 2016
@rjeczalik
rjeczalik deleted the connected-vm branch July 26, 2016 15:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants