weaveworks / launcher

Weave Cloud Launcher
Apache License 2.0
10 stars 13 forks source link

agent: Correctly encode the new GET parameters #259

Closed dlespiau closed 6 years ago

dlespiau commented 6 years ago

I thought the library would do it for me, but no. The URL struct only has the WawQuery field and String() compute the URL string with that field.

To add a GET parameter we need to encode the RawQuery manually.

This time, I unit-tested it, that's the price to pay when not getting right the first time!

dlespiau commented 6 years ago

tested it and the arguments are properly propagated up to launch-generator now:

build/agent -wc.token=9a76e3h4u9o9otswqqajrxxao11x6i1q -wc.hostname=frontend.dev.weave.works -agent.cri-endpoint=/foo/bar
INFO[0000] kubernetes: targeting api server https://192.168.99.100:8443 
INFO[0000] Checking for any previous installation...    
INFO[0001] Updating self from https://get.weave.works/k8s/agent.yaml?cri-endpoint=%2Ffoo%2Fbar&cri-endpoint=%2Ffoo%2Fbar&instanceID=winter-fire-60 
INFO[0001] Revision before self-update: 3               
INFO[0001] Revision after self-update: 3                
INFO[0001] Updating WC from https://frontend.dev.weave.works/k8s.yaml?k8s-version=v1.10.0&t=9a76e3h4u9o9otswqqajrxxao11x6i1q&omit-support-info=true&cri-endpoint=/foo/bar

However the installation still fails because we install scope 1.9.1 which doesn't know anything about the CRI probe:

$ kubectl -n weave logs weave-scope-agent-f2qbq
flag provided but not defined: -probe.cri

Next step: release a CRI scope!