You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to setup knife-spork in a chef-repo with my own cookbooks under site-cookbooks/ and third party cookbooks managed by librarian installed into cookbooks/. There are currently no cookbooks on my chef server. When I run kitchen spork upload lp-reports --include-dependencies, I get an error:
ERROR: lp-reports depends on apt (>= 0.0.0), which is not currently being uploaded and cannot be found on the server!
Am I misunderstanding the purpose of --include-dependencies? It seems to me that with that option set, a cookbook's dependencies should get uploaded with it - but that is not the case.
When the --include-dependenies option is present, it appears that @cookbooks includes all dependencies in an order that would satisfy check_dependencies, but only the cookbook passed to knife spork upload is actually uploaded. Without the option present, @cookbooks only contains the cookbooks passed to the command.
If this is indeed a bug in how --include-dependencies should work, then this should allow uploads of all @cookbooks when --include-dependencies is set. If so, then that is not the end of the dependency woes - in my example apt is included as a dependency more than once and if I run knife spork upload lp-reports apt --include-dependencies, it throws an error when it tries to upload apt a second time, after uploading and freezing it already in the same run.
Here is the metadata for my cookbooks that are involved:
# site-cookbooks/lp-reports/metadata.rb
name 'lp-reports'
...
depends 'apt'
depends 'ruby_build'
depends 'rbenv'
depends 'ub-base'
depends 'ub-passenger'
# site-cookbooks/ub-base/metadata.rb
name 'ub-base'
...
depends 'apt'
# site-cookbooks/ub-passenger/metadata.rb
name 'ub-passenger'
...
depends 'apt'
I'm happy to dig in and fix this, given that I understand --include-dependencies correctly.
The text was updated successfully, but these errors were encountered:
@jpb thanks for the report! I think you may be correct here and --include-dependencies is not working as intended (we don't use it so I hadn't noticed this).
From a quick glance, the code should support the uploading of all dependencies, but I suspect the check you highlighted on "if name_args.include?(cookbook.name.to_s)" is resulting in only the named cookbook actually being uploaded.
If you're OK to have a crack at this I'd be happy to accept a PR - if you get stuck lemme know and I'll try and work on it. Adding this to the next release milestone too.
I'm trying to setup knife-spork in a chef-repo with my own cookbooks under
site-cookbooks/
and third party cookbooks managed by librarian installed intocookbooks/
. There are currently no cookbooks on my chef server. When I runkitchen spork upload lp-reports --include-dependencies
, I get an error:Am I misunderstanding the purpose of
--include-dependencies
? It seems to me that with that option set, a cookbook's dependencies should get uploaded with it - but that is not the case.When the
--include-dependenies
option is present, it appears that@cookbooks
includes all dependencies in an order that would satisfycheck_dependencies
, but only the cookbook passed toknife spork upload
is actually uploaded. Without the option present,@cookbooks
only contains the cookbooks passed to the command.If this is indeed a bug in how
--include-dependencies
should work, then this should allow uploads of all@cookbooks
when--include-dependencies
is set. If so, then that is not the end of the dependency woes - in my exampleapt
is included as a dependency more than once and if I runknife spork upload lp-reports apt --include-dependencies
, it throws an error when it tries to upload apt a second time, after uploading and freezing it already in the same run.Here is the metadata for my cookbooks that are involved:
I'm happy to dig in and fix this, given that I understand
--include-dependencies
correctly.The text was updated successfully, but these errors were encountered: