hitachienergy/epiphany

[BUG] `epicli apply` fails if there is no k8s component enabled

Closed this issue · 0 comments

Describe the bug
epicli apply command fails with the following error if there is no kubernetes_master component enabled:

12:06:43 ERROR epicli - 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/epicli/cli/epicli.py", line 128, in main
    return args.func(args)
  File "/epicli/cli/epicli.py", line 226, in run_apply
    return cmd.apply()
  File "/epicli/cli/src/commands/Apply.py", line 135, in apply
    self.collect_infrastructure_config()
  File "/epicli/cli/src/commands/Apply.py", line 113, in collect_infrastructure_config
    self.output_mhandler.update_doc(config_collector.run())  # update kubernetes config doc
  File "/epicli/cli/src/schema/ManifestHandler.py", line 77, in update_doc
    docs = self.__docs[doc['kind']]  # defaultdict will not raise an error
TypeError: 'NoneType' object is not subscriptable

This bug has been recently introduced in PR #3268.

How to reproduce
Steps to reproduce the behavior:

  1. Execute epicli apply to deploy any cluster without k8s.

Expected behavior
The installation should be successful.

Environment

  • Cloud provider: [all]
  • OS: [all]

epicli version: [2.0.2dev]

Additional context
Add any other context about the problem here.


DoD checklist

  • Changelog
    • updated
    • not needed
  • COMPONENTS.md
    • updated
    • not needed
  • Schema
    • updated
    • not needed
  • Backport tasks
    • created
    • not needed
  • Documentation
    • added
    • updated
    • not needed
  • Feature has automated tests
  • Automated tests passed (QA pipelines)
    • apply
    • upgrade
    • backup/restore
  • Idempotency tested
  • All conversations in PR resolved