diff --git a/instrumentor/controllers/instrumentationdevice/common.go b/instrumentor/controllers/instrumentationdevice/common.go index fd85fb4ad..b0d24c51f 100644 --- a/instrumentor/controllers/instrumentationdevice/common.go +++ b/instrumentor/controllers/instrumentationdevice/common.go @@ -3,6 +3,7 @@ package instrumentationdevice import ( "context" "errors" + "github.com/odigos-io/odigos/common" odigosv1 "github.com/odigos-io/odigos/api/odigos/v1alpha1" "github.com/odigos-io/odigos/common/consts" @@ -26,6 +27,7 @@ const ( ApplyInstrumentationDeviceReasonNoRuntimeDetails ApplyInstrumentationDeviceReason = "NoRuntimeDetails" ApplyInstrumentationDeviceReasonErrApplying ApplyInstrumentationDeviceReason = "ErrApplyingInstrumentationDevice" ApplyInstrumentationDeviceReasonErrRemoving ApplyInstrumentationDeviceReason = "ErrRemovingInstrumentationDevice" + ApplyInstrumentationDeviceReasonNotSupported ApplyInstrumentationDeviceReason = "ErrVersionNotSupported" ) const ( @@ -210,6 +212,14 @@ func reconcileSingleWorkload(ctx context.Context, kubeClient client.Client, runt return err } + for _, runtimeDetail := range runtimeDetails.Spec.RuntimeDetails { + if runtimeDetail.Language == common.NginxProgrammingLanguage { + err := removeInstrumentationDeviceFromWorkload(ctx, kubeClient, runtimeDetails.Namespace, workloadKind, workloadName, ApplyInstrumentationDeviceReasonNotSupported) + conditions.UpdateStatusConditions(ctx, kubeClient, runtimeDetails, &runtimeDetails.Status.Conditions, metav1.ConditionFalse, appliedInstrumentationDeviceType, string(ApplyInstrumentationDeviceReasonNotSupported), "Nginx Instrumentation is Coming Soon!") + return err + } + } + err = addInstrumentationDeviceToWorkload(ctx, kubeClient, runtimeDetails) if err == nil { conditions.UpdateStatusConditions(ctx, kubeClient, runtimeDetails, &runtimeDetails.Status.Conditions, metav1.ConditionTrue, appliedInstrumentationDeviceType, "InstrumentationDeviceApplied", "Instrumentation device applied successfully")