Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 2bb3429

Browse files
committed
Enable logged out byoc with custom ecr without v3key injection
1 parent 903fd4f commit 2bb3429

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

launchpad/publish.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ type PublishPlan struct {
114114

115115
type PublishOutput struct {
116116
Duration time.Duration
117+
Registry *ImageRegistry
117118
publishedImages map[string]string
118119
}
119120

@@ -129,6 +130,10 @@ func (p *PublishImagePlan) remoteImageNameWithLatestTag() string {
129130
return fmt.Sprintf("%s:%s", p.remoteImageName, "latest")
130131
}
131132

133+
func (ir *ImageRegistry) GetHost() registryHost {
134+
return ir.host
135+
}
136+
132137
func (o *PublishOutput) DidPublish() bool {
133138
if o == nil {
134139
return false
@@ -472,7 +477,10 @@ func (p *Pad) publishDockerImage(
472477
published[image.localImage.String()] = image.remoteImageNameWithTag()
473478
}
474479

475-
return &PublishOutput{publishedImages: published}, nil
480+
return &PublishOutput{
481+
publishedImages: published,
482+
Registry: plan.registry,
483+
}, nil
476484
}
477485

478486
func makePublishPlan(

padcli/command/deploy.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func makeDeployOptions(
6363
helm.NewImageProvider(
6464
buildOutput.Image.String(),
6565
publishOutput.PublishedImages(),
66+
string(publishOutput.Registry.GetHost()),
6667
),
6768
jetCfg,
6869
cluster,
@@ -83,7 +84,6 @@ func makeDeployOptions(
8384
if err := hvc.Compute(ctx); err != nil {
8485
return nil, errors.Wrap(err, "failed to compute helm values")
8586
}
86-
8787
appValues, err := cmdOpts.Hooks().PostAppChartValuesCompute(
8888
ctx,
8989
cmdOpts,
@@ -92,7 +92,6 @@ func makeDeployOptions(
9292
if err != nil {
9393
return nil, err
9494
}
95-
9695
runtimeValues, err := cmdOpts.Hooks().PostRuntimeChartValuesCompute(
9796
ctx,
9897
cmdOpts,

padcli/helm/helm.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ func (hvc *ValueComputer) RuntimeValues() map[string]any {
6363
return hvc.runtimeValues
6464
}
6565

66+
func (hvc *ValueComputer) ImageProvider() *ImageProvider {
67+
return hvc.imageProvider
68+
}
69+
6670
// Compute converts command options to helm values.
6771
func (hvc *ValueComputer) Compute(ctx context.Context) error {
6872
hvc.appValues = map[string]any{}

padcli/helm/images.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,28 @@ type ImageProvider struct {
1010
// Should include tag if it exists
1111
defaultLocalImage string
1212

13+
imageRegistryHost string
14+
1315
// For published images, key is local image, value is published image
1416
imagePublishMap map[string]string
1517
}
1618

1719
func NewImageProvider(
1820
defaultLocalImage string,
1921
imagePublishMap map[string]string,
22+
imageRegistryHost string,
2023
) *ImageProvider {
2124
return &ImageProvider{
2225
defaultLocalImage: defaultLocalImage,
2326
imagePublishMap: imagePublishMap,
27+
imageRegistryHost: imageRegistryHost,
2428
}
2529
}
2630

31+
func (i *ImageProvider) GetRegistryHost() string {
32+
return i.imageRegistryHost
33+
}
34+
2735
func (i *ImageProvider) get(c provider.Cluster, img string) string {
2836
if i == nil {
2937
return img

0 commit comments

Comments
 (0)