Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix waiting for node on startup #202

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Fix waiting for node on startup #202

merged 1 commit into from
Jun 18, 2024

Conversation

schnatterer
Copy link
Member

@schnatterer schnatterer commented Jun 14, 2024

K8sClient.waitForNode(): The method name claimed something the method did not do - waiting.

Before d2f218c / #174 we had a bash method of the same name that actually waited.
It was called before the Groovy code was called.
So all those years K8sClient.waitForNode() lied about its implementation, but it was no problem.

After the bash implementation was gone, however, our build started to become flaky with these kinds of errors:

TRACE c.c.gitops.utils.CommandExecutor - Executing command: '[kubectl, get, node, -oname]' 
TRACE c.c.gitops.utils.CommandExecutor - Executing command: '[head, -n1]'
TRACE c.c.gitops.utils.CommandExecutor - Executing command: '[kubectl, get, , --template='{{range .status.addresses}}{{ if eq .type "InternalIP" }}{{.address}}{{break}}{{end}}{{end}}']' 11:34:12  error: the server doesn't have a resource type ""

The problem likely being that the k3d cluster wasn't ready, yet and returned empty on get node' without waiting.
The empty returned was then passed to the following function which then failed.
This should no be fixed.

The method name claimed something the method did not do: waiting.

Before d2f218c / #174 we had a bash method of the same name that
actually waited.
It was called before the Groovy code was called.
So all those years K8sClient.waitForNode() lied about its
implementation, but it was no problem.

After the bash implementation was gone, however, our build started to
become flaky with these kinds of errors:

TRACE c.c.gitops.utils.CommandExecutor - Executing command: '[kubectl, get, node, -oname]'
TRACE c.c.gitops.utils.CommandExecutor - Executing command: '[head, -n1]'
TRACE c.c.gitops.utils.CommandExecutor - Executing command: '[kubectl,
get, , --template='{{range .status.addresses}}{{ if eq .type "InternalIP" }}{{.address}}{{break}}{{end}}{{end}}']'
11:34:12  error: the server doesn't have a resource type ""

The problem likely being that the k3d cluster wasn't ready, yet and
returned empty on 'get node' without waiting.
The empty returned was then passed to the following function which then
failed.
This should no be fixed.
@k9ne257 k9ne257 merged commit 7800314 into main Jun 18, 2024
1 check passed
@k9ne257 k9ne257 deleted the feature/wait-for-node branch June 18, 2024 09:58
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.

None yet

2 participants