id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
25,600 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/volume_util_linux.go | GetBlockCapacityByte | func (u *volumeUtil) GetBlockCapacityByte(fullPath string) (int64, error) {
file, err := os.OpenFile(fullPath, os.O_RDONLY, 0)
if err != nil {
return 0, err
}
defer file.Close()
var size int64
// Get size of block device into 64 bit int.
// Ref: http://www.microhowto.info/howto/get_the_size_of_a_linux_block_s... | go | func (u *volumeUtil) GetBlockCapacityByte(fullPath string) (int64, error) {
file, err := os.OpenFile(fullPath, os.O_RDONLY, 0)
if err != nil {
return 0, err
}
defer file.Close()
var size int64
// Get size of block device into 64 bit int.
// Ref: http://www.microhowto.info/howto/get_the_size_of_a_linux_block_s... | [
"func",
"(",
"u",
"*",
"volumeUtil",
")",
"GetBlockCapacityByte",
"(",
"fullPath",
"string",
")",
"(",
"int64",
",",
"error",
")",
"{",
"file",
",",
"err",
":=",
"os",
".",
"OpenFile",
"(",
"fullPath",
",",
"os",
".",
"O_RDONLY",
",",
"0",
")",
"\n",... | // GetBlockCapacityByte returns capacity in bytes of a block device.
// fullPath is the pathname of block device. | [
"GetBlockCapacityByte",
"returns",
"capacity",
"in",
"bytes",
"of",
"a",
"block",
"device",
".",
"fullPath",
"is",
"the",
"pathname",
"of",
"block",
"device",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/volume_util_linux.go#L30-L45 |
25,601 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/common/common.go | CreateLocalPVSpec | func CreateLocalPVSpec(config *LocalPVConfig) *v1.PersistentVolume {
pv := &v1.PersistentVolume{
ObjectMeta: metav1.ObjectMeta{
Name: config.Name,
Labels: config.Labels,
Annotations: map[string]string{
AnnProvisionedBy: config.ProvisionerName,
},
},
Spec: v1.PersistentVolumeSpec{
PersistentV... | go | func CreateLocalPVSpec(config *LocalPVConfig) *v1.PersistentVolume {
pv := &v1.PersistentVolume{
ObjectMeta: metav1.ObjectMeta{
Name: config.Name,
Labels: config.Labels,
Annotations: map[string]string{
AnnProvisionedBy: config.ProvisionerName,
},
},
Spec: v1.PersistentVolumeSpec{
PersistentV... | [
"func",
"CreateLocalPVSpec",
"(",
"config",
"*",
"LocalPVConfig",
")",
"*",
"v1",
".",
"PersistentVolume",
"{",
"pv",
":=",
"&",
"v1",
".",
"PersistentVolume",
"{",
"ObjectMeta",
":",
"metav1",
".",
"ObjectMeta",
"{",
"Name",
":",
"config",
".",
"Name",
",... | // CreateLocalPVSpec returns a PV spec that can be used for PV creation | [
"CreateLocalPVSpec",
"returns",
"a",
"PV",
"spec",
"that",
"can",
"be",
"used",
"for",
"PV",
"creation"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/common/common.go#L201-L235 |
25,602 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/common/common.go | GetVolumeConfigFromConfigMap | func GetVolumeConfigFromConfigMap(client *kubernetes.Clientset, namespace, name string, provisionerConfig *ProvisionerConfiguration) error {
configMap, err := client.CoreV1().ConfigMaps(namespace).Get(name, metav1.GetOptions{})
if err != nil {
return err
}
err = ConfigMapDataToVolumeConfig(configMap.Data, provisi... | go | func GetVolumeConfigFromConfigMap(client *kubernetes.Clientset, namespace, name string, provisionerConfig *ProvisionerConfiguration) error {
configMap, err := client.CoreV1().ConfigMaps(namespace).Get(name, metav1.GetOptions{})
if err != nil {
return err
}
err = ConfigMapDataToVolumeConfig(configMap.Data, provisi... | [
"func",
"GetVolumeConfigFromConfigMap",
"(",
"client",
"*",
"kubernetes",
".",
"Clientset",
",",
"namespace",
",",
"name",
"string",
",",
"provisionerConfig",
"*",
"ProvisionerConfiguration",
")",
"error",
"{",
"configMap",
",",
"err",
":=",
"client",
".",
"CoreV1... | // GetVolumeConfigFromConfigMap gets volume configuration from given configmap. | [
"GetVolumeConfigFromConfigMap",
"gets",
"volume",
"configuration",
"from",
"given",
"configmap",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/common/common.go#L248-L255 |
25,603 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/common/common.go | VolumeConfigToConfigMapData | func VolumeConfigToConfigMapData(config *ProvisionerConfiguration) (map[string]string, error) {
configMapData := make(map[string]string)
val, err := yaml.Marshal(config.StorageClassConfig)
if err != nil {
return nil, fmt.Errorf("unable to Marshal volume config: %v", err)
}
configMapData[ProvisonerStorageClassCon... | go | func VolumeConfigToConfigMapData(config *ProvisionerConfiguration) (map[string]string, error) {
configMapData := make(map[string]string)
val, err := yaml.Marshal(config.StorageClassConfig)
if err != nil {
return nil, fmt.Errorf("unable to Marshal volume config: %v", err)
}
configMapData[ProvisonerStorageClassCon... | [
"func",
"VolumeConfigToConfigMapData",
"(",
"config",
"*",
"ProvisionerConfiguration",
")",
"(",
"map",
"[",
"string",
"]",
"string",
",",
"error",
")",
"{",
"configMapData",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n",
"val",
",",
"e... | // VolumeConfigToConfigMapData converts volume config to configmap data. | [
"VolumeConfigToConfigMapData",
"converts",
"volume",
"config",
"to",
"configmap",
"data",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/common/common.go#L258-L279 |
25,604 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/common/common.go | ConfigMapDataToVolumeConfig | func ConfigMapDataToVolumeConfig(data map[string]string, provisionerConfig *ProvisionerConfiguration) error {
rawYaml := ""
for key, val := range data {
rawYaml += key
rawYaml += ": \n"
rawYaml += insertSpaces(string(val))
}
if err := yaml.Unmarshal([]byte(rawYaml), provisionerConfig); err != nil {
return ... | go | func ConfigMapDataToVolumeConfig(data map[string]string, provisionerConfig *ProvisionerConfiguration) error {
rawYaml := ""
for key, val := range data {
rawYaml += key
rawYaml += ": \n"
rawYaml += insertSpaces(string(val))
}
if err := yaml.Unmarshal([]byte(rawYaml), provisionerConfig); err != nil {
return ... | [
"func",
"ConfigMapDataToVolumeConfig",
"(",
"data",
"map",
"[",
"string",
"]",
"string",
",",
"provisionerConfig",
"*",
"ProvisionerConfiguration",
")",
"error",
"{",
"rawYaml",
":=",
"\"",
"\"",
"\n",
"for",
"key",
",",
"val",
":=",
"range",
"data",
"{",
"r... | // ConfigMapDataToVolumeConfig converts configmap data to volume config. | [
"ConfigMapDataToVolumeConfig",
"converts",
"configmap",
"data",
"to",
"volume",
"config",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/common/common.go#L282-L325 |
25,605 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/common/common.go | LoadProvisionerConfigs | func LoadProvisionerConfigs(configPath string, provisionerConfig *ProvisionerConfiguration) error {
files, err := ioutil.ReadDir(configPath)
if err != nil {
return err
}
data := make(map[string]string)
for _, file := range files {
if !file.IsDir() {
if strings.Compare(file.Name(), "..data") != 0 {
fileC... | go | func LoadProvisionerConfigs(configPath string, provisionerConfig *ProvisionerConfiguration) error {
files, err := ioutil.ReadDir(configPath)
if err != nil {
return err
}
data := make(map[string]string)
for _, file := range files {
if !file.IsDir() {
if strings.Compare(file.Name(), "..data") != 0 {
fileC... | [
"func",
"LoadProvisionerConfigs",
"(",
"configPath",
"string",
",",
"provisionerConfig",
"*",
"ProvisionerConfiguration",
")",
"error",
"{",
"files",
",",
"err",
":=",
"ioutil",
".",
"ReadDir",
"(",
"configPath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"retu... | // LoadProvisionerConfigs loads all configuration into a string and unmarshal it into ProvisionerConfiguration struct.
// The configuration is stored in the configmap which is mounted as a volume. | [
"LoadProvisionerConfigs",
"loads",
"all",
"configuration",
"into",
"a",
"string",
"and",
"unmarshal",
"it",
"into",
"ProvisionerConfiguration",
"struct",
".",
"The",
"configuration",
"is",
"stored",
"in",
"the",
"configmap",
"which",
"is",
"mounted",
"as",
"a",
"v... | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/common/common.go#L339-L358 |
25,606 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/common/common.go | SetupClient | func SetupClient() *kubernetes.Clientset {
var config *rest.Config
var err error
kubeconfigFile := os.Getenv(KubeConfigEnv)
if kubeconfigFile != "" {
config, err = BuildConfigFromFlags("", kubeconfigFile)
if err != nil {
glog.Fatalf("Error creating config from %s specified file: %s %v\n", KubeConfigEnv,
... | go | func SetupClient() *kubernetes.Clientset {
var config *rest.Config
var err error
kubeconfigFile := os.Getenv(KubeConfigEnv)
if kubeconfigFile != "" {
config, err = BuildConfigFromFlags("", kubeconfigFile)
if err != nil {
glog.Fatalf("Error creating config from %s specified file: %s %v\n", KubeConfigEnv,
... | [
"func",
"SetupClient",
"(",
")",
"*",
"kubernetes",
".",
"Clientset",
"{",
"var",
"config",
"*",
"rest",
".",
"Config",
"\n",
"var",
"err",
"error",
"\n\n",
"kubeconfigFile",
":=",
"os",
".",
"Getenv",
"(",
"KubeConfigEnv",
")",
"\n",
"if",
"kubeconfigFile... | // SetupClient created client using either in-cluster configuration or if KUBECONFIG environment variable is specified then using that config. | [
"SetupClient",
"created",
"client",
"using",
"either",
"in",
"-",
"cluster",
"configuration",
"or",
"if",
"KUBECONFIG",
"environment",
"variable",
"is",
"specified",
"then",
"using",
"that",
"config",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/common/common.go#L361-L386 |
25,607 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/common/common.go | GenerateMountName | func GenerateMountName(mount *MountConfig) string {
h := fnv.New32a()
h.Write([]byte(mount.HostDir))
h.Write([]byte(mount.MountDir))
return fmt.Sprintf("mount-%x", h.Sum32())
} | go | func GenerateMountName(mount *MountConfig) string {
h := fnv.New32a()
h.Write([]byte(mount.HostDir))
h.Write([]byte(mount.MountDir))
return fmt.Sprintf("mount-%x", h.Sum32())
} | [
"func",
"GenerateMountName",
"(",
"mount",
"*",
"MountConfig",
")",
"string",
"{",
"h",
":=",
"fnv",
".",
"New32a",
"(",
")",
"\n",
"h",
".",
"Write",
"(",
"[",
"]",
"byte",
"(",
"mount",
".",
"HostDir",
")",
")",
"\n",
"h",
".",
"Write",
"(",
"[... | // GenerateMountName generates a volumeMount.name for pod spec, based on volume configuration. | [
"GenerateMountName",
"generates",
"a",
"volumeMount",
".",
"name",
"for",
"pod",
"spec",
"based",
"on",
"volume",
"configuration",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/common/common.go#L389-L394 |
25,608 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/common/common.go | GetVolumeMode | func GetVolumeMode(volUtil util.VolumeUtil, fullPath string) (v1.PersistentVolumeMode, error) {
isdir, errdir := volUtil.IsDir(fullPath)
if isdir {
return v1.PersistentVolumeFilesystem, nil
}
// check for Block before returning errdir
isblk, errblk := volUtil.IsBlock(fullPath)
if isblk {
return v1.PersistentV... | go | func GetVolumeMode(volUtil util.VolumeUtil, fullPath string) (v1.PersistentVolumeMode, error) {
isdir, errdir := volUtil.IsDir(fullPath)
if isdir {
return v1.PersistentVolumeFilesystem, nil
}
// check for Block before returning errdir
isblk, errblk := volUtil.IsBlock(fullPath)
if isblk {
return v1.PersistentV... | [
"func",
"GetVolumeMode",
"(",
"volUtil",
"util",
".",
"VolumeUtil",
",",
"fullPath",
"string",
")",
"(",
"v1",
".",
"PersistentVolumeMode",
",",
"error",
")",
"{",
"isdir",
",",
"errdir",
":=",
"volUtil",
".",
"IsDir",
"(",
"fullPath",
")",
"\n",
"if",
"... | // GetVolumeMode check volume mode of given path. | [
"GetVolumeMode",
"check",
"volume",
"mode",
"of",
"given",
"path",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/common/common.go#L397-L417 |
25,609 | kubernetes-incubator/external-storage | nfs/pkg/volume/delete.go | Delete | func (p *nfsProvisioner) Delete(volume *v1.PersistentVolume) error {
// Ignore the call if this provisioner was not the one to provision the
// volume. It doesn't even attempt to delete it, so it's neither a success
// (nil error) nor failure (any other error)
provisioned, err := p.provisioned(volume)
if err != ni... | go | func (p *nfsProvisioner) Delete(volume *v1.PersistentVolume) error {
// Ignore the call if this provisioner was not the one to provision the
// volume. It doesn't even attempt to delete it, so it's neither a success
// (nil error) nor failure (any other error)
provisioned, err := p.provisioned(volume)
if err != ni... | [
"func",
"(",
"p",
"*",
"nfsProvisioner",
")",
"Delete",
"(",
"volume",
"*",
"v1",
".",
"PersistentVolume",
")",
"error",
"{",
"// Ignore the call if this provisioner was not the one to provision the",
"// volume. It doesn't even attempt to delete it, so it's neither a success",
"... | // Delete removes the directory that was created by Provision backing the given
// PV and removes its export from the NFS server. | [
"Delete",
"removes",
"the",
"directory",
"that",
"was",
"created",
"by",
"Provision",
"backing",
"the",
"given",
"PV",
"and",
"removes",
"its",
"export",
"from",
"the",
"NFS",
"server",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/nfs/pkg/volume/delete.go#L31-L60 |
25,610 | kubernetes-incubator/external-storage | digitalocean/pkg/volume/provision.go | NewDigitalOceanProvisioner | func NewDigitalOceanProvisioner(ctx context.Context, client kubernetes.Interface, doClient *godo.Client) controller.Provisioner {
var identity types.UID
provisioner := &digitaloceanProvisioner{
client: client,
doClient: doClient,
ctx: ctx,
identity: identity,
}
return provisioner
} | go | func NewDigitalOceanProvisioner(ctx context.Context, client kubernetes.Interface, doClient *godo.Client) controller.Provisioner {
var identity types.UID
provisioner := &digitaloceanProvisioner{
client: client,
doClient: doClient,
ctx: ctx,
identity: identity,
}
return provisioner
} | [
"func",
"NewDigitalOceanProvisioner",
"(",
"ctx",
"context",
".",
"Context",
",",
"client",
"kubernetes",
".",
"Interface",
",",
"doClient",
"*",
"godo",
".",
"Client",
")",
"controller",
".",
"Provisioner",
"{",
"var",
"identity",
"types",
".",
"UID",
"\n\n",... | // NewDigitalOceanProvisioner creates a new DigitalOcean provisioner | [
"NewDigitalOceanProvisioner",
"creates",
"a",
"new",
"DigitalOcean",
"provisioner"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/digitalocean/pkg/volume/provision.go#L50-L61 |
25,611 | kubernetes-incubator/external-storage | iscsi/targetd/provisioner/iscsi-provisioner.go | getAccessModes | func (p *iscsiProvisioner) getAccessModes() []v1.PersistentVolumeAccessMode {
return []v1.PersistentVolumeAccessMode{
v1.ReadWriteOnce,
v1.ReadOnlyMany,
}
} | go | func (p *iscsiProvisioner) getAccessModes() []v1.PersistentVolumeAccessMode {
return []v1.PersistentVolumeAccessMode{
v1.ReadWriteOnce,
v1.ReadOnlyMany,
}
} | [
"func",
"(",
"p",
"*",
"iscsiProvisioner",
")",
"getAccessModes",
"(",
")",
"[",
"]",
"v1",
".",
"PersistentVolumeAccessMode",
"{",
"return",
"[",
"]",
"v1",
".",
"PersistentVolumeAccessMode",
"{",
"v1",
".",
"ReadWriteOnce",
",",
"v1",
".",
"ReadOnlyMany",
... | // getAccessModes returns access modes iscsi volume supported. | [
"getAccessModes",
"returns",
"access",
"modes",
"iscsi",
"volume",
"supported",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/iscsi/targetd/provisioner/iscsi-provisioner.go#L104-L109 |
25,612 | kubernetes-incubator/external-storage | iscsi/targetd/provisioner/iscsi-provisioner.go | getFirstAvailableLun | func getFirstAvailableLun(exportList exportList) (int32, error) {
sort.Sort(exportList)
log.Debug("sorted export List: ", exportList)
//this is sloppy way to remove duplicates
uniqueExport := make(map[int32]export)
for _, export := range exportList {
uniqueExport[export.Lun] = export
}
log.Debug("unique luns s... | go | func getFirstAvailableLun(exportList exportList) (int32, error) {
sort.Sort(exportList)
log.Debug("sorted export List: ", exportList)
//this is sloppy way to remove duplicates
uniqueExport := make(map[int32]export)
for _, export := range exportList {
uniqueExport[export.Lun] = export
}
log.Debug("unique luns s... | [
"func",
"getFirstAvailableLun",
"(",
"exportList",
"exportList",
")",
"(",
"int32",
",",
"error",
")",
"{",
"sort",
".",
"Sort",
"(",
"exportList",
")",
"\n",
"log",
".",
"Debug",
"(",
"\"",
"\"",
",",
"exportList",
")",
"\n",
"//this is sloppy way to remove... | // getFirstAvailableLun gets first available Lun. | [
"getFirstAvailableLun",
"gets",
"first",
"available",
"Lun",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/iscsi/targetd/provisioner/iscsi-provisioner.go#L312-L348 |
25,613 | kubernetes-incubator/external-storage | iscsi/targetd/provisioner/iscsi-provisioner.go | volDestroy | func (p *iscsiProvisioner) volDestroy(vol string, pool string) error {
client, err := p.getConnection()
defer client.Close()
if err != nil {
log.Warnln(err)
return err
}
args := volDestroyArgs{
Pool: pool,
Name: vol,
}
err = client.Call("vol_destroy", args, nil)
return err
} | go | func (p *iscsiProvisioner) volDestroy(vol string, pool string) error {
client, err := p.getConnection()
defer client.Close()
if err != nil {
log.Warnln(err)
return err
}
args := volDestroyArgs{
Pool: pool,
Name: vol,
}
err = client.Call("vol_destroy", args, nil)
return err
} | [
"func",
"(",
"p",
"*",
"iscsiProvisioner",
")",
"volDestroy",
"(",
"vol",
"string",
",",
"pool",
"string",
")",
"error",
"{",
"client",
",",
"err",
":=",
"p",
".",
"getConnection",
"(",
")",
"\n",
"defer",
"client",
".",
"Close",
"(",
")",
"\n",
"if"... | // volDestroy removes calls vol_destroy targetd API to remove volume. | [
"volDestroy",
"removes",
"calls",
"vol_destroy",
"targetd",
"API",
"to",
"remove",
"volume",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/iscsi/targetd/provisioner/iscsi-provisioner.go#L351-L364 |
25,614 | kubernetes-incubator/external-storage | iscsi/targetd/provisioner/iscsi-provisioner.go | exportDestroy | func (p *iscsiProvisioner) exportDestroy(vol string, pool string, initiator string) error {
client, err := p.getConnection()
defer client.Close()
if err != nil {
log.Warnln(err)
return err
}
args := exportDestroyArgs{
Pool: pool,
Vol: vol,
InitiatorWwn: initiator,
}
err = client.Call("... | go | func (p *iscsiProvisioner) exportDestroy(vol string, pool string, initiator string) error {
client, err := p.getConnection()
defer client.Close()
if err != nil {
log.Warnln(err)
return err
}
args := exportDestroyArgs{
Pool: pool,
Vol: vol,
InitiatorWwn: initiator,
}
err = client.Call("... | [
"func",
"(",
"p",
"*",
"iscsiProvisioner",
")",
"exportDestroy",
"(",
"vol",
"string",
",",
"pool",
"string",
",",
"initiator",
"string",
")",
"error",
"{",
"client",
",",
"err",
":=",
"p",
".",
"getConnection",
"(",
")",
"\n",
"defer",
"client",
".",
... | // exportDestroy calls export_destroy targetd API to remove export of volume. | [
"exportDestroy",
"calls",
"export_destroy",
"targetd",
"API",
"to",
"remove",
"export",
"of",
"volume",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/iscsi/targetd/provisioner/iscsi-provisioner.go#L367-L381 |
25,615 | kubernetes-incubator/external-storage | iscsi/targetd/provisioner/iscsi-provisioner.go | volCreate | func (p *iscsiProvisioner) volCreate(name string, size int64, pool string) error {
client, err := p.getConnection()
defer client.Close()
if err != nil {
log.Warnln(err)
return err
}
args := volCreateArgs{
Pool: pool,
Name: name,
Size: size,
}
err = client.Call("vol_create", args, nil)
return err
} | go | func (p *iscsiProvisioner) volCreate(name string, size int64, pool string) error {
client, err := p.getConnection()
defer client.Close()
if err != nil {
log.Warnln(err)
return err
}
args := volCreateArgs{
Pool: pool,
Name: name,
Size: size,
}
err = client.Call("vol_create", args, nil)
return err
} | [
"func",
"(",
"p",
"*",
"iscsiProvisioner",
")",
"volCreate",
"(",
"name",
"string",
",",
"size",
"int64",
",",
"pool",
"string",
")",
"error",
"{",
"client",
",",
"err",
":=",
"p",
".",
"getConnection",
"(",
")",
"\n",
"defer",
"client",
".",
"Close",
... | // volCreate calls vol_create targetd API to create a volume. | [
"volCreate",
"calls",
"vol_create",
"targetd",
"API",
"to",
"create",
"a",
"volume",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/iscsi/targetd/provisioner/iscsi-provisioner.go#L384-L398 |
25,616 | kubernetes-incubator/external-storage | iscsi/targetd/provisioner/iscsi-provisioner.go | exportCreate | func (p *iscsiProvisioner) exportCreate(vol string, lun int32, pool string, initiator string) error {
client, err := p.getConnection()
defer client.Close()
if err != nil {
log.Warnln(err)
return err
}
args := exportCreateArgs{
Pool: pool,
Vol: vol,
InitiatorWwn: initiator,
Lun: ... | go | func (p *iscsiProvisioner) exportCreate(vol string, lun int32, pool string, initiator string) error {
client, err := p.getConnection()
defer client.Close()
if err != nil {
log.Warnln(err)
return err
}
args := exportCreateArgs{
Pool: pool,
Vol: vol,
InitiatorWwn: initiator,
Lun: ... | [
"func",
"(",
"p",
"*",
"iscsiProvisioner",
")",
"exportCreate",
"(",
"vol",
"string",
",",
"lun",
"int32",
",",
"pool",
"string",
",",
"initiator",
"string",
")",
"error",
"{",
"client",
",",
"err",
":=",
"p",
".",
"getConnection",
"(",
")",
"\n",
"def... | // exportCreate calls export_create targetd API to create an export of volume. | [
"exportCreate",
"calls",
"export_create",
"targetd",
"API",
"to",
"create",
"an",
"export",
"of",
"volume",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/iscsi/targetd/provisioner/iscsi-provisioner.go#L401-L416 |
25,617 | kubernetes-incubator/external-storage | iscsi/targetd/provisioner/iscsi-provisioner.go | exportList | func (p *iscsiProvisioner) exportList() (exportList, error) {
client, err := p.getConnection()
defer client.Close()
if err != nil {
log.Warnln(err)
return nil, err
}
var result1 exportList
err = client.Call("export_list", nil, &result1)
return result1, err
} | go | func (p *iscsiProvisioner) exportList() (exportList, error) {
client, err := p.getConnection()
defer client.Close()
if err != nil {
log.Warnln(err)
return nil, err
}
var result1 exportList
err = client.Call("export_list", nil, &result1)
return result1, err
} | [
"func",
"(",
"p",
"*",
"iscsiProvisioner",
")",
"exportList",
"(",
")",
"(",
"exportList",
",",
"error",
")",
"{",
"client",
",",
"err",
":=",
"p",
".",
"getConnection",
"(",
")",
"\n",
"defer",
"client",
".",
"Close",
"(",
")",
"\n",
"if",
"err",
... | // exportList lists calls export_list targetd API to get export objects. | [
"exportList",
"lists",
"calls",
"export_list",
"targetd",
"API",
"to",
"get",
"export",
"objects",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/iscsi/targetd/provisioner/iscsi-provisioner.go#L419-L429 |
25,618 | kubernetes-incubator/external-storage | repo-infra/kazel/sourcerer.go | walkSource | func (v *Vendorer) walkSource(pkgPath string) ([]string, error) {
// clean pkgPath since we access v.newRules directly
pkgPath = filepath.Clean(pkgPath)
for _, r := range v.skippedPaths {
if r.Match([]byte(pkgPath)) {
return nil, nil
}
}
files, err := ioutil.ReadDir(pkgPath)
if err != nil {
return nil, e... | go | func (v *Vendorer) walkSource(pkgPath string) ([]string, error) {
// clean pkgPath since we access v.newRules directly
pkgPath = filepath.Clean(pkgPath)
for _, r := range v.skippedPaths {
if r.Match([]byte(pkgPath)) {
return nil, nil
}
}
files, err := ioutil.ReadDir(pkgPath)
if err != nil {
return nil, e... | [
"func",
"(",
"v",
"*",
"Vendorer",
")",
"walkSource",
"(",
"pkgPath",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"// clean pkgPath since we access v.newRules directly",
"pkgPath",
"=",
"filepath",
".",
"Clean",
"(",
"pkgPath",
")",
"\n",
... | // walkSource walks the source tree recursively from pkgPath, adding
// any BUILD files to v.newRules to be formatted.
//
// If AddSourcesRules is enabled in the kazel config, then we additionally add
// package-sources and recursive all-srcs filegroups rules to every BUILD file.
//
// Returns the list of children all-... | [
"walkSource",
"walks",
"the",
"source",
"tree",
"recursively",
"from",
"pkgPath",
"adding",
"any",
"BUILD",
"files",
"to",
"v",
".",
"newRules",
"to",
"be",
"formatted",
".",
"If",
"AddSourcesRules",
"is",
"enabled",
"in",
"the",
"kazel",
"config",
"then",
"... | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/repo-infra/kazel/sourcerer.go#L40-L107 |
25,619 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/openstack/openstack_client.go | NewNetworkV2 | func (os *OpenStack) NewNetworkV2() (*gophercloud.ServiceClient, error) {
network, err := openstack.NewNetworkV2(os.provider, gophercloud.EndpointOpts{
Region: os.region,
})
if err != nil {
glog.Warningf("Failed to find network v2 endpoint: %v", err)
return nil, err
}
return network, nil
} | go | func (os *OpenStack) NewNetworkV2() (*gophercloud.ServiceClient, error) {
network, err := openstack.NewNetworkV2(os.provider, gophercloud.EndpointOpts{
Region: os.region,
})
if err != nil {
glog.Warningf("Failed to find network v2 endpoint: %v", err)
return nil, err
}
return network, nil
} | [
"func",
"(",
"os",
"*",
"OpenStack",
")",
"NewNetworkV2",
"(",
")",
"(",
"*",
"gophercloud",
".",
"ServiceClient",
",",
"error",
")",
"{",
"network",
",",
"err",
":=",
"openstack",
".",
"NewNetworkV2",
"(",
"os",
".",
"provider",
",",
"gophercloud",
".",... | // NewNetworkV2 creates a new Network V2 endpoint | [
"NewNetworkV2",
"creates",
"a",
"new",
"Network",
"V2",
"endpoint"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/openstack/openstack_client.go#L27-L36 |
25,620 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/openstack/openstack_client.go | NewComputeV2 | func (os *OpenStack) NewComputeV2() (*gophercloud.ServiceClient, error) {
compute, err := openstack.NewComputeV2(os.provider, gophercloud.EndpointOpts{
Region: os.region,
})
if err != nil {
glog.Warningf("Failed to find compute v2 endpoint: %v", err)
return nil, err
}
return compute, nil
} | go | func (os *OpenStack) NewComputeV2() (*gophercloud.ServiceClient, error) {
compute, err := openstack.NewComputeV2(os.provider, gophercloud.EndpointOpts{
Region: os.region,
})
if err != nil {
glog.Warningf("Failed to find compute v2 endpoint: %v", err)
return nil, err
}
return compute, nil
} | [
"func",
"(",
"os",
"*",
"OpenStack",
")",
"NewComputeV2",
"(",
")",
"(",
"*",
"gophercloud",
".",
"ServiceClient",
",",
"error",
")",
"{",
"compute",
",",
"err",
":=",
"openstack",
".",
"NewComputeV2",
"(",
"os",
".",
"provider",
",",
"gophercloud",
".",... | // NewComputeV2 creates a new Compute V2 endpoint | [
"NewComputeV2",
"creates",
"a",
"new",
"Compute",
"V2",
"endpoint"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/openstack/openstack_client.go#L39-L48 |
25,621 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/openstack/openstack_volumes.go | OperationPending | func (os *OpenStack) OperationPending(diskName string) (bool, string, error) {
volume, err := os.getVolume(diskName)
if err != nil {
return false, "", err
}
volumeStatus := volume.Status
if volumeStatus == VolumeErrorStatus {
glog.Errorf("status of volume %s is %s", diskName, volumeStatus)
return false, volu... | go | func (os *OpenStack) OperationPending(diskName string) (bool, string, error) {
volume, err := os.getVolume(diskName)
if err != nil {
return false, "", err
}
volumeStatus := volume.Status
if volumeStatus == VolumeErrorStatus {
glog.Errorf("status of volume %s is %s", diskName, volumeStatus)
return false, volu... | [
"func",
"(",
"os",
"*",
"OpenStack",
")",
"OperationPending",
"(",
"diskName",
"string",
")",
"(",
"bool",
",",
"string",
",",
"error",
")",
"{",
"volume",
",",
"err",
":=",
"os",
".",
"getVolume",
"(",
"diskName",
")",
"\n",
"if",
"err",
"!=",
"nil"... | // OperationPending checks status, makes sure we're not in error state | [
"OperationPending",
"checks",
"status",
"makes",
"sure",
"we",
"re",
"not",
"in",
"error",
"state"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/openstack/openstack_volumes.go#L135-L149 |
25,622 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/openstack/openstack_volumes.go | AttachDisk | func (os *OpenStack) AttachDisk(instanceID, volumeID string) (string, error) {
volume, err := os.getVolume(volumeID)
if err != nil {
return "", err
}
if volume.Status != VolumeAvailableStatus {
errmsg := fmt.Sprintf("volume %s status is %s, not %s, can not be attached to instance %s.", volume.Name, volume.Statu... | go | func (os *OpenStack) AttachDisk(instanceID, volumeID string) (string, error) {
volume, err := os.getVolume(volumeID)
if err != nil {
return "", err
}
if volume.Status != VolumeAvailableStatus {
errmsg := fmt.Sprintf("volume %s status is %s, not %s, can not be attached to instance %s.", volume.Name, volume.Statu... | [
"func",
"(",
"os",
"*",
"OpenStack",
")",
"AttachDisk",
"(",
"instanceID",
",",
"volumeID",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"volume",
",",
"err",
":=",
"os",
".",
"getVolume",
"(",
"volumeID",
")",
"\n",
"if",
"err",
"!=",
"nil"... | // AttachDisk attaches specified cinder volume to the compute running kubelet | [
"AttachDisk",
"attaches",
"specified",
"cinder",
"volume",
"to",
"the",
"compute",
"running",
"kubelet"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/openstack/openstack_volumes.go#L152-L189 |
25,623 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/openstack/openstack_volumes.go | DeleteVolume | func (os *OpenStack) DeleteVolume(volumeID string) error {
used, err := os.diskIsUsed(volumeID)
if err != nil {
return err
}
if used {
msg := fmt.Sprintf("Cannot delete the volume %q, it's still attached to a node", volumeID)
return k8sVolume.NewDeletedVolumeInUseError(msg)
}
volumes, err := os.volumeServi... | go | func (os *OpenStack) DeleteVolume(volumeID string) error {
used, err := os.diskIsUsed(volumeID)
if err != nil {
return err
}
if used {
msg := fmt.Sprintf("Cannot delete the volume %q, it's still attached to a node", volumeID)
return k8sVolume.NewDeletedVolumeInUseError(msg)
}
volumes, err := os.volumeServi... | [
"func",
"(",
"os",
"*",
"OpenStack",
")",
"DeleteVolume",
"(",
"volumeID",
"string",
")",
"error",
"{",
"used",
",",
"err",
":=",
"os",
".",
"diskIsUsed",
"(",
"volumeID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
... | // DeleteVolume deletes the specified volume | [
"DeleteVolume",
"deletes",
"the",
"specified",
"volume"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/openstack/openstack_volumes.go#L291-L313 |
25,624 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/openstack/openstack_volumes.go | GetAttachmentDiskPath | func (os *OpenStack) GetAttachmentDiskPath(instanceID, volumeID string) (string, error) {
// See issue #33128 - Cinder does not always tell you the right device path, as such
// we must only use this value as a last resort.
volume, err := os.getVolume(volumeID)
if err != nil {
return "", err
}
if volume.Status ... | go | func (os *OpenStack) GetAttachmentDiskPath(instanceID, volumeID string) (string, error) {
// See issue #33128 - Cinder does not always tell you the right device path, as such
// we must only use this value as a last resort.
volume, err := os.getVolume(volumeID)
if err != nil {
return "", err
}
if volume.Status ... | [
"func",
"(",
"os",
"*",
"OpenStack",
")",
"GetAttachmentDiskPath",
"(",
"instanceID",
",",
"volumeID",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"// See issue #33128 - Cinder does not always tell you the right device path, as such",
"// we must only use this value... | // GetAttachmentDiskPath retrieves device path of attached volume to the compute running kubelet, as known by cinder | [
"GetAttachmentDiskPath",
"retrieves",
"device",
"path",
"of",
"attached",
"volume",
"to",
"the",
"compute",
"running",
"kubelet",
"as",
"known",
"by",
"cinder"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/openstack/openstack_volumes.go#L316-L339 |
25,625 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/populator/populator.go | NewPopulator | func NewPopulator(config *common.RuntimeConfig) *Populator {
p := &Populator{RuntimeConfig: config}
sharedInformer := config.InformerFactory.Core().V1().PersistentVolumes()
sharedInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
pv, ok := obj.(*v1.PersistentVo... | go | func NewPopulator(config *common.RuntimeConfig) *Populator {
p := &Populator{RuntimeConfig: config}
sharedInformer := config.InformerFactory.Core().V1().PersistentVolumes()
sharedInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
pv, ok := obj.(*v1.PersistentVo... | [
"func",
"NewPopulator",
"(",
"config",
"*",
"common",
".",
"RuntimeConfig",
")",
"*",
"Populator",
"{",
"p",
":=",
"&",
"Populator",
"{",
"RuntimeConfig",
":",
"config",
"}",
"\n",
"sharedInformer",
":=",
"config",
".",
"InformerFactory",
".",
"Core",
"(",
... | // NewPopulator returns a Populator object to update the PV cache | [
"NewPopulator",
"returns",
"a",
"Populator",
"object",
"to",
"update",
"the",
"PV",
"cache"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/populator/populator.go#L33-L63 |
25,626 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/volume_util.go | IsDir | func (u *volumeUtil) IsDir(fullPath string) (bool, error) {
dir, err := os.Open(fullPath)
if err != nil {
return false, err
}
defer dir.Close()
stat, err := dir.Stat()
if err != nil {
return false, err
}
return stat.IsDir(), nil
} | go | func (u *volumeUtil) IsDir(fullPath string) (bool, error) {
dir, err := os.Open(fullPath)
if err != nil {
return false, err
}
defer dir.Close()
stat, err := dir.Stat()
if err != nil {
return false, err
}
return stat.IsDir(), nil
} | [
"func",
"(",
"u",
"*",
"volumeUtil",
")",
"IsDir",
"(",
"fullPath",
"string",
")",
"(",
"bool",
",",
"error",
")",
"{",
"dir",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"fullPath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"false",
",",... | // IsDir checks if the given path is a directory | [
"IsDir",
"checks",
"if",
"the",
"given",
"path",
"is",
"a",
"directory"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/volume_util.go#L61-L74 |
25,627 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/volume_util.go | ReadDir | func (u *volumeUtil) ReadDir(fullPath string) ([]string, error) {
dir, err := os.Open(fullPath)
if err != nil {
return nil, err
}
defer dir.Close()
files, err := dir.Readdirnames(-1)
if err != nil {
return nil, err
}
return files, nil
} | go | func (u *volumeUtil) ReadDir(fullPath string) ([]string, error) {
dir, err := os.Open(fullPath)
if err != nil {
return nil, err
}
defer dir.Close()
files, err := dir.Readdirnames(-1)
if err != nil {
return nil, err
}
return files, nil
} | [
"func",
"(",
"u",
"*",
"volumeUtil",
")",
"ReadDir",
"(",
"fullPath",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"dir",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"fullPath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",... | // ReadDir returns a list all the files under the given directory | [
"ReadDir",
"returns",
"a",
"list",
"all",
"the",
"files",
"under",
"the",
"given",
"directory"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/volume_util.go#L77-L89 |
25,628 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/volume_util.go | DeleteContents | func (u *volumeUtil) DeleteContents(fullPath string) error {
dir, err := os.Open(fullPath)
if err != nil {
return err
}
defer dir.Close()
files, err := dir.Readdirnames(-1)
if err != nil {
return err
}
errList := []error{}
for _, file := range files {
err = os.RemoveAll(filepath.Join(fullPath, file))
... | go | func (u *volumeUtil) DeleteContents(fullPath string) error {
dir, err := os.Open(fullPath)
if err != nil {
return err
}
defer dir.Close()
files, err := dir.Readdirnames(-1)
if err != nil {
return err
}
errList := []error{}
for _, file := range files {
err = os.RemoveAll(filepath.Join(fullPath, file))
... | [
"func",
"(",
"u",
"*",
"volumeUtil",
")",
"DeleteContents",
"(",
"fullPath",
"string",
")",
"error",
"{",
"dir",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"fullPath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"defe... | // DeleteContents deletes all the contents under the given directory | [
"DeleteContents",
"deletes",
"all",
"the",
"contents",
"under",
"the",
"given",
"directory"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/volume_util.go#L92-L112 |
25,629 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/volume_util.go | GetFsCapacityByte | func (u *volumeUtil) GetFsCapacityByte(fullPath string) (int64, error) {
_, capacity, _, _, _, _, err := fs.FsInfo(fullPath)
return capacity, err
} | go | func (u *volumeUtil) GetFsCapacityByte(fullPath string) (int64, error) {
_, capacity, _, _, _, _, err := fs.FsInfo(fullPath)
return capacity, err
} | [
"func",
"(",
"u",
"*",
"volumeUtil",
")",
"GetFsCapacityByte",
"(",
"fullPath",
"string",
")",
"(",
"int64",
",",
"error",
")",
"{",
"_",
",",
"capacity",
",",
"_",
",",
"_",
",",
"_",
",",
"_",
",",
"err",
":=",
"fs",
".",
"FsInfo",
"(",
"fullPa... | // GetFsCapacityByte returns capacity in bytes about a mounted filesystem.
// fullPath is the pathname of any file within the mounted filesystem. Capacity
// returned here is total capacity. | [
"GetFsCapacityByte",
"returns",
"capacity",
"in",
"bytes",
"about",
"a",
"mounted",
"filesystem",
".",
"fullPath",
"is",
"the",
"pathname",
"of",
"any",
"file",
"within",
"the",
"mounted",
"filesystem",
".",
"Capacity",
"returned",
"here",
"is",
"total",
"capaci... | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/volume_util.go#L117-L120 |
25,630 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/volume_util.go | NewFakeVolumeUtil | func NewFakeVolumeUtil(deleteShouldFail bool, dirFiles map[string][]*FakeDirEntry) *FakeVolumeUtil {
return &FakeVolumeUtil{
directoryFiles: dirFiles,
deleteShouldFail: deleteShouldFail,
}
} | go | func NewFakeVolumeUtil(deleteShouldFail bool, dirFiles map[string][]*FakeDirEntry) *FakeVolumeUtil {
return &FakeVolumeUtil{
directoryFiles: dirFiles,
deleteShouldFail: deleteShouldFail,
}
} | [
"func",
"NewFakeVolumeUtil",
"(",
"deleteShouldFail",
"bool",
",",
"dirFiles",
"map",
"[",
"string",
"]",
"[",
"]",
"*",
"FakeDirEntry",
")",
"*",
"FakeVolumeUtil",
"{",
"return",
"&",
"FakeVolumeUtil",
"{",
"directoryFiles",
":",
"dirFiles",
",",
"deleteShouldF... | // NewFakeVolumeUtil returns a VolumeUtil object for use in unit testing | [
"NewFakeVolumeUtil",
"returns",
"a",
"VolumeUtil",
"object",
"for",
"use",
"in",
"unit",
"testing"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/volume_util.go#L151-L156 |
25,631 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/volume_util.go | ReadDir | func (u *FakeVolumeUtil) ReadDir(fullPath string) ([]string, error) {
fileNames := []string{}
files, found := u.directoryFiles[fullPath]
if !found {
return nil, fmt.Errorf("Directory %q not found", fullPath)
}
for _, file := range files {
fileNames = append(fileNames, file.Name)
}
return fileNames, nil
} | go | func (u *FakeVolumeUtil) ReadDir(fullPath string) ([]string, error) {
fileNames := []string{}
files, found := u.directoryFiles[fullPath]
if !found {
return nil, fmt.Errorf("Directory %q not found", fullPath)
}
for _, file := range files {
fileNames = append(fileNames, file.Name)
}
return fileNames, nil
} | [
"func",
"(",
"u",
"*",
"FakeVolumeUtil",
")",
"ReadDir",
"(",
"fullPath",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"fileNames",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"files",
",",
"found",
":=",
"u",
".",
"directoryFiles",
... | // ReadDir returns the list of all files under the given directory | [
"ReadDir",
"returns",
"the",
"list",
"of",
"all",
"files",
"under",
"the",
"given",
"directory"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/volume_util.go#L197-L207 |
25,632 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/volume_util.go | DeleteContents | func (u *FakeVolumeUtil) DeleteContents(fullPath string) error {
if u.deleteShouldFail {
return fmt.Errorf("Fake delete contents failed")
}
return nil
} | go | func (u *FakeVolumeUtil) DeleteContents(fullPath string) error {
if u.deleteShouldFail {
return fmt.Errorf("Fake delete contents failed")
}
return nil
} | [
"func",
"(",
"u",
"*",
"FakeVolumeUtil",
")",
"DeleteContents",
"(",
"fullPath",
"string",
")",
"error",
"{",
"if",
"u",
".",
"deleteShouldFail",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] | // DeleteContents removes all the contents under the given directory | [
"DeleteContents",
"removes",
"all",
"the",
"contents",
"under",
"the",
"given",
"directory"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/volume_util.go#L210-L215 |
25,633 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/volume_util.go | GetFsCapacityByte | func (u *FakeVolumeUtil) GetFsCapacityByte(fullPath string) (int64, error) {
return u.getDirEntryCapacity(fullPath, FakeEntryFile)
} | go | func (u *FakeVolumeUtil) GetFsCapacityByte(fullPath string) (int64, error) {
return u.getDirEntryCapacity(fullPath, FakeEntryFile)
} | [
"func",
"(",
"u",
"*",
"FakeVolumeUtil",
")",
"GetFsCapacityByte",
"(",
"fullPath",
"string",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"u",
".",
"getDirEntryCapacity",
"(",
"fullPath",
",",
"FakeEntryFile",
")",
"\n",
"}"
] | // GetFsCapacityByte returns capacity in byte about a mounted filesystem. | [
"GetFsCapacityByte",
"returns",
"capacity",
"in",
"byte",
"about",
"a",
"mounted",
"filesystem",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/volume_util.go#L218-L220 |
25,634 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/volume_util.go | GetBlockCapacityByte | func (u *FakeVolumeUtil) GetBlockCapacityByte(fullPath string) (int64, error) {
return u.getDirEntryCapacity(fullPath, FakeEntryBlock)
} | go | func (u *FakeVolumeUtil) GetBlockCapacityByte(fullPath string) (int64, error) {
return u.getDirEntryCapacity(fullPath, FakeEntryBlock)
} | [
"func",
"(",
"u",
"*",
"FakeVolumeUtil",
")",
"GetBlockCapacityByte",
"(",
"fullPath",
"string",
")",
"(",
"int64",
",",
"error",
")",
"{",
"return",
"u",
".",
"getDirEntryCapacity",
"(",
"fullPath",
",",
"FakeEntryBlock",
")",
"\n",
"}"
] | // GetBlockCapacityByte returns the space in the specified block device. | [
"GetBlockCapacityByte",
"returns",
"the",
"space",
"in",
"the",
"specified",
"block",
"device",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/volume_util.go#L223-L225 |
25,635 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/volume_util.go | AddNewDirEntries | func (u *FakeVolumeUtil) AddNewDirEntries(mountDir string, dirFiles map[string][]*FakeDirEntry) {
for dir, files := range dirFiles {
mountedPath := filepath.Join(mountDir, dir)
curFiles := u.directoryFiles[mountedPath]
if curFiles == nil {
curFiles = []*FakeDirEntry{}
}
glog.Infof("Adding to directory %q:... | go | func (u *FakeVolumeUtil) AddNewDirEntries(mountDir string, dirFiles map[string][]*FakeDirEntry) {
for dir, files := range dirFiles {
mountedPath := filepath.Join(mountDir, dir)
curFiles := u.directoryFiles[mountedPath]
if curFiles == nil {
curFiles = []*FakeDirEntry{}
}
glog.Infof("Adding to directory %q:... | [
"func",
"(",
"u",
"*",
"FakeVolumeUtil",
")",
"AddNewDirEntries",
"(",
"mountDir",
"string",
",",
"dirFiles",
"map",
"[",
"string",
"]",
"[",
"]",
"*",
"FakeDirEntry",
")",
"{",
"for",
"dir",
",",
"files",
":=",
"range",
"dirFiles",
"{",
"mountedPath",
"... | // AddNewDirEntries adds the given files to the current directory listing
// This is only for testing | [
"AddNewDirEntries",
"adds",
"the",
"given",
"files",
"to",
"the",
"current",
"directory",
"listing",
"This",
"is",
"only",
"for",
"testing"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/volume_util.go#L248-L258 |
25,636 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/types.go | GetSupportedVolumeFromPVSpec | func GetSupportedVolumeFromPVSpec(spec *core_v1.PersistentVolumeSpec) string {
if spec.HostPath != nil {
return "hostPath"
}
if spec.AWSElasticBlockStore != nil {
return "aws_ebs"
}
if spec.GCEPersistentDisk != nil {
return "gce-pd"
}
if spec.Cinder != nil {
return "cinder"
}
if spec.Glusterfs != nil {... | go | func GetSupportedVolumeFromPVSpec(spec *core_v1.PersistentVolumeSpec) string {
if spec.HostPath != nil {
return "hostPath"
}
if spec.AWSElasticBlockStore != nil {
return "aws_ebs"
}
if spec.GCEPersistentDisk != nil {
return "gce-pd"
}
if spec.Cinder != nil {
return "cinder"
}
if spec.Glusterfs != nil {... | [
"func",
"GetSupportedVolumeFromPVSpec",
"(",
"spec",
"*",
"core_v1",
".",
"PersistentVolumeSpec",
")",
"string",
"{",
"if",
"spec",
".",
"HostPath",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"if",
"spec",
".",
"AWSElasticBlockStore",
"!=",
"ni... | // GetSupportedVolumeFromPVSpec gets supported volume from PV spec | [
"GetSupportedVolumeFromPVSpec",
"gets",
"supported",
"volume",
"from",
"PV",
"spec"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/types.go#L261-L278 |
25,637 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/types.go | GetSupportedVolumeFromSnapshotDataSpec | func GetSupportedVolumeFromSnapshotDataSpec(spec *VolumeSnapshotDataSpec) string {
if spec.HostPath != nil {
return "hostPath"
}
if spec.AWSElasticBlockStore != nil {
return "aws_ebs"
}
if spec.GCEPersistentDiskSnapshot != nil {
return "gce-pd"
}
if spec.CinderSnapshot != nil {
return "cinder"
}
if spe... | go | func GetSupportedVolumeFromSnapshotDataSpec(spec *VolumeSnapshotDataSpec) string {
if spec.HostPath != nil {
return "hostPath"
}
if spec.AWSElasticBlockStore != nil {
return "aws_ebs"
}
if spec.GCEPersistentDiskSnapshot != nil {
return "gce-pd"
}
if spec.CinderSnapshot != nil {
return "cinder"
}
if spe... | [
"func",
"GetSupportedVolumeFromSnapshotDataSpec",
"(",
"spec",
"*",
"VolumeSnapshotDataSpec",
")",
"string",
"{",
"if",
"spec",
".",
"HostPath",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"if",
"spec",
".",
"AWSElasticBlockStore",
"!=",
"nil",
"{... | // GetSupportedVolumeFromSnapshotDataSpec gets supported volume from snapshot data spec | [
"GetSupportedVolumeFromSnapshotDataSpec",
"gets",
"supported",
"volume",
"from",
"snapshot",
"data",
"spec"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/types.go#L281-L298 |
25,638 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/types.go | UnmarshalJSON | func (v *VolumeSnapshot) UnmarshalJSON(data []byte) error {
tmp := VolumeSnapshotCopy{}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
tmp2 := VolumeSnapshot(tmp)
*v = tmp2
return nil
} | go | func (v *VolumeSnapshot) UnmarshalJSON(data []byte) error {
tmp := VolumeSnapshotCopy{}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
tmp2 := VolumeSnapshot(tmp)
*v = tmp2
return nil
} | [
"func",
"(",
"v",
"*",
"VolumeSnapshot",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"tmp",
":=",
"VolumeSnapshotCopy",
"{",
"}",
"\n",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"data",
",",
"&",
"tmp",
")",
"\n",
"if",
... | // UnmarshalJSON unmarshalls json data | [
"UnmarshalJSON",
"unmarshalls",
"json",
"data"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/types.go#L353-L362 |
25,639 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/openstack/openstack_snapshots.go | CreateSnapshot | func (os *OpenStack) CreateSnapshot(sourceVolumeID, name, description string, tags map[string]string) (string, string, error) {
snapshots, err := os.snapshotService()
if err != nil || snapshots == nil {
glog.Errorf("Unable to initialize cinder client for region: %s", os.region)
return "", "", fmt.Errorf("Failed t... | go | func (os *OpenStack) CreateSnapshot(sourceVolumeID, name, description string, tags map[string]string) (string, string, error) {
snapshots, err := os.snapshotService()
if err != nil || snapshots == nil {
glog.Errorf("Unable to initialize cinder client for region: %s", os.region)
return "", "", fmt.Errorf("Failed t... | [
"func",
"(",
"os",
"*",
"OpenStack",
")",
"CreateSnapshot",
"(",
"sourceVolumeID",
",",
"name",
",",
"description",
"string",
",",
"tags",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"string",
",",
"string",
",",
"error",
")",
"{",
"snapshots",
",",
... | // CreateSnapshot from the specified volume | [
"CreateSnapshot",
"from",
"the",
"specified",
"volume"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/openstack/openstack_snapshots.go#L144-L169 |
25,640 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/openstack/openstack_snapshots.go | DeleteSnapshot | func (os *OpenStack) DeleteSnapshot(snapshotID string) error {
snapshots, err := os.snapshotService()
if err != nil || snapshots == nil {
glog.Errorf("Unable to initialize cinder client for region: %s", os.region)
return err
}
err = snapshots.deleteSnapshot(snapshotID)
if err != nil {
glog.Errorf("Cannot de... | go | func (os *OpenStack) DeleteSnapshot(snapshotID string) error {
snapshots, err := os.snapshotService()
if err != nil || snapshots == nil {
glog.Errorf("Unable to initialize cinder client for region: %s", os.region)
return err
}
err = snapshots.deleteSnapshot(snapshotID)
if err != nil {
glog.Errorf("Cannot de... | [
"func",
"(",
"os",
"*",
"OpenStack",
")",
"DeleteSnapshot",
"(",
"snapshotID",
"string",
")",
"error",
"{",
"snapshots",
",",
"err",
":=",
"os",
".",
"snapshotService",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"||",
"snapshots",
"==",
"nil",
"{",
"glo... | // DeleteSnapshot deletes the specified snapshot | [
"DeleteSnapshot",
"deletes",
"the",
"specified",
"snapshot"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/openstack/openstack_snapshots.go#L172-L184 |
25,641 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/openstack/openstack_snapshots.go | FindSnapshot | func (os *OpenStack) FindSnapshot(tags map[string]string) ([]string, []string, error) {
var snapshotIDs, statuses []string
ss, err := os.snapshotService()
if err != nil || ss == nil {
glog.Errorf("Unable to initialize cinder client for region: %s", os.region)
return snapshotIDs, statuses, fmt.Errorf("Failed to f... | go | func (os *OpenStack) FindSnapshot(tags map[string]string) ([]string, []string, error) {
var snapshotIDs, statuses []string
ss, err := os.snapshotService()
if err != nil || ss == nil {
glog.Errorf("Unable to initialize cinder client for region: %s", os.region)
return snapshotIDs, statuses, fmt.Errorf("Failed to f... | [
"func",
"(",
"os",
"*",
"OpenStack",
")",
"FindSnapshot",
"(",
"tags",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"[",
"]",
"string",
",",
"[",
"]",
"string",
",",
"error",
")",
"{",
"var",
"snapshotIDs",
",",
"statuses",
"[",
"]",
"string",
"\... | // FindSnapshot finds snapshot by metadata | [
"FindSnapshot",
"finds",
"snapshot",
"by",
"metadata"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/openstack/openstack_snapshots.go#L210-L261 |
25,642 | kubernetes-incubator/external-storage | repo-infra/kazel/config.go | ReadCfg | func ReadCfg(cfgPath string) (*Cfg, error) {
b, err := ioutil.ReadFile(cfgPath)
if err != nil {
return nil, err
}
var cfg Cfg
if err := json.Unmarshal(b, &cfg); err != nil {
return nil, err
}
defaultCfg(&cfg)
return &cfg, nil
} | go | func ReadCfg(cfgPath string) (*Cfg, error) {
b, err := ioutil.ReadFile(cfgPath)
if err != nil {
return nil, err
}
var cfg Cfg
if err := json.Unmarshal(b, &cfg); err != nil {
return nil, err
}
defaultCfg(&cfg)
return &cfg, nil
} | [
"func",
"ReadCfg",
"(",
"cfgPath",
"string",
")",
"(",
"*",
"Cfg",
",",
"error",
")",
"{",
"b",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"cfgPath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
... | // ReadCfg reads and unmarshals the specified json file into a Cfg struct. | [
"ReadCfg",
"reads",
"and",
"unmarshals",
"the",
"specified",
"json",
"file",
"into",
"a",
"Cfg",
"struct",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/repo-infra/kazel/config.go#L41-L52 |
25,643 | kubernetes-incubator/external-storage | repo-infra/kazel/generator.go | findOpenAPI | func (v *Vendorer) findOpenAPI(root string) ([]string, error) {
finfos, err := ioutil.ReadDir(root)
if err != nil {
return nil, err
}
var res []string
var includeMe bool
for _, finfo := range finfos {
path := filepath.Join(root, finfo.Name())
if finfo.IsDir() && (finfo.Mode()&os.ModeSymlink == 0) {
child... | go | func (v *Vendorer) findOpenAPI(root string) ([]string, error) {
finfos, err := ioutil.ReadDir(root)
if err != nil {
return nil, err
}
var res []string
var includeMe bool
for _, finfo := range finfos {
path := filepath.Join(root, finfo.Name())
if finfo.IsDir() && (finfo.Mode()&os.ModeSymlink == 0) {
child... | [
"func",
"(",
"v",
"*",
"Vendorer",
")",
"findOpenAPI",
"(",
"root",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"finfos",
",",
"err",
":=",
"ioutil",
".",
"ReadDir",
"(",
"root",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"retu... | // findOpenAPI searches for all packages under root that request OpenAPI. It
// returns the go import paths. It does not follow symlinks. | [
"findOpenAPI",
"searches",
"for",
"all",
"packages",
"under",
"root",
"that",
"request",
"OpenAPI",
".",
"It",
"returns",
"the",
"go",
"import",
"paths",
".",
"It",
"does",
"not",
"follow",
"symlinks",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/repo-infra/kazel/generator.go#L54-L87 |
25,644 | kubernetes-incubator/external-storage | ceph/rbd/pkg/provision/provision.go | NewRBDProvisioner | func NewRBDProvisioner(client kubernetes.Interface, id string, timeout int, usePVName bool) controller.Provisioner {
return &rbdProvisioner{
client: client,
identity: id,
rbdUtil: &RBDUtil{
timeout: timeout,
},
usePVName: usePVName,
}
} | go | func NewRBDProvisioner(client kubernetes.Interface, id string, timeout int, usePVName bool) controller.Provisioner {
return &rbdProvisioner{
client: client,
identity: id,
rbdUtil: &RBDUtil{
timeout: timeout,
},
usePVName: usePVName,
}
} | [
"func",
"NewRBDProvisioner",
"(",
"client",
"kubernetes",
".",
"Interface",
",",
"id",
"string",
",",
"timeout",
"int",
",",
"usePVName",
"bool",
")",
"controller",
".",
"Provisioner",
"{",
"return",
"&",
"rbdProvisioner",
"{",
"client",
":",
"client",
",",
... | // NewRBDProvisioner creates a Provisioner that provisions Ceph RBD PVs backed by Ceph RBD images. | [
"NewRBDProvisioner",
"creates",
"a",
"Provisioner",
"that",
"provisions",
"Ceph",
"RBD",
"PVs",
"backed",
"by",
"Ceph",
"RBD",
"images",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/ceph/rbd/pkg/provision/provision.go#L94-L103 |
25,645 | kubernetes-incubator/external-storage | ceph/rbd/pkg/provision/provision.go | getAccessModes | func (p *rbdProvisioner) getAccessModes() []v1.PersistentVolumeAccessMode {
return []v1.PersistentVolumeAccessMode{
v1.ReadWriteOnce,
v1.ReadOnlyMany,
}
} | go | func (p *rbdProvisioner) getAccessModes() []v1.PersistentVolumeAccessMode {
return []v1.PersistentVolumeAccessMode{
v1.ReadWriteOnce,
v1.ReadOnlyMany,
}
} | [
"func",
"(",
"p",
"*",
"rbdProvisioner",
")",
"getAccessModes",
"(",
")",
"[",
"]",
"v1",
".",
"PersistentVolumeAccessMode",
"{",
"return",
"[",
"]",
"v1",
".",
"PersistentVolumeAccessMode",
"{",
"v1",
".",
"ReadWriteOnce",
",",
"v1",
".",
"ReadOnlyMany",
",... | // getAccessModes returns access modes RBD volume supported. | [
"getAccessModes",
"returns",
"access",
"modes",
"RBD",
"volume",
"supported",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/ceph/rbd/pkg/provision/provision.go#L108-L113 |
25,646 | kubernetes-incubator/external-storage | ceph/rbd/pkg/provision/provision.go | parsePVSecret | func (p *rbdProvisioner) parsePVSecret(namespace, secretName string) (string, error) {
if p.client == nil {
return "", fmt.Errorf("Cannot get kube client")
}
secrets, err := p.client.CoreV1().Secrets(namespace).Get(secretName, metav1.GetOptions{})
if err != nil {
return "", err
}
// TODO: Should we check secr... | go | func (p *rbdProvisioner) parsePVSecret(namespace, secretName string) (string, error) {
if p.client == nil {
return "", fmt.Errorf("Cannot get kube client")
}
secrets, err := p.client.CoreV1().Secrets(namespace).Get(secretName, metav1.GetOptions{})
if err != nil {
return "", err
}
// TODO: Should we check secr... | [
"func",
"(",
"p",
"*",
"rbdProvisioner",
")",
"parsePVSecret",
"(",
"namespace",
",",
"secretName",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"p",
".",
"client",
"==",
"nil",
"{",
"return",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"("... | // parsePVSecret retrives secret value for a given namespace and name. | [
"parsePVSecret",
"retrives",
"secret",
"value",
"for",
"a",
"given",
"namespace",
"and",
"name",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/ceph/rbd/pkg/provision/provision.go#L310-L329 |
25,647 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *AWSElasticBlockStoreVolumeSnapshotSource) DeepCopy() *AWSElasticBlockStoreVolumeSnapshotSource {
if in == nil {
return nil
}
out := new(AWSElasticBlockStoreVolumeSnapshotSource)
in.DeepCopyInto(out)
return out
} | go | func (in *AWSElasticBlockStoreVolumeSnapshotSource) DeepCopy() *AWSElasticBlockStoreVolumeSnapshotSource {
if in == nil {
return nil
}
out := new(AWSElasticBlockStoreVolumeSnapshotSource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"AWSElasticBlockStoreVolumeSnapshotSource",
")",
"DeepCopy",
"(",
")",
"*",
"AWSElasticBlockStoreVolumeSnapshotSource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"AWSElasticBlockStoreVolum... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSElasticBlockStoreVolumeSnapshotSource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"AWSElasticBlockStoreVolumeSnapshotSource",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L34-L41 |
25,648 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *CinderVolumeSnapshotSource) DeepCopy() *CinderVolumeSnapshotSource {
if in == nil {
return nil
}
out := new(CinderVolumeSnapshotSource)
in.DeepCopyInto(out)
return out
} | go | func (in *CinderVolumeSnapshotSource) DeepCopy() *CinderVolumeSnapshotSource {
if in == nil {
return nil
}
out := new(CinderVolumeSnapshotSource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"CinderVolumeSnapshotSource",
")",
"DeepCopy",
"(",
")",
"*",
"CinderVolumeSnapshotSource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"CinderVolumeSnapshotSource",
")",
"\n",
"in",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CinderVolumeSnapshotSource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"CinderVolumeSnapshotSource",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L50-L57 |
25,649 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *GCEPersistentDiskSnapshotSource) DeepCopy() *GCEPersistentDiskSnapshotSource {
if in == nil {
return nil
}
out := new(GCEPersistentDiskSnapshotSource)
in.DeepCopyInto(out)
return out
} | go | func (in *GCEPersistentDiskSnapshotSource) DeepCopy() *GCEPersistentDiskSnapshotSource {
if in == nil {
return nil
}
out := new(GCEPersistentDiskSnapshotSource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"GCEPersistentDiskSnapshotSource",
")",
"DeepCopy",
"(",
")",
"*",
"GCEPersistentDiskSnapshotSource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"GCEPersistentDiskSnapshotSource",
")",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCEPersistentDiskSnapshotSource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"GCEPersistentDiskSnapshotSource",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L66-L73 |
25,650 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *GlusterVolumeSnapshotSource) DeepCopy() *GlusterVolumeSnapshotSource {
if in == nil {
return nil
}
out := new(GlusterVolumeSnapshotSource)
in.DeepCopyInto(out)
return out
} | go | func (in *GlusterVolumeSnapshotSource) DeepCopy() *GlusterVolumeSnapshotSource {
if in == nil {
return nil
}
out := new(GlusterVolumeSnapshotSource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"GlusterVolumeSnapshotSource",
")",
"DeepCopy",
"(",
")",
"*",
"GlusterVolumeSnapshotSource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"GlusterVolumeSnapshotSource",
")",
"\n",
"in"... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlusterVolumeSnapshotSource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"GlusterVolumeSnapshotSource",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L82-L89 |
25,651 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *HostPathVolumeSnapshotSource) DeepCopy() *HostPathVolumeSnapshotSource {
if in == nil {
return nil
}
out := new(HostPathVolumeSnapshotSource)
in.DeepCopyInto(out)
return out
} | go | func (in *HostPathVolumeSnapshotSource) DeepCopy() *HostPathVolumeSnapshotSource {
if in == nil {
return nil
}
out := new(HostPathVolumeSnapshotSource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"HostPathVolumeSnapshotSource",
")",
"DeepCopy",
"(",
")",
"*",
"HostPathVolumeSnapshotSource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"HostPathVolumeSnapshotSource",
")",
"\n",
"... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPathVolumeSnapshotSource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"HostPathVolumeSnapshotSource",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L98-L105 |
25,652 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshot) DeepCopy() *VolumeSnapshot {
if in == nil {
return nil
}
out := new(VolumeSnapshot)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshot) DeepCopy() *VolumeSnapshot {
if in == nil {
return nil
}
out := new(VolumeSnapshot)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshot",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshot",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshot",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"ou... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshot. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshot",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L118-L125 |
25,653 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotCondition) DeepCopy() *VolumeSnapshotCondition {
if in == nil {
return nil
}
out := new(VolumeSnapshotCondition)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotCondition) DeepCopy() *VolumeSnapshotCondition {
if in == nil {
return nil
}
out := new(VolumeSnapshotCondition)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotCondition",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotCondition",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotCondition",
")",
"\n",
"in",
".",
"... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotCondition. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotCondition",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L137-L144 |
25,654 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotCopy) DeepCopy() *VolumeSnapshotCopy {
if in == nil {
return nil
}
out := new(VolumeSnapshotCopy)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotCopy) DeepCopy() *VolumeSnapshotCopy {
if in == nil {
return nil
}
out := new(VolumeSnapshotCopy)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotCopy",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotCopy",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotCopy",
")",
"\n",
"in",
".",
"DeepCopyInto",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotCopy. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotCopy",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L157-L164 |
25,655 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotData) DeepCopy() *VolumeSnapshotData {
if in == nil {
return nil
}
out := new(VolumeSnapshotData)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotData) DeepCopy() *VolumeSnapshotData {
if in == nil {
return nil
}
out := new(VolumeSnapshotData)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotData",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotData",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotData",
")",
"\n",
"in",
".",
"DeepCopyInto",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotData. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotData",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L177-L184 |
25,656 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotDataCondition) DeepCopy() *VolumeSnapshotDataCondition {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataCondition)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotDataCondition) DeepCopy() *VolumeSnapshotDataCondition {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataCondition)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotDataCondition",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotDataCondition",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotDataCondition",
")",
"\n",
"in"... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotDataCondition. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotDataCondition",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L196-L203 |
25,657 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotDataCopy) DeepCopy() *VolumeSnapshotDataCopy {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataCopy)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotDataCopy) DeepCopy() *VolumeSnapshotDataCopy {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataCopy)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotDataCopy",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotDataCopy",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotDataCopy",
")",
"\n",
"in",
".",
"Dee... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotDataCopy. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotDataCopy",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L216-L223 |
25,658 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotDataList) DeepCopy() *VolumeSnapshotDataList {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataList)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotDataList) DeepCopy() *VolumeSnapshotDataList {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataList)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotDataList",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotDataList",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotDataList",
")",
"\n",
"in",
".",
"Dee... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotDataList. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotDataList",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L241-L248 |
25,659 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotDataListCopy) DeepCopy() *VolumeSnapshotDataListCopy {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataListCopy)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotDataListCopy) DeepCopy() *VolumeSnapshotDataListCopy {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataListCopy)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotDataListCopy",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotDataListCopy",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotDataListCopy",
")",
"\n",
"in",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotDataListCopy. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotDataListCopy",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L275-L282 |
25,660 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotDataSource) DeepCopy() *VolumeSnapshotDataSource {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataSource)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotDataSource) DeepCopy() *VolumeSnapshotDataSource {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataSource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotDataSource",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotDataSource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotDataSource",
")",
"\n",
"in",
".",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotDataSource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotDataSource",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L336-L343 |
25,661 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotDataSpec) DeepCopy() *VolumeSnapshotDataSpec {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataSpec)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotDataSpec) DeepCopy() *VolumeSnapshotDataSpec {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataSpec)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotDataSpec",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotDataSpec",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotDataSpec",
")",
"\n",
"in",
".",
"Dee... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotDataSpec. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotDataSpec",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L346-L353 |
25,662 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotDataStatus) DeepCopy() *VolumeSnapshotDataStatus {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataStatus)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotDataStatus) DeepCopy() *VolumeSnapshotDataStatus {
if in == nil {
return nil
}
out := new(VolumeSnapshotDataStatus)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotDataStatus",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotDataStatus",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotDataStatus",
")",
"\n",
"in",
".",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotDataStatus. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotDataStatus",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L370-L377 |
25,663 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotList) DeepCopy() *VolumeSnapshotList {
if in == nil {
return nil
}
out := new(VolumeSnapshotList)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotList) DeepCopy() *VolumeSnapshotList {
if in == nil {
return nil
}
out := new(VolumeSnapshotList)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotList",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotList",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotList",
")",
"\n",
"in",
".",
"DeepCopyInto",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotList. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotList",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L395-L402 |
25,664 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotListCopy) DeepCopy() *VolumeSnapshotListCopy {
if in == nil {
return nil
}
out := new(VolumeSnapshotListCopy)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotListCopy) DeepCopy() *VolumeSnapshotListCopy {
if in == nil {
return nil
}
out := new(VolumeSnapshotListCopy)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotListCopy",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotListCopy",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotListCopy",
")",
"\n",
"in",
".",
"Dee... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotListCopy. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotListCopy",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L429-L436 |
25,665 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotSpec) DeepCopy() *VolumeSnapshotSpec {
if in == nil {
return nil
}
out := new(VolumeSnapshotSpec)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotSpec) DeepCopy() *VolumeSnapshotSpec {
if in == nil {
return nil
}
out := new(VolumeSnapshotSpec)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotSpec",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotSpec",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotSpec",
")",
"\n",
"in",
".",
"DeepCopyInto",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotSpec. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotSpec",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L445-L452 |
25,666 | kubernetes-incubator/external-storage | snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go | DeepCopy | func (in *VolumeSnapshotStatus) DeepCopy() *VolumeSnapshotStatus {
if in == nil {
return nil
}
out := new(VolumeSnapshotStatus)
in.DeepCopyInto(out)
return out
} | go | func (in *VolumeSnapshotStatus) DeepCopy() *VolumeSnapshotStatus {
if in == nil {
return nil
}
out := new(VolumeSnapshotStatus)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"VolumeSnapshotStatus",
")",
"DeepCopy",
"(",
")",
"*",
"VolumeSnapshotStatus",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"VolumeSnapshotStatus",
")",
"\n",
"in",
".",
"DeepCopyI... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotStatus. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"VolumeSnapshotStatus",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/apis/crd/v1/zz_generated.deepcopy.go#L469-L476 |
25,667 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go | GetLoadBalancer | func (lbaas *LbaasV2) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error) {
loadBalancerName := cloudprovider.GetLoadBalancerName(service)
loadbalancer, err := getLoadbalancerByName(lbaas.network, loadBalancerName)
if err == ErrNotFound {
return nil, false, nil
}
if loa... | go | func (lbaas *LbaasV2) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error) {
loadBalancerName := cloudprovider.GetLoadBalancerName(service)
loadbalancer, err := getLoadbalancerByName(lbaas.network, loadBalancerName)
if err == ErrNotFound {
return nil, false, nil
}
if loa... | [
"func",
"(",
"lbaas",
"*",
"LbaasV2",
")",
"GetLoadBalancer",
"(",
"clusterName",
"string",
",",
"service",
"*",
"v1",
".",
"Service",
")",
"(",
"*",
"v1",
".",
"LoadBalancerStatus",
",",
"bool",
",",
"error",
")",
"{",
"loadBalancerName",
":=",
"cloudprov... | // GetLoadBalancer gets the status of the load balancer | [
"GetLoadBalancer",
"gets",
"the",
"status",
"of",
"the",
"load",
"balancer"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go#L548-L562 |
25,668 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go | GetLoadBalancer | func (lb *LbaasV1) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error) {
loadBalancerName := cloudprovider.GetLoadBalancerName(service)
vip, err := getVipByName(lb.network, loadBalancerName)
if err == ErrNotFound {
return nil, false, nil
}
if vip == nil {
return nil, ... | go | func (lb *LbaasV1) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error) {
loadBalancerName := cloudprovider.GetLoadBalancerName(service)
vip, err := getVipByName(lb.network, loadBalancerName)
if err == ErrNotFound {
return nil, false, nil
}
if vip == nil {
return nil, ... | [
"func",
"(",
"lb",
"*",
"LbaasV1",
")",
"GetLoadBalancer",
"(",
"clusterName",
"string",
",",
"service",
"*",
"v1",
".",
"Service",
")",
"(",
"*",
"v1",
".",
"LoadBalancerStatus",
",",
"bool",
",",
"error",
")",
"{",
"loadBalancerName",
":=",
"cloudprovide... | // GetLoadBalancer gets a load balancer | [
"GetLoadBalancer",
"gets",
"a",
"load",
"balancer"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go#L1201-L1215 |
25,669 | kubernetes-incubator/external-storage | openebs/pkg/v1/maya_api.go | GetMayaClusterIP | func (v OpenEBSVolume) GetMayaClusterIP(client kubernetes.Interface) (string, error) {
clusterIP := "127.0.0.1"
namespace := os.Getenv("OPENEBS_NAMESPACE")
if namespace == "" {
namespace = "default"
}
glog.Info("OpenEBS volume provisioner namespace ", namespace)
//Fetch the Maya ClusterIP using the Maya API S... | go | func (v OpenEBSVolume) GetMayaClusterIP(client kubernetes.Interface) (string, error) {
clusterIP := "127.0.0.1"
namespace := os.Getenv("OPENEBS_NAMESPACE")
if namespace == "" {
namespace = "default"
}
glog.Info("OpenEBS volume provisioner namespace ", namespace)
//Fetch the Maya ClusterIP using the Maya API S... | [
"func",
"(",
"v",
"OpenEBSVolume",
")",
"GetMayaClusterIP",
"(",
"client",
"kubernetes",
".",
"Interface",
")",
"(",
"string",
",",
"error",
")",
"{",
"clusterIP",
":=",
"\"",
"\"",
"\n\n",
"namespace",
":=",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
... | //GetMayaClusterIP returns maya-apiserver IP address | [
"GetMayaClusterIP",
"returns",
"maya",
"-",
"apiserver",
"IP",
"address"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/openebs/pkg/v1/maya_api.go#L55-L74 |
25,670 | kubernetes-incubator/external-storage | openebs/pkg/v1/maya_api.go | CreateVolume | func (v OpenEBSVolume) CreateVolume(vs mayav1.VolumeSpec) (string, error) {
addr := os.Getenv("MAPI_ADDR")
if addr == "" {
err := errors.New("MAPI_ADDR environment variable not set")
glog.Errorf("Error getting maya-apiserver IP Address: %v", err)
return "Error getting maya-apiserver IP Address", err
}
url :=... | go | func (v OpenEBSVolume) CreateVolume(vs mayav1.VolumeSpec) (string, error) {
addr := os.Getenv("MAPI_ADDR")
if addr == "" {
err := errors.New("MAPI_ADDR environment variable not set")
glog.Errorf("Error getting maya-apiserver IP Address: %v", err)
return "Error getting maya-apiserver IP Address", err
}
url :=... | [
"func",
"(",
"v",
"OpenEBSVolume",
")",
"CreateVolume",
"(",
"vs",
"mayav1",
".",
"VolumeSpec",
")",
"(",
"string",
",",
"error",
")",
"{",
"addr",
":=",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"\n",
"if",
"addr",
"==",
"\"",
"\"",
"{",
"err",
... | // CreateVolume to create the Vsm through a API call to m-apiserver | [
"CreateVolume",
"to",
"create",
"the",
"Vsm",
"through",
"a",
"API",
"call",
"to",
"m",
"-",
"apiserver"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/openebs/pkg/v1/maya_api.go#L77-L123 |
25,671 | kubernetes-incubator/external-storage | openebs/pkg/v1/maya_api.go | ListVolume | func (v OpenEBSVolume) ListVolume(vname string, obj interface{}) error {
addr := os.Getenv("MAPI_ADDR")
if addr == "" {
err := errors.New("MAPI_ADDR environment variable not set")
glog.Errorf("Error getting mayaapi-server IP Address: %v", err)
return err
}
url := addr + "/latest/volumes/info/" + vname
glog... | go | func (v OpenEBSVolume) ListVolume(vname string, obj interface{}) error {
addr := os.Getenv("MAPI_ADDR")
if addr == "" {
err := errors.New("MAPI_ADDR environment variable not set")
glog.Errorf("Error getting mayaapi-server IP Address: %v", err)
return err
}
url := addr + "/latest/volumes/info/" + vname
glog... | [
"func",
"(",
"v",
"OpenEBSVolume",
")",
"ListVolume",
"(",
"vname",
"string",
",",
"obj",
"interface",
"{",
"}",
")",
"error",
"{",
"addr",
":=",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"\n",
"if",
"addr",
"==",
"\"",
"\"",
"{",
"err",
":=",
"... | // ListVolume to get the info of Vsm through a API call to m-apiserver | [
"ListVolume",
"to",
"get",
"the",
"info",
"of",
"Vsm",
"through",
"a",
"API",
"call",
"to",
"m",
"-",
"apiserver"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/openebs/pkg/v1/maya_api.go#L126-L156 |
25,672 | kubernetes-incubator/external-storage | aws/efs/cmd/efs-provisioner/efs-provisioner.go | NewEFSProvisioner | func NewEFSProvisioner(client kubernetes.Interface) controller.Provisioner {
fileSystemID := os.Getenv(fileSystemIDKey)
if fileSystemID == "" {
klog.Fatalf("environment variable %s is not set! Please set it.", fileSystemIDKey)
}
awsRegion := os.Getenv(awsRegionKey)
if awsRegion == "" {
klog.Fatalf("environmen... | go | func NewEFSProvisioner(client kubernetes.Interface) controller.Provisioner {
fileSystemID := os.Getenv(fileSystemIDKey)
if fileSystemID == "" {
klog.Fatalf("environment variable %s is not set! Please set it.", fileSystemIDKey)
}
awsRegion := os.Getenv(awsRegionKey)
if awsRegion == "" {
klog.Fatalf("environmen... | [
"func",
"NewEFSProvisioner",
"(",
"client",
"kubernetes",
".",
"Interface",
")",
"controller",
".",
"Provisioner",
"{",
"fileSystemID",
":=",
"os",
".",
"Getenv",
"(",
"fileSystemIDKey",
")",
"\n",
"if",
"fileSystemID",
"==",
"\"",
"\"",
"{",
"klog",
".",
"F... | // NewEFSProvisioner creates an AWS EFS volume provisioner | [
"NewEFSProvisioner",
"creates",
"an",
"AWS",
"EFS",
"volume",
"provisioner"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/aws/efs/cmd/efs-provisioner/efs-provisioner.go#L57-L100 |
25,673 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/api_util.go | CreatePV | func (u *apiUtil) CreatePV(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) {
startTime := time.Now()
metrics.APIServerRequestsTotal.WithLabelValues(metrics.APIServerRequestCreate).Inc()
pv, err := u.client.CoreV1().PersistentVolumes().Create(pv)
metrics.APIServerRequestsDurationSeconds.WithLabelValues(metric... | go | func (u *apiUtil) CreatePV(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) {
startTime := time.Now()
metrics.APIServerRequestsTotal.WithLabelValues(metrics.APIServerRequestCreate).Inc()
pv, err := u.client.CoreV1().PersistentVolumes().Create(pv)
metrics.APIServerRequestsDurationSeconds.WithLabelValues(metric... | [
"func",
"(",
"u",
"*",
"apiUtil",
")",
"CreatePV",
"(",
"pv",
"*",
"v1",
".",
"PersistentVolume",
")",
"(",
"*",
"v1",
".",
"PersistentVolume",
",",
"error",
")",
"{",
"startTime",
":=",
"time",
".",
"Now",
"(",
")",
"\n",
"metrics",
".",
"APIServerR... | // CreatePV will create a PersistentVolume | [
"CreatePV",
"will",
"create",
"a",
"PersistentVolume"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/api_util.go#L60-L69 |
25,674 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/api_util.go | DeletePV | func (u *apiUtil) DeletePV(pvName string) error {
startTime := time.Now()
metrics.APIServerRequestsTotal.WithLabelValues(metrics.APIServerRequestDelete).Inc()
err := u.client.CoreV1().PersistentVolumes().Delete(pvName, &metav1.DeleteOptions{})
metrics.APIServerRequestsDurationSeconds.WithLabelValues(metrics.APIServ... | go | func (u *apiUtil) DeletePV(pvName string) error {
startTime := time.Now()
metrics.APIServerRequestsTotal.WithLabelValues(metrics.APIServerRequestDelete).Inc()
err := u.client.CoreV1().PersistentVolumes().Delete(pvName, &metav1.DeleteOptions{})
metrics.APIServerRequestsDurationSeconds.WithLabelValues(metrics.APIServ... | [
"func",
"(",
"u",
"*",
"apiUtil",
")",
"DeletePV",
"(",
"pvName",
"string",
")",
"error",
"{",
"startTime",
":=",
"time",
".",
"Now",
"(",
")",
"\n",
"metrics",
".",
"APIServerRequestsTotal",
".",
"WithLabelValues",
"(",
"metrics",
".",
"APIServerRequestDele... | // DeletePV will delete a PersistentVolume | [
"DeletePV",
"will",
"delete",
"a",
"PersistentVolume"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/api_util.go#L72-L81 |
25,675 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/api_util.go | NewFakeAPIUtil | func NewFakeAPIUtil(shouldFail bool, cache *cache.VolumeCache) *FakeAPIUtil {
return &FakeAPIUtil{
createdPVs: map[string]*v1.PersistentVolume{},
deletedPVs: map[string]*v1.PersistentVolume{},
CreatedJobs: map[string]*batch_v1.Job{},
DeletedJobs: map[string]string{},
shouldFail: shouldFail,
cache: ... | go | func NewFakeAPIUtil(shouldFail bool, cache *cache.VolumeCache) *FakeAPIUtil {
return &FakeAPIUtil{
createdPVs: map[string]*v1.PersistentVolume{},
deletedPVs: map[string]*v1.PersistentVolume{},
CreatedJobs: map[string]*batch_v1.Job{},
DeletedJobs: map[string]string{},
shouldFail: shouldFail,
cache: ... | [
"func",
"NewFakeAPIUtil",
"(",
"shouldFail",
"bool",
",",
"cache",
"*",
"cache",
".",
"VolumeCache",
")",
"*",
"FakeAPIUtil",
"{",
"return",
"&",
"FakeAPIUtil",
"{",
"createdPVs",
":",
"map",
"[",
"string",
"]",
"*",
"v1",
".",
"PersistentVolume",
"{",
"}"... | // NewFakeAPIUtil returns an APIUtil object that can be used for unit testing | [
"NewFakeAPIUtil",
"returns",
"an",
"APIUtil",
"object",
"that",
"can",
"be",
"used",
"for",
"unit",
"testing"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/api_util.go#L113-L122 |
25,676 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/api_util.go | CreatePV | func (u *FakeAPIUtil) CreatePV(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) {
if u.shouldFail {
return nil, fmt.Errorf("API failed")
}
u.createdPVs[pv.Name] = pv
u.cache.AddPV(pv)
return pv, nil
} | go | func (u *FakeAPIUtil) CreatePV(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) {
if u.shouldFail {
return nil, fmt.Errorf("API failed")
}
u.createdPVs[pv.Name] = pv
u.cache.AddPV(pv)
return pv, nil
} | [
"func",
"(",
"u",
"*",
"FakeAPIUtil",
")",
"CreatePV",
"(",
"pv",
"*",
"v1",
".",
"PersistentVolume",
")",
"(",
"*",
"v1",
".",
"PersistentVolume",
",",
"error",
")",
"{",
"if",
"u",
".",
"shouldFail",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",... | // CreatePV will add the PV to the created list and cache | [
"CreatePV",
"will",
"add",
"the",
"PV",
"to",
"the",
"created",
"list",
"and",
"cache"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/api_util.go#L125-L133 |
25,677 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/api_util.go | DeletePV | func (u *FakeAPIUtil) DeletePV(pvName string) error {
if u.shouldFail {
return fmt.Errorf("API failed")
}
pv, exists := u.cache.GetPV(pvName)
if exists {
u.deletedPVs[pvName] = pv
delete(u.createdPVs, pvName)
u.cache.DeletePV(pvName)
return nil
}
return errors.NewNotFound(v1.Resource("persistentvolumes... | go | func (u *FakeAPIUtil) DeletePV(pvName string) error {
if u.shouldFail {
return fmt.Errorf("API failed")
}
pv, exists := u.cache.GetPV(pvName)
if exists {
u.deletedPVs[pvName] = pv
delete(u.createdPVs, pvName)
u.cache.DeletePV(pvName)
return nil
}
return errors.NewNotFound(v1.Resource("persistentvolumes... | [
"func",
"(",
"u",
"*",
"FakeAPIUtil",
")",
"DeletePV",
"(",
"pvName",
"string",
")",
"error",
"{",
"if",
"u",
".",
"shouldFail",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"pv",
",",
"exists",
":=",
"u",
".",
"c... | // DeletePV will delete the PV from the created list and cache, and also add it to the deleted list | [
"DeletePV",
"will",
"delete",
"the",
"PV",
"from",
"the",
"created",
"list",
"and",
"cache",
"and",
"also",
"add",
"it",
"to",
"the",
"deleted",
"list"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/api_util.go#L136-L149 |
25,678 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/api_util.go | GetAndResetCreatedPVs | func (u *FakeAPIUtil) GetAndResetCreatedPVs() map[string]*v1.PersistentVolume {
createdPVs := u.createdPVs
u.createdPVs = map[string]*v1.PersistentVolume{}
return createdPVs
} | go | func (u *FakeAPIUtil) GetAndResetCreatedPVs() map[string]*v1.PersistentVolume {
createdPVs := u.createdPVs
u.createdPVs = map[string]*v1.PersistentVolume{}
return createdPVs
} | [
"func",
"(",
"u",
"*",
"FakeAPIUtil",
")",
"GetAndResetCreatedPVs",
"(",
")",
"map",
"[",
"string",
"]",
"*",
"v1",
".",
"PersistentVolume",
"{",
"createdPVs",
":=",
"u",
".",
"createdPVs",
"\n",
"u",
".",
"createdPVs",
"=",
"map",
"[",
"string",
"]",
... | // GetAndResetCreatedPVs returns createdPVs and resets the map
// This is only for testing | [
"GetAndResetCreatedPVs",
"returns",
"createdPVs",
"and",
"resets",
"the",
"map",
"This",
"is",
"only",
"for",
"testing"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/api_util.go#L153-L157 |
25,679 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/api_util.go | GetAndResetDeletedPVs | func (u *FakeAPIUtil) GetAndResetDeletedPVs() map[string]*v1.PersistentVolume {
deletedPVs := u.deletedPVs
u.deletedPVs = map[string]*v1.PersistentVolume{}
return deletedPVs
} | go | func (u *FakeAPIUtil) GetAndResetDeletedPVs() map[string]*v1.PersistentVolume {
deletedPVs := u.deletedPVs
u.deletedPVs = map[string]*v1.PersistentVolume{}
return deletedPVs
} | [
"func",
"(",
"u",
"*",
"FakeAPIUtil",
")",
"GetAndResetDeletedPVs",
"(",
")",
"map",
"[",
"string",
"]",
"*",
"v1",
".",
"PersistentVolume",
"{",
"deletedPVs",
":=",
"u",
".",
"deletedPVs",
"\n",
"u",
".",
"deletedPVs",
"=",
"map",
"[",
"string",
"]",
... | // GetAndResetDeletedPVs returns createdPVs and resets the map
// This is only for testing | [
"GetAndResetDeletedPVs",
"returns",
"createdPVs",
"and",
"resets",
"the",
"map",
"This",
"is",
"only",
"for",
"testing"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/api_util.go#L161-L165 |
25,680 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/api_util.go | CreateJob | func (u *FakeAPIUtil) CreateJob(job *batch_v1.Job) error {
u.CreatedJobs[job.Namespace+"/"+job.Name] = job
return nil
} | go | func (u *FakeAPIUtil) CreateJob(job *batch_v1.Job) error {
u.CreatedJobs[job.Namespace+"/"+job.Name] = job
return nil
} | [
"func",
"(",
"u",
"*",
"FakeAPIUtil",
")",
"CreateJob",
"(",
"job",
"*",
"batch_v1",
".",
"Job",
")",
"error",
"{",
"u",
".",
"CreatedJobs",
"[",
"job",
".",
"Namespace",
"+",
"\"",
"\"",
"+",
"job",
".",
"Name",
"]",
"=",
"job",
"\n",
"return",
... | // CreateJob mocks job create method. | [
"CreateJob",
"mocks",
"job",
"create",
"method",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/api_util.go#L168-L171 |
25,681 | kubernetes-incubator/external-storage | local-volume/provisioner/pkg/util/api_util.go | DeleteJob | func (u *FakeAPIUtil) DeleteJob(jobName string, namespace string) error {
u.DeletedJobs[namespace+"/"+jobName] = jobName
return nil
} | go | func (u *FakeAPIUtil) DeleteJob(jobName string, namespace string) error {
u.DeletedJobs[namespace+"/"+jobName] = jobName
return nil
} | [
"func",
"(",
"u",
"*",
"FakeAPIUtil",
")",
"DeleteJob",
"(",
"jobName",
"string",
",",
"namespace",
"string",
")",
"error",
"{",
"u",
".",
"DeletedJobs",
"[",
"namespace",
"+",
"\"",
"\"",
"+",
"jobName",
"]",
"=",
"jobName",
"\n",
"return",
"nil",
"\n... | // DeleteJob mocks delete jon method. | [
"DeleteJob",
"mocks",
"delete",
"jon",
"method",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/local-volume/provisioner/pkg/util/api_util.go#L174-L177 |
25,682 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | getInstancesByRegex | func (c *Cloud) getInstancesByRegex(regex string) ([]types.NodeName, error) {
filters := []*ec2.Filter{newEc2Filter("instance-state-name", "running")}
instances, err := c.describeInstances(filters)
if err != nil {
return []types.NodeName{}, err
}
if len(instances) == 0 {
return []types.NodeName{}, fmt.Errorf... | go | func (c *Cloud) getInstancesByRegex(regex string) ([]types.NodeName, error) {
filters := []*ec2.Filter{newEc2Filter("instance-state-name", "running")}
instances, err := c.describeInstances(filters)
if err != nil {
return []types.NodeName{}, err
}
if len(instances) == 0 {
return []types.NodeName{}, fmt.Errorf... | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"getInstancesByRegex",
"(",
"regex",
"string",
")",
"(",
"[",
"]",
"types",
".",
"NodeName",
",",
"error",
")",
"{",
"filters",
":=",
"[",
"]",
"*",
"ec2",
".",
"Filter",
"{",
"newEc2Filter",
"(",
"\"",
"\"",
",... | // Return a list of instances matching regex string. | [
"Return",
"a",
"list",
"of",
"instances",
"matching",
"regex",
"string",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1085-L1132 |
25,683 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | getMountDevice | func (c *Cloud) getMountDevice(
i *awsInstance,
info *ec2.Instance,
volumeID awsVolumeID,
assign bool) (assigned mountDevice, alreadyAttached bool, err error) {
instanceType := i.getInstanceType()
if instanceType == nil {
return "", false, fmt.Errorf("could not get instance type for instance: %s", i.awsID)
}
... | go | func (c *Cloud) getMountDevice(
i *awsInstance,
info *ec2.Instance,
volumeID awsVolumeID,
assign bool) (assigned mountDevice, alreadyAttached bool, err error) {
instanceType := i.getInstanceType()
if instanceType == nil {
return "", false, fmt.Errorf("could not get instance type for instance: %s", i.awsID)
}
... | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"getMountDevice",
"(",
"i",
"*",
"awsInstance",
",",
"info",
"*",
"ec2",
".",
"Instance",
",",
"volumeID",
"awsVolumeID",
",",
"assign",
"bool",
")",
"(",
"assigned",
"mountDevice",
",",
"alreadyAttached",
"bool",
",",
... | // Gets the mountDevice already assigned to the volume, or assigns an unused mountDevice.
// If the volume is already assigned, this will return the existing mountDevice with alreadyAttached=true.
// Otherwise the mountDevice is assigned by finding the first available mountDevice, and it is returned with alreadyAttache... | [
"Gets",
"the",
"mountDevice",
"already",
"assigned",
"to",
"the",
"volume",
"or",
"assigns",
"an",
"unused",
"mountDevice",
".",
"If",
"the",
"volume",
"is",
"already",
"assigned",
"this",
"will",
"return",
"the",
"existing",
"mountDevice",
"with",
"alreadyAttac... | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1271-L1344 |
25,684 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | describeVolume | func (d *awsDisk) describeVolume() (*ec2.Volume, error) {
volumeID := d.awsID
request := &ec2.DescribeVolumesInput{
VolumeIds: []*string{volumeID.awsString()},
}
volumes, err := d.ec2.DescribeVolumes(request)
if err != nil {
return nil, fmt.Errorf("error querying ec2 for volume %q: %v", volumeID, err)
}
if... | go | func (d *awsDisk) describeVolume() (*ec2.Volume, error) {
volumeID := d.awsID
request := &ec2.DescribeVolumesInput{
VolumeIds: []*string{volumeID.awsString()},
}
volumes, err := d.ec2.DescribeVolumes(request)
if err != nil {
return nil, fmt.Errorf("error querying ec2 for volume %q: %v", volumeID, err)
}
if... | [
"func",
"(",
"d",
"*",
"awsDisk",
")",
"describeVolume",
"(",
")",
"(",
"*",
"ec2",
".",
"Volume",
",",
"error",
")",
"{",
"volumeID",
":=",
"d",
".",
"awsID",
"\n\n",
"request",
":=",
"&",
"ec2",
".",
"DescribeVolumesInput",
"{",
"VolumeIds",
":",
"... | // Gets the full information about this volume from the EC2 API | [
"Gets",
"the",
"full",
"information",
"about",
"this",
"volume",
"from",
"the",
"EC2",
"API"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1388-L1406 |
25,685 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | waitForAttachmentStatus | func (d *awsDisk) waitForAttachmentStatus(status string) (*ec2.VolumeAttachment, error) {
backoff := wait.Backoff{
Duration: volumeAttachmentStatusInitialDelay,
Factor: volumeAttachmentStatusFactor,
Steps: volumeAttachmentStatusSteps,
}
// Because of rate limiting, we often see errors from describeVolume... | go | func (d *awsDisk) waitForAttachmentStatus(status string) (*ec2.VolumeAttachment, error) {
backoff := wait.Backoff{
Duration: volumeAttachmentStatusInitialDelay,
Factor: volumeAttachmentStatusFactor,
Steps: volumeAttachmentStatusSteps,
}
// Because of rate limiting, we often see errors from describeVolume... | [
"func",
"(",
"d",
"*",
"awsDisk",
")",
"waitForAttachmentStatus",
"(",
"status",
"string",
")",
"(",
"*",
"ec2",
".",
"VolumeAttachment",
",",
"error",
")",
"{",
"backoff",
":=",
"wait",
".",
"Backoff",
"{",
"Duration",
":",
"volumeAttachmentStatusInitialDelay... | // waitForAttachmentStatus polls until the attachment status is the expected value
// On success, it returns the last attachment state. | [
"waitForAttachmentStatus",
"polls",
"until",
"the",
"attachment",
"status",
"is",
"the",
"expected",
"value",
"On",
"success",
"it",
"returns",
"the",
"last",
"attachment",
"state",
"."
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1410-L1466 |
25,686 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | deleteVolume | func (d *awsDisk) deleteVolume() (bool, error) {
request := &ec2.DeleteVolumeInput{VolumeId: d.awsID.awsString()}
_, err := d.ec2.DeleteVolume(request)
if err != nil {
if awsError, ok := err.(awserr.Error); ok {
if awsError.Code() == "InvalidVolume.NotFound" {
return false, nil
}
if awsError.Code() ==... | go | func (d *awsDisk) deleteVolume() (bool, error) {
request := &ec2.DeleteVolumeInput{VolumeId: d.awsID.awsString()}
_, err := d.ec2.DeleteVolume(request)
if err != nil {
if awsError, ok := err.(awserr.Error); ok {
if awsError.Code() == "InvalidVolume.NotFound" {
return false, nil
}
if awsError.Code() ==... | [
"func",
"(",
"d",
"*",
"awsDisk",
")",
"deleteVolume",
"(",
")",
"(",
"bool",
",",
"error",
")",
"{",
"request",
":=",
"&",
"ec2",
".",
"DeleteVolumeInput",
"{",
"VolumeId",
":",
"d",
".",
"awsID",
".",
"awsString",
"(",
")",
"}",
"\n",
"_",
",",
... | // Deletes the EBS disk | [
"Deletes",
"the",
"EBS",
"disk"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1469-L1484 |
25,687 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | getAwsInstance | func (c *Cloud) getAwsInstance(nodeName types.NodeName) (*awsInstance, error) {
var awsInstance *awsInstance
if nodeName == "" {
awsInstance = c.selfAWSInstance
} else {
instance, err := c.getInstanceByNodeName(nodeName)
if err != nil {
return nil, err
}
awsInstance = newAWSInstance(c.ec2, instance)
}... | go | func (c *Cloud) getAwsInstance(nodeName types.NodeName) (*awsInstance, error) {
var awsInstance *awsInstance
if nodeName == "" {
awsInstance = c.selfAWSInstance
} else {
instance, err := c.getInstanceByNodeName(nodeName)
if err != nil {
return nil, err
}
awsInstance = newAWSInstance(c.ec2, instance)
}... | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"getAwsInstance",
"(",
"nodeName",
"types",
".",
"NodeName",
")",
"(",
"*",
"awsInstance",
",",
"error",
")",
"{",
"var",
"awsInstance",
"*",
"awsInstance",
"\n",
"if",
"nodeName",
"==",
"\"",
"\"",
"{",
"awsInstance"... | // Gets the awsInstance with for the node with the specified nodeName, or the 'self' instance if nodeName == "" | [
"Gets",
"the",
"awsInstance",
"with",
"for",
"the",
"node",
"with",
"the",
"specified",
"nodeName",
"or",
"the",
"self",
"instance",
"if",
"nodeName",
"=="
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1513-L1527 |
25,688 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | GetVolumeLabels | func (c *Cloud) GetVolumeLabels(volumeName KubernetesVolumeID) (map[string]string, error) {
awsDisk, err := newAWSDisk(c, volumeName)
if err != nil {
return nil, err
}
info, err := awsDisk.describeVolume()
if err != nil {
return nil, err
}
labels := make(map[string]string)
az := aws.StringValue(info.Availab... | go | func (c *Cloud) GetVolumeLabels(volumeName KubernetesVolumeID) (map[string]string, error) {
awsDisk, err := newAWSDisk(c, volumeName)
if err != nil {
return nil, err
}
info, err := awsDisk.describeVolume()
if err != nil {
return nil, err
}
labels := make(map[string]string)
az := aws.StringValue(info.Availab... | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"GetVolumeLabels",
"(",
"volumeName",
"KubernetesVolumeID",
")",
"(",
"map",
"[",
"string",
"]",
"string",
",",
"error",
")",
"{",
"awsDisk",
",",
"err",
":=",
"newAWSDisk",
"(",
"c",
",",
"volumeName",
")",
"\n",
"... | // GetVolumeLabels implements Volumes.GetVolumeLabels | [
"GetVolumeLabels",
"implements",
"Volumes",
".",
"GetVolumeLabels"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1772-L1795 |
25,689 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | DisksAreAttached | func (c *Cloud) DisksAreAttached(nodeDisks map[types.NodeName][]KubernetesVolumeID) (map[types.NodeName]map[KubernetesVolumeID]bool, error) {
attached := make(map[types.NodeName]map[KubernetesVolumeID]bool)
if len(nodeDisks) == 0 {
return attached, nil
}
dnsNameSlice := []string{}
for nodeName, diskNames := ra... | go | func (c *Cloud) DisksAreAttached(nodeDisks map[types.NodeName][]KubernetesVolumeID) (map[types.NodeName]map[KubernetesVolumeID]bool, error) {
attached := make(map[types.NodeName]map[KubernetesVolumeID]bool)
if len(nodeDisks) == 0 {
return attached, nil
}
dnsNameSlice := []string{}
for nodeName, diskNames := ra... | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"DisksAreAttached",
"(",
"nodeDisks",
"map",
"[",
"types",
".",
"NodeName",
"]",
"[",
"]",
"KubernetesVolumeID",
")",
"(",
"map",
"[",
"types",
".",
"NodeName",
"]",
"map",
"[",
"KubernetesVolumeID",
"]",
"bool",
",",... | // DisksAreAttached checks whether disks are attached | [
"DisksAreAttached",
"checks",
"whether",
"disks",
"are",
"attached"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1844-L1908 |
25,690 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | CreateSnapshot | func (c *Cloud) CreateSnapshot(snapshotOptions *SnapshotOptions) (snapshotID string, status string, err error) {
request := &ec2.CreateSnapshotInput{}
request.VolumeId = aws.String(snapshotOptions.VolumeID)
request.DryRun = aws.Bool(false)
descriptions := "Created by Kubernetes for volume " + snapshotOptions.Volume... | go | func (c *Cloud) CreateSnapshot(snapshotOptions *SnapshotOptions) (snapshotID string, status string, err error) {
request := &ec2.CreateSnapshotInput{}
request.VolumeId = aws.String(snapshotOptions.VolumeID)
request.DryRun = aws.Bool(false)
descriptions := "Created by Kubernetes for volume " + snapshotOptions.Volume... | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"CreateSnapshot",
"(",
"snapshotOptions",
"*",
"SnapshotOptions",
")",
"(",
"snapshotID",
"string",
",",
"status",
"string",
",",
"err",
"error",
")",
"{",
"request",
":=",
"&",
"ec2",
".",
"CreateSnapshotInput",
"{",
"... | // CreateSnapshot creates an EBS volume snapshot | [
"CreateSnapshot",
"creates",
"an",
"EBS",
"volume",
"snapshot"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1911-L1937 |
25,691 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | DeleteSnapshot | func (c *Cloud) DeleteSnapshot(snapshotID string) (bool, error) {
request := &ec2.DeleteSnapshotInput{}
request.SnapshotId = aws.String(snapshotID)
_, err := c.ec2.DeleteSnapshot(request)
if err != nil {
return false, err
}
return true, nil
} | go | func (c *Cloud) DeleteSnapshot(snapshotID string) (bool, error) {
request := &ec2.DeleteSnapshotInput{}
request.SnapshotId = aws.String(snapshotID)
_, err := c.ec2.DeleteSnapshot(request)
if err != nil {
return false, err
}
return true, nil
} | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"DeleteSnapshot",
"(",
"snapshotID",
"string",
")",
"(",
"bool",
",",
"error",
")",
"{",
"request",
":=",
"&",
"ec2",
".",
"DeleteSnapshotInput",
"{",
"}",
"\n",
"request",
".",
"SnapshotId",
"=",
"aws",
".",
"Strin... | // DeleteSnapshot deletes an EBS volume snapshot | [
"DeleteSnapshot",
"deletes",
"an",
"EBS",
"volume",
"snapshot"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1940-L1949 |
25,692 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | DescribeSnapshot | func (c *Cloud) DescribeSnapshot(snapshotID string) (status string, isCompleted bool, err error) {
request := &ec2.DescribeSnapshotsInput{
SnapshotIds: []*string{
aws.String(snapshotID),
},
}
result, err := c.ec2.DescribeSnapshots(request)
if err != nil {
return "", false, err
}
if len(result) != 1 {
r... | go | func (c *Cloud) DescribeSnapshot(snapshotID string) (status string, isCompleted bool, err error) {
request := &ec2.DescribeSnapshotsInput{
SnapshotIds: []*string{
aws.String(snapshotID),
},
}
result, err := c.ec2.DescribeSnapshots(request)
if err != nil {
return "", false, err
}
if len(result) != 1 {
r... | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"DescribeSnapshot",
"(",
"snapshotID",
"string",
")",
"(",
"status",
"string",
",",
"isCompleted",
"bool",
",",
"err",
"error",
")",
"{",
"request",
":=",
"&",
"ec2",
".",
"DescribeSnapshotsInput",
"{",
"SnapshotIds",
"... | // DescribeSnapshot returns the status of the snapshot | [
"DescribeSnapshot",
"returns",
"the",
"status",
"of",
"the",
"snapshot"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1952-L1978 |
25,693 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | FindSnapshot | func (c *Cloud) FindSnapshot(tags map[string]string) ([]string, []string, error) {
request := &ec2.DescribeSnapshotsInput{}
for k, v := range tags {
filter := &ec2.Filter{}
filter.SetName(k)
filter.SetValues([]*string{&v})
request.Filters = append(request.Filters, filter)
}
result, err := c.ec2.DescribeSn... | go | func (c *Cloud) FindSnapshot(tags map[string]string) ([]string, []string, error) {
request := &ec2.DescribeSnapshotsInput{}
for k, v := range tags {
filter := &ec2.Filter{}
filter.SetName(k)
filter.SetValues([]*string{&v})
request.Filters = append(request.Filters, filter)
}
result, err := c.ec2.DescribeSn... | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"FindSnapshot",
"(",
"tags",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"[",
"]",
"string",
",",
"[",
"]",
"string",
",",
"error",
")",
"{",
"request",
":=",
"&",
"ec2",
".",
"DescribeSnapshotsInput",
"{",
"... | // FindSnapshot returns the found snapshot | [
"FindSnapshot",
"returns",
"the",
"found",
"snapshot"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L1981-L2004 |
25,694 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | findSecurityGroup | func (c *Cloud) findSecurityGroup(securityGroupID string) (*ec2.SecurityGroup, error) {
describeSecurityGroupsRequest := &ec2.DescribeSecurityGroupsInput{
GroupIds: []*string{&securityGroupID},
}
// We don't apply our tag filters because we are retrieving by ID
groups, err := c.ec2.DescribeSecurityGroups(describ... | go | func (c *Cloud) findSecurityGroup(securityGroupID string) (*ec2.SecurityGroup, error) {
describeSecurityGroupsRequest := &ec2.DescribeSecurityGroupsInput{
GroupIds: []*string{&securityGroupID},
}
// We don't apply our tag filters because we are retrieving by ID
groups, err := c.ec2.DescribeSecurityGroups(describ... | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"findSecurityGroup",
"(",
"securityGroupID",
"string",
")",
"(",
"*",
"ec2",
".",
"SecurityGroup",
",",
"error",
")",
"{",
"describeSecurityGroupsRequest",
":=",
"&",
"ec2",
".",
"DescribeSecurityGroupsInput",
"{",
"GroupIds"... | // Retrieves the specified security group from the AWS API, or returns nil if not found | [
"Retrieves",
"the",
"specified",
"security",
"group",
"from",
"the",
"AWS",
"API",
"or",
"returns",
"nil",
"if",
"not",
"found"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L2054-L2075 |
25,695 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | setSecurityGroupIngress | func (c *Cloud) setSecurityGroupIngress(securityGroupID string, permissions IPPermissionSet) (bool, error) {
group, err := c.findSecurityGroup(securityGroupID)
if err != nil {
glog.Warning("Error retrieving security group", err)
return false, err
}
if group == nil {
return false, fmt.Errorf("security group n... | go | func (c *Cloud) setSecurityGroupIngress(securityGroupID string, permissions IPPermissionSet) (bool, error) {
group, err := c.findSecurityGroup(securityGroupID)
if err != nil {
glog.Warning("Error retrieving security group", err)
return false, err
}
if group == nil {
return false, fmt.Errorf("security group n... | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"setSecurityGroupIngress",
"(",
"securityGroupID",
"string",
",",
"permissions",
"IPPermissionSet",
")",
"(",
"bool",
",",
"error",
")",
"{",
"group",
",",
"err",
":=",
"c",
".",
"findSecurityGroup",
"(",
"securityGroupID",... | // Makes sure the security group ingress is exactly the specified permissions
// Returns true if and only if changes were made
// The security group must already exist | [
"Makes",
"sure",
"the",
"security",
"group",
"ingress",
"is",
"exactly",
"the",
"specified",
"permissions",
"Returns",
"true",
"if",
"and",
"only",
"if",
"changes",
"were",
"made",
"The",
"security",
"group",
"must",
"already",
"exist"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L2156-L2221 |
25,696 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | findSecurityGroupForInstance | func findSecurityGroupForInstance(instance *ec2.Instance, taggedSecurityGroups map[string]*ec2.SecurityGroup) (*ec2.GroupIdentifier, error) {
instanceID := aws.StringValue(instance.InstanceId)
var tagged []*ec2.GroupIdentifier
var untagged []*ec2.GroupIdentifier
for _, group := range instance.SecurityGroups {
gr... | go | func findSecurityGroupForInstance(instance *ec2.Instance, taggedSecurityGroups map[string]*ec2.SecurityGroup) (*ec2.GroupIdentifier, error) {
instanceID := aws.StringValue(instance.InstanceId)
var tagged []*ec2.GroupIdentifier
var untagged []*ec2.GroupIdentifier
for _, group := range instance.SecurityGroups {
gr... | [
"func",
"findSecurityGroupForInstance",
"(",
"instance",
"*",
"ec2",
".",
"Instance",
",",
"taggedSecurityGroups",
"map",
"[",
"string",
"]",
"*",
"ec2",
".",
"SecurityGroup",
")",
"(",
"*",
"ec2",
".",
"GroupIdentifier",
",",
"error",
")",
"{",
"instanceID",
... | // Returns the first security group for an instance, or nil
// We only create instances with one security group, so we don't expect multiple security groups.
// However, if there are multiple security groups, we will choose the one tagged with our cluster filter.
// Otherwise we will return an error. | [
"Returns",
"the",
"first",
"security",
"group",
"for",
"an",
"instance",
"or",
"nil",
"We",
"only",
"create",
"instances",
"with",
"one",
"security",
"group",
"so",
"we",
"don",
"t",
"expect",
"multiple",
"security",
"groups",
".",
"However",
"if",
"there",
... | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L2957-L2995 |
25,697 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | getInstanceByID | func (c *Cloud) getInstanceByID(instanceID string) (*ec2.Instance, error) {
instances, err := c.getInstancesByIDs([]*string{&instanceID})
if err != nil {
return nil, err
}
if len(instances) == 0 {
return nil, cloudprovider.ErrInstanceNotFound
}
if len(instances) > 1 {
return nil, fmt.Errorf("multiple insta... | go | func (c *Cloud) getInstanceByID(instanceID string) (*ec2.Instance, error) {
instances, err := c.getInstancesByIDs([]*string{&instanceID})
if err != nil {
return nil, err
}
if len(instances) == 0 {
return nil, cloudprovider.ErrInstanceNotFound
}
if len(instances) > 1 {
return nil, fmt.Errorf("multiple insta... | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"getInstanceByID",
"(",
"instanceID",
"string",
")",
"(",
"*",
"ec2",
".",
"Instance",
",",
"error",
")",
"{",
"instances",
",",
"err",
":=",
"c",
".",
"getInstancesByIDs",
"(",
"[",
"]",
"*",
"string",
"{",
"&",
... | // Returns the instance with the specified ID | [
"Returns",
"the",
"instance",
"with",
"the",
"specified",
"ID"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L3282-L3296 |
25,698 | kubernetes-incubator/external-storage | snapshot/pkg/cloudprovider/providers/aws/aws.go | getInstanceByNodeName | func (c *Cloud) getInstanceByNodeName(nodeName types.NodeName) (*ec2.Instance, error) {
instance, err := c.findInstanceByNodeName(nodeName)
if err == nil && instance == nil {
return nil, cloudprovider.ErrInstanceNotFound
}
return instance, err
} | go | func (c *Cloud) getInstanceByNodeName(nodeName types.NodeName) (*ec2.Instance, error) {
instance, err := c.findInstanceByNodeName(nodeName)
if err == nil && instance == nil {
return nil, cloudprovider.ErrInstanceNotFound
}
return instance, err
} | [
"func",
"(",
"c",
"*",
"Cloud",
")",
"getInstanceByNodeName",
"(",
"nodeName",
"types",
".",
"NodeName",
")",
"(",
"*",
"ec2",
".",
"Instance",
",",
"error",
")",
"{",
"instance",
",",
"err",
":=",
"c",
".",
"findInstanceByNodeName",
"(",
"nodeName",
")"... | // Returns the instance with the specified node name
// Like findInstanceByNodeName, but returns error if node not found | [
"Returns",
"the",
"instance",
"with",
"the",
"specified",
"node",
"name",
"Like",
"findInstanceByNodeName",
"but",
"returns",
"error",
"if",
"node",
"not",
"found"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/snapshot/pkg/cloudprovider/providers/aws/aws.go#L3437-L3443 |
25,699 | kubernetes-incubator/external-storage | gluster/glusterfs/pkg/volume/provision.go | NewGlusterfsProvisioner | func NewGlusterfsProvisioner(config *rest.Config, client kubernetes.Interface) controller.Provisioner {
klog.Infof("Creating NewGlusterfsProvisioner.")
return newGlusterfsProvisionerInternal(config, client)
} | go | func NewGlusterfsProvisioner(config *rest.Config, client kubernetes.Interface) controller.Provisioner {
klog.Infof("Creating NewGlusterfsProvisioner.")
return newGlusterfsProvisionerInternal(config, client)
} | [
"func",
"NewGlusterfsProvisioner",
"(",
"config",
"*",
"rest",
".",
"Config",
",",
"client",
"kubernetes",
".",
"Interface",
")",
"controller",
".",
"Provisioner",
"{",
"klog",
".",
"Infof",
"(",
"\"",
"\"",
")",
"\n",
"return",
"newGlusterfsProvisionerInternal"... | // NewGlusterfsProvisioner creates a new glusterfs simple provisioner | [
"NewGlusterfsProvisioner",
"creates",
"a",
"new",
"glusterfs",
"simple",
"provisioner"
] | fbfedbf60da4e5ee25a3151bfe8504f3e3281319 | https://github.com/kubernetes-incubator/external-storage/blob/fbfedbf60da4e5ee25a3151bfe8504f3e3281319/gluster/glusterfs/pkg/volume/provision.go#L44-L47 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.