Open mertsaygi opened 4 years ago
Init function is created to initalize resource. When you run sync command, it runs https://github.com/codilime/floodgate/blob/69718a85b49e94e48353ab8038947bf37460bd76/resourcemanager/resourcemanager.go#L111 and then it starts to save resources in remote https://github.com/codilime/floodgate/blob/69718a85b49e94e48353ab8038947bf37460bd76/resourcemanager/resourcemanager.go#L124
To sum up, I don't think it's necessary to save resources in remote inside the init function.
Describe the bug When we synth our resources, Floodgate makes changes to our existing resources but it never creates our new resources. When we investigate, we should make change on spinnaker resource directory as like that:
if api != nil { if err := a.LoadRemoteState(api); err != nil { err := a.SaveLocalState(api) return err } }
If loadRemoteState has an error (does not exist error) local state should be saved on remote. This is quick solution. If you want to resolve this issue on me. I can do clean solution.