cf-targets-plugin icon indicating copy to clipboard operation
cf-targets-plugin copied to clipboard

Using cf-app sets target as modified

Open deinman opened this issue 5 years ago • 1 comments

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:

  1. login to a cf api
  2. save target
  3. 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 avatar Dec 11 '19 15:12 deinman

@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

sahil-bawa avatar Mar 25 '20 10:03 sahil-bawa