This repository was archived by the owner on Jun 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ type PublishPlan struct {
114
114
115
115
type PublishOutput struct {
116
116
Duration time.Duration
117
+ Registry * ImageRegistry
117
118
publishedImages map [string ]string
118
119
}
119
120
@@ -129,6 +130,10 @@ func (p *PublishImagePlan) remoteImageNameWithLatestTag() string {
129
130
return fmt .Sprintf ("%s:%s" , p .remoteImageName , "latest" )
130
131
}
131
132
133
+ func (ir * ImageRegistry ) GetHost () registryHost {
134
+ return ir .host
135
+ }
136
+
132
137
func (o * PublishOutput ) DidPublish () bool {
133
138
if o == nil {
134
139
return false
@@ -472,7 +477,10 @@ func (p *Pad) publishDockerImage(
472
477
published [image .localImage .String ()] = image .remoteImageNameWithTag ()
473
478
}
474
479
475
- return & PublishOutput {publishedImages : published }, nil
480
+ return & PublishOutput {
481
+ publishedImages : published ,
482
+ Registry : plan .registry ,
483
+ }, nil
476
484
}
477
485
478
486
func makePublishPlan (
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ func makeDeployOptions(
63
63
helm .NewImageProvider (
64
64
buildOutput .Image .String (),
65
65
publishOutput .PublishedImages (),
66
+ string (publishOutput .Registry .GetHost ()),
66
67
),
67
68
jetCfg ,
68
69
cluster ,
@@ -83,7 +84,6 @@ func makeDeployOptions(
83
84
if err := hvc .Compute (ctx ); err != nil {
84
85
return nil , errors .Wrap (err , "failed to compute helm values" )
85
86
}
86
-
87
87
appValues , err := cmdOpts .Hooks ().PostAppChartValuesCompute (
88
88
ctx ,
89
89
cmdOpts ,
@@ -92,7 +92,6 @@ func makeDeployOptions(
92
92
if err != nil {
93
93
return nil , err
94
94
}
95
-
96
95
runtimeValues , err := cmdOpts .Hooks ().PostRuntimeChartValuesCompute (
97
96
ctx ,
98
97
cmdOpts ,
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ func (hvc *ValueComputer) RuntimeValues() map[string]any {
63
63
return hvc .runtimeValues
64
64
}
65
65
66
+ func (hvc * ValueComputer ) ImageProvider () * ImageProvider {
67
+ return hvc .imageProvider
68
+ }
69
+
66
70
// Compute converts command options to helm values.
67
71
func (hvc * ValueComputer ) Compute (ctx context.Context ) error {
68
72
hvc .appValues = map [string ]any {}
Original file line number Diff line number Diff line change @@ -10,20 +10,28 @@ type ImageProvider struct {
10
10
// Should include tag if it exists
11
11
defaultLocalImage string
12
12
13
+ imageRegistryHost string
14
+
13
15
// For published images, key is local image, value is published image
14
16
imagePublishMap map [string ]string
15
17
}
16
18
17
19
func NewImageProvider (
18
20
defaultLocalImage string ,
19
21
imagePublishMap map [string ]string ,
22
+ imageRegistryHost string ,
20
23
) * ImageProvider {
21
24
return & ImageProvider {
22
25
defaultLocalImage : defaultLocalImage ,
23
26
imagePublishMap : imagePublishMap ,
27
+ imageRegistryHost : imageRegistryHost ,
24
28
}
25
29
}
26
30
31
+ func (i * ImageProvider ) GetRegistryHost () string {
32
+ return i .imageRegistryHost
33
+ }
34
+
27
35
func (i * ImageProvider ) get (c provider.Cluster , img string ) string {
28
36
if i == nil {
29
37
return img
You can’t perform that action at this time.
0 commit comments