From 8102c49138801b67ef65c5ad46474108d2e92789 Mon Sep 17 00:00:00 2001 From: gadotroee <55343099+gadotroee@users.noreply.github.com> Date: Wed, 4 May 2022 11:13:18 +0300 Subject: [PATCH 1/4] Improve acceptance tests setup script (#887) --- .gitignore | 5 ++++- acceptanceTests/setup.sh | 41 +++++++++++++++++++++++++--------------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index f03aa4cb9..80ee94b3a 100644 --- a/.gitignore +++ b/.gitignore @@ -52,4 +52,7 @@ tap/extensions/*/expect # UI folders to ignore **/node_modules/** **/dist/** -*.editorconfig \ No newline at end of file +*.editorconfig + +# Ignore *.log files +*.log \ No newline at end of file diff --git a/acceptanceTests/setup.sh b/acceptanceTests/setup.sh index ef1836087..1c820d30c 100755 --- a/acceptanceTests/setup.sh +++ b/acceptanceTests/setup.sh @@ -1,7 +1,10 @@ #!/bin/bash +set -e PREFIX=$HOME/local/bin VERSION=v1.22.0 +TUNNEL_LOG="tunnel.log" +PROXY_LOG="proxy.log" echo "Attempting to install minikube and assorted tools to $PREFIX" @@ -11,7 +14,7 @@ if ! [ -x "$(command -v kubectl)" ]; then chmod +x kubectl mv kubectl "$PREFIX" else - echo "kubetcl is already installed" + echo "kubectl is already installed" fi if ! [ -x "$(command -v minikube)" ]; then @@ -27,35 +30,39 @@ echo "Starting minikube..." minikube start echo "Creating mizu tests namespaces" -kubectl create namespace mizu-tests -kubectl create namespace mizu-tests2 +kubectl create namespace mizu-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl create namespace mizu-tests2 --dry-run=client -o yaml | kubectl apply -f - echo "Creating httpbin deployments" -kubectl create deployment httpbin --image=kennethreitz/httpbin -n mizu-tests -kubectl create deployment httpbin2 --image=kennethreitz/httpbin -n mizu-tests +kubectl create deployment httpbin --image=kennethreitz/httpbin -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl create deployment httpbin2 --image=kennethreitz/httpbin -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - -kubectl create deployment httpbin --image=kennethreitz/httpbin -n mizu-tests2 +kubectl create deployment httpbin --image=kennethreitz/httpbin -n mizu-tests2 --dry-run=client -o yaml | kubectl apply -f - echo "Creating redis deployment" -kubectl create deployment redis --image=redis -n mizu-tests +kubectl create deployment redis --image=redis -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - echo "Creating rabbitmq deployment" -kubectl create deployment rabbitmq --image=rabbitmq -n mizu-tests +kubectl create deployment rabbitmq --image=rabbitmq -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - echo "Creating httpbin services" -kubectl expose deployment httpbin --type=NodePort --port=80 -n mizu-tests -kubectl expose deployment httpbin2 --type=NodePort --port=80 -n mizu-tests +kubectl expose deployment httpbin --type=NodePort --port=80 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl expose deployment httpbin2 --type=NodePort --port=80 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - -kubectl expose deployment httpbin --type=NodePort --port=80 -n mizu-tests2 +kubectl expose deployment httpbin --type=NodePort --port=80 -n mizu-tests2 --dry-run=client -o yaml | kubectl apply -f - echo "Creating redis service" -kubectl expose deployment redis --type=LoadBalancer --port=6379 -n mizu-tests +kubectl expose deployment redis --type=LoadBalancer --port=6379 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - echo "Creating rabbitmq service" -kubectl expose deployment rabbitmq --type=LoadBalancer --port=5672 -n mizu-tests +kubectl expose deployment rabbitmq --type=LoadBalancer --port=5672 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - +# TODO: need to understand how to fail if address already in use echo "Starting proxy" -kubectl proxy --port=8080 & +rm -f ${PROXY_LOG} +kubectl proxy --port=8080 > ${PROXY_LOG} & +PID1=$! +echo "kubectl proxy process id is ${PID1} and log of proxy in ${PROXY_LOG}" if [[ -z "${CI}" ]]; then echo "Setting env var of mizu ci image" @@ -71,5 +78,9 @@ minikube image load "${MIZU_CI_IMAGE}" echo "Build cli" cd cli && make build GIT_BRANCH=ci SUFFIX=ci +# TODO: need to understand how to fail if password is asked (sudo) echo "Starting tunnel" -minikube tunnel & +rm -f ${TUNNEL_LOG} +minikube tunnel > ${TUNNEL_LOG} & +PID2=$! +echo "Minikube tunnel process id is ${PID2} and log of tunnel in ${TUNNEL_LOG}" From c7d068748a8c8a459da2c383f99ea30f4321d748 Mon Sep 17 00:00:00 2001 From: lirazyehezkel <61656597+lirazyehezkel@users.noreply.github.com> Date: Sun, 8 May 2022 13:44:56 +0300 Subject: [PATCH 2/4] TRA-4553 Fix outgoing filter (#1068) * Fix outgoing filter * fix labels --- .../TrafficViewer/EntryListItem/EntryListItem.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.tsx b/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.tsx index 2716f7c2c..836c6730f 100644 --- a/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.tsx +++ b/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.tsx @@ -274,21 +274,21 @@ export const EntryItem: React.FC = ({entry, style, headingMode, name > Ingoing traffic : Outgoing traffic { const query = `outgoing == false`; setQuery(queryState ? `${queryState} and ${query}` : query); From 81f06003d5fcfa0350d646a94fc902c87880d9a6 Mon Sep 17 00:00:00 2001 From: lirazyehezkel <61656597+lirazyehezkel@users.noreply.github.com> Date: Sun, 8 May 2022 14:58:13 +0300 Subject: [PATCH 3/4] Outgoing filter remove redundant code (#1069) --- .../components/TrafficViewer/EntryListItem/EntryListItem.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.tsx b/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.tsx index 836c6730f..a04fa5694 100644 --- a/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.tsx +++ b/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.tsx @@ -289,10 +289,6 @@ export const EntryItem: React.FC = ({entry, style, headingMode, name src={ingoingIcon} alt="Ingoing traffic" title="Ingoing" - onClick={() => { - const query = `outgoing == false`; - setQuery(queryState ? `${queryState} and ${query}` : query); - }} /> } From 0dc0459dff14e2f62c8df8c37bcbaca6ded622ef Mon Sep 17 00:00:00 2001 From: lirazyehezkel <61656597+lirazyehezkel@users.noreply.github.com> Date: Sun, 8 May 2022 15:45:33 +0300 Subject: [PATCH 4/4] Disable tapping status when streaming is paused (#1070) --- ui-common/src/components/TrafficViewer/TrafficViewer.tsx | 2 +- ui-common/src/components/UI/StatusBar.tsx | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ui-common/src/components/TrafficViewer/TrafficViewer.tsx b/ui-common/src/components/TrafficViewer/TrafficViewer.tsx index b4a044859..a8a0e7380 100644 --- a/ui-common/src/components/TrafficViewer/TrafficViewer.tsx +++ b/ui-common/src/components/TrafficViewer/TrafficViewer.tsx @@ -240,7 +240,7 @@ export const TrafficViewer: React.FC = ({ return (
- {tappingStatus && isShowStatusBar && } + {tappingStatus && isShowStatusBar && }
{ return `${noun}${amount !== 1 ? 's' : ''}` @@ -12,20 +13,22 @@ const pluralize = (noun: string, amount: number) => { interface StatusBarProps { isDemoBannerView: boolean; + disabled?: boolean; } -export const StatusBar: React.FC = ({isDemoBannerView}) => { +export const StatusBar: React.FC = ({isDemoBannerView, disabled}) => { const tappingStatus = useRecoilValue(tappingStatusAtom); const [expandedBar, setExpandedBar] = useState(false); const {uniqueNamespaces, amountOfPods, amountOfTappedPods, amountOfUntappedPods} = useRecoilValue(tappingStatusDetails); - return
setExpandedBar(true)} onMouseLeave={() => setExpandedBar(false)} data-cy="expandedStatusBar"> + return
setExpandedBar(true)} onMouseLeave={() => setExpandedBar(false)} data-cy="expandedStatusBar">
{tappingStatus.some(pod => !pod.isTapped) && warning} + {disabled && warning} {`Tapping ${amountOfUntappedPods > 0 ? amountOfTappedPods + " / " + amountOfPods : amountOfPods} ${pluralize('pod', amountOfPods)} in ${pluralize('namespace', uniqueNamespaces.length)} ${uniqueNamespaces.join(", ")}`}
- {expandedBar &&
+ {expandedBar && !disabled &&