Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
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
10 changes: 9 additions & 1 deletion launchpad/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ type PublishPlan struct {

type PublishOutput struct {
Duration time.Duration
RegistryHost registryHost
publishedImages map[string]string
}

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

func (ir *ImageRegistry) GetHost() registryHost {
return ir.host
}

func (o *PublishOutput) DidPublish() bool {
if o == nil {
return false
Expand Down Expand Up @@ -472,7 +477,10 @@ func (p *Pad) publishDockerImage(
published[image.localImage.String()] = image.remoteImageNameWithTag()
}

return &PublishOutput{publishedImages: published}, nil
return &PublishOutput{
publishedImages: published,
RegistryHost: plan.registry.GetHost(),
}, nil
}

func makePublishPlan(
Expand Down
3 changes: 1 addition & 2 deletions padcli/command/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func makeDeployOptions(
helm.NewImageProvider(
buildOutput.Image.String(),
publishOutput.PublishedImages(),
string(publishOutput.RegistryHost),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be needed. The published images have enough information to determine the host. (they are the hostname on the published image URL)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments in axiom

),
jetCfg,
cluster,
Expand All @@ -83,7 +84,6 @@ func makeDeployOptions(
if err := hvc.Compute(ctx); err != nil {
return nil, errors.Wrap(err, "failed to compute helm values")
}

appValues, err := cmdOpts.Hooks().PostAppChartValuesCompute(
ctx,
cmdOpts,
Expand All @@ -92,7 +92,6 @@ func makeDeployOptions(
if err != nil {
return nil, err
}

runtimeValues, err := cmdOpts.Hooks().PostRuntimeChartValuesCompute(
ctx,
cmdOpts,
Expand Down
4 changes: 4 additions & 0 deletions padcli/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func (hvc *ValueComputer) RuntimeValues() map[string]any {
return hvc.runtimeValues
}

func (hvc *ValueComputer) ImageProvider() *ImageProvider {
return hvc.imageProvider
}

// Compute converts command options to helm values.
func (hvc *ValueComputer) Compute(ctx context.Context) error {
hvc.appValues = map[string]any{}
Expand Down
8 changes: 8 additions & 0 deletions padcli/helm/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,28 @@ type ImageProvider struct {
// Should include tag if it exists
defaultLocalImage string

imageRegistryHost string

// For published images, key is local image, value is published image
imagePublishMap map[string]string
}

func NewImageProvider(
defaultLocalImage string,
imagePublishMap map[string]string,
imageRegistryHost string,
) *ImageProvider {
return &ImageProvider{
defaultLocalImage: defaultLocalImage,
imagePublishMap: imagePublishMap,
imageRegistryHost: imageRegistryHost,
}
}

func (i *ImageProvider) GetRegistryHost() string {
return i.imageRegistryHost
}

func (i *ImageProvider) get(c provider.Cluster, img string) string {
if i == nil {
return img
Expand Down