Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
* delete webhook related make targets, dockerfile

Signed-off-by: Arko Dasgupta <[email protected]>
  • Loading branch information
arkodg committed Sep 15, 2023
1 parent 0de732b commit 18102b6
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 143 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,12 @@ all: generate vet fmt verify test

# Run generators for protos, Deepcopy funcs, CRDs, and docs.
.PHONY: generate
generate: update-codegen update-webhook-yaml
generate: update-codegen

.PHONY: update-codegen
update-codegen:
hack/update-codegen.sh

.PHONY: update-webhook-yaml
update-webhook-yaml:
hack/update-webhook-yaml.sh

.PHONY: build-install-yaml
build-install-yaml:
hack/build-install-yaml.sh
Expand Down
31 changes: 0 additions & 31 deletions docker/Dockerfile.webhook

This file was deleted.

16 changes: 0 additions & 16 deletions hack/build-and-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,6 @@ fi
# Support multi-arch image build and push.
BUILDX_PLATFORMS="linux/amd64,linux/arm64"

echo "Building and pushing admission-server image...${BUILDX_PLATFORMS}"

# First, build the image, with the version info passed in.
# Note that an image will *always* be built tagged with the GIT_TAG, so we know when it was built.
# And, we add an extra version tag - either :latest or semver.
# The buildx integrate build and push in one line.
docker buildx build \
-t ${REGISTRY}/admission-server:${GIT_TAG} \
-t ${REGISTRY}/admission-server:${VERSION_TAG} \
--build-arg "COMMIT=${COMMIT}" \
--build-arg "TAG=${BINARY_TAG}" \
--platform ${BUILDX_PLATFORMS} \
--push \
-f docker/Dockerfile.webhook \
.

echo "Building and pushing echo-server image...${BUILDX_PLATFORMS}"

docker buildx build \
Expand Down
44 changes: 0 additions & 44 deletions hack/update-webhook-yaml.sh

This file was deleted.

47 changes: 0 additions & 47 deletions hack/verify-crds-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ cleanup() {
return
fi

rm -f config/webhook/kustomization.yaml

if [ "${KIND_CREATE_ATTEMPTED:-}" = true ]; then
kind delete cluster --name "${CLUSTER_NAME}" || true
fi
Expand Down Expand Up @@ -119,51 +117,6 @@ EOF
kubectl delete -f "config/crd/${CHANNEL}/gateway*.yaml" || res=$?
done

###
# This section and below can be REMOVED once the webhook is removed.
###
# Install webhook and check the _invalid_ examples again.
cat <<EOF >config/webhook/kustomization.yaml
resources:
- 0-namespace.yaml
- certificate_config.yaml
- admission_webhook.yaml
patches:
- patch: |-
- op: replace
path: /spec/template/spec/containers/0/image
value: ${LOCAL_IMAGE}
- op: replace
path: /spec/template/spec/containers/0/imagePullPolicy
value: IfNotPresent
target:
group: apps
version: v1
kind: Deployment
name: gateway-api-admission-server
EOF



docker build -t ${LOCAL_IMAGE} -f docker/Dockerfile.webhook .
kind load docker-image ${LOCAL_IMAGE} --name "${CLUSTER_NAME}"
kubectl apply -k config/webhook/

# Wait for webhook to be ready
for check in {1..10}; do
sleep 5
NUM_COMPLETED=$(kubectl get po -n gateway-system | grep Completed | wc -l | xargs || echo Failed to get completed Pods)
if [ "${NUM_COMPLETED}" = "2" ]; then
echo "Webhook successfully configured"
break
elif [ "${check}" = "10" ]; then
echo "Timed out waiting for webhook setup to complete"
cleanup
exit 1
fi
echo "Webhook not ready yet, will check again in 5 seconds"
done

for CHANNEL in experimental standard; do
##### Test valid CRD apply and that invalid examples are invalid.
# Install CRDs
Expand Down

0 comments on commit 18102b6

Please sign in to comment.