repo stringclasses 1
value | path stringlengths 18 145 | func_name stringlengths 2 108 | original_string stringlengths 68 22.9k | language stringclasses 1
value | code stringlengths 68 22.9k | code_tokens listlengths 23 4.91k | docstring stringlengths 13 1.73k | docstring_tokens listlengths 1 335 | sha stringclasses 1
value | url stringlengths 113 242 | partition stringclasses 1
value | summary stringlengths 15 310 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kubernetes/kubernetes | pkg/registry/core/namespace/strategy.go | MatchNamespace | func MatchNamespace(label labels.Selector, field fields.Selector) apistorage.SelectionPredicate {
return apistorage.SelectionPredicate{
Label: label,
Field: field,
GetAttrs: GetAttrs,
}
} | go | func MatchNamespace(label labels.Selector, field fields.Selector) apistorage.SelectionPredicate {
return apistorage.SelectionPredicate{
Label: label,
Field: field,
GetAttrs: GetAttrs,
}
} | [
"func",
"MatchNamespace",
"(",
"label",
"labels",
".",
"Selector",
",",
"field",
"fields",
".",
"Selector",
")",
"apistorage",
".",
"SelectionPredicate",
"{",
"return",
"apistorage",
".",
"SelectionPredicate",
"{",
"Label",
":",
"label",
",",
"Field",
":",
"fi... | // MatchNamespace returns a generic matcher for a given label and field selector. | [
"MatchNamespace",
"returns",
"a",
"generic",
"matcher",
"for",
"a",
"given",
"label",
"and",
"field",
"selector",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/registry/core/namespace/strategy.go#L151-L157 | train | MatchNamespace returns a SelectionPredicate that matches a namespace. | [
30522,
4569,
2278,
2674,
18442,
23058,
1006,
3830,
10873,
1012,
27000,
1010,
2492,
4249,
1012,
27000,
1007,
17928,
23809,
4270,
1012,
4989,
28139,
16467,
1063,
2709,
17928,
23809,
4270,
1012,
4989,
28139,
16467,
1063,
3830,
1024,
3830,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/scheduling/v1alpha1/zz_generated.conversion.go | Convert_scheduling_PriorityClass_To_v1alpha1_PriorityClass | func Convert_scheduling_PriorityClass_To_v1alpha1_PriorityClass(in *scheduling.PriorityClass, out *v1alpha1.PriorityClass, s conversion.Scope) error {
return autoConvert_scheduling_PriorityClass_To_v1alpha1_PriorityClass(in, out, s)
} | go | func Convert_scheduling_PriorityClass_To_v1alpha1_PriorityClass(in *scheduling.PriorityClass, out *v1alpha1.PriorityClass, s conversion.Scope) error {
return autoConvert_scheduling_PriorityClass_To_v1alpha1_PriorityClass(in, out, s)
} | [
"func",
"Convert_scheduling_PriorityClass_To_v1alpha1_PriorityClass",
"(",
"in",
"*",
"scheduling",
".",
"PriorityClass",
",",
"out",
"*",
"v1alpha1",
".",
"PriorityClass",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_scheduling_Priori... | // Convert_scheduling_PriorityClass_To_v1alpha1_PriorityClass is an autogenerated conversion function. | [
"Convert_scheduling_PriorityClass_To_v1alpha1_PriorityClass",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/scheduling/v1alpha1/zz_generated.conversion.go#L84-L86 | train | Convert_scheduling_PriorityClass_To_v1alpha1_PriorityClass is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
19940,
1035,
9470,
26266,
1035,
2000,
1035,
1058,
2487,
2389,
21890,
2487,
1035,
9470,
26266,
1006,
1999,
1008,
19940,
1012,
9470,
26266,
1010,
2041,
1008,
1058,
2487,
2389,
21890,
2487,
1012,
9470,
26266,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apiserver/pkg/endpoints/handlers/get.go | GetResourceWithOptions | func GetResourceWithOptions(r rest.GetterWithOptions, scope *RequestScope, isSubresource bool) http.HandlerFunc {
return getResourceHandler(scope,
func(ctx context.Context, name string, req *http.Request, trace *utiltrace.Trace) (runtime.Object, error) {
opts, subpath, subpathKey := r.NewGetOptions()
trace.Ste... | go | func GetResourceWithOptions(r rest.GetterWithOptions, scope *RequestScope, isSubresource bool) http.HandlerFunc {
return getResourceHandler(scope,
func(ctx context.Context, name string, req *http.Request, trace *utiltrace.Trace) (runtime.Object, error) {
opts, subpath, subpathKey := r.NewGetOptions()
trace.Ste... | [
"func",
"GetResourceWithOptions",
"(",
"r",
"rest",
".",
"GetterWithOptions",
",",
"scope",
"*",
"RequestScope",
",",
"isSubresource",
"bool",
")",
"http",
".",
"HandlerFunc",
"{",
"return",
"getResourceHandler",
"(",
"scope",
",",
"func",
"(",
"ctx",
"context",... | // GetResourceWithOptions returns a function that handles retrieving a single resource from a rest.Storage object. | [
"GetResourceWithOptions",
"returns",
"a",
"function",
"that",
"handles",
"retrieving",
"a",
"single",
"resource",
"from",
"a",
"rest",
".",
"Storage",
"object",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/get.go#L111-L125 | train | GetResourceWithOptions returns a handler that can be used to handle GET requests. | [
30522,
4569,
2278,
2131,
6072,
8162,
3401,
24415,
7361,
9285,
1006,
1054,
2717,
1012,
2131,
3334,
24415,
7361,
9285,
1010,
9531,
1008,
11186,
16186,
1010,
26354,
12083,
6072,
8162,
3401,
22017,
2140,
1007,
8299,
1012,
28213,
11263,
12273,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/client-go/tools/clientcmd/client_config.go | Possible | func (config *inClusterClientConfig) Possible() bool {
fi, err := os.Stat("/var/run/secrets/kubernetes.io/serviceaccount/token")
return os.Getenv("KUBERNETES_SERVICE_HOST") != "" &&
os.Getenv("KUBERNETES_SERVICE_PORT") != "" &&
err == nil && !fi.IsDir()
} | go | func (config *inClusterClientConfig) Possible() bool {
fi, err := os.Stat("/var/run/secrets/kubernetes.io/serviceaccount/token")
return os.Getenv("KUBERNETES_SERVICE_HOST") != "" &&
os.Getenv("KUBERNETES_SERVICE_PORT") != "" &&
err == nil && !fi.IsDir()
} | [
"func",
"(",
"config",
"*",
"inClusterClientConfig",
")",
"Possible",
"(",
")",
"bool",
"{",
"fi",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"\"",
"\"",
")",
"\n",
"return",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"!=",
"\"",
"\"",
"&&",
"os",... | // Possible returns true if loading an inside-kubernetes-cluster is possible. | [
"Possible",
"returns",
"true",
"if",
"loading",
"an",
"inside",
"-",
"kubernetes",
"-",
"cluster",
"is",
"possible",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/client_config.go#L525-L530 | train | Possible returns true if the in - cluster client is possible to use the serviceaccount token | [
30522,
4569,
2278,
1006,
9530,
8873,
2290,
1008,
4297,
7393,
3334,
20464,
11638,
8663,
8873,
2290,
1007,
2825,
1006,
1007,
22017,
2140,
1063,
10882,
1010,
9413,
2099,
1024,
1027,
9808,
1012,
28093,
1006,
1000,
1013,
13075,
1013,
2448,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/admissionregistration/zz_generated.deepcopy.go | DeepCopy | func (in *ValidatingWebhookConfiguration) DeepCopy() *ValidatingWebhookConfiguration {
if in == nil {
return nil
}
out := new(ValidatingWebhookConfiguration)
in.DeepCopyInto(out)
return out
} | go | func (in *ValidatingWebhookConfiguration) DeepCopy() *ValidatingWebhookConfiguration {
if in == nil {
return nil
}
out := new(ValidatingWebhookConfiguration)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"ValidatingWebhookConfiguration",
")",
"DeepCopy",
"(",
")",
"*",
"ValidatingWebhookConfiguration",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ValidatingWebhookConfiguration",
")",
"\n... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatingWebhookConfiguration. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"ValidatingWebhookConfiguration",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L189-L196 | train | DeepCopy is an autogenerated deepcopy function copying the receiver creating a new ValidatingWebhookConfiguration. | [
30522,
4569,
2278,
1006,
1999,
1008,
9398,
5844,
8545,
23706,
14659,
8663,
8873,
27390,
3370,
1007,
2784,
3597,
7685,
1006,
1007,
1008,
9398,
5844,
8545,
23706,
14659,
8663,
8873,
27390,
3370,
1063,
2065,
1999,
1027,
1027,
9152,
2140,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubemark/hollow_kubelet.go | GetHollowKubeletConfig | func GetHollowKubeletConfig(
nodeName string,
kubeletPort int,
kubeletReadOnlyPort int,
maxPods int,
podsPerCore int) (*options.KubeletFlags, *kubeletconfig.KubeletConfiguration) {
testRootDir := utils.MakeTempDirOrDie("hollow-kubelet.", "")
podFilePath := utils.MakeTempDirOrDie("static-pods", testRootDir)
klo... | go | func GetHollowKubeletConfig(
nodeName string,
kubeletPort int,
kubeletReadOnlyPort int,
maxPods int,
podsPerCore int) (*options.KubeletFlags, *kubeletconfig.KubeletConfiguration) {
testRootDir := utils.MakeTempDirOrDie("hollow-kubelet.", "")
podFilePath := utils.MakeTempDirOrDie("static-pods", testRootDir)
klo... | [
"func",
"GetHollowKubeletConfig",
"(",
"nodeName",
"string",
",",
"kubeletPort",
"int",
",",
"kubeletReadOnlyPort",
"int",
",",
"maxPods",
"int",
",",
"podsPerCore",
"int",
")",
"(",
"*",
"options",
".",
"KubeletFlags",
",",
"*",
"kubeletconfig",
".",
"KubeletCo... | // Builds a KubeletConfiguration for the HollowKubelet, ensuring that the
// usual defaults are applied for fields we do not override. | [
"Builds",
"a",
"KubeletConfiguration",
"for",
"the",
"HollowKubelet",
"ensuring",
"that",
"the",
"usual",
"defaults",
"are",
"applied",
"for",
"fields",
"we",
"do",
"not",
"override",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubemark/hollow_kubelet.go#L105-L168 | train | GetHollowKubeletConfig returns the kubelet config for the given node name and port. | [
30522,
4569,
2278,
2131,
14854,
8261,
5283,
8671,
3388,
8663,
8873,
2290,
1006,
13045,
18442,
5164,
1010,
13970,
8671,
3388,
6442,
20014,
1010,
13970,
8671,
3388,
16416,
5280,
2135,
6442,
20014,
1010,
4098,
22925,
20014,
1010,
26723,
4842,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/proxy/iptables/proxier.go | appendServiceCommentLocked | func (proxier *Proxier) appendServiceCommentLocked(args []string, svcName string) {
// Not printing these comments, can reduce size of iptables (in case of large
// number of endpoints) even by 40%+. So if total number of endpoint chains
// is large enough, we simply drop those comments.
if proxier.endpointChainsNu... | go | func (proxier *Proxier) appendServiceCommentLocked(args []string, svcName string) {
// Not printing these comments, can reduce size of iptables (in case of large
// number of endpoints) even by 40%+. So if total number of endpoint chains
// is large enough, we simply drop those comments.
if proxier.endpointChainsNu... | [
"func",
"(",
"proxier",
"*",
"Proxier",
")",
"appendServiceCommentLocked",
"(",
"args",
"[",
"]",
"string",
",",
"svcName",
"string",
")",
"{",
"// Not printing these comments, can reduce size of iptables (in case of large",
"// number of endpoints) even by 40%+. So if total numb... | // Assumes proxier.mu is held. | [
"Assumes",
"proxier",
".",
"mu",
"is",
"held",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/proxy/iptables/proxier.go#L636-L644 | train | appendServiceCommentLocked appends a service comment to the given args. | [
30522,
4569,
2278,
1006,
4013,
16898,
2099,
1008,
4013,
16898,
2099,
1007,
10439,
10497,
8043,
7903,
8586,
5358,
3672,
7878,
2098,
1006,
12098,
5620,
1031,
1033,
5164,
1010,
17917,
2278,
18442,
5164,
1007,
1063,
1013,
1013,
2025,
8021,
2122... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go | handleDirectiveInMergeMap | func handleDirectiveInMergeMap(directive interface{}, patch map[string]interface{}) (map[string]interface{}, error) {
if directive == replaceDirective {
// If the patch contains "$patch: replace", don't merge it, just use the
// patch directly. Later on, we can add a single level replace that only
// affects the... | go | func handleDirectiveInMergeMap(directive interface{}, patch map[string]interface{}) (map[string]interface{}, error) {
if directive == replaceDirective {
// If the patch contains "$patch: replace", don't merge it, just use the
// patch directly. Later on, we can add a single level replace that only
// affects the... | [
"func",
"handleDirectiveInMergeMap",
"(",
"directive",
"interface",
"{",
"}",
",",
"patch",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"if",
"directive",
"==",
"... | // handleDirectiveInMergeMap handles the patch directive when merging 2 maps. | [
"handleDirectiveInMergeMap",
"handles",
"the",
"patch",
"directive",
"when",
"merging",
"2",
"maps",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go#L907-L923 | train | handleDirectiveInMergeMap handles a patch directive in a merge map. | [
30522,
4569,
2278,
8971,
7442,
15277,
2378,
5017,
3351,
2863,
2361,
1006,
16449,
8278,
1063,
1065,
1010,
8983,
4949,
1031,
5164,
1033,
8278,
1063,
1065,
1007,
1006,
4949,
1031,
5164,
1033,
8278,
1063,
1065,
1010,
7561,
1007,
1063,
2065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/controller/disruption/disruption.go | getPodDeployment | func (dc *DisruptionController) getPodDeployment(pod *v1.Pod) (*controllerAndScale, error) {
controllerRef := metav1.GetControllerOf(pod)
if controllerRef == nil {
return nil, nil
}
if controllerRef.Kind != controllerKindRS.Kind {
return nil, nil
}
rs, err := dc.rsLister.ReplicaSets(pod.Namespace).Get(control... | go | func (dc *DisruptionController) getPodDeployment(pod *v1.Pod) (*controllerAndScale, error) {
controllerRef := metav1.GetControllerOf(pod)
if controllerRef == nil {
return nil, nil
}
if controllerRef.Kind != controllerKindRS.Kind {
return nil, nil
}
rs, err := dc.rsLister.ReplicaSets(pod.Namespace).Get(control... | [
"func",
"(",
"dc",
"*",
"DisruptionController",
")",
"getPodDeployment",
"(",
"pod",
"*",
"v1",
".",
"Pod",
")",
"(",
"*",
"controllerAndScale",
",",
"error",
")",
"{",
"controllerRef",
":=",
"metav1",
".",
"GetControllerOf",
"(",
"pod",
")",
"\n",
"if",
... | // getPodDeployments finds deployments for any replicasets which are being managed by deployments. | [
"getPodDeployments",
"finds",
"deployments",
"for",
"any",
"replicasets",
"which",
"are",
"being",
"managed",
"by",
"deployments",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/controller/disruption/disruption.go#L229-L261 | train | getPodDeployment returns the controller and scale of the deployment of the given pod. | [
30522,
4569,
2278,
1006,
5887,
1008,
20461,
8663,
13181,
10820,
1007,
2131,
27633,
3207,
24759,
6977,
3672,
1006,
17491,
1008,
1058,
2487,
1012,
17491,
1007,
1006,
1008,
11486,
29560,
9289,
2063,
1010,
7561,
1007,
1063,
11486,
2890,
2546,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubectl/generate/versioned/deployment.go | buildPodSpec | func buildPodSpec(images []string) v1.PodSpec {
podSpec := v1.PodSpec{Containers: []v1.Container{}}
for _, imageString := range images {
// Retain just the image name
imageSplit := strings.Split(imageString, "/")
name := imageSplit[len(imageSplit)-1]
// Remove any tag or hash
if strings.Contains(name, ":") ... | go | func buildPodSpec(images []string) v1.PodSpec {
podSpec := v1.PodSpec{Containers: []v1.Container{}}
for _, imageString := range images {
// Retain just the image name
imageSplit := strings.Split(imageString, "/")
name := imageSplit[len(imageSplit)-1]
// Remove any tag or hash
if strings.Contains(name, ":") ... | [
"func",
"buildPodSpec",
"(",
"images",
"[",
"]",
"string",
")",
"v1",
".",
"PodSpec",
"{",
"podSpec",
":=",
"v1",
".",
"PodSpec",
"{",
"Containers",
":",
"[",
"]",
"v1",
".",
"Container",
"{",
"}",
"}",
"\n",
"for",
"_",
",",
"imageString",
":=",
"... | // buildPodSpec: parse the image strings and assemble them into the Containers
// of a PodSpec. This is all you need to create the PodSpec for a deployment. | [
"buildPodSpec",
":",
"parse",
"the",
"image",
"strings",
"and",
"assemble",
"them",
"into",
"the",
"Containers",
"of",
"a",
"PodSpec",
".",
"This",
"is",
"all",
"you",
"need",
"to",
"create",
"the",
"PodSpec",
"for",
"a",
"deployment",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/generate/versioned/deployment.go#L74-L90 | train | buildPodSpec builds a pod spec from a list of images | [
30522,
4569,
2278,
3857,
22925,
5051,
2278,
1006,
4871,
1031,
1033,
5164,
1007,
1058,
2487,
1012,
26723,
5051,
2278,
1063,
26723,
5051,
2278,
1024,
1027,
1058,
2487,
1012,
26723,
5051,
2278,
1063,
16143,
1024,
1031,
1033,
1058,
2487,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/core/v1/zz_generated.conversion.go | Convert_v1_RBDVolumeSource_To_core_RBDVolumeSource | func Convert_v1_RBDVolumeSource_To_core_RBDVolumeSource(in *v1.RBDVolumeSource, out *core.RBDVolumeSource, s conversion.Scope) error {
return autoConvert_v1_RBDVolumeSource_To_core_RBDVolumeSource(in, out, s)
} | go | func Convert_v1_RBDVolumeSource_To_core_RBDVolumeSource(in *v1.RBDVolumeSource, out *core.RBDVolumeSource, s conversion.Scope) error {
return autoConvert_v1_RBDVolumeSource_To_core_RBDVolumeSource(in, out, s)
} | [
"func",
"Convert_v1_RBDVolumeSource_To_core_RBDVolumeSource",
"(",
"in",
"*",
"v1",
".",
"RBDVolumeSource",
",",
"out",
"*",
"core",
".",
"RBDVolumeSource",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_v1_RBDVolumeSource_To_core_RBDVol... | // Convert_v1_RBDVolumeSource_To_core_RBDVolumeSource is an autogenerated conversion function. | [
"Convert_v1_RBDVolumeSource_To_core_RBDVolumeSource",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/core/v1/zz_generated.conversion.go#L6052-L6054 | train | Convert_v1_RBDVolumeSource_To_core_RBDVolumeSource is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
1058,
2487,
1035,
21144,
2094,
6767,
12942,
2229,
8162,
3401,
1035,
2000,
1035,
4563,
1035,
21144,
2094,
6767,
12942,
2229,
8162,
3401,
1006,
1999,
1008,
1058,
2487,
1012,
21144,
2094,
6767,
12942,
2229,
8162... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/client-go/tools/record/events_cache.go | NewEventAggregator | func NewEventAggregator(lruCacheSize int, keyFunc EventAggregatorKeyFunc, messageFunc EventAggregatorMessageFunc,
maxEvents int, maxIntervalInSeconds int, clock clock.Clock) *EventAggregator {
return &EventAggregator{
cache: lru.New(lruCacheSize),
keyFunc: keyFunc,
messageFunc: ... | go | func NewEventAggregator(lruCacheSize int, keyFunc EventAggregatorKeyFunc, messageFunc EventAggregatorMessageFunc,
maxEvents int, maxIntervalInSeconds int, clock clock.Clock) *EventAggregator {
return &EventAggregator{
cache: lru.New(lruCacheSize),
keyFunc: keyFunc,
messageFunc: ... | [
"func",
"NewEventAggregator",
"(",
"lruCacheSize",
"int",
",",
"keyFunc",
"EventAggregatorKeyFunc",
",",
"messageFunc",
"EventAggregatorMessageFunc",
",",
"maxEvents",
"int",
",",
"maxIntervalInSeconds",
"int",
",",
"clock",
"clock",
".",
"Clock",
")",
"*",
"EventAggr... | // NewEventAggregator returns a new instance of an EventAggregator | [
"NewEventAggregator",
"returns",
"a",
"new",
"instance",
"of",
"an",
"EventAggregator"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/record/events_cache.go#L204-L214 | train | NewEventAggregator returns a new instance of an event aggregator. | [
30522,
4569,
2278,
2047,
18697,
12380,
13871,
2890,
20697,
2953,
1006,
1048,
6820,
3540,
8376,
4697,
20014,
1010,
3145,
11263,
12273,
2724,
8490,
17603,
20697,
2953,
14839,
11263,
12273,
1010,
4471,
11263,
12273,
2724,
8490,
17603,
20697,
295... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubectl/version/version.go | Get | func Get() apimachineryversion.Info {
// These variables typically come from -ldflags settings and in
// their absence fallback to the settings in ./base.go
return apimachineryversion.Info{
Major: gitMajor,
Minor: gitMinor,
GitVersion: gitVersion,
GitCommit: gitCommit,
GitTreeState: gitT... | go | func Get() apimachineryversion.Info {
// These variables typically come from -ldflags settings and in
// their absence fallback to the settings in ./base.go
return apimachineryversion.Info{
Major: gitMajor,
Minor: gitMinor,
GitVersion: gitVersion,
GitCommit: gitCommit,
GitTreeState: gitT... | [
"func",
"Get",
"(",
")",
"apimachineryversion",
".",
"Info",
"{",
"// These variables typically come from -ldflags settings and in",
"// their absence fallback to the settings in ./base.go",
"return",
"apimachineryversion",
".",
"Info",
"{",
"Major",
":",
"gitMajor",
",",
"Mino... | // Get returns the overall codebase version. It's for detecting
// what code a binary was built from. | [
"Get",
"returns",
"the",
"overall",
"codebase",
"version",
".",
"It",
"s",
"for",
"detecting",
"what",
"code",
"a",
"binary",
"was",
"built",
"from",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/version/version.go#L28-L42 | train | Get returns a version info object | [
30522,
4569,
2278,
2131,
1006,
1007,
17928,
22911,
14014,
2854,
27774,
1012,
18558,
1063,
1013,
1013,
2122,
10857,
4050,
2272,
2013,
1011,
25510,
10258,
26454,
10906,
1998,
1999,
1013,
1013,
2037,
6438,
2991,
5963,
2000,
1996,
10906,
1999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/cloudprovider/providers/gce/gce_targetproxy.go | GetTargetHTTPProxy | func (g *Cloud) GetTargetHTTPProxy(name string) (*compute.TargetHttpProxy, error) {
ctx, cancel := cloud.ContextWithCallTimeout()
defer cancel()
mc := newTargetProxyMetricContext("get")
v, err := g.c.TargetHttpProxies().Get(ctx, meta.GlobalKey(name))
return v, mc.Observe(err)
} | go | func (g *Cloud) GetTargetHTTPProxy(name string) (*compute.TargetHttpProxy, error) {
ctx, cancel := cloud.ContextWithCallTimeout()
defer cancel()
mc := newTargetProxyMetricContext("get")
v, err := g.c.TargetHttpProxies().Get(ctx, meta.GlobalKey(name))
return v, mc.Observe(err)
} | [
"func",
"(",
"g",
"*",
"Cloud",
")",
"GetTargetHTTPProxy",
"(",
"name",
"string",
")",
"(",
"*",
"compute",
".",
"TargetHttpProxy",
",",
"error",
")",
"{",
"ctx",
",",
"cancel",
":=",
"cloud",
".",
"ContextWithCallTimeout",
"(",
")",
"\n",
"defer",
"canc... | // GetTargetHTTPProxy returns the UrlMap by name. | [
"GetTargetHTTPProxy",
"returns",
"the",
"UrlMap",
"by",
"name",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_targetproxy.go#L32-L39 | train | GetTargetHTTPProxy returns the target http proxy by name. | [
30522,
4569,
2278,
1006,
1043,
1008,
6112,
1007,
2131,
7559,
18150,
11039,
25856,
21572,
18037,
1006,
2171,
5164,
1007,
1006,
1008,
24134,
1012,
4539,
11039,
25856,
21572,
18037,
1010,
7561,
1007,
1063,
14931,
2595,
1010,
17542,
1024,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | plugin/pkg/admission/security/podsecuritypolicy/admission.go | ValidateInitialization | func (plugin *PodSecurityPolicyPlugin) ValidateInitialization() error {
if plugin.authz == nil {
return fmt.Errorf("%s requires an authorizer", PluginName)
}
if plugin.lister == nil {
return fmt.Errorf("%s requires a lister", PluginName)
}
return nil
} | go | func (plugin *PodSecurityPolicyPlugin) ValidateInitialization() error {
if plugin.authz == nil {
return fmt.Errorf("%s requires an authorizer", PluginName)
}
if plugin.lister == nil {
return fmt.Errorf("%s requires a lister", PluginName)
}
return nil
} | [
"func",
"(",
"plugin",
"*",
"PodSecurityPolicyPlugin",
")",
"ValidateInitialization",
"(",
")",
"error",
"{",
"if",
"plugin",
".",
"authz",
"==",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"PluginName",
")",
"\n",
"}",
"\n",
"if",
... | // ValidateInitialization ensures an authorizer is set. | [
"ValidateInitialization",
"ensures",
"an",
"authorizer",
"is",
"set",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/plugin/pkg/admission/security/podsecuritypolicy/admission.go#L73-L81 | train | ValidateInitialization checks that the plugin is initialized. | [
30522,
4569,
2278,
1006,
13354,
2378,
1008,
26723,
8586,
25137,
18155,
2594,
22571,
7630,
11528,
1007,
9398,
3686,
5498,
20925,
3989,
1006,
1007,
7561,
1063,
2065,
13354,
2378,
1012,
8740,
2705,
2480,
1027,
1027,
9152,
2140,
1063,
2709,
471... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/client-go/tools/clientcmd/client_config.go | getClusterName | func (config *DirectClientConfig) getClusterName() (string, bool) {
if len(config.overrides.Context.Cluster) != 0 {
return config.overrides.Context.Cluster, true
}
context, _ := config.getContext()
return context.Cluster, false
} | go | func (config *DirectClientConfig) getClusterName() (string, bool) {
if len(config.overrides.Context.Cluster) != 0 {
return config.overrides.Context.Cluster, true
}
context, _ := config.getContext()
return context.Cluster, false
} | [
"func",
"(",
"config",
"*",
"DirectClientConfig",
")",
"getClusterName",
"(",
")",
"(",
"string",
",",
"bool",
")",
"{",
"if",
"len",
"(",
"config",
".",
"overrides",
".",
"Context",
".",
"Cluster",
")",
"!=",
"0",
"{",
"return",
"config",
".",
"overri... | // getClusterName returns a string containing the default, or user-set cluster name, and a boolean
// indicating whether the default clusterName has been overwritten by a user-set flag, or left as
// its default value | [
"getClusterName",
"returns",
"a",
"string",
"containing",
"the",
"default",
"or",
"user",
"-",
"set",
"cluster",
"name",
"and",
"a",
"boolean",
"indicating",
"whether",
"the",
"default",
"clusterName",
"has",
"been",
"overwritten",
"by",
"a",
"user",
"-",
"set... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/client_config.go#L398-L404 | train | getClusterName returns the cluster name | [
30522,
4569,
2278,
1006,
9530,
8873,
2290,
1008,
3622,
20464,
11638,
8663,
8873,
2290,
1007,
2131,
20464,
19966,
11795,
14074,
1006,
1007,
1006,
5164,
1010,
22017,
2140,
1007,
1063,
2065,
18798,
1006,
9530,
8873,
2290,
1012,
2058,
15637,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | cmd/kube-scheduler/app/options/insecure_serving.go | ApplyToFromLoadedConfig | func (o *CombinedInsecureServingOptions) ApplyToFromLoadedConfig(c *schedulerappconfig.Config, componentConfig *kubeschedulerconfig.KubeSchedulerConfiguration) error {
if o == nil {
return nil
}
if err := updateDeprecatedInsecureServingOptionsFromAddress(o.Healthz, componentConfig.HealthzBindAddress); err != nil ... | go | func (o *CombinedInsecureServingOptions) ApplyToFromLoadedConfig(c *schedulerappconfig.Config, componentConfig *kubeschedulerconfig.KubeSchedulerConfiguration) error {
if o == nil {
return nil
}
if err := updateDeprecatedInsecureServingOptionsFromAddress(o.Healthz, componentConfig.HealthzBindAddress); err != nil ... | [
"func",
"(",
"o",
"*",
"CombinedInsecureServingOptions",
")",
"ApplyToFromLoadedConfig",
"(",
"c",
"*",
"schedulerappconfig",
".",
"Config",
",",
"componentConfig",
"*",
"kubeschedulerconfig",
".",
"KubeSchedulerConfiguration",
")",
"error",
"{",
"if",
"o",
"==",
"n... | // ApplyToFromLoadedConfig updates the insecure serving options from the component config and then appies it to the given scheduler app configuration. | [
"ApplyToFromLoadedConfig",
"updates",
"the",
"insecure",
"serving",
"options",
"from",
"the",
"component",
"config",
"and",
"then",
"appies",
"it",
"to",
"the",
"given",
"scheduler",
"app",
"configuration",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kube-scheduler/app/options/insecure_serving.go#L96-L109 | train | ApplyToFromLoadedConfig applies the combined insecure serving options from the provided component config. | [
30522,
4569,
2278,
1006,
1051,
1008,
4117,
7076,
29150,
8043,
6455,
7361,
9285,
1007,
6611,
3406,
19699,
5358,
17468,
8663,
8873,
2290,
1006,
1039,
1008,
6134,
2527,
9397,
8663,
8873,
2290,
1012,
9530,
8873,
2290,
1010,
6922,
8663,
8873,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go | DeleteCollection | func (c *FakeClusterRoleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOptions)
_, err := c.Fake.Invokes(action, &v1beta1.ClusterRoleBindingList{})
return err
} | go | func (c *FakeClusterRoleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOptions)
_, err := c.Fake.Invokes(action, &v1beta1.ClusterRoleBindingList{})
return err
} | [
"func",
"(",
"c",
"*",
"FakeClusterRoleBindings",
")",
"DeleteCollection",
"(",
"options",
"*",
"v1",
".",
"DeleteOptions",
",",
"listOptions",
"v1",
".",
"ListOptions",
")",
"error",
"{",
"action",
":=",
"testing",
".",
"NewRootDeleteCollectionAction",
"(",
"cl... | // DeleteCollection deletes a collection of objects. | [
"DeleteCollection",
"deletes",
"a",
"collection",
"of",
"objects",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go#L105-L110 | train | DeleteCollection takes listOptions and deletes all ClusterRoleBinding objects in the given collection. Returns an error if one occurs. | [
30522,
4569,
2278,
1006,
1039,
1008,
8275,
20464,
19966,
2121,
13153,
15878,
22254,
8613,
1007,
3972,
12870,
26895,
18491,
1006,
7047,
1008,
1058,
2487,
1012,
3972,
12870,
7361,
9285,
1010,
2862,
7361,
9285,
1058,
2487,
1012,
2862,
7361,
92... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/core/v1/zz_generated.conversion.go | Convert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource | func Convert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource(in *v1.StorageOSVolumeSource, out *core.StorageOSVolumeSource, s conversion.Scope) error {
return autoConvert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource(in, out, s)
} | go | func Convert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource(in *v1.StorageOSVolumeSource, out *core.StorageOSVolumeSource, s conversion.Scope) error {
return autoConvert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource(in, out, s)
} | [
"func",
"Convert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource",
"(",
"in",
"*",
"v1",
".",
"StorageOSVolumeSource",
",",
"out",
"*",
"core",
".",
"StorageOSVolumeSource",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_v1_Storag... | // Convert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource is an autogenerated conversion function. | [
"Convert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/core/v1/zz_generated.conversion.go#L7135-L7137 | train | Convert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
1058,
2487,
1035,
5527,
2891,
6767,
12942,
2229,
8162,
3401,
1035,
2000,
1035,
4563,
1035,
5527,
2891,
6767,
12942,
2229,
8162,
3401,
1006,
1999,
1008,
1058,
2487,
1012,
5527,
2891,
6767,
12942,
2229,
8162,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | cmd/kubeadm/app/apis/kubeadm/v1beta2/zz_generated.conversion.go | Convert_kubeadm_LocalEtcd_To_v1beta2_LocalEtcd | func Convert_kubeadm_LocalEtcd_To_v1beta2_LocalEtcd(in *kubeadm.LocalEtcd, out *LocalEtcd, s conversion.Scope) error {
return autoConvert_kubeadm_LocalEtcd_To_v1beta2_LocalEtcd(in, out, s)
} | go | func Convert_kubeadm_LocalEtcd_To_v1beta2_LocalEtcd(in *kubeadm.LocalEtcd, out *LocalEtcd, s conversion.Scope) error {
return autoConvert_kubeadm_LocalEtcd_To_v1beta2_LocalEtcd(in, out, s)
} | [
"func",
"Convert_kubeadm_LocalEtcd_To_v1beta2_LocalEtcd",
"(",
"in",
"*",
"kubeadm",
".",
"LocalEtcd",
",",
"out",
"*",
"LocalEtcd",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_kubeadm_LocalEtcd_To_v1beta2_LocalEtcd",
"(",
"in",
","... | // Convert_kubeadm_LocalEtcd_To_v1beta2_LocalEtcd is an autogenerated conversion function. | [
"Convert_kubeadm_LocalEtcd_To_v1beta2_LocalEtcd",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/apis/kubeadm/v1beta2/zz_generated.conversion.go#L787-L789 | train | Convert_kubeadm_LocalEtcd_To_v1beta2_LocalEtcd is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
13970,
4783,
4215,
2213,
1035,
2334,
3388,
19797,
1035,
2000,
1035,
1058,
2487,
20915,
2050,
2475,
1035,
2334,
3388,
19797,
1006,
1999,
1008,
13970,
4783,
4215,
2213,
1012,
2334,
3388,
19797,
1010,
2041,
1008... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.conversion.go | Convert_v1_ProviderConfiguration_To_config_ProviderConfiguration | func Convert_v1_ProviderConfiguration_To_config_ProviderConfiguration(in *ProviderConfiguration, out *config.ProviderConfiguration, s conversion.Scope) error {
return autoConvert_v1_ProviderConfiguration_To_config_ProviderConfiguration(in, out, s)
} | go | func Convert_v1_ProviderConfiguration_To_config_ProviderConfiguration(in *ProviderConfiguration, out *config.ProviderConfiguration, s conversion.Scope) error {
return autoConvert_v1_ProviderConfiguration_To_config_ProviderConfiguration(in, out, s)
} | [
"func",
"Convert_v1_ProviderConfiguration_To_config_ProviderConfiguration",
"(",
"in",
"*",
"ProviderConfiguration",
",",
"out",
"*",
"config",
".",
"ProviderConfiguration",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_v1_ProviderConfigura... | // Convert_v1_ProviderConfiguration_To_config_ProviderConfiguration is an autogenerated conversion function. | [
"Convert_v1_ProviderConfiguration_To_config_ProviderConfiguration",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.conversion.go#L238-L240 | train | Convert_v1_ProviderConfiguration_To_config_ProviderConfiguration is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
1058,
2487,
1035,
10802,
8663,
8873,
27390,
3370,
1035,
2000,
1035,
9530,
8873,
2290,
1035,
10802,
8663,
8873,
27390,
3370,
1006,
1999,
1008,
10802,
8663,
8873,
27390,
3370,
1010,
2041,
1008,
9530,
8873,
2290... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/scheduler/volumebinder/volume_binder.go | NewVolumeBinder | func NewVolumeBinder(
client clientset.Interface,
nodeInformer coreinformers.NodeInformer,
pvcInformer coreinformers.PersistentVolumeClaimInformer,
pvInformer coreinformers.PersistentVolumeInformer,
storageClassInformer storageinformers.StorageClassInformer,
bindTimeout time.Duration) *VolumeBinder {
return &Vo... | go | func NewVolumeBinder(
client clientset.Interface,
nodeInformer coreinformers.NodeInformer,
pvcInformer coreinformers.PersistentVolumeClaimInformer,
pvInformer coreinformers.PersistentVolumeInformer,
storageClassInformer storageinformers.StorageClassInformer,
bindTimeout time.Duration) *VolumeBinder {
return &Vo... | [
"func",
"NewVolumeBinder",
"(",
"client",
"clientset",
".",
"Interface",
",",
"nodeInformer",
"coreinformers",
".",
"NodeInformer",
",",
"pvcInformer",
"coreinformers",
".",
"PersistentVolumeClaimInformer",
",",
"pvInformer",
"coreinformers",
".",
"PersistentVolumeInformer"... | // NewVolumeBinder sets up the volume binding library and binding queue | [
"NewVolumeBinder",
"sets",
"up",
"the",
"volume",
"binding",
"library",
"and",
"binding",
"queue"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/scheduler/volumebinder/volume_binder.go#L35-L46 | train | NewVolumeBinder constructs a new VolumeBinder. Always prefer using an informer factory to get a shared informer instead of getting an independent one. This reduces memory footprint and number of connections to the server. | [
30522,
4569,
2278,
2047,
6767,
12942,
15878,
22254,
2121,
1006,
7396,
7846,
3388,
1012,
8278,
1010,
13045,
2378,
14192,
2121,
4563,
2378,
14192,
2545,
1012,
13045,
2378,
14192,
2121,
1010,
26189,
15459,
14192,
2121,
4563,
2378,
14192,
2545,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go | compareListValuesAtIndex | func compareListValuesAtIndex(list1Inbounds, list2Inbounds bool, list1Value, list2Value string) (interface{}, interface{}) {
bothInBounds := list1Inbounds && list2Inbounds
switch {
// scalars are identical
case bothInBounds && list1Value == list2Value:
return nil, nil
// only list2 is in bound
case !list1Inboun... | go | func compareListValuesAtIndex(list1Inbounds, list2Inbounds bool, list1Value, list2Value string) (interface{}, interface{}) {
bothInBounds := list1Inbounds && list2Inbounds
switch {
// scalars are identical
case bothInBounds && list1Value == list2Value:
return nil, nil
// only list2 is in bound
case !list1Inboun... | [
"func",
"compareListValuesAtIndex",
"(",
"list1Inbounds",
",",
"list2Inbounds",
"bool",
",",
"list1Value",
",",
"list2Value",
"string",
")",
"(",
"interface",
"{",
"}",
",",
"interface",
"{",
"}",
")",
"{",
"bothInBounds",
":=",
"list1Inbounds",
"&&",
"list2Inbo... | // If first return value is non-nil, list1 contains an element not present in list2
// If second return value is non-nil, list2 contains an element not present in list1 | [
"If",
"first",
"return",
"value",
"is",
"non",
"-",
"nil",
"list1",
"contains",
"an",
"element",
"not",
"present",
"in",
"list2",
"If",
"second",
"return",
"value",
"is",
"non",
"-",
"nil",
"list2",
"contains",
"an",
"element",
"not",
"present",
"in",
"l... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go#L691-L712 | train | compareListValuesAtIndex compares two lists of values at index list1Value and list2Value. | [
30522,
4569,
2278,
12826,
9863,
10175,
15808,
20363,
3207,
2595,
1006,
2862,
2487,
2378,
15494,
2015,
1010,
2862,
2475,
2378,
15494,
2015,
22017,
2140,
1010,
2862,
2487,
10175,
5657,
1010,
2862,
2475,
10175,
5657,
5164,
1007,
1006,
8278,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubelet/dockershim/docker_streaming.go | PortForward | func (ds *dockerService) PortForward(_ context.Context, req *runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error) {
if ds.streamingServer == nil {
return nil, streaming.NewErrorStreamingDisabled("port forward")
}
_, err := checkContainerStatus(ds.client, req.PodSandboxId)
if err != nil {
retu... | go | func (ds *dockerService) PortForward(_ context.Context, req *runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error) {
if ds.streamingServer == nil {
return nil, streaming.NewErrorStreamingDisabled("port forward")
}
_, err := checkContainerStatus(ds.client, req.PodSandboxId)
if err != nil {
retu... | [
"func",
"(",
"ds",
"*",
"dockerService",
")",
"PortForward",
"(",
"_",
"context",
".",
"Context",
",",
"req",
"*",
"runtimeapi",
".",
"PortForwardRequest",
")",
"(",
"*",
"runtimeapi",
".",
"PortForwardResponse",
",",
"error",
")",
"{",
"if",
"ds",
".",
... | // PortForward prepares a streaming endpoint to forward ports from a PodSandbox, and returns the address. | [
"PortForward",
"prepares",
"a",
"streaming",
"endpoint",
"to",
"forward",
"ports",
"from",
"a",
"PodSandbox",
"and",
"returns",
"the",
"address",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/dockershim/docker_streaming.go#L132-L142 | train | PortForward returns the port forward response. | [
30522,
4569,
2278,
1006,
16233,
1008,
8946,
2545,
2121,
7903,
2063,
1007,
3417,
29278,
7652,
1006,
1035,
6123,
1012,
6123,
1010,
2128,
4160,
1008,
2448,
7292,
9331,
2072,
1012,
3417,
29278,
7652,
2890,
15500,
1007,
1006,
1008,
2448,
7292,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apiserver/pkg/registry/rest/meta.go | FillObjectMetaSystemFields | func FillObjectMetaSystemFields(meta metav1.Object) {
meta.SetCreationTimestamp(metav1.Now())
meta.SetUID(uuid.NewUUID())
meta.SetSelfLink("")
} | go | func FillObjectMetaSystemFields(meta metav1.Object) {
meta.SetCreationTimestamp(metav1.Now())
meta.SetUID(uuid.NewUUID())
meta.SetSelfLink("")
} | [
"func",
"FillObjectMetaSystemFields",
"(",
"meta",
"metav1",
".",
"Object",
")",
"{",
"meta",
".",
"SetCreationTimestamp",
"(",
"metav1",
".",
"Now",
"(",
")",
")",
"\n",
"meta",
".",
"SetUID",
"(",
"uuid",
".",
"NewUUID",
"(",
")",
")",
"\n",
"meta",
... | // FillObjectMetaSystemFields populates fields that are managed by the system on ObjectMeta. | [
"FillObjectMetaSystemFields",
"populates",
"fields",
"that",
"are",
"managed",
"by",
"the",
"system",
"on",
"ObjectMeta",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/registry/rest/meta.go#L28-L32 | train | FillObjectMetaSystemFields fills the object with system fields. | [
30522,
4569,
2278,
6039,
16429,
20614,
11368,
3022,
27268,
6633,
15155,
1006,
18804,
18804,
2615,
2487,
1012,
4874,
1007,
1063,
18804,
1012,
2275,
16748,
3370,
7292,
9153,
8737,
1006,
18804,
2615,
2487,
1012,
2085,
1006,
1007,
1007,
18804,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubelet/cm/cgroup_manager_linux.go | setSupportedSubsystems | func setSupportedSubsystems(cgroupConfig *libcontainerconfigs.Cgroup) error {
for sys, required := range getSupportedSubsystems() {
if _, ok := cgroupConfig.Paths[sys.Name()]; !ok {
if required {
return fmt.Errorf("Failed to find subsystem mount for required subsystem: %v", sys.Name())
}
// the cgroup i... | go | func setSupportedSubsystems(cgroupConfig *libcontainerconfigs.Cgroup) error {
for sys, required := range getSupportedSubsystems() {
if _, ok := cgroupConfig.Paths[sys.Name()]; !ok {
if required {
return fmt.Errorf("Failed to find subsystem mount for required subsystem: %v", sys.Name())
}
// the cgroup i... | [
"func",
"setSupportedSubsystems",
"(",
"cgroupConfig",
"*",
"libcontainerconfigs",
".",
"Cgroup",
")",
"error",
"{",
"for",
"sys",
",",
"required",
":=",
"range",
"getSupportedSubsystems",
"(",
")",
"{",
"if",
"_",
",",
"ok",
":=",
"cgroupConfig",
".",
"Paths"... | // setSupportedSubsystems sets cgroup resource limits only on the supported
// subsystems. ie. cpu and memory. We don't use libcontainer's cgroup/fs/Set()
// method as it doesn't allow us to skip updates on the devices cgroup
// Allowing or denying all devices by writing 'a' to devices.allow or devices.deny is
// not p... | [
"setSupportedSubsystems",
"sets",
"cgroup",
"resource",
"limits",
"only",
"on",
"the",
"supported",
"subsystems",
".",
"ie",
".",
"cpu",
"and",
"memory",
".",
"We",
"don",
"t",
"use",
"libcontainer",
"s",
"cgroup",
"/",
"fs",
"/",
"Set",
"()",
"method",
"a... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/cm/cgroup_manager_linux.go#L348-L363 | train | setSupportedSubsystems sets the supported subsystems for the cgroup | [
30522,
4569,
2278,
4520,
6279,
6442,
2098,
6342,
5910,
27268,
6633,
2015,
1006,
1039,
17058,
8663,
8873,
2290,
1008,
5622,
9818,
12162,
18175,
29566,
2078,
8873,
5620,
1012,
1039,
17058,
1007,
7561,
1063,
2005,
25353,
2015,
1010,
3223,
1024... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/core/v1/zz_generated.conversion.go | Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec | func Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(in *core.PersistentVolumeSpec, out *v1.PersistentVolumeSpec, s conversion.Scope) error {
return autoConvert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(in, out, s)
} | go | func Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(in *core.PersistentVolumeSpec, out *v1.PersistentVolumeSpec, s conversion.Scope) error {
return autoConvert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(in, out, s)
} | [
"func",
"Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec",
"(",
"in",
"*",
"core",
".",
"PersistentVolumeSpec",
",",
"out",
"*",
"v1",
".",
"PersistentVolumeSpec",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_core_Persiste... | // Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec is an autogenerated conversion function. | [
"Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/core/v1/zz_generated.conversion.go#L5082-L5084 | train | Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
4563,
1035,
14516,
6767,
12942,
2229,
5051,
2278,
1035,
2000,
1035,
1058,
2487,
1035,
14516,
6767,
12942,
2229,
5051,
2278,
1006,
1999,
1008,
4563,
1012,
14516,
6767,
12942,
2229,
5051,
2278,
1010,
2041,
1008... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/client-go/tools/clientcmd/api/helpers.go | IsConfigEmpty | func IsConfigEmpty(config *Config) bool {
return len(config.AuthInfos) == 0 && len(config.Clusters) == 0 && len(config.Contexts) == 0 &&
len(config.CurrentContext) == 0 &&
len(config.Preferences.Extensions) == 0 && !config.Preferences.Colors &&
len(config.Extensions) == 0
} | go | func IsConfigEmpty(config *Config) bool {
return len(config.AuthInfos) == 0 && len(config.Clusters) == 0 && len(config.Contexts) == 0 &&
len(config.CurrentContext) == 0 &&
len(config.Preferences.Extensions) == 0 && !config.Preferences.Colors &&
len(config.Extensions) == 0
} | [
"func",
"IsConfigEmpty",
"(",
"config",
"*",
"Config",
")",
"bool",
"{",
"return",
"len",
"(",
"config",
".",
"AuthInfos",
")",
"==",
"0",
"&&",
"len",
"(",
"config",
".",
"Clusters",
")",
"==",
"0",
"&&",
"len",
"(",
"config",
".",
"Contexts",
")",
... | // IsConfigEmpty returns true if the config is empty. | [
"IsConfigEmpty",
"returns",
"true",
"if",
"the",
"config",
"is",
"empty",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/api/helpers.go#L37-L42 | train | IsConfigEmpty returns true if config is empty | [
30522,
4569,
2278,
2003,
8663,
8873,
3351,
27718,
2100,
1006,
9530,
8873,
2290,
1008,
9530,
8873,
2290,
1007,
22017,
2140,
1063,
2709,
18798,
1006,
9530,
8873,
2290,
1012,
8740,
15222,
2078,
14876,
2015,
1007,
1027,
1027,
1014,
1004,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/volume/util/operationexecutor/operation_executor.go | GenerateMsg | func (volume *MountedVolume) GenerateMsg(prefixMsg, suffixMsg string) (simpleMsg, detailedMsg string) {
detailedStr := fmt.Sprintf("(UniqueName: %q) pod %q (UID: %q)", volume.VolumeName, volume.PodName, volume.PodUID)
return generateVolumeMsg(prefixMsg, suffixMsg, volume.OuterVolumeSpecName, detailedStr)
} | go | func (volume *MountedVolume) GenerateMsg(prefixMsg, suffixMsg string) (simpleMsg, detailedMsg string) {
detailedStr := fmt.Sprintf("(UniqueName: %q) pod %q (UID: %q)", volume.VolumeName, volume.PodName, volume.PodUID)
return generateVolumeMsg(prefixMsg, suffixMsg, volume.OuterVolumeSpecName, detailedStr)
} | [
"func",
"(",
"volume",
"*",
"MountedVolume",
")",
"GenerateMsg",
"(",
"prefixMsg",
",",
"suffixMsg",
"string",
")",
"(",
"simpleMsg",
",",
"detailedMsg",
"string",
")",
"{",
"detailedStr",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"volume",
".",
... | // GenerateMsg returns simple and detailed msgs for mounted volumes | [
"GenerateMsg",
"returns",
"simple",
"and",
"detailed",
"msgs",
"for",
"mounted",
"volumes"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/util/operationexecutor/operation_executor.go#L568-L571 | train | GenerateMsg generates a message for a mounted volume | [
30522,
4569,
2278,
1006,
3872,
1008,
5614,
6767,
12942,
2063,
1007,
9699,
5244,
2290,
1006,
17576,
5244,
2290,
1010,
16809,
5244,
2290,
5164,
1007,
1006,
3722,
5244,
2290,
1010,
6851,
5244,
2290,
5164,
1007,
1063,
6851,
3367,
2099,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apimachinery/pkg/util/wait/wait.go | PollImmediate | func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) error {
return pollImmediateInternal(poller(interval, timeout), condition)
} | go | func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) error {
return pollImmediateInternal(poller(interval, timeout), condition)
} | [
"func",
"PollImmediate",
"(",
"interval",
",",
"timeout",
"time",
".",
"Duration",
",",
"condition",
"ConditionFunc",
")",
"error",
"{",
"return",
"pollImmediateInternal",
"(",
"poller",
"(",
"interval",
",",
"timeout",
")",
",",
"condition",
")",
"\n",
"}"
] | // PollImmediate tries a condition func until it returns true, an error, or the timeout
// is reached.
//
// PollImmediate always checks 'condition' before waiting for the interval. 'condition'
// will always be invoked at least once.
//
// Some intervals may be missed if the condition takes too long or the time
// win... | [
"PollImmediate",
"tries",
"a",
"condition",
"func",
"until",
"it",
"returns",
"true",
"an",
"error",
"or",
"the",
"timeout",
"is",
"reached",
".",
"PollImmediate",
"always",
"checks",
"condition",
"before",
"waiting",
"for",
"the",
"interval",
".",
"condition",
... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apimachinery/pkg/util/wait/wait.go#L325-L327 | train | PollImmediate polls the database for events. | [
30522,
4569,
2278,
8554,
5714,
16969,
2618,
1006,
13483,
1010,
2051,
5833,
2051,
1012,
9367,
1010,
4650,
4650,
11263,
12273,
1007,
7561,
1063,
2709,
8554,
5714,
16969,
9589,
16451,
2389,
1006,
8554,
2121,
1006,
13483,
1010,
2051,
5833,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/registry/core/service/ipallocator/allocator.go | Release | func (r *Range) Release(ip net.IP) error {
ok, offset := r.contains(ip)
if !ok {
return nil
}
return r.alloc.Release(offset)
} | go | func (r *Range) Release(ip net.IP) error {
ok, offset := r.contains(ip)
if !ok {
return nil
}
return r.alloc.Release(offset)
} | [
"func",
"(",
"r",
"*",
"Range",
")",
"Release",
"(",
"ip",
"net",
".",
"IP",
")",
"error",
"{",
"ok",
",",
"offset",
":=",
"r",
".",
"contains",
"(",
"ip",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"return",
"r",
".... | // Release releases the IP back to the pool. Releasing an
// unallocated IP or an IP out of the range is a no-op and
// returns no error. | [
"Release",
"releases",
"the",
"IP",
"back",
"to",
"the",
"pool",
".",
"Releasing",
"an",
"unallocated",
"IP",
"or",
"an",
"IP",
"out",
"of",
"the",
"range",
"is",
"a",
"no",
"-",
"op",
"and",
"returns",
"no",
"error",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/registry/core/service/ipallocator/allocator.go#L173-L180 | train | Release releases the range. | [
30522,
4569,
2278,
1006,
1054,
1008,
2846,
1007,
2713,
1006,
12997,
5658,
1012,
12997,
1007,
7561,
1063,
7929,
1010,
16396,
1024,
1027,
1054,
1012,
3397,
1006,
12997,
1007,
2065,
999,
7929,
1063,
2709,
9152,
2140,
1065,
2709,
1054,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | cmd/kubeadm/app/phases/certs/certs.go | validatePrivatePublicKey | func validatePrivatePublicKey(l certKeyLocation) error {
// Try to load key
_, _, err := pkiutil.TryLoadPrivatePublicKeyFromDisk(l.pkiDir, l.baseName)
if err != nil {
return errors.Wrapf(err, "failure loading key for %s", l.uxName)
}
return nil
} | go | func validatePrivatePublicKey(l certKeyLocation) error {
// Try to load key
_, _, err := pkiutil.TryLoadPrivatePublicKeyFromDisk(l.pkiDir, l.baseName)
if err != nil {
return errors.Wrapf(err, "failure loading key for %s", l.uxName)
}
return nil
} | [
"func",
"validatePrivatePublicKey",
"(",
"l",
"certKeyLocation",
")",
"error",
"{",
"// Try to load key",
"_",
",",
"_",
",",
"err",
":=",
"pkiutil",
".",
"TryLoadPrivatePublicKeyFromDisk",
"(",
"l",
".",
"pkiDir",
",",
"l",
".",
"baseName",
")",
"\n",
"if",
... | // validatePrivatePublicKey tries to load a private key from pkiDir | [
"validatePrivatePublicKey",
"tries",
"to",
"load",
"a",
"private",
"key",
"from",
"pkiDir"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/phases/certs/certs.go#L418-L425 | train | validatePrivatePublicKey validates the private key for the certificate | [
30522,
4569,
2278,
9398,
3686,
18098,
21466,
14289,
16558,
30524,
1007,
7561,
1063,
1013,
1013,
3046,
2000,
7170,
3145,
1035,
1010,
1035,
1010,
9413,
2099,
1024,
1027,
1052,
3211,
21823,
2140,
1012,
3046,
11066,
18098,
21466,
14289,
16558,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/util/ipconfig/ipconfig.go | GetDNSSuffixSearchList | func (runner *runner) GetDNSSuffixSearchList() ([]string, error) {
// Parse the DNS suffix search list from ipconfig output
// ipconfig /all on Windows displays the entry of DNS suffix search list
// An example output contains:
//
// DNS Suffix Search List. . . . . . : example1.com
// ... | go | func (runner *runner) GetDNSSuffixSearchList() ([]string, error) {
// Parse the DNS suffix search list from ipconfig output
// ipconfig /all on Windows displays the entry of DNS suffix search list
// An example output contains:
//
// DNS Suffix Search List. . . . . . : example1.com
// ... | [
"func",
"(",
"runner",
"*",
"runner",
")",
"GetDNSSuffixSearchList",
"(",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"// Parse the DNS suffix search list from ipconfig output",
"// ipconfig /all on Windows displays the entry of DNS suffix search list",
"// An example... | // GetDNSSuffixSearchList returns the list of DNS suffix to search | [
"GetDNSSuffixSearchList",
"returns",
"the",
"list",
"of",
"DNS",
"suffix",
"to",
"search"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/util/ipconfig/ipconfig.go#L58-L99 | train | GetDNSSuffixSearchList returns the list of DNS Suffix Search List | [
30522,
4569,
2278,
1006,
5479,
1008,
5479,
1007,
2131,
2094,
3619,
6342,
26989,
2595,
17310,
11140,
9863,
1006,
1007,
1006,
1031,
1033,
5164,
1010,
7561,
1007,
1063,
1013,
1013,
11968,
3366,
1996,
1040,
3619,
16809,
3945,
2862,
2013,
12997,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubectl/cmd/get/humanreadable_flags.go | EnsureWithKind | func (f *HumanPrintFlags) EnsureWithKind() error {
showKind := true
f.ShowKind = &showKind
return nil
} | go | func (f *HumanPrintFlags) EnsureWithKind() error {
showKind := true
f.ShowKind = &showKind
return nil
} | [
"func",
"(",
"f",
"*",
"HumanPrintFlags",
")",
"EnsureWithKind",
"(",
")",
"error",
"{",
"showKind",
":=",
"true",
"\n",
"f",
".",
"ShowKind",
"=",
"&",
"showKind",
"\n",
"return",
"nil",
"\n",
"}"
] | // EnsureWithKind sets the "Showkind" humanreadable option to true. | [
"EnsureWithKind",
"sets",
"the",
"Showkind",
"humanreadable",
"option",
"to",
"true",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/cmd/get/humanreadable_flags.go#L51-L55 | train | EnsureWithKind sets the showKind field of the human print flags | [
30522,
4569,
2278,
1006,
1042,
1008,
2529,
16550,
10258,
26454,
1007,
5676,
24415,
18824,
1006,
1007,
7561,
1063,
2265,
18824,
1024,
1027,
2995,
1042,
1012,
2265,
18824,
1027,
1004,
2265,
18824,
2709,
9152,
2140,
1065,
102,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/registry/rbac/helpers.go | IsOnlyMutatingGCFields | func IsOnlyMutatingGCFields(obj, old runtime.Object, equalities conversion.Equalities) bool {
if old == nil || reflect.ValueOf(old).IsNil() {
return false
}
// make a copy of the newObj so that we can stomp for comparison
copied := obj.DeepCopyObject()
copiedMeta, err := meta.Accessor(copied)
if err != nil {
... | go | func IsOnlyMutatingGCFields(obj, old runtime.Object, equalities conversion.Equalities) bool {
if old == nil || reflect.ValueOf(old).IsNil() {
return false
}
// make a copy of the newObj so that we can stomp for comparison
copied := obj.DeepCopyObject()
copiedMeta, err := meta.Accessor(copied)
if err != nil {
... | [
"func",
"IsOnlyMutatingGCFields",
"(",
"obj",
",",
"old",
"runtime",
".",
"Object",
",",
"equalities",
"conversion",
".",
"Equalities",
")",
"bool",
"{",
"if",
"old",
"==",
"nil",
"||",
"reflect",
".",
"ValueOf",
"(",
"old",
")",
".",
"IsNil",
"(",
")",
... | // IsOnlyMutatingGCFields checks finalizers and ownerrefs which GC manipulates
// and indicates that only those fields are changing | [
"IsOnlyMutatingGCFields",
"checks",
"finalizers",
"and",
"ownerrefs",
"which",
"GC",
"manipulates",
"and",
"indicates",
"that",
"only",
"those",
"fields",
"are",
"changing"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/registry/rbac/helpers.go#L29-L49 | train | IsOnlyMutatingGCFields returns true if obj is only mutating GC fields. | [
30522,
4569,
2278,
11163,
20554,
24335,
13210,
3436,
18195,
15155,
1006,
27885,
3501,
1010,
2214,
2448,
7292,
1012,
4874,
1010,
5020,
6447,
7584,
1012,
5020,
6447,
1007,
22017,
2140,
1063,
2065,
2214,
1027,
1027,
9152,
2140,
1064,
1064,
833... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | cmd/kubeadm/app/cmd/phases/workflow/runner.go | BindToCommand | func (e *Runner) BindToCommand(cmd *cobra.Command) {
// keep track of the command triggering the runner
e.runCmd = cmd
// return early if no phases were added
if len(e.Phases) == 0 {
return
}
e.prepareForExecution()
// adds the phases subcommand
phaseCommand := &cobra.Command{
Use: "phase",
Short: fm... | go | func (e *Runner) BindToCommand(cmd *cobra.Command) {
// keep track of the command triggering the runner
e.runCmd = cmd
// return early if no phases were added
if len(e.Phases) == 0 {
return
}
e.prepareForExecution()
// adds the phases subcommand
phaseCommand := &cobra.Command{
Use: "phase",
Short: fm... | [
"func",
"(",
"e",
"*",
"Runner",
")",
"BindToCommand",
"(",
"cmd",
"*",
"cobra",
".",
"Command",
")",
"{",
"// keep track of the command triggering the runner",
"e",
".",
"runCmd",
"=",
"cmd",
"\n\n",
"// return early if no phases were added",
"if",
"len",
"(",
"e... | // BindToCommand bind the Runner to a cobra command by altering
// command help, adding phase related flags and by adding phases subcommands
// Please note that this command needs to be done once all the phases are added to the Runner. | [
"BindToCommand",
"bind",
"the",
"Runner",
"to",
"a",
"cobra",
"command",
"by",
"altering",
"command",
"help",
"adding",
"phase",
"related",
"flags",
"and",
"by",
"adding",
"phases",
"subcommands",
"Please",
"note",
"that",
"this",
"command",
"needs",
"to",
"be... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/cmd/phases/workflow/runner.go#L297-L397 | train | BindToCommand binds the command to the runner | [
30522,
4569,
2278,
1006,
1041,
1008,
5479,
1007,
14187,
3406,
9006,
2386,
2094,
1006,
4642,
2094,
1008,
16604,
1012,
3094,
1007,
1063,
1013,
1013,
2562,
2650,
1997,
1996,
3094,
29170,
1996,
5479,
1041,
1012,
2448,
27487,
2094,
1027,
4642,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/core/zz_generated.deepcopy.go | DeepCopy | func (in *FlexVolumeSource) DeepCopy() *FlexVolumeSource {
if in == nil {
return nil
}
out := new(FlexVolumeSource)
in.DeepCopyInto(out)
return out
} | go | func (in *FlexVolumeSource) DeepCopy() *FlexVolumeSource {
if in == nil {
return nil
}
out := new(FlexVolumeSource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"FlexVolumeSource",
")",
"DeepCopy",
"(",
")",
"*",
"FlexVolumeSource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"FlexVolumeSource",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlexVolumeSource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"FlexVolumeSource",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/core/zz_generated.deepcopy.go#L1482-L1489 | train | DeepCopy is an autogenerated deepcopy function copying the receiver creating a new FlexVolumeSource. | [
30522,
4569,
2278,
1006,
1999,
1008,
23951,
6767,
12942,
2229,
8162,
3401,
1007,
2784,
3597,
7685,
1006,
1007,
1008,
23951,
6767,
12942,
2229,
8162,
3401,
1063,
2065,
1999,
1027,
1027,
9152,
2140,
1063,
2709,
9152,
2140,
1065,
2041,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubelet/apis/config/validation/validation.go | ValidateKubeletConfiguration | func ValidateKubeletConfiguration(kc *kubeletconfig.KubeletConfiguration) error {
allErrors := []error{}
// Make a local copy of the global feature gates and combine it with the gates set by this configuration.
// This allows us to validate the config against the set of gates it will actually run against.
localFea... | go | func ValidateKubeletConfiguration(kc *kubeletconfig.KubeletConfiguration) error {
allErrors := []error{}
// Make a local copy of the global feature gates and combine it with the gates set by this configuration.
// This allows us to validate the config against the set of gates it will actually run against.
localFea... | [
"func",
"ValidateKubeletConfiguration",
"(",
"kc",
"*",
"kubeletconfig",
".",
"KubeletConfiguration",
")",
"error",
"{",
"allErrors",
":=",
"[",
"]",
"error",
"{",
"}",
"\n\n",
"// Make a local copy of the global feature gates and combine it with the gates set by this configura... | // ValidateKubeletConfiguration validates `kc` and returns an error if it is invalid | [
"ValidateKubeletConfiguration",
"validates",
"kc",
"and",
"returns",
"an",
"error",
"if",
"it",
"is",
"invalid"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/apis/config/validation/validation.go#L32-L147 | train | ValidateKubeletConfiguration validates the kubelet configuration | [
30522,
4569,
2278,
9398,
3686,
5283,
8671,
3388,
8663,
8873,
27390,
3370,
1006,
21117,
1008,
13970,
8671,
3388,
8663,
8873,
2290,
1012,
13970,
8671,
3388,
8663,
8873,
27390,
3370,
1007,
7561,
1063,
2035,
2121,
29165,
2015,
1024,
1027,
1031,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubelet/secret/secret_manager.go | NewCachingSecretManager | func NewCachingSecretManager(kubeClient clientset.Interface, getTTL manager.GetObjectTTLFunc) Manager {
getSecret := func(namespace, name string, opts metav1.GetOptions) (runtime.Object, error) {
return kubeClient.CoreV1().Secrets(namespace).Get(name, opts)
}
secretStore := manager.NewObjectStore(getSecret, clock.... | go | func NewCachingSecretManager(kubeClient clientset.Interface, getTTL manager.GetObjectTTLFunc) Manager {
getSecret := func(namespace, name string, opts metav1.GetOptions) (runtime.Object, error) {
return kubeClient.CoreV1().Secrets(namespace).Get(name, opts)
}
secretStore := manager.NewObjectStore(getSecret, clock.... | [
"func",
"NewCachingSecretManager",
"(",
"kubeClient",
"clientset",
".",
"Interface",
",",
"getTTL",
"manager",
".",
"GetObjectTTLFunc",
")",
"Manager",
"{",
"getSecret",
":=",
"func",
"(",
"namespace",
",",
"name",
"string",
",",
"opts",
"metav1",
".",
"GetOptio... | // NewCachingSecretManager creates a manager that keeps a cache of all secrets
// necessary for registered pods.
// It implements the following logic:
// - whenever a pod is created or updated, the cached versions of all secrets
// are invalidated
// - every GetObject() call tries to fetch the value from local cache;... | [
"NewCachingSecretManager",
"creates",
"a",
"manager",
"that",
"keeps",
"a",
"cache",
"of",
"all",
"secrets",
"necessary",
"for",
"registered",
"pods",
".",
"It",
"implements",
"the",
"following",
"logic",
":",
"-",
"whenever",
"a",
"pod",
"is",
"created",
"or"... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/secret/secret_manager.go#L119-L127 | train | NewCachingSecretManager returns a new secret manager that caches secrets. | [
30522,
4569,
2278,
2047,
3540,
8450,
3366,
16748,
22942,
17325,
1006,
13970,
4783,
20464,
11638,
7846,
3388,
1012,
8278,
1010,
2131,
4779,
2140,
3208,
1012,
2131,
16429,
20614,
4779,
10270,
4609,
2278,
1007,
3208,
1063,
4152,
8586,
13465,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/policy/v1beta1/zz_generated.conversion.go | Convert_v1beta1_Eviction_To_policy_Eviction | func Convert_v1beta1_Eviction_To_policy_Eviction(in *v1beta1.Eviction, out *policy.Eviction, s conversion.Scope) error {
return autoConvert_v1beta1_Eviction_To_policy_Eviction(in, out, s)
} | go | func Convert_v1beta1_Eviction_To_policy_Eviction(in *v1beta1.Eviction, out *policy.Eviction, s conversion.Scope) error {
return autoConvert_v1beta1_Eviction_To_policy_Eviction(in, out, s)
} | [
"func",
"Convert_v1beta1_Eviction_To_policy_Eviction",
"(",
"in",
"*",
"v1beta1",
".",
"Eviction",
",",
"out",
"*",
"policy",
".",
"Eviction",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_v1beta1_Eviction_To_policy_Eviction",
"(",
... | // Convert_v1beta1_Eviction_To_policy_Eviction is an autogenerated conversion function. | [
"Convert_v1beta1_Eviction_To_policy_Eviction",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/policy/v1beta1/zz_generated.conversion.go#L305-L307 | train | Convert_v1beta1_Eviction_To_policy_Eviction is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
1058,
2487,
20915,
27717,
1035,
23408,
28097,
1035,
2000,
1035,
3343,
1035,
23408,
28097,
1006,
1999,
1008,
1058,
2487,
20915,
27717,
1012,
23408,
28097,
1010,
2041,
1008,
3343,
1012,
23408,
28097,
1010,
1055,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/core/validation/validation.go | ValidateTaintsInNodeAnnotations | func ValidateTaintsInNodeAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
taints, err := helper.GetTaintsFromNodeAnnotations(annotations)
if err != nil {
allErrs = append(allErrs, field.Invalid(fldPath, core.TaintsAnnotationKey, err.Error()))
return ... | go | func ValidateTaintsInNodeAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
taints, err := helper.GetTaintsFromNodeAnnotations(annotations)
if err != nil {
allErrs = append(allErrs, field.Invalid(fldPath, core.TaintsAnnotationKey, err.Error()))
return ... | [
"func",
"ValidateTaintsInNodeAnnotations",
"(",
"annotations",
"map",
"[",
"string",
"]",
"string",
",",
"fldPath",
"*",
"field",
".",
"Path",
")",
"field",
".",
"ErrorList",
"{",
"allErrs",
":=",
"field",
".",
"ErrorList",
"{",
"}",
"\n\n",
"taints",
",",
... | // ValidateTaintsInNodeAnnotations tests that the serialized taints in Node.Annotations has valid data | [
"ValidateTaintsInNodeAnnotations",
"tests",
"that",
"the",
"serialized",
"taints",
"in",
"Node",
".",
"Annotations",
"has",
"valid",
"data"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/core/validation/validation.go#L4041-L4055 | train | ValidateTaintsInNodeAnnotations validates the taints in the node annotations | [
30522,
4569,
2278,
9398,
3686,
18249,
3215,
23111,
10244,
11639,
17287,
9285,
1006,
5754,
17287,
9285,
4949,
1031,
5164,
1033,
5164,
1010,
13109,
18927,
8988,
1008,
2492,
1012,
4130,
1007,
2492,
1012,
7561,
9863,
1063,
2035,
2121,
2869,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/volume/csi/csi_util.go | hasReadWriteOnce | func hasReadWriteOnce(modes []api.PersistentVolumeAccessMode) bool {
if modes == nil {
return false
}
for _, mode := range modes {
if mode == api.ReadWriteOnce {
return true
}
}
return false
} | go | func hasReadWriteOnce(modes []api.PersistentVolumeAccessMode) bool {
if modes == nil {
return false
}
for _, mode := range modes {
if mode == api.ReadWriteOnce {
return true
}
}
return false
} | [
"func",
"hasReadWriteOnce",
"(",
"modes",
"[",
"]",
"api",
".",
"PersistentVolumeAccessMode",
")",
"bool",
"{",
"if",
"modes",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"for",
"_",
",",
"mode",
":=",
"range",
"modes",
"{",
"if",
"mode",
"==... | // hasReadWriteOnce returns true if modes contains v1.ReadWriteOnce | [
"hasReadWriteOnce",
"returns",
"true",
"if",
"modes",
"contains",
"v1",
".",
"ReadWriteOnce"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/csi/csi_util.go#L129-L139 | train | hasReadWriteOnce returns true if the given list of modes is read - write - once | [
30522,
4569,
2278,
2038,
16416,
2094,
26373,
2239,
3401,
1006,
11583,
1031,
1033,
17928,
1012,
14516,
6767,
12942,
5243,
9468,
7971,
5302,
3207,
1007,
22017,
2140,
1063,
2065,
11583,
1027,
1027,
9152,
2140,
1063,
2709,
6270,
1065,
2005,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/volume/iscsi/iscsi_util.go | scanOneLun | func scanOneLun(hostNumber int, lunNumber int) error {
filename := fmt.Sprintf("/sys/class/scsi_host/host%d/scan", hostNumber)
fd, err := os.OpenFile(filename, os.O_WRONLY, 0)
if err != nil {
return err
}
defer fd.Close()
// Channel/Target are always 0 for iSCSI
scanCmd := fmt.Sprintf("0 0 %d", lunNumber)
if... | go | func scanOneLun(hostNumber int, lunNumber int) error {
filename := fmt.Sprintf("/sys/class/scsi_host/host%d/scan", hostNumber)
fd, err := os.OpenFile(filename, os.O_WRONLY, 0)
if err != nil {
return err
}
defer fd.Close()
// Channel/Target are always 0 for iSCSI
scanCmd := fmt.Sprintf("0 0 %d", lunNumber)
if... | [
"func",
"scanOneLun",
"(",
"hostNumber",
"int",
",",
"lunNumber",
"int",
")",
"error",
"{",
"filename",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"hostNumber",
")",
"\n",
"fd",
",",
"err",
":=",
"os",
".",
"OpenFile",
"(",
"filename",
",",
"... | // scanOneLun scans a single LUN on one SCSI bus
// Use this to avoid scanning the whole SCSI bus for all of the LUNs, which
// would result in the kernel on this node discovering LUNs that it shouldn't
// know about. Extraneous LUNs cause problems because they may get deleted
// without us getting notified, since we w... | [
"scanOneLun",
"scans",
"a",
"single",
"LUN",
"on",
"one",
"SCSI",
"bus",
"Use",
"this",
"to",
"avoid",
"scanning",
"the",
"whole",
"SCSI",
"bus",
"for",
"all",
"of",
"the",
"LUNs",
"which",
"would",
"result",
"in",
"the",
"kernel",
"on",
"this",
"node",
... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/iscsi/iscsi_util.go#L244-L262 | train | scanOneLun scans one lun on a SCSI host | [
30522,
4569,
2278,
13594,
5643,
26896,
1006,
3677,
19172,
5677,
20014,
1010,
11320,
10695,
29440,
20014,
1007,
7561,
1063,
5371,
18442,
1024,
1027,
4718,
2102,
1012,
9043,
2546,
1006,
1000,
1013,
25353,
2015,
1013,
2465,
1013,
8040,
5332,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/core/v1/zz_generated.conversion.go | Convert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource | func Convert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(in *core.GCEPersistentDiskVolumeSource, out *v1.GCEPersistentDiskVolumeSource, s conversion.Scope) error {
return autoConvert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(in, out, s)
} | go | func Convert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(in *core.GCEPersistentDiskVolumeSource, out *v1.GCEPersistentDiskVolumeSource, s conversion.Scope) error {
return autoConvert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(in, out, s)
} | [
"func",
"Convert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource",
"(",
"in",
"*",
"core",
".",
"GCEPersistentDiskVolumeSource",
",",
"out",
"*",
"v1",
".",
"GCEPersistentDiskVolumeSource",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"r... | // Convert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource is an autogenerated conversion function. | [
"Convert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/core/v1/zz_generated.conversion.go#L3604-L3606 | train | Convert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
4563,
1035,
1043,
3401,
7347,
27870,
3372,
10521,
2243,
6767,
12942,
2229,
8162,
3401,
1035,
2000,
1035,
1058,
2487,
1035,
1043,
3401,
7347,
27870,
3372,
10521,
2243,
6767,
12942,
2229,
8162,
3401,
1006,
1999... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go | Patch | func (c *FakeStorageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, name, pt, data, subresources...), &v1beta1.StorageClass{})
if obj == nil {
... | go | func (c *FakeStorageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, name, pt, data, subresources...), &v1beta1.StorageClass{})
if obj == nil {
... | [
"func",
"(",
"c",
"*",
"FakeStorageClasses",
")",
"Patch",
"(",
"name",
"string",
",",
"pt",
"types",
".",
"PatchType",
",",
"data",
"[",
"]",
"byte",
",",
"subresources",
"...",
"string",
")",
"(",
"result",
"*",
"v1beta1",
".",
"StorageClass",
",",
"... | // Patch applies the patch and returns the patched storageClass. | [
"Patch",
"applies",
"the",
"patch",
"and",
"returns",
"the",
"patched",
"storageClass",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go#L113-L120 | train | Patch applies the patch and returns the patched storageClass. | [
30522,
4569,
2278,
1006,
1039,
1008,
8275,
23809,
4270,
26266,
2229,
1007,
8983,
1006,
2171,
5164,
1010,
13866,
4127,
1012,
8983,
13874,
1010,
2951,
1031,
1033,
24880,
1010,
4942,
6072,
8162,
9623,
1012,
1012,
1012,
5164,
1007,
1006,
2765,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | cmd/kube-controller-manager/app/plugins.go | ProbeAttachableVolumePlugins | func ProbeAttachableVolumePlugins() []volume.VolumePlugin {
allPlugins := []volume.VolumePlugin{}
allPlugins = append(allPlugins, awsebs.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, gcepd.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, cinder.ProbeVolumePlugins()...)
allPlugins = append(allPl... | go | func ProbeAttachableVolumePlugins() []volume.VolumePlugin {
allPlugins := []volume.VolumePlugin{}
allPlugins = append(allPlugins, awsebs.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, gcepd.ProbeVolumePlugins()...)
allPlugins = append(allPlugins, cinder.ProbeVolumePlugins()...)
allPlugins = append(allPl... | [
"func",
"ProbeAttachableVolumePlugins",
"(",
")",
"[",
"]",
"volume",
".",
"VolumePlugin",
"{",
"allPlugins",
":=",
"[",
"]",
"volume",
".",
"VolumePlugin",
"{",
"}",
"\n\n",
"allPlugins",
"=",
"append",
"(",
"allPlugins",
",",
"awsebs",
".",
"ProbeVolumePlugi... | // ProbeAttachableVolumePlugins collects all volume plugins for the attach/
// detach controller.
// The list of plugins is manually compiled. This code and the plugin
// initialization code for kubelet really, really need a through refactor. | [
"ProbeAttachableVolumePlugins",
"collects",
"all",
"volume",
"plugins",
"for",
"the",
"attach",
"/",
"detach",
"controller",
".",
"The",
"list",
"of",
"plugins",
"is",
"manually",
"compiled",
".",
"This",
"code",
"and",
"the",
"plugin",
"initialization",
"code",
... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kube-controller-manager/app/plugins.go#L66-L85 | train | ProbeAttachableVolumePlugins returns a list of all volume plugins that are attached to the volume. | [
30522,
4569,
2278,
15113,
19321,
6776,
3085,
6767,
12942,
13699,
7630,
16529,
1006,
1007,
1031,
1033,
3872,
1012,
3872,
24759,
15916,
2378,
1063,
2035,
24759,
15916,
7076,
1024,
1027,
1031,
1033,
3872,
1012,
3872,
24759,
15916,
2378,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/storage/validation/validation.go | ValidateCSINode | func ValidateCSINode(csiNode *storage.CSINode) field.ErrorList {
allErrs := apivalidation.ValidateObjectMeta(&csiNode.ObjectMeta, false, apivalidation.ValidateNodeName, field.NewPath("metadata"))
allErrs = append(allErrs, validateCSINodeSpec(&csiNode.Spec, field.NewPath("spec"))...)
return allErrs
} | go | func ValidateCSINode(csiNode *storage.CSINode) field.ErrorList {
allErrs := apivalidation.ValidateObjectMeta(&csiNode.ObjectMeta, false, apivalidation.ValidateNodeName, field.NewPath("metadata"))
allErrs = append(allErrs, validateCSINodeSpec(&csiNode.Spec, field.NewPath("spec"))...)
return allErrs
} | [
"func",
"ValidateCSINode",
"(",
"csiNode",
"*",
"storage",
".",
"CSINode",
")",
"field",
".",
"ErrorList",
"{",
"allErrs",
":=",
"apivalidation",
".",
"ValidateObjectMeta",
"(",
"&",
"csiNode",
".",
"ObjectMeta",
",",
"false",
",",
"apivalidation",
".",
"Valid... | // ValidateCSINode validates a CSINode. | [
"ValidateCSINode",
"validates",
"a",
"CSINode",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/storage/validation/validation.go#L274-L278 | train | ValidateCSINode validates a CSINode. | [
30522,
4569,
2278,
9398,
3686,
6169,
5740,
3207,
1006,
22174,
3630,
3207,
1008,
5527,
1012,
22174,
3630,
3207,
1007,
2492,
1012,
7561,
9863,
1063,
2035,
2121,
2869,
1024,
1027,
17928,
10175,
8524,
3508,
1012,
9398,
3686,
16429,
20614,
11368... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | cmd/kubeadm/app/util/config/initconfiguration.go | LoadOrDefaultInitConfiguration | func LoadOrDefaultInitConfiguration(cfgPath string, defaultversionedcfg *kubeadmapiv1beta2.InitConfiguration) (*kubeadmapi.InitConfiguration, error) {
if cfgPath != "" {
// Loads configuration from config file, if provided
// Nb. --config overrides command line flags
return LoadInitConfigurationFromFile(cfgPath)... | go | func LoadOrDefaultInitConfiguration(cfgPath string, defaultversionedcfg *kubeadmapiv1beta2.InitConfiguration) (*kubeadmapi.InitConfiguration, error) {
if cfgPath != "" {
// Loads configuration from config file, if provided
// Nb. --config overrides command line flags
return LoadInitConfigurationFromFile(cfgPath)... | [
"func",
"LoadOrDefaultInitConfiguration",
"(",
"cfgPath",
"string",
",",
"defaultversionedcfg",
"*",
"kubeadmapiv1beta2",
".",
"InitConfiguration",
")",
"(",
"*",
"kubeadmapi",
".",
"InitConfiguration",
",",
"error",
")",
"{",
"if",
"cfgPath",
"!=",
"\"",
"\"",
"{... | // LoadOrDefaultInitConfiguration takes a path to a config file and a versioned configuration that can serve as the default config
// If cfgPath is specified, defaultversionedcfg will always get overridden. Otherwise, the default config (often populated by flags) will be used.
// Then the external, versioned configurat... | [
"LoadOrDefaultInitConfiguration",
"takes",
"a",
"path",
"to",
"a",
"config",
"file",
"and",
"a",
"versioned",
"configuration",
"that",
"can",
"serve",
"as",
"the",
"default",
"config",
"If",
"cfgPath",
"is",
"specified",
"defaultversionedcfg",
"will",
"always",
"g... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/util/config/initconfiguration.go#L201-L209 | train | LoadOrDefaultInitConfiguration loads the configuration from the given path or the provided defaultversionedcfg if provided. | [
30522,
4569,
2278,
7170,
8551,
12879,
23505,
5498,
13535,
2239,
8873,
27390,
3370,
1006,
12935,
21600,
8988,
5164,
1010,
12398,
27774,
2098,
2278,
2546,
2290,
1008,
13970,
4783,
4215,
2863,
8197,
2615,
2487,
20915,
2050,
2475,
1012,
1999,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apimachinery/pkg/api/meta/lazy.go | NewLazyRESTMapperLoader | func NewLazyRESTMapperLoader(fn func() (RESTMapper, error)) RESTMapper {
obj := &lazyObject{loader: fn}
return obj
} | go | func NewLazyRESTMapperLoader(fn func() (RESTMapper, error)) RESTMapper {
obj := &lazyObject{loader: fn}
return obj
} | [
"func",
"NewLazyRESTMapperLoader",
"(",
"fn",
"func",
"(",
")",
"(",
"RESTMapper",
",",
"error",
")",
")",
"RESTMapper",
"{",
"obj",
":=",
"&",
"lazyObject",
"{",
"loader",
":",
"fn",
"}",
"\n",
"return",
"obj",
"\n",
"}"
] | // NewLazyObjectLoader handles unrecoverable errors when creating a RESTMapper / ObjectTyper by
// returning those initialization errors when the interface methods are invoked. This defers the
// initialization and any server calls until a client actually needs to perform the action. | [
"NewLazyObjectLoader",
"handles",
"unrecoverable",
"errors",
"when",
"creating",
"a",
"RESTMapper",
"/",
"ObjectTyper",
"by",
"returning",
"those",
"initialization",
"errors",
"when",
"the",
"interface",
"methods",
"are",
"invoked",
".",
"This",
"defers",
"the",
"in... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apimachinery/pkg/api/meta/lazy.go#L38-L41 | train | NewLazyRESTMapperLoader creates a new RESTMapper that loads from a function. | [
30522,
4569,
2278,
2047,
2721,
9096,
28533,
2863,
18620,
11066,
2121,
1006,
1042,
2078,
4569,
2278,
1006,
1007,
1006,
2717,
2863,
18620,
1010,
7561,
1007,
1007,
2717,
2863,
18620,
1063,
27885,
3501,
1024,
1027,
1004,
13971,
16429,
20614,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go | DeepCopy | func (in *HorizontalPodAutoscaler) DeepCopy() *HorizontalPodAutoscaler {
if in == nil {
return nil
}
out := new(HorizontalPodAutoscaler)
in.DeepCopyInto(out)
return out
} | go | func (in *HorizontalPodAutoscaler) DeepCopy() *HorizontalPodAutoscaler {
if in == nil {
return nil
}
out := new(HorizontalPodAutoscaler)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"HorizontalPodAutoscaler",
")",
"DeepCopy",
"(",
")",
"*",
"HorizontalPodAutoscaler",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"HorizontalPodAutoscaler",
")",
"\n",
"in",
".",
"... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalPodAutoscaler. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"HorizontalPodAutoscaler",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go#L113-L120 | train | DeepCopy is an autogenerated deepcopy function copying the receiver creating a new HorizontalPodAutoscaler. | [
30522,
4569,
2278,
1006,
1999,
1008,
9876,
27633,
4887,
13122,
9289,
2121,
1007,
2784,
3597,
7685,
1006,
1007,
1008,
9876,
27633,
4887,
13122,
9289,
2121,
1063,
2065,
1999,
1027,
1027,
9152,
2140,
1063,
2709,
9152,
2140,
1065,
2041,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go | Delete | func (r *REST) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) (runtime.Object, bool, error) {
obj, err := r.Get(ctx, name, &metav1.GetOptions{})
if err != nil {
return nil, false, err
}
crd := obj.(*apiextensions.CustomResourceDefinition)
// Ensure we have a UID precondition
if option... | go | func (r *REST) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) (runtime.Object, bool, error) {
obj, err := r.Get(ctx, name, &metav1.GetOptions{})
if err != nil {
return nil, false, err
}
crd := obj.(*apiextensions.CustomResourceDefinition)
// Ensure we have a UID precondition
if option... | [
"func",
"(",
"r",
"*",
"REST",
")",
"Delete",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
"string",
",",
"options",
"*",
"metav1",
".",
"DeleteOptions",
")",
"(",
"runtime",
".",
"Object",
",",
"bool",
",",
"error",
")",
"{",
"obj",
",",
"e... | // Delete adds the CRD finalizer to the list | [
"Delete",
"adds",
"the",
"CRD",
"finalizer",
"to",
"the",
"list"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go#L70-L157 | train | Delete deletes a custom resource definition | [
30522,
4569,
2278,
1006,
1054,
1008,
2717,
1007,
3972,
12870,
1006,
14931,
2595,
6123,
1012,
6123,
1010,
2171,
5164,
1010,
7047,
1008,
18804,
2615,
2487,
1012,
3972,
12870,
7361,
9285,
1007,
1006,
2448,
7292,
1012,
4874,
1010,
22017,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go | DeepCopyObject | func (in *Policy) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | go | func (in *Policy) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
"func",
"(",
"in",
"*",
"Policy",
")",
"DeepCopyObject",
"(",
")",
"runtime",
".",
"Object",
"{",
"if",
"c",
":=",
"in",
".",
"DeepCopy",
"(",
")",
";",
"c",
"!=",
"nil",
"{",
"return",
"c",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] | // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. | [
"DeepCopyObject",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"runtime",
".",
"Object",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go#L219-L224 | train | DeepCopyObject is an autogenerated deepcopy function copying the receiver creating a new runtime. Object. | [
30522,
4569,
2278,
1006,
1999,
1008,
3343,
1007,
2784,
3597,
7685,
16429,
20614,
1006,
1007,
2448,
7292,
1012,
4874,
1063,
2065,
1039,
1024,
1027,
1999,
1012,
2784,
3597,
7685,
1006,
1007,
1025,
1039,
999,
1027,
9152,
2140,
1063,
2709,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/helpers.go | HasAnnotation | func HasAnnotation(obj ObjectMeta, ann string) bool {
_, found := obj.Annotations[ann]
return found
} | go | func HasAnnotation(obj ObjectMeta, ann string) bool {
_, found := obj.Annotations[ann]
return found
} | [
"func",
"HasAnnotation",
"(",
"obj",
"ObjectMeta",
",",
"ann",
"string",
")",
"bool",
"{",
"_",
",",
"found",
":=",
"obj",
".",
"Annotations",
"[",
"ann",
"]",
"\n",
"return",
"found",
"\n",
"}"
] | // HasAnnotation returns a bool if passed in annotation exists | [
"HasAnnotation",
"returns",
"a",
"bool",
"if",
"passed",
"in",
"annotation",
"exists"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/helpers.go#L189-L192 | train | HasAnnotation returns true if the object has the annotation ann. | [
30522,
4569,
2278,
17000,
17048,
3370,
1006,
27885,
3501,
4874,
11368,
2050,
1010,
5754,
5164,
1007,
22017,
2140,
1063,
1035,
1010,
2179,
1024,
1027,
27885,
3501,
1012,
5754,
17287,
9285,
1031,
5754,
1033,
2709,
2179,
1065,
102,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/util/configz/configz.go | New | func New(name string) (*Config, error) {
configsGuard.Lock()
defer configsGuard.Unlock()
if _, found := configs[name]; found {
return nil, fmt.Errorf("register config %q twice", name)
}
newConfig := Config{}
configs[name] = &newConfig
return &newConfig, nil
} | go | func New(name string) (*Config, error) {
configsGuard.Lock()
defer configsGuard.Unlock()
if _, found := configs[name]; found {
return nil, fmt.Errorf("register config %q twice", name)
}
newConfig := Config{}
configs[name] = &newConfig
return &newConfig, nil
} | [
"func",
"New",
"(",
"name",
"string",
")",
"(",
"*",
"Config",
",",
"error",
")",
"{",
"configsGuard",
".",
"Lock",
"(",
")",
"\n",
"defer",
"configsGuard",
".",
"Unlock",
"(",
")",
"\n",
"if",
"_",
",",
"found",
":=",
"configs",
"[",
"name",
"]",
... | // New creates a Config object with the given name. Each Config is registered
// with this package's "/configz" handler. | [
"New",
"creates",
"a",
"Config",
"object",
"with",
"the",
"given",
"name",
".",
"Each",
"Config",
"is",
"registered",
"with",
"this",
"package",
"s",
"/",
"configz",
"handler",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/util/configz/configz.go#L72-L81 | train | New creates a new config with the given name. | [
30522,
4569,
2278,
2047,
1006,
2171,
5164,
1007,
1006,
1008,
9530,
8873,
2290,
1010,
7561,
1007,
1063,
9530,
8873,
5620,
18405,
1012,
5843,
1006,
1007,
13366,
2121,
9530,
8873,
5620,
18405,
1012,
19829,
1006,
1007,
2065,
1035,
1010,
2179,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/api/core/v1/zz_generated.deepcopy.go | DeepCopyInto | func (in *ReplicationControllerSpec) DeepCopyInto(out *ReplicationControllerSpec) {
*out = *in
if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas
*out = new(int32)
**out = **in
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = make(map[string]string, len(*in))
for key, ... | go | func (in *ReplicationControllerSpec) DeepCopyInto(out *ReplicationControllerSpec) {
*out = *in
if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas
*out = new(int32)
**out = **in
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = make(map[string]string, len(*in))
for key, ... | [
"func",
"(",
"in",
"*",
"ReplicationControllerSpec",
")",
"DeepCopyInto",
"(",
"out",
"*",
"ReplicationControllerSpec",
")",
"{",
"*",
"out",
"=",
"*",
"in",
"\n",
"if",
"in",
".",
"Replicas",
"!=",
"nil",
"{",
"in",
",",
"out",
":=",
"&",
"in",
".",
... | // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"DeepCopyInto",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"writing",
"into",
"out",
".",
"in",
"must",
"be",
"non",
"-",
"nil",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/api/core/v1/zz_generated.deepcopy.go#L4080-L4100 | train | DeepCopyInto is an autogenerated deepcopy function copying the receiver creating a new ReplicationControllerSpec. | [
30522,
4569,
2278,
1006,
1999,
1008,
21647,
8663,
13181,
10820,
13102,
8586,
1007,
2784,
3597,
7685,
18447,
2080,
1006,
2041,
1008,
21647,
8663,
13181,
10820,
13102,
8586,
1007,
1063,
1008,
2041,
1027,
1008,
1999,
2065,
1999,
1012,
15059,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/core/v1/zz_generated.conversion.go | Convert_core_CSIVolumeSource_To_v1_CSIVolumeSource | func Convert_core_CSIVolumeSource_To_v1_CSIVolumeSource(in *core.CSIVolumeSource, out *v1.CSIVolumeSource, s conversion.Scope) error {
return autoConvert_core_CSIVolumeSource_To_v1_CSIVolumeSource(in, out, s)
} | go | func Convert_core_CSIVolumeSource_To_v1_CSIVolumeSource(in *core.CSIVolumeSource, out *v1.CSIVolumeSource, s conversion.Scope) error {
return autoConvert_core_CSIVolumeSource_To_v1_CSIVolumeSource(in, out, s)
} | [
"func",
"Convert_core_CSIVolumeSource_To_v1_CSIVolumeSource",
"(",
"in",
"*",
"core",
".",
"CSIVolumeSource",
",",
"out",
"*",
"v1",
".",
"CSIVolumeSource",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_core_CSIVolumeSource_To_v1_CSIVol... | // Convert_core_CSIVolumeSource_To_v1_CSIVolumeSource is an autogenerated conversion function. | [
"Convert_core_CSIVolumeSource_To_v1_CSIVolumeSource",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/core/v1/zz_generated.conversion.go#L2362-L2364 | train | Convert_core_CSIVolumeSource_To_v1_CSIVolumeSource is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
4563,
1035,
22174,
6767,
12942,
2229,
8162,
3401,
1035,
2000,
1035,
1058,
2487,
1035,
22174,
6767,
12942,
2229,
8162,
3401,
1006,
1999,
1008,
4563,
1012,
22174,
6767,
12942,
2229,
8162,
3401,
1010,
2041,
1008... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go | maybeRefreshCreds | func (a *Authenticator) maybeRefreshCreds(creds *credentials, r *clientauthentication.Response) error {
a.mu.Lock()
defer a.mu.Unlock()
// Since we're not making a new pointer to a.cachedCreds in getCreds, no
// need to do deep comparison.
if creds != a.cachedCreds {
// Credentials already rotated.
return nil... | go | func (a *Authenticator) maybeRefreshCreds(creds *credentials, r *clientauthentication.Response) error {
a.mu.Lock()
defer a.mu.Unlock()
// Since we're not making a new pointer to a.cachedCreds in getCreds, no
// need to do deep comparison.
if creds != a.cachedCreds {
// Credentials already rotated.
return nil... | [
"func",
"(",
"a",
"*",
"Authenticator",
")",
"maybeRefreshCreds",
"(",
"creds",
"*",
"credentials",
",",
"r",
"*",
"clientauthentication",
".",
"Response",
")",
"error",
"{",
"a",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"a",
".",
"mu",
".",
... | // maybeRefreshCreds executes the plugin to force a rotation of the
// credentials, unless they were rotated already. | [
"maybeRefreshCreds",
"executes",
"the",
"plugin",
"to",
"force",
"a",
"rotation",
"of",
"the",
"credentials",
"unless",
"they",
"were",
"rotated",
"already",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go#L266-L278 | train | maybeRefreshCreds refreshes the credentials from the credentials cache. | [
30522,
4569,
2278,
1006,
1037,
1008,
14469,
8844,
1007,
2672,
2890,
19699,
9953,
16748,
5104,
1006,
13675,
2098,
2015,
1008,
22496,
1010,
1054,
1008,
7396,
4887,
10760,
16778,
10719,
1012,
3433,
1007,
7561,
1063,
1037,
1012,
14163,
1012,
58... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubeapiserver/server/insecure_handler.go | BuildInsecureHandlerChain | func BuildInsecureHandlerChain(apiHandler http.Handler, c *server.Config) http.Handler {
handler := apiHandler
handler = genericapifilters.WithAudit(handler, c.AuditBackend, c.AuditPolicyChecker, c.LongRunningFunc)
handler = genericapifilters.WithAuthentication(handler, server.InsecureSuperuser{}, nil, nil)
handler... | go | func BuildInsecureHandlerChain(apiHandler http.Handler, c *server.Config) http.Handler {
handler := apiHandler
handler = genericapifilters.WithAudit(handler, c.AuditBackend, c.AuditPolicyChecker, c.LongRunningFunc)
handler = genericapifilters.WithAuthentication(handler, server.InsecureSuperuser{}, nil, nil)
handler... | [
"func",
"BuildInsecureHandlerChain",
"(",
"apiHandler",
"http",
".",
"Handler",
",",
"c",
"*",
"server",
".",
"Config",
")",
"http",
".",
"Handler",
"{",
"handler",
":=",
"apiHandler",
"\n",
"handler",
"=",
"genericapifilters",
".",
"WithAudit",
"(",
"handler"... | // DeprecatedInsecureServingInfo is required to serve http. HTTP does NOT include authentication or authorization.
// You shouldn't be using this. It makes sig-auth sad.
// DeprecatedInsecureServingInfo *ServingInfo
// BuildInsecureHandlerChain sets up the server to listen to http. Should be removed. | [
"DeprecatedInsecureServingInfo",
"is",
"required",
"to",
"serve",
"http",
".",
"HTTP",
"does",
"NOT",
"include",
"authentication",
"or",
"authorization",
".",
"You",
"shouldn",
"t",
"be",
"using",
"this",
".",
"It",
"makes",
"sig",
"-",
"auth",
"sad",
".",
"... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubeapiserver/server/insecure_handler.go#L32-L44 | train | BuildInsecureHandlerChain builds a handler chain that can be used to handle requests that are not in the chain. | [
30522,
4569,
2278,
3857,
7076,
29150,
11774,
3917,
24925,
2078,
1006,
17928,
11774,
3917,
8299,
1012,
28213,
1010,
1039,
1008,
8241,
1012,
9530,
8873,
2290,
1007,
8299,
1012,
28213,
1063,
28213,
1024,
1027,
17928,
11774,
3917,
28213,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/volume/local/local.go | SetUpAt | func (m *localVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
m.plugin.volumeLocks.LockKey(m.globalPath)
defer m.plugin.volumeLocks.UnlockKey(m.globalPath)
if m.globalPath == "" {
return fmt.Errorf("LocalVolume volume %q path is empty", m.volName)
}
err := validation.ValidatePathNoBacksteps(m.global... | go | func (m *localVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
m.plugin.volumeLocks.LockKey(m.globalPath)
defer m.plugin.volumeLocks.UnlockKey(m.globalPath)
if m.globalPath == "" {
return fmt.Errorf("LocalVolume volume %q path is empty", m.volName)
}
err := validation.ValidatePathNoBacksteps(m.global... | [
"func",
"(",
"m",
"*",
"localVolumeMounter",
")",
"SetUpAt",
"(",
"dir",
"string",
",",
"fsGroup",
"*",
"int64",
")",
"error",
"{",
"m",
".",
"plugin",
".",
"volumeLocks",
".",
"LockKey",
"(",
"m",
".",
"globalPath",
")",
"\n",
"defer",
"m",
".",
"pl... | // SetUpAt bind mounts the directory to the volume path and sets up volume ownership | [
"SetUpAt",
"bind",
"mounts",
"the",
"directory",
"to",
"the",
"volume",
"path",
"and",
"sets",
"up",
"volume",
"ownership"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/local/local.go#L431-L526 | train | SetUpAt sets up the local volume at the given path. | [
30522,
4569,
2278,
1006,
1049,
1008,
2334,
6767,
12942,
6633,
21723,
2121,
1007,
16437,
4017,
1006,
16101,
5164,
1010,
1042,
28745,
22107,
1008,
20014,
21084,
1007,
7561,
1063,
1049,
1012,
13354,
2378,
1012,
3872,
7878,
2015,
1012,
5843,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | cluster/images/etcd/migrate/versions.go | Equals | func (vp *EtcdVersionPair) Equals(o *EtcdVersionPair) bool {
return vp.version.Equals(o.version) && vp.storageVersion == o.storageVersion
} | go | func (vp *EtcdVersionPair) Equals(o *EtcdVersionPair) bool {
return vp.version.Equals(o.version) && vp.storageVersion == o.storageVersion
} | [
"func",
"(",
"vp",
"*",
"EtcdVersionPair",
")",
"Equals",
"(",
"o",
"*",
"EtcdVersionPair",
")",
"bool",
"{",
"return",
"vp",
".",
"version",
".",
"Equals",
"(",
"o",
".",
"version",
")",
"&&",
"vp",
".",
"storageVersion",
"==",
"o",
".",
"storageVersi... | // Equals returns true if both the versions and storage versions are exactly equal. | [
"Equals",
"returns",
"true",
"if",
"both",
"the",
"versions",
"and",
"storage",
"versions",
"are",
"exactly",
"equal",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cluster/images/etcd/migrate/versions.go#L143-L145 | train | Equals returns true if the version and storage version pair are equal. | [
30522,
4569,
2278,
1006,
21210,
1008,
4385,
2094,
27774,
4502,
4313,
1007,
19635,
1006,
1051,
1008,
4385,
2094,
27774,
4502,
4313,
1007,
22017,
2140,
1063,
2709,
21210,
1012,
2544,
1012,
19635,
1006,
1051,
1012,
2544,
1007,
1004,
1004,
2121... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/scheduler/apis/config/v1alpha1/zz_generated.conversion.go | Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha1_KubeSchedulerLeaderElectionConfiguration | func Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha1_KubeSchedulerLeaderElectionConfiguration(in *config.KubeSchedulerLeaderElectionConfiguration, out *v1alpha1.KubeSchedulerLeaderElectionConfiguration, s conversion.Scope) error {
return autoConvert_config_KubeSchedulerLeaderElectionConfiguration_T... | go | func Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha1_KubeSchedulerLeaderElectionConfiguration(in *config.KubeSchedulerLeaderElectionConfiguration, out *v1alpha1.KubeSchedulerLeaderElectionConfiguration, s conversion.Scope) error {
return autoConvert_config_KubeSchedulerLeaderElectionConfiguration_T... | [
"func",
"Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha1_KubeSchedulerLeaderElectionConfiguration",
"(",
"in",
"*",
"config",
".",
"KubeSchedulerLeaderElectionConfiguration",
",",
"out",
"*",
"v1alpha1",
".",
"KubeSchedulerLeaderElectionConfiguration",
",",
"s",
"... | // Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha1_KubeSchedulerLeaderElectionConfiguration is an autogenerated conversion function. | [
"Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha1_KubeSchedulerLeaderElectionConfiguration",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/scheduler/apis/config/v1alpha1/zz_generated.conversion.go#L183-L185 | train | Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha1_KubeSchedulerLeaderElectionConfiguration is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
9530,
8873,
2290,
1035,
13970,
12681,
7690,
9307,
20927,
9648,
16570,
18491,
8663,
8873,
27390,
3370,
1035,
2000,
1035,
1058,
2487,
2389,
21890,
2487,
1035,
13970,
12681,
7690,
9307,
20927,
9648,
16570,
18491,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apiserver/pkg/util/wsstream/conn.go | handshake | func handshake(config *websocket.Config, req *http.Request, allowed []string) error {
protocols := config.Protocol
if len(protocols) == 0 {
protocols = []string{""}
}
for _, protocol := range protocols {
for _, allow := range allowed {
if allow == protocol {
config.Protocol = []string{protocol}
retu... | go | func handshake(config *websocket.Config, req *http.Request, allowed []string) error {
protocols := config.Protocol
if len(protocols) == 0 {
protocols = []string{""}
}
for _, protocol := range protocols {
for _, allow := range allowed {
if allow == protocol {
config.Protocol = []string{protocol}
retu... | [
"func",
"handshake",
"(",
"config",
"*",
"websocket",
".",
"Config",
",",
"req",
"*",
"http",
".",
"Request",
",",
"allowed",
"[",
"]",
"string",
")",
"error",
"{",
"protocols",
":=",
"config",
".",
"Protocol",
"\n",
"if",
"len",
"(",
"protocols",
")",... | // handshake ensures the provided user protocol matches one of the allowed protocols. It returns
// no error if no protocol is specified. | [
"handshake",
"ensures",
"the",
"provided",
"user",
"protocol",
"matches",
"one",
"of",
"the",
"allowed",
"protocols",
".",
"It",
"returns",
"no",
"error",
"if",
"no",
"protocol",
"is",
"specified",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/util/wsstream/conn.go#L111-L127 | train | handshake is used to handshake a websocket connection. | [
30522,
4569,
2278,
2398,
20459,
2063,
1006,
9530,
8873,
2290,
1008,
4773,
6499,
19869,
2102,
1012,
9530,
8873,
2290,
1010,
2128,
4160,
1008,
8299,
1012,
5227,
1010,
3039,
1031,
1033,
5164,
1007,
7561,
1063,
16744,
1024,
1027,
9530,
8873,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/node-api/pkg/client/informers/externalversions/node/v1alpha1/runtimeclass.go | NewRuntimeClassInformer | func NewRuntimeClassInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredRuntimeClassInformer(client, resyncPeriod, indexers, nil)
} | go | func NewRuntimeClassInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredRuntimeClassInformer(client, resyncPeriod, indexers, nil)
} | [
"func",
"NewRuntimeClassInformer",
"(",
"client",
"versioned",
".",
"Interface",
",",
"resyncPeriod",
"time",
".",
"Duration",
",",
"indexers",
"cache",
".",
"Indexers",
")",
"cache",
".",
"SharedIndexInformer",
"{",
"return",
"NewFilteredRuntimeClassInformer",
"(",
... | // NewRuntimeClassInformer constructs a new informer for RuntimeClass type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server. | [
"NewRuntimeClassInformer",
"constructs",
"a",
"new",
"informer",
"for",
"RuntimeClass",
"type",
".",
"Always",
"prefer",
"using",
"an",
"informer",
"factory",
"to",
"get",
"a",
"shared",
"informer",
"instead",
"of",
"getting",
"an",
"independent",
"one",
".",
"T... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/node-api/pkg/client/informers/externalversions/node/v1alpha1/runtimeclass.go#L49-L51 | train | NewRuntimeClassInformer constructs a new informer for RuntimeClass type. Always prefer using an informer factory to get a shared informer instead of getting an independent one. This reduces memory footprint and number of connections to the server. | [
30522,
4569,
2278,
2047,
15532,
7292,
26266,
2378,
14192,
2121,
1006,
7396,
2544,
2098,
1012,
8278,
1010,
24501,
6038,
21906,
11124,
7716,
2051,
1012,
9367,
1010,
5950,
2545,
17053,
1012,
5950,
2545,
1007,
17053,
1012,
4207,
22254,
10288,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubectl/cmd/util/helpers.go | GetFlagInt64 | func GetFlagInt64(cmd *cobra.Command, flag string) int64 {
i, err := cmd.Flags().GetInt64(flag)
if err != nil {
klog.Fatalf("error accessing flag %s for command %s: %v", flag, cmd.Name(), err)
}
return i
} | go | func GetFlagInt64(cmd *cobra.Command, flag string) int64 {
i, err := cmd.Flags().GetInt64(flag)
if err != nil {
klog.Fatalf("error accessing flag %s for command %s: %v", flag, cmd.Name(), err)
}
return i
} | [
"func",
"GetFlagInt64",
"(",
"cmd",
"*",
"cobra",
".",
"Command",
",",
"flag",
"string",
")",
"int64",
"{",
"i",
",",
"err",
":=",
"cmd",
".",
"Flags",
"(",
")",
".",
"GetInt64",
"(",
"flag",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"klog",
".",... | // Assumes the flag has a default value. | [
"Assumes",
"the",
"flag",
"has",
"a",
"default",
"value",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/cmd/util/helpers.go#L354-L360 | train | GetFlagInt64 returns the value of a flag as int64 | [
30522,
4569,
2278,
2131,
10258,
22974,
3372,
21084,
1006,
4642,
2094,
1008,
16604,
1012,
3094,
1010,
5210,
5164,
1007,
20014,
21084,
1063,
30524,
1012,
9245,
1006,
1007,
1012,
2131,
18447,
21084,
1006,
5210,
1007,
2065,
9413,
2099,
999,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | plugin/pkg/admission/resourcequota/apis/resourcequota/zz_generated.deepcopy.go | DeepCopy | func (in *LimitedResource) DeepCopy() *LimitedResource {
if in == nil {
return nil
}
out := new(LimitedResource)
in.DeepCopyInto(out)
return out
} | go | func (in *LimitedResource) DeepCopy() *LimitedResource {
if in == nil {
return nil
}
out := new(LimitedResource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"LimitedResource",
")",
"DeepCopy",
"(",
")",
"*",
"LimitedResource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"LimitedResource",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitedResource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"LimitedResource",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/plugin/pkg/admission/resourcequota/apis/resourcequota/zz_generated.deepcopy.go#L79-L86 | train | DeepCopy is an autogenerated deepcopy function copying the receiver creating a new LimitedResource. | [
30522,
4569,
2278,
1006,
1999,
1008,
3132,
6072,
8162,
3401,
1007,
2784,
3597,
7685,
1006,
1007,
1008,
3132,
6072,
8162,
3401,
1063,
2065,
1999,
1027,
1027,
9152,
2140,
1063,
2709,
9152,
2140,
1065,
2041,
1024,
1027,
2047,
1006,
3132,
607... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/apps/zz_generated.deepcopy.go | DeepCopy | func (in *DaemonSetSpec) DeepCopy() *DaemonSetSpec {
if in == nil {
return nil
}
out := new(DaemonSetSpec)
in.DeepCopyInto(out)
return out
} | go | func (in *DaemonSetSpec) DeepCopy() *DaemonSetSpec {
if in == nil {
return nil
}
out := new(DaemonSetSpec)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"DaemonSetSpec",
")",
"DeepCopy",
"(",
")",
"*",
"DaemonSetSpec",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"DaemonSetSpec",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DaemonSetSpec. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"DaemonSetSpec",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/apps/zz_generated.deepcopy.go#L188-L195 | train | DeepCopy is an autogenerated deepcopy function copying the receiver creating a new DaemonSetSpec. | [
30522,
4569,
2278,
1006,
1999,
1008,
12828,
13462,
13102,
8586,
1007,
2784,
3597,
7685,
1006,
1007,
1008,
12828,
13462,
13102,
8586,
1063,
2065,
1999,
1027,
1027,
9152,
2140,
1063,
2709,
9152,
2140,
1065,
2041,
1024,
1027,
2047,
1006,
12828... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubelet/kubelet.go | NewMainKubelet | func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
kubeDeps *Dependencies,
crOptions *config.ContainerRuntimeOptions,
containerRuntime string,
runtimeCgroups string,
hostnameOverride string,
nodeIP string,
providerID string,
cloudProvider string,
certDirectory string,
rootDirectory strin... | go | func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
kubeDeps *Dependencies,
crOptions *config.ContainerRuntimeOptions,
containerRuntime string,
runtimeCgroups string,
hostnameOverride string,
nodeIP string,
providerID string,
cloudProvider string,
certDirectory string,
rootDirectory strin... | [
"func",
"NewMainKubelet",
"(",
"kubeCfg",
"*",
"kubeletconfiginternal",
".",
"KubeletConfiguration",
",",
"kubeDeps",
"*",
"Dependencies",
",",
"crOptions",
"*",
"config",
".",
"ContainerRuntimeOptions",
",",
"containerRuntime",
"string",
",",
"runtimeCgroups",
"string"... | // NewMainKubelet instantiates a new Kubelet object along with all the required internal modules.
// No initialization of Kubelet and its modules should happen here. | [
"NewMainKubelet",
"instantiates",
"a",
"new",
"Kubelet",
"object",
"along",
"with",
"all",
"the",
"required",
"internal",
"modules",
".",
"No",
"initialization",
"of",
"Kubelet",
"and",
"its",
"modules",
"should",
"happen",
"here",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/kubelet.go#L327-L882 | train | NewMainKubelet creates a new kubelet instance | [
30522,
4569,
2278,
2047,
24238,
5283,
8671,
3388,
1006,
13970,
4783,
2278,
2546,
2290,
1008,
13970,
8671,
3388,
8663,
8873,
11528,
16451,
2389,
1012,
13970,
8671,
3388,
8663,
8873,
27390,
3370,
1010,
13970,
8270,
13699,
2015,
1008,
12530,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/cloudprovider/providers/aws/aws_fakes.go | Compute | func (s *FakeAWSServices) Compute(region string) (EC2, error) {
return s.ec2, nil
} | go | func (s *FakeAWSServices) Compute(region string) (EC2, error) {
return s.ec2, nil
} | [
"func",
"(",
"s",
"*",
"FakeAWSServices",
")",
"Compute",
"(",
"region",
"string",
")",
"(",
"EC2",
",",
"error",
")",
"{",
"return",
"s",
".",
"ec2",
",",
"nil",
"\n",
"}"
] | // Compute returns a fake EC2 client | [
"Compute",
"returns",
"a",
"fake",
"EC2",
"client"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/aws/aws_fakes.go#L91-L93 | train | Compute returns the fake EC2 instance | [
30522,
4569,
2278,
1006,
1055,
1008,
8275,
10376,
18116,
7903,
2229,
1007,
24134,
1006,
2555,
5164,
1007,
1006,
14925,
2475,
1010,
7561,
1007,
1063,
2709,
1055,
1012,
14925,
2475,
1010,
9152,
2140,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/rbac/v1/zz_generated.conversion.go | Convert_rbac_RoleBinding_To_v1_RoleBinding | func Convert_rbac_RoleBinding_To_v1_RoleBinding(in *rbac.RoleBinding, out *v1.RoleBinding, s conversion.Scope) error {
return autoConvert_rbac_RoleBinding_To_v1_RoleBinding(in, out, s)
} | go | func Convert_rbac_RoleBinding_To_v1_RoleBinding(in *rbac.RoleBinding, out *v1.RoleBinding, s conversion.Scope) error {
return autoConvert_rbac_RoleBinding_To_v1_RoleBinding(in, out, s)
} | [
"func",
"Convert_rbac_RoleBinding_To_v1_RoleBinding",
"(",
"in",
"*",
"rbac",
".",
"RoleBinding",
",",
"out",
"*",
"v1",
".",
"RoleBinding",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_rbac_RoleBinding_To_v1_RoleBinding",
"(",
"in... | // Convert_rbac_RoleBinding_To_v1_RoleBinding is an autogenerated conversion function. | [
"Convert_rbac_RoleBinding_To_v1_RoleBinding",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/rbac/v1/zz_generated.conversion.go#L353-L355 | train | Convert_rbac_RoleBinding_To_v1_RoleBinding is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
21144,
6305,
1035,
2535,
8428,
4667,
1035,
2000,
1035,
1058,
2487,
1035,
2535,
8428,
4667,
1006,
1999,
1008,
21144,
6305,
1012,
2535,
8428,
4667,
1010,
2041,
1008,
1058,
2487,
1012,
2535,
8428,
4667,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/controller/nodeipam/config/v1alpha1/conversion.go | Convert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration | func Convert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration(in *v1alpha1.NodeIPAMControllerConfiguration, out *config.NodeIPAMControllerConfiguration, s conversion.Scope) error {
return autoConvert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration(in... | go | func Convert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration(in *v1alpha1.NodeIPAMControllerConfiguration, out *config.NodeIPAMControllerConfiguration, s conversion.Scope) error {
return autoConvert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration(in... | [
"func",
"Convert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration",
"(",
"in",
"*",
"v1alpha1",
".",
"NodeIPAMControllerConfiguration",
",",
"out",
"*",
"config",
".",
"NodeIPAMControllerConfiguration",
",",
"s",
"conversion",
".",
"Scope",
")"... | // Important! The public back-and-forth conversion functions for the types in this package
// with NodeIPAMControllerConfiguration types need to be manually exposed like this in order for
// other packages that reference this package to be able to call these conversion functions
// in an autogenerated manner.
// TODO: ... | [
"Important!",
"The",
"public",
"back",
"-",
"and",
"-",
"forth",
"conversion",
"functions",
"for",
"the",
"types",
"in",
"this",
"package",
"with",
"NodeIPAMControllerConfiguration",
"types",
"need",
"to",
"be",
"manually",
"exposed",
"like",
"this",
"in",
"orde... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/controller/nodeipam/config/v1alpha1/conversion.go#L33-L35 | train | Convert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
1058,
2487,
2389,
21890,
2487,
1035,
13045,
11514,
3286,
8663,
13181,
10820,
8663,
8873,
27390,
3370,
1035,
2000,
1035,
9530,
8873,
2290,
1035,
13045,
11514,
3286,
8663,
13181,
10820,
8663,
8873,
27390,
3370,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/controller/volume/persistentvolume/pv_controller.go | recycleVolumeOperation | func (ctrl *PersistentVolumeController) recycleVolumeOperation(volume *v1.PersistentVolume) {
klog.V(4).Infof("recycleVolumeOperation [%s] started", volume.Name)
// This method may have been waiting for a volume lock for some time.
// Previous recycleVolumeOperation might just have saved an updated version,
// so ... | go | func (ctrl *PersistentVolumeController) recycleVolumeOperation(volume *v1.PersistentVolume) {
klog.V(4).Infof("recycleVolumeOperation [%s] started", volume.Name)
// This method may have been waiting for a volume lock for some time.
// Previous recycleVolumeOperation might just have saved an updated version,
// so ... | [
"func",
"(",
"ctrl",
"*",
"PersistentVolumeController",
")",
"recycleVolumeOperation",
"(",
"volume",
"*",
"v1",
".",
"PersistentVolume",
")",
"{",
"klog",
".",
"V",
"(",
"4",
")",
".",
"Infof",
"(",
"\"",
"\"",
",",
"volume",
".",
"Name",
")",
"\n\n",
... | // recycleVolumeOperation recycles a volume. This method is running in
// standalone goroutine and already has all necessary locks. | [
"recycleVolumeOperation",
"recycles",
"a",
"volume",
".",
"This",
"method",
"is",
"running",
"in",
"standalone",
"goroutine",
"and",
"already",
"has",
"all",
"necessary",
"locks",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/controller/volume/persistentvolume/pv_controller.go#L1065-L1157 | train | recycleVolumeOperation is called when a volume is released or the volume is used. | [
30522,
4569,
2278,
1006,
14931,
12190,
1008,
14516,
6767,
12942,
8586,
12162,
26611,
1007,
28667,
2100,
14321,
6767,
12942,
8780,
29487,
1006,
3872,
1008,
1058,
2487,
1012,
14516,
6767,
12942,
2063,
1007,
1063,
1047,
21197,
1012,
1058,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1/zz_generated.conversion.go | Convert_wardle_FischerList_To_v1alpha1_FischerList | func Convert_wardle_FischerList_To_v1alpha1_FischerList(in *wardle.FischerList, out *FischerList, s conversion.Scope) error {
return autoConvert_wardle_FischerList_To_v1alpha1_FischerList(in, out, s)
} | go | func Convert_wardle_FischerList_To_v1alpha1_FischerList(in *wardle.FischerList, out *FischerList, s conversion.Scope) error {
return autoConvert_wardle_FischerList_To_v1alpha1_FischerList(in, out, s)
} | [
"func",
"Convert_wardle_FischerList_To_v1alpha1_FischerList",
"(",
"in",
"*",
"wardle",
".",
"FischerList",
",",
"out",
"*",
"FischerList",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_wardle_FischerList_To_v1alpha1_FischerList",
"(",
... | // Convert_wardle_FischerList_To_v1alpha1_FischerList is an autogenerated conversion function. | [
"Convert_wardle_FischerList_To_v1alpha1_FischerList",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1/zz_generated.conversion.go#L151-L153 | train | Convert_wardle_FischerList_To_v1alpha1_FischerList is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
4829,
2571,
1035,
13042,
9863,
1035,
2000,
1035,
1058,
2487,
2389,
21890,
2487,
1035,
13042,
9863,
1006,
1999,
1008,
4829,
2571,
1012,
13042,
9863,
1010,
2041,
1008,
13042,
9863,
1010,
1055,
7584,
1012,
9531,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apimachinery/pkg/runtime/schema/group_version.go | ParseKindArg | func ParseKindArg(arg string) (*GroupVersionKind, GroupKind) {
var gvk *GroupVersionKind
if strings.Count(arg, ".") >= 2 {
s := strings.SplitN(arg, ".", 3)
gvk = &GroupVersionKind{Group: s[2], Version: s[1], Kind: s[0]}
}
return gvk, ParseGroupKind(arg)
} | go | func ParseKindArg(arg string) (*GroupVersionKind, GroupKind) {
var gvk *GroupVersionKind
if strings.Count(arg, ".") >= 2 {
s := strings.SplitN(arg, ".", 3)
gvk = &GroupVersionKind{Group: s[2], Version: s[1], Kind: s[0]}
}
return gvk, ParseGroupKind(arg)
} | [
"func",
"ParseKindArg",
"(",
"arg",
"string",
")",
"(",
"*",
"GroupVersionKind",
",",
"GroupKind",
")",
"{",
"var",
"gvk",
"*",
"GroupVersionKind",
"\n",
"if",
"strings",
".",
"Count",
"(",
"arg",
",",
"\"",
"\"",
")",
">=",
"2",
"{",
"s",
":=",
"str... | // ParseKindArg takes the common style of string which may be either `Kind.group.com` or `Kind.version.group.com`
// and parses it out into both possibilities. This code takes no responsibility for knowing which representation was intended
// but with a knowledge of all GroupKinds, calling code can take a very good gue... | [
"ParseKindArg",
"takes",
"the",
"common",
"style",
"of",
"string",
"which",
"may",
"be",
"either",
"Kind",
".",
"group",
".",
"com",
"or",
"Kind",
".",
"version",
".",
"group",
".",
"com",
"and",
"parses",
"it",
"out",
"into",
"both",
"possibilities",
".... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apimachinery/pkg/runtime/schema/group_version.go#L44-L52 | train | ParseKindArg parses a KindArg string into a KindArg struct. | [
30522,
4569,
2278,
11968,
3366,
18824,
2906,
2290,
1006,
12098,
2290,
5164,
1007,
1006,
1008,
2177,
27774,
18824,
1010,
2177,
18824,
1007,
1063,
13075,
1043,
2615,
2243,
1008,
2177,
27774,
18824,
2065,
7817,
1012,
4175,
1006,
12098,
2290,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubectl/scheme/scheme.go | DefaultJSONEncoder | func DefaultJSONEncoder() runtime.Encoder {
return unstructured.JSONFallbackEncoder{Encoder: Codecs.LegacyCodec(Scheme.PrioritizedVersionsAllGroups()...)}
} | go | func DefaultJSONEncoder() runtime.Encoder {
return unstructured.JSONFallbackEncoder{Encoder: Codecs.LegacyCodec(Scheme.PrioritizedVersionsAllGroups()...)}
} | [
"func",
"DefaultJSONEncoder",
"(",
")",
"runtime",
".",
"Encoder",
"{",
"return",
"unstructured",
".",
"JSONFallbackEncoder",
"{",
"Encoder",
":",
"Codecs",
".",
"LegacyCodec",
"(",
"Scheme",
".",
"PrioritizedVersionsAllGroups",
"(",
")",
"...",
")",
"}",
"\n",
... | // DefaultJSONEncoder returns a default encoder for our scheme | [
"DefaultJSONEncoder",
"returns",
"a",
"default",
"encoder",
"for",
"our",
"scheme"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/scheme/scheme.go#L37-L39 | train | DefaultJSONEncoder returns a JSON encoder that uses the default JSON encoder. | [
30522,
4569,
2278,
12398,
22578,
5643,
15305,
4063,
1006,
1007,
2448,
7292,
1012,
4372,
16044,
2099,
1063,
2709,
4895,
3367,
26134,
1012,
1046,
3385,
13976,
5963,
2368,
16044,
2099,
1063,
4372,
16044,
2099,
1024,
3642,
6169,
1012,
8027,
160... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apiserver/pkg/registry/rest/update.go | validateCommonFields | func validateCommonFields(obj, old runtime.Object, strategy RESTUpdateStrategy) (field.ErrorList, error) {
allErrs := field.ErrorList{}
objectMeta, err := meta.Accessor(obj)
if err != nil {
return nil, fmt.Errorf("failed to get new object metadata: %v", err)
}
oldObjectMeta, err := meta.Accessor(old)
if err != ... | go | func validateCommonFields(obj, old runtime.Object, strategy RESTUpdateStrategy) (field.ErrorList, error) {
allErrs := field.ErrorList{}
objectMeta, err := meta.Accessor(obj)
if err != nil {
return nil, fmt.Errorf("failed to get new object metadata: %v", err)
}
oldObjectMeta, err := meta.Accessor(old)
if err != ... | [
"func",
"validateCommonFields",
"(",
"obj",
",",
"old",
"runtime",
".",
"Object",
",",
"strategy",
"RESTUpdateStrategy",
")",
"(",
"field",
".",
"ErrorList",
",",
"error",
")",
"{",
"allErrs",
":=",
"field",
".",
"ErrorList",
"{",
"}",
"\n",
"objectMeta",
... | // TODO: add other common fields that require global validation. | [
"TODO",
":",
"add",
"other",
"common",
"fields",
"that",
"require",
"global",
"validation",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/registry/rest/update.go#L67-L81 | train | validateCommonFields validates the common fields of the object and old object. | [
30522,
4569,
2278,
9398,
3686,
9006,
8202,
15155,
1006,
27885,
3501,
1010,
2214,
2448,
7292,
1012,
4874,
1010,
5656,
2717,
6279,
27122,
6494,
30524,
2065,
9413,
2099,
999,
1027,
9152,
2140,
1063,
2709,
9152,
2140,
1010,
4718,
2102,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/volume/util/util.go | MountOptionFromSpec | func MountOptionFromSpec(spec *volume.Spec, options ...string) []string {
pv := spec.PersistentVolume
if pv != nil {
// Use beta annotation first
if mo, ok := pv.Annotations[v1.MountOptionAnnotation]; ok {
moList := strings.Split(mo, ",")
return JoinMountOptions(moList, options)
}
if len(pv.Spec.Mount... | go | func MountOptionFromSpec(spec *volume.Spec, options ...string) []string {
pv := spec.PersistentVolume
if pv != nil {
// Use beta annotation first
if mo, ok := pv.Annotations[v1.MountOptionAnnotation]; ok {
moList := strings.Split(mo, ",")
return JoinMountOptions(moList, options)
}
if len(pv.Spec.Mount... | [
"func",
"MountOptionFromSpec",
"(",
"spec",
"*",
"volume",
".",
"Spec",
",",
"options",
"...",
"string",
")",
"[",
"]",
"string",
"{",
"pv",
":=",
"spec",
".",
"PersistentVolume",
"\n\n",
"if",
"pv",
"!=",
"nil",
"{",
"// Use beta annotation first",
"if",
... | // MountOptionFromSpec extracts and joins mount options from volume spec with supplied options | [
"MountOptionFromSpec",
"extracts",
"and",
"joins",
"mount",
"options",
"from",
"volume",
"spec",
"with",
"supplied",
"options"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/util/util.go#L259-L275 | train | MountOptionFromSpec returns a slice of mount options from a volume. Spec | [
30522,
4569,
2278,
4057,
7361,
3508,
19699,
22225,
5051,
2278,
1006,
28699,
1008,
3872,
1012,
28699,
1010,
7047,
1012,
1012,
1012,
5164,
1007,
1031,
1033,
5164,
1063,
26189,
1024,
1027,
28699,
1012,
14516,
6767,
12942,
2063,
2065,
26189,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubectl/explain/model_printer.go | PrintModel | func PrintModel(name string, writer *Formatter, builder fieldsPrinterBuilder, schema proto.Schema, gvk schema.GroupVersionKind) error {
m := &modelPrinter{Name: name, Writer: writer, Builder: builder, GVK: gvk}
schema.Accept(m)
return m.Error
} | go | func PrintModel(name string, writer *Formatter, builder fieldsPrinterBuilder, schema proto.Schema, gvk schema.GroupVersionKind) error {
m := &modelPrinter{Name: name, Writer: writer, Builder: builder, GVK: gvk}
schema.Accept(m)
return m.Error
} | [
"func",
"PrintModel",
"(",
"name",
"string",
",",
"writer",
"*",
"Formatter",
",",
"builder",
"fieldsPrinterBuilder",
",",
"schema",
"proto",
".",
"Schema",
",",
"gvk",
"schema",
".",
"GroupVersionKind",
")",
"error",
"{",
"m",
":=",
"&",
"modelPrinter",
"{"... | // PrintModel prints the description of a schema in writer. | [
"PrintModel",
"prints",
"the",
"description",
"of",
"a",
"schema",
"in",
"writer",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/explain/model_printer.go#L159-L163 | train | PrintModel prints a model to writer. | [
30522,
4569,
2278,
6140,
5302,
9247,
1006,
2171,
5164,
1010,
3213,
1008,
4289,
3334,
1010,
12508,
4249,
16550,
2121,
8569,
23891,
2099,
1010,
8040,
28433,
15053,
1012,
8040,
28433,
1010,
1043,
2615,
2243,
8040,
28433,
1012,
2177,
27774,
188... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go | DeepCopy | func (in *ObjectMeta) DeepCopy() *ObjectMeta {
if in == nil {
return nil
}
out := new(ObjectMeta)
in.DeepCopyInto(out)
return out
} | go | func (in *ObjectMeta) DeepCopy() *ObjectMeta {
if in == nil {
return nil
}
out := new(ObjectMeta)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"ObjectMeta",
")",
"DeepCopy",
"(",
")",
"*",
"ObjectMeta",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ObjectMeta",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"ObjectMeta",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go#L740-L747 | train | DeepCopy is an autogenerated deepcopy function copying the receiver creating a new ObjectMeta. | [
30522,
4569,
2278,
1006,
1999,
1008,
4874,
11368,
2050,
1007,
2784,
3597,
7685,
1006,
1007,
1008,
4874,
11368,
2050,
1063,
2065,
1999,
1027,
1027,
9152,
2140,
1063,
2709,
9152,
2140,
1065,
2041,
1024,
1027,
2047,
1006,
4874,
11368,
2050,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubelet/dockershim/docker_container_windows.go | copyGMSACredSpecToRegistryValue | func copyGMSACredSpecToRegistryValue(credSpec string) (string, error) {
valueName, err := gMSARegistryValueName()
if err != nil {
return "", err
}
// write to the registry
key, _, err := registryCreateKeyFunc(registry.LOCAL_MACHINE, credentialSpecRegistryLocation, registry.SET_VALUE)
if err != nil {
return "... | go | func copyGMSACredSpecToRegistryValue(credSpec string) (string, error) {
valueName, err := gMSARegistryValueName()
if err != nil {
return "", err
}
// write to the registry
key, _, err := registryCreateKeyFunc(registry.LOCAL_MACHINE, credentialSpecRegistryLocation, registry.SET_VALUE)
if err != nil {
return "... | [
"func",
"copyGMSACredSpecToRegistryValue",
"(",
"credSpec",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"valueName",
",",
"err",
":=",
"gMSARegistryValueName",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",... | // copyGMSACredSpecToRegistryKey copies the credential specs to a unique registry value, and returns its name. | [
"copyGMSACredSpecToRegistryKey",
"copies",
"the",
"credential",
"specs",
"to",
"a",
"unique",
"registry",
"value",
"and",
"returns",
"its",
"name",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/dockershim/docker_container_windows.go#L118-L135 | train | copyGMSACredSpecToRegistryValue copies the credential spec to the registry value | [
30522,
4569,
2278,
6100,
21693,
3736,
16748,
5104,
5051,
16761,
13910,
2923,
2854,
10175,
5657,
1006,
13675,
2098,
13102,
8586,
5164,
1007,
1006,
5164,
1010,
7561,
1007,
1063,
3643,
18442,
1010,
9413,
2099,
1024,
1027,
13938,
10286,
13910,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/core/validation/validation.go | validatePreferAvoidPodsEntry | func validatePreferAvoidPodsEntry(avoidPodEntry core.PreferAvoidPodsEntry, fldPath *field.Path) field.ErrorList {
allErrors := field.ErrorList{}
if avoidPodEntry.PodSignature.PodController == nil {
allErrors = append(allErrors, field.Required(fldPath.Child("PodSignature"), ""))
} else {
if *(avoidPodEntry.PodSig... | go | func validatePreferAvoidPodsEntry(avoidPodEntry core.PreferAvoidPodsEntry, fldPath *field.Path) field.ErrorList {
allErrors := field.ErrorList{}
if avoidPodEntry.PodSignature.PodController == nil {
allErrors = append(allErrors, field.Required(fldPath.Child("PodSignature"), ""))
} else {
if *(avoidPodEntry.PodSig... | [
"func",
"validatePreferAvoidPodsEntry",
"(",
"avoidPodEntry",
"core",
".",
"PreferAvoidPodsEntry",
",",
"fldPath",
"*",
"field",
".",
"Path",
")",
"field",
".",
"ErrorList",
"{",
"allErrors",
":=",
"field",
".",
"ErrorList",
"{",
"}",
"\n",
"if",
"avoidPodEntry"... | // validatePreferAvoidPodsEntry tests if given PreferAvoidPodsEntry has valid data. | [
"validatePreferAvoidPodsEntry",
"tests",
"if",
"given",
"PreferAvoidPodsEntry",
"has",
"valid",
"data",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/core/validation/validation.go#L3184-L3196 | train | validatePreferAvoidPodsEntry validates a preferAvoidPodsEntry | [
30522,
4569,
2278,
9398,
3686,
28139,
27709,
6767,
3593,
22925,
4765,
2854,
1006,
4468,
27633,
4765,
2854,
4563,
1012,
9544,
11431,
9314,
22925,
4765,
2854,
1010,
13109,
18927,
8988,
1008,
2492,
1012,
4130,
1007,
2492,
1012,
7561,
9863,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go | subjectAccessReviewInterfaceFromKubeconfig | func subjectAccessReviewInterfaceFromKubeconfig(kubeConfigFile string) (authorizationclient.SubjectAccessReviewInterface, error) {
localScheme := runtime.NewScheme()
if err := scheme.AddToScheme(localScheme); err != nil {
return nil, err
}
if err := localScheme.SetVersionPriority(groupVersions...); err != nil {
... | go | func subjectAccessReviewInterfaceFromKubeconfig(kubeConfigFile string) (authorizationclient.SubjectAccessReviewInterface, error) {
localScheme := runtime.NewScheme()
if err := scheme.AddToScheme(localScheme); err != nil {
return nil, err
}
if err := localScheme.SetVersionPriority(groupVersions...); err != nil {
... | [
"func",
"subjectAccessReviewInterfaceFromKubeconfig",
"(",
"kubeConfigFile",
"string",
")",
"(",
"authorizationclient",
".",
"SubjectAccessReviewInterface",
",",
"error",
")",
"{",
"localScheme",
":=",
"runtime",
".",
"NewScheme",
"(",
")",
"\n",
"if",
"err",
":=",
... | // subjectAccessReviewInterfaceFromKubeconfig builds a client from the specified kubeconfig file,
// and returns a SubjectAccessReviewInterface that uses that client. Note that the client submits SubjectAccessReview
// requests to the exact path specified in the kubeconfig file, so arbitrary non-API servers can be targ... | [
"subjectAccessReviewInterfaceFromKubeconfig",
"builds",
"a",
"client",
"from",
"the",
"specified",
"kubeconfig",
"file",
"and",
"returns",
"a",
"SubjectAccessReviewInterface",
"that",
"uses",
"that",
"client",
".",
"Note",
"that",
"the",
"client",
"submits",
"SubjectAcc... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go#L246-L260 | train | subjectAccessReviewInterfaceFromKubeconfig returns a subjectAccessReviewInterface from a Kubernetes config file | [
30522,
4569,
2278,
3395,
6305,
9623,
21338,
6777,
2666,
10105,
3334,
12172,
19699,
5358,
5283,
4783,
8663,
8873,
2290,
1006,
13970,
4783,
8663,
8873,
25708,
9463,
30524,
1027,
5679,
1012,
5587,
13122,
5403,
4168,
1006,
10575,
5403,
4168,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go | Get | func (c *FakeSecrets) Get(name string, options v1.GetOptions) (result *corev1.Secret, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(secretsResource, c.ns, name), &corev1.Secret{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Secret), err
} | go | func (c *FakeSecrets) Get(name string, options v1.GetOptions) (result *corev1.Secret, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(secretsResource, c.ns, name), &corev1.Secret{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Secret), err
} | [
"func",
"(",
"c",
"*",
"FakeSecrets",
")",
"Get",
"(",
"name",
"string",
",",
"options",
"v1",
".",
"GetOptions",
")",
"(",
"result",
"*",
"corev1",
".",
"Secret",
",",
"err",
"error",
")",
"{",
"obj",
",",
"err",
":=",
"c",
".",
"Fake",
".",
"In... | // Get takes name of the secret, and returns the corresponding secret object, and an error if there is any. | [
"Get",
"takes",
"name",
"of",
"the",
"secret",
"and",
"returns",
"the",
"corresponding",
"secret",
"object",
"and",
"an",
"error",
"if",
"there",
"is",
"any",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go#L42-L50 | train | Get takes name of the secret and returns the corresponding secret object and an error if there is any. | [
30522,
4569,
2278,
1006,
1039,
1008,
8275,
3366,
16748,
3215,
1007,
2131,
1006,
2171,
5164,
1010,
7047,
1058,
2487,
1012,
2131,
7361,
9285,
1007,
1006,
2765,
1008,
4563,
2615,
2487,
1012,
3595,
1010,
9413,
2099,
7561,
1007,
1063,
27885,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/apps/v1/zz_generated.conversion.go | Convert_v1_ControllerRevision_To_apps_ControllerRevision | func Convert_v1_ControllerRevision_To_apps_ControllerRevision(in *v1.ControllerRevision, out *apps.ControllerRevision, s conversion.Scope) error {
return autoConvert_v1_ControllerRevision_To_apps_ControllerRevision(in, out, s)
} | go | func Convert_v1_ControllerRevision_To_apps_ControllerRevision(in *v1.ControllerRevision, out *apps.ControllerRevision, s conversion.Scope) error {
return autoConvert_v1_ControllerRevision_To_apps_ControllerRevision(in, out, s)
} | [
"func",
"Convert_v1_ControllerRevision_To_apps_ControllerRevision",
"(",
"in",
"*",
"v1",
".",
"ControllerRevision",
",",
"out",
"*",
"apps",
".",
"ControllerRevision",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_v1_ControllerRevision... | // Convert_v1_ControllerRevision_To_apps_ControllerRevision is an autogenerated conversion function. | [
"Convert_v1_ControllerRevision_To_apps_ControllerRevision",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/apps/v1/zz_generated.conversion.go#L456-L458 | train | Convert_v1_ControllerRevision_To_apps_ControllerRevision is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
1058,
2487,
1035,
11486,
2890,
17084,
1035,
2000,
1035,
18726,
1035,
11486,
2890,
17084,
1006,
1999,
1008,
1058,
2487,
1012,
11486,
2890,
17084,
1010,
2041,
1008,
18726,
1012,
11486,
2890,
17084,
1010,
1055,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/apis/core/zz_generated.deepcopy.go | DeepCopyInto | func (in *ContainerStateTerminated) DeepCopyInto(out *ContainerStateTerminated) {
*out = *in
in.StartedAt.DeepCopyInto(&out.StartedAt)
in.FinishedAt.DeepCopyInto(&out.FinishedAt)
return
} | go | func (in *ContainerStateTerminated) DeepCopyInto(out *ContainerStateTerminated) {
*out = *in
in.StartedAt.DeepCopyInto(&out.StartedAt)
in.FinishedAt.DeepCopyInto(&out.FinishedAt)
return
} | [
"func",
"(",
"in",
"*",
"ContainerStateTerminated",
")",
"DeepCopyInto",
"(",
"out",
"*",
"ContainerStateTerminated",
")",
"{",
"*",
"out",
"=",
"*",
"in",
"\n",
"in",
".",
"StartedAt",
".",
"DeepCopyInto",
"(",
"&",
"out",
".",
"StartedAt",
")",
"\n",
"... | // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"DeepCopyInto",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"writing",
"into",
"out",
".",
"in",
"must",
"be",
"non",
"-",
"nil",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/core/zz_generated.deepcopy.go#L880-L885 | train | DeepCopyInto is an autogenerated deepcopy function copying the receiver setting the receiver to the receiver. | [
30522,
4569,
2278,
1006,
1999,
1008,
16143,
12259,
3334,
26972,
1007,
2784,
3597,
7685,
18447,
2080,
1006,
2041,
1008,
16143,
12259,
3334,
26972,
1007,
1063,
1008,
2041,
1027,
1008,
1999,
1999,
1012,
2318,
4017,
1012,
2784,
3597,
7685,
1844... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubectl/cmd/set/set_resources.go | NewCmdResources | func NewCmdResources(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {
o := NewResourcesOptions(streams)
cmd := &cobra.Command{
Use: "resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS]",
DisableFlagsInUseLine: true,
Short: i18n... | go | func NewCmdResources(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {
o := NewResourcesOptions(streams)
cmd := &cobra.Command{
Use: "resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS]",
DisableFlagsInUseLine: true,
Short: i18n... | [
"func",
"NewCmdResources",
"(",
"f",
"cmdutil",
".",
"Factory",
",",
"streams",
"genericclioptions",
".",
"IOStreams",
")",
"*",
"cobra",
".",
"Command",
"{",
"o",
":=",
"NewResourcesOptions",
"(",
"streams",
")",
"\n\n",
"cmd",
":=",
"&",
"cobra",
".",
"C... | // NewCmdResources returns initialized Command instance for the 'set resources' sub command | [
"NewCmdResources",
"returns",
"initialized",
"Command",
"instance",
"for",
"the",
"set",
"resources",
"sub",
"command"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/cmd/set/set_resources.go#L108-L140 | train | NewCmdResources returns a command to get a list of resources | [
30522,
4569,
2278,
2047,
27487,
16200,
6499,
3126,
9623,
1006,
1042,
4642,
8566,
3775,
2140,
1012,
4713,
1010,
9199,
12391,
20464,
3695,
16790,
2015,
1012,
16380,
25379,
2015,
1007,
1008,
16604,
1012,
3094,
1063,
1051,
1024,
1027,
2047,
607... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go | DeepCopy | func (in *Policy) DeepCopy() *Policy {
if in == nil {
return nil
}
out := new(Policy)
in.DeepCopyInto(out)
return out
} | go | func (in *Policy) DeepCopy() *Policy {
if in == nil {
return nil
}
out := new(Policy)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"Policy",
")",
"DeepCopy",
"(",
")",
"*",
"Policy",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"Policy",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",
"re... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"Policy",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go#L209-L216 | train | DeepCopy is an autogenerated deepcopy function copying the receiver creating a new Policy. | [
30522,
4569,
2278,
1006,
1999,
1008,
3343,
1007,
2784,
3597,
7685,
1006,
1007,
1008,
3343,
1063,
2065,
1999,
1027,
1027,
9152,
2140,
1063,
2709,
9152,
2140,
1065,
2041,
1024,
1027,
2047,
1006,
3343,
1007,
1999,
1012,
2784,
3597,
7685,
184... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/client-go/rest/watch/decoder.go | NewDecoder | func NewDecoder(decoder streaming.Decoder, embeddedDecoder runtime.Decoder) *Decoder {
return &Decoder{
decoder: decoder,
embeddedDecoder: embeddedDecoder,
}
} | go | func NewDecoder(decoder streaming.Decoder, embeddedDecoder runtime.Decoder) *Decoder {
return &Decoder{
decoder: decoder,
embeddedDecoder: embeddedDecoder,
}
} | [
"func",
"NewDecoder",
"(",
"decoder",
"streaming",
".",
"Decoder",
",",
"embeddedDecoder",
"runtime",
".",
"Decoder",
")",
"*",
"Decoder",
"{",
"return",
"&",
"Decoder",
"{",
"decoder",
":",
"decoder",
",",
"embeddedDecoder",
":",
"embeddedDecoder",
",",
"}",
... | // NewDecoder creates an Decoder for the given writer and codec. | [
"NewDecoder",
"creates",
"an",
"Decoder",
"for",
"the",
"given",
"writer",
"and",
"codec",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/rest/watch/decoder.go#L38-L43 | train | NewDecoder returns a new decoder that can be used to decode a collection of documents. | [
30522,
4569,
2278,
2047,
3207,
16044,
2099,
1006,
21933,
4063,
11058,
1012,
21933,
4063,
1010,
11157,
3207,
16044,
2099,
2448,
7292,
1012,
21933,
4063,
1007,
1008,
21933,
4063,
1063,
2709,
1004,
21933,
4063,
1063,
21933,
4063,
1024,
21933,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/volume/azure_file/azure_file.go | SetUp | func (b *azureFileMounter) SetUp(fsGroup *int64) error {
return b.SetUpAt(b.GetPath(), fsGroup)
} | go | func (b *azureFileMounter) SetUp(fsGroup *int64) error {
return b.SetUpAt(b.GetPath(), fsGroup)
} | [
"func",
"(",
"b",
"*",
"azureFileMounter",
")",
"SetUp",
"(",
"fsGroup",
"*",
"int64",
")",
"error",
"{",
"return",
"b",
".",
"SetUpAt",
"(",
"b",
".",
"GetPath",
"(",
")",
",",
"fsGroup",
")",
"\n",
"}"
] | // SetUp attaches the disk and bind mounts to the volume path. | [
"SetUp",
"attaches",
"the",
"disk",
"and",
"bind",
"mounts",
"to",
"the",
"volume",
"path",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/azure_file/azure_file.go#L239-L241 | train | SetUp sets up the filesystem. | [
30522,
4569,
2278,
1006,
1038,
1008,
24296,
8873,
16930,
21723,
2121,
1007,
16437,
1006,
1042,
28745,
22107,
1008,
20014,
21084,
1007,
7561,
1063,
2709,
1038,
1012,
16437,
4017,
1006,
1038,
1012,
2131,
15069,
1006,
1007,
1010,
1042,
28745,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubelet/server/portforward/httpstream.go | requestID | func (h *httpStreamHandler) requestID(stream httpstream.Stream) string {
requestID := stream.Headers().Get(api.PortForwardRequestIDHeader)
if len(requestID) == 0 {
klog.V(5).Infof("(conn=%p) stream received without %s header", h.conn, api.PortForwardRequestIDHeader)
// If we get here, it's because the connection ... | go | func (h *httpStreamHandler) requestID(stream httpstream.Stream) string {
requestID := stream.Headers().Get(api.PortForwardRequestIDHeader)
if len(requestID) == 0 {
klog.V(5).Infof("(conn=%p) stream received without %s header", h.conn, api.PortForwardRequestIDHeader)
// If we get here, it's because the connection ... | [
"func",
"(",
"h",
"*",
"httpStreamHandler",
")",
"requestID",
"(",
"stream",
"httpstream",
".",
"Stream",
")",
"string",
"{",
"requestID",
":=",
"stream",
".",
"Headers",
"(",
")",
".",
"Get",
"(",
"api",
".",
"PortForwardRequestIDHeader",
")",
"\n",
"if",... | // requestID returns the request id for stream. | [
"requestID",
"returns",
"the",
"request",
"id",
"for",
"stream",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/server/portforward/httpstream.go#L170-L203 | train | requestID returns the request ID for the given stream. | [
30522,
4569,
2278,
1006,
1044,
1008,
16770,
25379,
11774,
3917,
1007,
5227,
3593,
1006,
5460,
16770,
25379,
1012,
5460,
1007,
5164,
1063,
5227,
3593,
1024,
1027,
5460,
1012,
20346,
2015,
1006,
1007,
1012,
2131,
1006,
17928,
1012,
3417,
2927... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go | VerifyVolumePathsForVM | func VerifyVolumePathsForVM(vmMo mo.VirtualMachine, volPaths []string, nodeName string, nodeVolumeMap map[string]map[string]bool) {
// Verify if the volume paths are present on the VM backing virtual disk devices
vmDevices := object.VirtualDeviceList(vmMo.Config.Hardware.Device)
VerifyVolumePathsForVMDevices(vmDevic... | go | func VerifyVolumePathsForVM(vmMo mo.VirtualMachine, volPaths []string, nodeName string, nodeVolumeMap map[string]map[string]bool) {
// Verify if the volume paths are present on the VM backing virtual disk devices
vmDevices := object.VirtualDeviceList(vmMo.Config.Hardware.Device)
VerifyVolumePathsForVMDevices(vmDevic... | [
"func",
"VerifyVolumePathsForVM",
"(",
"vmMo",
"mo",
".",
"VirtualMachine",
",",
"volPaths",
"[",
"]",
"string",
",",
"nodeName",
"string",
",",
"nodeVolumeMap",
"map",
"[",
"string",
"]",
"map",
"[",
"string",
"]",
"bool",
")",
"{",
"// Verify if the volume p... | // VerifyVolumePathsForVM verifies if the volume paths (volPaths) are attached to VM. | [
"VerifyVolumePathsForVM",
"verifies",
"if",
"the",
"volume",
"paths",
"(",
"volPaths",
")",
"are",
"attached",
"to",
"VM",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go#L185-L190 | train | VerifyVolumePathsForVM verifies that the volume paths are present on the VM backing virtual disk | [
30522,
4569,
2278,
20410,
6767,
12942,
13699,
8988,
22747,
2953,
2615,
2213,
1006,
1058,
7382,
2080,
9587,
1012,
7484,
22911,
14014,
1010,
5285,
15069,
2015,
1031,
1033,
5164,
1010,
13045,
18442,
5164,
1010,
13045,
6767,
12942,
14545,
2361,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/volume/emptydir/empty_dir.go | getPageSizeMountOptionFromPod | func getPageSizeMountOptionFromPod(pod *v1.Pod) (string, error) {
pageSizeFound := false
pageSize := resource.Quantity{}
// In some rare cases init containers can also consume Huge pages.
containers := append(pod.Spec.Containers, pod.Spec.InitContainers...)
for _, container := range containers {
// We can take r... | go | func getPageSizeMountOptionFromPod(pod *v1.Pod) (string, error) {
pageSizeFound := false
pageSize := resource.Quantity{}
// In some rare cases init containers can also consume Huge pages.
containers := append(pod.Spec.Containers, pod.Spec.InitContainers...)
for _, container := range containers {
// We can take r... | [
"func",
"getPageSizeMountOptionFromPod",
"(",
"pod",
"*",
"v1",
".",
"Pod",
")",
"(",
"string",
",",
"error",
")",
"{",
"pageSizeFound",
":=",
"false",
"\n",
"pageSize",
":=",
"resource",
".",
"Quantity",
"{",
"}",
"\n",
"// In some rare cases init containers ca... | // getPageSizeMountOptionFromPod retrieves pageSize mount option from Pod's resources
// and validates pageSize options in all containers of given Pod. | [
"getPageSizeMountOptionFromPod",
"retrieves",
"pageSize",
"mount",
"option",
"from",
"Pod",
"s",
"resources",
"and",
"validates",
"pageSize",
"options",
"in",
"all",
"containers",
"of",
"given",
"Pod",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/emptydir/empty_dir.go#L294-L323 | train | getPageSizeMountOptionFromPod returns the mount option for the page size of the pod. | [
30522,
4569,
2278,
2131,
13704,
5332,
4371,
20048,
7361,
3508,
19699,
25377,
7716,
1006,
17491,
1008,
1058,
2487,
1012,
17491,
1007,
1006,
5164,
1010,
7561,
1007,
1063,
5530,
4697,
14876,
8630,
1024,
1027,
6270,
5530,
4697,
30524,
17491,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go | DeepCopy | func (in *GroupResources) DeepCopy() *GroupResources {
if in == nil {
return nil
}
out := new(GroupResources)
in.DeepCopyInto(out)
return out
} | go | func (in *GroupResources) DeepCopy() *GroupResources {
if in == nil {
return nil
}
out := new(GroupResources)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"GroupResources",
")",
"DeepCopy",
"(",
")",
"*",
"GroupResources",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"GroupResources",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"ou... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupResources. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"GroupResources",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go#L163-L170 | train | DeepCopy is an autogenerated deepcopy function copying the receiver creating a new GroupResources. | [
30522,
4569,
2278,
1006,
1999,
1008,
2177,
6072,
8162,
9623,
1007,
2784,
3597,
7685,
1006,
1007,
1008,
2177,
6072,
8162,
9623,
1063,
2065,
1999,
1027,
1027,
9152,
2140,
1063,
2709,
9152,
2140,
1065,
2041,
1024,
1027,
2047,
1006,
2177,
607... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apiserver/pkg/storage/etcd3/lease_manager.go | newLeaseManager | func newLeaseManager(client *clientv3.Client, leaseReuseDurationSeconds int64, leaseReuseDurationPercent float64) *leaseManager {
return &leaseManager{
client: client,
leaseReuseDurationSeconds: leaseReuseDurationSeconds,
leaseReuseDurationPercent: leaseReuseDurationPercent,
}
} | go | func newLeaseManager(client *clientv3.Client, leaseReuseDurationSeconds int64, leaseReuseDurationPercent float64) *leaseManager {
return &leaseManager{
client: client,
leaseReuseDurationSeconds: leaseReuseDurationSeconds,
leaseReuseDurationPercent: leaseReuseDurationPercent,
}
} | [
"func",
"newLeaseManager",
"(",
"client",
"*",
"clientv3",
".",
"Client",
",",
"leaseReuseDurationSeconds",
"int64",
",",
"leaseReuseDurationPercent",
"float64",
")",
"*",
"leaseManager",
"{",
"return",
"&",
"leaseManager",
"{",
"client",
":",
"client",
",",
"leas... | // newLeaseManager creates a new lease manager with the number of buffered
// leases, lease reuse duration in seconds and percentage. The percentage
// value x means x*100%. | [
"newLeaseManager",
"creates",
"a",
"new",
"lease",
"manager",
"with",
"the",
"number",
"of",
"buffered",
"leases",
"lease",
"reuse",
"duration",
"in",
"seconds",
"and",
"percentage",
".",
"The",
"percentage",
"value",
"x",
"means",
"x",
"*",
"100%",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/storage/etcd3/lease_manager.go#L52-L58 | train | newLeaseManager returns a new leaseManager | [
30522,
4569,
2278,
2047,
19738,
3366,
24805,
4590,
1006,
7396,
1008,
7396,
2615,
2509,
1012,
7396,
1010,
10084,
23446,
2098,
18924,
3366,
8663,
5104,
20014,
21084,
1010,
10084,
23446,
2098,
18924,
4842,
13013,
14257,
21084,
1007,
1008,
10084,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/kubectl/cmd/cmd.go | HandlePluginCommand | func HandlePluginCommand(pluginHandler PluginHandler, cmdArgs []string) error {
remainingArgs := []string{} // all "non-flag" arguments
for idx := range cmdArgs {
if strings.HasPrefix(cmdArgs[idx], "-") {
break
}
remainingArgs = append(remainingArgs, strings.Replace(cmdArgs[idx], "-", "_", -1))
}
foundBi... | go | func HandlePluginCommand(pluginHandler PluginHandler, cmdArgs []string) error {
remainingArgs := []string{} // all "non-flag" arguments
for idx := range cmdArgs {
if strings.HasPrefix(cmdArgs[idx], "-") {
break
}
remainingArgs = append(remainingArgs, strings.Replace(cmdArgs[idx], "-", "_", -1))
}
foundBi... | [
"func",
"HandlePluginCommand",
"(",
"pluginHandler",
"PluginHandler",
",",
"cmdArgs",
"[",
"]",
"string",
")",
"error",
"{",
"remainingArgs",
":=",
"[",
"]",
"string",
"{",
"}",
"// all \"non-flag\" arguments",
"\n\n",
"for",
"idx",
":=",
"range",
"cmdArgs",
"{"... | // HandlePluginCommand receives a pluginHandler and command-line arguments and attempts to find
// a plugin executable on the PATH that satisfies the given arguments. | [
"HandlePluginCommand",
"receives",
"a",
"pluginHandler",
"and",
"command",
"-",
"line",
"arguments",
"and",
"attempts",
"to",
"find",
"a",
"plugin",
"executable",
"on",
"the",
"PATH",
"that",
"satisfies",
"the",
"given",
"arguments",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/cmd/cmd.go#L372-L408 | train | HandlePluginCommand handles the given command. | [
30522,
4569,
2278,
5047,
24759,
15916,
2378,
9006,
2386,
2094,
1006,
13354,
2378,
11774,
3917,
13354,
2378,
11774,
3917,
1010,
4642,
7662,
5620,
1031,
1033,
5164,
1007,
7561,
1063,
3588,
2906,
5620,
1024,
1027,
1031,
1033,
5164,
1063,
1065,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/kubelet/config/v1beta1/zz_generated.deepcopy.go | DeepCopyInto | func (in *KubeletConfiguration) DeepCopyInto(out *KubeletConfiguration) {
*out = *in
out.TypeMeta = in.TypeMeta
out.SyncFrequency = in.SyncFrequency
out.FileCheckFrequency = in.FileCheckFrequency
out.HTTPCheckFrequency = in.HTTPCheckFrequency
if in.StaticPodURLHeader != nil {
in, out := &in.StaticPodURLHeader, ... | go | func (in *KubeletConfiguration) DeepCopyInto(out *KubeletConfiguration) {
*out = *in
out.TypeMeta = in.TypeMeta
out.SyncFrequency = in.SyncFrequency
out.FileCheckFrequency = in.FileCheckFrequency
out.HTTPCheckFrequency = in.HTTPCheckFrequency
if in.StaticPodURLHeader != nil {
in, out := &in.StaticPodURLHeader, ... | [
"func",
"(",
"in",
"*",
"KubeletConfiguration",
")",
"DeepCopyInto",
"(",
"out",
"*",
"KubeletConfiguration",
")",
"{",
"*",
"out",
"=",
"*",
"in",
"\n",
"out",
".",
"TypeMeta",
"=",
"in",
".",
"TypeMeta",
"\n",
"out",
".",
"SyncFrequency",
"=",
"in",
... | // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"DeepCopyInto",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"writing",
"into",
"out",
".",
"in",
"must",
"be",
"non",
"-",
"nil",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/kubelet/config/v1beta1/zz_generated.deepcopy.go#L86-L284 | train | DeepCopyInto is an autogenerated deepcopy function copying the receiver creating a new KubeletConfiguration. | [
30522,
4569,
2278,
1006,
1999,
1008,
13970,
8671,
3388,
8663,
8873,
27390,
3370,
1007,
2784,
3597,
7685,
18447,
2080,
1006,
2041,
1008,
13970,
8671,
3388,
8663,
8873,
27390,
3370,
1007,
1063,
1008,
2041,
1027,
1008,
1999,
2041,
1012,
2828,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go | DeepCopyInto | func (in *Table) DeepCopyInto(out *Table) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.ColumnDefinitions != nil {
in, out := &in.ColumnDefinitions, &out.ColumnDefinitions
*out = make([]TableColumnDefinition, len(*in))
copy(*out, *in)
}
if in.Rows != nil {
in, out := &in.Rows, &... | go | func (in *Table) DeepCopyInto(out *Table) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.ColumnDefinitions != nil {
in, out := &in.ColumnDefinitions, &out.ColumnDefinitions
*out = make([]TableColumnDefinition, len(*in))
copy(*out, *in)
}
if in.Rows != nil {
in, out := &in.Rows, &... | [
"func",
"(",
"in",
"*",
"Table",
")",
"DeepCopyInto",
"(",
"out",
"*",
"Table",
")",
"{",
"*",
"out",
"=",
"*",
"in",
"\n",
"out",
".",
"TypeMeta",
"=",
"in",
".",
"TypeMeta",
"\n",
"out",
".",
"ListMeta",
"=",
"in",
".",
"ListMeta",
"\n",
"if",
... | // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"DeepCopyInto",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"writing",
"into",
"out",
".",
"in",
"must",
"be",
"non",
"-",
"nil",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go#L1021-L1038 | train | DeepCopyInto is an autogenerated deepcopy function copying the receiver creating a new Table. | [
30522,
4569,
2278,
1006,
1999,
1008,
2795,
1007,
2784,
3597,
7685,
18447,
2080,
1006,
2041,
1008,
2795,
1007,
1063,
1008,
2041,
1027,
1008,
1999,
2041,
1012,
2828,
11368,
2050,
1027,
1999,
1012,
2828,
11368,
2050,
2041,
1012,
2862,
11368,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | pkg/scheduler/scheduler.go | New | func New(client clientset.Interface,
nodeInformer coreinformers.NodeInformer,
podInformer coreinformers.PodInformer,
pvInformer coreinformers.PersistentVolumeInformer,
pvcInformer coreinformers.PersistentVolumeClaimInformer,
replicationControllerInformer coreinformers.ReplicationControllerInformer,
replicaSetInfo... | go | func New(client clientset.Interface,
nodeInformer coreinformers.NodeInformer,
podInformer coreinformers.PodInformer,
pvInformer coreinformers.PersistentVolumeInformer,
pvcInformer coreinformers.PersistentVolumeClaimInformer,
replicationControllerInformer coreinformers.ReplicationControllerInformer,
replicaSetInfo... | [
"func",
"New",
"(",
"client",
"clientset",
".",
"Interface",
",",
"nodeInformer",
"coreinformers",
".",
"NodeInformer",
",",
"podInformer",
"coreinformers",
".",
"PodInformer",
",",
"pvInformer",
"coreinformers",
".",
"PersistentVolumeInformer",
",",
"pvcInformer",
"c... | // New returns a Scheduler | [
"New",
"returns",
"a",
"Scheduler"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/scheduler/scheduler.go#L121-L203 | train | New returns a new scheduler. | [
30522,
4569,
2278,
2047,
1006,
7396,
7846,
3388,
1012,
8278,
1010,
13045,
2378,
14192,
2121,
4563,
2378,
14192,
2545,
1012,
13045,
2378,
14192,
2121,
1010,
17491,
2378,
14192,
2121,
4563,
2378,
14192,
30524,
2121,
1010,
26189,
15459,
14192,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go | Watch | func (c *FakeControllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(controllerrevisionsResource, c.ns, opts))
} | go | func (c *FakeControllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(controllerrevisionsResource, c.ns, opts))
} | [
"func",
"(",
"c",
"*",
"FakeControllerRevisions",
")",
"Watch",
"(",
"opts",
"v1",
".",
"ListOptions",
")",
"(",
"watch",
".",
"Interface",
",",
"error",
")",
"{",
"return",
"c",
".",
"Fake",
".",
"InvokesWatch",
"(",
"testing",
".",
"NewWatchAction",
"(... | // Watch returns a watch.Interface that watches the requested controllerRevisions. | [
"Watch",
"returns",
"a",
"watch",
".",
"Interface",
"that",
"watches",
"the",
"requested",
"controllerRevisions",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go#L75-L79 | train | Watch returns a watch. Interface that watches the requested controllerRevisions. | [
30522,
4569,
2278,
1006,
1039,
1008,
8275,
8663,
13181,
10820,
2890,
17084,
2015,
1007,
3422,
1006,
23569,
2015,
1058,
2487,
1012,
2862,
7361,
9285,
1007,
1006,
3422,
1012,
8278,
1010,
7561,
1007,
1063,
2709,
1039,
1012,
8275,
1012,
1999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | staging/src/k8s.io/client-go/informers/apps/interface.go | V1beta2 | func (g *group) V1beta2() v1beta2.Interface {
return v1beta2.New(g.factory, g.namespace, g.tweakListOptions)
} | go | func (g *group) V1beta2() v1beta2.Interface {
return v1beta2.New(g.factory, g.namespace, g.tweakListOptions)
} | [
"func",
"(",
"g",
"*",
"group",
")",
"V1beta2",
"(",
")",
"v1beta2",
".",
"Interface",
"{",
"return",
"v1beta2",
".",
"New",
"(",
"g",
".",
"factory",
",",
"g",
".",
"namespace",
",",
"g",
".",
"tweakListOptions",
")",
"\n",
"}"
] | // V1beta2 returns a new v1beta2.Interface. | [
"V1beta2",
"returns",
"a",
"new",
"v1beta2",
".",
"Interface",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/informers/apps/interface.go#L60-L62 | train | V1beta2 returns a new v1beta2. Interface. | [
30522,
4569,
2278,
1006,
1043,
1008,
2177,
1007,
1058,
2487,
20915,
2050,
2475,
1006,
1007,
1058,
2487,
20915,
2050,
2475,
1012,
8278,
1063,
2709,
1058,
2487,
20915,
2050,
2475,
1012,
2047,
1006,
1043,
1012,
4713,
1010,
1043,
1012,
3415,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kubernetes/kubernetes | cmd/kubelet/app/server.go | buildKubeletClientConfig | func buildKubeletClientConfig(s *options.KubeletServer, nodeName types.NodeName) (*restclient.Config, func(), error) {
if s.RotateCertificates && utilfeature.DefaultFeatureGate.Enabled(features.RotateKubeletClientCertificate) {
// Rules for client rotation and the handling of kube config files:
//
// 1. If the c... | go | func buildKubeletClientConfig(s *options.KubeletServer, nodeName types.NodeName) (*restclient.Config, func(), error) {
if s.RotateCertificates && utilfeature.DefaultFeatureGate.Enabled(features.RotateKubeletClientCertificate) {
// Rules for client rotation and the handling of kube config files:
//
// 1. If the c... | [
"func",
"buildKubeletClientConfig",
"(",
"s",
"*",
"options",
".",
"KubeletServer",
",",
"nodeName",
"types",
".",
"NodeName",
")",
"(",
"*",
"restclient",
".",
"Config",
",",
"func",
"(",
")",
",",
"error",
")",
"{",
"if",
"s",
".",
"RotateCertificates",
... | // buildKubeletClientConfig constructs the appropriate client config for the kubelet depending on whether
// bootstrapping is enabled or client certificate rotation is enabled. | [
"buildKubeletClientConfig",
"constructs",
"the",
"appropriate",
"client",
"config",
"for",
"the",
"kubelet",
"depending",
"on",
"whether",
"bootstrapping",
"is",
"enabled",
"or",
"client",
"certificate",
"rotation",
"is",
"enabled",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubelet/app/server.go#L738-L807 | train | buildKubeletClientConfig creates a kubeconfig file for the kubelet server | [
30522,
4569,
2278,
3857,
5283,
8671,
3388,
20464,
11638,
8663,
8873,
2290,
1006,
1055,
1008,
7047,
1012,
13970,
8671,
8454,
2121,
6299,
1010,
13045,
18442,
4127,
1012,
13045,
18442,
1007,
1006,
1008,
2717,
20464,
11638,
1012,
9530,
8873,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.