...

Source file src/github.com/redhat-developer/odo/pkg/watch/status.go

Documentation: github.com/redhat-developer/odo/pkg/watch

     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  	//StateWaitBindings         State = "WaitBindings"
    14  	//StatePodRunning           State = "PodRunning"
    15  	//StateFilesSynced          State = "FilesSynced"
    16  	//StateBuildCommandExecuted State = "BuildCommandExecuted"
    17  	//StateRunCommandRunning    State = "RunCommandRunning"
    18  	StateReady State = "Ready"
    19  )
    20  
    21  type ComponentStatus struct {
    22  	state               State
    23  	PostStartEventsDone bool
    24  	// RunExecuted is set to true when the run command has been executed
    25  	// Used for HotReload capability
    26  	RunExecuted        bool
    27  	EndpointsForwarded map[string][]v1alpha2.Endpoint
    28  	// ImageComponentsAutoApplied is a cache of all image components that have been auto-applied.
    29  	// This map allows to avoid applying them too many times upon state changes in the cluster for example.
    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