forked from k8s-operatorhub/community-operators
-
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.
Merge branch 'k8s-operatorhub:main' into main
- Loading branch information
Showing
15,156 changed files
with
3,549,008 additions
and
138,290 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
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,90 @@ | ||
|
||
name: "Operator Convert" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
operators: | ||
description: 'List of operators divided by space (aqua dell-csi-operator). Value all is also supported' | ||
required: true | ||
default: 'aqua dell-csi-operator' | ||
target_branch: | ||
description: 'Target branch' | ||
required: true | ||
#default: 'main' | ||
default: 'manifest-to-bundle' | ||
playbook_repo: | ||
description: 'Playbook repo' | ||
required: true | ||
default: 'https://github.com/redhat-openshift-ecosystem/operator-test-playbooks' | ||
playbook_branch: | ||
description: 'Playbook branch' | ||
required: true | ||
default: 'upstream-community' | ||
env: | ||
OPP_OPERATORS: ${{ github.event.inputs.operators }} | ||
OPP_ANSIBLE_PULL_REPO: "${{ github.event.inputs.playbook_repo }}" | ||
OPP_ANSIBLE_PULL_BRANCH: "${{ github.event.inputs.playbook_branch }}" | ||
ANSIBLE_FORCE_COLOR: 1 | ||
ANSIBLE_DISPLAY_SKIPPED_HOSTS: 0 | ||
ANSIBLE_STDOUT_CALLBACK: "yaml" | ||
OPP_TARGET_BRANCH: "${{ github.event.inputs.target_branch }}" | ||
OPP_PRODUCTION_TYPE: "k8s" | ||
|
||
|
||
jobs: | ||
convert: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.FRAMEWORK_MERGE }} | ||
- name: Conversion | ||
run: | | ||
set -x | ||
PROJECT_DIR=$(pwd) | ||
FAKE_RC=false | ||
git config --local user.email "41898282+framework-automation[bot]@users.noreply.github.com" || $FAKE_RC | ||
git config --local user.name "framework-automation" || $FAKE_RC | ||
if [[ $OPP_TARGET_BRANCH != "main" ]];then | ||
git switch -C $OPP_TARGET_BRANCH | ||
git reset --hard main | ||
fi | ||
if [[ $OPP_OPERATORS == "all" ]];then | ||
echo "Searching for all operators ..." | ||
OPP_OPERATORS=$(find operators/ -name "*package.yaml" | cut -d '/' -f 2 | tr '\n' ' ') | ||
fi | ||
PLAYBOOK_DIR="/tmp/operator-test-playbooks" | ||
git clone $OPP_ANSIBLE_PULL_REPO -b $OPP_ANSIBLE_PULL_BRANCH $PLAYBOOK_DIR | ||
ANSIBLE_TAGS="reset_tools,operator_info" | ||
ANSIBLE_ARGS= | ||
[ "$OPP_PRODUCTION_TYPE" == "ocp" ] && ANSIBLE_ARGS="-e supported_cluster_versions=v4.10,v4.11,v4.12,v4.13,v4.14" | ||
for op in $OPP_OPERATORS;do | ||
# TODO: Check if it is package manifest already | ||
[ ! -d $PROJECT_DIR/operators/$op ] && { echo "Operator '$op' was not found, skipping ...";continue; } || true | ||
IS_PACKAGEMANIFEST=$(find $PROJECT_DIR/operators/$op -name "*package.yaml") | ||
[ -z $IS_PACKAGEMANIFEST ] && { echo "Operator '$op' is in bundle format already, skipping ...";continue; } || true | ||
cd $PLAYBOOK_DIR | ||
ansible-playbook -i localhost, -e ansible_connection=local -e run_upstream=true -e run_prepare_catalog_repo_upstream=false -e run_remove_catalog_repo=false upstream/local.yml --tags $ANSIBLE_TAGS \ | ||
-e operator_dir=$PROJECT_DIR/operators/$op -e cluster_type=$OPP_PRODUCTION_TYPE -e strict_cluster_version_labels=true -e strict_k8s_bundles=true -e automatic_cluster_version_label=true \ | ||
-e oi_index_skip=true $ANSIBLE_ARGS | ||
ANSIBLE_TAGS="operator_info" | ||
cd $PROJECT_DIR | ||
echo "Moving bundle for '$op' ..." | ||
[ -e $PROJECT_DIR/operators/$op/ci.yaml ] && mv $PROJECT_DIR/operators/$op/ci.yaml /tmp/operator-test/operators/$op/ || echo "ci.yaml file does not exist, skipping ..." | ||
rm -rf $PROJECT_DIR/operators/$op | ||
mv /tmp/operator-test/operators/$op $PROJECT_DIR/operators/$op | ||
find $PROJECT_DIR/operators/$op -name 'bundle.Dockerfile' -delete | ||
cd $PROJECT_DIR | ||
git add . || $FAKE_RC | ||
git commit -m "Operator '$op' converted from packagemanifest to bundle format" -a || $FAKE_RC | ||
git push origin $OPP_TARGET_BRANCH -f || $FAKE_RC | ||
done | ||
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
Oops, something went wrong.