Skip to content

Commit

Permalink
remove duplicated WASMFilterImageURL var
Browse files Browse the repository at this point in the history
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
  • Loading branch information
eguzki committed Oct 1, 2024
1 parent a17b273 commit 1092921
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions controllers/rate_limiting_istio_wasmplugin_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
istioclientgoextensionv1alpha1 "istio.io/client-go/pkg/apis/extensions/v1alpha1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/env"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/handler"
Expand All @@ -44,10 +43,6 @@ import (
"github.com/kuadrant/kuadrant-operator/pkg/rlptools/wasm"
)

var (
WASMFilterImageURL = env.GetString("RELATED_IMAGE_WASMSHIM", "oci://quay.io/kuadrant/wasm-shim:latest")
)

func WASMPluginName(gw *gatewayapiv1.Gateway) string {
return fmt.Sprintf("kuadrant-%s", gw.Name)
}
Expand Down Expand Up @@ -118,7 +113,7 @@ func (r *RateLimitingIstioWASMPluginReconciler) desiredRateLimitingWASMPlugin(ct
},
Spec: istioextensionsv1alpha1.WasmPlugin{
TargetRef: kuadrantistioutils.PolicyTargetRefFromGateway(gw),
Url: WASMFilterImageURL,
Url: wasm.WASMFilterImageURL,
PluginConfig: nil,
// Insert plugin before Istio stats filters and after Istio authorization filters.
Phase: istioextensionsv1alpha1.PluginPhase_STATS,
Expand Down
4 changes: 2 additions & 2 deletions tests/envoygateway/wasm_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var _ = Describe("wasm controller", func() {
Expect(ext.Spec.Wasm).To(HaveLen(1))
Expect(ext.Spec.Wasm[0].Code.Type).To(Equal(egv1alpha1.ImageWasmCodeSourceType))
Expect(ext.Spec.Wasm[0].Code.Image).To(Not(BeNil()))
Expect(ext.Spec.Wasm[0].Code.Image.URL).To(Equal(controllers.WASMFilterImageURL))
Expect(ext.Spec.Wasm[0].Code.Image.URL).To(Equal(wasm.WASMFilterImageURL))
existingWASMConfig, err := wasm.ConfigFromJSON(ext.Spec.Wasm[0].Config)
Expect(err).ToNot(HaveOccurred())
Expect(existingWASMConfig).To(Equal(&wasm.Config{
Expand Down Expand Up @@ -301,7 +301,7 @@ var _ = Describe("wasm controller", func() {
Expect(ext.Spec.Wasm).To(HaveLen(1))
Expect(ext.Spec.Wasm[0].Code.Type).To(Equal(egv1alpha1.ImageWasmCodeSourceType))
Expect(ext.Spec.Wasm[0].Code.Image).To(Not(BeNil()))
Expect(ext.Spec.Wasm[0].Code.Image.URL).To(Equal(controllers.WASMFilterImageURL))
Expect(ext.Spec.Wasm[0].Code.Image.URL).To(Equal(wasm.WASMFilterImageURL))
existingWASMConfig, err := wasm.ConfigFromJSON(ext.Spec.Wasm[0].Config)
Expect(err).ToNot(HaveOccurred())
Expect(existingWASMConfig).To(Equal(&wasm.Config{
Expand Down

0 comments on commit 1092921

Please sign in to comment.