Skip to content

Commit

Permalink
Add filter when generating keploy-config (#1159)
Browse files Browse the repository at this point in the history
* Add filter when generating keploy-config

Signed-off-by: Hermione Dadheech <hermionedadheech@gmail.com>

* Indentation fix

Signed-off-by: Hermione Dadheech <hermionedadheech@gmail.com>

* Indentation fix

Signed-off-by: Hermione Dadheech <hermionedadheech@gmail.com>

---------

Signed-off-by: Hermione Dadheech <hermionedadheech@gmail.com>
Co-authored-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
Co-authored-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 5, 2023
1 parent e8db337 commit 2ac3047
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/service/generateConfig/generateConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type generatorConfig struct {
}

func NewGeneratorConfig(logger *zap.Logger) GeneratorConfig {
return &generatorConfig {
return &generatorConfig{
logger: logger,
mutex: sync.Mutex{},
}
Expand All @@ -33,6 +33,9 @@ record:
networkName: ""
delay: 5
passThroughPorts: []
filters:
ReqHeader: []
urlMethods: {}
test:
path: ""
# mandatory
Expand Down Expand Up @@ -109,12 +112,11 @@ func (g *generatorConfig) GenerateConfig(filePath string) {
g.logger.Fatal("Failed to write config file", zap.Error(err))
}


cmd := exec.Command("sudo", "chmod", "-R", "777", filePath)
err = cmd.Run()
if err != nil {
g.logger.Error("failed to set the permission of config file", zap.Error(err))
}
cmd := exec.Command("sudo", "chmod", "-R", "777", filePath)
err = cmd.Run()
if err != nil {
g.logger.Error("failed to set the permission of config file", zap.Error(err))
}

g.logger.Info("Config file generated successfully")
}

0 comments on commit 2ac3047

Please sign in to comment.