diff --git a/Containerfile.wasp b/Containerfile.wasp index 555633c6..2efb3f41 100644 --- a/Containerfile.wasp +++ b/Containerfile.wasp @@ -26,7 +26,6 @@ FROM fedora:38 # Copy the binary from the builder stage to the final image COPY --from=builder /workdir/app/wasp /app/wasp -COPY OCI-hook /app/OCI-hook # Set the working directory to /app WORKDIR /app diff --git a/OCI-hook/hook.sh b/OCI-hook/hook.sh deleted file mode 100644 index 9fb23622..00000000 --- a/OCI-hook/hook.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/bash - -echo "WASP SWAP hook" - -set -x - -CG_PATH=$(jq -er '.linux.cgroupsPath' < config.json) -POD_NAMESPACE=$(jq -er '.annotations["io.kubernetes.pod.namespace"]' < config.json) - -if [[ "$CG_PATH" =~ .*"burst".* ]]; -then - CONTAINERID=$(jq -er '.linux.cgroupsPath | split(":")[2]' < config.json) - runc update $CONTAINERID --memory-swap -1 -fi diff --git a/OCI-hook/swap-for-burstable.json b/OCI-hook/swap-for-burstable.json deleted file mode 100644 index 1846ff2a..00000000 --- a/OCI-hook/swap-for-burstable.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "1.0.0", - "hook": { - "path": "/opt/oci-hook-swap.sh" - }, - "when": { - "always": true - }, - "stages": [ - "poststart" - ] -} \ No newline at end of file diff --git a/pkg/wasp/application.go b/pkg/wasp/application.go index e80b1a1a..637c2940 100644 --- a/pkg/wasp/application.go +++ b/pkg/wasp/application.go @@ -59,7 +59,6 @@ func Execute() { flag.Parse() setCrioSocketSymLink() - setOCIHook() var app = WaspApp{} swapUtilizationThresholdFactorStr := os.Getenv("SWAP_UTILIZATION_THRESHOLD_FACTOR") @@ -201,18 +200,6 @@ func setCrioSocketSymLink() { } } -func setOCIHook() { - err := moveFile("/app/OCI-hook/hook.sh", "/host/opt/oci-hook-swap.sh") - if err != nil { - klog.Warningf(err.Error()) - return - } - err = moveFile("/app/OCI-hook/swap-for-burstable.json", "/host/run/containers/oci/hooks.d/swap-for-burstable.json") - if err != nil { - klog.Warningf(err.Error()) - } -} - func moveFile(sourcePath, destPath string) error { inputFile, err := os.Open(sourcePath) if err != nil {