Skip to content

feat(source/template): add fqdn-target-template to pod/service/node and consolidate duplicate template helpers#6497

Open
ivankatliarchuk wants to merge 7 commits into
kubernetes-sigs:masterfrom
gofogo:feat/fqdn-target-template-sources-and-engine-helpers
Open

feat(source/template): add fqdn-target-template to pod/service/node and consolidate duplicate template helpers#6497
ivankatliarchuk wants to merge 7 commits into
kubernetes-sigs:masterfrom
gofogo:feat/fqdn-target-template-sources-and-engine-helpers

Conversation

@ivankatliarchuk

@ivankatliarchuk ivankatliarchuk commented Jun 14, 2026

Copy link
Copy Markdown
Member

What does it do ?

  • pod, service, and node sources supported --fqdn-template and --target-template but not --fqdn-target-template (host:target pairs), unlike gloo, traefik, f5, and unstructured
  • EndpointsForHostsAndTargets lived in source/unstructured.go despite being a pure endpoint utility with no source-specific logic

Motivation

It could be refactored further, let's say this is going to be to-path refactor. And this is a first step.

  • The endpointsFromXxxFQDNTargetTemplate pattern (split host:target pairs, validate, build endpoints) was copy-pasted verbatim across 8 source files with only the log-message resource kind differin
  • Consolidate 13 duplicated helper methods into template.Engine: add ApplyFQDNTargetTemplate(existing, obj) and ApplyTemplate(existing, obj) as canonical engine methods replacing 8 × endpointsFromXxxFQDNTargetTemplate and 5 × endpointsFromXxxTemplate across gloo, traefik, f5-virtualserver, f5-transportserver, unstructured, service, pod, and node - each call site shrinks from ~10 lines with a lambda closure to a single engine method call

More

  • Yes, this PR title follows Conventional Commits
  • Yes, I added unit tests
  • Yes, I updated end user documentation accordingly

…nd consolidate duplicate template helpers

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign raffo for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from szuecs and u-kai June 14, 2026 12:38
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 14, 2026
…nd consolidate duplicate template helpers

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
@ivankatliarchuk ivankatliarchuk marked this pull request as draft June 14, 2026 12:40
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 14, 2026
@coveralls

coveralls commented Jun 14, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27505670507

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.2%) to 81.196%

Details

  • Coverage decreased (-0.2%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 196 coverage regressions across 8 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

196 previously-covered lines in 8 files lost coverage.

File Lines Losing Coverage Coverage
traefik_proxy.go 88 67.68%
template/engine.go 49 66.04%
service.go 22 94.97%
gloo_proxy.go 18 74.5%
node.go 7 92.06%
pod.go 4 96.65%
f5_transportserver.go 4 79.46%
f5_virtualserver.go 4 80.17%

Coverage Stats

Coverage Status
Relevant Lines: 20974
Covered Lines: 17030
Line Coverage: 81.2%
Coverage Strength: 1484.44 hits per line

💛 - Coveralls

Comment thread endpoint/utils.go Fixed
…nd consolidate duplicate template helpers

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
…nd consolidate duplicate template helpers

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
…nd consolidate duplicate template helpers

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
@ivankatliarchuk ivankatliarchuk marked this pull request as ready for review June 14, 2026 14:43
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 14, 2026
@k8s-ci-robot k8s-ci-robot requested a review from vflaux June 14, 2026 14:43
ivankatliarchuk and others added 2 commits June 14, 2026 17:13
…nd consolidate duplicate template helpers

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants