Skip to content
Snippets Groups Projects
Commit 82049ba6 authored by ko_oler's avatar ko_oler
Browse files

правки по ПР: определена константа ExtensionMetadataKey

parent ab5108f2
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,8 @@ const ( ...@@ -21,6 +21,8 @@ const (
StateInstalled = pb.SpaceExtensions_INSTALLED StateInstalled = pb.SpaceExtensions_INSTALLED
StateInProgress = pb.SpaceExtensions_IN_PROGRESS StateInProgress = pb.SpaceExtensions_IN_PROGRESS
StateFail = pb.SpaceExtensions_FAIL StateFail = pb.SpaceExtensions_FAIL
ExtensionMetadataKey = "extension"
) )
type ( type (
......
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
"git.perx.ru/perxis/perxis-go/pkg/collections" "git.perx.ru/perxis/perxis-go/pkg/collections"
"git.perx.ru/perxis/perxis-go/pkg/environments" "git.perx.ru/perxis/perxis-go/pkg/environments"
"git.perx.ru/perxis/perxis-go/pkg/errors" "git.perx.ru/perxis/perxis-go/pkg/errors"
"git.perx.ru/perxis/perxis-go/pkg/extension"
"go.uber.org/zap" "go.uber.org/zap"
) )
...@@ -16,7 +17,6 @@ var ( ...@@ -16,7 +17,6 @@ var (
ErrInstallCollections = errors.New("failed to install collections") ErrInstallCollections = errors.New("failed to install collections")
ErrUninstallCollections = errors.New("failed to uninstall collections") ErrUninstallCollections = errors.New("failed to uninstall collections")
ErrCollectionAlreadyExists = errors.New("failed to uninstall collections") ErrCollectionAlreadyExists = errors.New("failed to uninstall collections")
key = "extension"
) )
type CollectionsOption func(c *CollectionConfig) type CollectionsOption func(c *CollectionConfig)
...@@ -158,7 +158,7 @@ func (s *Setup) InstallCollection(ctx context.Context, c CollectionConfig) (setS ...@@ -158,7 +158,7 @@ func (s *Setup) InstallCollection(ctx context.Context, c CollectionConfig) (setS
return false, err return false, err
} }
} else { } else {
if collection.Schema.Metadata != nil && exist.Schema.Metadata[key] != collection.Schema.Metadata[key] && !s.IsForce() { if collection.Schema.Metadata != nil && exist.Schema.Metadata[extension.ExtensionMetadataKey] != collection.Schema.Metadata[extension.ExtensionMetadataKey] && !s.IsForce() {
return false, ErrCollectionAlreadyExists return false, ErrCollectionAlreadyExists
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment