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

     1  // Copyright (c) 2021, 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  // Enforce that LoggingTrait adheres to Trait interface.
    12  var _ oam.Trait = &LoggingTrait{}
    13  
    14  // GetCondition gets the status condition of this trait.
    15  func (in *LoggingTrait) GetCondition(ct oamrt.ConditionType) oamrt.Condition {
    16  	return in.Status.GetCondition(ct)
    17  }
    18  
    19  // SetConditions sets the status condition of this trait.
    20  func (in *LoggingTrait) SetConditions(c ...oamrt.Condition) {
    21  	in.Status.SetConditions(c...)
    22  }
    23  
    24  // GetWorkloadReference gets the workload reference of this trait.
    25  func (in *LoggingTrait) GetWorkloadReference() oamrt.TypedReference {
    26  	return in.Spec.WorkloadReference
    27  }
    28  
    29  // SetWorkloadReference sets the workload reference of this trait.
    30  func (in *LoggingTrait) SetWorkloadReference(r oamrt.TypedReference) {
    31  	in.Spec.WorkloadReference = r
    32  }