mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-22 10:37:23 +00:00
⚡ Get Hub host and port from ProxyConfig
struct
This commit is contained in:
@@ -150,14 +150,13 @@ func createAndStartContainers(
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Get host and port from ProxyConfig
|
|
||||||
respFront, err = cli.ContainerCreate(ctx, &container.Config{
|
respFront, err = cli.ContainerCreate(ctx, &container.Config{
|
||||||
Image: imageFront,
|
Image: imageFront,
|
||||||
Tty: false,
|
Tty: false,
|
||||||
Env: []string{
|
Env: []string{
|
||||||
"REACT_APP_DEFAULT_FILTER= ",
|
"REACT_APP_DEFAULT_FILTER= ",
|
||||||
"REACT_APP_HUB_HOST=localhost",
|
fmt.Sprintf("REACT_APP_HUB_HOST=%s", config.Config.Tap.Proxy.Host),
|
||||||
"REACT_APP_HUB_PORT=8898",
|
fmt.Sprintf("REACT_APP_HUB_PORT=%d", config.Config.Tap.Proxy.Hub.SrcPort),
|
||||||
},
|
},
|
||||||
}, hostConfigFront, nil, nil, nameFront)
|
}, hostConfigFront, nil, nil, nameFront)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -261,7 +261,7 @@ func (provider *Provider) BuildHubPod(opts *PodOptions) (*core.Pod, error) {
|
|||||||
return pod, nil
|
return pod, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (provider *Provider) BuildFrontPod(opts *PodOptions) (*core.Pod, error) {
|
func (provider *Provider) BuildFrontPod(opts *PodOptions, hubHost string, hubPort string) (*core.Pod, error) {
|
||||||
configMapVolume := &core.ConfigMapVolumeSource{}
|
configMapVolume := &core.ConfigMapVolumeSource{}
|
||||||
configMapVolume.Name = ConfigMapName
|
configMapVolume.Name = ConfigMapName
|
||||||
|
|
||||||
@@ -285,7 +285,6 @@ func (provider *Provider) BuildFrontPod(opts *PodOptions) (*core.Pod, error) {
|
|||||||
volumeMounts := []core.VolumeMount{}
|
volumeMounts := []core.VolumeMount{}
|
||||||
volumes := []core.Volume{}
|
volumes := []core.Volume{}
|
||||||
|
|
||||||
// TODO: Get host and port from ProxyConfig
|
|
||||||
containers := []core.Container{
|
containers := []core.Container{
|
||||||
{
|
{
|
||||||
Name: opts.PodName,
|
Name: opts.PodName,
|
||||||
@@ -322,11 +321,11 @@ func (provider *Provider) BuildFrontPod(opts *PodOptions) (*core.Pod, error) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "REACT_APP_HUB_HOST",
|
Name: "REACT_APP_HUB_HOST",
|
||||||
Value: "localhost",
|
Value: hubHost,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "REACT_APP_HUB_PORT",
|
Name: "REACT_APP_HUB_PORT",
|
||||||
Value: "8898",
|
Value: hubPort,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -110,7 +110,7 @@ func createSelfHubPod(ctx context.Context, kubernetesProvider *kubernetes.Provid
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createFrontPod(ctx context.Context, kubernetesProvider *kubernetes.Provider, opts *kubernetes.PodOptions) error {
|
func createFrontPod(ctx context.Context, kubernetesProvider *kubernetes.Provider, opts *kubernetes.PodOptions) error {
|
||||||
pod, err := kubernetesProvider.BuildFrontPod(opts)
|
pod, err := kubernetesProvider.BuildFrontPod(opts, config.Config.Tap.Proxy.Host, fmt.Sprintf("%d", config.Config.Tap.Proxy.Hub.SrcPort))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user