github.com/verrazzano/verrazzano@v1.7.0/application-operator/apis/oam/v1alpha1/metricstrait_methods.go (about)

     1  // Copyright (c) 2020, 2022, Oracle and/or its affiliates.
     2  // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     3  
     4  package v1alpha1
     5  
     6  import (
     7  	oamrt "github.com/crossplane/crossplane-runtime/apis/common/v1"
     8  	"github.com/crossplane/oam-kubernetes-runtime/pkg/oam"
     9  )
    10  
    11  // Ensure that MetricsTrait adheres to Scope interface.
    12  var _ oam.Trait = &MetricsTrait{}
    13  
    14  // GetCondition gets the condition of this trait.
    15  func (t *MetricsTrait) GetCondition(ct oamrt.ConditionType) oamrt.Condition {
    16  	return t.Status.GetCondition(ct)
    17  }
    18  
    19  // SetConditions sets the condition of this trait.
    20  func (t *MetricsTrait) SetConditions(c ...oamrt.Condition) {
    21  	t.Status.SetConditions(c...)
    22  }
    23  
    24  // GetWorkloadReference gets the workload reference of this trait.
    25  func (t *MetricsTrait) GetWorkloadReference() oamrt.TypedReference {
    26  	return t.Spec.WorkloadReference
    27  }
    28  
    29  // SetWorkloadReference sets the workload reference of this trait.
    30  func (t *MetricsTrait) SetWorkloadReference(r oamrt.TypedReference) {
    31  	t.Spec.WorkloadReference = r
    32  }