diff --git a/pkg/burner/create.go b/pkg/burner/create.go index 5c1d88bfe..b5b77e08b 100644 --- a/pkg/burner/create.go +++ b/pkg/burner/create.go @@ -111,6 +111,7 @@ func (ex *Executor) RunCreateJob() { log.Infof("Burst: %v", RestConfig.Burst) } dynamicClient = dynamic.NewForConfigOrDie(RestConfig) + log.Infof("Running job %s", ex.Config.Name) if !ex.Config.NamespacedIterations { ns = ex.Config.Namespace nsLabels["name"] = ns @@ -220,10 +221,8 @@ func createRequest(gvr schema.GroupVersionResource, ns string, obj *unstructured } else if errors.IsAlreadyExists(err) { log.Errorf("%s/%s in namespace %s already exists", obj.GetKind(), obj.GetName(), ns) return true, nil - } else if errors.IsTimeout(err) { - log.Errorf("Timeout creating object %s/%s in namespace %s: %s", obj.GetKind(), obj.GetName(), ns, err) } else if err != nil { - log.Errorf("Error creating object: %s", err) + log.Errorf("Error creating object %s/%s in namespace %s: %s", obj.GetKind(), obj.GetName(), ns, err) } log.Error("Retrying object creation") return false, nil diff --git a/pkg/burner/namespaces.go b/pkg/burner/namespaces.go index b7bc94cfe..da3e84b0b 100644 --- a/pkg/burner/namespaces.go +++ b/pkg/burner/namespaces.go @@ -51,9 +51,9 @@ func createNamespace(clientset *kubernetes.Clientset, namespaceName string, nsLa // CleanupNamespaces deletes namespaces with the given selector func CleanupNamespaces(clientset *kubernetes.Clientset, s *util.Selector) { - log.Infof("Deleting namespaces with label %s", s.LabelSelector) ns, _ := clientset.CoreV1().Namespaces().List(context.TODO(), s.ListOptions) if len(ns.Items) > 0 { + log.Infof("Deleting namespaces with label %s", s.LabelSelector) for _, ns := range ns.Items { err := clientset.CoreV1().Namespaces().Delete(context.TODO(), ns.Name, metav1.DeleteOptions{}) if errors.IsNotFound(err) { diff --git a/pkg/util/template.go b/pkg/util/template.go index 1f2e0570e..f990a29f0 100644 --- a/pkg/util/template.go +++ b/pkg/util/template.go @@ -73,11 +73,11 @@ func RenderTemplate(original []byte, inputData interface{}, options templateOpti } t, err := template.New("").Option(string(options)).Funcs(funcMap).Parse(string(original)) if err != nil { - return nil, fmt.Errorf("Parsing error: %s", err) + return nil, fmt.Errorf("parsing error: %s", err) } err = t.Execute(&rendered, inputData) if err != nil { - return nil, fmt.Errorf("Rendering error: %s", err) + return nil, fmt.Errorf("rendering error: %s", err) } return rendered.Bytes(), nil } diff --git a/pkg/util/url_reader.go b/pkg/util/url_reader.go index 9c955d9a3..2df70d88f 100644 --- a/pkg/util/url_reader.go +++ b/pkg/util/url_reader.go @@ -30,7 +30,7 @@ func ReadConfig(configFile string) (io.Reader, error) { f, err := os.Open(configFile) // If the template file does not exist we try to read it from an URL if os.IsNotExist(err) { - log.Infof("File %s not found, falling back to read from URL", configFile) + log.Debugf("File %s not found, falling back to read from URL", configFile) f, err = readURL(configFile, f) } return f, err @@ -50,7 +50,7 @@ func readURL(stringURL string, body io.Reader) (io.Reader, error) { return body, err } if r.StatusCode != http.StatusOK { - return body, fmt.Errorf("Error requesting %s: %d", u, r.StatusCode) + return body, fmt.Errorf("error requesting %s: %d", u, r.StatusCode) } return r.Body, nil }