You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
s.Require().Greater(len(s.pathHeaders), 0, "No requests were made to Kube API")
112
+
s.Run("DiscoveryClient propagates "+header+" header to Kube API", func() {
113
+
s.Require().NotNil(s.pathHeaders["/api"], "No requests were made to /api")
114
+
s.Equal("Bearer a-token-from-mcp-client", s.pathHeaders["/api"].Get("Authorization"), "Overridden header Authorization not found in request to /api")
115
+
s.Require().NotNil(s.pathHeaders["/apis"], "No requests were made to /apis")
116
+
s.Equal("Bearer a-token-from-mcp-client", s.pathHeaders["/apis"].Get("Authorization"), "Overridden header Authorization not found in request to /apis")
117
+
s.Require().NotNil(s.pathHeaders["/api/v1"], "No requests were made to /api/v1")
118
+
s.Equal("Bearer a-token-from-mcp-client", s.pathHeaders["/api/v1"].Get("Authorization"), "Overridden header Authorization not found in request to /api/v1")
108
119
})
109
-
t.Run("DynamicClient propagates headers to Kube API", func(t*testing.T) {
t.Fatalf("Overridden header Authorization not found in request to /api/v1/namespaces/default/pods")
115
-
}
120
+
s.Run("DynamicClient propagates "+header+" header to Kube API", func() {
121
+
s.Require().NotNil(s.pathHeaders["/api/v1/namespaces/default/pods"], "No requests were made to /api/v1/namespaces/default/pods")
122
+
s.Equal("Bearer a-token-from-mcp-client", s.pathHeaders["/api/v1/namespaces/default/pods"].Get("Authorization"), "Overridden header Authorization not found in request to /api/v1/namespaces/default/pods")
s.Run("kubernetes.Interface propagates "+header+" header to Kube API", func() {
126
+
s.Require().NotNil(s.pathHeaders["/api/v1/namespaces/default/pods/a-pod-to-delete"], "No requests were made to /api/v1/namespaces/default/pods/a-pod-to-delete")
127
+
s.Equal("Bearer a-token-from-mcp-client", s.pathHeaders["/api/v1/namespaces/default/pods/a-pod-to-delete"].Get("Authorization"), "Overridden header Authorization not found in request to /api/v1/namespaces/default/pods/a-pod-to-delete")
0 commit comments