diff --git a/.gitignore b/.gitignore index d6acaaa..fb5fb50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ dist/agent -.vscode/launch.json +.vscode/** diff --git a/internal/services/resourceupdatev2/client.go b/internal/services/resourceupdatev2/client.go index 2d7dd93..35f7b2c 100644 --- a/internal/services/resourceupdatev2/client.go +++ b/internal/services/resourceupdatev2/client.go @@ -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 { diff --git a/internal/services/resourceupdatev2/hashlist.go b/internal/services/resourceupdatev2/hashlist.go index 0d501e1..f5e1003 100644 --- a/internal/services/resourceupdatev2/hashlist.go +++ b/internal/services/resourceupdatev2/hashlist.go @@ -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 { @@ -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 { diff --git a/internal/services/resourceupdatev2/resourcecache.go b/internal/services/resourceupdatev2/resourcecache.go index edcbe86..57e55cd 100644 --- a/internal/services/resourceupdatev2/resourcecache.go +++ b/internal/services/resourceupdatev2/resourcecache.go @@ -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() } } diff --git a/internal/utils/ingress.go b/internal/utils/ingress.go index 4a293cb..d7ecba4 100644 --- a/internal/utils/ingress.go +++ b/internal/utils/ingress.go @@ -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) { diff --git a/v2/internal/agentconfig/variables.go b/v2/internal/agentconfig/variables.go index 51d7664..51b6980 100644 --- a/v2/internal/agentconfig/variables.go +++ b/v2/internal/agentconfig/variables.go @@ -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 diff --git a/v2/internal/services/resourceupdatev2/client.go b/v2/internal/services/resourceupdatev2/client.go index e5010b7..0d524d9 100644 --- a/v2/internal/services/resourceupdatev2/client.go +++ b/v2/internal/services/resourceupdatev2/client.go @@ -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 { diff --git a/v2/internal/services/resourceupdatev2/hashlist.go b/v2/internal/services/resourceupdatev2/hashlist.go index 06bf9bd..06ae82d 100644 --- a/v2/internal/services/resourceupdatev2/hashlist.go +++ b/v2/internal/services/resourceupdatev2/hashlist.go @@ -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 { @@ -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 { diff --git a/v2/internal/services/resourceupdatev2/resourcecache.go b/v2/internal/services/resourceupdatev2/resourcecache.go index 8813e5b..d40754c 100644 --- a/v2/internal/services/resourceupdatev2/resourcecache.go +++ b/v2/internal/services/resourceupdatev2/resourcecache.go @@ -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() } }