Skip to content

Commit e30cd7d

Browse files
committed
ci: retrigger GPU tests
1 parent a5343e6 commit e30cd7d

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

pkg/validator/job/deployer.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,20 @@ func (d *Deployer) buildEnvApply() []*applycorev1.EnvVarApplyConfiguration {
209209
return env
210210
}
211211

212-
// imagePullPolicy returns Always when the image uses :latest tag (dev builds),
213-
// PullIfNotPresent otherwise. This ensures dev builds always pull fresh images
214-
// and avoids exec format errors from stale cached images on cluster nodes.
212+
// imagePullPolicy returns the appropriate pull policy based on the image reference.
213+
// Local images (ko.local, kind.local, localhost) always use IfNotPresent since they
214+
// are side-loaded into the cluster and cannot be pulled from a registry.
215+
// Remote images with :latest tag use Always to avoid stale cached images.
215216
func (d *Deployer) imagePullPolicy() corev1.PullPolicy {
216-
if strings.HasSuffix(d.entry.Image, ":latest") {
217+
img := d.entry.Image
218+
// Local images side-loaded into kind/nvkind — never pull from registry.
219+
if strings.HasPrefix(img, "ko.local") ||
220+
strings.HasPrefix(img, "kind.local") ||
221+
strings.HasPrefix(img, "localhost/") ||
222+
strings.HasPrefix(img, "localhost:") {
223+
return corev1.PullIfNotPresent
224+
}
225+
if strings.HasSuffix(img, ":latest") {
217226
return corev1.PullAlways
218227
}
219228
return corev1.PullIfNotPresent

pkg/validator/job/deployer_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,11 @@ func TestImagePullPolicy(t *testing.T) {
524524
}{
525525
{"latest tag uses Always", "ghcr.io/nvidia/aicr-validators/conformance:latest", corev1.PullAlways},
526526
{"versioned tag uses IfNotPresent", "ghcr.io/nvidia/aicr-validators/conformance:v1.0.0", corev1.PullIfNotPresent},
527+
{"ko.local uses IfNotPresent", "ko.local:smoke-test", corev1.PullIfNotPresent},
528+
{"ko.local latest uses IfNotPresent", "ko.local:latest", corev1.PullIfNotPresent},
529+
{"kind.local uses IfNotPresent", "kind.local/validator:latest", corev1.PullIfNotPresent},
530+
{"localhost registry uses IfNotPresent", "localhost:5000/validator:latest", corev1.PullIfNotPresent},
531+
{"localhost path uses IfNotPresent", "localhost/validator:latest", corev1.PullIfNotPresent},
527532
}
528533
for _, tt := range tests {
529534
t.Run(tt.name, func(t *testing.T) {

0 commit comments

Comments
 (0)