-
Notifications
You must be signed in to change notification settings - Fork 288
/
actions.go
60 lines (47 loc) · 1.31 KB
/
actions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package k8swatch
import (
"net/url"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"github.com/windmilleng/tilt/internal/k8s"
"github.com/windmilleng/tilt/pkg/model"
)
type PodChangeAction struct {
Pod *v1.Pod
ManifestName model.ManifestName
// The UID that we matched against to associate this pod with Tilt.
// Might be the Pod UID itself, or the UID of an ancestor.
MatchedAncestorUID types.UID
}
func (PodChangeAction) Action() {}
func NewPodChangeAction(pod *v1.Pod, mn model.ManifestName, matchedAncestorUID types.UID) PodChangeAction {
return PodChangeAction{
Pod: pod,
ManifestName: mn,
MatchedAncestorUID: matchedAncestorUID,
}
}
type PodDeleteAction struct {
PodID k8s.PodID
Namespace k8s.Namespace
}
func (PodDeleteAction) Action() {}
func NewPodDeleteAction(podID k8s.PodID, namespace k8s.Namespace) PodDeleteAction {
return PodDeleteAction{
PodID: podID,
Namespace: namespace,
}
}
type ServiceChangeAction struct {
Service *v1.Service
ManifestName model.ManifestName
URL *url.URL
}
func (ServiceChangeAction) Action() {}
func NewServiceChangeAction(service *v1.Service, mn model.ManifestName, url *url.URL) ServiceChangeAction {
return ServiceChangeAction{
Service: service,
ManifestName: mn,
URL: url,
}
}