From a57a31a2531461ceb258460838de0cda7983bc13 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Fri, 23 Sep 2022 20:59:31 +0530 Subject: [PATCH 1/4] Add roundtripper to kubeconfig before creating kubeclient Signed-off-by: Nikhil --- cmd/rollouts-controller/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/rollouts-controller/main.go b/cmd/rollouts-controller/main.go index 401b579323..65a1374542 100644 --- a/cmd/rollouts-controller/main.go +++ b/cmd/rollouts-controller/main.go @@ -107,6 +107,9 @@ func newCommand() *cobra.Command { log.Infof("Using namespace %s", namespace) } + k8sRequestProvider := &metrics.K8sRequestsCountProvider{} + kubeclientmetrics.AddMetricsTransportWrapper(config, k8sRequestProvider.IncKubernetesRequest) + kubeClient, err := kubernetes.NewForConfig(config) checkError(err) argoprojClient, err := clientset.NewForConfig(config) @@ -154,8 +157,6 @@ func newCommand() *cobra.Command { configMapInformer := controllerNamespaceInformerFactory.Core().V1().ConfigMaps() secretInformer := controllerNamespaceInformerFactory.Core().V1().Secrets() - k8sRequestProvider := &metrics.K8sRequestsCountProvider{} - kubeclientmetrics.AddMetricsTransportWrapper(config, k8sRequestProvider.IncKubernetesRequest) mode, err := ingressutil.DetermineIngressMode(ingressVersion, kubeClient.DiscoveryClient) checkError(err) ingressWrapper, err := ingressutil.NewIngressWrapper(mode, kubeClient, kubeInformerFactory) From 715d2297658bbe7cc8354150dd5e939b3f138038 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Fri, 23 Sep 2022 21:01:24 +0530 Subject: [PATCH 2/4] Check if k8sRequestsCount is nil before attempting increase Signed-off-by: Nikhil --- controller/metrics/client.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controller/metrics/client.go b/controller/metrics/client.go index f2e2624d20..60082ed866 100644 --- a/controller/metrics/client.go +++ b/controller/metrics/client.go @@ -35,7 +35,8 @@ func (m *K8sRequestsCountProvider) IncKubernetesRequest(resourceInfo kubeclientm name = "Unknown" kind = "Unknown" } - - m.k8sRequestsCount.WithLabelValues(kind, namespace, name, string(resourceInfo.Verb), statusCode).Inc() + if m.k8sRequestsCount!=nil{ + m.k8sRequestsCount.WithLabelValues(kind, namespace, name, string(resourceInfo.Verb), statusCode).Inc() + } return nil } From f8726b48f19a9eca92b0348090cb9c6bde52f1d9 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Fri, 23 Sep 2022 21:04:06 +0530 Subject: [PATCH 3/4] Added Flipkart to Users.md Signed-off-by: Nikhil --- USERS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/USERS.md b/USERS.md index 2624cfa9fb..cf71cd3507 100644 --- a/USERS.md +++ b/USERS.md @@ -13,6 +13,7 @@ Organizations below are **officially** using Argo Rollouts. Please send a PR wit 1. [Databricks](https://github.com/databricks) 1. [Devtron Labs](https://github.com/devtron-labs/devtron) 1. [Farfetch](https://www.farfetch.com/) +1. [Flipkart](https://flipkart.com) 1. [Gllue](https://gllue.com) 1. [Ibotta](https://home.ibotta.com/) 1. [Intuit](https://www.intuit.com/) From 0deaef62961c6db443eb1436efecb49fe1e69bb3 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Fri, 23 Sep 2022 21:40:10 +0530 Subject: [PATCH 4/4] gofmt controller/metrics/client.go Signed-off-by: Nikhil --- controller/metrics/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/metrics/client.go b/controller/metrics/client.go index 60082ed866..01367745ef 100644 --- a/controller/metrics/client.go +++ b/controller/metrics/client.go @@ -35,7 +35,7 @@ func (m *K8sRequestsCountProvider) IncKubernetesRequest(resourceInfo kubeclientm name = "Unknown" kind = "Unknown" } - if m.k8sRequestsCount!=nil{ + if m.k8sRequestsCount != nil { m.k8sRequestsCount.WithLabelValues(kind, namespace, name, string(resourceInfo.Verb), statusCode).Inc() } return nil