-
Notifications
You must be signed in to change notification settings - Fork 8
Add Get/Update methods for Properties API #11
Conversation
Why is new version required? Pick up fixes to specify custom ResponseDecoder
clients/splunk/properties.go
Outdated
|
|
||
| body := strings.NewReader(fmt.Sprintf("value=%s", value)) | ||
| resp, err := p.client.New().Post( | ||
| fmt.Sprintf("properties/%s/%s/%s", file, stanza, key)).Body(body).ResponseDecoder(stringResponseDecoder{}).Receive(nil, apiError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do the interpolated values need some kind of escaping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
clients/splunk/properties.go
Outdated
| apiError := &APIError{} | ||
| output := &Entry{} | ||
| resp, err := p.client.New().Get( | ||
| fmt.Sprintf("properties/%s/%s/%s", file, stanza, key)).ResponseDecoder(stringResponseDecoder{}).Receive(output, apiError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, see above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
| output := &Entry{} | ||
| resp, err := p.client.New().Get( | ||
| fmt.Sprintf("properties/%s/%s/%s", file, stanza, key)).ResponseDecoder(stringResponseDecoder{}).Receive(output, apiError) | ||
| if err != nil || !apiError.Empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, maybe we should make it such that we can check for exactly one condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will address these in a cleanup/refactor separate PR.
CI would fail with make test TESTREPORT=test-results/go/results.xml sed -e 's;@@gobin@@;/go/bin;g' < vault.hcl.in > vault.hcl mkdir -p test-results/go/ go clean -testcache go clean -testcache: open /tmp/go/cache/testexpire.txt: no such file or directory make: *** [Makefile:29: test] Error 1
| @test -n "$$SPLUNK_ADDR" || { echo 'warning: SPLUNK_ADDR not set, creating new Splunk instances. This will be slow.'; } | ||
| mkdir -p $(dir $(TESTREPORT)) | ||
| gotestsum --junitfile $(TESTREPORT) -- -cover -v ./... | ||
| go clean -testcache || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
env GOCACHE=off gotestsum...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkdir -p ./
env GOCACHE=off gotestsum --junitfile test-results.xml --format standard-verbose -- -cover -v ./...
build cache is disabled by GOCACHE=off, but required as of Go 1.12
=== Errors
build cache is disabled by GOCACHE=off, but required as of Go 1.12
DONE 0 tests, 1 error in 0.015s
make: *** [test] Error 1```
No description provided.