...
1 package watch
2
3 import (
4 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
5 "k8s.io/klog"
6 )
7
8 type State string
9
10 const (
11 StateWaitDeployment State = "WaitDeployment"
12 StateSyncOutdated State = "SyncOutdated"
13
14
15
16
17
18 StateReady State = "Ready"
19 )
20
21 type ComponentStatus struct {
22 state State
23 PostStartEventsDone bool
24
25
26 RunExecuted bool
27 EndpointsForwarded map[string][]v1alpha2.Endpoint
28
29
30 ImageComponentsAutoApplied map[string]v1alpha2.ImageComponent
31 }
32
33 func (o *ComponentStatus) SetState(s State) {
34 klog.V(4).Infof("setting inner loop State %q", s)
35 o.state = s
36 }
37
38 func (o *ComponentStatus) GetState() State {
39 return o.state
40 }
41
42 func componentCanSyncFile(state State) bool {
43 return state == StateReady
44 }
45
View as plain text