From d086d4d2dd32356ac871056a13ce5ee147a985af Mon Sep 17 00:00:00 2001 From: 7h3-3mp7y-m4n Date: Wed, 16 Oct 2024 03:48:55 +0530 Subject: [PATCH 01/10] added the remaining files to dockerignore Signed-off-by: 7h3-3mp7y-m4n --- .dockerignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index caae439..495ea57 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,4 +3,7 @@ !go.sum !.git/ !internal/ -!main.go/ \ No newline at end of file +!main.go +!main_init.go +!main_generate.go +!main_resources.go/ \ No newline at end of file From 87889b59849b63f789dfec8433e33137c6380f29 Mon Sep 17 00:00:00 2001 From: 7h3-3mp7y-m4n Date: Wed, 16 Oct 2024 04:01:02 +0530 Subject: [PATCH 02/10] added testing for docker image Signed-off-by: 7h3-3mp7y-m4n --- .github/workflows/ci.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 90e7180..46e0346 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,4 +33,10 @@ jobs: uses: docker/build-push-action@v6 with: context: . - push: false + push: false + load: true + tags: score-k8s:test + - name: Test docker image + run: | + docker run --rm -it score-k8s:test --version + docker run --rm -it score-k8s:test init From 24666a40a1bfa5efad61561b1a3a48c2fc4e59d2 Mon Sep 17 00:00:00 2001 From: 7h3-3mp7y-m4n Date: Wed, 16 Oct 2024 04:08:11 +0530 Subject: [PATCH 03/10] fixed ci.yaml Signed-off-by: 7h3-3mp7y-m4n --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 46e0346..56fdd4c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,5 +38,5 @@ jobs: tags: score-k8s:test - name: Test docker image run: | - docker run --rm -it score-k8s:test --version - docker run --rm -it score-k8s:test init + docker run --rm score-k8s:test --version + docker run --rm score-k8s:test init From 468ecd75fab8e9a610bcea26cb4ec4aae04bcb9b Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 16 Oct 2024 07:35:52 -0400 Subject: [PATCH 04/10] Update .github/workflows/ci.yaml Signed-off-by: Mathieu Benoit --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 56fdd4c..17b28ea 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,4 +39,5 @@ jobs: - name: Test docker image run: | docker run --rm score-k8s:test --version - docker run --rm score-k8s:test init + docker run -v .:/score-k8s --rm score-k8s:test init + cat score.yaml From 819d75d93f50de705e283202a69208e61d764286 Mon Sep 17 00:00:00 2001 From: 7h3-3mp7y-m4n Date: Wed, 16 Oct 2024 21:43:38 +0530 Subject: [PATCH 05/10] added go vet for testing Signed-off-by: 7h3-3mp7y-m4n --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 56fdd4c..04c4509 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,6 +17,8 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: 'go.mod' + - name: Run Go Vet + run: go vet ./... - name: Run Go Tests run: go test ./... -cover -race - name: Build binary @@ -39,4 +41,5 @@ jobs: - name: Test docker image run: | docker run --rm score-k8s:test --version - docker run --rm score-k8s:test init + docker run -v .:/score-k8s --rm score-k8s:test init + cat score.yaml From 4714a280398f588d06ce696c732c9444ff25a56f Mon Sep 17 00:00:00 2001 From: 7h3-3mp7y-m4n Date: Wed, 16 Oct 2024 21:54:54 +0530 Subject: [PATCH 06/10] properly keyed at contaier_files Signed-off-by: 7h3-3mp7y-m4n --- internal/convert/container_files.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/convert/container_files.go b/internal/convert/container_files.go index d98aa0a..ac516c8 100644 --- a/internal/convert/container_files.go +++ b/internal/convert/container_files.go @@ -92,7 +92,11 @@ func convertContainerFile( Name: mount.Name, VolumeSource: coreV1.VolumeSource{ ConfigMap: &coreV1.ConfigMapVolumeSource{ - Items: []coreV1.KeyToPath{{"file", filepath.Base(fileElem.Target), mountMode}}, + Items: []coreV1.KeyToPath{{ + Key: "file", + Path: filepath.Base(fileElem.Target), + Mode: mountMode, + }}, LocalObjectReference: coreV1.LocalObjectReference{Name: configMapName}, }, }, @@ -107,7 +111,10 @@ func convertContainerFile( VolumeSource: coreV1.VolumeSource{ Secret: &coreV1.SecretVolumeSource{ SecretName: refs[0].Name, - Items: []coreV1.KeyToPath{{refs[0].Key, filepath.Base(fileElem.Target), mountMode}}, + Items: []coreV1.KeyToPath{{ + Key: refs[0].Key, + Path: filepath.Base(fileElem.Target), + Mode: mountMode}}, }, }, }, nil From 09435177bc0eef91920156fb4f39d98a2cb83ace Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 16 Oct 2024 13:15:07 -0400 Subject: [PATCH 07/10] Update .github/workflows/ci.yaml Signed-off-by: Mathieu Benoit --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 04c4509..b303ea8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,4 +42,5 @@ jobs: run: | docker run --rm score-k8s:test --version docker run -v .:/score-k8s --rm score-k8s:test init + ls -la cat score.yaml From cc7462d8ca5803ec14d9e5872f3a5fb543b95026 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 16 Oct 2024 17:44:25 -0400 Subject: [PATCH 08/10] Update .github/workflows/ci.yaml Signed-off-by: Mathieu Benoit --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b303ea8..1619efa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,5 +42,5 @@ jobs: run: | docker run --rm score-k8s:test --version docker run -v .:/score-k8s --rm score-k8s:test init - ls -la + chmod 0755 score.yaml cat score.yaml From 251390fb4dd70e4b8d314bf6e534013c2fcdc969 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 16 Oct 2024 17:51:53 -0400 Subject: [PATCH 09/10] Update .github/workflows/ci.yaml Signed-off-by: Mathieu Benoit --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1619efa..9d2d701 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,5 +42,5 @@ jobs: run: | docker run --rm score-k8s:test --version docker run -v .:/score-k8s --rm score-k8s:test init - chmod 0755 score.yaml + ls | grep score.yaml cat score.yaml From 584610476a636e8a8cf7e6c736ff2cdcddbc37ce Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 16 Oct 2024 17:51:58 -0400 Subject: [PATCH 10/10] Update .github/workflows/ci.yaml Signed-off-by: Mathieu Benoit --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9d2d701..035d4d3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,4 +43,3 @@ jobs: docker run --rm score-k8s:test --version docker run -v .:/score-k8s --rm score-k8s:test init ls | grep score.yaml - cat score.yaml