Skip to content

Commit

Permalink
Add custom catalogsource (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 authored Nov 7, 2024
1 parent eba16c4 commit 97d20a3
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ install:
./scripts/deploy-network-policies.sh
./scripts/delete-standard-storageclass.sh
./scripts/deploy-cr-scale-operator.sh
./scripts/deploy-custom-catalogsource.sh

# Creates an install path specifically for the Kind QE clusters to use
install-for-qe:
Expand Down
10 changes: 10 additions & 0 deletions scripts/delete-custom-catalogsource.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -x

# Initialization
SCRIPT_DIR=$(dirname "$0")

# shellcheck disable=SC1091 # Not following.
source "$SCRIPT_DIR"/init-env.sh

oc delete --filename ./test-target/custom-catalogsource.yaml --namespace "$CUSTOM_CATALOG_NAMESPACE" --ignore-not-found
18 changes: 18 additions & 0 deletions scripts/deploy-custom-catalogsource.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -x

# Initialization
SCRIPT_DIR=$(dirname "$0")

# shellcheck disable=SC1091 # Not following.
source "$SCRIPT_DIR"/init-env.sh

oc create ns "$CUSTOM_CATALOG_NAMESPACE" --dry-run=client --output yaml | oc apply --filename -

# Apply the catalogsource YAML
oc apply --filename ./test-target/custom-catalogsource.yaml --namespace "$CUSTOM_CATALOG_NAMESPACE"

# Patch the custom-catalog service to be IP Family Dual Stack
# This is needed to pass the dual-stack service test
oc patch service custom-catalog --namespace "$CUSTOM_CATALOG_NAMESPACE" --type='json' -p='[{"op": "add", "path": "/spec/ipFamilyPolicy", "value": "PreferDualStack"}]'
oc patch service custom-catalog --namespace "$CUSTOM_CATALOG_NAMESPACE" --type='json' -p='[{"op": "add", "path": "/spec/ipFamilies", "value": ["IPv4", "IPv6"]}]'
3 changes: 3 additions & 0 deletions scripts/init-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export CERTSUITE_EXAMPLE_NAMESPACE="${CERTSUITE_EXAMPLE_NAMESPACE:-tnf}"
# catalog source namespace
export CATALOG_NAMESPACE="${CATALOG_NAMESPACE:-$CERTSUITE_EXAMPLE_NAMESPACE}"

# custom catalog source namespace
export CUSTOM_CATALOG_NAMESPACE="${CUSTOM_CATALOG_NAMESPACE:-$CERTSUITE_EXAMPLE_NAMESPACE}"

# Creates namespace if it does not exist.
oc create \
namespace "$CERTSUITE_EXAMPLE_NAMESPACE" \
Expand Down
10 changes: 10 additions & 0 deletions test-target/custom-catalogsource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: custom-catalog
spec:
sourceType: grpc
image: quay.io/deliedit/test:catalog-index-test
displayName: Operator Catalog
publisher: Redhat

0 comments on commit 97d20a3

Please sign in to comment.