Content-Length: 260841 | pFad | https://github.com/coreos/fleet/pull/1701

AC fleetctl: take experimentalAPI into account in getClient by dongsupark · Pull Request #1701 · coreos/fleet · GitHub
Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

fleetctl: take experimentalAPI into account in getClient #1701

Merged
merged 1 commit into from
Nov 10, 2016

Conversation

dongsupark
Copy link
Contributor

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
Contributor 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








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/coreos/fleet/pull/1701

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy