datawire / forge

Define and run multi-container apps in Kubernetes
http://forge.sh
Apache License 2.0
416 stars 43 forks source link

Build fails to pick up additional k8s directory. #183

Closed pkim-auro closed 6 years ago

pkim-auro commented 6 years ago

Maybe I am misusing the templating but found some wierd behavior:

Normal setup: $REPO/k8s/deployment.yaml actual result: forge build manifests -- works fine

Issue 1: setup: $REPO/k8s/forge-template/deployment.yaml

cmd: forge buildmanifets expected result: will build using the template in forge-template/deployment.yaml actual result: rendered: (none)

Issue 2: setup: $REPO/k8s/forge-template/deployment.yaml $REPO/k8s/deployment.yaml

cmd: forge build manifets expected result: will build something? actual result: errors out:

║ 44 tasks run, 1 errors
║   None: unexpected error
║
║     Traceback (most recent call last):
║       File "/home/pkim/.pex/install/Forge-0.4.7-py2-none-any.whl.d3ef9c6c3e933bb5f7e07959f7f5e6a6322239a0/Forge-0.4.7-py2-none-any.whl/forge/core.py", line 327, in root
║         service.go(name)
║       File "/home/pkim/.pex/install/Forge-0.4.7-py2-none-any.whl.d3ef9c6c3e933bb5f7e07959f7f5e6a6322239a0/Forge-0.4.7-py2-none-any.whl/forge/core.py", line 320, in service
║         goal(svc)
║       File "/home/pkim/.pex/install/Forge-0.4.7-py2-none-any.whl.d3ef9c6c3e933bb5f7e07959f7f5e6a6322239a0/Forge-0.4.7-py2-none-any.whl/forge/core.py", line 240, in manifest
║         self.kube.label(k8s_dir, labels)
║       File "/home/pkim/.pex/install/Forge-0.4.7-py2-none-any.whl.d3ef9c6c3e933bb5f7e07959f7f5e6a6322239a0/Forge-0.4.7-py2-none-any.whl/forge/kubernetes.py", line 159, in label
║         self._labeltate(yaml_dir, labels, annotate=False)
║       File "/home/pkim/.pex/install/Forge-0.4.7-py2-none-any.whl.d3ef9c6c3e933bb5f7e07959f7f5e6a6322239a0/Forge-0.4.7-py2-none-any.whl/forge/kubernetes.py", line 139, in _labeltate
║         with open(os.path.join(yaml_dir, name), 'read') as f:
║     IOError: [Errno 21] Is a directory: u'/home/pkim/git/net-diagnostics/.forge/k8s/net-diagnostics/forge-template'
rhs commented 6 years ago

This should be fixed in forge 0.4.10

pkim-auro commented 6 years ago

Thanks Rafael. tested and working. logged a minor observation on #185 - maybe just documentation?