-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support structured policy recommendation results
Signed-off-by: Yanjun Zhou <zhouya@vmware.com>
- Loading branch information
Showing
48 changed files
with
904 additions
and
1,212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.3.0-dev | ||
v0.4.0-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
v0.1.0 v1.7.0 | ||
v0.2.0 v1.8.0 | ||
v0.3.0 v1.9.0 | ||
v0.4.0 v1.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
build/charts/theia/provisioning/datasources/migrators/000003_0-3-0.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--Remove structured recommendations | ||
--Add yamls column | ||
ALTER TABLE recommendations ADD COLUMN yamls String; | ||
ALTER TABLE recommendations_local ADD COLUMN yamls String; | ||
--Copy old data and replace policy and kind by yamls | ||
INSERT INTO recommendations_local (id, type, timeCreated, yamls) | ||
SELECT id, type, timeCreated, arrayStringConcat(groupArray(policy), '\n---\n') AS yamls FROM recommendations_local GROUP BY id, type, timeCreated; | ||
--Delete old data | ||
ALTER TABLE recommendations_local DELETE WHERE yamls=''; | ||
--Drop yamls column | ||
ALTER TABLE recommendations DROP COLUMN kind; | ||
ALTER TABLE recommendations_local DROP COLUMN kind; | ||
ALTER TABLE recommendations DROP COLUMN policy; | ||
ALTER TABLE recommendations_local DROP COLUMN policy; |
18 changes: 18 additions & 0 deletions
18
build/charts/theia/provisioning/datasources/migrators/000003_0-3-0.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--Support structured recommendations | ||
--Add policy and kind column | ||
ALTER TABLE recommendations ADD COLUMN kind String; | ||
ALTER TABLE recommendations_local ADD COLUMN kind String; | ||
ALTER TABLE recommendations ADD COLUMN policy String; | ||
ALTER TABLE recommendations_local ADD COLUMN policy String; | ||
--Copy old data and replace yamls column by policy and kind | ||
INSERT INTO recommendations_local (id, type, timeCreated, policy) | ||
SELECT id, type, timeCreated, arrayJoin(splitByString('---\n', yamls)) AS policy FROM recommendations_local WHERE kind=''; | ||
ALTER TABLE recommendations_local UPDATE kind='knp' WHERE policy LIKE '%networking.k8s.io/v1%NetworkPolicy%'; | ||
ALTER TABLE recommendations_local UPDATE kind='anp' WHERE policy LIKE '%crd.antrea.io/v1alpha1%NetworkPolicy%'; | ||
ALTER TABLE recommendations_local UPDATE kind='acnp' WHERE policy LIKE '%ClusterNetworkPolicy%'; | ||
ALTER TABLE recommendations_local UPDATE kind='acg' WHERE policy LIKE '%ClusterGroup%'; | ||
--Delete old data | ||
ALTER TABLE recommendations_local DELETE WHERE policy=''; | ||
--Drop yamls column | ||
ALTER TABLE recommendations DROP COLUMN yamls; | ||
ALTER TABLE recommendations_local DROP COLUMN yamls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.