Skip to content

Commit ca74a61

Browse files
author
Dmitriy Kalinin
committed
add optional kbld platform selection option in App/Package specs
Signed-off-by: Dmitriy Kalinin <[email protected]>
1 parent 0c75a49 commit ca74a61

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

config/config/crds.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,9 @@ spec:
560560
items:
561561
type: string
562562
type: array
563+
platform:
564+
description: Resolve to specific platform for image indexes (optional)
565+
type: string
563566
type: object
564567
kustomize:
565568
description: TODO implement kustomize
@@ -1187,6 +1190,9 @@ spec:
11871190
items:
11881191
type: string
11891192
type: array
1193+
platform:
1194+
description: Resolve to specific platform for image indexes (optional)
1195+
type: string
11901196
type: object
11911197
kustomize:
11921198
description: TODO implement kustomize

pkg/apis/kappctrl/v1alpha1/types_template.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ type AppTemplateYtt struct {
4141
// +k8s:openapi-gen=true
4242
type AppTemplateKbld struct {
4343
Paths []string `json:"paths,omitempty" protobuf:"bytes,1,rep,name=paths"`
44+
// Resolve to specific platform for image indexes (optional)
45+
Platform string `json:"platform,omitempty" protobuf:"bytes,2,opt,name=platform"`
4446
}
4547

4648
// +k8s:openapi-gen=true

pkg/apiserver/openapi/zz_generated.openapi.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/template/kbld.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ func (t *Kbld) template(dirPath string, input io.Reader) exec.CmdRunResult {
5656
args = append(args, "--build=false")
5757
}
5858

59+
if len(t.opts.Platform) > 0 {
60+
args = append(args, "--platform="+t.opts.Platform)
61+
}
62+
5963
var stdoutBs, stderrBs bytes.Buffer
6064

6165
cmd := goexec.Command("kbld", args...)

0 commit comments

Comments
 (0)