github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/internal/store/clusters/actions.go (about)

     1  package clusters
     2  
     3  import (
     4  	"k8s.io/apimachinery/pkg/types"
     5  
     6  	"github.com/tilt-dev/tilt/internal/store"
     7  	"github.com/tilt-dev/tilt/pkg/apis/core/v1alpha1"
     8  )
     9  
    10  type ClusterUpsertAction struct {
    11  	Cluster *v1alpha1.Cluster
    12  }
    13  
    14  func NewClusterUpsertAction(obj *v1alpha1.Cluster) ClusterUpsertAction {
    15  	return ClusterUpsertAction{Cluster: obj}
    16  }
    17  
    18  func (a ClusterUpsertAction) Summarize(summary *store.ChangeSummary) {
    19  	summary.Clusters.Add(types.NamespacedName{
    20  		Namespace: a.Cluster.Namespace,
    21  		Name:      a.Cluster.Name,
    22  	})
    23  }
    24  
    25  func (ClusterUpsertAction) Action() {}
    26  
    27  type ClusterDeleteAction struct {
    28  	Name string
    29  }
    30  
    31  func NewClusterDeleteAction(n string) ClusterDeleteAction {
    32  	return ClusterDeleteAction{Name: n}
    33  }
    34  
    35  func (ClusterDeleteAction) Action() {}
    36  
    37  func (a ClusterDeleteAction) Summarize(summary *store.ChangeSummary) {
    38  	summary.Clusters.Add(types.NamespacedName{
    39  		Name: a.Name,
    40  	})
    41  }