-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RABSW-985: Prefix webhook resource names for unit tests (#33)
* RABSW-985: Prefix webhook resource names for unit tests This commit fixes an issue where the DWS workflow validation webhook was colliding with the NNF storage profile validation webhook. This was because the ValidatingWebhookConfiguration resource generated by the controller-gen tool has the same name between the projects. I added a script to prefix the names of the ValidatingWebhookConfiguration and Service resource with "nnf-". The script makes a copy of the original yaml files and passes the new location to the test code through an environment variable. Signed-off-by: Matt Richerson <[email protected]> * move export Signed-off-by: Matt Richerson <[email protected]> Co-authored-by: Matt Richerson <[email protected]>
- Loading branch information
1 parent
716ffd5
commit 10352d2
Showing
5 changed files
with
24 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
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
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
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
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,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
function prefix_webhook_names { | ||
SOURCE_DIR=$1 | ||
DEST_DIR=$2 | ||
|
||
mkdir -p $DEST_DIR | ||
cp $SOURCE_DIR/manifests.yaml $DEST_DIR | ||
sed -i.bak -e 's/validating-webhook-configuration/nnf-validating-webhook-configuration/' $DEST_DIR/manifests.yaml | ||
rm $DEST_DIR/manifests.yaml.bak | ||
|
||
cp $SOURCE_DIR/service.yaml $DEST_DIR | ||
sed -i.bak -e 's/webhook-service/nnf-webhook-service/' $DEST_DIR/service.yaml | ||
rm $DEST_DIR/service.yaml.bak | ||
} |