diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-08-24 11:05:41 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-08-29 08:54:47 +0300 |
commit | 0a66fa23dff504ea123f4c03cade249eff641b00 (patch) | |
tree | 7cceb7eaa1aabf0ef793a9c567e63ce3ce5e6403 /tools | |
parent | 5d7ecbde6ac469c13fe0750a73583d128ba00ff6 (diff) |
tools/test-boot: Stop using gitlab-shell configuration
Migrate the test-boot tool away from the gitlab-shell configuration in
favor of configuring the GitLab secret directly.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/test-boot/main.go | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/tools/test-boot/main.go b/tools/test-boot/main.go index 5fd5f730f..d27e53856 100644 --- a/tools/test-boot/main.go +++ b/tools/test-boot/main.go @@ -19,13 +19,13 @@ import ( ) type gitalyConfig struct { - SocketPath string - BinDir string - Dir string - UseBundledGit bool - GitPath string - GitalyDir string - GitlabShellDir string + SocketPath string + BinDir string + Dir string + UseBundledGit bool + GitPath string + GitalyDir string + GitlabSecret string } const configTemplate = ` @@ -40,11 +40,9 @@ path = "{{.Dir}}" use_bundled_binaries = {{.UseBundledGit}} bin_path = "{{.GitPath}}" -[gitlab-shell] -dir = "{{.GitlabShellDir}}" - [gitlab] url = 'http://gitlab_url' +secret = "{{.GitlabSecret}}" ` func checkVersion(gitalyDir, gitalyBin string) error { @@ -162,27 +160,17 @@ func testBoot(appCtx *cli.Context) error { _ = os.RemoveAll(tempDir) }() - gitlabShellDir := filepath.Join(tempDir, "gitlab-shell") - if err := os.Mkdir(gitlabShellDir, 0o755); err != nil { - return fmt.Errorf("create gitlab-shell directory: %w", err) - } - - err = os.WriteFile(filepath.Join(gitlabShellDir, ".gitlab_shell_secret"), []byte("test_gitlab_shell_token"), 0o644) - if err != nil { - return fmt.Errorf("write gitlab-shell secret: %w", err) - } - socketPath := filepath.Join(tempDir, "socket") configPath := filepath.Join(tempDir, "config.toml") err = writeGitalyConfig(configPath, gitalyConfig{ - SocketPath: socketPath, - BinDir: binDir, - Dir: tempDir, - UseBundledGit: useBundledGit, - GitPath: gitPath, - GitalyDir: gitalyDir, - GitlabShellDir: gitlabShellDir, + SocketPath: socketPath, + BinDir: binDir, + Dir: tempDir, + UseBundledGit: useBundledGit, + GitPath: gitPath, + GitalyDir: gitalyDir, + GitlabSecret: "test_gitlab_shell_token", }) if err != nil { return nil |