diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c6340f0e..97ce43b2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -28,7 +28,6 @@ jobs: - name: Build run: make bin - - name: Upload a Build Artifact uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e083215a..9bd8efd9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,8 @@ jobs: - uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} + - name: Install dyff + run: go install github.com/homeport/dyff/cmd/dyff@v1.5.8 - name: Run tests run: make test - name: Perform cross compile @@ -34,6 +36,8 @@ jobs: - uses: actions/setup-go@v4 with: go-version: 1.19 + - name: Install dyff + run: go install github.com/homeport/dyff/cmd/dyff@v1.5.8 - name: Create .coverprofile for each targeted directory by re:running tests run: make test - name: Collect all .coverprofile files and save it to one file gover.coverprofile diff --git a/pkg/transformer/openshift/openshift.go b/pkg/transformer/openshift/openshift.go index 8e77262e..ba53409b 100644 --- a/pkg/transformer/openshift/openshift.go +++ b/pkg/transformer/openshift/openshift.go @@ -428,7 +428,9 @@ func (o *OpenShift) Transform(komposeObject kobject.KomposeObject, opt kobject.C // sort all object so Services are first o.SortServicesFirst(&allobjects) o.RemoveDupObjects(&allobjects) - transformer.AssignNamespaceToObjects(&allobjects, komposeObject.Namespace) + if komposeObject.Namespace != "" { + transformer.AssignNamespaceToObjects(&allobjects, komposeObject.Namespace) + } // o.FixWorkloadVersion(&allobjects) return allobjects, nil diff --git a/script/test/cmd/lib.sh b/script/test/cmd/lib.sh index 5141b961..cac3ff46 100644 --- a/script/test/cmd/lib.sh +++ b/script/test/cmd/lib.sh @@ -100,10 +100,10 @@ function convert::match_output() { convert::run_cmd $cmd exit_status=$? if [ $exit_status -ne 0 ]; then FAIL_MSGS=$FAIL_MSGS"exit status: $exit_status\n"; return $exit_status; fi - match=$(diff <(yq ea '[.] | sort_by(.metadata.name) | .[] | splitDoc' $expected_output) <(yq ea '[.] | sort_by(.metadata.name) | .[] | splitDoc' $TEMP_STDOUT)) - echo "$match" > /tmp/diff - if [ "$match" == "" ]; then SUCCESS_MSGS=$SUCCESS_MSGS"converted output matches\n"; return 0; - else FAIL_MSGS=$FAIL_MSGS"converted output does not match\n"; cat /tmp/diff; rm /tmp/diff; return 1; + + match=$(dyff between --ignore-order-changes --set-exit-code $expected_output $TEMP_STDOUT) + if [ $? -eq 0 ]; then SUCCESS_MSGS=$SUCCESS_MSGS"converted output matches\n"; return 0; + else FAIL_MSGS=$FAIL_MSGS"converted output does not match\n"; echo $match; return 1; fi } readonly -f convert::match_output diff --git a/script/test/cmd/tests_new.sh b/script/test/cmd/tests_new.sh index 92cd7b27..054cdb6b 100755 --- a/script/test/cmd/tests_new.sh +++ b/script/test/cmd/tests_new.sh @@ -113,8 +113,8 @@ k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/volume-mounts/windows/doc os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/volume-mounts/windows/docker-compose.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/volume-mounts/windows/output-k8s.yaml" os_output="$KOMPOSE_ROOT/script/test/fixtures/volume-mounts/windows/output-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success_and_warning "$os_cmd" "$os_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success_and_warning "$os_cmd" "$os_output" || exit 1 # # TEST the placement # should convert placement to affinity @@ -122,8 +122,8 @@ k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/deploy/placement/docker-c os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/deploy/placement/docker-compose-placement.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/deploy/placement/output-placement-k8s.yaml" os_output="$KOMPOSE_ROOT/script/test/fixtures/deploy/placement/output-placement-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success_and_warning "$os_cmd" "$os_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success_and_warning "$os_cmd" "$os_output" || exit 1 # test configmap volume @@ -131,173 +131,168 @@ k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/configmap-volume/docker-c os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/configmap-volume/docker-compose.yml convert --stdout --with-kompose-annotation=false --volumes=configMap" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/configmap-volume/output-k8s.yaml" os_output="$KOMPOSE_ROOT/script/test/fixtures/configmap-volume/output-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # test configmap volume using service label k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/configmap-volume/docker-compose-withlabel.yml convert --stdout --with-kompose-annotation=false" os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/configmap-volume/docker-compose-withlabel.yml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml" os_output="$KOMPOSE_ROOT/script/test/fixtures/configmap-volume/output-os-withlabel.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # Test that emptyDir works k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/change-in-volume/docker-compose.yml convert --with-kompose-annotation=false --stdout --volumes emptyDir" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.yaml" os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/change-in-volume/docker-compose.yml convert --with-kompose-annotation=false --stdout --volumes emptyDir" os_output="$KOMPOSE_ROOT/script/test/fixtures/change-in-volume/output-os-empty-vols-template.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # Test that emptyvols works k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/change-in-volume/docker-compose.yml convert --with-kompose-annotation=false --stdout --emptyvols" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/change-in-volume/output-k8s.yaml" os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/change-in-volume/docker-compose.yml convert --with-kompose-annotation=false --stdout --emptyvols" os_output="$KOMPOSE_ROOT/script/test/fixtures/change-in-volume/output-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success_and_warning "$os_cmd" "$os_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success_and_warning "$os_cmd" "$os_output" || exit 1 # test service expose k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/expose/compose.yaml convert --stdout --with-kompose-annotation=false" ocp_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/expose/compose.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/expose/output-k8s.yaml" ocp_output="$KOMPOSE_ROOT/script/test/fixtures/expose/output-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$ocp_cmd" "$ocp_output" +convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$ocp_cmd" "$ocp_output" || exit 1 # test service group by volume, not support openshift for now -k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/service-group/compose.yaml convert --stdout --with-kompose-annotation=false --service-group-mode=volume" +k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/service-group/compose.yaml convert --stdout --with-kompose-annotation=false --service-group-mode=volume --service-group-name=librenms-dispatcher" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/service-group/output-k8s.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 # test merge multiple compose files k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/multiple-files/first.yaml -f $KOMPOSE_ROOT/script/test/fixtures/multiple-files/second.yaml convert --stdout --with-kompose-annotation=false" ocp_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/multiple-files/first.yaml -f $KOMPOSE_ROOT/script/test/fixtures/multiple-files/second.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/multiple-files/output-k8s.yaml" ocp_output="$KOMPOSE_ROOT/script/test/fixtures/multiple-files/output-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$ocp_cmd" "$ocp_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$ocp_cmd" "$ocp_output" || exit 1 # test health check -k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/healthcheck/docker-compose-healthcheck.yaml convert --stdout --service-group-mode=label --with-kompose-annotation=false" -os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/healthcheck/docker-compose-healthcheck.yaml convert --stdout --service-group-mode=label --with-kompose-annotation=false" +k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/healthcheck/docker-compose-healthcheck.yaml convert --stdout --with-kompose-annotation=false" +os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/healthcheck/docker-compose-healthcheck.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml" os_output="$KOMPOSE_ROOT/script/test/fixtures/healthcheck/output-healthcheck-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # test statefulset k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/statefulset/docker-compose.yaml convert --stdout --with-kompose-annotation=false --controller statefulset" ocp_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/statefulset/docker-compose.yaml convert --stdout --with-kompose-annotation=false --controller statefulset" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/statefulset/output-k8s.yaml" ocp_output="$KOMPOSE_ROOT/script/test/fixtures/statefulset/output-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$ocp_cmd" "$ocp_output" +convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$ocp_cmd" "$ocp_output" || exit 1 # test specifying volume type using service label k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/multiple-type-volumes/docker-compose.yaml convert --stdout --with-kompose-annotation=false" os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/multiple-type-volumes/docker-compose.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/multiple-type-volumes/output-k8s.yaml" os_output="$KOMPOSE_ROOT/script/test/fixtures/multiple-type-volumes/output-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # Test environment variables interpolation k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/envvars-interpolation/docker-compose.yaml convert --stdout --with-kompose-annotation=false" os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/envvars-interpolation/docker-compose.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/envvars-interpolation/output-k8s.yaml" os_output="$KOMPOSE_ROOT/script/test/fixtures/envvars-interpolation/output-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success_and_warning "$os_cmd" "$os_output" || exit 1 # Test single file output feature k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/single-file-output/docker-compose.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/single-file-output/output-k8s.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 # Test host port and protocol feature k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/host-port-protocol/docker-compose.yaml convert --stdout --with-kompose-annotation=false" os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/host-port-protocol/docker-compose.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/host-port-protocol/output-k8s.yaml" os_output="$KOMPOSE_ROOT/script/test/fixtures/host-port-protocol/output-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # Test external traffic policy feature with valid configuration, warning is coming from the network policy. k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/external-traffic-policy/docker-compose-v1.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml" os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/external-traffic-policy/docker-compose-v1.yaml convert --stdout --with-kompose-annotation=false" os_output="$KOMPOSE_ROOT/script/test/fixtures/external-traffic-policy/output-os-v1.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # Test external traffic policy feature with warning, because we have nodeport with external traffic policy k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/external-traffic-policy/docker-compose-v2.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml" os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/external-traffic-policy/docker-compose-v2.yaml convert --stdout --with-kompose-annotation=false" os_output="$KOMPOSE_ROOT/script/test/fixtures/external-traffic-policy/output-os-v2.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success_and_warning "$os_cmd" "$os_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success_and_warning "$os_cmd" "$os_output" || exit 1 # Test Pod security context fs group k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/fsgroup/docker-compose.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/fsgroup/output-k8s.yaml" os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/fsgroup/docker-compose.yaml convert --stdout --with-kompose-annotation=false" os_output="$KOMPOSE_ROOT/script/test/fixtures/fsgroup/output-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success_and_warning "$os_cmd" "$os_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # Test support for compose.yaml file -k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/compose-file-support/docker-compose.yaml convert --stdout --with-kompose-annotation=false" +k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/compose-file-support/compose.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/compose-file-support/output-k8s.yaml" -convert::expect_success "$k8s_cmd" "$k8s_output" +convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 # Test support for compose env interpolation k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/compose-env-interpolation/docker-compose.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/compose-env-interpolation/output-k8s.yaml" -convert::expect_success "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # Test support for subpath volume k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/vols-subpath/docker-compose.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/vols-subpath/output-k8s.yaml" os_cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/vols-subpath/docker-compose.yaml convert --stdout --with-kompose-annotation=false" os_output="$KOMPOSE_ROOT/script/test/fixtures/vols-subpath/output-os.yaml" -convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # Test support for network policies generation k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/network-policies/docker-compose.yaml convert --generate-network-policies --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/network-policies/output-k8s.yaml" -convert::expect_success "$k8s_cmd" "$k8s_output" - -# Test support for custom build and push images -k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/custom-build-push/docker-compose.yaml convert --build-command 'docker build -t ahmedgrati/kompose-test ./script/test/fixtures/custom-build-push' --push-command 'docker push ahmedgrati/kompose-test' --stdout --with-kompose-annotation=false" -k8s_output="$KOMPOSE_ROOT/script/test/fixtures/custom-build-push/output-k8s.yaml" -convert::expect_success "$k8s_cmd" "$k8s_output" +convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1 # Test support for namespace generation k8s_cmd="kompose -f ./script/test/fixtures/namespace/docker-compose.yaml convert --stdout --with-kompose-annotation=false -n web" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/namespace/output-k8s.yaml" os_cmd="kompose -f ./script/test/fixtures/namespace/docker-compose.yaml convert --stdout --with-kompose-annotation=false -n web --provider openshift" os_output="$KOMPOSE_ROOT/script/test/fixtures/namespace/output-os.yaml" -convert::expect_success "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # Test support for read only root fs k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/read-only/docker-compose.yaml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/read-only/output-k8s.yaml" os_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/read-only/docker-compose.yaml convert --stdout --with-kompose-annotation=false --provider openshift" os_output="$KOMPOSE_ROOT/script/test/fixtures/read-only/output-os.yaml" -convert::expect_success "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 # Test env_file support k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/env/docker-compose.yml convert --stdout --with-kompose-annotation=false" k8s_output="$KOMPOSE_ROOT/script/test/fixtures/env/output-k8s.yaml" os_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/env/docker-compose.yml convert --provider openshift --stdout --with-kompose-annotation=false" os_output="$KOMPOSE_ROOT/script/test/fixtures/env/output-os.yaml" -convert::expect_success "$k8s_cmd" "$k8s_output" -convert::expect_success "$os_cmd" "$os_output" +convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 +convert::expect_success "$os_cmd" "$os_output" || exit 1 diff --git a/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.yaml b/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.yaml index 831d5053..673e998f 100644 --- a/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.yaml +++ b/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.yaml @@ -8,7 +8,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: clusterIP: None ports: @@ -28,7 +27,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: ports: - name: "5000" @@ -49,7 +47,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: @@ -80,7 +77,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/change-in-volume/output-k8s.yaml b/script/test/fixtures/change-in-volume/output-k8s.yaml index 831d5053..673e998f 100644 --- a/script/test/fixtures/change-in-volume/output-k8s.yaml +++ b/script/test/fixtures/change-in-volume/output-k8s.yaml @@ -8,7 +8,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: clusterIP: None ports: @@ -28,7 +27,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: ports: - name: "5000" @@ -49,7 +47,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: @@ -80,7 +77,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/change-in-volume/output-os-empty-vols-template.yaml b/script/test/fixtures/change-in-volume/output-os-empty-vols-template.yaml index ad02b0f9..40061b7a 100644 --- a/script/test/fixtures/change-in-volume/output-os-empty-vols-template.yaml +++ b/script/test/fixtures/change-in-volume/output-os-empty-vols-template.yaml @@ -8,7 +8,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: clusterIP: None ports: @@ -28,7 +27,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: ports: - name: "5000" @@ -49,7 +47,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: @@ -95,7 +92,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: lookupPolicy: local: false @@ -120,7 +116,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: @@ -180,7 +175,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/change-in-volume/output-os.yaml b/script/test/fixtures/change-in-volume/output-os.yaml index ad02b0f9..40061b7a 100644 --- a/script/test/fixtures/change-in-volume/output-os.yaml +++ b/script/test/fixtures/change-in-volume/output-os.yaml @@ -8,7 +8,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: clusterIP: None ports: @@ -28,7 +27,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: ports: - name: "5000" @@ -49,7 +47,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: @@ -95,7 +92,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: lookupPolicy: local: false @@ -120,7 +116,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: @@ -180,7 +175,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/compose-env-interpolation/docker-compose.yaml b/script/test/fixtures/compose-env-interpolation/docker-compose.yaml index b098afdb..b9ccb53c 100644 --- a/script/test/fixtures/compose-env-interpolation/docker-compose.yaml +++ b/script/test/fixtures/compose-env-interpolation/docker-compose.yaml @@ -5,3 +5,5 @@ services: labels: kompose.image-pull-policy: "${IMAGE_PULL_POLICY:-IfNotPresent}" build: . + ports: + - 80:80 diff --git a/script/test/fixtures/compose-env-interpolation/output-k8s.yaml b/script/test/fixtures/compose-env-interpolation/output-k8s.yaml index 109ea022..4bdcc1c1 100644 --- a/script/test/fixtures/compose-env-interpolation/output-k8s.yaml +++ b/script/test/fixtures/compose-env-interpolation/output-k8s.yaml @@ -1,3 +1,23 @@ +--- +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.image-pull-policy: IfNotPresent + creationTimestamp: null + labels: + io.kompose.service: foo + name: foo +spec: + ports: + - name: "80" + port: 80 + targetPort: 80 + selector: + io.kompose.service: foo +status: + loadBalancer: {} + --- apiVersion: apps/v1 kind: Deployment @@ -27,23 +47,11 @@ spec: - image: foo imagePullPolicy: IfNotPresent name: foo + ports: + - containerPort: 80 + hostPort: 80 + protocol: TCP resources: {} restartPolicy: Always status: {} ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - creationTimestamp: null - name: compose-env-interpolation-default -spec: - ingress: - - from: - - podSelector: - matchLabels: - io.kompose.network/compose-env-interpolation-default: "true" - podSelector: - matchLabels: - io.kompose.network/compose-env-interpolation-default: "true" - diff --git a/script/test/fixtures/compose-file-support/output-k8s.yaml b/script/test/fixtures/compose-file-support/output-k8s.yaml index ac735023..1ca00e60 100644 --- a/script/test/fixtures/compose-file-support/output-k8s.yaml +++ b/script/test/fixtures/compose-file-support/output-k8s.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: ports: - name: "80" @@ -25,7 +24,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml b/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml index a72027ac..5e3c9d33 100644 --- a/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml +++ b/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml @@ -8,7 +8,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: replicas: 1 selector: @@ -55,7 +54,6 @@ metadata: labels: io.kompose.service: db name: db-cm0 - namespace: default --- apiVersion: apps/v1 @@ -67,7 +65,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: @@ -118,7 +115,6 @@ metadata: labels: io.kompose.service: web name: web-cm0 - namespace: default --- apiVersion: v1 @@ -132,5 +128,4 @@ metadata: labels: io.kompose.service: web name: web-cm1 - namespace: default diff --git a/script/test/fixtures/configmap-volume/output-k8s.yaml b/script/test/fixtures/configmap-volume/output-k8s.yaml index 895322f8..4baf157a 100644 --- a/script/test/fixtures/configmap-volume/output-k8s.yaml +++ b/script/test/fixtures/configmap-volume/output-k8s.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: replicas: 1 selector: @@ -51,7 +50,6 @@ metadata: labels: io.kompose.service: db name: db-cm0 - namespace: default --- apiVersion: apps/v1 @@ -61,7 +59,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: @@ -110,7 +107,6 @@ metadata: labels: io.kompose.service: web name: web-cm0 - namespace: default --- apiVersion: v1 @@ -124,5 +120,4 @@ metadata: labels: io.kompose.service: web name: web-cm1 - namespace: default diff --git a/script/test/fixtures/configmap-volume/output-os-withlabel.yaml b/script/test/fixtures/configmap-volume/output-os-withlabel.yaml index 9bd9da38..4ab7aa8a 100644 --- a/script/test/fixtures/configmap-volume/output-os-withlabel.yaml +++ b/script/test/fixtures/configmap-volume/output-os-withlabel.yaml @@ -8,7 +8,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: replicas: 1 selector: @@ -66,7 +65,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: lookupPolicy: local: false @@ -95,7 +93,6 @@ metadata: labels: io.kompose.service: db name: db-cm0 - namespace: default --- apiVersion: apps.openshift.io/v1 @@ -107,7 +104,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: @@ -170,7 +166,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: lookupPolicy: local: false @@ -198,7 +193,6 @@ metadata: labels: io.kompose.service: web name: web-cm0 - namespace: default --- apiVersion: v1 @@ -212,5 +206,4 @@ metadata: labels: io.kompose.service: web name: web-cm1 - namespace: default diff --git a/script/test/fixtures/configmap-volume/output-os.yaml b/script/test/fixtures/configmap-volume/output-os.yaml index 395ad9c1..c1a9628e 100644 --- a/script/test/fixtures/configmap-volume/output-os.yaml +++ b/script/test/fixtures/configmap-volume/output-os.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: replicas: 1 selector: @@ -64,7 +63,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: lookupPolicy: local: false @@ -93,7 +91,6 @@ metadata: labels: io.kompose.service: db name: db-cm0 - namespace: default --- apiVersion: apps.openshift.io/v1 @@ -103,7 +100,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: @@ -166,7 +162,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: lookupPolicy: local: false @@ -194,7 +189,6 @@ metadata: labels: io.kompose.service: web name: web-cm0 - namespace: default --- apiVersion: v1 @@ -208,5 +202,4 @@ metadata: labels: io.kompose.service: web name: web-cm1 - namespace: default diff --git a/script/test/fixtures/custom-build-push/Dockerfile b/script/test/fixtures/custom-build-push/Dockerfile deleted file mode 100644 index 4be68ad1..00000000 --- a/script/test/fixtures/custom-build-push/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM busybox - -CMD ["sleep", "4800"] diff --git a/script/test/fixtures/custom-build-push/docker-compose.yaml b/script/test/fixtures/custom-build-push/docker-compose.yaml deleted file mode 100644 index 8b24f656..00000000 --- a/script/test/fixtures/custom-build-push/docker-compose.yaml +++ /dev/null @@ -1,10 +0,0 @@ -version: '3.8' - -networks: - web: - -services: - nginx: - image: nginx - networks: - - web diff --git a/script/test/fixtures/custom-build-push/output-k8s.yaml b/script/test/fixtures/custom-build-push/output-k8s.yaml deleted file mode 100644 index 32d118b6..00000000 --- a/script/test/fixtures/custom-build-push/output-k8s.yaml +++ /dev/null @@ -1,44 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - creationTimestamp: null - labels: - io.kompose.service: nginx - name: nginx -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: nginx - strategy: {} - template: - metadata: - creationTimestamp: null - labels: - io.kompose.network/custom-build-push-web: "true" - io.kompose.service: nginx - spec: - containers: - - image: nginx - name: nginx - resources: {} - restartPolicy: Always -status: {} - ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - creationTimestamp: null - name: custom-build-push-web -spec: - ingress: - - from: - - podSelector: - matchLabels: - io.kompose.network/custom-build-push-web: "true" - podSelector: - matchLabels: - io.kompose.network/custom-build-push-web: "true" - diff --git a/script/test/fixtures/deploy/placement/output-placement-k8s.yaml b/script/test/fixtures/deploy/placement/output-placement-k8s.yaml index 46e5db6c..8005d35e 100644 --- a/script/test/fixtures/deploy/placement/output-placement-k8s.yaml +++ b/script/test/fixtures/deploy/placement/output-placement-k8s.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: ports: - name: "6379" @@ -25,7 +24,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/deploy/placement/output-placement-os.yaml b/script/test/fixtures/deploy/placement/output-placement-os.yaml index 98e9958a..d59f6b4f 100644 --- a/script/test/fixtures/deploy/placement/output-placement-os.yaml +++ b/script/test/fixtures/deploy/placement/output-placement-os.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: ports: - name: "6379" @@ -25,7 +24,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: @@ -104,7 +102,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/env/docker-compose.yml b/script/test/fixtures/env/docker-compose.yml index 8d989dee..bc80f225 100644 --- a/script/test/fixtures/env/docker-compose.yml +++ b/script/test/fixtures/env/docker-compose.yml @@ -11,5 +11,8 @@ services: - "8020:8020" another-namenode: image: bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8 + ports: + - "50070:50070" + - "8020:8020" env_file: - hadoop-hive-namenode.env diff --git a/script/test/fixtures/env/output-k8s.yaml b/script/test/fixtures/env/output-k8s.yaml index a885df99..61bf3efe 100644 --- a/script/test/fixtures/env/output-k8s.yaml +++ b/script/test/fixtures/env/output-k8s.yaml @@ -1,3 +1,24 @@ +--- +apiVersion: v1 +kind: Service +metadata: + creationTimestamp: null + labels: + io.kompose.service: another-namenode + name: another-namenode +spec: + ports: + - name: "50070" + port: 50070 + targetPort: 50070 + - name: "8020" + port: 8020 + targetPort: 8020 + selector: + io.kompose.service: another-namenode +status: + loadBalancer: {} + --- apiVersion: v1 kind: Service @@ -6,7 +27,6 @@ metadata: labels: io.kompose.service: namenode name: namenode - namespace: default spec: ports: - name: "50070" @@ -28,7 +48,6 @@ metadata: labels: io.kompose.service: another-namenode name: another-namenode - namespace: default spec: replicas: 1 selector: @@ -56,6 +75,13 @@ spec: name: home-runner-work-kompose-kompose-script-test-fixtures-env-hadoop-hive-namenode-env image: bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8 name: another-namenode + ports: + - containerPort: 50070 + hostPort: 50070 + protocol: TCP + - containerPort: 8020 + hostPort: 8020 + protocol: TCP resources: {} restartPolicy: Always status: {} @@ -71,7 +97,6 @@ metadata: labels: io.kompose.service: another-namenode-home-runner-work-kompose-kompose-script-test-fixtures-env-hadoop-hive-namenode-env name: home-runner-work-kompose-kompose-script-test-fixtures-env-hadoop-hive-namenode-env - namespace: default --- apiVersion: apps/v1 @@ -81,7 +106,6 @@ metadata: labels: io.kompose.service: namenode name: namenode - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/env/output-os.yaml b/script/test/fixtures/env/output-os.yaml index 8537d2be..f4283959 100644 --- a/script/test/fixtures/env/output-os.yaml +++ b/script/test/fixtures/env/output-os.yaml @@ -1,3 +1,24 @@ +--- +apiVersion: v1 +kind: Service +metadata: + creationTimestamp: null + labels: + io.kompose.service: another-namenode + name: another-namenode +spec: + ports: + - name: "50070" + port: 50070 + targetPort: 50070 + - name: "8020" + port: 8020 + targetPort: 8020 + selector: + io.kompose.service: another-namenode +status: + loadBalancer: {} + --- apiVersion: v1 kind: Service @@ -6,7 +27,6 @@ metadata: labels: io.kompose.service: namenode name: namenode - namespace: default spec: ports: - name: "50070" @@ -31,7 +51,6 @@ metadata: labels: io.kompose.service: another-namenode-home-runner-work-kompose-kompose-script-test-fixtures-env-hadoop-hive-namenode-env name: home-runner-work-kompose-kompose-script-test-fixtures-env-hadoop-hive-namenode-env - namespace: default --- apiVersion: apps.openshift.io/v1 @@ -41,7 +60,6 @@ metadata: labels: io.kompose.service: another-namenode name: another-namenode - namespace: default spec: replicas: 1 selector: @@ -69,6 +87,13 @@ spec: name: home-runner-work-kompose-kompose-script-test-fixtures-env-hadoop-hive-namenode-env image: ' ' name: another-namenode + ports: + - containerPort: 50070 + hostPort: 50070 + protocol: TCP + - containerPort: 8020 + hostPort: 8020 + protocol: TCP resources: {} restartPolicy: Always test: false @@ -98,7 +123,6 @@ metadata: labels: io.kompose.service: another-namenode name: another-namenode - namespace: default spec: lookupPolicy: local: false @@ -123,7 +147,6 @@ metadata: labels: io.kompose.service: namenode name: namenode - namespace: default spec: replicas: 1 selector: @@ -189,7 +212,6 @@ metadata: labels: io.kompose.service: namenode name: namenode - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/envvars-interpolation/output-k8s.yaml b/script/test/fixtures/envvars-interpolation/output-k8s.yaml index 9a58466d..d9ccbd06 100644 --- a/script/test/fixtures/envvars-interpolation/output-k8s.yaml +++ b/script/test/fixtures/envvars-interpolation/output-k8s.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: myservice name: myservice - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/envvars-interpolation/output-os.yaml b/script/test/fixtures/envvars-interpolation/output-os.yaml index 3460a655..f2113d65 100644 --- a/script/test/fixtures/envvars-interpolation/output-os.yaml +++ b/script/test/fixtures/envvars-interpolation/output-os.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: myservice name: myservice - namespace: default spec: replicas: 1 selector: @@ -60,7 +59,6 @@ metadata: labels: io.kompose.service: myservice name: myservice - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/expose/output-k8s.yaml b/script/test/fixtures/expose/output-k8s.yaml index 2f2311c1..52ad4c7d 100644 --- a/script/test/fixtures/expose/output-k8s.yaml +++ b/script/test/fixtures/expose/output-k8s.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: ports: - name: "6379" @@ -29,7 +28,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: ports: - name: "5000" @@ -48,7 +46,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: @@ -84,7 +81,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: @@ -125,7 +121,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: ingressClassName: nginx rules: diff --git a/script/test/fixtures/expose/output-os.yaml b/script/test/fixtures/expose/output-os.yaml index d117874d..149ceab4 100644 --- a/script/test/fixtures/expose/output-os.yaml +++ b/script/test/fixtures/expose/output-os.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: ports: - name: "6379" @@ -29,7 +28,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: ports: - name: "5000" @@ -48,7 +46,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: @@ -97,7 +94,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: lookupPolicy: local: false @@ -126,7 +122,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: @@ -176,7 +171,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: lookupPolicy: local: false @@ -201,7 +195,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: host: batman.example.com/dev,batwoman.example.com port: diff --git a/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml b/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml index b5f9a93f..aabc5a9a 100644 --- a/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml +++ b/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml @@ -11,7 +11,6 @@ metadata: labels: io.kompose.service: front-end-tcp name: front-end-tcp - namespace: default spec: externalTrafficPolicy: Local ports: @@ -37,7 +36,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml b/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml index 656c7c07..391e21bb 100644 --- a/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml +++ b/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml @@ -11,7 +11,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: clusterIP: None ports: @@ -37,7 +36,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: replicas: 1 selector: @@ -83,7 +81,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: ingressClassName: nginx rules: diff --git a/script/test/fixtures/external-traffic-policy/output-os-v1.yaml b/script/test/fixtures/external-traffic-policy/output-os-v1.yaml index 09471152..6ce6a5df 100644 --- a/script/test/fixtures/external-traffic-policy/output-os-v1.yaml +++ b/script/test/fixtures/external-traffic-policy/output-os-v1.yaml @@ -11,7 +11,6 @@ metadata: labels: io.kompose.service: front-end-tcp name: front-end-tcp - namespace: default spec: externalTrafficPolicy: Local ports: @@ -37,7 +36,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: replicas: 1 selector: @@ -90,7 +88,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/external-traffic-policy/output-os-v2.yaml b/script/test/fixtures/external-traffic-policy/output-os-v2.yaml index bcf80f57..49f64791 100644 --- a/script/test/fixtures/external-traffic-policy/output-os-v2.yaml +++ b/script/test/fixtures/external-traffic-policy/output-os-v2.yaml @@ -11,7 +11,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: clusterIP: None ports: @@ -37,7 +36,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: replicas: 1 selector: @@ -90,7 +88,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: lookupPolicy: local: false @@ -115,7 +112,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: host: lb port: diff --git a/script/test/fixtures/fsgroup/output-k8s.yaml b/script/test/fixtures/fsgroup/output-k8s.yaml index 95ad09ef..51ad5d6d 100644 --- a/script/test/fixtures/fsgroup/output-k8s.yaml +++ b/script/test/fixtures/fsgroup/output-k8s.yaml @@ -60,20 +60,3 @@ spec: requests: storage: 100Mi status: {} - ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - creationTimestamp: null - name: fsgroup-default -spec: - ingress: - - from: - - podSelector: - matchLabels: - io.kompose.network/fsgroup-default: "true" - podSelector: - matchLabels: - io.kompose.network/fsgroup-default: "true" - diff --git a/script/test/fixtures/healthcheck/docker-compose-healthcheck.yaml b/script/test/fixtures/healthcheck/docker-compose-healthcheck.yaml index 91df90fc..8078a2cb 100644 --- a/script/test/fixtures/healthcheck/docker-compose-healthcheck.yaml +++ b/script/test/fixtures/healthcheck/docker-compose-healthcheck.yaml @@ -66,4 +66,4 @@ services: kompose.service.healthcheck.readiness.tcp_port: 9091 kompose.service.healthcheck.readiness.interval: 11s kompose.service.healthcheck.readiness.timeout: 2s - kompose.service.healthcheck.readiness.retries: 6 \ No newline at end of file + kompose.service.healthcheck.readiness.retries: 6 diff --git a/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml b/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml index 55ba111b..9c8115a1 100644 --- a/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml +++ b/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml @@ -11,16 +11,15 @@ metadata: kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: - io.kompose.service: my-group + io.kompose.service: mongo name: mongo - namespace: default spec: ports: - name: "27017" port: 27017 targetPort: 27017 selector: - io.kompose.service: my-group + io.kompose.service: mongo status: loadBalancer: {} @@ -37,16 +36,15 @@ metadata: kompose.service.healthcheck.readiness.timeout: 2s creationTimestamp: null labels: - io.kompose.service: my-group + io.kompose.service: mysql name: mysql - namespace: default spec: ports: - name: "3306" port: 3306 targetPort: 3306 selector: - io.kompose.service: my-group + io.kompose.service: mysql status: loadBalancer: {} @@ -66,7 +64,6 @@ metadata: labels: io.kompose.service: postgresql name: postgresql - namespace: default spec: ports: - name: "5432" @@ -90,7 +87,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: ports: - name: "6379" @@ -107,21 +103,20 @@ kind: Deployment metadata: annotations: kompose.service.group: my-group - kompose.service.healthcheck.liveness.tcp_port: "8081" - kompose.service.healthcheck.readiness.interval: 11s - kompose.service.healthcheck.readiness.retries: "6" - kompose.service.healthcheck.readiness.tcp_port: "9091" - kompose.service.healthcheck.readiness.timeout: 2s + kompose.service.healthcheck.liveness.tcp_port: "8080" + kompose.service.healthcheck.readiness.interval: 10s + kompose.service.healthcheck.readiness.retries: "5" + kompose.service.healthcheck.readiness.tcp_port: "9090" + kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: - io.kompose.service: my-group - name: my-group - namespace: default + io.kompose.service: mongo + name: mongo spec: replicas: 1 selector: matchLabels: - io.kompose.service: my-group + io.kompose.service: mongo strategy: {} template: metadata: @@ -135,7 +130,7 @@ spec: creationTimestamp: null labels: io.kompose.network/healthcheck-default: "true" - io.kompose.service: my-group + io.kompose.service: mongo spec: containers: - image: mongo @@ -156,6 +151,45 @@ spec: port: 9090 timeoutSeconds: 1 resources: {} + restartPolicy: Always +status: {} + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.service.group: my-group + kompose.service.healthcheck.liveness.tcp_port: "8081" + kompose.service.healthcheck.readiness.interval: 11s + kompose.service.healthcheck.readiness.retries: "6" + kompose.service.healthcheck.readiness.tcp_port: "9091" + kompose.service.healthcheck.readiness.timeout: 2s + creationTimestamp: null + labels: + io.kompose.service: mysql + name: mysql +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mysql + strategy: {} + template: + metadata: + annotations: + kompose.service.group: my-group + kompose.service.healthcheck.liveness.tcp_port: "8081" + kompose.service.healthcheck.readiness.interval: 11s + kompose.service.healthcheck.readiness.retries: "6" + kompose.service.healthcheck.readiness.tcp_port: "9091" + kompose.service.healthcheck.readiness.timeout: 2s + creationTimestamp: null + labels: + io.kompose.network/healthcheck-default: "true" + io.kompose.service: mysql + spec: + containers: - image: mysql livenessProbe: failureThreshold: 6 @@ -193,7 +227,6 @@ metadata: labels: io.kompose.service: postgresql name: postgresql - namespace: default spec: replicas: 1 selector: @@ -252,7 +285,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/healthcheck/output-healthcheck-os.yaml b/script/test/fixtures/healthcheck/output-healthcheck-os.yaml index 3207559b..a4a29a6b 100644 --- a/script/test/fixtures/healthcheck/output-healthcheck-os.yaml +++ b/script/test/fixtures/healthcheck/output-healthcheck-os.yaml @@ -13,7 +13,6 @@ metadata: labels: io.kompose.service: mongo name: mongo - namespace: default spec: ports: - name: "27017" @@ -39,7 +38,6 @@ metadata: labels: io.kompose.service: mysql name: mysql - namespace: default spec: ports: - name: "3306" @@ -66,7 +64,6 @@ metadata: labels: io.kompose.service: postgresql name: postgresql - namespace: default spec: ports: - name: "5432" @@ -90,7 +87,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: ports: - name: "6379" @@ -116,7 +112,6 @@ metadata: labels: io.kompose.service: mongo name: mongo - namespace: default spec: replicas: 1 selector: @@ -177,7 +172,6 @@ metadata: labels: io.kompose.service: mongo name: mongo - namespace: default spec: lookupPolicy: local: false @@ -209,7 +203,6 @@ metadata: labels: io.kompose.service: mysql name: mysql - namespace: default spec: replicas: 1 selector: @@ -270,7 +263,6 @@ metadata: labels: io.kompose.service: mysql name: mysql - namespace: default spec: lookupPolicy: local: false @@ -303,7 +295,6 @@ metadata: labels: io.kompose.service: postgresql name: postgresql - namespace: default spec: replicas: 1 selector: @@ -366,7 +357,6 @@ metadata: labels: io.kompose.service: postgresql name: postgresql - namespace: default spec: lookupPolicy: local: false @@ -396,7 +386,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: @@ -460,7 +449,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/host-port-protocol/output-k8s.yaml b/script/test/fixtures/host-port-protocol/output-k8s.yaml index 32b1f5c7..8af386f1 100644 --- a/script/test/fixtures/host-port-protocol/output-k8s.yaml +++ b/script/test/fixtures/host-port-protocol/output-k8s.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: nginx name: nginx - namespace: default spec: ports: - name: "80" @@ -25,7 +24,6 @@ metadata: labels: io.kompose.service: nginx name: nginx - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/host-port-protocol/output-os.yaml b/script/test/fixtures/host-port-protocol/output-os.yaml index 3432f5c6..e1659373 100644 --- a/script/test/fixtures/host-port-protocol/output-os.yaml +++ b/script/test/fixtures/host-port-protocol/output-os.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: nginx name: nginx - namespace: default spec: ports: - name: "80" @@ -25,7 +24,6 @@ metadata: labels: io.kompose.service: nginx name: nginx - namespace: default spec: replicas: 1 selector: @@ -75,7 +73,6 @@ metadata: labels: io.kompose.service: nginx name: nginx - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/multiple-files/output-k8s.yaml b/script/test/fixtures/multiple-files/output-k8s.yaml index 2934ed6d..165a54c8 100644 --- a/script/test/fixtures/multiple-files/output-k8s.yaml +++ b/script/test/fixtures/multiple-files/output-k8s.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: bar name: bar - namespace: default spec: replicas: 99 selector: @@ -35,7 +34,6 @@ metadata: labels: io.kompose.service: foo name: foo - namespace: default spec: replicas: 3 selector: diff --git a/script/test/fixtures/multiple-files/output-os.yaml b/script/test/fixtures/multiple-files/output-os.yaml index ca69f76c..d673d065 100644 --- a/script/test/fixtures/multiple-files/output-os.yaml +++ b/script/test/fixtures/multiple-files/output-os.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: bar name: bar - namespace: default spec: replicas: 99 selector: @@ -52,7 +51,6 @@ metadata: labels: io.kompose.service: bar name: bar - namespace: default spec: lookupPolicy: local: false @@ -77,7 +75,6 @@ metadata: labels: io.kompose.service: foo name: foo - namespace: default spec: replicas: 3 selector: @@ -123,7 +120,6 @@ metadata: labels: io.kompose.service: foo name: foo - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/multiple-type-volumes/output-k8s.yaml b/script/test/fixtures/multiple-type-volumes/output-k8s.yaml index a67801bc..40690d2a 100644 --- a/script/test/fixtures/multiple-type-volumes/output-k8s.yaml +++ b/script/test/fixtures/multiple-type-volumes/output-k8s.yaml @@ -8,7 +8,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: replicas: 1 selector: @@ -47,7 +46,6 @@ metadata: labels: io.kompose.service: db-data name: db-data - namespace: default spec: accessModes: - ReadWriteOnce @@ -66,7 +64,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: @@ -117,7 +114,6 @@ metadata: labels: io.kompose.service: web name: web-cm0 - namespace: default --- apiVersion: v1 @@ -131,5 +127,4 @@ metadata: labels: io.kompose.service: web name: web-cm1 - namespace: default diff --git a/script/test/fixtures/multiple-type-volumes/output-os.yaml b/script/test/fixtures/multiple-type-volumes/output-os.yaml index 51981c7b..9a4c7b76 100644 --- a/script/test/fixtures/multiple-type-volumes/output-os.yaml +++ b/script/test/fixtures/multiple-type-volumes/output-os.yaml @@ -8,7 +8,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: replicas: 1 selector: @@ -62,7 +61,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: lookupPolicy: local: false @@ -87,7 +85,6 @@ metadata: labels: io.kompose.service: db-data name: db-data - namespace: default spec: accessModes: - ReadWriteOnce @@ -106,7 +103,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: replicas: 1 selector: @@ -169,7 +165,6 @@ metadata: labels: io.kompose.service: web name: web - namespace: default spec: lookupPolicy: local: false @@ -197,7 +192,6 @@ metadata: labels: io.kompose.service: web name: web-cm0 - namespace: default --- apiVersion: v1 @@ -211,5 +205,4 @@ metadata: labels: io.kompose.service: web name: web-cm1 - namespace: default diff --git a/script/test/fixtures/network-policies/docker-compose.yaml b/script/test/fixtures/network-policies/docker-compose.yaml index 8b24f656..2630f699 100644 --- a/script/test/fixtures/network-policies/docker-compose.yaml +++ b/script/test/fixtures/network-policies/docker-compose.yaml @@ -6,5 +6,7 @@ networks: services: nginx: image: nginx - networks: + ports: + - 80:80 + networks: - web diff --git a/script/test/fixtures/network-policies/output-k8s.yaml b/script/test/fixtures/network-policies/output-k8s.yaml index 049edeab..8dbca2cc 100644 --- a/script/test/fixtures/network-policies/output-k8s.yaml +++ b/script/test/fixtures/network-policies/output-k8s.yaml @@ -1,3 +1,21 @@ +--- +apiVersion: v1 +kind: Service +metadata: + creationTimestamp: null + labels: + io.kompose.service: nginx + name: nginx +spec: + ports: + - name: "80" + port: 80 + targetPort: 80 + selector: + io.kompose.service: nginx +status: + loadBalancer: {} + --- apiVersion: apps/v1 kind: Deployment @@ -22,6 +40,10 @@ spec: containers: - image: nginx name: nginx + ports: + - containerPort: 80 + hostPort: 80 + protocol: TCP resources: {} restartPolicy: Always status: {} diff --git a/script/test/fixtures/read-only/output-k8s.yaml b/script/test/fixtures/read-only/output-k8s.yaml index 7d7d3fbf..d18582fd 100644 --- a/script/test/fixtures/read-only/output-k8s.yaml +++ b/script/test/fixtures/read-only/output-k8s.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: test name: test - namespace: default spec: ports: - name: "80" @@ -25,7 +24,6 @@ metadata: labels: io.kompose.service: test name: test - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/read-only/output-os.yaml b/script/test/fixtures/read-only/output-os.yaml index 876ce92a..40cc310e 100644 --- a/script/test/fixtures/read-only/output-os.yaml +++ b/script/test/fixtures/read-only/output-os.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: test name: test - namespace: default spec: ports: - name: "80" @@ -25,7 +24,6 @@ metadata: labels: io.kompose.service: test name: test - namespace: default spec: replicas: 1 selector: @@ -77,7 +75,6 @@ metadata: labels: io.kompose.service: test name: test - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/service-group/output-k8s.yaml b/script/test/fixtures/service-group/output-k8s.yaml index a639d78e..e22fdd17 100644 --- a/script/test/fixtures/service-group/output-k8s.yaml +++ b/script/test/fixtures/service-group/output-k8s.yaml @@ -4,16 +4,15 @@ kind: Service metadata: creationTimestamp: null labels: - io.kompose.service: dispatcher-librenms + io.kompose.service: librenms-dispatcher name: librenms - namespace: default spec: ports: - name: "8000" port: 8000 targetPort: 8000 selector: - io.kompose.service: dispatcher-librenms + io.kompose.service: librenms-dispatcher status: loadBalancer: {} @@ -23,14 +22,13 @@ kind: Deployment metadata: creationTimestamp: null labels: - io.kompose.service: dispatcher-librenms - name: dispatcher-librenms - namespace: default + io.kompose.service: librenms-dispatcher + name: librenms-dispatcher spec: replicas: 1 selector: matchLabels: - io.kompose.service: dispatcher-librenms + io.kompose.service: librenms-dispatcher strategy: type: Recreate template: @@ -38,17 +36,9 @@ spec: creationTimestamp: null labels: io.kompose.network/service-group-default: "true" - io.kompose.service: dispatcher-librenms + io.kompose.service: librenms-dispatcher spec: containers: - - env: - - name: TZ - image: librenms/dispatcher:latest - name: dispatcher - resources: {} - volumeMounts: - - mountPath: /data - name: dispatcher-librenms-claim0 - env: - name: TZ image: librenms/librenms:latest @@ -60,13 +50,21 @@ spec: resources: {} volumeMounts: - mountPath: /data - name: dispatcher-librenms-claim0 - hostname: librenms + name: librenms-dispatcher-claim0 + - env: + - name: TZ + image: librenms/dispatcher:latest + name: dispatcher + resources: {} + volumeMounts: + - mountPath: /data + name: librenms-dispatcher-claim0 + hostname: dispatcher restartPolicy: Always volumes: - - name: dispatcher-librenms-claim0 + - name: librenms-dispatcher-claim0 persistentVolumeClaim: - claimName: dispatcher-librenms-claim0 + claimName: librenms-dispatcher-claim0 status: {} --- @@ -75,9 +73,8 @@ kind: PersistentVolumeClaim metadata: creationTimestamp: null labels: - io.kompose.service: dispatcher-librenms-claim0 - name: dispatcher-librenms-claim0 - namespace: default + io.kompose.service: librenms-dispatcher-claim0 + name: librenms-dispatcher-claim0 spec: accessModes: - ReadWriteOnce diff --git a/script/test/fixtures/single-file-output/output-k8s.yaml b/script/test/fixtures/single-file-output/output-k8s.yaml index d1e5dd28..39835492 100644 --- a/script/test/fixtures/single-file-output/output-k8s.yaml +++ b/script/test/fixtures/single-file-output/output-k8s.yaml @@ -9,7 +9,6 @@ metadata: labels: io.kompose.service: front-end name: front_end - namespace: default spec: ports: - name: "80" @@ -31,7 +30,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: replicas: 1 selector: @@ -73,7 +71,6 @@ metadata: labels: io.kompose.service: front-end name: front-end - namespace: default spec: ingressClassName: nginx rules: diff --git a/script/test/fixtures/statefulset/output-k8s.yaml b/script/test/fixtures/statefulset/output-k8s.yaml index fcdae4d7..7172545e 100644 --- a/script/test/fixtures/statefulset/output-k8s.yaml +++ b/script/test/fixtures/statefulset/output-k8s.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: clusterIP: None ports: @@ -27,7 +26,6 @@ metadata: labels: io.kompose.service: wordpress name: wordpress - namespace: default spec: clusterIP: None ports: @@ -48,7 +46,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: replicas: 1 selector: @@ -109,7 +106,6 @@ metadata: labels: io.kompose.service: wordpress name: wordpress - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/statefulset/output-os.yaml b/script/test/fixtures/statefulset/output-os.yaml index bfe80aff..b3664bd2 100644 --- a/script/test/fixtures/statefulset/output-os.yaml +++ b/script/test/fixtures/statefulset/output-os.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: ports: - name: "3306" @@ -25,7 +24,6 @@ metadata: labels: io.kompose.service: wordpress name: wordpress - namespace: default spec: ports: - name: "8000" @@ -44,7 +42,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: replicas: 1 selector: @@ -105,7 +102,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: replicas: 1 selector: @@ -168,7 +164,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: lookupPolicy: local: false @@ -193,7 +188,6 @@ metadata: labels: io.kompose.service: wordpress name: wordpress - namespace: default spec: replicas: 1 selector: @@ -254,7 +248,6 @@ metadata: labels: io.kompose.service: wordpress name: wordpress - namespace: default spec: replicas: 1 selector: @@ -317,7 +310,6 @@ metadata: labels: io.kompose.service: wordpress name: wordpress - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/v2/output-k8s.yaml b/script/test/fixtures/v2/output-k8s.yaml index 3a9c0a3d..714375d2 100644 --- a/script/test/fixtures/v2/output-k8s.yaml +++ b/script/test/fixtures/v2/output-k8s.yaml @@ -234,22 +234,6 @@ spec: - 1234 status: {} ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - creationTimestamp: null - name: v2-default -spec: - ingress: - - from: - - podSelector: - matchLabels: - io.kompose.network/v2-default: "true" - podSelector: - matchLabels: - io.kompose.network/v2-default: "true" - --- apiVersion: apps/v1 kind: Deployment diff --git a/script/test/fixtures/v2/output-os.yaml b/script/test/fixtures/v2/output-os.yaml index a68ae3e7..f9282d27 100644 --- a/script/test/fixtures/v2/output-os.yaml +++ b/script/test/fixtures/v2/output-os.yaml @@ -235,7 +235,7 @@ spec: status: {} --- -apiVersion: v1 +apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: annotations: @@ -290,7 +290,7 @@ status: updatedReplicas: 0 --- -apiVersion: v1 +apiVersion: image.openshift.io/v1 kind: ImageStream metadata: creationTimestamp: null diff --git a/script/test/fixtures/v3.0/output-k8s.yaml b/script/test/fixtures/v3.0/output-k8s.yaml index f339d4c3..ae6ee902 100644 --- a/script/test/fixtures/v3.0/output-k8s.yaml +++ b/script/test/fixtures/v3.0/output-k8s.yaml @@ -8,7 +8,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: clusterIP: None ports: @@ -28,7 +27,6 @@ metadata: labels: io.kompose.service: foo name: foo - namespace: default spec: replicas: 1 selector: @@ -65,7 +63,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/v3.0/output-os.yaml b/script/test/fixtures/v3.0/output-os.yaml index a9e5f0ff..26117700 100644 --- a/script/test/fixtures/v3.0/output-os.yaml +++ b/script/test/fixtures/v3.0/output-os.yaml @@ -8,7 +8,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: clusterIP: None ports: @@ -28,7 +27,6 @@ metadata: labels: io.kompose.service: foo name: foo - namespace: default spec: replicas: 1 selector: @@ -80,7 +78,6 @@ metadata: labels: io.kompose.service: foo name: foo - namespace: default spec: lookupPolicy: local: false @@ -107,7 +104,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: replicas: 1 selector: @@ -160,7 +156,6 @@ metadata: labels: io.kompose.service: redis name: redis - namespace: default spec: lookupPolicy: local: false diff --git a/script/test/fixtures/vols-subpath/output-k8s.yaml b/script/test/fixtures/vols-subpath/output-k8s.yaml index 13d7daf4..de17dc83 100644 --- a/script/test/fixtures/vols-subpath/output-k8s.yaml +++ b/script/test/fixtures/vols-subpath/output-k8s.yaml @@ -61,20 +61,3 @@ spec: requests: storage: 100Mi status: {} - ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - creationTimestamp: null - name: vols-subpath-default -spec: - ingress: - - from: - - podSelector: - matchLabels: - io.kompose.network/vols-subpath-default: "true" - podSelector: - matchLabels: - io.kompose.network/vols-subpath-default: "true" - diff --git a/script/test/fixtures/volume-mounts/windows/output-k8s.yaml b/script/test/fixtures/volume-mounts/windows/output-k8s.yaml index c4fdc940..29a2eb65 100644 --- a/script/test/fixtures/volume-mounts/windows/output-k8s.yaml +++ b/script/test/fixtures/volume-mounts/windows/output-k8s.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: ports: - name: "80" @@ -25,7 +24,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: replicas: 1 selector: @@ -65,7 +63,6 @@ metadata: labels: io.kompose.service: db-claim0 name: db-claim0 - namespace: default spec: accessModes: - ReadWriteOnce diff --git a/script/test/fixtures/volume-mounts/windows/output-os.yaml b/script/test/fixtures/volume-mounts/windows/output-os.yaml index f4061f3e..ac6b530e 100644 --- a/script/test/fixtures/volume-mounts/windows/output-os.yaml +++ b/script/test/fixtures/volume-mounts/windows/output-os.yaml @@ -6,7 +6,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: ports: - name: "80" @@ -25,7 +24,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: replicas: 1 selector: @@ -82,7 +80,6 @@ metadata: labels: io.kompose.service: db name: db - namespace: default spec: lookupPolicy: local: false @@ -107,7 +104,6 @@ metadata: labels: io.kompose.service: db-claim0 name: db-claim0 - namespace: default spec: accessModes: - ReadWriteOnce