Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floodgate should return with different code when there is error in compare #128

Open
boscard opened this issue Oct 5, 2020 · 3 comments · May be fixed by #130
Open

Floodgate should return with different code when there is error in compare #128

boscard opened this issue Oct 5, 2020 · 3 comments · May be fixed by #130

Comments

@boscard
Copy link
Contributor

boscard commented Oct 5, 2020

https://app.circleci.com/pipelines/github/codilime/floodgate/784/workflows/4f9815e0-20aa-42d8-88fb-425479fbd1dd/jobs/3486

#!/bin/bash -eo pipefail
echo "Print version using version flag"
/floodgate/bin/floodgate --version
echo "Print version using version command"
/floodgate/bin/floodgate version
echo "Comare changes - clean Spinnaker"
/floodgate/bin/floodgate -q --config ~/floodgate.yaml compare && exit 1 || echo "Found changes"
echo "Apply local resources"
/floodgate/bin/floodgate -q --config ~/floodgate.yaml sync
echo "Compare changes - synced resources"
/floodgate/bin/floodgate -q --config ~/floodgate.yaml compare

Print version using version flag
version 0.3.0-pull/126
Print version using version command
Version:		0.3.0-pull/126
Gate API version:	1.21.x
Go version:		1.14.4
Git commit:		9099505e23301e5e55cdf1dfe00f645ea0d0f806
Built:			2020-10-05_20:25:28
Comare changes - clean Spinnaker
FATA[0007] unexpected end of JSON input                 
Found changes
Apply local resources
Compare changes - synced resources

CircleCI received exit code 0

When there is such error Floodgate should exit with different code than 1 because 1 is used when there is difference between local and remote state.

@mertsaygi
Copy link
Contributor

Also both of the JSONs' valid in this case. Local and remote

@boscard
Copy link
Contributor Author

boscard commented Oct 14, 2020

I think that we can implement something similar to this https://golang.org/pkg/os/#pkg-variables

@mertsaygi
Copy link
Contributor

Could you please check this PR? I tried to find a different solution for this issue:

#126

@boscard boscard linked a pull request Nov 3, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants