Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Implement version gate in fleetctl #428

Merged
merged 1 commit into from
May 16, 2014
Merged

Conversation

jonboulle
Copy link
Contributor

No description provided.

@jonboulle jonboulle self-assigned this May 9, 2014
@jonboulle
Copy link
Contributor Author

Added dumb strawman to start a conversation on this.

@@ -99,6 +98,7 @@ func newMachineFromConfig(cfg config.Config) (*machine.Machine, error) {
func newAgentFromConfig(mach *machine.Machine, cfg config.Config, mgr *systemd.SystemdManager) (*agent.Agent, error) {
regClient := newEtcdClientFromConfig(cfg)
reg := registry.New(regClient, cfg.EtcdKeyPrefix)
reg.SetLatestVersion(version.SemVersion)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's overkill to do this right now. The version information is already published in each individual MachineState object. Could we not infer the latest version from that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Neat, somehow I missed that.

@jonboulle
Copy link
Contributor Author

Updated to address feedback. Any other high-level comments? thoughts? concerns?

func (r *EtcdRegistry) GetLatestVersion() (*semver.Version, error) {
machs, err := r.GetActiveMachines()
if err != nil {
if err.(*etcd.EtcdError).ErrorCode == etcdErr.EcodeKeyNotFound {
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll need to update this to use the new isKeyNotFound helper here or in the other PR depending on which lands first.

@bcwaldon
Copy link
Contributor

Looking good. Needs a rebase.

@jonboulle
Copy link
Contributor Author

Rebased.

I'm still not necessarily totally sold on this. Is it too scary? Should we link to a github issue (e.g. having a proper API), or talk about future compatibility?

@bcwaldon
Copy link
Contributor

@jonboulle We absolutely need something like this. What specifically are you concerned about?

@jonboulle
Copy link
Contributor Author

@bcwaldon I suppose the implication that we're incapable of providing any compatibility (for example, this doesn't discriminate between patch/minor versions). But since that seems to be the reality for now perhaps we should roll forward with this + revisit asap?

WARNING: fleetctl (%s) is older than the latest registered
version of fleet in the Registry (%s). You are strongly
recommended to upgrade fleetctl to prevent incompatibility issues.
####################################################################
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't mention anything about how fleet determines what the current version is. Maybe link to the releases page?

####################################################################
WARNING: fleetctl (%s) does not match the version running on the
cluster (%s). You are strongly recommended to upgrade fleetctl to
prevent incompatibility issues.
Download from https://github.com/coreos/fleet/releases
####################################################################

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bcwaldon thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

@robszumski What's your thinking behind that suggestion?

Copy link
Member

Choose a reason for hiding this comment

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

it references the registry which most users have no idea a) that it exists or b) what it does.

Copy link
Contributor

Choose a reason for hiding this comment

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

@robszumski What if we just replace "Registry" with "cluster"?

Copy link
Member

Choose a reason for hiding this comment

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

I don't love latest registered version because it exposes a bit of how the system works to the user, when they don't care how fleet determines the holistic version of the cluster. But, it's not the end of the world.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jonboulle s/Registry/cluster/

@bcwaldon
Copy link
Contributor

@robszumski Until we have a single versioned entrypoint, they have to care how it works to a degree.

@jonboulle
Copy link
Contributor Author

@bcwaldon do you want this merged, then?

This adds a basic version check/gate to fleetctl wherein it will print a
scary warning to the user if the version of fleetctl appears to be older
than the version of fleet running in the cluster. The version of fleet
in the cluster is inferred from the latest version found in all
machinestates registered in the registry.
@jonboulle
Copy link
Contributor Author

updated

@bcwaldon
Copy link
Contributor

lgtm when tests pass

@jonboulle
Copy link
Contributor Author

ok here we gooooo

jonboulle added a commit that referenced this pull request May 16, 2014
Implement version gate in fleetctl
@jonboulle jonboulle merged commit 714864a into coreos:master May 16, 2014
@jonboulle jonboulle deleted the 428 branch May 16, 2014 18:52
@bcwaldon bcwaldon added this to the v0.4.0 milestone May 16, 2014
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.

4 participants