Skip to content

Commit

Permalink
Merge branch 'main' into rg2-change-log
Browse files Browse the repository at this point in the history
# Conflicts:
#	cmd/collectors/zapi/plugins/aggregate/aggregate.go
#	pkg/dict/dict.go
#	pkg/matrix/instance.go
  • Loading branch information
rahulguptajss committed Oct 4, 2023
2 parents e9cfee9 + c8a6abe commit 218fc41
Show file tree
Hide file tree
Showing 195 changed files with 5,081 additions and 2,253 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
8 changes: 4 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build, Test, Lint License

env:
GO_VERSION: "1.21.0"
GO_VERSION: "1.21.1"

on:
push:
Expand All @@ -17,7 +17,7 @@ jobs:
govulncheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
Expand All @@ -27,7 +27,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
Expand All @@ -48,7 +48,7 @@ jobs:
if: '!github.event.deleted'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.21.0'
- uses: actions/checkout@v3
go-version: '1.21.1'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ ifeq ($(origin ci),undefined)
@echo make ci=/path/to/harvest.yml ci-local
@exit 1
endif
-@docker stop $$(docker ps -aq) 2>/dev/null || true
-@docker rm $$(docker ps -aq) 2>/dev/null || true
-@docker stop $$(docker ps -a --format '{{.ID}} {{.Names}}' | grep -E 'grafana|prometheus|poller') 2>/dev/null || true
-@docker rm $$(docker ps -a --format '{{.ID}} {{.Names}}' | grep -E 'grafana|prometheus|poller') 2>/dev/null || true
-@docker volume rm harvest_grafana_data harvest_prometheus_data 2>/dev/null || true
@if [ "$(ci)" != "harvest.yml" ]; then cp $(ci) harvest.yml; else echo "Source and destination files are the same, skipping copy"; fi
@./bin/harvest generate docker full --port --output harvest-compose.yml
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func doTLS(_ *cobra.Command, _ []string) {

func doAdmin(c *cobra.Command, _ []string) {
var configPath = c.Root().PersistentFlags().Lookup("config").Value.String()
err := conf.LoadHarvestConfig(configPath)
_, err := conf.LoadHarvestConfig(configPath)
if err != nil {
return
}
Expand Down
10 changes: 4 additions & 6 deletions cmd/collectors/collectorstest.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@ func JSONToGson(path string, flatten bool) []gjson.Result {
return nil
}
bb := b.Bytes()
output := gjson.GetManyBytes(bb, "records", "num_records", "_links.next.href")
output := gjson.ParseBytes(bb)
data := output.Get("records")
numRecords := output.Get("num_records")

data := output[0]
numRecords := output[1]
isNonIterRestCall := !data.Exists()

if isNonIterRestCall {
if !data.Exists() {
contentJSON := `{"records":[]}`
response, err := sjson.SetRawBytes([]byte(contentJSON), "records.-1", bb)
if err != nil {
Expand Down
17 changes: 8 additions & 9 deletions cmd/collectors/ems/ems_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,17 @@ func BookendEmsTest(t *testing.T, e *Ems) {
}

func NewEms() *Ems {
// homepath is harvest directory level
// homePath is harvest directory level
homePath := "../../../"
emsConfgPath := homePath + "conf/ems/default.yaml"
emsPoller := "testEms"
emsConfigPath := homePath + "conf/ems/default.yaml"

conf.TestLoadHarvestConfig("testdata/config.yml")
opts := options.Options{
Poller: emsPoller,
HomePath: homePath,
IsTest: true,
}
ac := collector.New("Ems", "Ems", &opts, emsParams(emsConfgPath), nil)
opts := options.New(options.WithConfPath(homePath + "conf"))
opts.Poller = "testEms"
opts.HomePath = homePath
opts.IsTest = true

ac := collector.New("Ems", "Ems", opts, emsParams(emsConfigPath), nil)
e := &Ems{}
if err := e.Init(ac); err != nil {
log.Fatal().Err(err).Send()
Expand Down
Loading

0 comments on commit 218fc41

Please sign in to comment.