mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-07-10 00:51:09 +00:00
Compare commits
3 Commits
30.0-dev25
...
30.0-dev28
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbcb776139 | ||
|
|
a3de34f544 | ||
|
|
99667984d6 |
@@ -40,7 +40,7 @@ type ConfigStruct struct {
|
|||||||
HeadlessMode bool `yaml:"headless" default:"false"`
|
HeadlessMode bool `yaml:"headless" default:"false"`
|
||||||
LogLevelStr string `yaml:"log-level,omitempty" default:"INFO" readonly:""`
|
LogLevelStr string `yaml:"log-level,omitempty" default:"INFO" readonly:""`
|
||||||
ServiceMap bool `yaml:"service-map" default:"true"`
|
ServiceMap bool `yaml:"service-map" default:"true"`
|
||||||
OAS bool `yaml:"oas,omitempty" default:"false" readonly:""`
|
OAS bool `yaml:"oas" default:"true"`
|
||||||
Elastic shared.ElasticConfig `yaml:"elastic"`
|
Elastic shared.ElasticConfig `yaml:"elastic"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,10 +110,8 @@ func UpdateTapTargets(newTapTargets []v1.Pod) {
|
|||||||
success := true
|
success := true
|
||||||
|
|
||||||
tapTargets = newTapTargets
|
tapTargets = newTapTargets
|
||||||
if err := initializePacketSources(); err != nil {
|
|
||||||
logger.Log.Fatal(err)
|
packetSourceManager.UpdatePods(tapTargets)
|
||||||
success = false
|
|
||||||
}
|
|
||||||
|
|
||||||
if tlsTapperInstance != nil {
|
if tlsTapperInstance != nil {
|
||||||
if err := tlstapper.UpdateTapTargets(tlsTapperInstance, &tapTargets, *procfs); err != nil {
|
if err := tlstapper.UpdateTapTargets(tlsTapperInstance, &tapTargets, *procfs); err != nil {
|
||||||
|
|||||||
@@ -11,8 +11,16 @@ import (
|
|||||||
const bpfFilterMaxPods = 150
|
const bpfFilterMaxPods = 150
|
||||||
const hostSourcePid = "0"
|
const hostSourcePid = "0"
|
||||||
|
|
||||||
|
type PacketSourceManagerConfig struct {
|
||||||
|
mtls bool
|
||||||
|
procfs string
|
||||||
|
interfaceName string
|
||||||
|
behaviour TcpPacketSourceBehaviour
|
||||||
|
}
|
||||||
|
|
||||||
type PacketSourceManager struct {
|
type PacketSourceManager struct {
|
||||||
sources map[string]*tcpPacketSource
|
sources map[string]*tcpPacketSource
|
||||||
|
config PacketSourceManagerConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPacketSourceManager(procfs string, filename string, interfaceName string,
|
func NewPacketSourceManager(procfs string, filename string, interfaceName string,
|
||||||
@@ -28,7 +36,14 @@ func NewPacketSourceManager(procfs string, filename string, interfaceName string
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceManager.UpdatePods(mtls, procfs, pods, interfaceName, behaviour)
|
sourceManager.config = PacketSourceManagerConfig{
|
||||||
|
mtls: mtls,
|
||||||
|
procfs: procfs,
|
||||||
|
interfaceName: interfaceName,
|
||||||
|
behaviour: behaviour,
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceManager.UpdatePods(pods)
|
||||||
return sourceManager, nil
|
return sourceManager, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,10 +64,9 @@ func newHostPacketSource(filename string, interfaceName string,
|
|||||||
return source, nil
|
return source, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PacketSourceManager) UpdatePods(mtls bool, procfs string, pods []v1.Pod,
|
func (m *PacketSourceManager) UpdatePods(pods []v1.Pod) {
|
||||||
interfaceName string, behaviour TcpPacketSourceBehaviour) {
|
if m.config.mtls {
|
||||||
if mtls {
|
m.updateMtlsPods(m.config.procfs, pods, m.config.interfaceName, m.config.behaviour)
|
||||||
m.updateMtlsPods(procfs, pods, interfaceName, behaviour)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m.setBPFFilter(pods)
|
m.setBPFFilter(pods)
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ const trafficViewerApi = {...api}
|
|||||||
{window["isOasEnabled"] && <Button
|
{window["isOasEnabled"] && <Button
|
||||||
startIcon={<img className="custom" src={services} alt="services"></img>}
|
startIcon={<img className="custom" src={services} alt="services"></img>}
|
||||||
size="large"
|
size="large"
|
||||||
type="submit"
|
|
||||||
variant="contained"
|
variant="contained"
|
||||||
className={commonClasses.outlinedButton + " " + commonClasses.imagedButton}
|
className={commonClasses.outlinedButton + " " + commonClasses.imagedButton}
|
||||||
style={{ marginRight: 25, textTransform: 'unset' }}
|
style={{ marginRight: 25, textTransform: 'unset' }}
|
||||||
|
|||||||
Reference in New Issue
Block a user