diff --git a/pkg/extension/extension.go b/pkg/extension/extension.go index 26d9b6d51171307161e68ceef0830857fbb569a8..fb8044c7a2f4c76b775840c5628319196a0493ae 100644 --- a/pkg/extension/extension.go +++ b/pkg/extension/extension.go @@ -21,6 +21,8 @@ const ( StateInstalled = pb.SpaceExtensions_INSTALLED StateInProgress = pb.SpaceExtensions_IN_PROGRESS StateFail = pb.SpaceExtensions_FAIL + + ExtensionMetadataKey = "extension" ) type ( diff --git a/pkg/setup/collection.go b/pkg/setup/collection.go index 375fedf64ee38fa4e9d195667b811c0a2f5c444e..bb0fc2d96214ab71b19f39ce5a8a0d2766533efe 100644 --- a/pkg/setup/collection.go +++ b/pkg/setup/collection.go @@ -8,6 +8,7 @@ import ( "git.perx.ru/perxis/perxis-go/pkg/collections" "git.perx.ru/perxis/perxis-go/pkg/environments" "git.perx.ru/perxis/perxis-go/pkg/errors" + "git.perx.ru/perxis/perxis-go/pkg/extension" "go.uber.org/zap" ) @@ -16,7 +17,6 @@ var ( ErrInstallCollections = errors.New("failed to install collections") ErrUninstallCollections = errors.New("failed to uninstall collections") ErrCollectionAlreadyExists = errors.New("failed to uninstall collections") - key = "extension" ) type CollectionsOption func(c *CollectionConfig) @@ -158,7 +158,7 @@ func (s *Setup) InstallCollection(ctx context.Context, c CollectionConfig) (setS return false, err } } 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 }