update some lift file logical
Signed-off-by: zishen <softwarebtg@163.com>
This commit is contained in:
parent
2d22b74dfc
commit
b7e6826abc
|
@ -52,17 +52,17 @@ package lifted
|
||||||
| nodeselector_test.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/apis/core/helper/helpers_test.go#L138-L200 | func TestNodeSelectorRequirementsAsSelector | N |
|
| nodeselector_test.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/apis/core/helper/helpers_test.go#L138-L200 | func TestNodeSelectorRequirementsAsSelector | N |
|
||||||
| objectwatcher.go | https://github.com/kubernetes-sigs/kubefed/blob/master/pkg/controller/util/propagatedversion.go#L35-L43 | func ObjectVersion | N |
|
| objectwatcher.go | https://github.com/kubernetes-sigs/kubefed/blob/master/pkg/controller/util/propagatedversion.go#L35-L43 | func ObjectVersion | N |
|
||||||
| objectwatcher.go | https://github.com/kubernetes-sigs/kubefed/blob/master/pkg/controller/util/propagatedversion.go#L45-L59 | func ObjectNeedsUpdate | N |
|
| objectwatcher.go | https://github.com/kubernetes-sigs/kubefed/blob/master/pkg/controller/util/propagatedversion.go#L45-L59 | func ObjectNeedsUpdate | N |
|
||||||
| objectwatcher.go | https://github.com/kubernetes-sigs/kubefed/blob/master/pkg/controller/util/meta.go#L63-L80 | func objectMetaObjEquivalent | Y |
|
| objectwatcher.go | https://github.com/kubernetes-retired/kubefed/blob/master/pkg/controller/util/meta.go#L82-L103 | func objectMetaObjEquivalent | Y |
|
||||||
| podtemplate.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/controller/controller_utils.go#L466-L472 | func getPodsLabelSet | N |
|
| podtemplate.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/controller/controller_utils.go#L466-L472 | func getPodsLabelSet | N |
|
||||||
| podtemplate.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/controller/controller_utils.go#L474-L478 | func getPodsFinalizers | N |
|
| podtemplate.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/controller/controller_utils.go#L474-L478 | func getPodsFinalizers | N |
|
||||||
| podtemplate.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/controller/controller_utils.go#L480-L486 | func getPodsAnnotationSet | N |
|
| podtemplate.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/controller/controller_utils.go#L480-L486 | func getPodsAnnotationSet | N |
|
||||||
| podtemplate.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/controller/controller_utils.go#L488-L495 | func getPodsPrefix | N |
|
| podtemplate.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/controller/controller_utils.go#L488-L495 | func getPodsPrefix | N |
|
||||||
| podtemplate.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/controller/controller_utils.go#L539-L562 | func GetPodFromTemplate | Y |
|
| podtemplate.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/controller/controller_utils.go#L539-L562 | func GetPodFromTemplate | Y |
|
||||||
| requestinfo.go | https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo.go#L88-L247 | func NewRequestInfo | Y |
|
| requestinfo.go | https://github.com/kubernetes/apiserver/blob/release-1.26/pkg/endpoints/request/requestinfo.go#L67-L71 | var specialVerbs | N |
|
||||||
| requestinfo.go | https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo.go#L267-L274 | func SplitPath | Y |
|
| requestinfo.go | https://github.com/kubernetes/apiserver/blob/release-1.26/pkg/endpoints/request/requestinfo.go#L73-L74 | var specialVerbsNoSubresources | N |
|
||||||
| requestinfo.go | https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo.go#L73-L74 | var specialVerbsNoSubresources | N |
|
| requestinfo.go | https://github.com/kubernetes/apiserver/blob/release-1.26/pkg/endpoints/request/requestinfo.go#L76-L78 | var namespaceSubresources | N |
|
||||||
| requestinfo.go | https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo.go#L76-L78 | var namespaceSubresources | N |
|
| requestinfo.go | https://github.com/kubernetes/apiserver/blob/release-1.26/pkg/endpoints/request/requestinfo.go#L88-L247 | func NewRequestInfo | Y |
|
||||||
| requestinfo.go | https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo.go#L67-L71 | var specialVerbs | N |
|
| requestinfo.go | https://github.com/kubernetes/apiserver/blob/release-1.26/pkg/endpoints/request/requestinfo.go#L267-L274 | func SplitPath | Y |
|
||||||
| requestinfo_test.go | https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo_test.go#L30-L148 | func TestGetAPIRequestInfo | Y |
|
| requestinfo_test.go | https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo_test.go#L30-L148 | func TestGetAPIRequestInfo | Y |
|
||||||
| requestinfo_test.go | https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo_test.go#L150-L184 | func TestGetNonAPIRequestInfo | Y |
|
| requestinfo_test.go | https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo_test.go#L150-L184 | func TestGetNonAPIRequestInfo | Y |
|
||||||
| resourcename.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/scheduler/util/utils.go#L144-L148 | func IsScalarResourceName | Y |
|
| resourcename.go | https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/scheduler/util/utils.go#L144-L148 | func IsScalarResourceName | Y |
|
||||||
|
|
|
@ -18,7 +18,7 @@ limitations under the License.
|
||||||
// object needs to be updated according to the desired object and the recorded version.
|
// object needs to be updated according to the desired object and the recorded version.
|
||||||
// For reference:
|
// For reference:
|
||||||
// https://github.com/kubernetes-sigs/kubefed/blob/master/pkg/controller/util/propagatedversion.go#L30-L59
|
// https://github.com/kubernetes-sigs/kubefed/blob/master/pkg/controller/util/propagatedversion.go#L30-L59
|
||||||
// https://github.com/kubernetes-sigs/kubefed/blob/master/pkg/controller/util/meta.go#L63-L80
|
// https://github.com/kubernetes-retired/kubefed/blob/master/pkg/controller/util/meta.go#L82-L103
|
||||||
|
|
||||||
package lifted
|
package lifted
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ func ObjectNeedsUpdate(desiredObj, clusterObj *unstructured.Unstructured, record
|
||||||
return strings.HasPrefix(targetVersion, generationPrefix) && !objectMetaObjEquivalent(desiredObj, clusterObj)
|
return strings.HasPrefix(targetVersion, generationPrefix) && !objectMetaObjEquivalent(desiredObj, clusterObj)
|
||||||
}
|
}
|
||||||
|
|
||||||
// +lifted:source=https://github.com/kubernetes-sigs/kubefed/blob/master/pkg/controller/util/meta.go#L63-L80
|
// +lifted:source=https://github.com/kubernetes-retired/kubefed/blob/master/pkg/controller/util/meta.go#L82-L103
|
||||||
// +lifted:changed
|
// +lifted:changed
|
||||||
|
|
||||||
// objectMetaObjEquivalent checks if cluster-independent, user provided data in two given ObjectMeta are equal. If in
|
// objectMetaObjEquivalent checks if cluster-independent, user provided data in two given ObjectMeta are equal. If in
|
||||||
|
|
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||||
|
|
||||||
// This code is directly lifted from the Kubernetes codebase in order to avoid relying on the k8s.io/kubernetes package.
|
// This code is directly lifted from the Kubernetes codebase in order to avoid relying on the k8s.io/kubernetes package.
|
||||||
// For reference:
|
// For reference:
|
||||||
// https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo.go
|
// https://github.com/kubernetes/apiserver/blob/release-1.26/pkg/endpoints/request/requestinfo.go
|
||||||
|
|
||||||
package lifted
|
package lifted
|
||||||
|
|
||||||
|
@ -25,19 +25,39 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
|
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
|
||||||
|
metainternalversionscheme "k8s.io/apimachinery/pkg/apis/meta/internalversion/scheme"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
apirequest "k8s.io/apiserver/pkg/endpoints/request"
|
apirequest "k8s.io/apiserver/pkg/endpoints/request"
|
||||||
|
"k8s.io/klog/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var apiPrefixes = sets.NewString("apis", "api")
|
var apiPrefixes = sets.NewString("apis", "api")
|
||||||
var grouplessAPIPrefixes = sets.NewString("api")
|
var grouplessAPIPrefixes = sets.NewString("api")
|
||||||
|
|
||||||
// +lifted:source=https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo.go#L88-L247
|
// +lifted:source=https://github.com/kubernetes/apiserver/blob/release-1.26/pkg/endpoints/request/requestinfo.go#L67-L71
|
||||||
|
|
||||||
|
// specialVerbs contains just strings which are used in REST paths for special actions that don't fall under the normal
|
||||||
|
// CRUDdy GET/POST/PUT/DELETE actions on REST objects.
|
||||||
|
// TODO: find a way to keep this up to date automatically. Maybe dynamically populate list as handlers added to
|
||||||
|
// master's Mux.
|
||||||
|
var specialVerbs = sets.NewString("proxy", "watch")
|
||||||
|
|
||||||
|
// +lifted:source=https://github.com/kubernetes/apiserver/blob/release-1.26/pkg/endpoints/request/requestinfo.go#L73-L74
|
||||||
|
|
||||||
|
// specialVerbsNoSubresources contains root verbs which do not allow subresources
|
||||||
|
var specialVerbsNoSubresources = sets.NewString("proxy")
|
||||||
|
|
||||||
|
// +lifted:source=https://github.com/kubernetes/apiserver/blob/release-1.26/pkg/endpoints/request/requestinfo.go#L76-L78
|
||||||
|
|
||||||
|
// namespaceSubresources contains subresources of namespace
|
||||||
|
// this list allows the parser to distinguish between a namespace subresource, and a namespaced resource
|
||||||
|
var namespaceSubresources = sets.NewString("status", "finalize")
|
||||||
|
|
||||||
|
// +lifted:source=https://github.com/kubernetes/apiserver/blob/release-1.26/pkg/endpoints/request/requestinfo.go#L88-L247
|
||||||
// +lifted:changed
|
// +lifted:changed
|
||||||
|
|
||||||
// TODO write an integration test against the swagger doc to test the RequestInfo and match up behavior to responses
|
// TODO write an integration test against the swagger doc to test the RequestInfo and match up behavior to responses
|
||||||
|
|
||||||
// NewRequestInfo returns the information from the http request. If error is not nil, RequestInfo holds the information as best it is known before the failure
|
// NewRequestInfo returns the information from the http request. If error is not nil, RequestInfo holds the information as best it is known before the failure
|
||||||
// It handles both resource and non-resource requests and fills in all the pertinent information for each.
|
// It handles both resource and non-resource requests and fills in all the pertinent information for each.
|
||||||
// Valid Inputs:
|
// Valid Inputs:
|
||||||
|
@ -161,11 +181,18 @@ func NewRequestInfo(req *http.Request) *apirequest.RequestInfo {
|
||||||
// if there's no name on the request and we thought it was a get before, then the actual verb is a list or a watch
|
// if there's no name on the request and we thought it was a get before, then the actual verb is a list or a watch
|
||||||
if len(requestInfo.Name) == 0 && requestInfo.Verb == "get" {
|
if len(requestInfo.Name) == 0 && requestInfo.Verb == "get" {
|
||||||
opts := metainternalversion.ListOptions{}
|
opts := metainternalversion.ListOptions{}
|
||||||
if values := req.URL.Query()["watch"]; len(values) > 0 {
|
if err := metainternalversionscheme.ParameterCodec.DecodeParameters(req.URL.Query(), metav1.SchemeGroupVersion, &opts); err != nil {
|
||||||
switch strings.ToLower(values[0]) {
|
// An error in parsing request will result in default to "list" and not setting "name" field.
|
||||||
case "false", "0":
|
klog.ErrorS(err, "Couldn't parse request", "Request", req.URL.Query())
|
||||||
default:
|
// Reset opts to not rely on partial results from parsing.
|
||||||
opts.Watch = true
|
// However, if watch is set, let's report it.
|
||||||
|
opts = metainternalversion.ListOptions{}
|
||||||
|
if values := req.URL.Query()["watch"]; len(values) > 0 {
|
||||||
|
switch strings.ToLower(values[0]) {
|
||||||
|
case "false", "0":
|
||||||
|
default:
|
||||||
|
opts.Watch = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,7 +210,7 @@ func NewRequestInfo(req *http.Request) *apirequest.RequestInfo {
|
||||||
return &requestInfo
|
return &requestInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
// +lifted:source=https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo.go#L267-L274
|
// +lifted:source=https://github.com/kubernetes/apiserver/blob/release-1.26/pkg/endpoints/request/requestinfo.go#L267-L274
|
||||||
// +lifted:changed
|
// +lifted:changed
|
||||||
|
|
||||||
// SplitPath returns the segments for a URL path.
|
// SplitPath returns the segments for a URL path.
|
||||||
|
@ -194,22 +221,3 @@ func SplitPath(path string) []string {
|
||||||
}
|
}
|
||||||
return strings.Split(path, "/")
|
return strings.Split(path, "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
// +lifted:source=https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo.go#L73-L74
|
|
||||||
|
|
||||||
// specialVerbsNoSubresources contains root verbs which do not allow subresources
|
|
||||||
var specialVerbsNoSubresources = sets.NewString("proxy")
|
|
||||||
|
|
||||||
// +lifted:source=https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo.go#L76-L78
|
|
||||||
|
|
||||||
// namespaceSubresources contains subresources of namespace
|
|
||||||
// this list allows the parser to distinguish between a namespace subresource, and a namespaced resource
|
|
||||||
var namespaceSubresources = sets.NewString("status", "finalize")
|
|
||||||
|
|
||||||
// +lifted:source=https://github.com/kubernetes/apiserver/blob/release-1.23/pkg/endpoints/request/requestinfo.go#L67-L71
|
|
||||||
|
|
||||||
// specialVerbs contains just strings which are used in REST paths for special actions that don't fall under the normal
|
|
||||||
// CRUDdy GET/POST/PUT/DELETE actions on REST objects.
|
|
||||||
// TODO: find a way to keep this up to date automatically. Maybe dynamically populate list as handlers added to
|
|
||||||
// master's Mux.
|
|
||||||
var specialVerbs = sets.NewString("proxy", "watch")
|
|
||||||
|
|
Loading…
Reference in New Issue