forked from cri-o/cri-o
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes cri-o#3914 [FEAT] Add new parameter disable_hostport_mapping i…
…n CRI-O Signed-off-by: T K Chandra Hasan <t.k.chandra.hasan@ibm.com>
- Loading branch information
Showing
10 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package hostport | ||
|
||
import "github.com/sirupsen/logrus" | ||
|
||
// This interface implements, when hostport mapping is disabled in CRI-O | ||
type noopHostportManager struct{} | ||
|
||
// NewNoopHostportManager creates a new HostPortManager | ||
func NewNoopHostportManager() HostPortManager { | ||
logrus.Info("HostPort Mapping is Disabled in CRI-O") | ||
return &noopHostportManager{} | ||
} | ||
|
||
func (mh *noopHostportManager) Add(id string, podPortMapping *PodPortMapping, natInterfaceName string) error { | ||
logrus.Debug("HostPort Mapping is Disabled in CRI-O") | ||
return nil | ||
} | ||
|
||
func (mh *noopHostportManager) Remove(id string, podPortMapping *PodPortMapping) error { | ||
logrus.Debug("HostPort Mapping is Disabled in CRI-O") | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters