From 2b7806b05e74496c5400fc1b784fdd13032c64ad Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Thu, 2 May 2024 14:49:53 -0400 Subject: [PATCH] Add unprivileged to agent provider. (#4658) --- internal/pkg/composable/providers/agent/agent.go | 1 + internal/pkg/composable/providers/agent/agent_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/internal/pkg/composable/providers/agent/agent.go b/internal/pkg/composable/providers/agent/agent.go index a560d4cac5f..7959bb86c86 100644 --- a/internal/pkg/composable/providers/agent/agent.go +++ b/internal/pkg/composable/providers/agent/agent.go @@ -36,6 +36,7 @@ func (*contextProvider) Run(ctx context.Context, comm corecomp.ContextProviderCo "build_time": release.BuildTime().Format("2006-01-02 15:04:05 -0700 MST"), "snapshot": release.Snapshot(), }, + "unprivileged": a.Unprivileged(), }) if err != nil { return errors.New(err, "failed to set mapping", errors.TypeUnexpected) diff --git a/internal/pkg/composable/providers/agent/agent_test.go b/internal/pkg/composable/providers/agent/agent_test.go index 5a4e9e2bd6a..57b6a6d15c5 100644 --- a/internal/pkg/composable/providers/agent/agent_test.go +++ b/internal/pkg/composable/providers/agent/agent_test.go @@ -35,4 +35,6 @@ func TestContextProvider(t *testing.T) { assert.True(t, hasID, "missing id") _, hasVersion := current["version"] assert.True(t, hasVersion, "missing version") + _, hasUnprivileged := current["unprivileged"] + assert.True(t, hasUnprivileged, "missing unprivileged") }