Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: run GatewayWithAttachedRoutes from Gateway API conformance suite #286

Merged
merged 2 commits into from
May 23, 2024
Merged
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
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ SHELL = bash
IMG ?= docker.io/kong/gateway-operator-oss
KUSTOMIZE_IMG_NAME = docker.io/kong/gateway-operator-oss

ifeq (Darwin,$(shell uname -s))
LDFLAGS_COMMON ?= -extldflags=-Wl,-ld_classic
endif

LDFLAGS_METADATA ?= \
-X $(REPO)/modules/manager/metadata.Release=$(TAG) \
-X $(REPO)/modules/manager/metadata.Commit=$(COMMIT) \
-X $(REPO)/modules/manager/metadata.Repo=$(REPO_INFO)

# ------------------------------------------------------------------------------
# Configuration - Tooling
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -142,10 +151,8 @@ build.operator.debug:

.PHONY: _build.operator
_build.operator:
go build -o bin/manager $(GCFLAGS) -ldflags "$(LDFLAGS) \
-X $(REPO)/modules/manager/metadata.Release=$(TAG) \
-X $(REPO)/modules/manager/metadata.Commit=$(COMMIT) \
-X $(REPO)/modules/manager/metadata.Repo=$(REPO_INFO)" \
go build -o bin/manager $(GCFLAGS) \
-ldflags "$(LDFLAGS_COMMON) $(LDFLAGS) $(LDFLAGS_METADATA)" \
cmd/main.go

.PHONY: build
Expand Down Expand Up @@ -315,6 +322,7 @@ _test.integration: webhook-certs-dir gotestsum
GOTESTSUM_FORMAT=$(GOTESTSUM_FORMAT) \
$(GOTESTSUM) -- $(GOTESTFLAGS) \
-timeout $(INTEGRATION_TEST_TIMEOUT) \
-ldflags "$(LDFLAGS_COMMON) $(LDFLAGS) $(LDFLAGS_METADATA)" \
-race \
-coverprofile=$(COVERPROFILE) \
./test/integration/...
Expand Down Expand Up @@ -343,6 +351,7 @@ test.integration_provision_dataplane_fail:
_test.e2e: gotestsum
GOTESTSUM_FORMAT=$(GOTESTSUM_FORMAT) \
$(GOTESTSUM) -- $(GOTESTFLAGS) \
-ldflags "$(LDFLAGS_COMMON) $(LDFLAGS) $(LDFLAGS_METADATA)" \
-race \
./test/e2e/...

Expand All @@ -359,6 +368,7 @@ _test.conformance: gotestsum
GOTESTSUM_FORMAT=$(GOTESTSUM_FORMAT) \
$(GOTESTSUM) -- $(GOTESTFLAGS) \
-timeout $(CONFORMANCE_TEST_TIMEOUT) \
-ldflags "$(LDFLAGS_COMMON) $(LDFLAGS) $(LDFLAGS_METADATA)" \
-race \
-parallel $(PARALLEL) \
./test/conformance/...
Expand All @@ -368,7 +378,7 @@ test.conformance:
@$(MAKE) _test.conformance \
KGO_PROJECT_URL=$(REPO) \
KGO_PROJECT_NAME=$(REPO_NAME) \
KGO_RELEASE=$(TAG)
KGO_RELEASE=$(TAG) \
GOTESTFLAGS="$(GOTESTFLAGS)"

.PHONY: test.samples
Expand Down
6 changes: 6 additions & 0 deletions controller/gateway/controller_reconciler_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,12 @@ func (g *gatewayConditionsAndListenersAwareT) setProgrammed() {
LastTransitionTime: metav1.Now(),
}
listenerStatus := listenerConditionsAware(listener)
rCond, ok := k8sutils.GetCondition(k8sutils.ConditionType(gatewayv1.ListenerConditionResolvedRefs), listenerStatus)
if ok && rCond.Status == metav1.ConditionFalse {
programmedCondition.Status = metav1.ConditionFalse
programmedCondition.Reason = string(gatewayv1.ListenerReasonPending)
programmedCondition.Message = "Listener references are not resolved yet."
}
mlavacca marked this conversation as resolved.
Show resolved Hide resolved
k8sutils.SetCondition(programmedCondition, listenerStatus)
}
}
Expand Down
2 changes: 0 additions & 2 deletions test/conformance/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ var skippedTests = []string{
// gateway
tests.GatewayInvalidTLSConfiguration.ShortName,
tests.GatewayModifyListeners.ShortName,
// TODO: https://github.com/Kong/gateway-operator/issues/56
tests.GatewayWithAttachedRoutes.ShortName,

// httproute
tests.HTTPRouteHeaderMatching.ShortName,
Expand Down
Loading