🔨 Fix the targetted typo

This commit is contained in:
M. Mert Yildiran
2023-01-08 21:44:12 +03:00
parent ac6aee07f5
commit eaa21f0789
7 changed files with 62 additions and 62 deletions

View File

@@ -116,22 +116,22 @@ func (connector *Connector) PostStorageLimitToHub(limit int64) {
}
}
func (connector *Connector) PostTargettedPodsToHub(pods []core.Pod) {
postTargettedUrl := fmt.Sprintf("%s/pods/targetted", connector.url)
func (connector *Connector) PostTargetedPodsToHub(pods []core.Pod) {
postTargetedUrl := fmt.Sprintf("%s/pods/targeted", connector.url)
if podsMarshalled, err := json.Marshal(pods); err != nil {
log.Error().Err(err).Msg("Failed to marshal the targetted pods:")
log.Error().Err(err).Msg("Failed to marshal the targeted pods:")
} else {
ok := false
for !ok {
if _, err = utils.Post(postTargettedUrl, "application/json", bytes.NewBuffer(podsMarshalled), connector.client); err != nil {
if _, err = utils.Post(postTargetedUrl, "application/json", bytes.NewBuffer(podsMarshalled), connector.client); err != nil {
if _, ok := err.(*url.Error); ok {
break
}
log.Debug().Err(err).Msg("Failed sending the targetted pods to Hub:")
log.Debug().Err(err).Msg("Failed sending the targeted pods to Hub:")
} else {
ok = true
log.Debug().Int("pod-count", len(pods)).Msg("Reported targetted pods to Hub:")
log.Debug().Int("pod-count", len(pods)).Msg("Reported targeted pods to Hub:")
}
time.Sleep(time.Second)
}