MCPcopy Index your code
hub / github.com/1Panel-dev/KubePi / compatibleClusterVersion

Function compatibleClusterVersion

internal/api/v1/proxy/proxy.go:301–322  ·  view source on GitHub ↗
(minor int, path *string)

Source from the content-addressed store, hash-verified

299}
300
301func compatibleClusterVersion(minor int, path *string) {
302 p := *path
303 if minor <= 18 {
304 if strings.Contains(p, "networking.k8s.io/v1/") && strings.Contains(p, "ingresses") {
305 p = strings.Replace(p, "networking.k8s.io/v1/", "networking.k8s.io/v1beta1/", -1)
306 }
307 }
308 if minor <= 20 {
309 if strings.Contains(p, "batch/v1/") && strings.Contains(p, "cronjobs") {
310 p = strings.Replace(p, "batch/v1/", "batch/v1beta1/", -1)
311 }
312 if strings.Contains(p, "policy/v1/") && strings.Contains(p, "poddisruptionbudgets") {
313 p = strings.Replace(p, "policy/v1/", "policy/v1beta1/", -1)
314 }
315 }
316 if minor <= 22 {
317 if strings.Contains(p, "autoscaling/v2/") && strings.Contains(p, "horizontalpodautoscalers") {
318 p = strings.Replace(p, "autoscaling/v2/", "autoscaling/v2beta2/", -1)
319 }
320 }
321 *path = p
322}
323
324func hasNamespaceFilter(path string) bool {
325 ss := strings.Split(path, "/")

Callers 1

KubernetesAPIProxyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected