#!/bin/bash
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/utils"
assert_resources_exist(){

	# verify DS
	os::cmd::try_until_success "oc -n $NAMESPACE get ds collector" ${TIMEOUT_MIN}

	# verify ER
	os::cmd::try_until_success "oc -n $NAMESPACE get elasticsearch elasticsearch" ${TIMEOUT_MIN}

}

assert_kibana_instance_exists() {
	# verify kibana crd
	os::cmd::try_until_success "oc -n $NAMESPACE get kibana kibana" ${TIMEOUT_MIN}
}

assert_resources_does_not_exist(){
	os::cmd::try_until_failure "oc -n $NAMESPACE get cronjob curator"
	os::cmd::try_until_failure "oc -n $NAMESPACE get ds collector"
	os::cmd::try_until_failure "oc -n $NAMESPACE get elasticsearch elasticsearch"

}

assert_kibana_instance_does_not_exists() {
	os::cmd::try_until_failure "oc -n $NAMESPACE get kibana kibana"
}
