Skip to content

Commit

Permalink
test check_catlog
Browse files Browse the repository at this point in the history
Signed-off-by: yiraeChristineKim <[email protected]>
  • Loading branch information
yiraeChristineKim committed Jan 22, 2025
1 parent 649dde5 commit 2feb6c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ kind-bootstrap-cluster: kind-bootstrap-cluster-dev kind-deploy-controller
.PHONY: kind-bootstrap-cluster-dev
kind-bootstrap-cluster-dev: CLUSTER_NAME = $(MANAGED_CLUSTER_NAME)
kind-bootstrap-cluster-dev: kind-create-cluster install-crds kind-controller-kubeconfig
kubectl create -f test/resources/grc-operators/catalog.yaml
./build/common/scripts/check_catalog.sh

.PHONY: kind-deploy-controller
kind-deploy-controller: generate-operator-yaml install-resources deploy
Expand Down Expand Up @@ -243,6 +241,9 @@ install-resources:
# deploying roles and service account
kubectl apply -k deploy/rbac
kubectl apply -f deploy/manager/service-account.yaml -n $(KIND_NAMESPACE)
# deploying GRC fake operators
kubectl create -f test/resources/grc-operators/catalog.yaml
./build/common/scripts/check_catalog.sh

IS_HOSTED ?= false
E2E_PROCS = 20
Expand Down
9 changes: 6 additions & 3 deletions build/common/scripts/check_catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ check_and_continue() {
GREEN=$'\e[0;32m'
NC=$'\e[0m'
RED=$'\e[0;31m'
echo "${GREEN}Found these grc fake operators..${NC}"
kubectl get packagemanifest | grep GRC

# Run the command and count matching lines
result_count=$(kubectl get packagemanifest | grep -c GRC)

if [ "$result_count" -gt 0 ]; then
echo "${GREEN}Found these grc fake operators..${NC}"
kubectl get packagemanifest | grep GRC
echo "${GREEN}GRC found ($result_count lines). Continuing...${NC}"
return 0
else
Expand All @@ -29,10 +30,12 @@ while ! check_and_continue; do
retry_count=$((retry_count + 1))

if [ "$retry_count" -ge "$MAX_RETRIES" ]; then
kubectl get catalogsource -n olm grc-mock-source -o yaml
kubectl get pod -n olm
echo "${RED}Max retries reached. Exiting.${NC}"
exit 1
fi

# Wait before retrying
sleep 5
sleep 1
done
3 changes: 2 additions & 1 deletion controllers/operatorpolicy_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,8 @@ func (s Schema) toString() string {
}

// deprecationCond returns a Compliant condition (without affecting the condition itself),
// and a message in the format: 'The ____ (Package, Channel, Bundle) was deprecated.' + additional details from packageManifest.
// and a message in the format: 'The ____ (Package, Channel, Bundle) was deprecated.'
// + additional details from packageManifest.
func deprecationCond(depSchemaName string, depSchema Schema, message string) metav1.Condition {
return metav1.Condition{
Type: "DeprecationWarning",
Expand Down

0 comments on commit 2feb6c6

Please sign in to comment.