Skip to content

Commit

Permalink
Merge branch 'main' into node-density-udn
Browse files Browse the repository at this point in the history
  • Loading branch information
rsevilla87 authored Sep 18, 2024
2 parents 283eeb4 + 466287d commit ec18ef7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ linters:
- goimports
- dupl
- unparam
- revive
- staticcheck
- gosimple
- unconvert
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
repos:
- repo: https://github.com/golangci/golangci-lint
rev: v1.58.1
rev: v1.60.3
hooks:
- id: golangci-lint
entry: golangci-lint run
args: [--timeout=5m]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.34.0
Expand Down
2 changes: 1 addition & 1 deletion cluster_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func clusterImageRegistryCheck(clientset kubernetes.Interface) bool {
return false
}
if deployment.Status.AvailableReplicas > 0 {
log.Debugf("Deployment image-regsitry in namespace openshift-image-registry is available with %d replicas", deployment.Status.AvailableReplicas)
log.Debugf("Deployment image-registry in namespace openshift-image-registry is available with %d replicas", deployment.Status.AvailableReplicas)
return true
}
return false
Expand Down
6 changes: 2 additions & 4 deletions egressip.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,18 @@ func getFirstUsableAddr(cidr string) uint32 {
baseAddrInt, err := ipconv.IPv4ToInt(firstUsableIP)
if err != nil {
log.Fatal("Error converting IP to int: ", err)
os.Exit(1)
}
return baseAddrInt
}

// egress IPs and node IPs will be in same cidr. So we need to exclude node IPs from CIDR to generate list of avaialble egress IPs.
// egress IPs and node IPs will be in same cidr. So we need to exclude node IPs from CIDR to generate list of available egress IPs.
func generateEgressIPs(numJobIterations int, addressesPerIteration int, externalServerIP string) {

nodeIPs, egressIPCidr := getEgressIPCidrNodeIPs()
// Add external server ip to nodeIPs to get excluded while creating egress ip list
nodeIPs = append(nodeIPs, externalServerIP)
baseAddrInt := getFirstUsableAddr(egressIPCidr)
// list to host avaialble egress IPs
// list to host available egress IPs
addrSlice := make([]string, 0, (numJobIterations * addressesPerIteration))

// map to store nodeIPs
Expand All @@ -123,7 +122,6 @@ func generateEgressIPs(numJobIterations int, addressesPerIteration int, external
nodeipuint32, err := ipconv.IPv4ToInt(net.ParseIP(nodeip))
if err != nil {
log.Fatal("Error: ", err)
os.Exit(1)
}
nodeMap[nodeipuint32] = true
}
Expand Down
20 changes: 10 additions & 10 deletions index.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
package ocp

import (
"encoding/json"
"fmt"
"os"
"strings"
"encoding/json"
"time"
"fmt"

"github.com/cloud-bulldozer/go-commons/indexers"
"github.com/cloud-bulldozer/go-commons/version"
ocpmetadata "github.com/cloud-bulldozer/go-commons/ocp-metadata"
"github.com/kube-burner/kube-burner/pkg/config"
"github.com/cloud-bulldozer/go-commons/version"
"github.com/kube-burner/kube-burner/pkg/burner"
"github.com/kube-burner/kube-burner/pkg/config"
"github.com/kube-burner/kube-burner/pkg/prometheus"
"github.com/kube-burner/kube-burner/pkg/util/metrics"
"github.com/kube-burner/kube-burner/pkg/workloads"
Expand Down Expand Up @@ -133,17 +133,17 @@ func NewIndex(metricsEndpoint *string, ocpMetaAgent *ocpmetadata.Metadata) *cobr
break
}
jobSummary := burner.JobSummary{
Timestamp: time.Unix(start, 0).UTC(),
Timestamp: time.Unix(start, 0).UTC(),
EndTimestamp: time.Unix(end, 0).UTC(),
ElapsedTime: time.Unix(end, 0).UTC().Sub(time.Unix(start, 0).UTC()).Round(time.Second).Seconds(),
UUID: uuid,
ElapsedTime: time.Unix(end, 0).UTC().Sub(time.Unix(start, 0).UTC()).Round(time.Second).Seconds(),
UUID: uuid,
JobConfig: config.Job{
Name: jobName,
},
Metadata: metricsScraper.Metadata,
Metadata: metricsScraper.Metadata,
MetricName: "jobSummary",
Version: fmt.Sprintf("%v@%v", version.Version, version.GitCommit),
Passed: rc == 0,
Version: fmt.Sprintf("%v@%v", version.Version, version.GitCommit),
Passed: rc == 0,
}
burner.IndexJobSummary([]burner.JobSummary{jobSummary}, indexerValue)
},
Expand Down

0 comments on commit ec18ef7

Please sign in to comment.