From 7ba0dd53bb57391db9d4adfd1191b6da02274414 Mon Sep 17 00:00:00 2001 From: devsingh <43881792+Kaaku2302@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:52:21 -0400 Subject: [PATCH] FOPTS-5007 Exit with error code in case of any failure in bill uploads (#52) * Update main.go if there is an error, exit * Running make generate Running make generate * Update version * Replace version from main * Fixing review comments * update --------- Co-authored-by: Davinder Singh --- CHANGELOG.md | 4 ++ helm-chart/Chart.yaml | 4 +- helm-chart/README.md | 4 +- .../cbi-oi-kubecost-exporter-1.19.0.tgz | Bin 0 -> 5415 bytes helm-chart/values.yaml | 2 +- index.yaml | 58 ++++++++++-------- main.go | 11 ++++ 7 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 helm-chart/cbi-oi-kubecost-exporter-1.19.0.tgz diff --git a/CHANGELOG.md b/CHANGELOG.md index 07c0b1f..9e3ee90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v1.19.0 + +- Exit with error code 1 in case of any failure during bill upload. + ## v1.18.0 - Changed the default schedule of the cronJob scheduler to run an export task to - Once in every 24 hours. diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml index f9d24ef..edd7310 100644 --- a/helm-chart/Chart.yaml +++ b/helm-chart/Chart.yaml @@ -6,10 +6,10 @@ description: Kubecost exporter helm chart for Kubernetes # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.18.0 +version: 1.19.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.18" +appVersion: "1.19" diff --git a/helm-chart/README.md b/helm-chart/README.md index 2e64964..4400013 100644 --- a/helm-chart/README.md +++ b/helm-chart/README.md @@ -1,6 +1,6 @@ # cbi-oi-kubecost-exporter -![Version: 1.18.0](https://img.shields.io/badge/Version-1.18.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.18](https://img.shields.io/badge/AppVersion-1.18-informational?style=flat-square) +![Version: 1.19.0](https://img.shields.io/badge/Version-1.19.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.19](https://img.shields.io/badge/AppVersion-1.19-informational?style=flat-square) ### Kubecost exporter helm chart for Kubernetes @@ -100,7 +100,7 @@ You should see 200/201s in the logs, which indicates that the exporter is workin | flexera.vendorName | string | `"Kubecost"` | Vendor name for the Bill Connect. It is used when CREATE_BILL_CONNECT_IF_NOT_EXIST is set to true. | | image.pullPolicy | string | `"Always"` | | | image.repository | string | `"public.ecr.aws/flexera/cbi-oi-kubecost-exporter"` | | -| image.tag | string | `"1.18"` | | +| image.tag | string | `"1.19"` | | | imagePullSecrets | list | `[]` | | | includePreviousMonth | bool | `false` | Indicates whether to collect and export previous month. | | kubecost.aggregation | string | `"pod"` | The level of granularity to use when aggregating the cost data. Valid values are namespace, controller, node, or pod. | diff --git a/helm-chart/cbi-oi-kubecost-exporter-1.19.0.tgz b/helm-chart/cbi-oi-kubecost-exporter-1.19.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..bebdb172a7c17c72defb80ee7e14dc353b48083c GIT binary patch literal 5415 zcmV+?71-(@iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH>ebKAJF_cQ;Bt=!Js`B~IQoTR6DX-Bb@M2#)`*^1lDwWC1f zN6cYtGCGzJtkxoKg5hn zaq|bL zKN#~CPa-7YKhz(LYjJS@PaYD}8{~qrs0GueL*h95v(j)IKUW+dg~w?u^}E+rP9T*N zm|zfsr-TJYjOzwGLW#nONQf<1C18%6#n=K8#{u<-g6>RH%nGqvcfL1o{u7>+>wiju z1jScT0PEL(qyDs6UtIr>>W%&S{}#^yoZ^Tifdn(*dJ(S@3fDP+{)7s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