feat: allow to filter machines for global service deployments

This commit is contained in:
Pavel Sviderski
2025-02-17 20:26:40 +10:00
parent 8610322682
commit e13408d79f
6 changed files with 227 additions and 10 deletions
+5
View File
@@ -7,6 +7,7 @@ import (
"github.com/distribution/reference"
"strings"
"uncloud/internal/api"
"uncloud/internal/machine/api/pb"
"uncloud/internal/secret"
)
@@ -25,6 +26,10 @@ type Plan struct {
SequenceOperation
}
// MachineFilter determines which machines participate in a deployment operation by returning true for
// machines that should be included.
type MachineFilter func(m *pb.MachineInfo) bool
// NewDeployment creates a new deployment for the given service specification.
// If strategy is nil, a default RollingStrategy will be used.
func (cli *Client) NewDeployment(spec api.ServiceSpec, strategy Strategy) (*Deployment, error) {