Comments (9)
Fixed in pr, will be in the next release.
from goss.
Issue was due to a comment in vars.yaml
from goss.
If you don't mind, can you provide the exact vars.yaml
and goss.yaml
to reproduce this?
Goss should not panic, this is definitely a bug.
from goss.
Yes, sure! :)
Our vars.yaml
starts with:
domain_name: #DOMAIN#
k8s_version: 1.25
and then on a pipeline we replace #DOMAIN#
by a proper string, but when I was testing locally I forgot to change the value and that is why I got the segfault. Maybe it could be detected and show a proper error message when the variables are not well declared.
Thanks for looking into this, @aelsabbahy !
from goss.
Just following up on this, I think I'm doing something wrong while trying to reproduce, can you also provide the matching goss.yaml that causes it to panic.
$ cat vars.yaml
domain_name: #DOMAIN#
k8s_version: 1.25
$ cat goss.yaml
command:
echo "hi":
exit-status: 0
stdout:
- {{.Vars.domain_name}}
stderr: []
timeout: 10000
$ goss.3.18 --vars vars.yaml render
command:
echo "hi":
exit-status: 0
stdout:
- <no value>
stderr: []
timeout: 10000
$ goss.3.18 --vars vars.yaml v
.F
Failures/Skipped:
Command: echo "hi": stdout: patterns not found: [<no value>]
Total Duration: 0.002s
Count: 2, Failed: 1, Skipped: 0
from goss.
Sorry, I am also unable to reproduce with the previous goss.yaml
that caused the segfault. I think we can close it.
from goss.
It's okay, I have some theories on how it may have happened, but can't reproduce it.
I'll roll out those "fixes" in a future PR. We can leave the ticket open for that, I won't know for sure I fixed the problem, but should help.
Thank you for following back up.
from goss.
Got it again! It's related with the http
module:
$ ./goss --version
goss version v0.4.1
$ cat goss.yaml
http:
# Ensure argocd is available and redirected to HTTPS
http://argocd.mgmt.{{ .Vars.domain_name }}/:
status: 302
no-follow-redirects: true
headers:
- "Location: https://argocd"
$ cat vars.yaml
domain_name: #DOMAIN#
k8s_version: 1.25
$ ./goss -g goss.yaml --vars vars.yaml render
http:
http://argocd.mgmt.<no value>/:
status: 302
allow-insecure: false
no-follow-redirects: true
headers:
- 'Location: https://argocd'
$ ./goss -g goss.yaml --vars vars.yaml validate
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x7ac440]
goroutine 69 [running]:
github.com/goss-org/goss/system.(*DefHTTP).Status(0xc00012b380)
/home/travis/gopath/src/github.com/goss-org/goss/system/http.go:186 +0x40
github.com/goss-org/goss/resource.ValidateGomegaValue({_, _}, {_, _}, {_, _}, {_, _}, _)
/home/travis/gopath/src/github.com/goss-org/goss/resource/validate.go:160 +0x3f6
github.com/goss-org/goss/resource.ValidateValue({_, _}, {_, _}, {_, _}, {_, _}, _)
/home/travis/gopath/src/github.com/goss-org/goss/resource/validate.go:130 +0x195
github.com/goss-org/goss/resource.(*HTTP).Validate(0xc000460a20, 0xc000330370?)
/home/travis/gopath/src/github.com/goss-org/goss/resource/http.go:81 +0x305
github.com/goss-org/goss.validate.func2()
/home/travis/gopath/src/github.com/goss-org/goss/validate.go:184 +0x91
created by github.com/goss-org/goss.validate
/home/travis/gopath/src/github.com/goss-org/goss/validate.go:181 +0x190
Hope that with this new info you can fix it :)
from goss.
Awesome, I was able to reproduce it! Will fix it in the next goss release.. surprised not too many people ran into this.
from goss.
Related Issues (20)
- Write test report artifacts directly HOT 5
- install.sh: Install latest release HOT 1
- Remove Molecule from Community Contributions section in readme
- Set a custom user agent string for http checks HOT 4
- Unable to read the documentation HOT 6
- Use goss as a go package outside of the CLI HOT 2
- goss validate command does not print command output HOT 2
- Alternatives to Goss? HOT 2
- dgoss: Copy multiple files with `GOSS_FILES_PATH`
- How can we get goss working on AIX server HOT 1
- High severity CVE related with go stdlib version HOT 13
- goss.rocks/install redirects to "old" URL HOT 2
- Improve CI pipeline and integration tests HOT 16
- Is there a way to pass in a list as a variable? HOT 4
- yaml escaping seen as string and not boolean HOT 3
- Missing dgoss sha256 asset for release v0.4.7 HOT 3
- Can we add ansible galaxy goss install to README? HOT 2
- Semver package check did not work with alpine packages HOT 6
- Dgoss Error when Running tests /goss/goss: no such file or directory. HOT 2
- Final steps to new documentation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goss.