Skip to content

Fix k8s workload attestor Broker API config docs and remove dead code#7112

Merged
sorindumitru merged 3 commits into
spiffe:mainfrom
amartinezfayo:broker-k8s-followup
Jul 2, 2026
Merged

Fix k8s workload attestor Broker API config docs and remove dead code#7112
sorindumitru merged 3 commits into
spiffe:mainfrom
amartinezfayo:broker-k8s-followup

Conversation

@amartinezfayo

Copy link
Copy Markdown
Member

The SPIFFE Broker API support for the k8s workload attestor merged in #6915. This is a small follow-up addressing a few items noted during that review.

The agent_full.conf example for the k8s plugin still placed the broker block at the top level of plugin_data, but the plugin now expects it under experimental, so uncommenting the example as written would be rejected as an unknown key. This nests the broker block under experimental and adds the missing experimental.api_server.cache.enabled example.

The plugin documentation listed the experimental options as fully-qualified dotted rows in the main configuration table. This moves them into a dedicated experimental configuration sub-table, matching how spire_agent.md, spire_server.md, and the upstreamauthority_spire plugin doc present experimental settings.

Finally, checkPodReferenceScope became dead code once agent_node pod resolution was limited to the kubelet and stopped falling back to the API server. It was only reachable on the cluster-scope path, where it is a no-op, so this removes the function and its two call sites.

Signed-off-by: Agustín Martínez Fayó <amartinezfayo@gmail.com>
Copilot AI review requested due to automatic review settings July 2, 2026 13:44
@amartinezfayo
amartinezfayo requested a review from evan2645 as a code owner July 2, 2026 13:44
@amartinezfayo amartinezfayo added this to the 1.15.2 milestone Jul 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Follow-up to Broker API support in the k8s workload attestor, focusing on aligning documentation/examples with the plugin’s current experimental config shape and removing now-dead scope-check logic from the attestation implementation.

Changes:

  • Removed dead checkPodReferenceScope logic and its call sites in the k8s workload attestor.
  • Reworked k8s workload attestor plugin docs to present experimental settings in a dedicated sub-table.
  • Updated agent_full.conf k8s plugin example to nest broker under experimental and include the missing experimental.api_server.cache.enabled example.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pkg/agent/plugin/workloadattestor/k8s/k8s.go Removes unreachable pod-scope validation helper and call sites.
doc/plugin_agent_workloadattestor_k8s.md Moves experimental options into a dedicated “experimental” configuration sub-table.
conf/agent/agent_full.conf Updates the k8s plugin example to correctly nest Broker/API server cache config under experimental.

Comment thread conf/agent/agent_full.conf Outdated
Signed-off-by: Agustín Martínez Fayó <amartinezfayo@gmail.com>

@matheuscscp matheuscscp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Since now we only look at the kubelet results for the agent_node scope, we no longer need this explicit check. Another good thing is that we no longer need to rely on the node name being properly configured in the plugin :)

Great catch on the docs as well!

Signed-off-by: Agustín Martínez Fayó <amartinezfayo@gmail.com>
@sorindumitru
sorindumitru added this pull request to the merge queue Jul 2, 2026
Merged via the queue into spiffe:main with commit 656b64d Jul 2, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants