mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-20 17:48:20 +00:00
Update Makefile, version.go, and 3 more files...
This commit is contained in:
@@ -77,7 +77,7 @@ func (provider *Provider) GetPods(ctx context.Context, namespace string) {
|
||||
fmt.Printf("There are %d pods in Namespace %s\n", len(pods.Items), namespace)
|
||||
}
|
||||
|
||||
func (provider *Provider) CreateMizuPod(ctx context.Context, namespace string, podName string, podImage string, tappedPodNamespace string, tappedPodName string) (*core.Pod, error) {
|
||||
func (provider *Provider) CreateMizuPod(ctx context.Context, namespace string, podName string, podImage string, tappedPodNamespace string, tappedPodName string, linkServiceAccount bool) (*core.Pod, error) {
|
||||
tappedPod, err := provider.clientSet.CoreV1().Pods(tappedPodNamespace).Get(ctx, tappedPodName, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
@@ -117,11 +117,14 @@ func (provider *Provider) CreateMizuPod(ctx context.Context, namespace string, p
|
||||
},
|
||||
},
|
||||
},
|
||||
ServiceAccountName: serviceAccountName,
|
||||
TerminationGracePeriodSeconds: new(int64),
|
||||
NodeSelector: map[string]string{"kubernetes.io/hostname": tappedPod.Spec.NodeName},
|
||||
},
|
||||
}
|
||||
//pod will crash if a non existent service account name is defined in spec
|
||||
if linkServiceAccount {
|
||||
pod.Spec.ServiceAccountName = serviceAccountName
|
||||
}
|
||||
return provider.clientSet.CoreV1().Pods(namespace).Create(ctx, pod, metav1.CreateOptions{})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user