relax label value constraints

This commit is contained in:
Jonathan Shook 2025-01-16 14:07:52 -06:00
parent fbd2949b51
commit db39d8149f
2 changed files with 10 additions and 4 deletions

View File

@ -64,7 +64,9 @@ public class NBBaseComponent extends NBBaseComponentMetrics implements NBCompone
labelsAdvisor.add(Conditions.NoSpacesWarning);
labelsAdvisor.validateAll(componentSpecificLabelsOnly.asMap().keySet());
labelsAdvisor.validateAll(componentSpecificLabelsOnly.asMap().values());
// This change diverged too much to cherry-pick directly
// labelsAdvisor.validateAll(componentSpecificLabelsOnly.asMap().values());
NBAdvisorResults advisorResults = getAdvisorResults();
advisorResults.evaluate();

View File

@ -86,13 +86,17 @@ class ActivityExecutorTest {
synchronized void testAdvisorError() {
try {
ActivityDef activityDef = ActivityDef.parseActivityDef("driver=diag;alias=test-delayed-start;cycles=1000;initdelay=2000;");
ActivityDef activityDef = ActivityDef.parseActivityDef("driver=diag;"
+ "alias=test-delayed-start;"
+ "cycles=1000;initdelay=2000;"
+ "labels=invalid-name:valid"
+ "-value");
new ActivityTypeLoader().load(activityDef, TestComponent.INSTANCE);
Activity activity = new DelayedInitActivity(activityDef);
fail("Expected an Advisor exception");
} catch (NBAdvisorException e) {
} catch (RuntimeException e) {
assertThat(e.toString().contains("error"));
assertThat(e.getExitCode() == 2);
// assertThat(e.getExitCode() == 2);
}
}