diff --git a/config/flipt.schema.cue b/config/flipt.schema.cue index 66d37e79e0..78741e6a9a 100644 --- a/config/flipt.schema.cue +++ b/config/flipt.schema.cue @@ -129,9 +129,9 @@ import "strings" min_idle_conn?: int | *0 conn_max_idle_time?: =~#duration | int | *0 net_timeout?: =~#duration | int | *0 - ca_cert_path?: string - ca_cert_bytes?: string - insecure_skip_tls?: bool | *false + ca_cert_path?: string + ca_cert_bytes?: string + insecure_skip_tls?: bool | *false } memory?: { @@ -142,9 +142,9 @@ import "strings" } #cloud: { - host?: string | *"flipt.cloud" - organization?: string - instance?: string + host?: string | *"flipt.cloud" + organization?: string + instance?: string authentication?: { api_key?: string } @@ -176,6 +176,7 @@ import "strings" local?: path: string | *"." git?: { repository: string + backend?: *"memory" | "local" ref?: string | *"main" ref_type?: *"static" | "semver" directory?: string @@ -347,7 +348,7 @@ import "strings" body: string headers?: [string]: string }] - }, + } cloud?: { enabled?: bool | *false } diff --git a/config/flipt.schema.json b/config/flipt.schema.json index d58d4d6523..0e1d74c6f6 100644 --- a/config/flipt.schema.json +++ b/config/flipt.schema.json @@ -607,6 +607,11 @@ "repository": { "type": "string" }, + "backend": { + "type": "string", + "enum": ["memory", "local"], + "default": "local" + }, "ref": { "type": "string", "default": "main" diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 07addb907f..c6b62a8742 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -921,7 +921,7 @@ func TestLoad(t *testing.T) { Type: GitStorageType, Git: &Git{ Backend: GitBackend{ - Type: GitBackendFilesystem, + Type: GitBackendLocal, Path: "/path/to/gitdir", }, Ref: "main", diff --git a/internal/config/storage.go b/internal/config/storage.go index 71b7f3cb3c..165f081669 100644 --- a/internal/config/storage.go +++ b/internal/config/storage.go @@ -191,8 +191,8 @@ func (g *Git) validate() error { type GitBackendType string const ( - GitBackendMemory = GitBackendType("memory") - GitBackendFilesystem = GitBackendType("filesystem") + GitBackendMemory = GitBackendType("memory") + GitBackendLocal = GitBackendType("local") ) type GitBackend struct { diff --git a/internal/config/testdata/storage/git_provided_with_backend_type.yml b/internal/config/testdata/storage/git_provided_with_backend_type.yml index ed1c21902f..e83ec1ee74 100644 --- a/internal/config/testdata/storage/git_provided_with_backend_type.yml +++ b/internal/config/testdata/storage/git_provided_with_backend_type.yml @@ -3,5 +3,5 @@ storage: git: repository: "git@github.com:foo/bar.git" backend: - type: "filesystem" + type: "local" path: "/path/to/gitdir" diff --git a/internal/storage/fs/store/store.go b/internal/storage/fs/store/store.go index 3073cf46d2..4886451d7f 100644 --- a/internal/storage/fs/store/store.go +++ b/internal/storage/fs/store/store.go @@ -47,7 +47,7 @@ func NewStore(ctx context.Context, logger *zap.Logger, cfg *config.Config) (_ st } switch storage.Backend.Type { - case config.GitBackendFilesystem: + case config.GitBackendLocal: path := storage.Backend.Path if path == "" { path, err = os.MkdirTemp(os.TempDir(), "flipt-git-*")