github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/internal/operator/boom/application/applications/metriccollection/prometheusoperator.go (about)

     1  package metriccollection
     2  
     3  import (
     4  	toolsetslatest "github.com/caos/orbos/internal/operator/boom/api/latest"
     5  	"github.com/caos/orbos/internal/operator/boom/application/applications/metriccollection/info"
     6  	"github.com/caos/orbos/internal/operator/boom/name"
     7  	"github.com/caos/orbos/mntr"
     8  )
     9  
    10  type PrometheusOperator struct {
    11  	monitor mntr.Monitor
    12  }
    13  
    14  func New(monitor mntr.Monitor) *PrometheusOperator {
    15  	po := &PrometheusOperator{
    16  		monitor: monitor,
    17  	}
    18  
    19  	return po
    20  }
    21  
    22  func (po *PrometheusOperator) GetName() name.Application {
    23  	return info.GetName()
    24  }
    25  
    26  func (po *PrometheusOperator) Deploy(toolsetCRDSpec *toolsetslatest.ToolsetSpec) bool {
    27  	return toolsetCRDSpec.MetricCollection != nil && toolsetCRDSpec.MetricCollection.Deploy
    28  }
    29  
    30  func (po *PrometheusOperator) GetNamespace() string {
    31  	return info.GetNamespace()
    32  }