This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add index tools (catalog, subscription)
Resolves: #144 Signed-off-by: Sergio Arroutbi <[email protected]>
- Loading branch information
Showing
6 changed files
with
130 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: CatalogSource | ||
metadata: | ||
name: tang-operator | ||
namespace: openshift-operators | ||
spec: | ||
displayName: tang-operator | ||
publisher: Red Hat | ||
sourceType: grpc | ||
image: quay.io/sec-eng-special/tang-operator-index:VERSION_HERE | ||
|
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,53 @@ | ||
#!/bin/bash | ||
# Parameters: | ||
# 1 - sync image to quay.io/<repository>/ or registry-proxy.engineering.redhat.com/rh-osbs/tang-operator-bundle@sha256:fceb6d82cea8fd14be1b0ebc0333d314ec5bd2c88199c0aa63377d12c6f4db6e | ||
# 2 - two parameters, $1 is for bundle; $2 is for release, format like 0.0.25-1 | ||
# Example: | ||
# $0 "registry-proxy.engineering.redhat.com/rh-osbs/tang-operator-bundle:0.2.0-6" | ||
# ./tang_index.sh registry-proxy.engineering.redhat.com/rh-osbs/tang-operator-bundle@sha256:a69a44c15bb0ca40a382dcd551f2e7ed06fe8ae8007df55feeeb8a1c33de6e7d 0.2.0-6 | ||
# | ||
# | ||
CONTAINER_MGR='docker' | ||
|
||
usage() { | ||
### echo './tang_index.sh registry-proxy.engineering.redhat.com/rh-osbs/tang-operator-bundle@sha256:a69a44c15bb0ca40a382dcd551f2e7ed06fe8ae8007df55feeeb8a1c33de6e7d 0.2.0-6' | ||
echo './tang_index.sh quay.io/sec-eng-special/tang-operator-bundle:v0.2.0-6 0.2.0-6' | ||
exit "$2" | ||
} | ||
|
||
while getopts "h" arg | ||
do | ||
case "${arg}" in | ||
h) usage "$0" 0 | ||
;; | ||
*) usage "$0" 1 | ||
;; | ||
esac | ||
done | ||
|
||
CO_image_with_digest=$1 | ||
version=$2 | ||
|
||
digest=$(echo "${CO_image_with_digest}" | awk -F: '{print $2}') | ||
sub_digest="${digest:0:12}" | ||
|
||
"${CONTAINER_MGR}" login quay.io -u sarroutb | ||
echo "sub_digest:${sub_digest}" | ||
|
||
#1. Mirror bundle container image | ||
echo -e "step 1 \n\n" | ||
|
||
oc image mirror --filter-by-os=".*" --keep-manifest-list "${CO_image_with_digest}" quay.io/sec-eng-special/tang-operator-bundle-container:"${sub_digest}" | ||
oc image mirror --filter-by-os=".*" --keep-manifest-list "${CO_image_with_digest}" quay.io/sec-eng-special/tang-operator-bundle-container:latest | ||
|
||
#2. Build index image | ||
echo -e "step 2 \n\n" | ||
opm index add --bundles "${CO_image_with_digest}" --tag quay.io/sec-eng-special/tang-operator-index:v"${version}" -c ${CONTAINER_MGR} | ||
|
||
#3. Push image index to quay.io/sec-eng-special/ | ||
echo -e "step 3 \n\n" | ||
echo -e "${CONTAINER_MGR} push quay.io/sec-eng-special/tang-operator-index:v$version \n" | ||
${CONTAINER_MGR} push quay.io/sec-eng-special/tang-operator-index:v"${version}" | ||
|
||
#4. Substitute version in catalog source | ||
sed -e "s@VERSION_HERE@v${version}@g" < tang_catalog_source_template.yaml > tang_catalog_source.yaml |
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,49 @@ | ||
#!/bin/bash | ||
echo "-------------------------------------" | ||
echo "oc status" | ||
oc status | ||
echo "-------------------------------------" | ||
sleep 1 | ||
echo "oc create -f tang_catalog_source.yaml" | ||
oc create -f tang_catalog_source.yaml | ||
echo "-------------------------------------" | ||
sleep 1 | ||
echo "oc get catsrc -nopenshift-marketplace" | ||
oc get catsrc -nopenshift-marketplace | ||
echo "-------------------------------------" | ||
sleep 1 | ||
echo "oc get pods -nopenshift-marketplace" | ||
oc get pods -nopenshift-marketplace | ||
echo "-------------------------------------" | ||
sleep 1 | ||
echo "oc create -f tang_subscription.yaml" | ||
oc create -f tang_subscription.yaml | ||
echo "-------------------------------------" | ||
echo "oc project" | ||
oc project | ||
echo "-------------------------------------" | ||
sleep 1 | ||
echo "oc get sub" | ||
oc get sub | ||
echo "-------------------------------------" | ||
sleep 1 | ||
echo "oc get ip" | ||
oc get ip | ||
echo "-------------------------------------" | ||
sleep 1 | ||
echo "oc get jobs -nopenshift-marketplace" | ||
oc get jobs -nopenshift-marketplace | ||
echo "-------------------------------------" | ||
sleep 1 | ||
echo "oc get pods -nopenshift-marketplace" | ||
oc get pods -nopenshift-marketplace | ||
echo "-------------------------------------" | ||
sleep 1 | ||
echo "oc get csv" | ||
oc get csv | ||
echo "-------------------------------------" | ||
sleep 1 | ||
echo "oc get pods" | ||
oc get pods | ||
echo "-------------------------------------" | ||
sleep 1 |
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,13 @@ | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: Subscription | ||
metadata: | ||
labels: | ||
operators.coreos.com/tang-operator.openshift-operators: "" | ||
name: tang-operator | ||
namespace: openshift-operators | ||
spec: | ||
channel: "alpha" | ||
installPlanApproval: Automatic | ||
name: tang-operator | ||
source: tang-operator | ||
sourceNamespace: openshift-marketplace |
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,3 @@ | ||
#!/bin/bash | ||
oc delete -f tang_subscription.yaml | ||
oc delete -f tang_catalog_source.yaml |