charm-tools
charm-tools copied to clipboard
charm-build and interfaces: no 'exclude' option (which was 'ignore' before recent change).
Checklist
- [X] Confirmed this is an issue with charm-tools, not charmstore-client
- [X] Provide versions of tools used
- [X] Described the feature or ways to replicate the issue
What version am I running?
It's from git master branch: cd23ad6f3a7ad93d9404a6c9a60487960937151d #235: Fix ignore and add exclude support in layer.yaml (fixes #220 #234)
I ran the following command: charm version
and got the following ouput:
charm-tools 2.1.2
I am using: Linux 4.4.0-34-generic #53-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux (Xenial)
Issue/Feature
With the recent change of 'ignore' and the addition of 'exclude' to the layer.yaml, I was hoping that the interface.yaml in an interface would work the same way. Unfortunately, adding 'exclude' to an interface.yaml does nothing.
e.g. from a build the barbican charm which uses keystone:
interface.yaml:
name: keystone
summary: Interface for integrating with Keystone identity service
maintainer: OpenStack Charmers <[email protected]>
exclude:
- 'units_tests'
- 'Makefile'
- '.testr.conf'
- 'test-requirements.txt'
- 'tox.ini'
Actual contents of the copied system: (ls -al):
drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 25 13:12 .
drwxrwxr-x 8 ubuntu ubuntu 4096 Aug 25 13:12 ..
-rw-rw-r-- 1 ubuntu ubuntu 826 Apr 18 12:02 copyright
-rw-rw-r-- 1 ubuntu ubuntu 36 Aug 24 19:16 .gitignore
-rw-rw-r-- 1 ubuntu ubuntu 89 Aug 24 18:15 .gitreview
-rw-rw-r-- 1 ubuntu ubuntu 0 Aug 25 13:12 __init__.py
-rw-rw-r-- 1 ubuntu ubuntu 250 Aug 25 13:11 interface.yaml
-rw-r--r-- 1 ubuntu ubuntu 12288 Aug 25 13:12 .interface.yaml.swp
-rw-rw-r-- 1 ubuntu ubuntu 5786 Aug 24 18:15 requires.py
-rw-rw-r-- 1 ubuntu ubuntu 331 Aug 24 19:16 .testr.conf
-rw-rw-r-- 1 ubuntu ubuntu 97 Aug 24 19:16 test-requirements.txt
-rw-rw-r-- 1 ubuntu ubuntu 700 Aug 24 19:16 tox.ini
-rw-r--r-- 1 ubuntu ubuntu 7168 Aug 24 17:06 .unit-state.db
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 25 13:12 unit_tests
i.e. the things to ignore weren't ignored.
I expect/expected the following
I expected the excluded files and directories from the interface to not be copied to the build charm.
Thanks for the report, this definitely wasn't added to interface.yaml
, but is probably should be. @johnsca thoughts?
Yes, interfaces should support this as well. As @stub42's mentions in #243 there are several areas where interface layers aren't handled as robustly as other layers and the support should be more unified.
Is there a fix underway for this? Indeed, we do need to be able to utilizes 'ignores' for interfaces in OpenStack Charm CI, and cannot currently.
Reference:
- https://review.openstack.org/#/c/360055/
- https://review.openstack.org/#/c/360055/1/interface.yaml