Skip to content

cmd/k8s-operator: set different app type for operator with proxy enabled/disabled - #10081

Merged
irbekrm merged 1 commit into
mainfrom
irbekrm/hostinfoapp
Nov 2, 2023
Merged

irbekrm merged 1 commit into
mainfrom
irbekrm/hostinfoapp

Conversation

@irbekrm

@irbekrm irbekrm commented Nov 2, 2023 •

Copy link
Copy Markdown
Contributor

This PR fixes a bug where, although we intend to set different app type for operator with proxy enabled vs disabled, it was in practice always set to 'k8s-operator' because that code path got hit first and early.

I have tested this fix by deploying operator from this PR with the proxy enabled and checked that 'App' gets set to 'k8s-operator-proxy'. This can be observed in the operator logs if the logging level is set to 'debug':

k logs deploy/operator -n tailscale
...
{"level":"debug","ts":"2023-11-02T13:13:44Z","logger":"tailscaled","msg":"control: [v1] HostInfo: {\"IPNVersion\":\"1.53.51-t50aeac003\",\"BackendLogID\":\"7aa1bca5af2cdc83c59b51a77c57f8b871dc188455862c4d36797a11a4d0edf3\",\"OS\":\"linux\",\"OSVersion\":\"5.15.120+\",\"Container\":false,\"Env\":\"k8s\",\"Distro\":\"alpine\",\"DistroVersion\":\"3.16.7\",\"App\":\"k8s-operator-proxy\",\"Desktop\":false,\"Package\":\"tsnet\",\"Hostname\":\"tailscale-operator\",\"Machine\":\"x86_64\",\"GoArch\":\"amd64\",\"GoArchVar\":\"v1\",\"GoVersion\":\"go1.21.3\",\"Services\":[{\"Proto\":\"peerapi4\",\"Port\":47531},{\"Proto\":\"peerapi6\",\"Port\":47531},{\"Proto\":\"peerapi-dns-proxy\",\"Port\":1}],\"Cloud\":\"gcp\",\"Userspace\":true,\"UserspaceRouter\":true}"}
...

Updates #9222

plain k8s-operator should have hostinfo.App set to 'k8s-operator', operator with proxy should have it set to 'k8s-operator-proxy'. In proxy mode, we were setting the type after it had already been set to 'k8s-operator'

Signed-off-by: Irbe Krumina <[email protected]>
@irbekrm
irbekrm requested a review from maisem November 2, 2023 13:19
@irbekrm
irbekrm merged commit af49bca into main Nov 2, 2023
@irbekrm
irbekrm deleted the irbekrm/hostinfoapp branch November 2, 2023 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants