summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/config_linux_cgo.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/specgen/generate/config_linux_cgo.go')
-rw-r--r--pkg/specgen/generate/config_linux_cgo.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/specgen/generate/config_linux_cgo.go b/pkg/specgen/generate/config_linux_cgo.go
index b06ef5c9a..5d629a6e6 100644
--- a/pkg/specgen/generate/config_linux_cgo.go
+++ b/pkg/specgen/generate/config_linux_cgo.go
@@ -24,6 +24,9 @@ func getSeccompConfig(s *specgen.SpecGenerator, configSpec *spec.Spec, img *imag
}
if scp == seccomp.PolicyImage {
+ if img == nil {
+ return nil, errors.New("cannot read seccomp profile without a valid image")
+ }
labels, err := img.Labels(context.Background())
if err != nil {
return nil, err