github.com/verrazzano/verrazzano@v1.7.0/application-operator/controllers/logging/loginfo.go (about)

     1  // Copyright (c) 2021, 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 logging
     5  
     6  import (
     7  	"context"
     8  
     9  	vzapi "github.com/verrazzano/verrazzano/application-operator/apis/oam/v1alpha1"
    10  	ctrl "sigs.k8s.io/controller-runtime"
    11  )
    12  
    13  const (
    14  	configMapAPIVersion = "v1"
    15  	configMapKind       = "ConfigMap"
    16  )
    17  
    18  // LogInfo contains information needed for logging
    19  type LogInfo struct {
    20  	// The fluentd image
    21  	FluentdImage string
    22  }
    23  
    24  // Handler abstracts the FLUENTD integration for components
    25  type Handler interface {
    26  	Apply(ctx context.Context, resource vzapi.QualifiedResourceRelation, info *LogInfo) (*ctrl.Result, error)
    27  	Remove(ctx context.Context, resource vzapi.QualifiedResourceRelation, info *LogInfo) (bool, error)
    28  }
    29  
    30  // NewLogInfo creates and populates a new logging info
    31  func NewLogInfo() *LogInfo {
    32  	return &LogInfo{FluentdImage: DefaultFluentdImage}
    33  }