apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
  - script: |
      if kubectl scale deployment nginx-test --replicas=1 -n test-validate 2>&1 | grep -q 'validation error: nginx-test needs to have 2 replicas' 
      then 
        echo "Test failed. Resource was blocked from scaling."
        exit 1
      else 
        echo "Tested succeeded. Resource was allowed to scale."
        exit 0 
      fi