From 11741fafcf947431c96c99f56dee086594fee656 Mon Sep 17 00:00:00 2001 From: Tushar Tathgur Date: Thu, 6 Jul 2023 14:49:02 -0700 Subject: [PATCH] Addressed comments with Table and datasources changes Signed-off-by: Tushar Tathgur --- .../migrators/000005_0-5-0.down.sql | 13 --------- .../datasources/migrators/000005_0-5-0.up.sql | 13 --------- .../migrators/000005_0-6-0.down.sql | 14 ++++++++++ .../datasources/migrators/000005_0-6-0.up.sql | 14 ++++++++++ build/yamls/flow-visibility.yml | 28 +++++++++++++++++++ ci/kind/test-upgrade-theia.sh | 2 +- 6 files changed, 57 insertions(+), 27 deletions(-) delete mode 100644 build/charts/theia/provisioning/datasources/migrators/000005_0-5-0.down.sql delete mode 100644 build/charts/theia/provisioning/datasources/migrators/000005_0-5-0.up.sql diff --git a/build/charts/theia/provisioning/datasources/migrators/000005_0-5-0.down.sql b/build/charts/theia/provisioning/datasources/migrators/000005_0-5-0.down.sql deleted file mode 100644 index af51c9d1d..000000000 --- a/build/charts/theia/provisioning/datasources/migrators/000005_0-5-0.down.sql +++ /dev/null @@ -1,13 +0,0 @@ ---Drop aggregated TAD columns -ALTER TABLE tadetector DROP COLUMN podNamespace String; -ALTER TABLE tadetector_local DROP COLUMN podNamespace String; -ALTER TABLE tadetector DROP COLUMN podLabels String; -ALTER TABLE tadetector_local DROP COLUMN podLabels String; -ALTER TABLE tadetector DROP COLUMN destinationServicePortName String; -ALTER TABLE tadetector_local DROP COLUMN destinationServicePortName String; -ALTER TABLE tadetector DROP COLUMN aggType String; -ALTER TABLE tadetector_local DROP COLUMN aggType String; -ALTER TABLE tadetector DROP COLUMN direction String; -ALTER TABLE tadetector_local DROP COLUMN direction String; -ALTER TABLE tadetector DROP COLUMN podName String; -ALTER TABLE tadetector_local DROP COLUMN podName String; diff --git a/build/charts/theia/provisioning/datasources/migrators/000005_0-5-0.up.sql b/build/charts/theia/provisioning/datasources/migrators/000005_0-5-0.up.sql deleted file mode 100644 index e10544b2c..000000000 --- a/build/charts/theia/provisioning/datasources/migrators/000005_0-5-0.up.sql +++ /dev/null @@ -1,13 +0,0 @@ ---Add aggregated TAD columns -ALTER TABLE tadetector ADD COLUMN podNamespace String; -ALTER TABLE tadetector_local ADD COLUMN podNamespace String; -ALTER TABLE tadetector ADD COLUMN podLabels String; -ALTER TABLE tadetector_local ADD COLUMN podLabels String; -ALTER TABLE tadetector ADD COLUMN destinationServicePortName String; -ALTER TABLE tadetector_local ADD COLUMN destinationServicePortName String; -ALTER TABLE tadetector ADD COLUMN aggType String; -ALTER TABLE tadetector_local ADD COLUMN aggType String; -ALTER TABLE tadetector ADD COLUMN direction String; -ALTER TABLE tadetector_local ADD COLUMN direction String; -ALTER TABLE tadetector ADD COLUMN podName String; -ALTER TABLE tadetector_local ADD COLUMN podName String; diff --git a/build/charts/theia/provisioning/datasources/migrators/000005_0-6-0.down.sql b/build/charts/theia/provisioning/datasources/migrators/000005_0-6-0.down.sql index bdaa70220..a378c9764 100644 --- a/build/charts/theia/provisioning/datasources/migrators/000005_0-6-0.down.sql +++ b/build/charts/theia/provisioning/datasources/migrators/000005_0-6-0.down.sql @@ -198,3 +198,17 @@ ALTER TABLE flows ALTER TABLE flows_local DROP COLUMN egressName, DROP COLUMN egressIP; +ALTER TABLE tadetector + DROP COLUMN podNamespace, + DROP COLUMN podLabels, + DROP COLUMN destinationServicePortName, + DROP COLUMN aggType, + DROP COLUMN direction, + DROP COLUMN podName; +ALTER TABLE tadetector_local + DROP COLUMN podNamespace, + DROP COLUMN podLabels, + DROP COLUMN destinationServicePortName, + DROP COLUMN aggType, + DROP COLUMN direction, + DROP COLUMN podName; diff --git a/build/charts/theia/provisioning/datasources/migrators/000005_0-6-0.up.sql b/build/charts/theia/provisioning/datasources/migrators/000005_0-6-0.up.sql index 282953886..b5ac3bcf7 100644 --- a/build/charts/theia/provisioning/datasources/migrators/000005_0-6-0.up.sql +++ b/build/charts/theia/provisioning/datasources/migrators/000005_0-6-0.up.sql @@ -137,3 +137,17 @@ ALTER TABLE flows ALTER TABLE flows_local ADD COLUMN egressName String, ADD COLUMN egressIP String; +ALTER TABLE tadetector + ADD COLUMN podNamespace String, + ADD COLUMN podLabels String, + ADD COLUMN destinationServicePortName String, + ADD COLUMN aggType String, + ADD COLUMN direction String, + ADD COLUMN podName String; +ALTER TABLE tadetector_local + ADD COLUMN podNamespace String, + ADD COLUMN podLabels String, + ADD COLUMN destinationServicePortName String, + ADD COLUMN aggType String, + ADD COLUMN direction String, + ADD COLUMN podName String; diff --git a/build/yamls/flow-visibility.yml b/build/yamls/flow-visibility.yml index 884f10cb5..61b0fceaa 100644 --- a/build/yamls/flow-visibility.yml +++ b/build/yamls/flow-visibility.yml @@ -589,6 +589,20 @@ data: ALTER TABLE flows_local DROP COLUMN egressName, DROP COLUMN egressIP; + ALTER TABLE tadetector + DROP COLUMN podNamespace, + DROP COLUMN podLabels, + DROP COLUMN destinationServicePortName, + DROP COLUMN aggType, + DROP COLUMN direction, + DROP COLUMN podName; + ALTER TABLE tadetector_local + DROP COLUMN podNamespace, + DROP COLUMN podLabels, + DROP COLUMN destinationServicePortName, + DROP COLUMN aggType, + DROP COLUMN direction, + DROP COLUMN podName; 000005_0-6-0.up.sql: | -- Create underlying tables for Materialized Views to attach data CREATE TABLE IF NOT EXISTS pod_view_table_local ( @@ -729,6 +743,20 @@ data: ALTER TABLE flows_local ADD COLUMN egressName String, ADD COLUMN egressIP String; + ALTER TABLE tadetector + ADD COLUMN podNamespace String, + ADD COLUMN podLabels String, + ADD COLUMN destinationServicePortName String, + ADD COLUMN aggType String, + ADD COLUMN direction String, + ADD COLUMN podName String; + ALTER TABLE tadetector_local + ADD COLUMN podNamespace String, + ADD COLUMN podLabels String, + ADD COLUMN destinationServicePortName String, + ADD COLUMN aggType String, + ADD COLUMN direction String, + ADD COLUMN podName String; create_table.sh: | #!/usr/bin/env bash diff --git a/ci/kind/test-upgrade-theia.sh b/ci/kind/test-upgrade-theia.sh index 8e48e94d2..65f7fd2a7 100755 --- a/ci/kind/test-upgrade-theia.sh +++ b/ci/kind/test-upgrade-theia.sh @@ -255,7 +255,7 @@ popd rm -rf $TMP_THEIA_DIR rc=0 -go test -v -run=TestUpgrade antrea.io/theia/test/e2e -provider=kind --logs-export-dir=$ANTREA_LOG_DIR --upgrade.toVersion=$CURRENT_VERSION --upgrade.fromVersion=$THEIA_FROM_TAG || rc=$? +go test -v -timeout=15m -run=TestUpgrade antrea.io/theia/test/e2e -provider=kind --logs-export-dir=$ANTREA_LOG_DIR --upgrade.toVersion=$CURRENT_VERSION --upgrade.fromVersion=$THEIA_FROM_TAG || rc=$? $THIS_DIR/kind-setup.sh destroy kind