fluent / fluent-package-builder

td-agent (Fluentd) Building and Packaging System
Apache License 2.0
21 stars 23 forks source link

fluent-package: msi: migration process wrongly runs every update in env once updated from v4 #640

Closed daipom closed 3 months ago

daipom commented 3 months ago

The migration process fluent-package-post-migration.bat wrongly runs every update in env once updated from v4.

https://github.com/fluent/fluent-package-builder/blob/9d718761b04a1b028ee0925727f7e7aeaabb67ac/fluent-package/msi/assets/fluent-package-post-migration.bat

This is because the following if always becomes true in an environment once updated from v4.

https://github.com/fluent/fluent-package-builder/blob/9d718761b04a1b028ee0925727f7e7aeaabb67ac/fluent-package/msi/assets/fluent-package-post-migration.bat#L4

I have confirmed the following overwriting fluentd.conf can be harmful.

https://github.com/fluent/fluent-package-builder/blob/9d718761b04a1b028ee0925727f7e7aeaabb67ac/fluent-package/msi/assets/fluent-package-post-migration.bat#L25

If adding some setting to fluentd.conf and not editing the old config td-agent.conf, this overwrites fluentd.conf by the old config td-agent.conf. This results in the loss of the current config.

The workaround is to remove the old config file td-agent.conf. We should surely remove this old file before updating v5 from v5. (If that env was once updated from v4.)

daipom commented 3 months ago

We will fix this for v5.0.3. v5.0.3 msi release will be delayed.