diff --git a/cmd/k8s-operator/operator.go b/cmd/k8s-operator/operator.go index 2d7a8c793..4398c21cc 100644 --- a/cmd/k8s-operator/operator.go +++ b/cmd/k8s-operator/operator.go @@ -567,6 +567,9 @@ func (a *ServiceReconciler) getDeviceInfo(ctx context.Context, svc *corev1.Servi if err != nil { return "", "", err } + if sec == nil { + return "", "", nil + } id = string(sec.Data["device_id"]) if id == "" { return "", "", nil