Skip to content

Commit 22cef2a

Browse files
committed
Add "special" bare feature as platform for the graph parser
Signed-off-by: Tobias Wolf <[email protected]>
1 parent d394261 commit 22cef2a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/gardenlinux/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# -*- coding: utf-8 -*-
22

3+
# GardenLinux "bare" feature
4+
BARE_FLAVOR_FEATURE_CONTENT = { "description": "Bare flavor", "type": "platform" }
5+
36
# GardenLinux flavors schema for validation
47
GL_FLAVORS_SCHEMA = {
58
"type": "object",

src/gardenlinux/features/parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import subprocess
1010
import yaml
1111

12+
from ..constants import BARE_FLAVOR_FEATURE_CONTENT
1213
from ..logger import LoggerSetup
1314

1415

@@ -72,6 +73,11 @@ def filter(
7273
filter_set = input_features.copy()
7374

7475
for feature in input_features:
76+
# @TODO: Remove "special" handling once "bare" is a first-class citizen of the feature graph
77+
if feature == "bare":
78+
self.graph.add_node("bare", content=BARE_FLAVOR_FEATURE_CONTENT)
79+
continue
80+
7581
filter_set.update(networkx.descendants(Parser._get_graph_view_for_attr(self.graph, "include"), feature))
7682

7783
graph = networkx.subgraph_view(self.graph, filter_node = self._get_filter_set_callable(filter_set, additional_filter_func))

0 commit comments

Comments
 (0)