Skip to content

Commit b9fc567

Browse files
committed
Not using fine-grained auth.
1 parent 7caff55 commit b9fc567

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pkg/kubelet/server/auth.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ func isSubpath(subpath, path string) bool {
6969
// /metrics/* => verb=<api verb from request>, resource=nodes, name=<node name>, subresource(s)=metrics
7070
// /logs/* => verb=<api verb from request>, resource=nodes, name=<node name>, subresource(s)=log
7171
// /checkpoint/* => verb=<api verb from request>, resource=nodes, name=<node name>, subresource(s)=checkpoint
72+
// /statusz => verb=<api verb from request>, resource=nodes, name=<node name>, subresource(s)=statusz
7273
// /pods/* => verb=<api verb from request>, resource=nodes, name=<node name>, subresource(s)=pods,proxy
7374
// /runningPods/* => verb=<api verb from request>, resource=nodes, name=<node name>, subresource(s)=pods,proxy
7475
// /healthz/* => verb=<api verb from request>, resource=nodes, name=<node name>, subresource(s)=healthz,proxy
7576
// /configz => verb=<api verb from request>, resource=nodes, name=<node name>, subresource(s)=configz,proxy
76-
// /statusz => verb=<api verb from request>, resource=nodes, name=<node name>, subresource(s)=statusz,proxy
7777
func (n nodeAuthorizerAttributesGetter) GetRequestAttributes(u user.Info, r *http.Request) []authorizer.Attributes {
7878

7979
apiVerb := ""
@@ -101,8 +101,6 @@ func (n nodeAuthorizerAttributesGetter) GetRequestAttributes(u user.Info, r *htt
101101
subresources = append(subresources, "healthz")
102102
case isSubpath(requestPath, configz.DefaultConfigzPath):
103103
subresources = append(subresources, "configz")
104-
case isSubpath(requestPath, statusz.DefaultStatuszPath):
105-
subresources = append(subresources, "statusz")
106104
// We put runningpods last since it will allocate a new string on every
107105
// check since the handler path has a trailing slash.
108106
case isSubpath(requestPath, runningPodsPath):
@@ -120,6 +118,8 @@ func (n nodeAuthorizerAttributesGetter) GetRequestAttributes(u user.Info, r *htt
120118
subresources = append(subresources, "log")
121119
case isSubpath(requestPath, checkpointPath):
122120
subresources = append(subresources, "checkpoint")
121+
case isSubpath(requestPath, statusz.DefaultStatuszPath):
122+
subresources = append(subresources, "statusz")
123123
default:
124124
subresources = append(subresources, "proxy")
125125
}

pkg/kubelet/server/server_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,8 @@ func TestServePortForward(t *testing.T) {
16191619
}
16201620

16211621
func TestMetricBuckets(t *testing.T) {
1622+
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, zpagesfeatures.ComponentStatusz, true)
1623+
16221624
tests := map[string]struct {
16231625
url string
16241626
bucket string
@@ -1654,7 +1656,6 @@ func TestMetricBuckets(t *testing.T) {
16541656
"invalid path": {url: "/junk", bucket: "other"},
16551657
"invalid path starting with good": {url: "/healthzjunk", bucket: "other"},
16561658
}
1657-
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, zpagesfeatures.ComponentStatusz, true)
16581659
fw := newServerTest()
16591660
defer fw.testHTTPServer.Close()
16601661

0 commit comments

Comments
 (0)