Skip to content

Commit

Permalink
Make feature tables that dont have a FF version more intuitive
Browse files Browse the repository at this point in the history
Originally `kops_feature_table(kops_added_default='1.17')` would generate a single column with a header of Default which isnt very intuitive. This replaces the header with Introduced which I think is more intuitive
  • Loading branch information
rifelpet committed Jul 19, 2020
1 parent fe2cc46 commit 91d8ca2
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions hack/mkdocs_macros/feature_stability_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def kops_feature_table(**kwargs):

# this dict object maps the kwarg to its description, which will be used in the final table
supported_args = {
'kops_added_ff': 'Alpha (Feature Flag)',
'kops_added_ff': 'Alpha (Feature Flag)',
'kops_added_default': 'Default',
'k8s_min': 'Minimum K8s Version'
}
Expand All @@ -42,10 +42,17 @@ def kops_feature_table(**kwargs):
values = '|'

# Iterate over provided supported kwargs and match them with the provided values.
for arg in supported_args.keys():
if arg in kwargs.keys():
title += f' {supported_args[arg]} |'
separators += ' :-: |'
for arg, header in supported_args.items():
if arg not in kwargs.keys():
continue
if arg == 'kops_added_default' and 'kops_added_ff' not in kwargs.keys():
title += ' Introduced |'
else:
title += f' {header} |'
separators += ' :-: |'
if arg == 'k8s_min':
values += f' K8s {kwargs[arg]} |'
else:
values += f' Kops {kwargs[arg]} |'

# Create a list object containing all the table rows,
Expand Down

0 comments on commit 91d8ca2

Please sign in to comment.