Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix apply configuration generation on macOS #248

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

SgtCoDFish
Copy link
Member

@SgtCoDFish SgtCoDFish commented Nov 28, 2023

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.

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

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

Signed-off-by: Ashley Davis <ashley.davis@venafi.com>
This avoids us spinning up a separate shell when we can use the existing
identical value

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

Signed-off-by: Ashley Davis <ashley.davis@venafi.com>
@jetstack-bot jetstack-bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 28, 2023
@erikgb
Copy link
Contributor

erikgb commented Nov 28, 2023

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 jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 28, 2023
@jetstack-bot
Copy link
Contributor

[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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jetstack-bot jetstack-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 28, 2023
@jetstack-bot jetstack-bot merged commit 5b960b2 into cert-manager:main Nov 28, 2023
4 checks passed
@SgtCoDFish SgtCoDFish deleted the fix-api-dirs-macos branch November 28, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants