-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes broken "make run" for ansible operators
Previously, an ansible operator would be scaffolded with a Makefile whose "run" target had incorrect syntax. It would run this command: `ANSIBLE_ROLES_PATH="$(ANSIBLE_ROLES_PATH):$(shell pwd)/roles" $(ANSIBLE_OPERATOR) run` That command failed to set the `ANSIBLE_ROLES_PATH` variable correctly because it was using Makefile syntax in a target's recipe, which gets interpreted as shell script. This commit moves the variable setting statement, which uses Makefile syntax, out of the recipe. It also uses the standard `?=` operator to only set the variable if it is unset. Signed-off-by: Michael Hrivnak <mhrivnak@redhat.com>
- Loading branch information
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# entries is a list of entries to include in | ||
# release notes and/or the migration guide | ||
entries: | ||
- description: 'ansible: fixed "make run" so it finds local roles' | ||
|
||
# kind is one of: | ||
# - addition | ||
# - change | ||
# - deprecation | ||
# - removal | ||
# - bugfix | ||
kind: "bugfix" | ||
|
||
# Is this a breaking change? | ||
breaking: false | ||
|
||
# NOTE: ONLY USE `pull_request_override` WHEN ADDING THIS | ||
# FILE FOR A PREVIOUSLY MERGED PULL_REQUEST! | ||
# | ||
# The generator auto-detects the PR number from the commit | ||
# message in which this file was originally added. | ||
# | ||
# What is the pull request number (without the "#")? | ||
# pull_request_override: 0 | ||
|
||
|
||
# Migration can be defined to automatically add a section to | ||
# the migration guide. This is required for breaking changes. | ||
migration: | ||
header: update ansible operator Makefile's run target | ||
body: | | ||
For an ansible operator, update the Makefile's run target to the | ||
following to fix a bug in its implementation. | ||
``` | ||
.PHONY: run | ||
ANSIBLE_ROLES_PATH?="$(shell pwd)/roles" | ||
run: ansible-operator ## Run against the configured Kubernetes cluster in ~/.kube/config | ||
$(ANSIBLE_OPERATOR) run | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters