Skip to content

Commit

Permalink
style: capitalize first word in log messages
Browse files Browse the repository at this point in the history
Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
  • Loading branch information
c3y1huang committed Apr 14, 2023
1 parent 62e31a9 commit c586511
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/manager/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (a *AgentDaemonSet) getDaemonSetName() string {

func (a *AgentDaemonSet) Create(image string, managerURL string) (*appsv1.DaemonSet, error) {
dsName := a.getDaemonSetName()
logrus.Debugf("creating daemonset %s with image %s", dsName, image)
logrus.Debugf("Creating daemonset %s with image %s", dsName, image)

// get manager pod for owner reference
labels := fmt.Sprintf("app=%s,%s=%s", types.SupportBundleManager, types.SupportBundleLabelKey, a.sbm.BundleName)
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewCluster(ctx context.Context, sbm *SupportBundleManager) *Cluster {
}

func (c *Cluster) GenerateClusterBundle(bundleDir string) (string, error) {
logrus.Debug("generating cluster bundle...")
logrus.Debug("Generating cluster bundle...")
namespace, err := c.sbm.k8s.GetNamespace(c.sbm.PodNamespace)
if err != nil {
return "", errors.Wrap(err, "cannot get deployed namespace")
Expand Down
4 changes: 2 additions & 2 deletions pkg/manager/collectors/harvester.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ func (module harvesterModule) toObj(b []byte, groupVersion, kind string, resourc
switch resource {
case "secrets":
currentItems, _ := jsonParsed.S("items").Data().([]interface{})
logrus.Debugf("whole items: %v", currentItems)
logrus.Debugf("Whole items: %v", currentItems)
var newItems []interface{}
for _, item := range currentItems {
gItem := gabs.Wrap(item)
if find := gItem.S("type").Data().(string) == "rke.cattle.io/machine-plan"; find {
logrus.Debugf("prepare to append item: %v", gItem.Data().(map[string]interface{}))
logrus.Debugf("Prepare to append item: %v", gItem.Data().(map[string]interface{}))
newItems = append(newItems, item)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/httpserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *HttpServer) createNodeBundle(w http.ResponseWriter, req *http.Request)
return
}

logrus.Debugf("handle create node bundle for %s", node)
logrus.Debugf("Handle create node bundle for %s", node)
nodesDir := filepath.Join(s.manager.getWorkingDir(), "nodes")
err := os.MkdirAll(nodesDir, os.FileMode(0775))
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (m *SupportBundleManager) Run() error {
m.status.SetPhase(phase.Name)
if err := phase.Run(); err != nil {
m.status.SetError(err.Error())
logrus.Errorf("failed to run phase %s: %s", phase.Name, err.Error())
logrus.Errorf("Failed to run phase %s: %s", phase.Name, err.Error())
break
}

Expand Down Expand Up @@ -210,7 +210,7 @@ func (m *SupportBundleManager) phaseCollectNodeBundles() error {
if err != nil {
// Ignore error here, since in some failure cases we might not receive all node bundles.
// A support bundle with partital data is also useful.
logrus.Error(err)
logrus.WithError(err).Error("Failed to collect node bundles")
}
return nil
}
Expand Down Expand Up @@ -295,15 +295,15 @@ func (m *SupportBundleManager) completeNode(node string) {

_, ok := m.expectedNodes[node]
if ok {
logrus.Debugf("complete node %s", node)
logrus.Debugf("Complete node %s", node)
delete(m.expectedNodes, node)
} else {
logrus.Warnf("complete an unknown node %s", node)
logrus.Warnf("Complete an unknown node %s", node)
}

if len(m.expectedNodes) == 0 {
if !m.done {
logrus.Debugf("all nodes are completed.")
logrus.Debugf("All nodes are completed")
m.ch <- struct{}{}
m.done = true
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/simulator/objects/process_node_zips.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func walkZipFiles(zipFile string) (*v1.Pod, *bundlekit.NodeConfig, error) {
}
nConfig.Spec = nodeConfigSpec
if len(containers) == 0 {
logrus.Warnf("no pod being created for node %s as zip file has no log files associated with this node", filepath.Base(nodeName[0]))
logrus.Warnf("No pod being created for node %s as zip file has no log files associated with this node", filepath.Base(nodeName[0]))
return nil, nConfig, nil
}
pod.Spec.Containers = containers
Expand Down

0 comments on commit c586511

Please sign in to comment.