-
Notifications
You must be signed in to change notification settings - Fork 442
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
Don't check if trial's metadata is in spec.parameters #1848
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8b6fc58
do not check trial parameter in experiment parameters if it's trial's…
alexeygorobets 6d4ce0f
revert unnecessary change
alexeygorobets 99ce98f
Merge pull request #2 from mesosphere/fix-trial-metadata-substitution…
alexeygorobets 07725af
add handle Labels[label] and Annotations[annotation]
alexeygorobets 72db2a5
fix test description
alexeygorobets 6713b34
Merge pull request #3 from mesosphere/dont-check-trial-metadata-in-sp…
alexeygorobets File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -415,6 +415,7 @@ spec: | |
validTemplate4 := p.EXPECT().GetTrialTemplate(gomock.Any()).Return(validJobStr, nil) | ||
validTemplate5 := p.EXPECT().GetTrialTemplate(gomock.Any()).Return(validJobStr, nil) | ||
validTemplate6 := p.EXPECT().GetTrialTemplate(gomock.Any()).Return(validJobStr, nil) | ||
validTemplate7 := p.EXPECT().GetTrialTemplate(gomock.Any()).Return(validJobStr, nil) | ||
|
||
missedParameterTemplate := p.EXPECT().GetTrialTemplate(gomock.Any()).Return(missedParameterJobStr, nil) | ||
oddParameterTemplate := p.EXPECT().GetTrialTemplate(gomock.Any()).Return(oddParameterJobStr, nil) | ||
|
@@ -431,6 +432,7 @@ spec: | |
validTemplate4, | ||
validTemplate5, | ||
validTemplate6, | ||
validTemplate7, | ||
missedParameterTemplate, | ||
oddParameterTemplate, | ||
invalidParameterTemplate, | ||
|
@@ -570,6 +572,16 @@ spec: | |
Err: false, | ||
testDescription: "Trial template contains Trial parameters when spec.parameters is empty", | ||
}, | ||
// Trial template contains Trial metadata parameter substitution | ||
{ | ||
Instance: func() *experimentsv1beta1.Experiment { | ||
i := newFakeInstance() | ||
i.Spec.TrialTemplate.TrialParameters[1].Reference = "${trialSpec.Name}" | ||
return i | ||
}(), | ||
Err: false, | ||
testDescription: "Trial template contains Trial metadata reference as parameter", | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also add a test case for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hi @tenzen-y , I've added handing of those cases and tests, thanks! |
||
// Trial Template doesn't contain parameter from trialParameters | ||
// missedParameterTemplate case | ||
{ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
contains(consts.TrialTemplateMetaKeys, match[1])
returnsfalse
whenparameter.Reference
isAnotations
orLabels
.WDYT @alexeygorobets ?
katib/examples/v1beta1/trial-template/trial-metadata-substitution.yaml
Lines 43 to 48 in e031b5e