Skip to content

Commit

Permalink
localhost resolves to ipv6 on newer nodejs versions, we should use 12… (
Browse files Browse the repository at this point in the history
#67)

localhost resolves to ipv6 on newer nodejs versions, we should use 127.0.0.1 instead
  • Loading branch information
hebelal authored Jan 13, 2023
1 parent 438eec9 commit fec2f11
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fixtures/node_with_opa/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cf ssh node-opa
```
and query the sidecar process using curl
```sh
curl localhost:8999
curl 127.0.0.1:8999
```


Expand Down
4 changes: 2 additions & 2 deletions pkg/supply/supply.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ type OPAConfig struct {
func (s *Supplier) writeProfileDFile(cfg env.Config) error {
s.Log.Info("writing profileD file..")
values := map[string]string{
"OPA_URL": fmt.Sprintf("http://localhost:%d/", cfg.Port),
"ADC_URL": fmt.Sprintf("http://localhost:%d/", cfg.Port),
"OPA_URL": fmt.Sprintf("http://127.0.0.1:%d/", cfg.Port),
"ADC_URL": fmt.Sprintf("http://127.0.0.1:%d/", cfg.Port),
}

var b bytes.Buffer
Expand Down
2 changes: 1 addition & 1 deletion pkg/supply/supply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ var _ = Describe("Supply", func() {
env, err := os.ReadFile(path.Join(buildDir, ".profile.d", "0000_opa_env.sh"))
Expect(err).NotTo(HaveOccurred())
expectIsExecutable(path.Join(buildDir, ".profile.d", "0000_opa_env.sh"))
Expect(string(env)).To(ContainSubstring(`export OPA_URL=http://localhost:9888`))
Expect(string(env)).To(ContainSubstring(`export OPA_URL=http://127.0.0.1:9888`))
})
It("provides the OPA executable", func() {
Expect(supplier.Run()).To(Succeed())
Expand Down

0 comments on commit fec2f11

Please sign in to comment.