Skip to content

Commit

Permalink
Merge pull request #13339 from wbrefvem/master
Browse files Browse the repository at this point in the history
Allow an unknown agent to be configured in prow
  • Loading branch information
k8s-ci-robot authored Jul 8, 2019
2 parents 25e0d4a + 4d6beaf commit 152915a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion prow/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,8 @@ func validateAgent(v JobBase, podNamespace string) error {
agent := v.Agent
switch {
case !agents.Has(agent):
return fmt.Errorf("agent must be one of %s (found %q)", strings.Join(agents.List(), ", "), agent)
logrus.Warningf("agent %s is unknown and cannot be validated: use at your own risk", agent)
return nil
case v.Spec != nil && agent != k:
return fmt.Errorf("job specs require agent: %s (found %q)", k, agent)
case agent == k && v.Spec == nil:
Expand Down
3 changes: 2 additions & 1 deletion prow/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,11 @@ func TestValidateAgent(t *testing.T) {
pass bool
}{
{
name: "reject unknown agent",
name: "accept unknown agent",
base: func(j *JobBase) {
j.Agent = "random-agent"
},
pass: true,
},
{
name: "spec requires kubernetes agent",
Expand Down

0 comments on commit 152915a

Please sign in to comment.