-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assign the owner as a label to the project (#946)
* Assign the owner as a label to the project Refers to opendevstack/ods-provisioning-app#668 * Added entry in CHANGELOG.md * Added double quote to prevent globbing and word splitting * Updated label to opendevstack.org/project.owner Co-authored-by: zxBCN Cruz_Martinez <[email protected]>
- Loading branch information
1 parent
05d7c05
commit 02c9bc8
Showing
2 changed files
with
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,17 @@ if [ -n "${PROJECT_ADMINS}" ]; then | |
oc policy add-role-to-user admin "${admin_user}" -n "${PROJECT_ID}-test" | ||
oc policy add-role-to-user admin "${admin_user}" -n "${PROJECT_ID}-cd" | ||
done | ||
|
||
echo "Assign the owner as a label to the OpenShift project" | ||
# Take the first in the list as owner of the project. | ||
# Labels do not allow the '@' char so let's replace it with '_at_' | ||
# For instance, [email protected] will be converted to foo_at_bar.com | ||
# resulting in the following label: opendevstack.org/project.owner=foot_at_bar.com | ||
namespace_owner=$(echo "${PROJECT_ADMINS}" | cut -d "," -f1 | sed -r 's/@/_at_/g') | ||
|
||
oc label namespace "${PROJECT_ID}-dev" opendevstack.org/project.owner="${namespace_owner}" | ||
oc label namespace "${PROJECT_ID}-test" opendevstack.org/project.owner="${namespace_owner}" | ||
oc label namespace "${PROJECT_ID}-cd" opendevstack.org/project.owner="${namespace_owner}" | ||
fi | ||
|
||
if [ -n "${PROJECT_GROUPS}" ]; then | ||
|