MCPcopy Create free account
hub / github.com/cloudtty/cloudtty / GetBindingWorkerFor

Method GetBindingWorkerFor

pkg/controllers/cloudshell_controller.go:1125–1140  ·  view source on GitHub ↗
(cloudshell *cloudshellv1alpha1.CloudShell)

Source from the content-addressed store, hash-verified

1123}
1124
1125func (c *Controller) GetBindingWorkerFor(cloudshell *cloudshellv1alpha1.CloudShell) (*corev1.Pod, error) {
1126 podName := cloudshell.Labels[constants.CloudshellPodLabelKey]
1127 if len(podName) == 0 {
1128 return nil, nil
1129 }
1130
1131 pod, err := c.podLister.Pods(cloudshell.GetNamespace()).Get(podName)
1132 if err != nil {
1133 if apierrors.IsNotFound(err) {
1134 return nil, nil
1135 }
1136 return nil, err
1137 }
1138
1139 return pod, nil
1140}
1141
1142func execCommand(cloudshell *cloudshellv1alpha1.CloudShell, command []string, config *rest.Config) error {
1143 config.GroupVersion = &corev1.SchemeGroupVersion

Callers 2

syncCloudShellMethod · 0.95
removeCloudshellMethod · 0.95

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected