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

Limit calculated agent service name to 80 characters #2266

Merged
merged 1 commit into from May 22, 2019

Conversation

juliobbv
Copy link
Contributor

No description provided.

@juliobbv juliobbv changed the title Limit agent service name to 80 characters Limit calculated agent service name to 80 characters May 21, 2019
@@ -53,6 +53,18 @@ public void CalculateServiceName(AgentSettings settings, string serviceNamePatte
}

serviceName = StringUtil.Format(serviceNamePattern, accountName, settings.PoolName, settings.AgentName);

if (serviceName.Length > 80)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i assume 80 won't break, only 81+ will break.

Copy link
Contributor Author

@juliobbv juliobbv May 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. I tried out with a calculated name with exactly 80 characters, and it works.

@TingluoHuang TingluoHuang merged commit d723074 into master May 22, 2019
@TingluoHuang TingluoHuang deleted the users/juliobv/trimTooLongServiceName branch May 22, 2019 14:10
string poolNameSubstring = StringUtil.SubstringPrefix(settings.PoolName, 30);
string agentNameSubstring = StringUtil.SubstringPrefix(settings.AgentName, 20);

serviceName = StringUtil.Format(serviceNamePattern, accountNameSubstring, poolNameSubstring, agentNameSubstring);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the serviceNamePattern contains any chars that will contribute to the 80 chars?

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