Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-v0.7] fix: cache the server version info of kubernetes #977

Merged
merged 9 commits into from
Aug 30, 2022
Prev Previous commit
fix: fix the errors
(cherry picked from commit 7bab3ab)
  • Loading branch information
Sodawyx authored and github-actions[bot] committed Aug 30, 2022
commit 0c35e00398276038fc775b8f401d0b5ee33fe5f7
1 change: 1 addition & 0 deletions pkg/yurthub/server/nonresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func withNonResourceRequest(w http.ResponseWriter, req *http.Request) {
for i := range nonResourceReqPaths {
if req.URL.Path == nonResourceReqPaths[i] {
cacheNonResourceInfo(w, req, cfg.StorageWrapper, fmt.Sprintf("non-reosurce-info%s", nonResourceReqPaths[i]), nonResourceReqPaths[i], false)
break
}
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/yurthub/server/nonresource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ package server

import (
"fmt"
"github.com/openyurtio/openyurt/pkg/yurthub/cachemanager"
"github.com/openyurtio/openyurt/pkg/yurthub/storage/disk"
"net/http"
"net/http/httptest"
"os"
"testing"

"github.com/openyurtio/openyurt/pkg/yurthub/cachemanager"
"github.com/openyurtio/openyurt/pkg/yurthub/storage/disk"
)

var rootDir = "/tmp/cache-local"
Expand Down