Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ursasi committed Aug 28, 2024
1 parent 82ea5d3 commit 9700082
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/controller/component/kbagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func buildKBAgentContainer(synthesizedComp *SynthesizedComponent) error {
}
}

eye, err := buildKBAgentEyeContainer(discovery)
eye, err := buildKBAgentEyeContainer(discovery, envVars)
if err != nil {
return err
}
Expand Down Expand Up @@ -496,7 +496,7 @@ func mountPathExists(volumeMounts []corev1.VolumeMount, mountPath string) bool {
return false
}

func buildKBAgentEyeContainer(discovery map[string]string) (*corev1.Container, error) {
func buildKBAgentEyeContainer(discovery map[string]string, envVar []corev1.EnvVar) (*corev1.Container, error) {
var env corev1.EnvVar
dd, err := json.Marshal(discovery)
if err != nil {
Expand All @@ -511,6 +511,7 @@ func buildKBAgentEyeContainer(discovery map[string]string) (*corev1.Container, e
SetImage(viper.GetString(constant.KBToolsImage)).
SetImagePullPolicy(corev1.PullIfNotPresent).
AddCommands(kbAgentCommand).
AddEnv(envVar...).
AddEnv(env).
GetObject(), nil
}
3 changes: 3 additions & 0 deletions pkg/kbagent/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ type Service interface {
}

func New(logger logr.Logger, actions []proto.Action, probes []proto.Probe) ([]Service, error) {
actions = append(actions, proto.Action{
Name: "eye",
})
sa, err := newActionService(logger, actions)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/kbagent/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
const (
ContainerName = "kbagent"
InitContainerName = "init-kbagent"
EyeContainerName = "kbagent-eye"
EyeContainerName = "kba-eye"
DefaultPortName = "http"

actionEnvName = "KB_AGENT_ACTION"
Expand Down

0 comments on commit 9700082

Please sign in to comment.