Skip to content

Commit c0683a2

Browse files
committed
code linting
1 parent 5a8a380 commit c0683a2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/outputs/k8s-configmap.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ func setupOutputK8SConfigMap(namespace, configMapName string) (*OutputK8SConfigM
5151

5252
// WriteOutput writes data to a Kubernetes ConfigMap
5353
func (o *OutputK8SConfigMap) WriteOutput(data interface{}) (err error) {
54-
configMap, err := o.k8sClient.CoreV1().ConfigMaps(o.namespace).Get(o.configMapName, metav1.GetOptions{})
54+
var configMap *v1.ConfigMap
55+
_, err = o.k8sClient.CoreV1().ConfigMaps(o.namespace).Get(o.configMapName, metav1.GetOptions{})
5556
if err != nil {
5657
configMap = &v1.ConfigMap{
5758
TypeMeta: metav1.TypeMeta{
@@ -65,7 +66,7 @@ func (o *OutputK8SConfigMap) WriteOutput(data interface{}) (err error) {
6566
"targets.yml": "",
6667
},
6768
}
68-
configMap, err = o.k8sClient.CoreV1().ConfigMaps(o.namespace).Create(configMap)
69+
_, err = o.k8sClient.CoreV1().ConfigMaps(o.namespace).Create(configMap)
6970
if err != nil {
7071
return fmt.Errorf("failed to create configmap: %s", err)
7172
}
@@ -88,7 +89,7 @@ func (o *OutputK8SConfigMap) WriteOutput(data interface{}) (err error) {
8889
"targets.yml": string(c),
8990
},
9091
}
91-
configMap, err = o.k8sClient.CoreV1().ConfigMaps(o.namespace).Update(configMap)
92+
_, err = o.k8sClient.CoreV1().ConfigMaps(o.namespace).Update(configMap)
9293
if err != nil {
9394
return fmt.Errorf("failed to update configmap: %s", err)
9495
}

0 commit comments

Comments
 (0)