github.com/aporeto-inc/trireme-lib@v10.358.0+incompatible/controller/internal/supervisor/noop/supervisornoop.go (about)

     1  // Package supervisornoop implements the supervisor interface with no operations. This is currently being used in two places:
     2  // 1. for the supervisor proxy that actually does not need to take any action as a complement to the enforcer proxy
     3  // 2. for enforcer implementations that do not need a supervisor to program the networks (e.g. the remote envoy authorizer enforcer)
     4  package supervisornoop
     5  
     6  import (
     7  	"context"
     8  	"time"
     9  
    10  	"go.aporeto.io/enforcerd/trireme-lib/controller/runtime"
    11  	"go.aporeto.io/enforcerd/trireme-lib/policy"
    12  )
    13  
    14  // NoopSupervisor is a struct to hold the implementation of the Supervisor interface
    15  type NoopSupervisor struct{}
    16  
    17  // Supervise just keeps track of the active remotes so that it can initiate updates.
    18  func (s *NoopSupervisor) Supervise(contextID string, puInfo *policy.PUInfo) error {
    19  
    20  	return nil
    21  }
    22  
    23  // Unsupervise just keeps track of the active remotes so
    24  func (s *NoopSupervisor) Unsupervise(contextID string) error {
    25  
    26  	return nil
    27  }
    28  
    29  // SetTargetNetworks sets the target networks in case of an  update
    30  func (s *NoopSupervisor) SetTargetNetworks(cfg *runtime.Configuration) error {
    31  	return nil
    32  }
    33  
    34  // CleanUp implements the cleanup interface, but it doesn't need to do anything.
    35  func (s *NoopSupervisor) CleanUp() error {
    36  	return nil
    37  }
    38  
    39  // Run runs the proxy supervisor and initializes the cleaners.
    40  func (s *NoopSupervisor) Run(ctx context.Context) error {
    41  	return nil
    42  }
    43  
    44  // EnableIPTablesPacketTracing enable iptables tracing
    45  func (s *NoopSupervisor) EnableIPTablesPacketTracing(ctx context.Context, contextID string, interval time.Duration) error {
    46  	return nil
    47  }
    48  
    49  // NewNoopSupervisor creates a new noop supervisor
    50  func NewNoopSupervisor() *NoopSupervisor {
    51  
    52  	return &NoopSupervisor{}
    53  }