diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b573f5fb4..e2705b356 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,8 +42,8 @@ jobs: npm ci npm test - name: Check licenses - if: matrix.package == 'kpt-functions' || - matrix.package == 'create-kpt-functions' || + if: matrix.package == 'kpt-functions' || + matrix.package == 'create-kpt-functions' || matrix.package == 'demo-functions' run: | cd ts/${{ matrix.package }} @@ -55,61 +55,3 @@ jobs: npm run gen-docs DIFF=$(git status -s) [[ -z $DIFF ]] || { echo "Need to update docs: $DIFF"; } - - go-ci: - strategy: - matrix: - platform: [ubuntu-latest] - runs-on: ${{ matrix.platform }} - env: - GOPATH: /home/runner/work/kpt-functions-sdk/go - GO111MODULE: on - steps: - - name: Set up Go 1.17 - uses: actions/setup-go@v1 - with: - go-version: 1.17 - id: go - - name: Check out code into GOPATH - uses: actions/checkout@v1 - with: - path: go/src/github.com/GoogleContainerTools/kpt-functions-sdk - - name: Build, Test, Lint - run: | - cd go - make all - - e2e-ci: - needs: [node-ci, go-ci] - strategy: - matrix: - platform: [ubuntu-latest, macos-latest] - node-version: [12.x, 14.x] - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v1 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Install NPM packages - run: | - cd ts/demo-functions - npm ci - - name: Build docker images - if: matrix.platform == 'ubuntu-latest' - run: | - cd ts/demo-functions - npm run kpt:docker-build - - name: Run all e2e tests - if: matrix.platform == 'ubuntu-latest' - run: | - sudo curl https://storage.googleapis.com/kpt-dev/latest/linux_amd64/kpt -o /usr/local/bin/kpt - sudo chmod +x /usr/local/bin/kpt - tests/e2e.sh - - name: Run non-docker e2e tests - if: matrix.platform == 'macos-latest' - run: | - sudo curl https://storage.googleapis.com/kpt-dev/latest/darwin_amd64/kpt -o /usr/local/bin/kpt - sudo chmod +x /usr/local/bin/kpt - NODOCKER=true tests/e2e.sh diff --git a/.github/workflows/release-create-kpt-functions.yaml b/.github/workflows/release-create-kpt-functions.yaml deleted file mode 100644 index 1a412a207..000000000 --- a/.github/workflows/release-create-kpt-functions.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: release-create-kpt-functions - -on: - push: - tags: - - release-create-kpt-functions-* - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Use Node.js 14.x - uses: actions/setup-node@v1 - with: - node-version: 14.x - registry-url: 'https://wombat-dressing-room.appspot.com' - - name: Install, test - run: | - cd ts/create-kpt-functions - npm ci - npm test - - name: Publish - run: | - cd ts/create-kpt-functions - ../../scripts/publish-npm.sh $GITHUB_REF - env: - NODE_AUTH_TOKEN: ${{ secrets.WOMBAT_CREATE_KPT_FUNCTIONS }} diff --git a/.github/workflows/release-kpt-functions.yaml b/.github/workflows/release-typescript-functions.yaml similarity index 88% rename from .github/workflows/release-kpt-functions.yaml rename to .github/workflows/release-typescript-functions.yaml index c0c822524..2d178bcdf 100644 --- a/.github/workflows/release-kpt-functions.yaml +++ b/.github/workflows/release-typescript-functions.yaml @@ -1,9 +1,9 @@ -name: release-kpt-functions +name: release-typescript-functions on: push: tags: - - release-kpt-functions-* + - release-typescript-functions-* jobs: release: diff --git a/.gitignore b/.gitignore index 1c7459db4..1dc16f55a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ dist node_modules *.iml .npmrc -go/.out +ts/go/.out ts/create-kpt-functions/bin .DS_Store *.swo diff --git a/go/pkg/api/kptfile/v1/types.go b/api/kptfile/v1/types.go similarity index 100% rename from go/pkg/api/kptfile/v1/types.go rename to api/kptfile/v1/types.go diff --git a/go/pkg/api/util/kptfileutil.go b/api/util/kptfileutil.go similarity index 92% rename from go/pkg/api/util/kptfileutil.go rename to api/util/kptfileutil.go index d4c8b6858..02451d7e2 100644 --- a/go/pkg/api/util/kptfileutil.go +++ b/api/util/kptfileutil.go @@ -18,7 +18,7 @@ import ( "fmt" "strings" - kptfilev1 "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/api/kptfile/v1" + kptfilev1 "github.com/GoogleContainerTools/kpt-functions-sdk/api/kptfile/v1" "gopkg.in/yaml.v3" ) diff --git a/go/pkg/api/util/kptfileutil_test.go b/api/util/kptfileutil_test.go similarity index 96% rename from go/pkg/api/util/kptfileutil_test.go rename to api/util/kptfileutil_test.go index c5d30dd23..d9b27e319 100644 --- a/go/pkg/api/util/kptfileutil_test.go +++ b/api/util/kptfileutil_test.go @@ -19,7 +19,7 @@ import ( "strings" "testing" - kptfilev1 "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/api/kptfile/v1" + kptfilev1 "github.com/GoogleContainerTools/kpt-functions-sdk/api/kptfile/v1" ) func TestReadKptfile(t *testing.T) { diff --git a/tests/e2e.sh b/tests/e2e.sh deleted file mode 100755 index ff96be2ca..000000000 --- a/tests/e2e.sh +++ /dev/null @@ -1,228 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -euo pipefail - -REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null 2>&1 && pwd)" -DIST=${REPO}/ts/demo-functions/dist -TAG=${TAG:-dev} -NODOCKER=${NODOCKER:-} -EMPTY_OUTPUT=$( - cat <<-EOF -apiVersion: config.kubernetes.io/v1 -kind: ResourceList -metadata: - name: output -items: [] -EOF -) - -############################ -# Test framework -############################ - -function testcase() { - echo "testcase: ${1}" - tmp=$(mktemp -d "/tmp/e2e.${1}.XXXXXXXX") - cp -r "${REPO}"/example-configs/* "${tmp}" - cd "${tmp}" -} - -function fail() { - echo "FAIL: " "$@" - exit 1 -} - -function assert_empty_list() { - content="$(<"$1")" - [[ ${content} = "${EMPTY_OUTPUT}" ]] || fail "Not empty list: ${content}" -} - -function assert_empty_string() { - content="$(<"$1")" - [[ -z ${content} ]] || fail "Not empty list: ${content}" -} - -function assert_dir_exists() { - [[ -d $1 ]] || fail "Dir not exist: $1" -} - -############################ -# Node Tests -############################ - -testcase "node_no_op_stdout" -node "${DIST}"/no_op_run.js -i /dev/null >out.yaml -assert_empty_list out.yaml - -testcase "node_no_op_regular_files" -echo "$EMPTY_OUTPUT" >in.yaml -node "${DIST}"/no_op_run.js -i in.yaml -o out.yaml -assert_empty_list out.yaml - -testcase "node_no_op_pipe" -node "${DIST}"/no_op_run.js -i /dev/null | - node "${DIST}"/no_op_run.js >out.yaml -assert_empty_list out.yaml - -testcase "node_no_op_devnull" -node "${DIST}"/no_op_run.js -i /dev/null | - node "${DIST}"/no_op_run.js | - node "${DIST}"/no_op_run.js -o /dev/null >out.yaml -assert_empty_string out.yaml - -testcase "node_label_namespace" -node "${DIST}"/read_yaml_run.js -i /dev/null -d source_dir="$(pwd)" | - node "${DIST}"/label_namespace_run.js -d label_name=color -d label_value=orange | - grep -q 'color: orange' - -testcase "kpt_node_label_namespace" -kpt fn source . | - node "${DIST}"/label_namespace_run.js -d label_name=color -d label_value=orange | - kpt fn sink . -grep -qR 'color: orange' . - -testcase "node_label_namespace_func_config_file" -cat >fc.yaml <out.yaml -assert_empty_list out.yaml - -testcase "docker_no_op_regular_files" -echo "$EMPTY_OUTPUT" >in.yaml -docker run -i -u "$(id -u)" -v "$(pwd)":/source gcr.io/kpt-functions/no-op:"${TAG}" -i /source/in.yaml -o /source/out.yaml -assert_empty_list out.yaml - -testcase "docker_no_op_pipe" -docker run -i gcr.io/kpt-functions/no-op:"${TAG}" -i /dev/null | - docker run -i gcr.io/kpt-functions/no-op:"${TAG}" >out.yaml -assert_empty_list out.yaml - -testcase "docker_no_op_devnull" -docker run -i gcr.io/kpt-functions/no-op:"${TAG}" -i /dev/null | - docker run -i gcr.io/kpt-functions/no-op:"${TAG}" | - docker run -i gcr.io/kpt-functions/no-op:"${TAG}" -o /dev/null >out.yaml -assert_empty_string out.yaml - -testcase "docker_label_namespace" -docker run -i -u "$(id -u)" -v "$(pwd)":/source gcr.io/kpt-functions/read-yaml:"${TAG}" -i /dev/null -d source_dir=/source | - docker run -i gcr.io/kpt-functions/label-namespace:"${TAG}" -d label_name=color -d label_value=orange | - grep -q 'color: orange' - -testcase "docker_demo_funcs" -docker run -i -u "$(id -u)" -v "$(pwd)":/source gcr.io/kpt-functions/read-yaml:"${TAG}" -i /dev/null -d source_dir=/source | - docker run -i gcr.io/kpt-functions/mutate-psp:"${TAG}" | - docker run -i gcr.io/kpt-functions/expand-team-cr:"${TAG}" | - docker run -i gcr.io/kpt-functions/validate-rolebinding:"${TAG}" -d subject_name=alice@foo-corp.com | - docker run -i -u "$(id -u)" -v "$(pwd)":/sink gcr.io/kpt-functions/write-yaml:"${TAG}" -o /dev/null -d sink_dir=/sink -d overwrite=true -assert_dir_exists payments-dev -assert_dir_exists payments-prod -grep -q allowPrivilegeEscalation podsecuritypolicy_psp.yaml - -############################ -# kpt fn Tests -############################ - -testcase "kpt_label_namespace_imperative" -kpt fn source . | - kpt fn run --image gcr.io/kpt-functions/label-namespace:"${TAG}" -- label_name=color label_value=orange | - kpt fn sink . -grep -qR 'color: orange' . - -testcase "kpt_label_namespace_imperative_short" -kpt fn run --image gcr.io/kpt-functions/label-namespace:"${TAG}" . -- label_name=color label_value=orange -grep -qR 'color: orange' . - -testcase "kpt_label_namespace_declarative" -cat <kpt-func.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: my-config - annotations: - config.k8s.io/function: | - container: - image: gcr.io/kpt-functions/label-namespace:${TAG} - config.kubernetes.io/local-config: "true" -data: - label_name: color - label_value: orange -EOF -kpt fn run . -grep -qR 'color: orange' . - -testcase "kpt_label_namespace_declarative_multi" -cat <kpt-func.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: my-config - annotations: - config.k8s.io/function: | - container: - image: gcr.io/kpt-functions/label-namespace:${TAG} - config.kubernetes.io/local-config: "true" -data: - label_name: color - label_value: orange -EOF -cat <kpt-func2.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: my-config2 - annotations: - config.k8s.io/function: | - container: - image: gcr.io/kpt-functions/label-namespace:${TAG} - config.kubernetes.io/local-config: "true" -data: - label_name: city - label_value: toronto -EOF -kpt fn run . -grep -qR 'color: orange' . -grep -qR 'city: toronto' . diff --git a/go/Makefile b/ts/go/Makefile similarity index 100% rename from go/Makefile rename to ts/go/Makefile diff --git a/go/README.md b/ts/go/README.md similarity index 100% rename from go/README.md rename to ts/go/README.md diff --git a/go/build/func.Dockerfile b/ts/go/build/func.Dockerfile similarity index 95% rename from go/build/func.Dockerfile rename to ts/go/build/func.Dockerfile index 926fd158e..36d296ca4 100644 --- a/go/build/func.Dockerfile +++ b/ts/go/build/func.Dockerfile @@ -27,6 +27,6 @@ FROM alpine:3.10 WORKDIR /app -COPY --from=builder /go/bin /app/ +COPY --from=builder /ts/go/bin /app/ ENTRYPOINT ["/app/$FUNC"] diff --git a/go/cmd/gatekeeper_validate/gatekeeper_validate.go b/ts/go/cmd/gatekeeper_validate/gatekeeper_validate.go similarity index 83% rename from go/cmd/gatekeeper_validate/gatekeeper_validate.go rename to ts/go/cmd/gatekeeper_validate/gatekeeper_validate.go index caf718171..713f867e8 100644 --- a/go/cmd/gatekeeper_validate/gatekeeper_validate.go +++ b/ts/go/cmd/gatekeeper_validate/gatekeeper_validate.go @@ -15,8 +15,8 @@ package main import ( - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/runners" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/functions/gatekeeper" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/runners" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/functions/gatekeeper" ) const usage = ` diff --git a/go/cmd/gatekeeper_validate/testing/bad_gatekeeper_repo.json b/ts/go/cmd/gatekeeper_validate/testing/bad_gatekeeper_repo.json similarity index 100% rename from go/cmd/gatekeeper_validate/testing/bad_gatekeeper_repo.json rename to ts/go/cmd/gatekeeper_validate/testing/bad_gatekeeper_repo.json diff --git a/go/cmd/gatekeeper_validate/testing/bad_gatekeeper_repo.yaml b/ts/go/cmd/gatekeeper_validate/testing/bad_gatekeeper_repo.yaml similarity index 100% rename from go/cmd/gatekeeper_validate/testing/bad_gatekeeper_repo.yaml rename to ts/go/cmd/gatekeeper_validate/testing/bad_gatekeeper_repo.yaml diff --git a/go/cmd/gatekeeper_validate/testing/good_gatekeeper_repo.json b/ts/go/cmd/gatekeeper_validate/testing/good_gatekeeper_repo.json similarity index 100% rename from go/cmd/gatekeeper_validate/testing/good_gatekeeper_repo.json rename to ts/go/cmd/gatekeeper_validate/testing/good_gatekeeper_repo.json diff --git a/go/cmd/gatekeeper_validate/testing/good_gatekeeper_repo.yaml b/ts/go/cmd/gatekeeper_validate/testing/good_gatekeeper_repo.yaml similarity index 100% rename from go/cmd/gatekeeper_validate/testing/good_gatekeeper_repo.yaml rename to ts/go/cmd/gatekeeper_validate/testing/good_gatekeeper_repo.yaml diff --git a/go/cmd/typegen/typegen.go b/ts/go/cmd/typegen/typegen.go similarity index 94% rename from go/cmd/typegen/typegen.go rename to ts/go/cmd/typegen/typegen.go index aa34d43c4..80625fd3c 100644 --- a/go/cmd/typegen/typegen.go +++ b/ts/go/cmd/typegen/typegen.go @@ -22,11 +22,11 @@ import ( "sort" "strings" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/swagger/language" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/swagger/language" "github.com/pkg/errors" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/swagger" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/swagger" "github.com/spf13/cobra" ) diff --git a/go/go.mod b/ts/go/go.mod similarity index 100% rename from go/go.mod rename to ts/go/go.mod diff --git a/go/go.sum b/ts/go/go.sum similarity index 100% rename from go/go.sum rename to ts/go/go.sum diff --git a/go/pkg/framework/constants/constants.go b/ts/go/pkg/framework/constants/constants.go similarity index 100% rename from go/pkg/framework/constants/constants.go rename to ts/go/pkg/framework/constants/constants.go diff --git a/go/pkg/framework/io/io.go b/ts/go/pkg/framework/io/io.go similarity index 97% rename from go/pkg/framework/io/io.go rename to ts/go/pkg/framework/io/io.go index caacbae51..5ff44b0e6 100644 --- a/go/pkg/framework/io/io.go +++ b/ts/go/pkg/framework/io/io.go @@ -16,12 +16,13 @@ package io import ( "encoding/json" - "github.com/pkg/errors" - "gopkg.in/yaml.v2" "io/ioutil" "os" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/types" + "github.com/pkg/errors" + "gopkg.in/yaml.v2" + + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/types" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/go/pkg/framework/io/io_test.go b/ts/go/pkg/framework/io/io_test.go similarity index 95% rename from go/pkg/framework/io/io_test.go rename to ts/go/pkg/framework/io/io_test.go index 24ca39bc6..27b3c6a4f 100644 --- a/go/pkg/framework/io/io_test.go +++ b/ts/go/pkg/framework/io/io_test.go @@ -17,8 +17,8 @@ package io import ( "testing" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/types" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/testing/fake" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/types" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/testing/fake" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" ) diff --git a/go/pkg/framework/io/registry.go b/ts/go/pkg/framework/io/registry.go similarity index 96% rename from go/pkg/framework/io/registry.go rename to ts/go/pkg/framework/io/registry.go index f9e68b3dc..7c24afc1d 100644 --- a/go/pkg/framework/io/registry.go +++ b/ts/go/pkg/framework/io/registry.go @@ -16,7 +16,8 @@ package io import ( "encoding/json" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/types" + + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/types" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime/schema" ) diff --git a/go/pkg/framework/runners/runners.go b/ts/go/pkg/framework/runners/runners.go similarity index 92% rename from go/pkg/framework/runners/runners.go rename to ts/go/pkg/framework/runners/runners.go index dd797b90f..9f691232e 100644 --- a/go/pkg/framework/runners/runners.go +++ b/ts/go/pkg/framework/runners/runners.go @@ -17,8 +17,8 @@ package runners import ( "os" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/io" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/types" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/io" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/types" "github.com/spf13/cobra" ) diff --git a/go/pkg/framework/types/config_error.go b/ts/go/pkg/framework/types/config_error.go similarity index 96% rename from go/pkg/framework/types/config_error.go rename to ts/go/pkg/framework/types/config_error.go index 61db6e018..b398db69f 100644 --- a/go/pkg/framework/types/config_error.go +++ b/ts/go/pkg/framework/types/config_error.go @@ -19,7 +19,7 @@ import ( "fmt" "strings" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/constants" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/constants" ) // Error implements error. diff --git a/go/pkg/framework/types/types.go b/ts/go/pkg/framework/types/types.go similarity index 100% rename from go/pkg/framework/types/types.go rename to ts/go/pkg/framework/types/types.go diff --git a/go/pkg/framework/types/unstructured.go b/ts/go/pkg/framework/types/unstructured.go similarity index 99% rename from go/pkg/framework/types/unstructured.go rename to ts/go/pkg/framework/types/unstructured.go index e6ef34258..b35900ffe 100644 --- a/go/pkg/framework/types/unstructured.go +++ b/ts/go/pkg/framework/types/unstructured.go @@ -16,6 +16,7 @@ package types import ( "encoding/json" + "gopkg.in/yaml.v2" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) diff --git a/go/pkg/functions/gatekeeper/validate.go b/ts/go/pkg/functions/gatekeeper/validate.go similarity index 93% rename from go/pkg/functions/gatekeeper/validate.go rename to ts/go/pkg/functions/gatekeeper/validate.go index d784ac000..a4a19403c 100644 --- a/go/pkg/functions/gatekeeper/validate.go +++ b/ts/go/pkg/functions/gatekeeper/validate.go @@ -21,10 +21,10 @@ import ( "sort" "strings" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/constants" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/io" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/types" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/functions/util" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/constants" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/io" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/types" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/functions/util" "github.com/open-policy-agent/frameworks/constraint/pkg/apis/templates/v1beta1" opaclient "github.com/open-policy-agent/frameworks/constraint/pkg/client" "github.com/open-policy-agent/frameworks/constraint/pkg/client/drivers/local" diff --git a/go/pkg/functions/util/unstructured.go b/ts/go/pkg/functions/util/unstructured.go similarity index 92% rename from go/pkg/functions/util/unstructured.go rename to ts/go/pkg/functions/util/unstructured.go index 26115537a..59b7fc113 100644 --- a/go/pkg/functions/util/unstructured.go +++ b/ts/go/pkg/functions/util/unstructured.go @@ -17,7 +17,7 @@ package util import ( "encoding/json" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/types" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/types" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) diff --git a/go/pkg/swagger/alias.go b/ts/go/pkg/swagger/alias.go similarity index 100% rename from go/pkg/swagger/alias.go rename to ts/go/pkg/swagger/alias.go diff --git a/go/pkg/swagger/arrays.go b/ts/go/pkg/swagger/arrays.go similarity index 100% rename from go/pkg/swagger/arrays.go rename to ts/go/pkg/swagger/arrays.go diff --git a/go/pkg/swagger/definition.go b/ts/go/pkg/swagger/definition.go similarity index 100% rename from go/pkg/swagger/definition.go rename to ts/go/pkg/swagger/definition.go diff --git a/go/pkg/swagger/empty.go b/ts/go/pkg/swagger/empty.go similarity index 100% rename from go/pkg/swagger/empty.go rename to ts/go/pkg/swagger/empty.go diff --git a/go/pkg/swagger/fields.go b/ts/go/pkg/swagger/fields.go similarity index 100% rename from go/pkg/swagger/fields.go rename to ts/go/pkg/swagger/fields.go diff --git a/go/pkg/swagger/imports.go b/ts/go/pkg/swagger/imports.go similarity index 100% rename from go/pkg/swagger/imports.go rename to ts/go/pkg/swagger/imports.go diff --git a/go/pkg/swagger/language/languages.go b/ts/go/pkg/swagger/language/languages.go similarity index 95% rename from go/pkg/swagger/language/languages.go rename to ts/go/pkg/swagger/language/languages.go index b8717301b..a22008456 100644 --- a/go/pkg/swagger/language/languages.go +++ b/ts/go/pkg/swagger/language/languages.go @@ -14,7 +14,7 @@ package language -import "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/swagger" +import "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/swagger" // Language implements the minimum required to print client code for a Definition in a particular programming language. // diff --git a/go/pkg/swagger/language/ts.go b/ts/go/pkg/swagger/language/ts.go similarity index 99% rename from go/pkg/swagger/language/ts.go rename to ts/go/pkg/swagger/language/ts.go index 19090adad..5a54dac69 100644 --- a/go/pkg/swagger/language/ts.go +++ b/ts/go/pkg/swagger/language/ts.go @@ -19,7 +19,7 @@ import ( "sort" "strings" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/swagger" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/swagger" ) // TypeScript implements Language-specific logic for TypeScript. diff --git a/go/pkg/swagger/language/ts_test.go b/ts/go/pkg/swagger/language/ts_test.go similarity index 99% rename from go/pkg/swagger/language/ts_test.go rename to ts/go/pkg/swagger/language/ts_test.go index 7c5dcd8e5..13b60e5ca 100644 --- a/go/pkg/swagger/language/ts_test.go +++ b/ts/go/pkg/swagger/language/ts_test.go @@ -18,7 +18,7 @@ import ( "strings" "testing" - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/swagger" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/swagger" "github.com/google/go-cmp/cmp" ) diff --git a/go/pkg/swagger/map.go b/ts/go/pkg/swagger/map.go similarity index 100% rename from go/pkg/swagger/map.go rename to ts/go/pkg/swagger/map.go diff --git a/go/pkg/swagger/objects.go b/ts/go/pkg/swagger/objects.go similarity index 100% rename from go/pkg/swagger/objects.go rename to ts/go/pkg/swagger/objects.go diff --git a/go/pkg/swagger/objects_test.go b/ts/go/pkg/swagger/objects_test.go similarity index 100% rename from go/pkg/swagger/objects_test.go rename to ts/go/pkg/swagger/objects_test.go diff --git a/go/pkg/swagger/parser.go b/ts/go/pkg/swagger/parser.go similarity index 100% rename from go/pkg/swagger/parser.go rename to ts/go/pkg/swagger/parser.go diff --git a/go/pkg/swagger/parser_test.go b/ts/go/pkg/swagger/parser_test.go similarity index 100% rename from go/pkg/swagger/parser_test.go rename to ts/go/pkg/swagger/parser_test.go diff --git a/go/pkg/swagger/primitives.go b/ts/go/pkg/swagger/primitives.go similarity index 100% rename from go/pkg/swagger/primitives.go rename to ts/go/pkg/swagger/primitives.go diff --git a/go/pkg/swagger/properties.go b/ts/go/pkg/swagger/properties.go similarity index 100% rename from go/pkg/swagger/properties.go rename to ts/go/pkg/swagger/properties.go diff --git a/go/pkg/swagger/properties_test.go b/ts/go/pkg/swagger/properties_test.go similarity index 100% rename from go/pkg/swagger/properties_test.go rename to ts/go/pkg/swagger/properties_test.go diff --git a/go/pkg/swagger/refs.go b/ts/go/pkg/swagger/refs.go similarity index 100% rename from go/pkg/swagger/refs.go rename to ts/go/pkg/swagger/refs.go diff --git a/go/pkg/swagger/swagger.go b/ts/go/pkg/swagger/swagger.go similarity index 100% rename from go/pkg/swagger/swagger.go rename to ts/go/pkg/swagger/swagger.go diff --git a/go/pkg/swagger/swagger_test.go b/ts/go/pkg/swagger/swagger_test.go similarity index 100% rename from go/pkg/swagger/swagger_test.go rename to ts/go/pkg/swagger/swagger_test.go diff --git a/go/pkg/swagger/testdata/swagger-v1.13.0.json b/ts/go/pkg/swagger/testdata/swagger-v1.13.0.json similarity index 100% rename from go/pkg/swagger/testdata/swagger-v1.13.0.json rename to ts/go/pkg/swagger/testdata/swagger-v1.13.0.json diff --git a/go/pkg/swagger/testdata/swagger-v1.14.3.json b/ts/go/pkg/swagger/testdata/swagger-v1.14.3.json similarity index 100% rename from go/pkg/swagger/testdata/swagger-v1.14.3.json rename to ts/go/pkg/swagger/testdata/swagger-v1.14.3.json diff --git a/go/pkg/testing/fake/fake.go b/ts/go/pkg/testing/fake/fake.go similarity index 92% rename from go/pkg/testing/fake/fake.go rename to ts/go/pkg/testing/fake/fake.go index 3bf2722c2..c760f26ea 100644 --- a/go/pkg/testing/fake/fake.go +++ b/ts/go/pkg/testing/fake/fake.go @@ -15,7 +15,7 @@ package fake import ( - "github.com/GoogleContainerTools/kpt-functions-sdk/go/pkg/framework/types" + "github.com/GoogleContainerTools/kpt-functions-sdk/ts/go/pkg/framework/types" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/go/pkg/util/json.go b/ts/go/pkg/util/json.go similarity index 100% rename from go/pkg/util/json.go rename to ts/go/pkg/util/json.go diff --git a/go/scripts/e2e.sh b/ts/go/scripts/e2e.sh similarity index 100% rename from go/scripts/e2e.sh rename to ts/go/scripts/e2e.sh diff --git a/go/scripts/publish-functions.sh b/ts/go/scripts/publish-functions.sh similarity index 100% rename from go/scripts/publish-functions.sh rename to ts/go/scripts/publish-functions.sh diff --git a/go/testdata/source/gatekeeper/bad_repo.yaml b/ts/go/testdata/source/gatekeeper/bad_repo.yaml similarity index 100% rename from go/testdata/source/gatekeeper/bad_repo.yaml rename to ts/go/testdata/source/gatekeeper/bad_repo.yaml diff --git a/go/testdata/source/gatekeeper/good_repo.yaml b/ts/go/testdata/source/gatekeeper/good_repo.yaml similarity index 100% rename from go/testdata/source/gatekeeper/good_repo.yaml rename to ts/go/testdata/source/gatekeeper/good_repo.yaml diff --git a/go/testdata/source/pod-security-policy.yaml b/ts/go/testdata/source/pod-security-policy.yaml similarity index 100% rename from go/testdata/source/pod-security-policy.yaml rename to ts/go/testdata/source/pod-security-policy.yaml diff --git a/scripts/demo/demo-magic/.editorconfig b/ts/scripts/demo/demo-magic/.editorconfig similarity index 100% rename from scripts/demo/demo-magic/.editorconfig rename to ts/scripts/demo/demo-magic/.editorconfig diff --git a/scripts/demo/demo-magic/.gitignore b/ts/scripts/demo/demo-magic/.gitignore similarity index 100% rename from scripts/demo/demo-magic/.gitignore rename to ts/scripts/demo/demo-magic/.gitignore diff --git a/scripts/demo/demo-magic/README.md b/ts/scripts/demo/demo-magic/README.md similarity index 100% rename from scripts/demo/demo-magic/README.md rename to ts/scripts/demo/demo-magic/README.md diff --git a/scripts/demo/demo-magic/demo-magic.sh b/ts/scripts/demo/demo-magic/demo-magic.sh similarity index 100% rename from scripts/demo/demo-magic/demo-magic.sh rename to ts/scripts/demo/demo-magic/demo-magic.sh diff --git a/scripts/demo/demo-magic/license.txt b/ts/scripts/demo/demo-magic/license.txt similarity index 100% rename from scripts/demo/demo-magic/license.txt rename to ts/scripts/demo/demo-magic/license.txt diff --git a/scripts/demo/demo-magic/samples/demo-template.sh b/ts/scripts/demo/demo-magic/samples/demo-template.sh similarity index 100% rename from scripts/demo/demo-magic/samples/demo-template.sh rename to ts/scripts/demo/demo-magic/samples/demo-template.sh diff --git a/scripts/demo/run.sh b/ts/scripts/demo/run.sh similarity index 100% rename from scripts/demo/run.sh rename to ts/scripts/demo/run.sh diff --git a/scripts/gen-api-docs.sh b/ts/scripts/gen-api-docs.sh similarity index 100% rename from scripts/gen-api-docs.sh rename to ts/scripts/gen-api-docs.sh diff --git a/scripts/init-package.sh b/ts/scripts/init-package.sh similarity index 100% rename from scripts/init-package.sh rename to ts/scripts/init-package.sh diff --git a/scripts/mirrorImages.sh b/ts/scripts/mirrorImages.sh similarity index 100% rename from scripts/mirrorImages.sh rename to ts/scripts/mirrorImages.sh diff --git a/scripts/publish-bins.sh b/ts/scripts/publish-bins.sh similarity index 100% rename from scripts/publish-bins.sh rename to ts/scripts/publish-bins.sh diff --git a/scripts/publish-npm.sh b/ts/scripts/publish-npm.sh similarity index 100% rename from scripts/publish-npm.sh rename to ts/scripts/publish-npm.sh diff --git a/scripts/version-kpt-functions-sdk-deps.sh b/ts/scripts/version-kpt-functions-sdk-deps.sh similarity index 100% rename from scripts/version-kpt-functions-sdk-deps.sh rename to ts/scripts/version-kpt-functions-sdk-deps.sh diff --git a/scripts/version-kpt-functions-sdk.sh b/ts/scripts/version-kpt-functions-sdk.sh similarity index 100% rename from scripts/version-kpt-functions-sdk.sh rename to ts/scripts/version-kpt-functions-sdk.sh