argoproj-labs / argocd-operator

A Kubernetes operator for managing Argo CD clusters.
https://argocd-operator.readthedocs.io
Apache License 2.0
658 stars 772 forks source link

`make bundle` does not work on MacOS #1564

Open appiepollo14 opened 1 month ago

appiepollo14 commented 1 month ago

Describe the bug When running make bundle on MacOS, it exits premature with an error statement:

sed: 1: "bundle/manifests/argocd ...": undefined label 'undle/manifests/argocd-operator-webhook-service_v1_service.yaml' make: *** [bundle] Error 1

This causes the generated bundle to not complete. Which led to a PR not passing CI, as the bundle is different than when it is generated on Linux in CI.

The rootcause is that there are some sed statements in the make statement which have unexpected behavior on MacOS exiting make.

To Reproduce Steps to reproduce the behavior: use a MacOS system!

  1. open a cmd
  2. execute: make bundle

Expected behavior Execute make bundle without an error caused by sed

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Solution / explanation of the difference between sed on systems is posted here: https://stackoverflow.com/questions/12272065/sed-undefined-label-on-macos

appiepollo14 commented 1 month ago

I've closed the PR as there is no generic approach to sed which will work on both MacOS and Linux. Hence why my followup question is: why is there the need in the first place to replace these labels in the bundle? Can we set the value of those labels directly via any other input for operator-sdk?

anandf commented 1 month ago

@appiepollo14 Could you try installing gnu-sed in mac and try using the command brew install gnu-sed should work.

appiepollo14 commented 1 month ago

@anandf that off course solves the issue. However, this feels like an undocumented workaround to me. The core of this issue is the request to make the bundle target cross-platform compatible. So what was the purpose of replacing those labels and can't that be done in another fashion?