Dataset Viewer
Auto-converted to Parquet Duplicate
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
sequencelengths
23
4.91k
docstring
stringlengths
13
1.73k
docstring_tokens
sequencelengths
1
335
sha
stringclasses
1 value
url
stringlengths
113
242
partition
stringclasses
1 value
summary
stringlengths
15
310
input_ids
sequencelengths
502
502
token_type_ids
sequencelengths
502
502
attention_mask
sequencelengths
502
502
labels
sequencelengths
502
502
kubernetes/kubernetes
staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go
NewGRPCService
func NewGRPCService(endpoint string, callTimeout time.Duration) (Service, error) { klog.V(4).Infof("Configure KMS provider with endpoint: %s", endpoint) addr, err := parseEndpoint(endpoint) if err != nil { return nil, err } connection, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithDefaultCallOptions(grpc.FailFast(false)), grpc.WithDialer( func(string, time.Duration) (net.Conn, error) { // Ignoring addr and timeout arguments: // addr - comes from the closure // timeout - is ignored since we are connecting in a non-blocking configuration c, err := net.DialTimeout(unixProtocol, addr, 0) if err != nil { klog.Errorf("failed to create connection to unix socket: %s, error: %v", addr, err) } return c, err })) if err != nil { return nil, fmt.Errorf("failed to create connection to %s, error: %v", endpoint, err) } kmsClient := kmsapi.NewKeyManagementServiceClient(connection) return &gRPCService{ kmsClient: kmsClient, connection: connection, callTimeout: callTimeout, }, nil }
go
func NewGRPCService(endpoint string, callTimeout time.Duration) (Service, error) { klog.V(4).Infof("Configure KMS provider with endpoint: %s", endpoint) addr, err := parseEndpoint(endpoint) if err != nil { return nil, err } connection, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithDefaultCallOptions(grpc.FailFast(false)), grpc.WithDialer( func(string, time.Duration) (net.Conn, error) { // Ignoring addr and timeout arguments: // addr - comes from the closure // timeout - is ignored since we are connecting in a non-blocking configuration c, err := net.DialTimeout(unixProtocol, addr, 0) if err != nil { klog.Errorf("failed to create connection to unix socket: %s, error: %v", addr, err) } return c, err })) if err != nil { return nil, fmt.Errorf("failed to create connection to %s, error: %v", endpoint, err) } kmsClient := kmsapi.NewKeyManagementServiceClient(connection) return &gRPCService{ kmsClient: kmsClient, connection: connection, callTimeout: callTimeout, }, nil }
[ "func", "NewGRPCService", "(", "endpoint", "string", ",", "callTimeout", "time", ".", "Duration", ")", "(", "Service", ",", "error", ")", "{", "klog", ".", "V", "(", "4", ")", ".", "Infof", "(", "\"", "\"", ",", "endpoint", ")", "\n\n", "addr", ",", ...
// NewGRPCService returns an envelope.Service which use gRPC to communicate the remote KMS provider.
[ "NewGRPCService", "returns", "an", "envelope", ".", "Service", "which", "use", "gRPC", "to", "communicate", "the", "remote", "KMS", "provider", "." ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go#L56-L86
train
NewGRPCService creates a new service with the given endpoint and callTimeout.
[ 30522, 4569, 2278, 2047, 16523, 15042, 8043, 7903, 2063, 1006, 2203, 8400, 5164, 1010, 2655, 7292, 5833, 2051, 1012, 9367, 1007, 1006, 2326, 1010, 7561, 1007, 1063, 1047, 21197, 1012, 1058, 1006, 1018, 1007, 1012, 18558, 2546, 1006, 1000, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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/api/v1/persistentvolume/util.go
VisitPVSecretNames
func VisitPVSecretNames(pv *corev1.PersistentVolume, visitor Visitor) bool { source := &pv.Spec.PersistentVolumeSource switch { case source.AzureFile != nil: if source.AzureFile.SecretNamespace != nil && len(*source.AzureFile.SecretNamespace) > 0 { if len(source.AzureFile.SecretName) > 0 && !visitor(*source.AzureFile.SecretNamespace, source.AzureFile.SecretName, true /* kubeletVisible */) { return false } } else { if len(source.AzureFile.SecretName) > 0 && !visitor(getClaimRefNamespace(pv), source.AzureFile.SecretName, true /* kubeletVisible */) { return false } } return true case source.CephFS != nil: if source.CephFS.SecretRef != nil { // previously persisted PV objects use claimRef namespace ns := getClaimRefNamespace(pv) if len(source.CephFS.SecretRef.Namespace) > 0 { // use the secret namespace if namespace is set ns = source.CephFS.SecretRef.Namespace } if !visitor(ns, source.CephFS.SecretRef.Name, true /* kubeletVisible */) { return false } } case source.Cinder != nil: if source.Cinder.SecretRef != nil && !visitor(source.Cinder.SecretRef.Namespace, source.Cinder.SecretRef.Name, true /* kubeletVisible */) { return false } case source.FlexVolume != nil: if source.FlexVolume.SecretRef != nil { // previously persisted PV objects use claimRef namespace ns := getClaimRefNamespace(pv) if len(source.FlexVolume.SecretRef.Namespace) > 0 { // use the secret namespace if namespace is set ns = source.FlexVolume.SecretRef.Namespace } if !visitor(ns, source.FlexVolume.SecretRef.Name, true /* kubeletVisible */) { return false } } case source.RBD != nil: if source.RBD.SecretRef != nil { // previously persisted PV objects use claimRef namespace ns := getClaimRefNamespace(pv) if len(source.RBD.SecretRef.Namespace) > 0 { // use the secret namespace if namespace is set ns = source.RBD.SecretRef.Namespace } if !visitor(ns, source.RBD.SecretRef.Name, true /* kubeletVisible */) { return false } } case source.ScaleIO != nil: if source.ScaleIO.SecretRef != nil { ns := getClaimRefNamespace(pv) if source.ScaleIO.SecretRef != nil && len(source.ScaleIO.SecretRef.Namespace) > 0 { ns = source.ScaleIO.SecretRef.Namespace } if !visitor(ns, source.ScaleIO.SecretRef.Name, true /* kubeletVisible */) { return false } } case source.ISCSI != nil: if source.ISCSI.SecretRef != nil { // previously persisted PV objects use claimRef namespace ns := getClaimRefNamespace(pv) if len(source.ISCSI.SecretRef.Namespace) > 0 { // use the secret namespace if namespace is set ns = source.ISCSI.SecretRef.Namespace } if !visitor(ns, source.ISCSI.SecretRef.Name, true /* kubeletVisible */) { return false } } case source.StorageOS != nil: if source.StorageOS.SecretRef != nil && !visitor(source.StorageOS.SecretRef.Namespace, source.StorageOS.SecretRef.Name, true /* kubeletVisible */) { return false } case source.CSI != nil: if source.CSI.ControllerPublishSecretRef != nil { if !visitor(source.CSI.ControllerPublishSecretRef.Namespace, source.CSI.ControllerPublishSecretRef.Name, false /* kubeletVisible */) { return false } } if source.CSI.NodePublishSecretRef != nil { if !visitor(source.CSI.NodePublishSecretRef.Namespace, source.CSI.NodePublishSecretRef.Name, true /* kubeletVisible */) { return false } } if source.CSI.NodeStageSecretRef != nil { if !visitor(source.CSI.NodeStageSecretRef.Namespace, source.CSI.NodeStageSecretRef.Name, true /* kubeletVisible */) { return false } } } return true }
go
func VisitPVSecretNames(pv *corev1.PersistentVolume, visitor Visitor) bool { source := &pv.Spec.PersistentVolumeSource switch { case source.AzureFile != nil: if source.AzureFile.SecretNamespace != nil && len(*source.AzureFile.SecretNamespace) > 0 { if len(source.AzureFile.SecretName) > 0 && !visitor(*source.AzureFile.SecretNamespace, source.AzureFile.SecretName, true /* kubeletVisible */) { return false } } else { if len(source.AzureFile.SecretName) > 0 && !visitor(getClaimRefNamespace(pv), source.AzureFile.SecretName, true /* kubeletVisible */) { return false } } return true case source.CephFS != nil: if source.CephFS.SecretRef != nil { // previously persisted PV objects use claimRef namespace ns := getClaimRefNamespace(pv) if len(source.CephFS.SecretRef.Namespace) > 0 { // use the secret namespace if namespace is set ns = source.CephFS.SecretRef.Namespace } if !visitor(ns, source.CephFS.SecretRef.Name, true /* kubeletVisible */) { return false } } case source.Cinder != nil: if source.Cinder.SecretRef != nil && !visitor(source.Cinder.SecretRef.Namespace, source.Cinder.SecretRef.Name, true /* kubeletVisible */) { return false } case source.FlexVolume != nil: if source.FlexVolume.SecretRef != nil { // previously persisted PV objects use claimRef namespace ns := getClaimRefNamespace(pv) if len(source.FlexVolume.SecretRef.Namespace) > 0 { // use the secret namespace if namespace is set ns = source.FlexVolume.SecretRef.Namespace } if !visitor(ns, source.FlexVolume.SecretRef.Name, true /* kubeletVisible */) { return false } } case source.RBD != nil: if source.RBD.SecretRef != nil { // previously persisted PV objects use claimRef namespace ns := getClaimRefNamespace(pv) if len(source.RBD.SecretRef.Namespace) > 0 { // use the secret namespace if namespace is set ns = source.RBD.SecretRef.Namespace } if !visitor(ns, source.RBD.SecretRef.Name, true /* kubeletVisible */) { return false } } case source.ScaleIO != nil: if source.ScaleIO.SecretRef != nil { ns := getClaimRefNamespace(pv) if source.ScaleIO.SecretRef != nil && len(source.ScaleIO.SecretRef.Namespace) > 0 { ns = source.ScaleIO.SecretRef.Namespace } if !visitor(ns, source.ScaleIO.SecretRef.Name, true /* kubeletVisible */) { return false } } case source.ISCSI != nil: if source.ISCSI.SecretRef != nil { // previously persisted PV objects use claimRef namespace ns := getClaimRefNamespace(pv) if len(source.ISCSI.SecretRef.Namespace) > 0 { // use the secret namespace if namespace is set ns = source.ISCSI.SecretRef.Namespace } if !visitor(ns, source.ISCSI.SecretRef.Name, true /* kubeletVisible */) { return false } } case source.StorageOS != nil: if source.StorageOS.SecretRef != nil && !visitor(source.StorageOS.SecretRef.Namespace, source.StorageOS.SecretRef.Name, true /* kubeletVisible */) { return false } case source.CSI != nil: if source.CSI.ControllerPublishSecretRef != nil { if !visitor(source.CSI.ControllerPublishSecretRef.Namespace, source.CSI.ControllerPublishSecretRef.Name, false /* kubeletVisible */) { return false } } if source.CSI.NodePublishSecretRef != nil { if !visitor(source.CSI.NodePublishSecretRef.Namespace, source.CSI.NodePublishSecretRef.Name, true /* kubeletVisible */) { return false } } if source.CSI.NodeStageSecretRef != nil { if !visitor(source.CSI.NodeStageSecretRef.Namespace, source.CSI.NodeStageSecretRef.Name, true /* kubeletVisible */) { return false } } } return true }
[ "func", "VisitPVSecretNames", "(", "pv", "*", "corev1", ".", "PersistentVolume", ",", "visitor", "Visitor", ")", "bool", "{", "source", ":=", "&", "pv", ".", "Spec", ".", "PersistentVolumeSource", "\n", "switch", "{", "case", "source", ".", "AzureFile", "!="...
// VisitPVSecretNames invokes the visitor function with the name of every secret // referenced by the PV spec. If visitor returns false, visiting is short-circuited. // Returns true if visiting completed, false if visiting was short-circuited.
[ "VisitPVSecretNames", "invokes", "the", "visitor", "function", "with", "the", "name", "of", "every", "secret", "referenced", "by", "the", "PV", "spec", ".", "If", "visitor", "returns", "false", "visiting", "is", "short", "-", "circuited", ".", "Returns", "true...
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/api/v1/persistentvolume/util.go#L36-L134
train
VisitPVSecretNames visits PV secrets
[ 30522, 4569, 2278, 3942, 2361, 15088, 8586, 13465, 18442, 2015, 1006, 26189, 1008, 4563, 2615, 2487, 1012, 14516, 6767, 12942, 2063, 1010, 10367, 10367, 1007, 22017, 2140, 1063, 3120, 1024, 1027, 1004, 26189, 1012, 28699, 1012, 14516, 6767, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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/metrics/pkg/apis/external_metrics/zz_generated.deepcopy.go
DeepCopyObject
func (in *ExternalMetricValue) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil }
go
func (in *ExternalMetricValue) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil }
[ "func", "(", "in", "*", "ExternalMetricValue", ")", "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/metrics/pkg/apis/external_metrics/zz_generated.deepcopy.go#L59-L64
train
DeepCopyObject is an autogenerated deepcopy function copying the receiver creating a new runtime. Object.
[ 30522, 4569, 2278, 1006, 1999, 1008, 6327, 12589, 10175, 5657, 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, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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/images/images.go
GetEtcdImage
func GetEtcdImage(cfg *kubeadmapi.ClusterConfiguration) string { // Etcd uses default image repository by default etcdImageRepository := cfg.ImageRepository // unless an override is specified if cfg.Etcd.Local != nil && cfg.Etcd.Local.ImageRepository != "" { etcdImageRepository = cfg.Etcd.Local.ImageRepository } // Etcd uses an imageTag that corresponds to the etcd version matching the Kubernetes version etcdImageTag := constants.DefaultEtcdVersion etcdVersion, err := constants.EtcdSupportedVersion(cfg.KubernetesVersion) if err == nil { etcdImageTag = etcdVersion.String() } // unless an override is specified if cfg.Etcd.Local != nil && cfg.Etcd.Local.ImageTag != "" { etcdImageTag = cfg.Etcd.Local.ImageTag } return GetGenericImage(etcdImageRepository, constants.Etcd, etcdImageTag) }
go
func GetEtcdImage(cfg *kubeadmapi.ClusterConfiguration) string { // Etcd uses default image repository by default etcdImageRepository := cfg.ImageRepository // unless an override is specified if cfg.Etcd.Local != nil && cfg.Etcd.Local.ImageRepository != "" { etcdImageRepository = cfg.Etcd.Local.ImageRepository } // Etcd uses an imageTag that corresponds to the etcd version matching the Kubernetes version etcdImageTag := constants.DefaultEtcdVersion etcdVersion, err := constants.EtcdSupportedVersion(cfg.KubernetesVersion) if err == nil { etcdImageTag = etcdVersion.String() } // unless an override is specified if cfg.Etcd.Local != nil && cfg.Etcd.Local.ImageTag != "" { etcdImageTag = cfg.Etcd.Local.ImageTag } return GetGenericImage(etcdImageRepository, constants.Etcd, etcdImageTag) }
[ "func", "GetEtcdImage", "(", "cfg", "*", "kubeadmapi", ".", "ClusterConfiguration", ")", "string", "{", "// Etcd uses default image repository by default", "etcdImageRepository", ":=", "cfg", ".", "ImageRepository", "\n", "// unless an override is specified", "if", "cfg", "...
// GetEtcdImage generates and returns the image for etcd
[ "GetEtcdImage", "generates", "and", "returns", "the", "image", "for", "etcd" ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/images/images.go#L63-L81
train
GetEtcdImage returns the image for the etcd image
[ 30522, 4569, 2278, 2131, 3388, 19797, 9581, 3351, 1006, 12935, 2290, 1008, 13970, 4783, 4215, 2863, 8197, 1012, 9324, 8663, 8873, 27390, 3370, 1007, 5164, 1063, 1013, 1013, 4385, 2094, 3594, 12398, 3746, 22409, 2011, 12398, 4385, 22172, 173...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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/podtolerationrestriction/admission.go
extractNSTolerations
func extractNSTolerations(ns *corev1.Namespace, key string) ([]api.Toleration, error) { // if a namespace does not have any annotations if len(ns.Annotations) == 0 { return nil, nil } // if NSWLTolerations or NSDefaultTolerations does not exist if _, ok := ns.Annotations[key]; !ok { return nil, nil } // if value is set to empty if len(ns.Annotations[key]) == 0 { return []api.Toleration{}, nil } var v1Tolerations []v1.Toleration err := json.Unmarshal([]byte(ns.Annotations[key]), &v1Tolerations) if err != nil { return nil, err } ts := make([]api.Toleration, len(v1Tolerations)) for i := range v1Tolerations { if err := k8s_api_v1.Convert_v1_Toleration_To_core_Toleration(&v1Tolerations[i], &ts[i], nil); err != nil { return nil, err } } return ts, nil }
go
func extractNSTolerations(ns *corev1.Namespace, key string) ([]api.Toleration, error) { // if a namespace does not have any annotations if len(ns.Annotations) == 0 { return nil, nil } // if NSWLTolerations or NSDefaultTolerations does not exist if _, ok := ns.Annotations[key]; !ok { return nil, nil } // if value is set to empty if len(ns.Annotations[key]) == 0 { return []api.Toleration{}, nil } var v1Tolerations []v1.Toleration err := json.Unmarshal([]byte(ns.Annotations[key]), &v1Tolerations) if err != nil { return nil, err } ts := make([]api.Toleration, len(v1Tolerations)) for i := range v1Tolerations { if err := k8s_api_v1.Convert_v1_Toleration_To_core_Toleration(&v1Tolerations[i], &ts[i], nil); err != nil { return nil, err } } return ts, nil }
[ "func", "extractNSTolerations", "(", "ns", "*", "corev1", ".", "Namespace", ",", "key", "string", ")", "(", "[", "]", "api", ".", "Toleration", ",", "error", ")", "{", "// if a namespace does not have any annotations", "if", "len", "(", "ns", ".", "Annotations...
// extractNSTolerations extracts default or whitelist of tolerations from // following namespace annotations keys: "scheduler.alpha.kubernetes.io/defaultTolerations" // and "scheduler.alpha.kubernetes.io/tolerationsWhitelist". If these keys are // unset (nil), extractNSTolerations returns nil. If the value to these // keys are set to empty, an empty toleration is returned, otherwise // configured tolerations are returned.
[ "extractNSTolerations", "extracts", "default", "or", "whitelist", "of", "tolerations", "from", "following", "namespace", "annotations", "keys", ":", "scheduler", ".", "alpha", ".", "kubernetes", ".", "io", "/", "defaultTolerations", "and", "scheduler", ".", "alpha",...
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/plugin/pkg/admission/podtolerationrestriction/admission.go#L263-L293
train
extractNSTolerations extracts the NSTolerations from a namespace and the given key.
[ 30522, 4569, 2278, 14817, 23808, 9890, 28893, 1006, 24978, 1008, 4563, 2615, 2487, 1012, 3415, 15327, 1010, 3145, 5164, 1007, 1006, 1031, 1033, 17928, 1012, 2000, 3917, 3370, 1010, 7561, 1007, 1063, 1013, 1013, 2065, 1037, 3415, 15327, 2515...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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/token.go
RunDeleteTokens
func RunDeleteTokens(out io.Writer, client clientset.Interface, tokenIDsOrTokens []string) error { for _, tokenIDOrToken := range tokenIDsOrTokens { // Assume this is a token id and try to parse it tokenID := tokenIDOrToken klog.V(1).Infof("[token] parsing token %q", tokenIDOrToken) if !bootstraputil.IsValidBootstrapTokenID(tokenIDOrToken) { // Okay, the full token with both id and secret was probably passed. Parse it and extract the ID only bts, err := kubeadmapiv1beta2.NewBootstrapTokenString(tokenIDOrToken) if err != nil { return errors.Errorf("given token %q didn't match pattern %q or %q", tokenIDOrToken, bootstrapapi.BootstrapTokenIDPattern, bootstrapapi.BootstrapTokenIDPattern) } tokenID = bts.ID } tokenSecretName := bootstraputil.BootstrapTokenSecretName(tokenID) klog.V(1).Infof("[token] deleting token %q", tokenID) if err := client.CoreV1().Secrets(metav1.NamespaceSystem).Delete(tokenSecretName, nil); err != nil { return errors.Wrapf(err, "failed to delete bootstrap token %q", tokenID) } fmt.Fprintf(out, "bootstrap token %q deleted\n", tokenID) } return nil }
go
func RunDeleteTokens(out io.Writer, client clientset.Interface, tokenIDsOrTokens []string) error { for _, tokenIDOrToken := range tokenIDsOrTokens { // Assume this is a token id and try to parse it tokenID := tokenIDOrToken klog.V(1).Infof("[token] parsing token %q", tokenIDOrToken) if !bootstraputil.IsValidBootstrapTokenID(tokenIDOrToken) { // Okay, the full token with both id and secret was probably passed. Parse it and extract the ID only bts, err := kubeadmapiv1beta2.NewBootstrapTokenString(tokenIDOrToken) if err != nil { return errors.Errorf("given token %q didn't match pattern %q or %q", tokenIDOrToken, bootstrapapi.BootstrapTokenIDPattern, bootstrapapi.BootstrapTokenIDPattern) } tokenID = bts.ID } tokenSecretName := bootstraputil.BootstrapTokenSecretName(tokenID) klog.V(1).Infof("[token] deleting token %q", tokenID) if err := client.CoreV1().Secrets(metav1.NamespaceSystem).Delete(tokenSecretName, nil); err != nil { return errors.Wrapf(err, "failed to delete bootstrap token %q", tokenID) } fmt.Fprintf(out, "bootstrap token %q deleted\n", tokenID) } return nil }
[ "func", "RunDeleteTokens", "(", "out", "io", ".", "Writer", ",", "client", "clientset", ".", "Interface", ",", "tokenIDsOrTokens", "[", "]", "string", ")", "error", "{", "for", "_", ",", "tokenIDOrToken", ":=", "range", "tokenIDsOrTokens", "{", "// Assume this...
// RunDeleteTokens removes a bootstrap tokens from the server.
[ "RunDeleteTokens", "removes", "a", "bootstrap", "tokens", "from", "the", "server", "." ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/cmd/token.go#L300-L323
train
RunDeleteTokens deletes the given tokens from the given list of tokens
[ 30522, 4569, 2278, 2448, 9247, 12870, 18715, 6132, 1006, 2041, 22834, 1012, 3213, 1010, 7396, 7846, 3388, 1012, 8278, 1010, 19204, 9821, 11589, 11045, 3619, 1031, 1033, 5164, 1007, 7561, 1063, 2005, 1035, 1010, 19204, 13820, 5339, 11045, 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/kubeadm/app/util/certs/util.go
CreateCACert
func CreateCACert(t *testing.T) (*x509.Certificate, crypto.Signer) { certCfg := &certutil.Config{CommonName: "kubernetes"} cert, key, err := pkiutil.NewCertificateAuthority(certCfg) if err != nil { t.Fatalf("couldn't create CA: %v", err) } return cert, key }
go
func CreateCACert(t *testing.T) (*x509.Certificate, crypto.Signer) { certCfg := &certutil.Config{CommonName: "kubernetes"} cert, key, err := pkiutil.NewCertificateAuthority(certCfg) if err != nil { t.Fatalf("couldn't create CA: %v", err) } return cert, key }
[ "func", "CreateCACert", "(", "t", "*", "testing", ".", "T", ")", "(", "*", "x509", ".", "Certificate", ",", "crypto", ".", "Signer", ")", "{", "certCfg", ":=", "&", "certutil", ".", "Config", "{", "CommonName", ":", "\"", "\"", "}", "\n", "cert", "...
// CreateCACert creates a generic CA cert.
[ "CreateCACert", "creates", "a", "generic", "CA", "cert", "." ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/util/certs/util.go#L134-L141
train
CreateCACert creates a certificate and key pair for the Kubernetes CA
[ 30522, 4569, 2278, 3443, 3540, 17119, 2102, 1006, 1056, 1008, 5604, 1012, 1056, 1007, 1006, 1008, 1060, 12376, 2683, 1012, 8196, 1010, 19888, 2080, 1012, 3696, 2121, 1007, 1063, 8292, 5339, 2278, 2546, 2290, 1024, 1027, 1004, 8292, 5339, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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/internal/cache/fake/fake_cache.go
GetPod
func (c *Cache) GetPod(pod *v1.Pod) (*v1.Pod, error) { return c.GetPodFunc(pod), nil }
go
func (c *Cache) GetPod(pod *v1.Pod) (*v1.Pod, error) { return c.GetPodFunc(pod), nil }
[ "func", "(", "c", "*", "Cache", ")", "GetPod", "(", "pod", "*", "v1", ".", "Pod", ")", "(", "*", "v1", ".", "Pod", ",", "error", ")", "{", "return", "c", ".", "GetPodFunc", "(", "pod", ")", ",", "nil", "\n", "}" ]
// GetPod is a fake method for testing.
[ "GetPod", "is", "a", "fake", "method", "for", "testing", "." ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/scheduler/internal/cache/fake/fake_cache.go#L64-L66
train
GetPod returns the last query result set for a pod.
[ 30522, 4569, 2278, 1006, 1039, 1008, 17053, 1007, 2131, 27633, 1006, 17491, 1008, 1058, 2487, 1012, 17491, 1007, 1006, 1008, 1058, 2487, 1012, 17491, 1010, 7561, 1007, 1063, 2709, 1039, 1012, 2131, 27633, 11263, 12273, 1006, 17491, 1007, 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/kubectl/generate/versioned/secret_for_docker_registry.go
ParamNames
func (s SecretForDockerRegistryGeneratorV1) ParamNames() []generate.GeneratorParam { return []generate.GeneratorParam{ {Name: "name", Required: true}, {Name: "from-file", Required: false}, {Name: "docker-username", Required: true}, {Name: "docker-email", Required: false}, {Name: "docker-password", Required: true}, {Name: "docker-server", Required: true}, {Name: "append-hash", Required: false}, } }
go
func (s SecretForDockerRegistryGeneratorV1) ParamNames() []generate.GeneratorParam { return []generate.GeneratorParam{ {Name: "name", Required: true}, {Name: "from-file", Required: false}, {Name: "docker-username", Required: true}, {Name: "docker-email", Required: false}, {Name: "docker-password", Required: true}, {Name: "docker-server", Required: true}, {Name: "append-hash", Required: false}, } }
[ "func", "(", "s", "SecretForDockerRegistryGeneratorV1", ")", "ParamNames", "(", ")", "[", "]", "generate", ".", "GeneratorParam", "{", "return", "[", "]", "generate", ".", "GeneratorParam", "{", "{", "Name", ":", "\"", "\"", ",", "Required", ":", "true", "...
// ParamNames returns the set of supported input parameters when using the parameter injection generator pattern
[ "ParamNames", "returns", "the", "set", "of", "supported", "input", "parameters", "when", "using", "the", "parameter", "injection", "generator", "pattern" ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/generate/versioned/secret_for_docker_registry.go#L118-L128
train
ParamNames returns a list of parameters that are required to generate a secret for a docker registry
[ 30522, 4569, 2278, 1006, 1055, 3595, 3877, 7432, 28849, 24063, 2854, 6914, 6906, 4263, 2615, 2487, 1007, 11498, 2213, 18442, 2015, 1006, 1007, 1031, 1033, 9699, 1012, 13103, 28689, 2213, 1063, 2709, 1031, 1033, 9699, 1012, 13103, 28689, 221...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 *Event) DeepCopy() *Event { if in == nil { return nil } out := new(Event) in.DeepCopyInto(out) return out }
go
func (in *Event) DeepCopy() *Event { if in == nil { return nil } out := new(Event) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "Event", ")", "DeepCopy", "(", ")", "*", "Event", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "Event", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ")", "\n", "retur...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Event.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "Event", "." ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/core/zz_generated.deepcopy.go#L1300-L1307
train
DeepCopy is an autogenerated deepcopy function copying the receiver creating a new Event.
[ 30522, 4569, 2278, 1006, 1999, 1008, 2724, 1007, 2784, 3597, 7685, 1006, 1007, 1008, 2724, 1063, 2065, 1999, 1027, 1027, 9152, 2140, 1063, 2709, 9152, 2140, 1065, 2041, 1024, 1027, 2047, 1006, 2724, 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
pkg/registry/core/persistentvolumeclaim/strategy.go
GetAttrs
func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) { persistentvolumeclaimObj, ok := obj.(*api.PersistentVolumeClaim) if !ok { return nil, nil, fmt.Errorf("not a persistentvolumeclaim") } return labels.Set(persistentvolumeclaimObj.Labels), PersistentVolumeClaimToSelectableFields(persistentvolumeclaimObj), nil }
go
func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) { persistentvolumeclaimObj, ok := obj.(*api.PersistentVolumeClaim) if !ok { return nil, nil, fmt.Errorf("not a persistentvolumeclaim") } return labels.Set(persistentvolumeclaimObj.Labels), PersistentVolumeClaimToSelectableFields(persistentvolumeclaimObj), nil }
[ "func", "GetAttrs", "(", "obj", "runtime", ".", "Object", ")", "(", "labels", ".", "Set", ",", "fields", ".", "Set", ",", "error", ")", "{", "persistentvolumeclaimObj", ",", "ok", ":=", "obj", ".", "(", "*", "api", ".", "PersistentVolumeClaim", ")", "\...
// GetAttrs returns labels and fields of a given object for filtering purposes.
[ "GetAttrs", "returns", "labels", "and", "fields", "of", "a", "given", "object", "for", "filtering", "purposes", "." ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/registry/core/persistentvolumeclaim/strategy.go#L112-L118
train
GetAttrs returns a set of labels and fields for a persistent volume claim
[ 30522, 4569, 2278, 2131, 19321, 2869, 1006, 27885, 3501, 2448, 7292, 1012, 4874, 1007, 1006, 10873, 1012, 2275, 1010, 4249, 1012, 2275, 1010, 7561, 1007, 1063, 14516, 6767, 12942, 8586, 19771, 5302, 2497, 3501, 1010, 7929, 1024, 1027, 27885...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 *APIGroupList) DeepCopyInto(out *APIGroupList) { *out = *in out.TypeMeta = in.TypeMeta if in.Groups != nil { in, out := &in.Groups, &out.Groups *out = make([]APIGroup, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } return }
go
func (in *APIGroupList) DeepCopyInto(out *APIGroupList) { *out = *in out.TypeMeta = in.TypeMeta if in.Groups != nil { in, out := &in.Groups, &out.Groups *out = make([]APIGroup, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } return }
[ "func", "(", "in", "*", "APIGroupList", ")", "DeepCopyInto", "(", "out", "*", "APIGroupList", ")", "{", "*", "out", "=", "*", "in", "\n", "out", ".", "TypeMeta", "=", "in", ".", "TypeMeta", "\n", "if", "in", ".", "Groups", "!=", "nil", "{", "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/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go#L65-L76
train
DeepCopyInto is an autogenerated deepcopy function copying the receiver creating a new APIGroupList.
[ 30522, 4569, 2278, 1006, 1999, 1008, 17928, 17058, 9863, 1007, 2784, 3597, 7685, 18447, 2080, 1006, 2041, 1008, 17928, 17058, 9863, 1007, 1063, 1008, 2041, 1027, 1008, 1999, 2041, 1012, 2828, 11368, 2050, 1027, 1999, 1012, 2828, 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/remote/remote_runtime.go
StopPodSandbox
func (r *RemoteRuntimeService) StopPodSandbox(podSandBoxID string) error { ctx, cancel := getContextWithTimeout(r.timeout) defer cancel() _, err := r.runtimeClient.StopPodSandbox(ctx, &runtimeapi.StopPodSandboxRequest{ PodSandboxId: podSandBoxID, }) if err != nil { klog.Errorf("StopPodSandbox %q from runtime service failed: %v", podSandBoxID, err) return err } return nil }
go
func (r *RemoteRuntimeService) StopPodSandbox(podSandBoxID string) error { ctx, cancel := getContextWithTimeout(r.timeout) defer cancel() _, err := r.runtimeClient.StopPodSandbox(ctx, &runtimeapi.StopPodSandboxRequest{ PodSandboxId: podSandBoxID, }) if err != nil { klog.Errorf("StopPodSandbox %q from runtime service failed: %v", podSandBoxID, err) return err } return nil }
[ "func", "(", "r", "*", "RemoteRuntimeService", ")", "StopPodSandbox", "(", "podSandBoxID", "string", ")", "error", "{", "ctx", ",", "cancel", ":=", "getContextWithTimeout", "(", "r", ".", "timeout", ")", "\n", "defer", "cancel", "(", ")", "\n\n", "_", ",",...
// StopPodSandbox stops the sandbox. If there are any running containers in the // sandbox, they should be forced to termination.
[ "StopPodSandbox", "stops", "the", "sandbox", ".", "If", "there", "are", "any", "running", "containers", "in", "the", "sandbox", "they", "should", "be", "forced", "to", "termination", "." ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/remote/remote_runtime.go#L120-L133
train
StopPodSandbox stops a podSandbox from the runtime service
[ 30522, 4569, 2278, 1006, 1054, 1008, 6556, 15532, 7292, 8043, 7903, 2063, 1007, 2644, 22925, 5685, 8758, 1006, 26723, 5685, 8758, 3593, 5164, 1007, 7561, 1063, 14931, 2595, 1010, 17542, 1024, 1027, 2131, 8663, 18209, 24415, 7292, 5833, 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
pkg/volume/util/nsenter/nsenter_mount_unsupported.go
GetFileType
func (*Mounter) GetFileType(_ string) (mount.FileType, error) { return mount.FileType("fake"), errors.New("not implemented") }
go
func (*Mounter) GetFileType(_ string) (mount.FileType, error) { return mount.FileType("fake"), errors.New("not implemented") }
[ "func", "(", "*", "Mounter", ")", "GetFileType", "(", "_", "string", ")", "(", "mount", ".", "FileType", ",", "error", ")", "{", "return", "mount", ".", "FileType", "(", "\"", "\"", ")", ",", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}" ...
// GetFileType checks for file/directory/socket/block/character devices. // Always returns an error and "fake" filetype on unsupported platforms
[ "GetFileType", "checks", "for", "file", "/", "directory", "/", "socket", "/", "block", "/", "character", "devices", ".", "Always", "returns", "an", "error", "and", "fake", "filetype", "on", "unsupported", "platforms" ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/util/nsenter/nsenter_mount_unsupported.go#L93-L95
train
GetFileType returns the file type of the file system.
[ 30522, 4569, 2278, 1006, 1008, 4057, 2121, 1007, 2131, 8873, 7485, 18863, 1006, 1035, 5164, 1007, 1006, 4057, 1012, 5371, 13874, 1010, 7561, 1007, 1063, 2709, 4057, 1012, 5371, 13874, 1006, 1000, 8275, 1000, 1007, 1010, 10697, 1012, 2047, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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/secret_for_docker_registry.go
Generate
func (s SecretForDockerRegistryGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error) { err := generate.ValidateParams(s.ParamNames(), genericParams) if err != nil { return nil, err } delegate := &SecretForDockerRegistryGeneratorV1{} hashParam, found := genericParams["append-hash"] if found { hashBool, isBool := hashParam.(bool) if !isBool { return nil, fmt.Errorf("expected bool, found :%v", hashParam) } delegate.AppendHash = hashBool delete(genericParams, "append-hash") } params := map[string]string{} for key, value := range genericParams { strVal, isString := value.(string) if !isString { return nil, fmt.Errorf("expected string, saw %v for '%s'", value, key) } params[key] = strVal } delegate.Name = params["name"] delegate.Username = params["docker-username"] delegate.Email = params["docker-email"] delegate.Password = params["docker-password"] delegate.Server = params["docker-server"] return delegate.StructuredGenerate() }
go
func (s SecretForDockerRegistryGeneratorV1) Generate(genericParams map[string]interface{}) (runtime.Object, error) { err := generate.ValidateParams(s.ParamNames(), genericParams) if err != nil { return nil, err } delegate := &SecretForDockerRegistryGeneratorV1{} hashParam, found := genericParams["append-hash"] if found { hashBool, isBool := hashParam.(bool) if !isBool { return nil, fmt.Errorf("expected bool, found :%v", hashParam) } delegate.AppendHash = hashBool delete(genericParams, "append-hash") } params := map[string]string{} for key, value := range genericParams { strVal, isString := value.(string) if !isString { return nil, fmt.Errorf("expected string, saw %v for '%s'", value, key) } params[key] = strVal } delegate.Name = params["name"] delegate.Username = params["docker-username"] delegate.Email = params["docker-email"] delegate.Password = params["docker-password"] delegate.Server = params["docker-server"] return delegate.StructuredGenerate() }
[ "func", "(", "s", "SecretForDockerRegistryGeneratorV1", ")", "Generate", "(", "genericParams", "map", "[", "string", "]", "interface", "{", "}", ")", "(", "runtime", ".", "Object", ",", "error", ")", "{", "err", ":=", "generate", ".", "ValidateParams", "(", ...
// Generate returns a secret using the specified parameters
[ "Generate", "returns", "a", "secret", "using", "the", "specified", "parameters" ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/generate/versioned/secret_for_docker_registry.go#L55-L84
train
Generate generates a secret for docker registry
[ 30522, 4569, 2278, 1006, 1055, 3595, 3877, 7432, 28849, 24063, 2854, 6914, 6906, 4263, 2615, 2487, 1007, 9699, 1006, 12391, 28689, 5244, 4949, 1031, 5164, 1033, 8278, 1063, 1065, 1007, 1006, 2448, 7292, 1012, 4874, 1010, 7561, 1007, 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/volume/util/volumepathhandler/volume_path_handler_linux.go
AttachFileDevice
func (v VolumePathHandler) AttachFileDevice(path string) (string, error) { blockDevicePath, err := v.GetLoopDevice(path) if err != nil && err.Error() != ErrDeviceNotFound { return "", err } // If no existing loop device for the path, create one if blockDevicePath == "" { klog.V(4).Infof("Creating device for path: %s", path) blockDevicePath, err = makeLoopDevice(path) if err != nil { return "", err } } return blockDevicePath, nil }
go
func (v VolumePathHandler) AttachFileDevice(path string) (string, error) { blockDevicePath, err := v.GetLoopDevice(path) if err != nil && err.Error() != ErrDeviceNotFound { return "", err } // If no existing loop device for the path, create one if blockDevicePath == "" { klog.V(4).Infof("Creating device for path: %s", path) blockDevicePath, err = makeLoopDevice(path) if err != nil { return "", err } } return blockDevicePath, nil }
[ "func", "(", "v", "VolumePathHandler", ")", "AttachFileDevice", "(", "path", "string", ")", "(", "string", ",", "error", ")", "{", "blockDevicePath", ",", "err", ":=", "v", ".", "GetLoopDevice", "(", "path", ")", "\n", "if", "err", "!=", "nil", "&&", "...
// AttachFileDevice takes a path to a regular file and makes it available as an // attached block device.
[ "AttachFileDevice", "takes", "a", "path", "to", "a", "regular", "file", "and", "makes", "it", "available", "as", "an", "attached", "block", "device", "." ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/util/volumepathhandler/volume_path_handler_linux.go#L33-L48
train
AttachFileDevice attachs a file device to a loop device
[ 30522, 4569, 2278, 1006, 1058, 3872, 15069, 11774, 3917, 1007, 22476, 8873, 3709, 17726, 2063, 1006, 4130, 5164, 1007, 1006, 5164, 1010, 7561, 1007, 1063, 3796, 24844, 6610, 15069, 1010, 9413, 2099, 1024, 1027, 1058, 1012, 2131, 4135, 7361,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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/container/sync_result.go
NewSyncResult
func NewSyncResult(action SyncAction, target interface{}) *SyncResult { return &SyncResult{Action: action, Target: target} }
go
func NewSyncResult(action SyncAction, target interface{}) *SyncResult { return &SyncResult{Action: action, Target: target} }
[ "func", "NewSyncResult", "(", "action", "SyncAction", ",", "target", "interface", "{", "}", ")", "*", "SyncResult", "{", "return", "&", "SyncResult", "{", "Action", ":", "action", ",", "Target", ":", "target", "}", "\n", "}" ]
// NewSyncResult generates new SyncResult with specific Action and Target
[ "NewSyncResult", "generates", "new", "SyncResult", "with", "specific", "Action", "and", "Target" ]
6a8a3682919652ae668c389ed2f60efb770eed03
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/container/sync_result.go#L82-L84
train
NewSyncResult returns a new SyncResult.
[ 30522, 4569, 2278, 2739, 6038, 16748, 23722, 2102, 1006, 2895, 26351, 18908, 3258, 1010, 4539, 8278, 1063, 1065, 1007, 1008, 26351, 6072, 11314, 1063, 2709, 1004, 26351, 6072, 11314, 1063, 2895, 1024, 2895, 1010, 4539, 1024, 4539, 1065, 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
pkg/apis/batch/zz_generated.deepcopy.go
DeepCopyInto
func (in *Job) DeepCopyInto(out *Job) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) return }
go
func (in *Job) DeepCopyInto(out *Job) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) return }
[ "func", "(", "in", "*", "Job", ")", "DeepCopyInto", "(", "out", "*", "Job", ")", "{", "*", "out", "=", "*", "in", "\n", "out", ".", "TypeMeta", "=", "in", ".", "TypeMeta", "\n", "in", ".", "ObjectMeta", ".", "DeepCopyInto", "(", "&", "out", ".", ...
// 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/batch/zz_generated.deepcopy.go#L153-L160
train
DeepCopyInto is a deep copy of the receiver
[ 30522, 4569, 2278, 1006, 1999, 1008, 3105, 1007, 2784, 3597, 7685, 18447, 2080, 1006, 2041, 1008, 3105, 1007, 1063, 1008, 2041, 1027, 1008, 1999, 2041, 1012, 2828, 11368, 2050, 1027, 1999, 1012, 2828, 11368, 2050, 1999, 1012, 4874, 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...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
5