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

Long agent name #928

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public KubernetesAgentInstaller(TemporaryDirectory temporaryDirectory, string he
this.kubeConfigPath = kubeConfigPath;
this.logger = logger;

AgentName = Guid.NewGuid().ToString("N");
AgentName = Guid.NewGuid().ToString("N") + "f823g789fwgh39dfsadfarh239r8923fh8923fh389whrf8923hf89239h8";
}

public string AgentName { get; }
Expand Down Expand Up @@ -150,8 +150,9 @@ string BuildAgentInstallArguments(string valuesFilePath, string? tentacleImageAn

async Task<string> GetAgentThumbprint()
{
string? thumbprint = null;
var maxAttempts = 30;

string? thumbprint = null;
var attempt = 0;
do
{
Expand Down Expand Up @@ -187,16 +188,16 @@ async Task<string> GetAgentThumbprint()
return thumbprint;
}

if (attempt == 5)
if (attempt == maxAttempts)
{
break;
}

attempt++;
await Task.Delay(500);
await Task.Delay(TimeSpan.FromSeconds(2));
} while (thumbprint is null);

throw new InvalidOperationException("Failed to load the generated thumbprint after 5 attempts");
throw new InvalidOperationException($"Failed to load the generated thumbprint after {maxAttempts} attempts");
}

string NamespaceFlag => $"--namespace \"{Namespace}\"";
Expand Down