diff --git a/commands/fn/doc/cmdfndoc.go b/commands/fn/doc/cmdfndoc.go index 53b32b35e4..c0c0d716bf 100644 --- a/commands/fn/doc/cmdfndoc.go +++ b/commands/fn/doc/cmdfndoc.go @@ -23,7 +23,7 @@ import ( "os/exec" "github.com/kptdev/kpt/internal/docs/generated/fndocs" - "github.com/kptdev/kpt/internal/fnruntime" + fnruntime "github.com/kptdev/kpt/pkg/fn/runtime" "github.com/kptdev/kpt/pkg/lib/runneroptions" "github.com/kptdev/kpt/pkg/lib/util/cmdutil" "github.com/kptdev/kpt/pkg/printer" diff --git a/commands/fn/doc/cmdfndoc_test.go b/commands/fn/doc/cmdfndoc_test.go index 16a0297f7e..58f28d0a64 100644 --- a/commands/fn/doc/cmdfndoc_test.go +++ b/commands/fn/doc/cmdfndoc_test.go @@ -21,7 +21,7 @@ import ( "testing" "github.com/kptdev/kpt/commands/fn/doc" - "github.com/kptdev/kpt/internal/fnruntime" + fnruntime "github.com/kptdev/kpt/pkg/fn/runtime" "github.com/kptdev/kpt/pkg/printer/fake" "sigs.k8s.io/kustomize/kyaml/testutil" ) diff --git a/e2e/fn_test.go b/e2e/fn_test.go index 62bce3528e..9cffe864c8 100644 --- a/e2e/fn_test.go +++ b/e2e/fn_test.go @@ -22,7 +22,7 @@ import ( "strings" "testing" - "github.com/kptdev/kpt/internal/fnruntime" + fnruntime "github.com/kptdev/kpt/pkg/fn/runtime" "github.com/kptdev/kpt/pkg/test/runner" ) diff --git a/internal/hook/executor.go b/internal/hook/executor.go index ecdc82be94..8595463b36 100644 --- a/internal/hook/executor.go +++ b/internal/hook/executor.go @@ -19,12 +19,12 @@ import ( "fmt" "io" - "github.com/kptdev/kpt/internal/fnruntime" "github.com/kptdev/kpt/internal/pkg" "github.com/kptdev/kpt/internal/types" fnresult "github.com/kptdev/kpt/pkg/api/fnresult/v1" kptfilev1 "github.com/kptdev/kpt/pkg/api/kptfile/v1" "github.com/kptdev/kpt/pkg/fn" + fnruntime "github.com/kptdev/kpt/pkg/fn/runtime" "github.com/kptdev/kpt/pkg/lib/runneroptions" "sigs.k8s.io/kustomize/kyaml/filesys" "sigs.k8s.io/kustomize/kyaml/kio" diff --git a/internal/util/render/executor.go b/internal/util/render/executor.go index 10406fd6e5..ce667cc9ac 100644 --- a/internal/util/render/executor.go +++ b/internal/util/render/executor.go @@ -23,7 +23,6 @@ import ( "slices" "strings" - "github.com/kptdev/kpt/internal/fnruntime" "github.com/kptdev/kpt/internal/pkg" "github.com/kptdev/kpt/internal/types" "github.com/kptdev/kpt/internal/util/attribution" @@ -31,6 +30,7 @@ import ( fnresult "github.com/kptdev/kpt/pkg/api/fnresult/v1" kptfilev1 "github.com/kptdev/kpt/pkg/api/kptfile/v1" "github.com/kptdev/kpt/pkg/fn" + fnruntime "github.com/kptdev/kpt/pkg/fn/runtime" "github.com/kptdev/kpt/pkg/kptfile/kptfileutil" "github.com/kptdev/kpt/pkg/lib/errors" "github.com/kptdev/kpt/pkg/lib/runneroptions" diff --git a/internal/util/render/executor_test.go b/internal/util/render/executor_test.go index 9f4280a794..ac07c74af5 100644 --- a/internal/util/render/executor_test.go +++ b/internal/util/render/executor_test.go @@ -22,11 +22,11 @@ import ( "strings" "testing" - "github.com/kptdev/kpt/internal/fnruntime" "github.com/kptdev/kpt/internal/pkg" "github.com/kptdev/kpt/internal/types" fnresult "github.com/kptdev/kpt/pkg/api/fnresult/v1" kptfilev1 "github.com/kptdev/kpt/pkg/api/kptfile/v1" + fnruntime "github.com/kptdev/kpt/pkg/fn/runtime" "github.com/kptdev/kpt/pkg/kptfile/kptfileutil" "github.com/kptdev/kpt/pkg/printer" "github.com/stretchr/testify/assert" diff --git a/internal/fnruntime/container.go b/pkg/fn/runtime/container.go similarity index 99% rename from internal/fnruntime/container.go rename to pkg/fn/runtime/container.go index bbb66eb2e7..766fe35123 100644 --- a/internal/fnruntime/container.go +++ b/pkg/fn/runtime/container.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "bufio" diff --git a/internal/fnruntime/container_test.go b/pkg/fn/runtime/container_test.go similarity index 99% rename from internal/fnruntime/container_test.go rename to pkg/fn/runtime/container_test.go index a70c886fe5..ad523cfdd6 100644 --- a/internal/fnruntime/container_test.go +++ b/pkg/fn/runtime/container_test.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "bytes" diff --git a/internal/fnruntime/container_utils.go b/pkg/fn/runtime/container_utils.go similarity index 98% rename from internal/fnruntime/container_utils.go rename to pkg/fn/runtime/container_utils.go index 21026fbb68..12f8f58c84 100644 --- a/internal/fnruntime/container_utils.go +++ b/pkg/fn/runtime/container_utils.go @@ -1,4 +1,4 @@ -package fnruntime +package runtime import ( "bytes" diff --git a/internal/fnruntime/container_utils_test.go b/pkg/fn/runtime/container_utils_test.go similarity index 99% rename from internal/fnruntime/container_utils_test.go rename to pkg/fn/runtime/container_utils_test.go index 2c220d2f9e..20cd978a87 100644 --- a/internal/fnruntime/container_utils_test.go +++ b/pkg/fn/runtime/container_utils_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "testing" diff --git a/internal/fnruntime/exec.go b/pkg/fn/runtime/exec.go similarity index 99% rename from internal/fnruntime/exec.go rename to pkg/fn/runtime/exec.go index f6e2a25d2f..49f5141653 100644 --- a/internal/fnruntime/exec.go +++ b/pkg/fn/runtime/exec.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "bytes" diff --git a/internal/fnruntime/fnerrors.go b/pkg/fn/runtime/fnerrors.go similarity index 99% rename from internal/fnruntime/fnerrors.go rename to pkg/fn/runtime/fnerrors.go index bc7007dc48..eaa69c5693 100644 --- a/internal/fnruntime/fnerrors.go +++ b/pkg/fn/runtime/fnerrors.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "fmt" diff --git a/internal/fnruntime/fnerrors_test.go b/pkg/fn/runtime/fnerrors_test.go similarity index 99% rename from internal/fnruntime/fnerrors_test.go rename to pkg/fn/runtime/fnerrors_test.go index 7125171c2c..7068b23647 100644 --- a/internal/fnruntime/fnerrors_test.go +++ b/pkg/fn/runtime/fnerrors_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "bytes" diff --git a/internal/fnruntime/imagepullpolicy.go b/pkg/fn/runtime/imagepullpolicy.go similarity index 99% rename from internal/fnruntime/imagepullpolicy.go rename to pkg/fn/runtime/imagepullpolicy.go index 2f7df26ca4..ef740dddb1 100644 --- a/internal/fnruntime/imagepullpolicy.go +++ b/pkg/fn/runtime/imagepullpolicy.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "fmt" diff --git a/internal/fnruntime/jsglue.go b/pkg/fn/runtime/jsglue.go similarity index 99% rename from internal/fnruntime/jsglue.go rename to pkg/fn/runtime/jsglue.go index ddbd7a7df3..1aad3d7405 100644 --- a/internal/fnruntime/jsglue.go +++ b/pkg/fn/runtime/jsglue.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime // The glue code below has been tested with node.js v18.6.0. // It may need some small changes to work with v14 and v16. diff --git a/internal/fnruntime/nodejs.go b/pkg/fn/runtime/nodejs.go similarity index 99% rename from internal/fnruntime/nodejs.go rename to pkg/fn/runtime/nodejs.go index 8f0bb4e13a..420f843098 100644 --- a/internal/fnruntime/nodejs.go +++ b/pkg/fn/runtime/nodejs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "fmt" diff --git a/internal/fnruntime/runner.go b/pkg/fn/runtime/runner.go similarity index 99% rename from internal/fnruntime/runner.go rename to pkg/fn/runtime/runner.go index 3cef092b58..dea979b45a 100644 --- a/internal/fnruntime/runner.go +++ b/pkg/fn/runtime/runner.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "context" diff --git a/internal/fnruntime/runner_test.go b/pkg/fn/runtime/runner_test.go similarity index 99% rename from internal/fnruntime/runner_test.go rename to pkg/fn/runtime/runner_test.go index 0c009b7f97..74bdb5f786 100644 --- a/internal/fnruntime/runner_test.go +++ b/pkg/fn/runtime/runner_test.go @@ -14,7 +14,7 @@ // Package pipeline provides struct definitions for Pipeline and utility // methods to read and write a pipeline resource. -package fnruntime +package runtime import ( "bytes" diff --git a/internal/fnruntime/tag_resolution.go b/pkg/fn/runtime/tag_resolution.go similarity index 99% rename from internal/fnruntime/tag_resolution.go rename to pkg/fn/runtime/tag_resolution.go index 1fb635fefd..18ae91e7f5 100644 --- a/internal/fnruntime/tag_resolution.go +++ b/pkg/fn/runtime/tag_resolution.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "context" diff --git a/internal/fnruntime/tag_resolution_test.go b/pkg/fn/runtime/tag_resolution_test.go similarity index 99% rename from internal/fnruntime/tag_resolution_test.go rename to pkg/fn/runtime/tag_resolution_test.go index e8afd97756..24b6099566 100644 --- a/internal/fnruntime/tag_resolution_test.go +++ b/pkg/fn/runtime/tag_resolution_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "context" diff --git a/internal/fnruntime/utils.go b/pkg/fn/runtime/utils.go similarity index 99% rename from internal/fnruntime/utils.go rename to pkg/fn/runtime/utils.go index 147d67b4b8..6d4289c6b5 100644 --- a/internal/fnruntime/utils.go +++ b/pkg/fn/runtime/utils.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "bytes" diff --git a/internal/fnruntime/utils_test.go b/pkg/fn/runtime/utils_test.go similarity index 99% rename from internal/fnruntime/utils_test.go rename to pkg/fn/runtime/utils_test.go index 9d05ed31f1..ff6bd0b241 100644 --- a/internal/fnruntime/utils_test.go +++ b/pkg/fn/runtime/utils_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "testing" diff --git a/internal/fnruntime/wasm.go b/pkg/fn/runtime/wasm.go similarity index 99% rename from internal/fnruntime/wasm.go rename to pkg/fn/runtime/wasm.go index f626c8edac..e3d9378718 100644 --- a/internal/fnruntime/wasm.go +++ b/pkg/fn/runtime/wasm.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "context" diff --git a/internal/fnruntime/wasmtime.go b/pkg/fn/runtime/wasmtime.go similarity index 98% rename from internal/fnruntime/wasmtime.go rename to pkg/fn/runtime/wasmtime.go index 1537549082..67202be6f9 100644 --- a/internal/fnruntime/wasmtime.go +++ b/pkg/fn/runtime/wasmtime.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime import ( "errors" @@ -23,7 +23,7 @@ import ( "log" "os" - wasmtime "github.com/bytecodealliance/wasmtime-go" + "github.com/bytecodealliance/wasmtime-go" "github.com/prep/wasmexec" "github.com/prep/wasmexec/wasmtimexec" "sigs.k8s.io/kustomize/kyaml/yaml" diff --git a/internal/fnruntime/wasmtime_unsupported.go b/pkg/fn/runtime/wasmtime_unsupported.go similarity index 98% rename from internal/fnruntime/wasmtime_unsupported.go rename to pkg/fn/runtime/wasmtime_unsupported.go index ba52f8927c..7ff287de6b 100644 --- a/internal/fnruntime/wasmtime_unsupported.go +++ b/pkg/fn/runtime/wasmtime_unsupported.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fnruntime +package runtime // Stub functions for running without wasmtime support compiled in. // wasmtime requires cgo, which is not always a viable option. diff --git a/pkg/lib/errors/resolver/container.go b/pkg/lib/errors/resolver/container.go index 7946fca9dd..3966ab2ea5 100644 --- a/pkg/lib/errors/resolver/container.go +++ b/pkg/lib/errors/resolver/container.go @@ -17,7 +17,7 @@ package resolver import ( "errors" - "github.com/kptdev/kpt/internal/fnruntime" + fnruntime "github.com/kptdev/kpt/pkg/fn/runtime" ) //nolint:gochecknoinits diff --git a/pkg/test/runner/runner.go b/pkg/test/runner/runner.go index c6a4ed5a2a..847c82e84e 100644 --- a/pkg/test/runner/runner.go +++ b/pkg/test/runner/runner.go @@ -24,7 +24,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/kptdev/kpt/internal/fnruntime" + fnruntime "github.com/kptdev/kpt/pkg/fn/runtime" ) // Runner runs an e2e test diff --git a/thirdparty/kyaml/runfn/runfn.go b/thirdparty/kyaml/runfn/runfn.go index df6c57af2c..a1264791ef 100644 --- a/thirdparty/kyaml/runfn/runfn.go +++ b/thirdparty/kyaml/runfn/runfn.go @@ -13,6 +13,7 @@ import ( "strings" "github.com/kptdev/kpt/internal/types" + fnruntime "github.com/kptdev/kpt/pkg/fn/runtime" "github.com/kptdev/kpt/pkg/lib/runneroptions" "github.com/kptdev/kpt/pkg/printer" "sigs.k8s.io/kustomize/kyaml/errors" @@ -21,7 +22,6 @@ import ( "sigs.k8s.io/kustomize/kyaml/kio" "sigs.k8s.io/kustomize/kyaml/yaml" - "github.com/kptdev/kpt/internal/fnruntime" "github.com/kptdev/kpt/internal/pkg" "github.com/kptdev/kpt/internal/util/printerutil" fnresult "github.com/kptdev/kpt/pkg/api/fnresult/v1"