1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-16 06:59:25 +00:00

add comments and other minor improvements

This commit is contained in:
Jiaqi Luo
2022-11-22 11:04:42 -07:00
parent 4741eb8fb1
commit b183dd71ce
4 changed files with 13 additions and 8 deletions

View File

@@ -412,15 +412,15 @@ func parseEventRateLimit(clusterFile string, rkeConfig *v3.RancherKubernetesEngi
return nil
}
logrus.Debugf("event rate limit is found in cluster.yml")
var r map[string]interface{}
err := ghodssyaml.Unmarshal([]byte(clusterFile), &r)
var parsedClusterFile map[string]interface{}
err := ghodssyaml.Unmarshal([]byte(clusterFile), &parsedClusterFile)
if err != nil {
return fmt.Errorf("error unmarshalling: %v", err)
}
if r["services"] == nil {
if parsedClusterFile["services"] == nil {
return nil
}
cfg, found, err := unstructured.NestedMap(r, "services", "kube-api", "event_rate_limit", "configuration")
cfg, found, err := unstructured.NestedMap(parsedClusterFile, "services", "kube-api", "event_rate_limit", "configuration")
if err != nil {
return err
}