Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/fn/cmdeval/cmdeval.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ func GetEvalFnRunner(ctx context.Context, parent string) *EvalFnRunner {
})

r.Command.Flags().BoolVar(
&r.RunnerOptions.AllowWasm, "allow-alpha-wasm", false, "allow alpha wasm functions to be run."+
" If true, you can specify a wasm image with --image flag or a path to a wasm file (must have the .wasm file extension) with --exec flag.")
&r.RunnerOptions.AllowWasm, "allow-alpha-wasm", false, "support for WASM functions has been removed from kpt."+
" If true, running a function given with --image, or a .wasm file given with --exec, fails with an error.")

// selector flags
r.Command.Flags().StringVar(
Expand Down
2 changes: 1 addition & 1 deletion cli/fn/render/cmdrender.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewRunner(ctx context.Context, parent string) *Runner {
c.Flags().BoolVar(&r.RunnerOptions.AllowNetwork, "allow-network", false,
"allow functions to access network during pipeline execution.")
c.Flags().BoolVar(&r.RunnerOptions.AllowWasm, "allow-alpha-wasm", r.RunnerOptions.AllowWasm,
"allow wasm to be used during pipeline execution.")
"support for WASM functions has been removed from kpt. If true, every pipeline function fails with an error.")
cmdutil.FixDocs("kpt", parent, c)
r.Command = c
return r
Expand Down
4 changes: 3 additions & 1 deletion e2e/testdata/fn-eval/wasm-function/.expected/config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 The kpt Authors
# Copyright 2022-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,3 +17,5 @@ image: ghcr.io/kptdev/krm-functions-catalog/wasm/set-namespace:v0.5.1
args:
namespace: staging
allowWasm: true
exitCode: 1
stdErr: "support for WASM functions has been removed from kpt"
11 changes: 0 additions & 11 deletions e2e/testdata/fn-eval/wasm-function/.expected/diff.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 The kpt Authors
# Copyright 2022-2026 The kpt Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,3 +14,5 @@

sequential: true
allowWasm: true
exitCode: 1
stdErr: "support for WASM functions has been removed from kpt"
50 changes: 10 additions & 40 deletions e2e/testdata/fn-render/basicpipeline-wasm/.expected/diff.patch
Original file line number Diff line number Diff line change
@@ -1,52 +1,22 @@
diff --git a/Kptfile b/Kptfile
index 17a7822..98fa855 100644
index 17a7822..b3032ae 100644
--- a/Kptfile
+++ b/Kptfile
@@ -12,3 +12,22 @@ pipeline:
@@ -12,3 +12,17 @@ pipeline:
- image: ghcr.io/kptdev/krm-functions-catalog/wasm/set-labels:v0.2.4
configMap:
tier: backend
+status:
+ conditions:
+ - type: Rendered
+ status: "True"
+ reason: RenderSuccess
+ status: "False"
+ reason: RenderFailed
+ message: |-
+ pkg.render: pkg .:
+ pipeline.run: support for WASM functions has been removed from kpt, run the function as a container image or an executable instead
+ renderStatus:
+ mutationSteps:
+ - image: ghcr.io/kptdev/krm-functions-catalog/wasm/set-namespace:v0.5.1
+ exitCode: 0
+ results:
+ - message: namespace [default] updated to "staging", 1 value(s) changed
+ severity: info
+ - message: all `depends-on` annotations are up-to-date. no `namespace` changed
+ severity: info
+ - image: ghcr.io/kptdev/krm-functions-catalog/wasm/set-labels:v0.2.4
+ exitCode: 0
+ results:
+ - message: set 4 labels in total
+ severity: info
diff --git a/resources.yaml b/resources.yaml
index eed43d6..c1de2b0 100644
--- a/resources.yaml
+++ b/resources.yaml
@@ -15,12 +15,20 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
+ namespace: staging
+ labels:
+ tier: backend
spec:
replicas: 3
+ selector:
+ matchLabels:
+ tier: backend
---
apiVersion: custom.io/v1
kind: Custom
metadata:
name: custom
+ labels:
+ tier: backend
spec:
image: nginx:1.2.3
+ executionError: support for WASM functions has been removed from kpt, run the function as a container image or an executable instead
+ exitCode: 1
+ errorSummary: 'ghcr.io/kptdev/krm-functions-catalog/wasm/set-namespace:v0.5.1: support for WASM functions has been removed from kpt, run the function as a container image or an executable instead'
16 changes: 0 additions & 16 deletions e2e/testdata/fn-render/basicpipeline-wasm/.expected/setup.sh

This file was deleted.

16 changes: 0 additions & 16 deletions e2e/testdata/fn-render/basicpipeline-wasm/.expected/teardown.sh

This file was deleted.

2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ go 1.26.9

require (
github.com/Masterminds/semver/v3 v3.5.0
github.com/bytecodealliance/wasmtime-go v1.0.0
github.com/cpuguy83/go-md2man/v2 v2.0.7
github.com/distribution/reference v0.6.0
github.com/go-errors/errors v1.5.1
Expand All @@ -18,7 +17,6 @@ require (
github.com/otiai10/copy v1.14.1
github.com/philopon/go-toposort v0.0.0-20170620085441-9be86dbd762f
github.com/pkg/errors v0.9.1
github.com/prep/wasmexec v0.0.0-20220807105708-6554945c1dec
github.com/regclient/regclient v0.11.5
github.com/spf13/cobra v1.10.2
github.com/stretchr/testify v1.11.1
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/bytecodealliance/wasmtime-go v1.0.0 h1:9u9gqaUiaJeN5IoD1L7egD8atOnTGyJcNp8BhkL9cUU=
github.com/bytecodealliance/wasmtime-go v1.0.0/go.mod h1:jjlqQbWUfVSbehpErw3UoWFndBXRRMvfikYH6KsCwOg=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chai2010/gettext-go v1.0.3 h1:9liNh8t+u26xl5ddmWLmsOsdNLwkdRTg5AG+JnTiM80=
Expand Down Expand Up @@ -164,8 +162,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prep/wasmexec v0.0.0-20220807105708-6554945c1dec h1:Yz85KaIsPzF0YRrznNaD35o4GEk65/3mqio3m9sgqi4=
github.com/prep/wasmexec v0.0.0-20220807105708-6554945c1dec/go.mod h1:/AG7CoBOwtk42jdCTLbd280PA4h50oaFK88jee+BaVA=
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
Expand Down
2 changes: 0 additions & 2 deletions make/info.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ YEAR_GEN := $(shell date '+%Y')
GOBIN := $(shell go env GOPATH)/bin
KPT_VERSION := $(shell date '+development-%Y-%m-%dT%H:%M:%S')

export KPT_FN_WASM_RUNTIME ?= nodejs

LDFLAGS := -ldflags "-X main.version=${KPT_VERSION}
ifeq ($(OS),Windows_NT)
# Do nothing
Expand Down
Loading