cert-manager / trust-manager

trust-manager is an operator for distributing trust bundles across a Kubernetes cluster.
https://cert-manager.io/docs/projects/trust-manager/
Apache License 2.0
243 stars 65 forks source link

Fix apply configuration generation on macOS #248

Closed SgtCoDFish closed 8 months ago

SgtCoDFish commented 8 months ago

I noticed this while looking into #240

Commit 1

On at least macos 14.1 (sonoma) the paste utility seems to require a filename to be specified; before this change, the API_DIRS variable fails with the following error:

usage: paste [-s] [-d delimiters] file ...

Commit 2

This avoids us spinning up a separate shell when evaluating API_DIRS, since GO_MODULE already contains the value we want.

This change also changes the variable assignments; make variables are very confusing, but := should only evaluate at startup while = will evaluate every time the variable is used.

See these docs for how = works, and these for :=. From the first link:

Another disadvantage is that any functions referenced in the definition will be executed every time the variable is expanded. This makes make run slower; worse, it causes the wildcard and shell functions to give unpredictable results because you cannot easily control when they are called, or even how many times.

erikgb commented 8 months ago

Thanks Ash! I am just dreaming of a Mac! 😉 I have also verified that this still works on my Windows-Ubuntu.

/lgtm /approve

jetstack-bot commented 8 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: erikgb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/cert-manager/trust-manager/blob/main/OWNERS)~~ [erikgb] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment