github.com/looshlee/cilium@v1.6.12/plugins/cilium-cni/chaining/portmap/portmap.go (about)

     1  // Copyright 2019 Authors of Cilium
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package portmap
    16  
    17  import (
    18  	"context"
    19  
    20  	chainingapi "github.com/cilium/cilium/plugins/cilium-cni/chaining/api"
    21  
    22  	cniTypesVer "github.com/containernetworking/cni/pkg/types/current"
    23  )
    24  
    25  type portmapChainer struct{}
    26  
    27  func (p *portmapChainer) ImplementsAdd() bool {
    28  	return false
    29  }
    30  
    31  func (p *portmapChainer) Add(ctx context.Context, pluginCtx chainingapi.PluginContext) (res *cniTypesVer.Result, err error) {
    32  	return nil, nil
    33  }
    34  
    35  func (p *portmapChainer) ImplementsDelete() bool {
    36  	return false
    37  }
    38  
    39  func (p *portmapChainer) Delete(ctx context.Context, pluginCtx chainingapi.PluginContext) (err error) {
    40  	return nil
    41  }
    42  
    43  func init() {
    44  	chainingapi.Register("portmap", &portmapChainer{})
    45  }