Skip to content

Commit

Permalink
Merge pull request #362 from itmo-eve/fix-network-sed
Browse files Browse the repository at this point in the history
Merge for MacOs
  • Loading branch information
mydatascience authored Nov 13, 2020
2 parents 2d15d7a + 23bfd32 commit 4fd1f7c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion cmd/edenSetup.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ var setupCmd = &cobra.Command{
log.Info("GenerateEveCerts done")
}
} else {
log.Info("GenerateEveCerts done")
log.Infof("Certs already exists in certs dir: %s", certsDir)
}
if err := eden.GenerateEVEConfig(certsDir, certsDomain, certsEVEIP, adamPort, apiV1); err != nil {
Expand Down Expand Up @@ -211,7 +212,6 @@ var setupCmd = &cobra.Command{
}
} else {
log.Infof("EVE already exists in dir: %s", eveDist)

}
} else {
if _, err := os.Lstat(eveImageFile); os.IsNotExist(err) {
Expand Down Expand Up @@ -241,6 +241,7 @@ var setupCmd = &cobra.Command{
}
}
} else {
log.Infof("download EVE done: %s", eveImageFile)
log.Infof("EVE already exists in dir: %s", filepath.Dir(eveImageFile))
}
}
Expand Down
14 changes: 7 additions & 7 deletions cmd/eve.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ var ipEveCmd = &cobra.Command{
return nil
},
Run: func(cmd *cobra.Command, args []string) {
statusAdam, err := eden.StatusAdam()
if err == nil && statusAdam != "container doesn't exist" {
if ip, err := eveLastRequests(); err == nil && ip != "" {
fmt.Println(ip)
return
}
if !eveRemote && runtime.GOOS == "darwin" {
fmt.Println("127.0.0.1")
return
}
if ip, err := eveLastRequests(); err == nil && ip != "" {
fmt.Println(ip)
return
}
log.Fatal("not found")
},
}

Expand Down
8 changes: 4 additions & 4 deletions tests/network/testdata/test_networking.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[!exec:bash] stop
[!exec:grep] stop
[!exec:sed] stop
[!exec:cut] stop
[!exec:curl] stop
[!exec:sleep] stop

Expand Down Expand Up @@ -91,7 +91,7 @@ stdout 'no app with app3 found'

echo "defining of environment variables for the first app"

echo net=$(grep '10.2.0.0/24' network_ls | sed '$s/\(^[^\t]*\).*$/\1/')>.env
echo net=$(grep '10.2.0.0/24' network_ls | cut -f1)>.env
echo external_port=''>>.env
echo metadata={{$test_data}}>>.env
echo name=app1>>.env
Expand All @@ -106,7 +106,7 @@ $EDEN pod ps>pod_ps

echo "defining of environment variables for the second app"

echo net=$(grep '10.1.0.0/24' network_ls | sed '$s/\(^[^\t]*\).*$/\1/'),$(grep '10.2.0.0/24' network_ls | sed '$s/\(^[^\t]*\).*$/\1/')>.env
echo net=$(grep '10.1.0.0/24' network_ls | cut -f1),$(grep '10.2.0.0/24' network_ls | cut -f1)>.env
echo external_port=-p 8027:80>>.env
echo metadata=http://$(grep '10.2.0.' pod_ps | grep -o -E '10.2.0.[0-9]{1,3}')/user-data.html>>.env
echo name=app2>>.env
Expand All @@ -128,7 +128,7 @@ until curl $address | grep {{$test_data}}; do sleep 3; done

echo "defining of environment variables for the third app"

echo net=$(grep '10.1.0.0/24' network_ls | sed '$s/\(^[^\t]*\).*$/\1/'),$(grep '10.2.0.0/24' network_ls | sed '$s/\(^[^\t]*\).*$/\1/')>.env
echo net=$(grep '10.1.0.0/24' network_ls | cut -f1),$(grep '10.2.0.0/24' network_ls | cut -f1)>.env
echo external_port=-p 8028:80>>.env
echo metadata=http://$(grep '10.2.0.' pod_ps |grep app1| grep -o -E '10.2.0.[0-9]{1,3}')/user-data.html>>.env
echo name=app3>>.env
Expand Down

0 comments on commit 4fd1f7c

Please sign in to comment.