diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/publication_dns_contract_test.go b/internal/go/apps/gatewayendpoint/controllers/gateway/publication_dns_contract_test.go new file mode 100644 index 0000000..68669c7 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/publication_dns_contract_test.go @@ -0,0 +1,468 @@ +package gateway + +import ( + "bytes" + "context" + "crypto/sha256" + "encoding/json" + "fmt" + "net/http/httptest" + "os" + "path/filepath" + "reflect" + "sort" + "strings" + "testing" + + endpointcontroller "github.com/appthrust/dns-api/internal/go/apps/endpoint/controllers/endpointrecordset" + corezoneunit "github.com/appthrust/dns-api/internal/go/core/controllers/zoneunit" + route53 "github.com/appthrust/dns-api/internal/go/providers/route53/controllers/zoneunit" + route53conversion "github.com/appthrust/dns-api/internal/go/providers/route53/conversion" + dnsv1alpha1 "github.com/appthrust/dns-api/pkg/go/api/dns/v1alpha1" + endpointv1alpha1 "github.com/appthrust/dns-api/pkg/go/api/endpoint/v1alpha1" + route53v1alpha1 "github.com/appthrust/dns-api/pkg/go/api/route53/v1alpha1" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + apimeta "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/client/interceptor" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + gatewayv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +const publicationDNSContractDirectory = "testdata/publication-dns-contract/v1" + +type publicationDNSContract struct { + Scenario string `json:"scenario"` + Description string `json:"description"` + Gateway gatewayv1.Gateway `json:"gateway"` + Routes []gatewayv1.HTTPRoute `json:"routes"` + Expect struct { + DNS string `json:"dns"` + Hostnames []string `json:"hostnames"` + } `json:"expect"` +} + +// TestPublicationDNSContract consumes only real, normalized Fleet output. The +// healthy publication is established through the complete consumer chain first; +// every scenario then starts with new clients and reconciler instances backed +// solely by those persisted Kubernetes objects and provider records. +func TestPublicationDNSContract(t *testing.T) { + fixtures := publicationDNSFixtures(t) + healthy := fixtures["healthy"] + scheme := testScheme(t) + for _, add := range []func(*runtime.Scheme) error{corev1.AddToScheme, dnsv1alpha1.AddToScheme, route53v1alpha1.AddToScheme} { + publicationDNSRequire(t, add(scheme)) + } + server := httptest.NewServer(route53conversion.NewHandler()) + t.Cleanup(server.Close) + zone := publicationDNSZone() + objects := publicationDNSInfrastructure(zone) + objects = append(objects, healthy.Gateway.DeepCopy()) + keys := make([]client.ObjectKey, 0, len(healthy.Routes)) + for i := range healthy.Routes { + objects = append(objects, healthy.Routes[i].DeepCopy()) + keys = append(keys, client.ObjectKeyFromObject(&healthy.Routes[i])) + } + incarnation := 0 + cl := publicationDNSClient(scheme, objects, &incarnation) + recordKey := client.ObjectKey{Namespace: zone.Namespace, Name: generatedGatewayEndpointRecordSetName(healthy.Gateway.Namespace, healthy.Gateway.Name)} + provider := &publicationDNSProvider{publicationProvider: publicationProvider{records: map[string]route53.RecordSetResource{}}} + // Reuse the ordinary (non-external) retention-test boundary. The source + // controller creates the admission receipt; no receipt is synthesized here. + r := &Reconciler{Client: cl, EndpointRecordSetNamespace: recordKey.Namespace} + for _, key := range keys { + reconcileRetentionRoute(t, r, key) + } + markUnprotected(t, r, recordKey) + publicationDNSConverge(t, cl, provider, server.URL, keys, recordKey, client.ObjectKeyFromObject(zone)) + var before endpointv1alpha1.EndpointRecordSet + publicationDNSRequire(t, cl.Get(t.Context(), recordKey, &before)) + if before.UID == "" || before.Annotations[testAdmissionReceiptAnnotation] == "" || !reflect.DeepEqual(before.Spec.Hostnames, healthy.Expect.Hostnames) { + t.Fatalf("healthy fixture did not establish receipted DNS intent: %#v", before) + } + var children dnsv1alpha1.RecordSetList + publicationDNSRequire(t, cl.List(t.Context(), &children)) + if len(children.Items) != len(healthy.Expect.Hostnames) || len(provider.records) != len(healthy.Expect.Hostnames) || provider.upserts != len(healthy.Expect.Hostnames) || provider.deletes != 0 { + t.Fatalf("healthy publication did not reach Route 53: children=%d records=%d upserts=%d deletes=%d", len(children.Items), len(provider.records), provider.upserts, provider.deletes) + } + for _, child := range children.Items { + if child.UID == "" { + t.Fatal("healthy child RecordSet has no UID") + } + } + stored := publicationDNSStoredObjects(t, cl) + names := make([]string, 0, len(fixtures)) + for name := range fixtures { + names = append(names, name) + } + sort.Strings(names) + for _, name := range names { + t.Run(name, func(t *testing.T) { + fixture := fixtures[name] + // This is an API-store snapshot, not a warmed informer or a reused + // reconciler. Preserve all persisted receipts, UIDs, finalizers and + // child status, replacing only the producer-owned source objects. + restartedObjects := make([]client.Object, 0, len(stored)) + for _, object := range stored { + switch object.(type) { + case *gatewayv1.Gateway, *gatewayv1.HTTPRoute: + continue + } + restartedObjects = append(restartedObjects, object.DeepCopyObject().(client.Object)) + } + restartedObjects = append(restartedObjects, fixture.Gateway.DeepCopy()) + for i := range fixture.Routes { + route := fixture.Routes[i].DeepCopy() + // DNS-owned finalizers survive for an existing incarnation; they + // are not part of the normalized Fleet producer protocol. + for _, object := range stored { + previous, ok := object.(*gatewayv1.HTTPRoute) + if ok && previous.UID == route.UID { + route.Finalizers = append([]string(nil), previous.Finalizers...) + break + } + } + restartedObjects = append(restartedObjects, route) + } + restarted := publicationDNSClient(scheme, restartedObjects, &incarnation) + restartedProvider := &publicationDNSProvider{publicationProvider: publicationProvider{records: map[string]route53.RecordSetResource{}, tags: provider.tags}} + for key, record := range provider.records { + restartedProvider.records[key] = record + } + // Include the deleted route's key: startup receipt discovery must + // still clean up its old publication when the object is absent. + publicationDNSConverge(t, restarted, restartedProvider, server.URL, keys, recordKey, client.ObjectKeyFromObject(zone)) + publicationDNSAssertOutcome(t, fixture, restarted, restartedProvider, &before, children.Items, provider.records, zone.Spec.DomainName) + }) + } +} + +func publicationDNSFixtures(t *testing.T) map[string]publicationDNSContract { + t.Helper() + required := []string{"apply-conflict", "gateway-rejected", "healthy", "hostname-removed", "leaf-policy-status-absent", "leaf-route-status-stale", "leaf-unreachable", "parentref-removed", "policy-rejected", "reconciler-restart", "route-deleted", "route-replaced"} + manifest, err := os.ReadFile(filepath.Join(publicationDNSContractDirectory, "SHA256SUMS")) + publicationDNSRequire(t, err) + fixtures := make(map[string]publicationDNSContract, len(required)) + var names []string + for _, line := range strings.Split(strings.TrimSpace(string(manifest)), "\n") { + fields := strings.Split(line, " ") + if len(fields) != 2 || filepath.Base(fields[1]) != fields[1] || !strings.HasSuffix(fields[1], ".json") { + t.Fatalf("invalid contract SHA256SUMS entry: %q", line) + } + data, err := os.ReadFile(filepath.Join(publicationDNSContractDirectory, fields[1])) + publicationDNSRequire(t, err) + if fmt.Sprintf("%x", sha256.Sum256(data)) != fields[0] { + t.Fatalf("contract checksum mismatch: %s", fields[1]) + } + var fixture publicationDNSContract + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + publicationDNSRequire(t, decoder.Decode(&fixture)) + if fixture.Scenario+".json" != fields[1] || fixture.Description == "" { + t.Fatalf("invalid contract scenario metadata: %s", fields[1]) + } + fixtures[fixture.Scenario] = fixture + names = append(names, fixture.Scenario) + } + sort.Strings(names) + if !reflect.DeepEqual(required, names) { + t.Fatalf("contract scenario inventory = %v, want %v", names, required) + } + files, err := filepath.Glob(filepath.Join(publicationDNSContractDirectory, "*.json")) + publicationDNSRequire(t, err) + if len(files) != len(names) { + t.Fatal("unlisted contract fixture") + } + return fixtures +} + +func publicationDNSClient(scheme *runtime.Scheme, objects []client.Object, incarnation *int) client.Client { + return fake.NewClientBuilder().WithScheme(scheme).WithObjects(objects...). + WithStatusSubresource(&gatewayv1.Gateway{}, &gatewayv1.HTTPRoute{}, &endpointv1alpha1.EndpointRecordSet{}, &dnsv1alpha1.Zone{}, &dnsv1alpha1.ZoneUnit{}, &dnsv1alpha1.RecordSet{}). + WithInterceptorFuncs(interceptor.Funcs{Create: func(ctx context.Context, cl client.WithWatch, object client.Object, opts ...client.CreateOption) error { + *incarnation++ + object.SetUID(types.UID(fmt.Sprintf("publication-contract-%d", *incarnation))) + object.SetGeneration(1) + return cl.Create(ctx, object, opts...) + }}).Build() +} + +func publicationDNSConverge(t *testing.T, cl client.Client, provider *publicationDNSProvider, conversionURL string, routeKeys []client.ObjectKey, recordKey, zoneKey client.ObjectKey) { + t.Helper() + ignoredStatusWrites := 0 + cl = interceptor.NewClient(cl.(client.WithWatch), interceptor.Funcs{ + SubResourcePatch: func(ctx context.Context, c client.Client, subresource string, object client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error { + desired, isEndpoint := object.(*endpointv1alpha1.EndpointRecordSet) + ignored := false + if subresource == "status" && isEndpoint { + var observed endpointv1alpha1.EndpointRecordSet + publicationDNSRequire(t, c.Get(ctx, client.ObjectKeyFromObject(desired), &observed)) + candidate := desired.DeepCopy() + publicationDNSNormalizeConvergence(&observed) + publicationDNSNormalizeConvergence(candidate) + before, err := json.Marshal(&observed) + publicationDNSRequire(t, err) + after, err := json.Marshal(candidate) + publicationDNSRequire(t, err) + ignored = bytes.Equal(before, after) + } + err := c.SubResource(subresource).Patch(ctx, object, patch, opts...) + if err == nil && ignored { + ignoredStatusWrites++ + } + return err + }, + }) + gateway := &Reconciler{Client: cl, EndpointRecordSetNamespace: recordKey.Namespace} + endpoint := &endpointcontroller.Reconciler{Client: cl, RecordSetNamespace: recordKey.Namespace, RESTConfig: &rest.Config{Host: conversionURL}} + composition := &corezoneunit.ZoneUnitCompositionReconciler{Client: cl} + dns := &route53.ZoneReconciler{Client: cl, Provider: provider} + var previous []byte + for pass := range 16 { + upserts, deletes := provider.upserts, provider.deletes + for _, key := range routeKeys { + reconcileRetentionRoute(t, gateway, key) + } + for _, step := range []struct { + reconciler reconcile.Reconciler + key client.ObjectKey + }{{endpoint, recordKey}, {composition, zoneKey}, {dns, zoneKey}} { + _, err := step.reconciler.Reconcile(t.Context(), reconcile.Request{NamespacedName: step.key}) + publicationDNSRequire(t, err) + } + objects := publicationDNSStoredObjects(t, cl) + for _, object := range objects { + publicationDNSNormalizeConvergence(object) + } + current, err := json.Marshal(struct { + Objects []client.Object + Records map[string]route53.RecordSetResource + Tags map[string]string + Actions []json.RawMessage + }{objects, provider.records, provider.tags, provider.actions}) + publicationDNSRequire(t, err) + if bytes.Equal(previous, current) && upserts == provider.upserts && deletes == provider.deletes { + t.Logf("converged passes=%d ignored-status-only-writes=%d provider-upserts=%d provider-deletes=%d records=%d", pass+1, ignoredStatusWrites, provider.upserts, provider.deletes, len(provider.records)) + return + } + previous = current + } + t.Fatal("publication consumer chain did not converge in 16 passes") +} + +func publicationDNSNormalizeConvergence(object client.Object) { + object.SetResourceVersion("") + object.SetManagedFields(nil) + if endpoint, ok := object.(*endpointv1alpha1.EndpointRecordSet); ok { + // APT-1185: hostname Resolved lastTransitionTime restamps each reconcile (endpointrecordset/controller.go:271,376,771-787). + for i := range endpoint.Status.Hostnames { + for j := range endpoint.Status.Hostnames[i].Conditions { + endpoint.Status.Hostnames[i].Conditions[j].LastTransitionTime = metav1.Time{} + } + } + } +} + +func publicationDNSStoredObjects(t *testing.T, cl client.Client) []client.Object { + t.Helper() + var objects []client.Object + for _, list := range []client.ObjectList{ + &gatewayv1.GatewayList{}, &gatewayv1.HTTPRouteList{}, &endpointv1alpha1.EndpointRecordSetList{}, &endpointv1alpha1.EndpointProviderCapabilityList{}, + &dnsv1alpha1.RecordSetList{}, &dnsv1alpha1.ZoneList{}, &dnsv1alpha1.ZoneUnitList{}, &dnsv1alpha1.ZoneClassList{}, &dnsv1alpha1.ProviderList{}, + &dnsv1alpha1.RecordWithdrawalList{}, &route53v1alpha1.Route53IdentityList{}, &corev1.NamespaceList{}, + } { + publicationDNSRequire(t, cl.List(t.Context(), list)) + items, err := apimeta.ExtractList(list) + publicationDNSRequire(t, err) + for _, item := range items { + objects = append(objects, item.(client.Object)) + } + } + return objects +} + +func publicationDNSAssertOutcome(t *testing.T, fixture publicationDNSContract, cl client.Client, provider *publicationDNSProvider, before *endpointv1alpha1.EndpointRecordSet, children []dnsv1alpha1.RecordSet, records map[string]route53.RecordSetResource, domain string) { + t.Helper() + removed := map[string]bool{} + switch fixture.Expect.DNS { + case "retain": + if !reflect.DeepEqual(fixture.Expect.Hostnames, before.Spec.Hostnames) { + t.Fatal("retain fixture must name every established hostname") + } + // Count actions, not just final records: DELETE followed by UPSERT is + // a withdrawal regression even when the final DNS snapshot looks right. + if provider.deletes != 0 { + t.Fatalf("retained publication sent Route 53 DELETE: %v", provider.deletedNames) + } + // A restarted reconciler must not rewrite unchanged records either. + if provider.upserts != 0 { + t.Fatalf("retained publication sent %d Route 53 UPSERTs", provider.upserts) + } + case "withdraw-hostnames", "withdraw-all": + for _, hostname := range fixture.Expect.Hostnames { + removed[hostname] = true + } + default: + t.Fatalf("unknown DNS expectation %q", fixture.Expect.DNS) + } + var expected []string + for _, hostname := range before.Spec.Hostnames { + if !removed[hostname] { + expected = append(expected, hostname) + } + } + if fixture.Expect.DNS == "withdraw-all" && len(expected) != 0 { + t.Fatal("withdraw-all fixture does not cover all established hostnames") + } + var after endpointv1alpha1.EndpointRecordSet + err := cl.Get(t.Context(), client.ObjectKeyFromObject(before), &after) + if len(expected) == 0 { + if !apierrors.IsNotFound(err) { + t.Fatalf("withdrawn EndpointRecordSet remains: error=%v object=%#v", err, after) + } + } else { + publicationDNSRequire(t, err) + if after.UID != before.UID || !after.DeletionTimestamp.IsZero() || !reflect.DeepEqual(after.Spec.Hostnames, expected) || !reflect.DeepEqual(after.Spec.Targets, before.Spec.Targets) { + t.Fatalf("unexpected EndpointRecordSet transition: expected=%v before=%#v after=%#v", expected, before, after) + } + if fixture.Expect.DNS == "retain" && !reflect.DeepEqual(after.Spec, before.Spec) { + t.Fatal("retained EndpointRecordSet spec changed") + } + } + var current dnsv1alpha1.RecordSetList + publicationDNSRequire(t, cl.List(t.Context(), ¤t)) + if len(current.Items) != len(expected) { + t.Fatalf("child RecordSets = %d, want %d", len(current.Items), len(expected)) + } + for _, child := range children { + hostname := strings.TrimSuffix(child.Spec.Name+"."+domain, ".") + var found dnsv1alpha1.RecordSet + err := cl.Get(t.Context(), client.ObjectKeyFromObject(&child), &found) + if removed[hostname] { + if !apierrors.IsNotFound(err) { + t.Fatalf("withdrawn child %s remains: %v", hostname, err) + } + continue + } + publicationDNSRequire(t, err) + if found.UID != child.UID || !found.DeletionTimestamp.IsZero() || !reflect.DeepEqual(found.Spec, child.Spec) { + t.Fatalf("retained child %s changed identity or spec: before=%#v after=%#v", hostname, child, found) + } + } + if len(provider.records) != len(expected) || provider.deletes != len(removed) { + t.Fatalf("provider outcome: records=%d deletes=%d; want records=%d deletes=%d", len(provider.records), provider.deletes, len(expected), len(removed)) + } + for name, beforeRecord := range records { + afterRecord, exists := provider.records[name] + if removed[strings.TrimSuffix(name, ".")] { + if exists { + t.Fatalf("withdrawn Route 53 name remains: %s", name) + } + } else if !exists || !reflect.DeepEqual(afterRecord, beforeRecord) { + t.Fatalf("retained Route 53 record changed: %s", name) + } + } + for _, name := range provider.deletedNames { + if !removed[strings.TrimSuffix(name, ".")] { + t.Fatalf("Route 53 DELETE targeted an unaffected hostname: %s", name) + } + } +} + +type publicationDNSProvider struct { + publicationProvider + deletedNames []string + actions []json.RawMessage +} + +func (p *publicationDNSProvider) GetHostedZone(context.Context, string) (route53.HostedZone, error) { + return route53.HostedZone{ID: "ZPUBLICATION", Name: "project.example"}, nil +} + +func (p *publicationDNSProvider) ChangeRecordSets(ctx context.Context, id string, changes []route53.RecordSetChange) (*route53v1alpha1.Route53Change, error) { + actions, err := json.Marshal(changes) + if err != nil { + return nil, err + } + p.actions = append(p.actions, actions) + for _, change := range changes { + if change.Action == route53.RecordSetChangeActionDelete { + p.deletedNames = append(p.deletedNames, change.RecordSet.Name) + } + } + return p.publicationProvider.ChangeRecordSets(ctx, id, changes) +} + +func publicationDNSZone() *dnsv1alpha1.Zone { + return &dnsv1alpha1.Zone{ + ObjectMeta: metav1.ObjectMeta{Namespace: "dns-system", Name: "project", UID: "publication-zone", Generation: 1}, + Spec: dnsv1alpha1.ZoneSpec{ + DomainName: "project.example", Provider: route53v1alpha1.ProviderRef, + ZoneClassRef: dnsv1alpha1.ZoneClassReference{Name: "route53"}, + Adoption: runtime.RawExtension{Raw: []byte(`{"hostedZoneId":"ZPUBLICATION"}`)}, + AllowedRecordSets: []dnsv1alpha1.AllowedRecordSet{{ + Namespaces: dnsv1alpha1.AllowedRecordSetNamespaces{Selector: metav1.LabelSelector{}}, + Records: []dnsv1alpha1.AllowedRecord{{ + Name: dnsv1alpha1.RecordNamePolicy{Pattern: ".*"}, Types: []dnsv1alpha1.RecordType{dnsv1alpha1.RecordTypeA}, + }}, + }}, + }, + } +} + +func publicationDNSInfrastructure(zone *dnsv1alpha1.Zone) []client.Object { + return []client.Object{ + zone, + &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: zone.Namespace}}, + &dnsv1alpha1.Provider{ + ObjectMeta: metav1.ObjectMeta{Name: route53v1alpha1.ProviderName}, + Spec: dnsv1alpha1.ProviderSpec{Versions: []dnsv1alpha1.ProviderVersion{{ + Name: route53v1alpha1.ProviderVersion, Served: true, Storage: true, + RecordSet: dnsv1alpha1.ProviderRecordSet{SupportedTypes: []dnsv1alpha1.RecordType{dnsv1alpha1.RecordTypeA}}, + }}}, + }, + &dnsv1alpha1.ZoneClass{ + ObjectMeta: metav1.ObjectMeta{Namespace: zone.Namespace, Name: "route53", Generation: 1}, + Spec: dnsv1alpha1.ZoneClassSpec{ + Provider: route53v1alpha1.ProviderRef, ControllerName: route53.DefaultControllerName, + IdentityRef: &dnsv1alpha1.LocalObjectReference{Name: "route53"}, + Parameters: runtime.RawExtension{Raw: []byte(`{}`)}, + AllowedZones: dnsv1alpha1.ZoneClassAllowedZones{ + Namespaces: dnsv1alpha1.NamespacePolicy{From: dnsv1alpha1.NamespacesFromSame}, + }, + }, + Status: dnsv1alpha1.ZoneClassStatus{Conditions: []metav1.Condition{{ + Type: "Accepted", Status: metav1.ConditionTrue, ObservedGeneration: 1, + }}}, + }, + &route53v1alpha1.Route53Identity{ + ObjectMeta: metav1.ObjectMeta{Namespace: zone.Namespace, Name: "route53", Generation: 1}, + Status: route53v1alpha1.Route53IdentityStatus{Conditions: []metav1.Condition{ + {Type: "Accepted", Status: metav1.ConditionTrue, ObservedGeneration: 1}, + {Type: "Ready", Status: metav1.ConditionTrue, ObservedGeneration: 1}, + }}, + }, + &endpointv1alpha1.EndpointProviderCapability{ + ObjectMeta: metav1.ObjectMeta{Name: "route53"}, + Spec: endpointv1alpha1.EndpointProviderCapabilitySpec{ + Provider: route53v1alpha1.ProviderRef, + Conversion: endpointv1alpha1.EndpointRecordSetConversionAPI{ + Group: route53conversion.GroupName, Version: route53conversion.Version, Resource: route53conversion.Resource, + }, + }, + }, + } +} + +func publicationDNSRequire(t *testing.T, err error) { + t.Helper() + if err != nil { + t.Fatal(err) + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/README.md b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/README.md new file mode 100644 index 0000000..b0d7c54 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/README.md @@ -0,0 +1,103 @@ +# Gateway Fleet to dns-api publication contract (v1) + +APT-822 / ADR-0083: these fixtures cross the repository boundary without importing +another repository's `internal` package. They are real source Gateway and +HTTPRoute objects captured after the platform Gateway Fleet `Reconciler` runs, +not hand-authored source status. + +## Ownership and regeneration + +The producer is platform's +`internal/controllers/gatewayfleet/publication_dns_contract_test.go`, +`TestPublicationDNSContract`. From the platform repository root, regenerate with: + +```sh +UPDATE_PUBLICATION_DNS_CONTRACT=1 go test ./internal/controllers/gatewayfleet -run '^TestPublicationDNSContract$' -count=1 +``` + +Without `UPDATE_PUBLICATION_DNS_CONTRACT=1`, the producer compares its complete +normalized output with the golden JSON and verifies `SHA256SUMS`. The generator +writes nothing until every scenario has been produced successfully, and refuses +a run filtered to some scenarios. + +Copy this **entire directory byte-for-byte**, including this README and +`SHA256SUMS`, to dns-api's +`internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/`. +The consumer there is also named `TestPublicationDNSContract`; it verifies the +checksums and the complete 12-scenario inventory before reconciling anything. +A fixture change must land in **both repositories**. Platform's dns-api import +approval PRs under `hack/upstream-artifacts/...` must check that the imported +revision carries the current, byte-identical copy. A green test in only one +repository is not cross-repository approval. **Known gap:** no CI job fails +today when only one copy changes; each repository checks its own +`SHA256SUMS` only. Tracked as APT-1187 (pin the dns-api copy's checksum in the +import record). + +Coverage limits: for dns-api, `leaf-unreachable`/`reconciler-restart` and +`leaf-policy-status-absent`/`policy-rejected` carry identical inputs; they stay +separate because the producer pins different Fleet paths. `route-deleted` +covers a route that is already absent, not one held by its finalizer. + +## Wire format + +Each JSON document contains `scenario`, `description`, `gateway`, `routes`, and +`expect`. Metadata retains only name, namespace, UID and generation. Gateway spec +and status are captured in full. Routes retain spec hostnames and parentRefs and +status parents. API version and kind are retained. Resource versions, managed +fields and creation timestamps are excluded; condition transition timestamps are +fixed to `2026-01-01T00:00:00Z`. Fixture identities, route order and JSON key order +are deterministic. `SHA256SUMS` covers every JSON fixture (not itself or this +README). + +`expect.hostnames` means: + +- `retain`: all established names must remain. +- `withdraw-hostnames`: exactly these names must disappear; other names remain. +- `withdraw-all`: all listed established names and the shared set must disappear. + +The baseline has 12 source routes and 13 names: `app-00` also publishes +`alias.project.example`. Thus hostname removal tests partial withdrawal within +one route, and route removal/replacement tests unaffected siblings too. + +## Current contract, not future wave-3 behavior + +The producer captures actual status rather than rewriting it to a desired tuple. +In particular, absent leaf SecurityPolicy status currently closes the edge with +`Accepted=False/RouteClosed` and `PoliciesReady=False/PoliciesNotReady`. This is +the deliberate fence until ADR-0083 wave 3 Q2, not the future `Unknown` behavior. +Under D4, dns-api retains the already receipted hostname for either False or +Unknown route acceptance. Explicit policy rejection has the same DNS outcome. +An explicit observed Gateway rejection instead withdraws the shared set. + +The incomplete-pass cases preserve source route status, while Gateway acceptance +can become Unknown. ParentRef removal may leave an old parent status whose +observed generation predates the new route generation: the intent removal, not +that stale status, authorizes DNS withdrawal. APT-1087 backend projection lag is +intentionally not included. + +## Consumer restart and provider boundary + +The consumer establishes healthy publication using the real gateway-endpoint, +endpointrecordset, ZoneUnit composition and Route 53 reconcilers. It uses the +retention-test harness's HTTP conversion handler and in-memory Route 53 provider. +It requires persisted admission receipts, EndpointRecordSet/child UIDs, and +provider records before taking a snapshot. + +Each scenario reconstructs a fresh fake API client and every reconciler from +that snapshot, substitutes only the captured source Gateway/routes, and starts +with a fresh provider adapter holding the existing records. No previous +reconciler or admission cache is reused. Existing source-route incarnations keep +their DNS-owned finalizers. All baseline route keys, including a deleted route's +key, are reconciled. Convergence is bounded to 16 passes and compares all stored +objects, provider records, tags and the provider action log. It ignores only +metadata resourceVersion/managedFields and EndpointRecordSet hostname-condition +lastTransitionTime (the independently tracked APT-1185 status-restamping defect). +Ignored status-only writes are counted and logged for each scenario. Specs, +receipts, annotations, finalizers and every other status field remain compared. + +Retain cases require the EndpointRecordSet and every child RecordSet UID/spec to +remain unchanged. Every Route 53 DELETE action is counted, so DELETE followed by +UPSERT cannot hide a transient withdrawal. Withdrawal cases require exactly the +specified provider names and children to disappear, with sibling identities and +records unchanged. Gateway rejection additionally requires the shared +EndpointRecordSet to be gone. No live infrastructure or AWS credentials are used. diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/SHA256SUMS b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/SHA256SUMS new file mode 100644 index 0000000..6dc2a9c --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/SHA256SUMS @@ -0,0 +1,12 @@ +202163804317467782bf01bc7c04cc809826b823a786d3fbed1759dc52e0bf5a apply-conflict.json +ab6de530bf3de6fdd5e76f545a0c3a425a02bce89843c1fb0a82fc67f4b4c224 gateway-rejected.json +553505c184da41d665bd2c4dd489f24d6a2363c158cb7769f7593eabdaecf425 healthy.json +fd5ead3daaf87db5703522501e411fd5171424586750cbe8cf5cfd1c04518313 hostname-removed.json +cc81d34706db32fb06b2b57eaaa83436ed066da85550064b4a7ce29587cbf908 leaf-policy-status-absent.json +4cfd22fba3cf97aa7a2d642ff26133ec3740dc14babcaee63bbf3503ab3b8bba leaf-route-status-stale.json +779238ad7430a8b6bf6054d1289898c21862111e0807dcfb1b918f37b2118972 leaf-unreachable.json +ae9475a2bd36f22ad71c73aa2e2f0388b40a0a095dc0dd947e49ef2aa81229dc parentref-removed.json +aa66b3f4c91f0711cd56a0387c8881757f25ea870d2aff086ca132ca8be2945d policy-rejected.json +c6dc459f3c135b0f16c5073959e7a7e3cec0dcae071657e8d5e4238bd89538cb reconciler-restart.json +0f26cdaf578ca6c9f967a7c4039097cea7ea4e86f3495f99fb2795ba6599dab4 route-deleted.json +090b06ec4c17bd69bcb697dbfd7305e4979990a3c4034193124e50b3b6e73441 route-replaced.json diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/apply-conflict.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/apply-conflict.json new file mode 100644 index 0000000..2c073f0 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/apply-conflict.json @@ -0,0 +1,856 @@ +{ + "scenario": "apply-conflict", + "description": "Leaf HTTPRoute apply conflict during an incomplete pass", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf accepts the current Gateway.", + "observedGeneration": 1, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a current programmed and publishable leaf.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected clusters still have leaf apply errors", + "observedGeneration": 1, + "reason": "WaitingForLeafApply", + "status": "False", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf Gateway and HTTPRoute status before publishing parent Gateway addresses", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "False", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-00", + "namespace": "edge-system", + "uid": "route-app-00" + }, + "spec": { + "hostnames": [ + "app-00.project.example", + "alias.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Access authentication policy is current and ready", + "observedGeneration": 8, + "reason": "PoliciesReady", + "status": "True", + "type": "PoliciesReady" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "retain", + "hostnames": [ + "alias.project.example", + "app-00.project.example", + "app-01.project.example", + "app-02.project.example", + "app-03.project.example", + "app-04.project.example", + "app-05.project.example", + "app-06.project.example", + "app-07.project.example", + "app-08.project.example", + "app-09.project.example", + "app-10.project.example", + "app-11.project.example" + ] + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/gateway-rejected.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/gateway-rejected.json new file mode 100644 index 0000000..2ebb5f0 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/gateway-rejected.json @@ -0,0 +1,856 @@ +{ + "scenario": "gateway-rejected", + "description": "Current explicit leaf Gateway rejection withdraws the shared publication", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf rejects the current Gateway.", + "observedGeneration": 1, + "reason": "Rejected", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a current programmed and publishable leaf.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Leaf Gateway and HTTPRoute resources applied to 1 selected clusters", + "observedGeneration": 1, + "reason": "LeafResourcesApplied", + "status": "True", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf Gateway and HTTPRoute status before publishing parent Gateway addresses", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "False", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-00", + "namespace": "edge-system", + "uid": "route-app-00" + }, + "spec": { + "hostnames": [ + "app-00.project.example", + "alias.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Access authentication policy is current and ready", + "observedGeneration": 8, + "reason": "PoliciesReady", + "status": "True", + "type": "PoliciesReady" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "withdraw-all", + "hostnames": [ + "alias.project.example", + "app-00.project.example", + "app-01.project.example", + "app-02.project.example", + "app-03.project.example", + "app-04.project.example", + "app-05.project.example", + "app-06.project.example", + "app-07.project.example", + "app-08.project.example", + "app-09.project.example", + "app-10.project.example", + "app-11.project.example" + ] + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/healthy.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/healthy.json new file mode 100644 index 0000000..e4ace94 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/healthy.json @@ -0,0 +1,861 @@ +{ + "scenario": "healthy", + "description": "Established publication with current leaf acceptance", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [ + { + "type": "IPAddress", + "value": "192.0.2.1" + } + ], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf accepts the current Gateway.", + "observedGeneration": 1, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf is programmed and publishable.", + "observedGeneration": 1, + "reason": "Programmed", + "status": "True", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Leaf Gateway and HTTPRoute resources applied to 1 selected clusters", + "observedGeneration": 1, + "reason": "LeafResourcesApplied", + "status": "True", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 publishable leaf addresses aggregated onto the parent Gateway", + "observedGeneration": 1, + "reason": "Publishable", + "status": "True", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-00", + "namespace": "edge-system", + "uid": "route-app-00" + }, + "spec": { + "hostnames": [ + "app-00.project.example", + "alias.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Access authentication policy is current and ready", + "observedGeneration": 8, + "reason": "PoliciesReady", + "status": "True", + "type": "PoliciesReady" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "retain", + "hostnames": [ + "alias.project.example", + "app-00.project.example", + "app-01.project.example", + "app-02.project.example", + "app-03.project.example", + "app-04.project.example", + "app-05.project.example", + "app-06.project.example", + "app-07.project.example", + "app-08.project.example", + "app-09.project.example", + "app-10.project.example", + "app-11.project.example" + ] + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/hostname-removed.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/hostname-removed.json new file mode 100644 index 0000000..d4e6454 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/hostname-removed.json @@ -0,0 +1,835 @@ +{ + "scenario": "hostname-removed", + "description": "One hostname removed while its route and siblings remain", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf accepts the current Gateway.", + "observedGeneration": 1, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a current programmed and publishable leaf.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Leaf Gateway and HTTPRoute resources applied to 1 selected clusters", + "observedGeneration": 1, + "reason": "LeafResourcesApplied", + "status": "True", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf Gateway and HTTPRoute status before publishing parent Gateway addresses", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "False", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-00", + "namespace": "edge-system", + "uid": "route-app-00" + }, + "spec": { + "hostnames": [ + "app-00.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a current leaf HTTPRoute Accepted condition", + "observedGeneration": 9, + "reason": "WaitingForLeafStatus", + "status": "Unknown", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a current leaf HTTPRoute ResolvedRefs condition", + "observedGeneration": 9, + "reason": "WaitingForLeafStatus", + "status": "Unknown", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "withdraw-hostnames", + "hostnames": [ + "alias.project.example" + ] + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/leaf-policy-status-absent.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/leaf-policy-status-absent.json new file mode 100644 index 0000000..bebc4f4 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/leaf-policy-status-absent.json @@ -0,0 +1,861 @@ +{ + "scenario": "leaf-policy-status-absent", + "description": "Completed pass without leaf SecurityPolicy status: edge closes until wave 3 Q2; DNS keeps the receipted name per D4", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [ + { + "type": "IPAddress", + "value": "192.0.2.1" + } + ], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf accepts the current Gateway.", + "observedGeneration": 1, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf is programmed and publishable.", + "observedGeneration": 1, + "reason": "Programmed", + "status": "True", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Leaf Gateway and HTTPRoute resources applied to 1 selected clusters", + "observedGeneration": 1, + "reason": "LeafResourcesApplied", + "status": "True", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 publishable leaf addresses aggregated onto the parent Gateway", + "observedGeneration": 1, + "reason": "Publishable", + "status": "True", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-00", + "namespace": "edge-system", + "uid": "route-app-00" + }, + "spec": { + "hostnames": [ + "app-00.project.example", + "alias.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Gateway Fleet rejects the current route admission: RouteClosed", + "observedGeneration": 8, + "reason": "RouteClosed", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Gateway Fleet rejects the current route admission: RouteClosed", + "observedGeneration": 8, + "reason": "RouteClosed", + "status": "False", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Access authentication policy is not current and ready", + "observedGeneration": 8, + "reason": "PoliciesNotReady", + "status": "False", + "type": "PoliciesReady" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "retain", + "hostnames": [ + "alias.project.example", + "app-00.project.example", + "app-01.project.example", + "app-02.project.example", + "app-03.project.example", + "app-04.project.example", + "app-05.project.example", + "app-06.project.example", + "app-07.project.example", + "app-08.project.example", + "app-09.project.example", + "app-10.project.example", + "app-11.project.example" + ] + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/leaf-route-status-stale.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/leaf-route-status-stale.json new file mode 100644 index 0000000..4afb2ad --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/leaf-route-status-stale.json @@ -0,0 +1,856 @@ +{ + "scenario": "leaf-route-status-stale", + "description": "Leaf HTTPRoute acceptance predates its generation", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf accepts the current Gateway.", + "observedGeneration": 1, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a current programmed and publishable leaf.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Leaf Gateway and HTTPRoute resources applied to 1 selected clusters", + "observedGeneration": 1, + "reason": "LeafResourcesApplied", + "status": "True", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf Gateway and HTTPRoute status before publishing parent Gateway addresses", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "False", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-00", + "namespace": "edge-system", + "uid": "route-app-00" + }, + "spec": { + "hostnames": [ + "app-00.project.example", + "alias.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Leaf HTTPRoute does not report a current Accepted condition", + "observedGeneration": 8, + "reason": "LeafRouteStatusNotCurrent", + "status": "Unknown", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Leaf HTTPRoute does not report a current ResolvedRefs condition", + "observedGeneration": 8, + "reason": "LeafRouteStatusNotCurrent", + "status": "Unknown", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Access authentication policy is current and ready", + "observedGeneration": 8, + "reason": "PoliciesReady", + "status": "True", + "type": "PoliciesReady" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "retain", + "hostnames": [ + "alias.project.example", + "app-00.project.example", + "app-01.project.example", + "app-02.project.example", + "app-03.project.example", + "app-04.project.example", + "app-05.project.example", + "app-06.project.example", + "app-07.project.example", + "app-08.project.example", + "app-09.project.example", + "app-10.project.example", + "app-11.project.example" + ] + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/leaf-unreachable.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/leaf-unreachable.json new file mode 100644 index 0000000..6581816 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/leaf-unreachable.json @@ -0,0 +1,856 @@ +{ + "scenario": "leaf-unreachable", + "description": "Leaf client unavailable during an incomplete pass", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a selected leaf to report current Gateway acceptance.", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "Unknown", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a current programmed and publishable leaf.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected clusters still have leaf apply errors", + "observedGeneration": 1, + "reason": "WaitingForLeafApply", + "status": "False", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf Gateway and HTTPRoute status before publishing parent Gateway addresses", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "False", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-00", + "namespace": "edge-system", + "uid": "route-app-00" + }, + "spec": { + "hostnames": [ + "app-00.project.example", + "alias.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Access authentication policy is current and ready", + "observedGeneration": 8, + "reason": "PoliciesReady", + "status": "True", + "type": "PoliciesReady" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "retain", + "hostnames": [ + "alias.project.example", + "app-00.project.example", + "app-01.project.example", + "app-02.project.example", + "app-03.project.example", + "app-04.project.example", + "app-05.project.example", + "app-06.project.example", + "app-07.project.example", + "app-08.project.example", + "app-09.project.example", + "app-10.project.example", + "app-11.project.example" + ] + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/parentref-removed.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/parentref-removed.json new file mode 100644 index 0000000..c15fff6 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/parentref-removed.json @@ -0,0 +1,846 @@ +{ + "scenario": "parentref-removed", + "description": "Route no longer references the source Gateway", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [ + { + "type": "IPAddress", + "value": "192.0.2.1" + } + ], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf accepts the current Gateway.", + "observedGeneration": 1, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf is programmed and publishable.", + "observedGeneration": 1, + "reason": "Programmed", + "status": "True", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Leaf Gateway and HTTPRoute resources applied to 1 selected clusters", + "observedGeneration": 1, + "reason": "LeafResourcesApplied", + "status": "True", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 publishable leaf addresses aggregated onto the parent Gateway", + "observedGeneration": 1, + "reason": "Publishable", + "status": "True", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-00", + "namespace": "edge-system", + "uid": "route-app-00" + }, + "spec": { + "hostnames": [ + "app-00.project.example", + "alias.project.example" + ], + "parentRefs": [] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Access authentication policy is current and ready", + "observedGeneration": 8, + "reason": "PoliciesReady", + "status": "True", + "type": "PoliciesReady" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "withdraw-hostnames", + "hostnames": [ + "alias.project.example", + "app-00.project.example" + ] + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/policy-rejected.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/policy-rejected.json new file mode 100644 index 0000000..43bb189 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/policy-rejected.json @@ -0,0 +1,861 @@ +{ + "scenario": "policy-rejected", + "description": "Current explicit leaf SecurityPolicy rejection closes the route, not DNS", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [ + { + "type": "IPAddress", + "value": "192.0.2.1" + } + ], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf accepts the current Gateway.", + "observedGeneration": 1, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf is programmed and publishable.", + "observedGeneration": 1, + "reason": "Programmed", + "status": "True", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Leaf Gateway and HTTPRoute resources applied to 1 selected clusters", + "observedGeneration": 1, + "reason": "LeafResourcesApplied", + "status": "True", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 publishable leaf addresses aggregated onto the parent Gateway", + "observedGeneration": 1, + "reason": "Publishable", + "status": "True", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-00", + "namespace": "edge-system", + "uid": "route-app-00" + }, + "spec": { + "hostnames": [ + "app-00.project.example", + "alias.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Gateway Fleet rejects the current route admission: RouteClosed", + "observedGeneration": 8, + "reason": "RouteClosed", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Gateway Fleet rejects the current route admission: RouteClosed", + "observedGeneration": 8, + "reason": "RouteClosed", + "status": "False", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Access authentication policy is not current and ready", + "observedGeneration": 8, + "reason": "PoliciesNotReady", + "status": "False", + "type": "PoliciesReady" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "retain", + "hostnames": [ + "alias.project.example", + "app-00.project.example", + "app-01.project.example", + "app-02.project.example", + "app-03.project.example", + "app-04.project.example", + "app-05.project.example", + "app-06.project.example", + "app-07.project.example", + "app-08.project.example", + "app-09.project.example", + "app-10.project.example", + "app-11.project.example" + ] + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/reconciler-restart.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/reconciler-restart.json new file mode 100644 index 0000000..e2663b5 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/reconciler-restart.json @@ -0,0 +1,856 @@ +{ + "scenario": "reconciler-restart", + "description": "Fresh Fleet reconciler before the leaf client connects", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a selected leaf to report current Gateway acceptance.", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "Unknown", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a current programmed and publishable leaf.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected clusters still have leaf apply errors", + "observedGeneration": 1, + "reason": "WaitingForLeafApply", + "status": "False", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf Gateway and HTTPRoute status before publishing parent Gateway addresses", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "False", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-00", + "namespace": "edge-system", + "uid": "route-app-00" + }, + "spec": { + "hostnames": [ + "app-00.project.example", + "alias.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Access authentication policy is current and ready", + "observedGeneration": 8, + "reason": "PoliciesReady", + "status": "True", + "type": "PoliciesReady" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "retain", + "hostnames": [ + "alias.project.example", + "app-00.project.example", + "app-01.project.example", + "app-02.project.example", + "app-03.project.example", + "app-04.project.example", + "app-05.project.example", + "app-06.project.example", + "app-07.project.example", + "app-08.project.example", + "app-09.project.example", + "app-10.project.example", + "app-11.project.example" + ] + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/route-deleted.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/route-deleted.json new file mode 100644 index 0000000..092ac27 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/route-deleted.json @@ -0,0 +1,782 @@ +{ + "scenario": "route-deleted", + "description": "Source route deleted; only remaining routes are captured", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [ + { + "type": "IPAddress", + "value": "192.0.2.1" + } + ], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf accepts the current Gateway.", + "observedGeneration": 1, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "A selected leaf is programmed and publishable.", + "observedGeneration": 1, + "reason": "Programmed", + "status": "True", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Leaf Gateway and HTTPRoute resources applied to 1 selected clusters", + "observedGeneration": 1, + "reason": "LeafResourcesApplied", + "status": "True", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 publishable leaf addresses aggregated onto the parent Gateway", + "observedGeneration": 1, + "reason": "Publishable", + "status": "True", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "withdraw-hostnames", + "hostnames": [ + "alias.project.example", + "app-00.project.example" + ] + } +} diff --git a/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/route-replaced.json b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/route-replaced.json new file mode 100644 index 0000000..6a915a7 --- /dev/null +++ b/internal/go/apps/gatewayendpoint/controllers/gateway/testdata/publication-dns-contract/v1/route-replaced.json @@ -0,0 +1,829 @@ +{ + "scenario": "route-replaced", + "description": "Same route name with a new UID before leaf observation", + "gateway": { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "Gateway", + "metadata": { + "generation": 1, + "name": "app-public", + "namespace": "edge-system", + "uid": "gateway-edge-system-app-public" + }, + "spec": { + "gatewayClassName": "multicluster-gateway-fleet-public", + "listeners": [ + { + "hostname": "*.project.example", + "name": "https", + "port": 443, + "protocol": "HTTPS", + "tls": { + "certificateRefs": [ + { + "name": "project-tls" + } + ], + "mode": "Terminate" + } + } + ] + }, + "status": { + "addresses": [], + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a selected leaf to report current Gateway acceptance.", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "Unknown", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a current programmed and publishable leaf.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected gateway clusters resolved", + "observedGeneration": 1, + "reason": "ClustersSelected", + "status": "True", + "type": "SelectedClusters" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "1 selected clusters still have leaf apply errors", + "observedGeneration": 1, + "reason": "WaitingForLeafApply", + "status": "False", + "type": "LeafResourcesApplied" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf Gateway and HTTPRoute status before publishing parent Gateway addresses", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "False", + "type": "DNSPublishable" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Current-generation leaf listener programming.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ListenersProgrammed" + } + ], + "listeners": [ + { + "attachedRoutes": 0, + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "Programmed" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for leaf listener status.", + "observedGeneration": 1, + "reason": "Pending", + "status": "False", + "type": "ResolvedRefs" + } + ], + "name": "https", + "supportedKinds": [] + } + ] + } + }, + "routes": [ + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 1, + "name": "app-00", + "namespace": "edge-system", + "uid": "replacement-route" + }, + "spec": { + "hostnames": [ + "app-00.project.example", + "alias.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a current leaf HTTPRoute Accepted condition", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "Unknown", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Waiting for a current leaf HTTPRoute ResolvedRefs condition", + "observedGeneration": 1, + "reason": "WaitingForLeafStatus", + "status": "Unknown", + "type": "ResolvedRefs" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 8, + "name": "app-01", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-01" + }, + "spec": { + "hostnames": [ + "app-01.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 8, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 8, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 8, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 9, + "name": "app-02", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-02" + }, + "spec": { + "hostnames": [ + "app-02.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 9, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 9, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 9, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 10, + "name": "app-03", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-03" + }, + "spec": { + "hostnames": [ + "app-03.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 10, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 10, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 10, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 11, + "name": "app-04", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-04" + }, + "spec": { + "hostnames": [ + "app-04.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 11, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 11, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 11, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 12, + "name": "app-05", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-05" + }, + "spec": { + "hostnames": [ + "app-05.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 12, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 12, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 12, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 13, + "name": "app-06", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-06" + }, + "spec": { + "hostnames": [ + "app-06.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 13, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 13, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 13, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 14, + "name": "app-07", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-07" + }, + "spec": { + "hostnames": [ + "app-07.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 14, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 14, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 14, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 15, + "name": "app-08", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-08" + }, + "spec": { + "hostnames": [ + "app-08.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 15, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 15, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 15, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 16, + "name": "app-09", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-09" + }, + "spec": { + "hostnames": [ + "app-09.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 16, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 16, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 16, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 17, + "name": "app-10", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-10" + }, + "spec": { + "hostnames": [ + "app-10.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 17, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 17, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 17, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + }, + { + "apiVersion": "gateway.networking.k8s.io/v1", + "kind": "HTTPRoute", + "metadata": { + "generation": 18, + "name": "app-11", + "namespace": "edge-system", + "uid": "httproute-edge-system-app-11" + }, + "spec": { + "hostnames": [ + "app-11.project.example" + ], + "parentRefs": [ + { + "name": "app-public" + } + ] + }, + "status": { + "parents": [ + { + "conditions": [ + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Accepted is true", + "observedGeneration": 18, + "reason": "Accepted", + "status": "True", + "type": "Accepted" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "ResolvedRefs is true", + "observedGeneration": 18, + "reason": "ResolvedRefs", + "status": "True", + "type": "ResolvedRefs" + }, + { + "lastTransitionTime": "2026-01-01T00:00:00Z", + "message": "Route admission is not a convergence-only refusal", + "observedGeneration": 18, + "reason": "AdmissionNotPending", + "status": "False", + "type": "AdmissionPending" + } + ], + "controllerName": "gateway.multicluster.appthrust.io/gateway-fleet-controller", + "parentRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "app-public", + "namespace": "edge-system" + } + } + ] + } + } + ], + "expect": { + "dns": "withdraw-hostnames", + "hostnames": [ + "alias.project.example", + "app-00.project.example" + ] + } +}