Skip to content

Commit 339f0cf

Browse files
openshift-merge-bot[bot]wangke19
authored andcommitted
Merge pull request #483 from ricardomaraschini/check-if-image-is-not-nil-before-using
OCPBUGS-45861: validate image property isn't nil before using
2 parents db4989b + c3ac45e commit 339f0cf

File tree

5 files changed

+50
-5
lines changed

5 files changed

+50
-5
lines changed

.ci-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
build_root_image:
22
name: release
33
namespace: openshift
4-
tag: rhel-9-release-golang-1.22-openshift-4.18
4+
tag: rhel-9-release-golang-1.23-openshift-4.19

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/openshift/openshift-apiserver
22

3-
go 1.22.0
3+
go 1.23.0
44

5-
toolchain go1.22.1
5+
toolchain go1.23.4
66

77
require (
88
github.com/MakeNowJust/heredoc v1.0.0

images/Dockerfile.rhel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.18 AS builder
1+
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.23-openshift-4.19 AS builder
22
WORKDIR /go/src/github.com/openshift/openshift-apiserver
33
COPY . .
44
RUN make build --warn-undefined-variables
55

6-
FROM registry.ci.openshift.org/ocp/4.18:base-rhel9
6+
FROM registry.ci.openshift.org/ocp/4.19:base-rhel9
77
COPY --from=builder /go/src/github.com/openshift/openshift-apiserver/openshift-apiserver /usr/bin/
88
ENTRYPOINT ["/usr/bin/openshift-apiserver"]
99
LABEL io.k8s.display-name="OpenShift API Server Command" \

pkg/image/apis/image/v1/zz_generated.conversion.go

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/image/apiserver/importer/importer.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,22 @@ func (imp *ImageStreamImporter) importImages(ctx context.Context, isi *imageapi.
295295
cache[j] = digest.Image
296296
}
297297
for _, index := range ids[j] {
298+
// we have seen the below state in our internal CI clusters. we think
299+
// it's caused by outages in the upstream registry, but we're not sure
300+
// exactly how we end up in this situation where neither error or image
301+
// are set. to protect against that we throw a generic error when it
302+
// happens.
303+
// See https://issues.redhat.com/browse/OCPBUGS-35036 for details.
304+
if digest.Image == nil && digest.Err == nil {
305+
errMsg := fmt.Sprintf(
306+
"unknown error while importing digest %q from repository %q with import mode %q, please try again.",
307+
digest.Name,
308+
repo.Name,
309+
digest.ImportMode,
310+
)
311+
digest.Err = errors.New(errMsg)
312+
klog.Infof("importImages: both digest image and error are nil! repo=%+v digest=%+v", repo, digest)
313+
}
298314
if digest.Err != nil {
299315
setImageImportStatus(isi, index, "", digest.Err)
300316
continue

0 commit comments

Comments
 (0)