Skip to content

Commit

Permalink
feat: add the release storage interface (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
healthjyk committed May 7, 2024
1 parent c7455b0 commit 8ed1c20
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pkg/engine/release/storage.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package release

import (
v1 "kusionstack.io/kusion/pkg/apis/api.kusion.io/v1"
)

// Storage is used to provide storage service for multiple releases.
type Storage interface {
// Get returns a specified Release which is determined by the group of Project, Workspace
// and Revision.
Get(project, workspace string, revision uint64) (*v1.Release, error)

// GetRevisions returns the Revisions of a specified Project and Workspace.
GetRevisions(project, workspace string) ([]uint64, error)

// GetStackBoundRevisions returns the Revisions of a specified Project, Stack and Workspace.
GetStackBoundRevisions(project, stack, workspace string) ([]uint64, error)

// GetLatestRevision returns the latest State which corresponds to the current infra Resources.
GetLatestRevision(project, workspace string) (uint64, error)

// Create creates a new Release in the Storage.
Create(release *v1.Release) error

// Update updates an existing Release in the Storage.
Update(release *v1.Release) error
}

0 comments on commit 8ed1c20

Please sign in to comment.