Skip to content

Commit

Permalink
fix go report card
Browse files Browse the repository at this point in the history
  • Loading branch information
havardelnan committed Nov 19, 2024
1 parent 385e8fa commit 1460e26
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dist/agent
.vscode/launch.json
.vscode/**
2 changes: 1 addition & 1 deletion internal/services/resourceupdatev2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/go-resty/resty/v2"
)

// the function sends the resource to the ror api. If recieving a non 2xx statuscode it will retun an error.
// the function sends the resource to the ror api. If receiving a non 2xx statuscode it will retun an error.
func sendResourceUpdateToRor(resourceUpdate *apiresourcecontracts.ResourceUpdateModel) error {
rorClient, err := clients.GetOrCreateRorClient()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/services/resourceupdatev2/hashlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (hl *hashList) markActive(uid string) {

}

// Returns a bool value of true if the resource need to be commited
// Returns a bool value of true if the resource need to be committed
func (rc hashList) checkUpdateNeeded(uid string, hash string) bool {
hashitem, _ := rc.getHashByUid(uid)
if hashitem.Hash == hash {
Expand All @@ -58,7 +58,7 @@ func (hl hashList) getHashByUid(uid string) (hashItem, int) {
return hashItem{}, 0
}

// updates hash in internal hashlist on update. The api will update its list on commiting the resource to its database.
// updates hash in internal hashlist on update. The api will update its list on committing the resource to its database.
func (hl *hashList) updateHash(uid string, hash string) {
_, i := hl.getHashByUid(uid)
if i != 0 {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/resourceupdatev2/resourcecache.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (rc resourcecache) addWorkqueScheduler(seconds int) {
}
func (rc resourcecache) runWorkqueScheduler() {
if rc.Workqueue.NeedToRun() {
rlog.Warn("resourceQue has non zero lenght", rlog.Int("resource que length", rc.Workqueue.ItemCount()))
rlog.Warn("resourceQue has non zero length", rlog.Int("resource que length", rc.Workqueue.ItemCount()))
rc.RunWorkQue()
}
}
Expand Down
5 changes: 1 addition & 4 deletions internal/utils/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ func GetIngressDetails(ingress *networkingV1.Ingress) (*apicontracts.Ingress, er
Rules: rules,
}

richIngress, err := GetIngressHealth(newIngress)

return richIngress, nil

return GetIngressHealth(newIngress)
}

func GetIngressHealth(thisIngress apicontracts.Ingress) (*apicontracts.Ingress, error) {
Expand Down
4 changes: 2 additions & 2 deletions v2/internal/agentconfig/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
// The version and commit are set to the default v1.1.0/FFFFF if not set at compile time
//
// The configuration variables are set to the default values if not set in the environment
// The enviroment variables required are:
// The environment variables required are:
// ROLE default value is ClusterAgent
// HEALTH_ENDPOINT default value is :8100
// POD_NAMESPACE default value is ror
// API_KEY_SECRET default value is ror-apikey
// API_KEY migt be provided by the user if a secret containg the api key is not present in the cluster
// API_KEY migt be provided by the user if a secret containing the api key is not present in the cluster
//

package agentconfig
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/services/resourceupdatev2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/go-resty/resty/v2"
)

// the function sends the resource to the ror api. If recieving a non 2xx statuscode it will retun an error.
// the function sends the resource to the ror api. If receiving a non 2xx statuscode it will retun an error.
func sendResourceUpdateToRor(resourceUpdate *apiresourcecontracts.ResourceUpdateModel) error {
rorClient, err := clients.GetOrCreateRorClient()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions v2/internal/services/resourceupdatev2/hashlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (hl *hashList) markActive(uid string) {

}

// Returns a bool value of true if the resource need to be commited
// Returns a bool value of true if the resource need to be committed
func (rc hashList) checkUpdateNeeded(uid string, hash string) bool {
hashitem, _ := rc.getHashByUid(uid)
if hashitem.Hash == hash {
Expand All @@ -92,7 +92,7 @@ func (hl hashList) getHashByUid(uid string) (hashItem, int) {
return hashItem{}, 0
}

// updates hash in internal hashlist on update. The api will update its list on commiting the resource to its database.
// updates hash in internal hashlist on update. The api will update its list on committing the resource to its database.
func (hl *hashList) updateHash(uid string, hash string) {
_, i := hl.getHashByUid(uid)
if i != 0 {
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/services/resourceupdatev2/resourcecache.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (rc *resourcecache) addWorkQeueScheduler(seconds int) {
}
func (rc *resourcecache) runWorkQeueScheduler() {
if rc.WorkQueue.NeedToRun() {
rlog.Warn("resourceQueue has non zero lenght", rlog.Int("resource Queue length", rc.WorkQueue.ItemCount()))
rlog.Warn("resourceQueue has non zero length", rlog.Int("resource Queue length", rc.WorkQueue.ItemCount()))
rc.RunWorkQeue()
}
}
Expand Down

0 comments on commit 1460e26

Please sign in to comment.