Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: remove alpine linux postgres (#1621)

Danny Xu3094262a1db3
diff --git a/resources/README.md b/resources/README.md
index 4ac02a6588..2cf96e0e67 100644
--- a/resources/README.md
+++ b/resources/README.md
@@ -4,14 +4,12 @@ You need to run `go generate -tags mysql ./...` to download some resources manua
## Postgresql
-We will embed Postgres binaries to serve and store backend data. We will extract the binary to a binary path and install Postgres. We will use Go file suffix build tags to include the embedded file only for the build platform. For example, resources_darwin.go will only be included for building Bytebase on darwin platform. However, we will also use build tag `alpine` to differentiate builds on Linux and alpine Linux. We have to include alpine Linux because its underlying libc is different from regular Linux, and we use alpine Linux for our docker images.
+We will embed Postgres binaries to serve and store backend data. We will extract the binary to a binary path and install Postgres. We will use Go file suffix build tags to include the embedded file only for the build platform. For example, resources_darwin.go will only be included for building Bytebase on darwin platform.
linux/amd64 used for Linux (MD5 3b5b460450f09543f1055e7ffd1cf773): https://repo1.maven.org/maven2/io/zonky/test/postgres/embedded-postgres-binaries-linux-amd64/14.2.0/embedded-postgres-binaries-linux-amd64-14.2.0.jar
linux/arm64 used for Linux arm64 (MD5 db2d840c9a35d9cfb661a0fd9a690829): https://repo1.maven.org/maven2/io/zonky/test/postgres/embedded-postgres-binaries-linux-arm64v8/14.2.0/embedded-postgres-binaries-linux-arm64v8-14.2.0.jar
-linux/amd64 used for Alpine Linux - Docker image (MD5 2f7e10b17683bcbcba264057d7c4215d): https://repo1.maven.org/maven2/io/zonky/test/postgres/embedded-postgres-binaries-linux-amd64-alpine/14.2.0/embedded-postgres-binaries-linux-amd64-alpine-14.2.0.jar
-
darwin/amd64 used for MacOS development (MD5 d95d5c5fccc1e1ef45de6533fd8e6d0a): https://repo1.maven.org/maven2/io/zonky/test/postgres/embedded-postgres-binaries-darwin-amd64/14.2.0/embedded-postgres-binaries-darwin-amd64-14.2.0.jar
## MySQL
diff --git a/resources/postgres/postgres.go b/resources/postgres/postgres.go
index c77d659106..6cb1b31982 100644
--- a/resources/postgres/postgres.go
+++ b/resources/postgres/postgres.go
@@ -101,11 +101,7 @@ func Install(resourceDir, pgDataDir, pgUser string) (*Instance, error) {
case "darwin":
tarName = "postgres-darwin-x86_64.txz"
case "linux":
- if isAlpineLinux() {
- tarName = "postgres-linux-x86_64-alpine_linux.txz"
- } else {
- tarName = "postgres-linux-x86_64.txz"
- }
+ tarName = "postgres-linux-x86_64.txz"
default:
return nil, fmt.Errorf("OS %q is not supported", runtime.GOOS)
}
@@ -166,11 +162,6 @@ func Install(resourceDir, pgDataDir, pgUser string) (*Instance, error) {
}, nil
}
-func isAlpineLinux() bool {
- _, err := os.Stat("/etc/alpine-release")
- return err == nil
-}
-
// initDB inits a postgres database if not yet.
func initDB(pgBinDir, pgDataDir, pgUser string) error {
versionPath := filepath.Join(pgDataDir, "PG_VERSION")
diff --git a/resources/postgres/resources_alpine_linux.go b/resources/postgres/resources_alpine_linux.go
deleted file mode 100644
index cbbabfe856..0000000000
--- a/resources/postgres/resources_alpine_linux.go
+++ /dev/null
@@ -1,9 +0,0 @@
-//go:build alpine
-// +build alpine
-
-package postgres
-
-import "embed"
-
-//go:embed postgres-linux-x86_64-alpine_linux.txz
-var resources embed.FS
diff --git a/resources/postgres/resources_linux_amd64.go b/resources/postgres/resources_linux_amd64.go
index d02d2eccae..2fa2d5cee9 100644
--- a/resources/postgres/resources_linux_amd64.go
+++ b/resources/postgres/resources_linux_amd64.go
@@ -1,6 +1,3 @@
-//go:build !alpine
-// +build !alpine
-
package postgres
import "embed"
diff --git a/resources/postgres/resources_linux_arm64.go b/resources/postgres/resources_linux_arm64.go
index e5a0252386..10a538a415 100644
--- a/resources/postgres/resources_linux_arm64.go
+++ b/resources/postgres/resources_linux_arm64.go
@@ -1,6 +1,3 @@
-//go:build !alpine
-// +build !alpine
-
package postgres
import "embed"