Skip to content

Commit

Permalink
feat: add building affinity (#1824)
Browse files Browse the repository at this point in the history
* feat: add building affinity
  • Loading branch information
DokiDoki1103 authored Jan 8, 2024
1 parent dd6ba6f commit 3464882
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builder/build/code_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ func (s *slugBuild) runBuildJob(re *Request) error {
Operator: corev1.NodeSelectorOpIn,
Values: []string{re.Arch},
},
{
Key: "kubernetes.io/hostname",
Operator: corev1.NodeSelectorOpIn,
Values: []string{os.Getenv("HOST_IP")},
},
},
},
},
Expand Down
5 changes: 5 additions & 0 deletions builder/build/dockerfile_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ func (d *dockerfileBuild) runBuildJob(re *Request, buildImageName string) error
Operator: corev1.NodeSelectorOpIn,
Values: []string{re.Arch},
},
{
Key: "kubernetes.io/hostname",
Operator: corev1.NodeSelectorOpIn,
Values: []string{os.Getenv("HOST_IP")},
},
},
},
},
Expand Down
5 changes: 5 additions & 0 deletions builder/sources/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ func ImageBuild(arch, contextDir, cachePVCName, cacheMode, RbdNamespace, Service
Operator: corev1.NodeSelectorOpIn,
Values: []string{arch},
},
{
Key: "kubernetes.io/hostname",
Operator: corev1.NodeSelectorOpIn,
Values: []string{os.Getenv("HOST_IP")},
},
},
},
},
Expand Down

0 comments on commit 3464882

Please sign in to comment.