Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng committed May 6, 2024
1 parent 4b3a364 commit 5c220df
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .ci/helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ function ci::verify_exclamation_function() {
timesleep=$5
kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- bin/pulsar-client produce -m "${inputmessage}" -n 1 "${inputtopic}"
sleep "$timesleep"
MESSAGE=$(kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- bin/pulsar-client consume -n 1 -s "sub" --subscription-position Earliest "${outputtopic}")
sub=`cat /dev/urandom | tr -dc 'a-z' | head -c 8`
MESSAGE=$(kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- bin/pulsar-client consume -n 1 -s "${sub}" --subscription-position Earliest "${outputtopic}")
echo "$MESSAGE"
if [[ "$MESSAGE" == *"$outputmessage"* ]]; then
return 0
Expand All @@ -399,7 +400,8 @@ function ci::verify_exclamation_function_with_auth() {
command="kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- sh -c 'bin/pulsar-client --auth-plugin \$brokerClientAuthenticationPlugin --auth-params \$brokerClientAuthenticationParameters produce -m \"${inputmessage}\" -n 1 \"${inputtopic}\"'"
sh -c "$command"
sleep "$timesleep"
consumeCommand="kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- sh -c 'bin/pulsar-client --auth-plugin \$brokerClientAuthenticationPlugin --auth-params \$brokerClientAuthenticationParameters consume -n 1 -s "sub" --subscription-position Earliest \"${outputtopic}\"'"
sub=`cat /dev/urandom | tr -dc 'a-z' | head -c 8`
consumeCommand="kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- sh -c 'bin/pulsar-client --auth-plugin \$brokerClientAuthenticationPlugin --auth-params \$brokerClientAuthenticationParameters consume -n 1 -s \"${sub}\" --subscription-position Earliest \"${outputtopic}\"'"
MESSAGE=$(sh -c "$consumeCommand")
echo "$MESSAGE"
if [[ "$MESSAGE" == *"$outputmessage"* ]]; then
Expand All @@ -416,7 +418,8 @@ function ci::verify_wordcount_function() {
timesleep=$5
kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- bin/pulsar-client produce -m "${inputmessage}" -n 1 "${inputtopic}"
sleep "$timesleep"
MESSAGE=$(kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- bin/pulsar-client consume -n 3 -s "sub" --subscription-position Earliest "${outputtopic}")
sub=`cat /dev/urandom | tr -dc 'a-z' | head -c 8`
MESSAGE=$(kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- bin/pulsar-client consume -n 3 -s "${sub}" --subscription-position Earliest "${outputtopic}")
echo "$MESSAGE"
if [[ "$MESSAGE" == *"$outputmessage"* ]]; then
return 0
Expand Down Expand Up @@ -492,6 +495,7 @@ function ci::verify_mongodb_source() {
if [ $? -eq 0 ]; then
return 0
fi
kubectl logs --tail=-1 -l compute.functionmesh.io/name=source-sample
return 1
}

Expand All @@ -517,7 +521,8 @@ function ci::verify_function_with_encryption() {

kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- bin/pulsar-client produce -ekn "myapp1" -ekv "data:application/x-pem-file;base64,${correct_pubkey}" -m "${inputmessage}" -n 1 "${inputtopic}"
sleep "$timesleep"
MESSAGE=$(kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- bin/pulsar-client consume -n 1 -s "sub" --subscription-position Earliest "${outputtopic}")
sub=`cat /dev/urandom | tr -dc 'a-z' | head -c 8`
MESSAGE=$(kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- bin/pulsar-client consume -n 1 -s "${sub}" --subscription-position Earliest "${outputtopic}")
echo "$MESSAGE"
if [[ "$MESSAGE" == *"$outputmessage"* ]]; then
return 0
Expand Down Expand Up @@ -606,7 +611,8 @@ function ci::verify_log_topic() {
timesleep=$3

sleep "$timesleep"
MESSAGE=$(kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- bin/pulsar-client consume -n 1 -s "sub" --subscription-position Earliest "${logTopic}")
sub=`cat /dev/urandom | tr -dc 'a-z' | head -c 8`
MESSAGE=$(kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- bin/pulsar-client consume -n 1 -s "${sub}" --subscription-position Earliest "${logTopic}")
echo "$MESSAGE"
if [[ "$MESSAGE" == *"$message"* ]]; then
return 0
Expand All @@ -621,7 +627,8 @@ function ci::verify_log_topic_with_auth() {
timesleep=$3

sleep "$timesleep"
consumeCommand="kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- sh -c 'bin/pulsar-client --auth-plugin \$brokerClientAuthenticationPlugin --auth-params \$brokerClientAuthenticationParameters consume -n 1 -s "sub" --subscription-position Earliest \"${logTopic}\"'"
sub=`cat /dev/urandom | tr -dc 'a-z' | head -c 8`
consumeCommand="kubectl exec -n ${NAMESPACE} ${CLUSTER}-pulsar-broker-0 -- sh -c 'bin/pulsar-client --auth-plugin \$brokerClientAuthenticationPlugin --auth-params \$brokerClientAuthenticationParameters consume -n 1 -s \"${sub}\" --subscription-position Earliest \"${logTopic}\"'"
MESSAGE=$(sh -c "$consumeCommand")
echo "$MESSAGE"
if [[ "$MESSAGE" == *"$message"* ]]; then
Expand Down
1 change: 1 addition & 0 deletions controllers/spec/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package spec
import (
"bytes"
"context"

// used for template
_ "embed"
"encoding/json"
Expand Down

0 comments on commit 5c220df

Please sign in to comment.