diff --git a/controllers/bpfman-agent/application-program.go b/controllers/bpfman-agent/application-program.go index 10c21e8ad..3734591ce 100644 --- a/controllers/bpfman-agent/application-program.go +++ b/controllers/bpfman-agent/application-program.go @@ -78,7 +78,7 @@ func (r *BpfApplicationReconciler) Reconcile(ctx context.Context, req ctrl.Reque for j, p := range a.Spec.Programs { switch p.Type { case bpfmaniov1alpha1.ProgTypeFentry: - appProgramId := fmt.Sprintf("%s-%s", strings.ToLower(string(p.Type)), sanitize(p.Fentry.FunctionName)) + appProgramId := fmt.Sprintf("%s-%s", strings.ToLower(string(p.Type)), sanitize(p.Fentry.BpfFunctionName)) fentryProgram := bpfmaniov1alpha1.FentryProgram{ ObjectMeta: metav1.ObjectMeta{ Name: buildProgramName(a, p), @@ -100,7 +100,7 @@ func (r *BpfApplicationReconciler) Reconcile(ctx context.Context, req ctrl.Reque complete, res, err = r.reconcileCommon(ctx, rec, fentryObjects) case bpfmaniov1alpha1.ProgTypeFexit: - appProgramId := fmt.Sprintf("%s-%s", strings.ToLower(string(p.Type)), sanitize(p.Fexit.FunctionName)) + appProgramId := fmt.Sprintf("%s-%s", strings.ToLower(string(p.Type)), sanitize(p.Fexit.BpfFunctionName)) fexitProgram := bpfmaniov1alpha1.FexitProgram{ ObjectMeta: metav1.ObjectMeta{ Name: buildProgramName(a, p), @@ -123,7 +123,7 @@ func (r *BpfApplicationReconciler) Reconcile(ctx context.Context, req ctrl.Reque case bpfmaniov1alpha1.ProgTypeKprobe, bpfmaniov1alpha1.ProgTypeKretprobe: - appProgramId := fmt.Sprintf("%s-%s", strings.ToLower(string(p.Type)), sanitize(p.Kprobe.FunctionName)) + appProgramId := fmt.Sprintf("%s-%s", strings.ToLower(string(p.Type)), sanitize(p.Kprobe.BpfFunctionName)) kprobeProgram := bpfmaniov1alpha1.KprobeProgram{ ObjectMeta: metav1.ObjectMeta{ Name: buildProgramName(a, p), @@ -146,7 +146,7 @@ func (r *BpfApplicationReconciler) Reconcile(ctx context.Context, req ctrl.Reque case bpfmaniov1alpha1.ProgTypeUprobe, bpfmaniov1alpha1.ProgTypeUretprobe: - appProgramId := fmt.Sprintf("%s-%s", strings.ToLower(string(p.Type)), sanitize(p.Uprobe.FunctionName)) + appProgramId := fmt.Sprintf("%s-%s", strings.ToLower(string(p.Type)), sanitize(p.Uprobe.BpfFunctionName)) uprobeProgram := bpfmaniov1alpha1.UprobeProgram{ ObjectMeta: metav1.ObjectMeta{ Name: buildProgramName(a, p), @@ -168,7 +168,7 @@ func (r *BpfApplicationReconciler) Reconcile(ctx context.Context, req ctrl.Reque complete, res, err = r.reconcileCommon(ctx, rec, uprobeObjects) case bpfmaniov1alpha1.ProgTypeTracepoint: - appProgramId := fmt.Sprintf("%s-%s", strings.ToLower(string(p.Type)), sanitize(p.Tracepoint.Names[0])) + appProgramId := fmt.Sprintf("%s-%s-%s", strings.ToLower(string(p.Type)), sanitize(p.Tracepoint.Names[0]), p.Tracepoint.BpfFunctionName) tracepointProgram := bpfmaniov1alpha1.TracepointProgram{ ObjectMeta: metav1.ObjectMeta{ Name: buildProgramName(a, p), @@ -196,7 +196,7 @@ func (r *BpfApplicationReconciler) Reconcile(ctx context.Context, req ctrl.Reque "app program name", a.Name, "program index", j) continue } - appProgramId := fmt.Sprintf("%s-%s-%s", strings.ToLower(string(p.Type)), p.TC.Direction, interfaces[0]) + appProgramId := fmt.Sprintf("%s-%s-%s-%s", strings.ToLower(string(p.Type)), p.TC.Direction, interfaces[0], p.TC.BpfFunctionName) tcProgram := bpfmaniov1alpha1.TcProgram{ ObjectMeta: metav1.ObjectMeta{ Name: buildProgramName(a, p), @@ -224,7 +224,7 @@ func (r *BpfApplicationReconciler) Reconcile(ctx context.Context, req ctrl.Reque "app program name", a.Name, "program index", j) continue } - appProgramId := fmt.Sprintf("%s-%s-%s", strings.ToLower(string(p.Type)), p.TCX.Direction, interfaces[0]) + appProgramId := fmt.Sprintf("%s-%s-%s-%s", strings.ToLower(string(p.Type)), p.TCX.Direction, interfaces[0], p.TCX.BpfFunctionName) tcxProgram := bpfmaniov1alpha1.TcxProgram{ ObjectMeta: metav1.ObjectMeta{ Name: buildProgramName(a, p), @@ -252,7 +252,7 @@ func (r *BpfApplicationReconciler) Reconcile(ctx context.Context, req ctrl.Reque "app program name", a.Name, "program index", j) continue } - appProgramId := fmt.Sprintf("%s-%s", strings.ToLower(string(p.Type)), interfaces[0]) + appProgramId := fmt.Sprintf("%s-%s-%s", strings.ToLower(string(p.Type)), interfaces[0], p.XDP.BpfFunctionName) xdpProgram := bpfmaniov1alpha1.XdpProgram{ ObjectMeta: metav1.ObjectMeta{ Name: buildProgramName(a, p),