From dcd7294dabbdde418806563a12169db8ca2aceff Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Thu, 23 Dec 2021 12:34:16 +0100 Subject: [PATCH 01/14] [HEL-1430]: Add release name for cronjob to support multiple helm releases --- helm/leanix-k8s-connector/templates/clusterrole.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/leanix-k8s-connector/templates/clusterrole.yaml b/helm/leanix-k8s-connector/templates/clusterrole.yaml index c156d4fe..2a8aadd7 100644 --- a/helm/leanix-k8s-connector/templates/clusterrole.yaml +++ b/helm/leanix-k8s-connector/templates/clusterrole.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: leanix-k8s-connector + name: leanix-k8s-connector-{{ .Release.Name }} labels: {{ include "leanix-k8s-connector.labels" . | indent 4 }} rules: From 4e38766f138cd698915454b4cffb8856eed46d68 Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Thu, 23 Dec 2021 12:35:00 +0100 Subject: [PATCH 02/14] [HEL-1430]: Add release name for cronjob to support multiple helm releases --- helm/leanix-k8s-connector/templates/clusterrole.yaml | 2 +- helm/leanix-k8s-connector/templates/cronjob.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/helm/leanix-k8s-connector/templates/clusterrole.yaml b/helm/leanix-k8s-connector/templates/clusterrole.yaml index 2a8aadd7..c156d4fe 100644 --- a/helm/leanix-k8s-connector/templates/clusterrole.yaml +++ b/helm/leanix-k8s-connector/templates/clusterrole.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: leanix-k8s-connector-{{ .Release.Name }} + name: leanix-k8s-connector labels: {{ include "leanix-k8s-connector.labels" . | indent 4 }} rules: diff --git a/helm/leanix-k8s-connector/templates/cronjob.yaml b/helm/leanix-k8s-connector/templates/cronjob.yaml index ed3ee322..dc9bb464 100644 --- a/helm/leanix-k8s-connector/templates/cronjob.yaml +++ b/helm/leanix-k8s-connector/templates/cronjob.yaml @@ -1,7 +1,7 @@ apiVersion: batch/v1beta1 kind: CronJob metadata: - name: {{ include "leanix-k8s-connector.fullname" . }} + name: {{ include "leanix-k8s-connector.fullname" . }}-{{ .Release.Name }} namespace: {{ .Release.Namespace }} labels: {{ include "leanix-k8s-connector.labels" . | indent 4 }} @@ -18,7 +18,7 @@ spec: cluster-autoscaler.kubernetes.io/safe-to-evict: "true" spec: {{- if .Values.rbac }} - serviceAccountName: leanix-k8s-connector + serviceAccountName: leanix-k8s-connector-{{ .Release.Name }} {{- end }} containers: - name: connector From f248304a575415943f47e31abd755eec6544ec6b Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Thu, 23 Dec 2021 12:35:46 +0100 Subject: [PATCH 03/14] [HEL-1430]: Update CR, CRB and Service Account to support new release name --- helm/leanix-k8s-connector/templates/clusterrole.yaml | 2 +- helm/leanix-k8s-connector/templates/clusterrolebinding.yaml | 6 +++--- helm/leanix-k8s-connector/templates/serviceaccount.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/helm/leanix-k8s-connector/templates/clusterrole.yaml b/helm/leanix-k8s-connector/templates/clusterrole.yaml index c156d4fe..2a8aadd7 100644 --- a/helm/leanix-k8s-connector/templates/clusterrole.yaml +++ b/helm/leanix-k8s-connector/templates/clusterrole.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: leanix-k8s-connector + name: leanix-k8s-connector-{{ .Release.Name }} labels: {{ include "leanix-k8s-connector.labels" . | indent 4 }} rules: diff --git a/helm/leanix-k8s-connector/templates/clusterrolebinding.yaml b/helm/leanix-k8s-connector/templates/clusterrolebinding.yaml index 9e7d8127..4aa77b4d 100644 --- a/helm/leanix-k8s-connector/templates/clusterrolebinding.yaml +++ b/helm/leanix-k8s-connector/templates/clusterrolebinding.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: leanix-k8s-connector + name: leanix-k8s-connector-{{ .Release.Name }} labels: {{ include "leanix-k8s-connector.labels" . | indent 4 }} roleRef: @@ -17,7 +17,7 @@ subjects: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: leanix-k8s-connector-view + name: leanix-k8s-connector-view-{{ .Release.Name }} labels: {{ include "leanix-k8s-connector.labels" . | indent 4 }} roleRef: @@ -26,6 +26,6 @@ roleRef: name: view subjects: - kind: ServiceAccount - name: leanix-k8s-connector + name: leanix-k8s-connector-{{ .Release.Name }} namespace: {{ .Release.Namespace }} {{- end -}} \ No newline at end of file diff --git a/helm/leanix-k8s-connector/templates/serviceaccount.yaml b/helm/leanix-k8s-connector/templates/serviceaccount.yaml index 476dac51..d3e1c296 100644 --- a/helm/leanix-k8s-connector/templates/serviceaccount.yaml +++ b/helm/leanix-k8s-connector/templates/serviceaccount.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: leanix-k8s-connector + name: leanix-k8s-connector-{{ .Release.Name }} namespace: {{ .Release.Namespace }} labels: {{ include "leanix-k8s-connector.labels" . | indent 4 }} From 6427a62d80c0754d825c5791e43d59ecdfdc7d72 Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Thu, 23 Dec 2021 12:38:14 +0100 Subject: [PATCH 04/14] [HEL-1430]: Bump up the chart version --- helm/leanix-k8s-connector/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/leanix-k8s-connector/Chart.yaml b/helm/leanix-k8s-connector/Chart.yaml index 07166a2d..8b9013a3 100644 --- a/helm/leanix-k8s-connector/Chart.yaml +++ b/helm/leanix-k8s-connector/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v1 appVersion: "6.1.0" description: Retrieves information from Kubernetes cluster name: leanix-k8s-connector -version: 6.1.0 +version: 6.2.0 From 786a54c02a78db31a076e3226ee32c61e3658902 Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Thu, 23 Dec 2021 14:41:30 +0100 Subject: [PATCH 05/14] [HEL-1430]: bumped up app version and added kubeversion --- helm/leanix-k8s-connector/Chart.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helm/leanix-k8s-connector/Chart.yaml b/helm/leanix-k8s-connector/Chart.yaml index 8b9013a3..b5b32e38 100644 --- a/helm/leanix-k8s-connector/Chart.yaml +++ b/helm/leanix-k8s-connector/Chart.yaml @@ -1,5 +1,6 @@ apiVersion: v1 -appVersion: "6.1.0" +appVersion: "6.2.0" description: Retrieves information from Kubernetes cluster name: leanix-k8s-connector version: 6.2.0 +kubeVersion: '>= 1.19.0-0' \ No newline at end of file From 7bf95c0cfdb1743f39c981e8595da22a92592d80 Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Thu, 23 Dec 2021 14:41:57 +0100 Subject: [PATCH 06/14] [HEL-1430]: updated helm index --- helm/index.yaml | 34 ++++++++++++++++++---------- helm/leanix-k8s-connector-6.2.0.tgz | Bin 0 -> 2950 bytes 2 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 helm/leanix-k8s-connector-6.2.0.tgz diff --git a/helm/index.yaml b/helm/index.yaml index 88388fd2..8bd495b2 100644 --- a/helm/index.yaml +++ b/helm/index.yaml @@ -1,9 +1,19 @@ apiVersion: v1 entries: leanix-k8s-connector: + - apiVersion: v1 + appVersion: 6.2.0 + created: "2021-12-23T14:40:59.713818+01:00" + description: Retrieves information from Kubernetes cluster + digest: 5774478e89bc749ba21ec7f2477bb348788f2bbf6e8b76956eee5c4739de9e46 + kubeVersion: '>= 1.19.0-0' + name: leanix-k8s-connector + urls: + - leanix-k8s-connector-6.2.0.tgz + version: 6.2.0 - apiVersion: v1 appVersion: 6.1.0 - created: "2021-12-08T12:06:19.532135+01:00" + created: "2021-12-23T14:40:59.711566+01:00" description: Retrieves information from Kubernetes cluster digest: eabf3e49a9d4a0722228cb24872e6dfcc7b9db6b764bc714a74c0941f0d3ea4f name: leanix-k8s-connector @@ -12,7 +22,7 @@ entries: version: 6.1.0 - apiVersion: v1 appVersion: 6.0.3 - created: "2021-12-08T12:06:19.529601+01:00" + created: "2021-12-23T14:40:59.710467+01:00" description: Retrieves information from Kubernetes cluster digest: 5f1be6a80fc173d45ca60f5da8937abc0fcb2cc14652d6149d9ff2e405568a71 name: leanix-k8s-connector @@ -21,7 +31,7 @@ entries: version: 6.0.3 - apiVersion: v1 appVersion: 6.0.2 - created: "2021-12-08T12:06:19.528574+01:00" + created: "2021-12-23T14:40:59.709385+01:00" description: Retrieves information from Kubernetes cluster digest: ccd112d1de601bfa796c4413ddc2b394f93ec4b66604338a736593168523b327 name: leanix-k8s-connector @@ -30,7 +40,7 @@ entries: version: 6.0.2 - apiVersion: v1 appVersion: 6.0.1 - created: "2021-12-08T12:06:19.527459+01:00" + created: "2021-12-23T14:40:59.708288+01:00" description: Retrieves information from Kubernetes cluster digest: f3b959e24bdbf55314fa6d0a05681ec41dd34b1493b026a3450bf147e62a4b1b name: leanix-k8s-connector @@ -39,7 +49,7 @@ entries: version: 6.0.1 - apiVersion: v1 appVersion: 6.0.0 - created: "2021-12-08T12:06:19.521274+01:00" + created: "2021-12-23T14:40:59.70717+01:00" description: Retrieves information from Kubernetes cluster digest: c51f68b592c6f608a2f982e8c322280b8fc3aa4ac6ed0d823b2baf24b0877e6b name: leanix-k8s-connector @@ -48,7 +58,7 @@ entries: version: 6.0.0 - apiVersion: v1 appVersion: 5.0.0 - created: "2021-12-08T12:06:19.5199+01:00" + created: "2021-12-23T14:40:59.705136+01:00" description: Retrieves information from Kubernetes cluster digest: 549a753cf9875ca4eeaf5ecb5c64e76149b30bb8e82eee821f6c81cca27c37cf name: leanix-k8s-connector @@ -57,7 +67,7 @@ entries: version: 5.0.0 - apiVersion: v1 appVersion: 4.0.0 - created: "2021-12-08T12:06:19.516911+01:00" + created: "2021-12-23T14:40:59.704044+01:00" description: Retrieves information from Kubernetes cluster digest: adf5c8ef024857c4a0845a5c659f27bd7f21cdf568fff3445a192425c44fc9a8 name: leanix-k8s-connector @@ -66,7 +76,7 @@ entries: version: 4.0.0 - apiVersion: v1 appVersion: 3.0.0 - created: "2021-12-08T12:06:19.513995+01:00" + created: "2021-12-23T14:40:59.703176+01:00" description: Retrieves information from Kubernetes cluster digest: 2927aebc215a1c5175e986135e36a10101e90fa69e7ab22a183049d086f7eddb name: leanix-k8s-connector @@ -75,7 +85,7 @@ entries: version: 3.0.0 - apiVersion: v1 appVersion: 2.0.0 - created: "2021-12-08T12:06:19.512623+01:00" + created: "2021-12-23T14:40:59.702333+01:00" description: Retrieves information from Kubernetes cluster digest: 3481723d2374757038495117518c47f634054408ccbd55112a6260d5a15e18c9 name: leanix-k8s-connector @@ -84,7 +94,7 @@ entries: version: 2.0.0 - apiVersion: v1 appVersion: 2.0.0-beta7 - created: "2021-12-08T12:06:19.511567+01:00" + created: "2021-12-23T14:40:59.701445+01:00" description: Retrieves information from Kubernetes cluster digest: 0ade89d01236286f11ebf70290e2c4c82740fac11ec755be9dddd2375c74246f name: leanix-k8s-connector @@ -93,11 +103,11 @@ entries: version: 2.0.0-beta7 - apiVersion: v1 appVersion: 1.1.0 - created: "2021-12-08T12:06:19.51069+01:00" + created: "2021-12-23T14:40:59.700206+01:00" description: Retrieves information from Kubernetes cluster digest: aa3ee10eefe30e61e37058762b031bdee11cb9dd67afecdf6e831335d5c16e0f name: leanix-k8s-connector urls: - leanix-k8s-connector-1.0.0.tgz version: 1.0.0 -generated: "2021-12-08T12:06:19.508107+01:00" +generated: "2021-12-23T14:40:59.698587+01:00" diff --git a/helm/leanix-k8s-connector-6.2.0.tgz b/helm/leanix-k8s-connector-6.2.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..b24017074700b5676ebd2f9734a555ba3e7c183c GIT binary patch literal 2950 zcmV;13wiV(iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH*eavC|(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)Avr7?6qjWIBNyFWw$VNt- zV>XmG7|!eVANOH2Bb?kYm{#ZHta*6SKHYE$%>>E=&Zg^r%J}6`v-SGuuvk!NZ?z~3!fm!FwHP5^S|O6~0m73JPJV_bW5S^E zqOjEFuOY2kOrJkn63Zby)2w-Kh|kp;i-MFa)rGX^;*0q^P4i%HEzM~vClO5h1Ywdc z%Q?H@baQ8iwcLOH=G12LxE{BXChJ-z%hyCTS4lWF-bxksL$PViF3H^@p5?g^%fc)2 zTw=EZ+rX^y@y@<(F+xj>YW}KTslYixLD~0-3i+SydVTw${(C1-c49AP^z(diA#eIsIr}?G{M?Hq?01Ax`wxc5 zVmjbL;i%l(LBO0VE_GkpZgw z7a%H45+St$HAKc>z(fyXqQfEOgP%bnBbts860;kbwG$qBkAdUB{b=lIBC$^|F@g)K zhwy*T0_boy0l{rgBa+!~0HYiOFF5F)ceRk{J%;SU;k#BBA}W;^45+T!Pba Date: Thu, 23 Dec 2021 15:30:02 +0100 Subject: [PATCH 07/14] [HEL-1430]: support interfaces for logname append with the workspace id. seperate file name and extension for proper concatination --- pkg/storage/backend.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/storage/backend.go b/pkg/storage/backend.go index 7227fc3e..22c83ec2 100644 --- a/pkg/storage/backend.go +++ b/pkg/storage/backend.go @@ -11,15 +11,19 @@ const ( // FileStorage is a constant for the file storage identifier FileStorage string = "file" // LdifFileName is a constant for the file name used to store the ldif content - LdifFileName string = "kubernetes.ldif" + LdifFileName string = "kubernetes-" + // LdifFileExtension is a constant for Ldif file extension + LdifFileExtension string = ".ldf" // LogFileName is a constant for the file name used to store the log output - LogFileName string = "leanix-k8s-connector.log" + LogFileName string = "leanix-k8s-connector-" + // LogFileExtension is a constant for Log file extension + LogFileExtension string = ".log" ) // Backend exposes a common interface for all storage mechanisms type Backend interface { - UploadLdif(ldif []byte) error - UploadLog(log []byte) error + UploadLdif(ldif []byte, fileName string) error + UploadLog(log []byte, fileName string) error } // NewBackend create a new storage backend for the given storage backend type From c2ddcff10dcacb7ce2258d67619c3ad16b94887e Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Thu, 23 Dec 2021 15:30:27 +0100 Subject: [PATCH 08/14] [HEL-1430]: Implement interfaces with new logfile name append with workspace id --- pkg/storage/azureblob.go | 4 ++-- pkg/storage/localfile.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/storage/azureblob.go b/pkg/storage/azureblob.go index 40ad2a92..f90b0e88 100644 --- a/pkg/storage/azureblob.go +++ b/pkg/storage/azureblob.go @@ -51,7 +51,7 @@ func NewAzureBlob(azureOpts *AzureBlobOpts) (*AzureContainer, error) { } // Upload uploads the LDIF file to azure blob storage -func (u *AzureContainer) UploadLdif(ldif []byte) error { +func (u *AzureContainer) UploadLdif(ldif []byte, LdifFileName string) error { err := u.uploadFile(LdifFileName, ldif) if err != nil { return err @@ -61,7 +61,7 @@ func (u *AzureContainer) UploadLdif(ldif []byte) error { } // Upload uploads the log file to azure blob storage -func (u *AzureContainer) UploadLog(log []byte) error { +func (u *AzureContainer) UploadLog(log []byte, LogFileName string) error { err := u.uploadFile(LogFileName, log) if err != nil { return err diff --git a/pkg/storage/localfile.go b/pkg/storage/localfile.go index 20d25bb7..785d9ad2 100644 --- a/pkg/storage/localfile.go +++ b/pkg/storage/localfile.go @@ -33,7 +33,7 @@ func NewLocalFile(path string) (*LocalFile, error) { } // Upload persists the ldif content in a local files -func (u *LocalFile) UploadLdif(ldif []byte) error { +func (u *LocalFile) UploadLdif(ldif []byte, LdifFileName string) error { err := ioutil.WriteFile(path.Join(u.Path, LdifFileName), ldif, 0644) if err != nil { return err @@ -42,7 +42,7 @@ func (u *LocalFile) UploadLdif(ldif []byte) error { } // Upload persists the the log file content in a local files -func (u *LocalFile) UploadLog(log []byte) error { +func (u *LocalFile) UploadLog(log []byte, LogFileName string) error { err := ioutil.WriteFile(path.Join(u.Path, LogFileName), log, 0644) if err != nil { return err From 751d7e2c07a56307a2fa89211698fe5cc2853316 Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Thu, 23 Dec 2021 15:31:00 +0100 Subject: [PATCH 09/14] [HEL-1430]: Adapted the new implementation for ldif and log file names --- cmd/leanix-k8s-connector/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/leanix-k8s-connector/main.go b/cmd/leanix-k8s-connector/main.go index 1e8e412a..b4695640 100644 --- a/cmd/leanix-k8s-connector/main.go +++ b/cmd/leanix-k8s-connector/main.go @@ -275,7 +275,7 @@ func main() { _, err = leanix.UpdateFailedProgressStatus(startResponse.ProgressCallbackUrl, "Failed to create uploader for backend storage") log.Fatal(err) } - err = uploader.UploadLdif(ldifByte) + err = uploader.UploadLdif(ldifByte, storage.LdifFileName+viper.GetString(lxWorkspaceFlag)+storage.LdifFileExtension) if err != nil { log.Fatal(err) _, err := leanix.UpdateFailedProgressStatus(startResponse.ProgressCallbackUrl, "Failed to upload ldif to backend storage configured storage backend - "+viper.GetString("storage-backend")) @@ -285,7 +285,7 @@ func main() { } log.Info("Uploading log file to configured backend storage") - err = uploader.UploadLog(debugLogBuffer.Bytes()) + err = uploader.UploadLog(debugLogBuffer.Bytes(), storage.LogFileName+viper.GetString(lxWorkspaceFlag)+storage.LogFileExtension) if err != nil { log.Fatal(err) } From 86ba47da2da836574e3f81f7e527c711a3e10a42 Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Tue, 28 Dec 2021 09:39:41 +0100 Subject: [PATCH 10/14] [HEL-1430]: Add proper role and SA for CRB --- helm/leanix-k8s-connector/templates/clusterrolebinding.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/leanix-k8s-connector/templates/clusterrolebinding.yaml b/helm/leanix-k8s-connector/templates/clusterrolebinding.yaml index 4aa77b4d..11eb07ed 100644 --- a/helm/leanix-k8s-connector/templates/clusterrolebinding.yaml +++ b/helm/leanix-k8s-connector/templates/clusterrolebinding.yaml @@ -8,10 +8,10 @@ metadata: roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: leanix-k8s-connector + name: leanix-k8s-connector-{{ .Release.Name }} subjects: - kind: ServiceAccount - name: leanix-k8s-connector + name: leanix-k8s-connector-{{ .Release.Name }} namespace: {{ .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 From f89a1b57c25c3178939f0a3a3effbde688e07edb Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Tue, 28 Dec 2021 09:40:16 +0100 Subject: [PATCH 11/14] [HEL-1430]: to keep the extension naming consistent w.r.t PC changing it to .ldif.json --- pkg/storage/backend.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/storage/backend.go b/pkg/storage/backend.go index 22c83ec2..f9c7d9ec 100644 --- a/pkg/storage/backend.go +++ b/pkg/storage/backend.go @@ -13,7 +13,7 @@ const ( // LdifFileName is a constant for the file name used to store the ldif content LdifFileName string = "kubernetes-" // LdifFileExtension is a constant for Ldif file extension - LdifFileExtension string = ".ldf" + LdifFileExtension string = ".ldf.json" // LogFileName is a constant for the file name used to store the log output LogFileName string = "leanix-k8s-connector-" // LogFileExtension is a constant for Log file extension From c0612cc9850a9e1844fbf9014b7e79e6151165fd Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Thu, 30 Dec 2021 11:24:08 +0100 Subject: [PATCH 12/14] [HEL-1430]: keep the extension same as PC --- pkg/storage/backend.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/storage/backend.go b/pkg/storage/backend.go index f9c7d9ec..1dd5b7c1 100644 --- a/pkg/storage/backend.go +++ b/pkg/storage/backend.go @@ -13,7 +13,7 @@ const ( // LdifFileName is a constant for the file name used to store the ldif content LdifFileName string = "kubernetes-" // LdifFileExtension is a constant for Ldif file extension - LdifFileExtension string = ".ldf.json" + LdifFileExtension string = ".ldif.json" // LogFileName is a constant for the file name used to store the log output LogFileName string = "leanix-k8s-connector-" // LogFileExtension is a constant for Log file extension From 9d883107fa3604241720595d2420648313070827 Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Mon, 3 Jan 2022 11:42:24 +0100 Subject: [PATCH 13/14] Bump up version to 6.2.0 and Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d3c0c66..5267ccc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # LeanIX Kubernetes Connector Changelog +## Release 2022-01-03 - 6.2.0 +* To ensure support for multiple helm release on same cluster, all the existing K8s workloads are suffixed with the Helm release name. +* Support multiple workspace ID for same cluster via different helm releases + ## Release 2021-12-08 - 6.1.0 * Breaking changes! Follow the below migration docs to upgrade from 6.0.3 to 6.1.0 From 9cf24104a320d2d549f4f60c03e346928b526887 Mon Sep 17 00:00:00 2001 From: Sudharma Puranik Date: Mon, 3 Jan 2022 11:42:36 +0100 Subject: [PATCH 14/14] bumpup version to 6.2.0 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e9aadbd0..9996fe70 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ PROJECT ?= leanix-k8s-connector DOCKER_NAMESPACE ?= leanixacrpublic.azurecr.io -VERSION := 6.1.0 +VERSION := 6.2.0 FULL_VERSION := $(VERSION)-$(shell git describe --tags --always) IMAGE := $(DOCKER_NAMESPACE)/$(PROJECT):$(VERSION)