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

Conversation

@dongsupark
Copy link

getClient() has not taken into account the case of !experimentalAPI, before calling registryClient. It has set endPoint to a specific value of URLs, but the new value would not be passed to getRegistryClient(), which simply fetches endPoint again. This was a regression since 848d356 ("fleetctl: convert cli to cobra").

To fix that, introduce getEndpoint() that does GetString("endpoint") as well as the special handling for experimentalAPI. And make getRegistryClient() call getEndpoint().

Fortunately, the experimentalAPI flag is set to true by default, so this special handling path is not actively used after all. Just for correctness.

getClient() has not taken into account the case of !experimentalAPI,
before calling registryClient. It has set endPoint to a specific value
of URLs, but the new value would not be passed to getRegistryClient(),
which simply fetches endPoint again. This was a regression since
848d356 ("fleetctl: convert cli to cobra").

To fix that, introduce getEndpoint() that does GetString("endpoint")
as well as the special handling for experimentalAPI. And make
getRegistryClient() call getEndpoint().

Fortunately, the experimentalAPI flag is set to true by default, so
this special handling path is not actively used after all. Just for
correctness.
@dongsupark
Copy link
Author

I just manually tested it, and I confirm that it fixes the regression.

$ /home/core/fleet/bin/fleetctl --experimental-api=false --endpoint=http://172.18.1.1:54728 list-machines
MACHINE         IP              METADATA
e7da15e6...     172.18.1.1      hostname=smokee7da15e607aa4695be37708374d31ec6

It works fine now.
Creating another functional test for that option is probably overkill, as the option is obsolete after all.
I'll merge it.

@dongsupark dongsupark merged commit c614551 into coreos:master Nov 10, 2016
@dongsupark dongsupark deleted the dongsu/fleetctl-fix-get-endpoint branch November 10, 2016 13:45
dongsupark pushed a commit that referenced this pull request Nov 10, 2016
fleetctl: take experimentalAPI into account in getClient
dongsupark pushed a commit that referenced this pull request Nov 10, 2016
fleetctl: take experimentalAPI into account in getClient
dongsupark pushed a commit that referenced this pull request Nov 10, 2016
fleetctl: take experimentalAPI into account in getClient
@jonboulle
Copy link
Contributor

lgtm!

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.

2 participants