mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
chore: cleanup unused machine filter struct
This commit is contained in:
@@ -14,7 +14,6 @@ import (
|
|||||||
"github.com/psviderski/uncloud/internal/machine/api/pb"
|
"github.com/psviderski/uncloud/internal/machine/api/pb"
|
||||||
"github.com/psviderski/uncloud/pkg/api"
|
"github.com/psviderski/uncloud/pkg/api"
|
||||||
"github.com/psviderski/uncloud/pkg/client"
|
"github.com/psviderski/uncloud/pkg/client"
|
||||||
"github.com/psviderski/uncloud/pkg/client/deploy"
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -197,12 +196,3 @@ func UpdateDomainRecords(ctx context.Context, clusterClient *client.Client, prog
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func machineFilter(machines []string) deploy.MachineFilter {
|
|
||||||
if len(machines) == 0 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return func(m *pb.MachineInfo) bool {
|
|
||||||
return slices.Contains(machines, m.Name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/psviderski/uncloud/internal/machine/api/pb"
|
|
||||||
"github.com/psviderski/uncloud/pkg/api"
|
"github.com/psviderski/uncloud/pkg/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -34,12 +33,6 @@ type Plan struct {
|
|||||||
SequenceOperation
|
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
|
|
||||||
|
|
||||||
var ErrNoMatchingMachines = errors.New("no machines match the filter")
|
|
||||||
|
|
||||||
// NewDeployment creates a new deployment for the given service specification.
|
// NewDeployment creates a new deployment for the given service specification.
|
||||||
// If strategy is nil, a default RollingStrategy will be used.
|
// If strategy is nil, a default RollingStrategy will be used.
|
||||||
func NewDeployment(cli Client, spec api.ServiceSpec, strategy Strategy) *Deployment {
|
func NewDeployment(cli Client, spec api.ServiceSpec, strategy Strategy) *Deployment {
|
||||||
|
|||||||
Reference in New Issue
Block a user