pkg/types: move column template registration into init() instead of the manually called Init(nodeName)
@@ -25,9 +25,7 @@ type EventType string
var node string
-func Init(nodeName string) {
- node = nodeName
-
+func init() {
// Register column templates
columns.MustRegisterTemplate("comm", "maxWidth:16")
columns.MustRegisterTemplate("pid", "minWidth:7")
@@ -40,6 +38,10 @@ func Init(nodeName string) {
columns.MustRegisterTemplate("ipport", "minWidth:type")
}
+func Init(nodeName string) {
+ node = nodeName
+}
+
type CommonData struct {
// Node where the event comes from
Node string `json:"node,omitempty" column:"node,width:30,ellipsis:middle" columnTags:"kubernetes"`
