Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
corverroos committed May 31, 2022
1 parent 53812ff commit b7f3dfc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,4 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: ls -la
- run: go test -v github.com/obolnetwork/charon/testutil/compose/compose -integration
4 changes: 2 additions & 2 deletions cmd/createcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func writeDepositData(conf clusterConfig, secrets []*bls_sig.SecretKey) error {

// Write it to disk
depositPath := path.Join(conf.ClusterDir, "deposit-data.json")
err = os.WriteFile(depositPath, bytes, 0o444) // read-only
err = os.WriteFile(depositPath, bytes, 0o400) // read-only
if err != nil {
return errors.Wrap(err, "write deposit data")
}
Expand All @@ -308,7 +308,7 @@ func writeLock(conf clusterConfig, dvs []tbls.TSS, peers []p2p.Peer) error {
}

lockPath := path.Join(conf.ClusterDir, "cluster-lock.json")
err = os.WriteFile(lockPath, b, 0o444) // read-only
err = os.WriteFile(lockPath, b, 0o400) // read-only
if err != nil {
return errors.Wrap(err, "write cluster lock")
}
Expand Down
2 changes: 1 addition & 1 deletion eth2util/keystore/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func loadPassword(keyFile string) (string, error) {
func storePassword(keyFile string, password string) error {
passwordFile := strings.Replace(keyFile, ".json", ".txt", 1)

err := os.WriteFile(passwordFile, []byte(password), 0o444)
err := os.WriteFile(passwordFile, []byte(password), 0o400)
if err != nil {
return errors.Wrap(err, "write password file")
}
Expand Down
9 changes: 0 additions & 9 deletions testutil/compose/compose/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ func newRunnerFunc(topic string, dir string, up bool, runFunc runFunc,
return compose.TmplData{}, err
}

exe(ctx, dir, "ls", "-la")

log.Info(ctx, "Running compose command", z.Str("command", topic))

data, err = runFunc(ctx, dir, conf)
Expand All @@ -108,13 +106,6 @@ func newRunnerFunc(topic string, dir string, up bool, runFunc runFunc,
}
}

func exe(ctx context.Context, dir string, cmd string, args ...string) {
c := exec.Command(cmd, args...)
c.Dir = dir
out, err := c.CombinedOutput()
log.Info(ctx, "EXEC", z.Str("out", string(out)), z.Str("dir", dir), z.Err(err))
}

// newDockerCmd returns a cobra command that generates docker-compose.yml files and executes it.
func newDockerCmd(use string, short string, runFunc runFunc) *cobra.Command {
cmd := &cobra.Command{
Expand Down

0 comments on commit b7f3dfc

Please sign in to comment.