Skip to content

Commit 693ca68

Browse files
committed
Add some informative logging
1 parent a129942 commit 693ca68

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/deployclient/deployclient.go

+9
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,25 @@ func Prepare(ctx context.Context, cfg *Config) (*pb.DeploymentRequest, error) {
131131

132132
if len(cfg.WorkloadImage) > 0 {
133133
if len(cfg.WorkloadName) == 0 {
134+
log.Infof("Workload image specified, but not workload name; attempting auto-detection...")
135+
134136
workloadNames := make([]string, 0, len(resources))
135137
for i := range resources {
136138
workloadNames = append(workloadNames, detectWorkloadName(resources[i]))
137139
}
140+
138141
if len(workloadNames) == 1 {
139142
cfg.WorkloadName = workloadNames[0]
143+
log.Infof("Detected workload name '%s'", cfg.WorkloadName)
144+
} else if len(workloadNames) > 1 {
145+
log.Warnf("Multiple workload names detected, skipping image resource generation: %v", workloadNames)
146+
} else {
147+
log.Warn("No workload name detected, skipping image resource generation")
140148
}
141149
}
142150

143151
if len(cfg.WorkloadName) > 0 {
152+
log.Infof("Building image resource for workload %q with image %q", cfg.WorkloadName, cfg.WorkloadImage)
144153
resource, err := buildImageResource(cfg.WorkloadName, cfg.WorkloadImage, cfg.Team)
145154
if err != nil {
146155
return nil, ErrorWrap(ExitInternalError, fmt.Errorf("build image resource: %w", err))

0 commit comments

Comments
 (0)