Skip to content

Commit

Permalink
changing input args for genpolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
SethHollandsworth committed Jun 17, 2024
1 parent 629a2ba commit 6e39e89
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
5 changes: 5 additions & 0 deletions src/confcom/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Release History
===============
0.3.6
++++++
* updating genpolicy version up through 3.2.0.azl1.genpolicy0
* changing genpolicy flags to give full path to config files instead of path as a flag

0.3.5
++++++
* making diff mode more robust
Expand Down
6 changes: 0 additions & 6 deletions src/confcom/azext_confcom/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,6 @@ def katapolicygen_confcom(
use_cached_files: bool = False,
settings_file_name: str = None,
):

if settings_file_name:
if "genpolicy-settings.json" in settings_file_name:
error_out("Cannot use default settings file names")
os_util.copy_file(settings_file_name, DATA_FOLDER)

kata_proxy = KataPolicyGenProxy()

output = kata_proxy.kata_genpolicy(
Expand Down
2 changes: 1 addition & 1 deletion src/confcom/azext_confcom/data/internal_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.3.5",
"version": "0.3.6",
"hcsshim_config": {
"maxVersion": "1.0.0",
"minVersion": "0.0.1"
Expand Down
10 changes: 4 additions & 6 deletions src/confcom/azext_confcom/kata_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def kata_genpolicy(
) -> List[str]:
policy_bin_str = str(self.policy_bin)
# get path to data and rules folder
arg_list = [policy_bin_str, "-y", yaml_path, "-i", DATA_FOLDER]
arg_list = [policy_bin_str, "-y", yaml_path, "-p", os.path.join(DATA_FOLDER, "rules.rego")]

if config_map_file is not None:
arg_list.append("-c")
Expand All @@ -127,16 +127,14 @@ def kata_genpolicy(
if use_cached_files:
arg_list.append("-u")

arg_list.append("-j")
if settings_file_name:
arg_list.append("-j")
# only take the last part of the path for the settings file
settings_file_name = os.path.basename(settings_file_name)
arg_list.append(settings_file_name)
else:
arg_list.append(os.path.join(DATA_FOLDER, "genpolicy-settings.json"))

item = subprocess.run(
arg_list,
# stdout=sys.stdout,
# stderr=sys.stderr,
check=False,
)

Expand Down
2 changes: 1 addition & 1 deletion src/confcom/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

logger.warn("Wheel is not available, disabling bdist_wheel hook")

VERSION = "0.3.5"
VERSION = "0.3.6"

# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down

0 comments on commit 6e39e89

Please sign in to comment.