cf-targets-plugin
cf-targets-plugin copied to clipboard
Using cf-app sets target as modified
Using cf-targets version 1.2.0 and cf CLI version 6.48.0 I'm suddenly seeing errors trying to switch targets without the -f flag claiming that I've modified the current target, but no modifications were made to the target.
Steps to reproduce:
- login to a cf api
- save target
- run
cf app {app}
If you then run 'cf targets` the target shows as modified.
Not certain if other commands trigger the same issue, I use the cf app command constantly in my workflow so it's the one that's caused me to add the -f to most of my scripts to work around this.
@deinman true. certain commands, and other cf plugins fiddle with the cf_home but not necessarily the login details. Since, in the code, I can see @guidowb is using a byte comparison between the two homes, I guess that tight comparison causes the issue. Maybe if we just check certain properties in home and not the entire file, things will be different. I will experiment with this if I find time.
Reference: https://github.com/guidowb/cf-targets-plugin/blob/master/cf_targets.go#L294