diff --git a/src/operator/api/v2alpha1/approved_clientintents_types.go b/src/operator/api/v2alpha1/approved_clientintents_types.go index 69da63399..a09002f10 100644 --- a/src/operator/api/v2alpha1/approved_clientintents_types.go +++ b/src/operator/api/v2alpha1/approved_clientintents_types.go @@ -206,13 +206,13 @@ func approvedClientIntentsStatusToCloudFormat(approvedClientIntents ApprovedClie status.IstioStatus.ServiceAccountName = toPtrOrNil(serviceAccountName) isSharedValue, ok := approvedClientIntents.Annotations[OtterizeSharedServiceAccountAnnotation] - if !ok { - return nil, false, errors.Errorf("missing annotation shared service account for client intents %s", approvedClientIntents.Name) - } - - isShared, err := strconv.ParseBool(isSharedValue) - if err != nil { - return nil, false, errors.Errorf("failed to parse shared service account annotation for client intents %s", approvedClientIntents.Name) + isShared := false + if ok { + parsedIsShared, err := strconv.ParseBool(isSharedValue) + if err != nil { + return nil, false, errors.Errorf("failed to parse shared service account annotation for client intents %s", approvedClientIntents.Name) + } + isShared = parsedIsShared } status.IstioStatus.IsServiceAccountShared = lo.ToPtr(isShared) diff --git a/src/operator/api/v2beta1/approved_clientintents_types.go b/src/operator/api/v2beta1/approved_clientintents_types.go index e5bcf573f..08d0201ee 100644 --- a/src/operator/api/v2beta1/approved_clientintents_types.go +++ b/src/operator/api/v2beta1/approved_clientintents_types.go @@ -207,13 +207,13 @@ func approvedClientIntentsStatusToCloudFormat(approvedClientIntents ApprovedClie status.IstioStatus.ServiceAccountName = toPtrOrNil(serviceAccountName) isSharedValue, ok := approvedClientIntents.Annotations[OtterizeSharedServiceAccountAnnotation] - if !ok { - return nil, false, errors.Errorf("missing annotation shared service account for client intents %s", approvedClientIntents.Name) - } - - isShared, err := strconv.ParseBool(isSharedValue) - if err != nil { - return nil, false, errors.Errorf("failed to parse shared service account annotation for client intents %s", approvedClientIntents.Name) + isShared := false + if ok { + parsedIsShared, err := strconv.ParseBool(isSharedValue) + if err != nil { + return nil, false, errors.Errorf("failed to parse shared service account annotation for client intents %s", approvedClientIntents.Name) + } + isShared = parsedIsShared } status.IstioStatus.IsServiceAccountShared = lo.ToPtr(isShared)