Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions pkg/jobconfig/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func (i *Info) ConfigMapName() string {
if i.Type == "periodics" {
return fmt.Sprintf("job-config-%s", promotion.FlavorForBranch(""))
}
// job-config shards for master are already too big, shard them further by type
if i.Branch == "master" {
return fmt.Sprintf("job-config-%s-%s", promotion.FlavorForBranch(i.Branch), i.Type)
}
return fmt.Sprintf("job-config-%s", promotion.FlavorForBranch(i.Branch))
}

Expand Down
14 changes: 11 additions & 3 deletions pkg/jobconfig/files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,12 +611,20 @@ func TestInfo_ConfigMapName(t *testing.T) {
testCases := []struct {
name string
branch string
jobType string
expected string
}{
{
name: "master branch goes to master configmap",
name: "master branch goes to master configmap further sharded by type: presubmits",
branch: "master",
expected: "job-config-master",
jobType: "presubmits",
expected: "job-config-master-presubmits",
},
{
name: "master branch goes to master configmap further sharded by type: postsubmits",
branch: "master",
jobType: "postsubmits",
expected: "job-config-master-postsubmits",
},
{
name: "enterprise 3.6 branch goes to 3.x configmap",
Expand Down Expand Up @@ -681,7 +689,7 @@ func TestInfo_ConfigMapName(t *testing.T) {
}
for _, testCase := range testCases {
t.Run(testCase.expected, func(t *testing.T) {
info := Info{Branch: testCase.branch}
info := Info{Branch: testCase.branch, Type: testCase.jobType}
if actual, expected := info.ConfigMapName(), testCase.expected; !reflect.DeepEqual(actual, expected) {
t.Errorf("%s: didn't get correct basename: %v", testCase.name, diff.ObjectReflectDiff(actual, expected))
}
Expand Down