Open mtarng opened 4 years ago
I reproduced this bug on Windows.
The bug occurs within the function LoadComponent()
in component.go
1st run: the error os.PathError
is returned from UnmarshalComponent("yaml", ...)
loadedComponents
and the error message "Error loading component in path ./" are returned.
2nd run: There is no error, as component.yaml
now exists in the current directory. Moving forward, the function applyDefaultsAndMigrations()
is called, adding the ComponentType
of "component".
Potential Solution: Handle the specific error of os.PathError
, adding the ComponentType
of "component" in this case.
Describe the bug: When calling
fab add
it excludestype: component
at the top level of thecomponent.yaml
. Subsequently, if you run the same command again,type:component
will be added as, I suspect, it's being added to the object when loading from thecomponent.yaml
file.To Reproduce:
fab add someservice --path ./someservice --method local --type component
fab add someservice --path ./someservice --method local --type component
notice
type: component
has been added at the top level. Expected behavior:type: component
should probably be added on the first run.Screenshots:
Additional context:
Desktop (please complete the following information):