hitachienergy / epiphany

Cloud and on-premises automation for Kubernetes centered industrial grade solutions.
Apache License 2.0
138 stars 107 forks source link

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

Closed przemyslavic closed 1 year ago

przemyslavic commented 1 year ago

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

epicli version: [2.0.2dev]

Additional context Add any other context about the problem here.


DoD checklist