Skip to content

Commit

Permalink
Merge branch 'dev' into fix/vault-server
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoVoges committed Sep 28, 2023
2 parents 235a462 + df5ecce commit cfc6941
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ test_docker:
.PHONY: test_coverage
test_coverage:
@echo ----- Testing code coverage -----
coverage run --source=kapitan --omit="*reclass*" -m unittest discover
coverage report --fail-under=65 -m
python tests/vault_server.py

.PHONY: test_formatting
test_formatting:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,4 +380,9 @@ def load_config(self, path: str):
return [], {}
classes = OmegaConf.create(config.get("classes", []))
parameters = OmegaConf.create(config.get("parameters", {}))

# add metadata to nodes
filename = os.path.splitext(os.path.split(path)[1])[0]
parameters._set_flag(["filename", "path"], [filename, path], recursive=True)

return classes, parameters
2 changes: 1 addition & 1 deletion kapitan/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import kapitan.cached as cached
from kapitan import __file__ as kapitan_install_path
from kapitan.errors import CompileError, InventoryError, KapitanError
from kapitan.inventory.omegaconf import OmegaConfBackend
from kapitan.inventory.omegaconf_inv import OmegaConfBackend
from kapitan.inventory.reclass import ReclassBackend
from kapitan.utils import (
PrettyDumper,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_omegaconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import yaml

from kapitan.inventory.omegaconf import OmegaConfBackend
from kapitan.inventory.omegaconf_inv import OmegaConfBackend


class OmegaConfMigrationTest(unittest.TestCase):
Expand Down
16 changes: 16 additions & 0 deletions tests/vault_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,19 @@ def get_policy(self):
}
"""
return test_policy


try:
server = VaultServer("", "test_vaultkv")
server.setup_vault()
except Exception as e:
print("logs:")
for log in server.container.logs().decode().split("\n"):
print(log)
raise e
finally:
server.container.stop()
server.docker_client.close()

# coverage run --source=kapitan --omit="*reclass*" -m unittest discover
# coverage report --fail-under=65 -m

0 comments on commit cfc6941

Please sign in to comment.