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 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 90e7180..035d4d3 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 @@ -33,4 +35,11 @@ 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 score-k8s:test --version + docker run -v .:/score-k8s --rm score-k8s:test init + ls | grep score.yaml 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