repo stringclasses 1
value | path stringlengths 19 155 | func_name stringlengths 1 106 | original_string stringlengths 76 130k | language stringclasses 1
value | code stringlengths 76 130k | code_tokens sequencelengths 22 32.6k | docstring stringlengths 13 1.73k | docstring_tokens sequencelengths 1 316 | sha stringclasses 1
value | url stringlengths 114 252 | partition stringclasses 1
value | summary stringlengths 13 316 | input_ids sequencelengths 502 502 | token_type_ids sequencelengths 502 502 | attention_mask sequencelengths 502 502 | labels sequencelengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kubernetes/kubernetes | pkg/controller/serviceaccount/tokens_controller.go | ensureReferencedToken | func (e *TokensController) ensureReferencedToken(serviceAccount *v1.ServiceAccount) ( /* retry */ bool, error) {
if hasToken, err := e.hasReferencedToken(serviceAccount); err != nil {
// Don't retry cache lookup errors
return false, err
} else if hasToken {
// A service account token already exists, and is refe... | go | func (e *TokensController) ensureReferencedToken(serviceAccount *v1.ServiceAccount) ( /* retry */ bool, error) {
if hasToken, err := e.hasReferencedToken(serviceAccount); err != nil {
// Don't retry cache lookup errors
return false, err
} else if hasToken {
// A service account token already exists, and is refe... | [
"func",
"(",
"e",
"*",
"TokensController",
")",
"ensureReferencedToken",
"(",
"serviceAccount",
"*",
"v1",
".",
"ServiceAccount",
")",
"(",
"/* retry */",
"bool",
",",
"error",
")",
"{",
"if",
"hasToken",
",",
"err",
":=",
"e",
".",
"hasReferencedToken",
"("... | // ensureReferencedToken makes sure at least one ServiceAccountToken secret exists, and is included in the serviceAccount's Secrets list | [
"ensureReferencedToken",
"makes",
"sure",
"at",
"least",
"one",
"ServiceAccountToken",
"secret",
"exists",
"and",
"is",
"included",
"in",
"the",
"serviceAccount",
"s",
"Secrets",
"list"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/controller/serviceaccount/tokens_controller.go#L360-L477 | train | ensureReferencedToken ensures that the service account token is referenced by the service account. | [
30522,
4569,
2278,
1006,
1041,
1008,
19204,
9363,
3372,
26611,
1007,
5676,
2890,
25523,
11927,
11045,
2078,
1006,
2326,
6305,
3597,
16671,
1008,
1058,
2487,
1012,
2326,
6305,
3597,
16671,
1007,
1006,
1013,
1008,
2128,
11129,
1008,
1013,
220... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/apis/apiextensions/zz_generated.deepcopy.go | DeepCopy | func (in *CustomResourceSubresources) DeepCopy() *CustomResourceSubresources {
if in == nil {
return nil
}
out := new(CustomResourceSubresources)
in.DeepCopyInto(out)
return out
} | go | func (in *CustomResourceSubresources) DeepCopy() *CustomResourceSubresources {
if in == nil {
return nil
}
out := new(CustomResourceSubresources)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"CustomResourceSubresources",
")",
"DeepCopy",
"(",
")",
"*",
"CustomResourceSubresources",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"CustomResourceSubresources",
")",
"\n",
"in",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceSubresources. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"CustomResourceSubresources",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go#L331-L338 | train | DeepCopy is an autogenerated deepcopy function copying the receiver creating a new CustomResourceSubresources. | [
30522,
4569,
2278,
1006,
1999,
1008,
7661,
6072,
8162,
9623,
12083,
6072,
8162,
9623,
1007,
2784,
3597,
7685,
1006,
1007,
1008,
7661,
6072,
8162,
9623,
12083,
6072,
8162,
9623,
1063,
2065,
1999,
1027,
1027,
9152,
2140,
1063,
2709,
9152,
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 | cmd/kubeadm/app/cmd/reset.go | resetConfigDir | func resetConfigDir(configPathDir, pkiPathDir string) {
dirsToClean := []string{
filepath.Join(configPathDir, kubeadmconstants.ManifestsSubDirName),
pkiPathDir,
}
fmt.Printf("[reset] Deleting contents of config directories: %v\n", dirsToClean)
for _, dir := range dirsToClean {
if err := cleanDir(dir); err != ... | go | func resetConfigDir(configPathDir, pkiPathDir string) {
dirsToClean := []string{
filepath.Join(configPathDir, kubeadmconstants.ManifestsSubDirName),
pkiPathDir,
}
fmt.Printf("[reset] Deleting contents of config directories: %v\n", dirsToClean)
for _, dir := range dirsToClean {
if err := cleanDir(dir); err != ... | [
"func",
"resetConfigDir",
"(",
"configPathDir",
",",
"pkiPathDir",
"string",
")",
"{",
"dirsToClean",
":=",
"[",
"]",
"string",
"{",
"filepath",
".",
"Join",
"(",
"configPathDir",
",",
"kubeadmconstants",
".",
"ManifestsSubDirName",
")",
",",
"pkiPathDir",
",",
... | // resetConfigDir is used to cleanup the files kubeadm writes in /etc/kubernetes/. | [
"resetConfigDir",
"is",
"used",
"to",
"cleanup",
"the",
"files",
"kubeadm",
"writes",
"in",
"/",
"etc",
"/",
"kubernetes",
"/",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/cmd/reset.go#L293-L318 | train | resetConfigDir removes all the contents of the config directory | [
30522,
4569,
2278,
25141,
8663,
8873,
2290,
4305,
2099,
1006,
9530,
8873,
21600,
8988,
4305,
2099,
1010,
1052,
3211,
15069,
4305,
2099,
5164,
1007,
1063,
16101,
16033,
14321,
2319,
1024,
1027,
1031,
1033,
5164,
1063,
5371,
15069,
1012,
3693... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/request.go | request | func (r *Request) request(fn func(*http.Request, *http.Response)) error {
//Metrics for total request latency
start := time.Now()
defer func() {
metrics.RequestLatency.Observe(r.verb, r.finalURLTemplate(), time.Since(start))
}()
if r.err != nil {
klog.V(4).Infof("Error in request: %v", r.err)
return r.err
... | go | func (r *Request) request(fn func(*http.Request, *http.Response)) error {
//Metrics for total request latency
start := time.Now()
defer func() {
metrics.RequestLatency.Observe(r.verb, r.finalURLTemplate(), time.Since(start))
}()
if r.err != nil {
klog.V(4).Infof("Error in request: %v", r.err)
return r.err
... | [
"func",
"(",
"r",
"*",
"Request",
")",
"request",
"(",
"fn",
"func",
"(",
"*",
"http",
".",
"Request",
",",
"*",
"http",
".",
"Response",
")",
")",
"error",
"{",
"//Metrics for total request latency",
"start",
":=",
"time",
".",
"Now",
"(",
")",
"\n",
... | // request connects to the server and invokes the provided function when a server response is
// received. It handles retry behavior and up front validation of requests. It will invoke
// fn at most once. It will return an error if a problem occurred prior to connecting to the
// server - the provided function is respo... | [
"request",
"connects",
"to",
"the",
"server",
"and",
"invokes",
"the",
"provided",
"function",
"when",
"a",
"server",
"response",
"is",
"received",
".",
"It",
"handles",
"retry",
"behavior",
"and",
"up",
"front",
"validation",
"of",
"requests",
".",
"It",
"w... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/rest/request.go#L683-L795 | train | request is a helper function to make a request to the server. | [
30522,
4569,
2278,
1006,
1054,
1008,
5227,
1007,
5227,
1006,
1042,
2078,
4569,
2278,
1006,
1008,
8299,
1012,
5227,
1010,
1008,
8299,
1012,
3433,
1007,
30524,
6633,
15725,
1006,
1007,
1010,
2051,
1012,
2144,
1006,
2707,
1007,
1007,
1065,
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/volume/persistentvolume/config/v1alpha1/zz_generated.conversion.go | RegisterConversions | func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*v1alpha1.GroupResource)(nil), (*v1.GroupResource)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_GroupResource_To_v1_GroupResource(a.(*v1alpha1.GroupResource), b.(*v1.GroupResource), sco... | go | func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*v1alpha1.GroupResource)(nil), (*v1.GroupResource)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_GroupResource_To_v1_GroupResource(a.(*v1alpha1.GroupResource), b.(*v1.GroupResource), sco... | [
"func",
"RegisterConversions",
"(",
"s",
"*",
"runtime",
".",
"Scheme",
")",
"error",
"{",
"if",
"err",
":=",
"s",
".",
"AddGeneratedConversionFunc",
"(",
"(",
"*",
"v1alpha1",
".",
"GroupResource",
")",
"(",
"nil",
")",
",",
"(",
"*",
"v1",
".",
"Grou... | // RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes. | [
"RegisterConversions",
"adds",
"conversion",
"functions",
"to",
"the",
"given",
"scheme",
".",
"Public",
"to",
"allow",
"building",
"arbitrary",
"schemes",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/controller/volume/persistentvolume/config/v1alpha1/zz_generated.conversion.go#L37-L89 | train | RegisterConversions registers conversion functions to the given scheme. | [
30522,
4569,
2278,
4236,
8663,
27774,
2015,
1006,
1055,
1008,
2448,
7292,
1012,
5679,
1007,
7561,
1063,
2065,
9413,
2099,
1024,
1027,
1055,
1012,
5587,
6914,
16848,
8663,
27774,
11263,
12273,
1006,
1006,
1008,
1058,
2487,
2389,
21890,
2487,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | GetUniquePodName | func GetUniquePodName(pod *v1.Pod) types.UniquePodName {
return types.UniquePodName(pod.UID)
} | go | func GetUniquePodName(pod *v1.Pod) types.UniquePodName {
return types.UniquePodName(pod.UID)
} | [
"func",
"GetUniquePodName",
"(",
"pod",
"*",
"v1",
".",
"Pod",
")",
"types",
".",
"UniquePodName",
"{",
"return",
"types",
".",
"UniquePodName",
"(",
"pod",
".",
"UID",
")",
"\n",
"}"
] | // GetUniquePodName returns a unique identifier to reference a pod by | [
"GetUniquePodName",
"returns",
"a",
"unique",
"identifier",
"to",
"reference",
"a",
"pod",
"by"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/util/util.go#L323-L325 | train | GetUniquePodName returns the unique pod name for a pod. | [
30522,
4569,
2278,
2131,
19496,
4226,
27633,
18442,
1006,
17491,
1008,
1058,
2487,
1012,
17491,
1007,
4127,
1012,
4310,
27633,
18442,
1063,
2709,
4127,
1012,
4310,
27633,
18442,
1006,
17491,
1012,
21318,
2094,
1007,
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 | staging/src/k8s.io/api/extensions/v1beta1/zz_generated.deepcopy.go | DeepCopyObject | func (in *IngressList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | go | func (in *IngressList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
"func",
"(",
"in",
"*",
"IngressList",
")",
"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/api/extensions/v1beta1/zz_generated.deepcopy.go#L620-L625 | train | DeepCopyObject is an autogenerated deepcopy function copying the receiver creating a new runtime. Object. | [
30522,
4569,
2278,
1006,
1999,
1008,
13749,
8303,
9863,
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,
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 | cmd/kubeadm/app/preflight/checks_unix.go | Check | func (ipuc IsPrivilegedUserCheck) Check() (warnings, errorList []error) {
errorList = []error{}
if os.Getuid() != 0 {
errorList = append(errorList, errors.New("user is not running as root"))
}
return nil, errorList
} | go | func (ipuc IsPrivilegedUserCheck) Check() (warnings, errorList []error) {
errorList = []error{}
if os.Getuid() != 0 {
errorList = append(errorList, errors.New("user is not running as root"))
}
return nil, errorList
} | [
"func",
"(",
"ipuc",
"IsPrivilegedUserCheck",
")",
"Check",
"(",
")",
"(",
"warnings",
",",
"errorList",
"[",
"]",
"error",
")",
"{",
"errorList",
"=",
"[",
"]",
"error",
"{",
"}",
"\n",
"if",
"os",
".",
"Getuid",
"(",
")",
"!=",
"0",
"{",
"errorLi... | // Check validates if an user has elevated (root) privileges. | [
"Check",
"validates",
"if",
"an",
"user",
"has",
"elevated",
"(",
"root",
")",
"privileges",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/preflight/checks_unix.go#L28-L35 | train | Check is a wrapper for IsPrivilegedUserCheck. | [
30522,
4569,
2278,
1006,
12997,
14194,
2003,
18098,
12848,
9463,
5999,
20330,
5403,
3600,
1007,
4638,
1006,
1007,
1006,
16234,
1010,
7561,
9863,
1031,
1033,
7561,
1007,
1063,
7561,
9863,
1027,
1031,
1033,
7561,
1063,
1065,
2065,
9808,
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 | hack/make-rules/helpers/go2make/pkgwalk.go | findPackage | func findPackage(pkgName string) (*build.Package, error) {
debug("find", pkgName)
pkg, err := build.Import(pkgName, getwd(), build.FindOnly)
if err != nil {
return nil, err
}
return pkg, nil
} | go | func findPackage(pkgName string) (*build.Package, error) {
debug("find", pkgName)
pkg, err := build.Import(pkgName, getwd(), build.FindOnly)
if err != nil {
return nil, err
}
return pkg, nil
} | [
"func",
"findPackage",
"(",
"pkgName",
"string",
")",
"(",
"*",
"build",
".",
"Package",
",",
"error",
")",
"{",
"debug",
"(",
"\"",
"\"",
",",
"pkgName",
")",
"\n",
"pkg",
",",
"err",
":=",
"build",
".",
"Import",
"(",
"pkgName",
",",
"getwd",
"("... | // findPackage finds a Go package. | [
"findPackage",
"finds",
"a",
"Go",
"package",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/hack/make-rules/helpers/go2make/pkgwalk.go#L73-L80 | train | findPackage returns a package with the given name. | [
30522,
4569,
2278,
2424,
23947,
4270,
1006,
1052,
2243,
16989,
4168,
5164,
1007,
1006,
1008,
3857,
1012,
7427,
1010,
7561,
1007,
1063,
2139,
8569,
2290,
1006,
1000,
2424,
1000,
1010,
1052,
2243,
16989,
4168,
1007,
1052,
2243,
2290,
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/garbagecollector/garbagecollector.go | printDiff | func printDiff(oldResources, newResources map[schema.GroupVersionResource]struct{}) string {
removed := sets.NewString()
for oldResource := range oldResources {
if _, ok := newResources[oldResource]; !ok {
removed.Insert(fmt.Sprintf("%+v", oldResource))
}
}
added := sets.NewString()
for newResource := range... | go | func printDiff(oldResources, newResources map[schema.GroupVersionResource]struct{}) string {
removed := sets.NewString()
for oldResource := range oldResources {
if _, ok := newResources[oldResource]; !ok {
removed.Insert(fmt.Sprintf("%+v", oldResource))
}
}
added := sets.NewString()
for newResource := range... | [
"func",
"printDiff",
"(",
"oldResources",
",",
"newResources",
"map",
"[",
"schema",
".",
"GroupVersionResource",
"]",
"struct",
"{",
"}",
")",
"string",
"{",
"removed",
":=",
"sets",
".",
"NewString",
"(",
")",
"\n",
"for",
"oldResource",
":=",
"range",
"... | // printDiff returns a human-readable summary of what resources were added and removed | [
"printDiff",
"returns",
"a",
"human",
"-",
"readable",
"summary",
"of",
"what",
"resources",
"were",
"added",
"and",
"removed"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/controller/garbagecollector/garbagecollector.go#L247-L261 | train | printDiff returns a string containing the diff between two resources. | [
30522,
4569,
2278,
6140,
4305,
4246,
1006,
2214,
6072,
8162,
9623,
1010,
2047,
6072,
8162,
9623,
4949,
1031,
8040,
28433,
1012,
2177,
27774,
6072,
8162,
3401,
1033,
2358,
6820,
6593,
1063,
1065,
1007,
5164,
1063,
3718,
1024,
1027,
4520,
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/volume/storageos/storageos.go | parseAPIConfig | func parseAPIConfig(params map[string]string) (*storageosAPIConfig, error) {
if len(params) == 0 {
return nil, fmt.Errorf("empty API config")
}
c := &storageosAPIConfig{}
for name, data := range params {
switch strings.ToLower(name) {
case "apiaddress":
c.apiAddr = string(data)
case "apiusername":
... | go | func parseAPIConfig(params map[string]string) (*storageosAPIConfig, error) {
if len(params) == 0 {
return nil, fmt.Errorf("empty API config")
}
c := &storageosAPIConfig{}
for name, data := range params {
switch strings.ToLower(name) {
case "apiaddress":
c.apiAddr = string(data)
case "apiusername":
... | [
"func",
"parseAPIConfig",
"(",
"params",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"*",
"storageosAPIConfig",
",",
"error",
")",
"{",
"if",
"len",
"(",
"params",
")",
"==",
"0",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
... | // Parse API configuration from parameters or secret | [
"Parse",
"API",
"configuration",
"from",
"parameters",
"or",
"secret"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/storageos/storageos.go#L750-L772 | train | parseAPIConfig parses the API config from a map | [
30522,
4569,
2278,
11968,
17310,
24330,
2239,
8873,
2290,
1006,
11498,
5244,
4949,
1031,
5164,
1033,
5164,
1007,
1006,
1008,
5527,
8820,
24330,
2239,
8873,
2290,
1010,
7561,
1007,
1063,
2065,
18798,
1006,
11498,
5244,
1007,
1027,
1027,
1014... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/images/image_gc_manager.go | freeSpace | func (im *realImageGCManager) freeSpace(bytesToFree int64, freeTime time.Time) (int64, error) {
imagesInUse, err := im.detectImages(freeTime)
if err != nil {
return 0, err
}
im.imageRecordsLock.Lock()
defer im.imageRecordsLock.Unlock()
// Get all images in eviction order.
images := make([]evictionInfo, 0, le... | go | func (im *realImageGCManager) freeSpace(bytesToFree int64, freeTime time.Time) (int64, error) {
imagesInUse, err := im.detectImages(freeTime)
if err != nil {
return 0, err
}
im.imageRecordsLock.Lock()
defer im.imageRecordsLock.Unlock()
// Get all images in eviction order.
images := make([]evictionInfo, 0, le... | [
"func",
"(",
"im",
"*",
"realImageGCManager",
")",
"freeSpace",
"(",
"bytesToFree",
"int64",
",",
"freeTime",
"time",
".",
"Time",
")",
"(",
"int64",
",",
"error",
")",
"{",
"imagesInUse",
",",
"err",
":=",
"im",
".",
"detectImages",
"(",
"freeTime",
")"... | // Tries to free bytesToFree worth of images on the disk.
//
// Returns the number of bytes free and an error if any occurred. The number of
// bytes freed is always returned.
// Note that error may be nil and the number of bytes free may be less
// than bytesToFree. | [
"Tries",
"to",
"free",
"bytesToFree",
"worth",
"of",
"images",
"on",
"the",
"disk",
".",
"Returns",
"the",
"number",
"of",
"bytes",
"free",
"and",
"an",
"error",
"if",
"any",
"occurred",
".",
"The",
"number",
"of",
"bytes",
"freed",
"is",
"always",
"retu... | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/images/image_gc_manager.go#L328-L389 | train | freeSpace is used to free up enough space. | [
30522,
4569,
2278,
1006,
10047,
1008,
2613,
9581,
3351,
18195,
24805,
4590,
1007,
2489,
23058,
1006,
27507,
3406,
23301,
20014,
21084,
1010,
2489,
7292,
2051,
1012,
2051,
1007,
1006,
20014,
21084,
1010,
7561,
1007,
1063,
4871,
13429,
2063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | RESTConfigFromKubeConfig | func RESTConfigFromKubeConfig(configBytes []byte) (*restclient.Config, error) {
clientConfig, err := NewClientConfigFromBytes(configBytes)
if err != nil {
return nil, err
}
return clientConfig.ClientConfig()
} | go | func RESTConfigFromKubeConfig(configBytes []byte) (*restclient.Config, error) {
clientConfig, err := NewClientConfigFromBytes(configBytes)
if err != nil {
return nil, err
}
return clientConfig.ClientConfig()
} | [
"func",
"RESTConfigFromKubeConfig",
"(",
"configBytes",
"[",
"]",
"byte",
")",
"(",
"*",
"restclient",
".",
"Config",
",",
"error",
")",
"{",
"clientConfig",
",",
"err",
":=",
"NewClientConfigFromBytes",
"(",
"configBytes",
")",
"\n",
"if",
"err",
"!=",
"nil... | // RESTConfigFromKubeConfig is a convenience method to give back a restconfig from your kubeconfig bytes.
// For programmatic access, this is what you want 80% of the time | [
"RESTConfigFromKubeConfig",
"is",
"a",
"convenience",
"method",
"to",
"give",
"back",
"a",
"restconfig",
"from",
"your",
"kubeconfig",
"bytes",
".",
"For",
"programmatic",
"access",
"this",
"is",
"what",
"you",
"want",
"80%",
"of",
"the",
"time"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/client_config.go#L114-L120 | train | RESTConfigFromKubeConfig returns a REST client config from a byte slice | [
30522,
4569,
2278,
2717,
8663,
8873,
25708,
21716,
5283,
4783,
8663,
8873,
2290,
1006,
9530,
8873,
18259,
17250,
2015,
1031,
1033,
24880,
1007,
1006,
1008,
2717,
20464,
11638,
1012,
9530,
8873,
2290,
1010,
7561,
1007,
1063,
7396,
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 | pkg/kubelet/eviction/helpers.go | thresholdsMet | func thresholdsMet(thresholds []evictionapi.Threshold, observations signalObservations, enforceMinReclaim bool) []evictionapi.Threshold {
results := []evictionapi.Threshold{}
for i := range thresholds {
threshold := thresholds[i]
observed, found := observations[threshold.Signal]
if !found {
klog.Warningf("ev... | go | func thresholdsMet(thresholds []evictionapi.Threshold, observations signalObservations, enforceMinReclaim bool) []evictionapi.Threshold {
results := []evictionapi.Threshold{}
for i := range thresholds {
threshold := thresholds[i]
observed, found := observations[threshold.Signal]
if !found {
klog.Warningf("ev... | [
"func",
"thresholdsMet",
"(",
"thresholds",
"[",
"]",
"evictionapi",
".",
"Threshold",
",",
"observations",
"signalObservations",
",",
"enforceMinReclaim",
"bool",
")",
"[",
"]",
"evictionapi",
".",
"Threshold",
"{",
"results",
":=",
"[",
"]",
"evictionapi",
"."... | // thresholdsMet returns the set of thresholds that were met independent of grace period | [
"thresholdsMet",
"returns",
"the",
"set",
"of",
"thresholds",
"that",
"were",
"met",
"independent",
"of",
"grace",
"period"
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/eviction/helpers.go#L780-L806 | train | thresholdsMet returns a list of thresholds that are met by the specified signal. | [
30522,
4569,
2278,
11207,
6491,
3388,
1006,
11207,
2015,
1031,
1033,
23408,
28097,
9331,
2072,
1012,
11207,
1010,
9420,
4742,
16429,
8043,
21596,
2015,
1010,
16306,
10020,
2890,
25154,
22017,
2140,
1007,
1031,
1033,
23408,
28097,
9331,
2072,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/listers/node/v1alpha1/runtimeclass.go | Get | func (s *runtimeClassLister) Get(name string) (*v1alpha1.RuntimeClass, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("runtimeclass"), name)
}
return obj.(*v1alpha1.RuntimeClass), nil
} | go | func (s *runtimeClassLister) Get(name string) (*v1alpha1.RuntimeClass, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("runtimeclass"), name)
}
return obj.(*v1alpha1.RuntimeClass), nil
} | [
"func",
"(",
"s",
"*",
"runtimeClassLister",
")",
"Get",
"(",
"name",
"string",
")",
"(",
"*",
"v1alpha1",
".",
"RuntimeClass",
",",
"error",
")",
"{",
"obj",
",",
"exists",
",",
"err",
":=",
"s",
".",
"indexer",
".",
"GetByKey",
"(",
"name",
")",
... | // Get retrieves the RuntimeClass from the index for a given name. | [
"Get",
"retrieves",
"the",
"RuntimeClass",
"from",
"the",
"index",
"for",
"a",
"given",
"name",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/node-api/pkg/client/listers/node/v1alpha1/runtimeclass.go#L56-L65 | train | Get retrieves the RuntimeClass from the index for a given name. | [
30522,
4569,
2278,
1006,
1055,
1008,
2448,
7292,
26266,
9863,
2121,
1007,
2131,
1006,
2171,
5164,
1007,
1006,
1008,
1058,
2487,
2389,
21890,
2487,
1012,
2448,
7292,
26266,
1010,
7561,
1007,
1063,
27885,
3501,
1010,
6526,
1010,
9413,
2099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/v1beta1/zz_generated.conversion.go | Convert_v1beta1_ClusterRole_To_rbac_ClusterRole | func Convert_v1beta1_ClusterRole_To_rbac_ClusterRole(in *v1beta1.ClusterRole, out *rbac.ClusterRole, s conversion.Scope) error {
return autoConvert_v1beta1_ClusterRole_To_rbac_ClusterRole(in, out, s)
} | go | func Convert_v1beta1_ClusterRole_To_rbac_ClusterRole(in *v1beta1.ClusterRole, out *rbac.ClusterRole, s conversion.Scope) error {
return autoConvert_v1beta1_ClusterRole_To_rbac_ClusterRole(in, out, s)
} | [
"func",
"Convert_v1beta1_ClusterRole_To_rbac_ClusterRole",
"(",
"in",
"*",
"v1beta1",
".",
"ClusterRole",
",",
"out",
"*",
"rbac",
".",
"ClusterRole",
",",
"s",
"conversion",
".",
"Scope",
")",
"error",
"{",
"return",
"autoConvert_v1beta1_ClusterRole_To_rbac_ClusterRole... | // Convert_v1beta1_ClusterRole_To_rbac_ClusterRole is an autogenerated conversion function. | [
"Convert_v1beta1_ClusterRole_To_rbac_ClusterRole",
"is",
"an",
"autogenerated",
"conversion",
"function",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/rbac/v1beta1/zz_generated.conversion.go#L191-L193 | train | Convert_v1beta1_ClusterRole_To_rbac_ClusterRole is an autogenerated conversion function. | [
30522,
4569,
2278,
10463,
1035,
1058,
2487,
20915,
27717,
1035,
9324,
13153,
2063,
1035,
2000,
1035,
21144,
6305,
1035,
9324,
13153,
2063,
1006,
1999,
1008,
1058,
2487,
20915,
27717,
1012,
9324,
13153,
2063,
1010,
2041,
1008,
21144,
6305,
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/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go | Get | func (c *FakeCSIDrivers) Get(name string, options v1.GetOptions) (result *v1beta1.CSIDriver, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(csidriversResource, name), &v1beta1.CSIDriver{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.CSIDriver), err
} | go | func (c *FakeCSIDrivers) Get(name string, options v1.GetOptions) (result *v1beta1.CSIDriver, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(csidriversResource, name), &v1beta1.CSIDriver{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.CSIDriver), err
} | [
"func",
"(",
"c",
"*",
"FakeCSIDrivers",
")",
"Get",
"(",
"name",
"string",
",",
"options",
"v1",
".",
"GetOptions",
")",
"(",
"result",
"*",
"v1beta1",
".",
"CSIDriver",
",",
"err",
"error",
")",
"{",
"obj",
",",
"err",
":=",
"c",
".",
"Fake",
"."... | // Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. | [
"Get",
"takes",
"name",
"of",
"the",
"cSIDriver",
"and",
"returns",
"the",
"corresponding",
"cSIDriver",
"object",
"and",
"an",
"error",
"if",
"there",
"is",
"any",
"."
] | 6a8a3682919652ae668c389ed2f60efb770eed03 | https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go#L41-L48 | train | Get takes name of the cSIDriver and returns the corresponding cSIDriver object and an error if there is any. | [
30522,
4569,
2278,
1006,
1039,
1008,
8275,
6169,
3593,
24352,
2015,
1007,
2131,
1006,
2171,
5164,
1010,
7047,
1058,
2487,
1012,
2131,
7361,
9285,
1007,
1006,
2765,
1008,
1058,
2487,
20915,
27717,
1012,
22174,
23663,
2099,
1010,
9413,
2099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4