From 416e607f33ae4b29e55ee6fcec969811c1e391c7 Mon Sep 17 00:00:00 2001 From: Yuriy Losev Date: Fri, 13 Oct 2023 15:29:49 +0400 Subject: [PATCH] cleanup and client --- go.mod | 2 +- go.sum | 4 ++-- pkg/kube_events_manager/monitor_config.go | 25 ----------------------- 3 files changed, 3 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 2cc32364..a5c77039 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/flant/shell-operator go 1.19 require ( - github.com/flant/kube-client v0.26.2-0.20231011163110-aabf62d4e4fe + github.com/flant/kube-client v1.0.0 github.com/flant/libjq-go v1.6.3-0.20201126171326-c46a40ff22ee // branch: master github.com/go-chi/chi/v5 v5.0.10 github.com/go-openapi/spec v0.19.8 diff --git a/go.sum b/go.sum index 68b74dd6..cbd12524 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCv github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/flant/go-openapi-validate v0.19.12-flant.0 h1:xk6kvc9fHKMgUdB6J7kbpbLR5vJOUzKAK8p3nrD7mDk= github.com/flant/go-openapi-validate v0.19.12-flant.0/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4= -github.com/flant/kube-client v0.26.2-0.20231011163110-aabf62d4e4fe h1:obusY1s0gCLGNNUgqQUsJAXK6XRj3Ha2bh1b+k2lYEo= -github.com/flant/kube-client v0.26.2-0.20231011163110-aabf62d4e4fe/go.mod h1:YVcJ8PxomM0iYsK7nj2I3lmog2D0j/GloJfLYnhjlls= +github.com/flant/kube-client v1.0.0 h1:hoP0qB75cb3qQZw5N29rgPNhX3KC2MuxT/By3IkXxxc= +github.com/flant/kube-client v1.0.0/go.mod h1:YVcJ8PxomM0iYsK7nj2I3lmog2D0j/GloJfLYnhjlls= github.com/flant/libjq-go v1.6.3-0.20201126171326-c46a40ff22ee h1:evii83J+/6QGNvyf6tjQ/p27DPY9iftxIBb37ALJRTg= github.com/flant/libjq-go v1.6.3-0.20201126171326-c46a40ff22ee/go.mod h1:f+REaGl/+pZR97rbTcwHEka/MAipoQQ2Mc0iQUj4ak0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= diff --git a/pkg/kube_events_manager/monitor_config.go b/pkg/kube_events_manager/monitor_config.go index c7817001..5c33c957 100644 --- a/pkg/kube_events_manager/monitor_config.go +++ b/pkg/kube_events_manager/monitor_config.go @@ -81,25 +81,6 @@ func (c *MonitorConfig) WithFieldSelector(fieldSel *FieldSelector) { } } -// func (c *MonitorConfig) AddFieldSelectorRequirement(field string, op string, value string) { -// if c.FieldSelector == nil { -// c.FieldSelector = &FieldSelector{ -// MatchExpressions: []FieldSelectorRequirement{}, -// } -// } -// if c.FieldSelector.MatchExpressions == nil { -// c.FieldSelector.MatchExpressions = make([]FieldSelectorRequirement, 0) -// } -// -// req := FieldSelectorRequirement{ -// Field: field, -// Operator: op, -// Value: value, -// } -// -// c.FieldSelector.MatchExpressions = append(c.FieldSelector.MatchExpressions, req) -//} - // WithLabelSelector copies input LabelSelector into monitor.LabelSelector func (c *MonitorConfig) WithLabelSelector(labelSel *metav1.LabelSelector) { if labelSel != nil { @@ -110,12 +91,6 @@ func (c *MonitorConfig) WithLabelSelector(labelSel *metav1.LabelSelector) { } } -// func (c *MonitorConfig) IsAnyNamespace() bool { -// return c.NamespaceSelector == nil || -// (c.NamespaceSelector.NameSelector == nil && c.NamespaceSelector.LabelSelector == nil) || -// (c.NamespaceSelector.NameSelector != nil && len(c.NamespaceSelector.NameSelector.MatchNames) == 0) -//} - // names returns names of monitored objects if nameSelector.matchNames is defined in config. func (c *MonitorConfig) names() []string { res := make([]string, 0)