Skip to content

Commit

Permalink
fix: skips the migration on proxy tab
Browse files Browse the repository at this point in the history
  • Loading branch information
hetangmodi-crest committed Nov 14, 2024
1 parent 26bf7fa commit 607ab26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 4 additions & 0 deletions splunk_add_on_ucc_framework/global_config_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ def _dump_with_migrated_tabs(global_config: GlobalConfig, path: str) -> None:
for i, tab in enumerate(
global_config.content.get("pages", {}).get("configuration", {}).get("tabs", [])
):
if tab.get("type") == "proxyTab":
# Collapsing the tab is not required for ProxyTab because we can't be certain
# that a particular tab is a Proxy tab, as we can with a Logging tab.
continue
global_config.content["pages"]["configuration"]["tabs"][i] = _collapse_tab(tab)

_dump(global_config.content, path, global_config._is_global_config_yaml)
Expand Down
10 changes: 2 additions & 8 deletions splunk_add_on_ucc_framework/tabs/proxy_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,8 @@ def tab_type(self) -> Optional[str]:
@classmethod
def from_definition(cls, definition: Dict[str, Any]) -> Optional["Tab"]:
"""
This function checks if the definition either has type==ProxyTab, or if it is a normal tab (which later will
be converted), that satisfies the following conditions:
1. This dictionary has only 3 keys: name, title and entity (e.g. no keys like warnings)
2. It has only one entity
3. The entity is singleSelect and has the predefined log levels.
Note: Although it is possible to set custom levels, this function will omit other levels, as it would be harder
to determine whether the tab is indeed a logging tab.
This function checks if the definition has type == ProxyTab; if it does, it gets converted;
otherwise, it returns None.
"""
if definition.get("type") == "proxyTab":
entity = []
Expand Down

0 comments on commit 607ab26

Please sign in to comment.