staticnetworkconfig

package
v1.0.10-0...-a63f435 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package staticnetworkconfig is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateStaticNetworkConfigArchive

func GenerateStaticNetworkConfigArchive(files []StaticNetworkConfigData) (*bytes.Buffer, error)

Types

type Config

type Config struct {
	// MinVersionForNmstateService is a flag that enables the static networking flow using the nmstate service for specific OCP versions.
	MinVersionForNmstateService string `envconfig:"MIN_VERSION_FOR_NMSTATE_SERVICE" default:"4.18"`
}

type MockStaticNetworkConfig

type MockStaticNetworkConfig struct {
	// contains filtered or unexported fields
}

MockStaticNetworkConfig is a mock of StaticNetworkConfig interface.

func NewMockStaticNetworkConfig

func NewMockStaticNetworkConfig(ctrl *gomock.Controller) *MockStaticNetworkConfig

NewMockStaticNetworkConfig creates a new mock instance.

func (*MockStaticNetworkConfig) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockStaticNetworkConfig) FormatStaticNetworkConfigForDB

func (m *MockStaticNetworkConfig) FormatStaticNetworkConfigForDB(staticNetworkConfig []*models.HostStaticNetworkConfig) (string, error)

FormatStaticNetworkConfigForDB mocks base method.

func (*MockStaticNetworkConfig) GenerateStaticNetworkConfigData

func (m *MockStaticNetworkConfig) GenerateStaticNetworkConfigData(ctx context.Context, hostsYAMLS string) ([]StaticNetworkConfigData, error)

GenerateStaticNetworkConfigData mocks base method.

func (*MockStaticNetworkConfig) GenerateStaticNetworkConfigDataYAML

func (m *MockStaticNetworkConfig) GenerateStaticNetworkConfigDataYAML(staticNetworkConfigStr string) ([]StaticNetworkConfigData, error)

GenerateStaticNetworkConfigDataYAML mocks base method.

func (*MockStaticNetworkConfig) ShouldUseNmstateService

func (m *MockStaticNetworkConfig) ShouldUseNmstateService(staticNetworkConfigStr, openshiftVersion string) (bool, error)

ShouldUseNmstateService mocks base method.

func (*MockStaticNetworkConfig) ValidateStaticConfigParamsYAML

func (m *MockStaticNetworkConfig) ValidateStaticConfigParamsYAML(staticNetworkConfig []*models.HostStaticNetworkConfig) error

ValidateStaticConfigParamsYAML mocks base method.

type MockStaticNetworkConfigMockRecorder

type MockStaticNetworkConfigMockRecorder struct {
	// contains filtered or unexported fields
}

MockStaticNetworkConfigMockRecorder is the mock recorder for MockStaticNetworkConfig.

func (*MockStaticNetworkConfigMockRecorder) FormatStaticNetworkConfigForDB

func (mr *MockStaticNetworkConfigMockRecorder) FormatStaticNetworkConfigForDB(staticNetworkConfig interface{}) *gomock.Call

FormatStaticNetworkConfigForDB indicates an expected call of FormatStaticNetworkConfigForDB.

func (*MockStaticNetworkConfigMockRecorder) GenerateStaticNetworkConfigData

func (mr *MockStaticNetworkConfigMockRecorder) GenerateStaticNetworkConfigData(ctx, hostsYAMLS interface{}) *gomock.Call

GenerateStaticNetworkConfigData indicates an expected call of GenerateStaticNetworkConfigData.

func (*MockStaticNetworkConfigMockRecorder) GenerateStaticNetworkConfigDataYAML

func (mr *MockStaticNetworkConfigMockRecorder) GenerateStaticNetworkConfigDataYAML(staticNetworkConfigStr interface{}) *gomock.Call

GenerateStaticNetworkConfigDataYAML indicates an expected call of GenerateStaticNetworkConfigDataYAML.

func (*MockStaticNetworkConfigMockRecorder) ShouldUseNmstateService

func (mr *MockStaticNetworkConfigMockRecorder) ShouldUseNmstateService(staticNetworkConfigStr, openshiftVersion interface{}) *gomock.Call

ShouldUseNmstateService indicates an expected call of ShouldUseNmstateService.

func (*MockStaticNetworkConfigMockRecorder) ValidateStaticConfigParamsYAML

func (mr *MockStaticNetworkConfigMockRecorder) ValidateStaticConfigParamsYAML(staticNetworkConfig interface{}) *gomock.Call

ValidateStaticConfigParamsYAML indicates an expected call of ValidateStaticConfigParamsYAML.

type StaticNetworkConfig

type StaticNetworkConfig interface {
	GenerateStaticNetworkConfigData(ctx context.Context, hostsYAMLS string) ([]StaticNetworkConfigData, error)
	GenerateStaticNetworkConfigDataYAML(staticNetworkConfigStr string) ([]StaticNetworkConfigData, error)
	FormatStaticNetworkConfigForDB(staticNetworkConfig []*models.HostStaticNetworkConfig) (string, error)
	ValidateStaticConfigParamsYAML(staticNetworkConfig []*models.HostStaticNetworkConfig) error
	ShouldUseNmstateService(staticNetworkConfigStr, openshiftVersion string) (bool, error)
}

func New

type StaticNetworkConfigData

type StaticNetworkConfigData struct {
	FilePath     string
	FileContents string
}

type StaticNetworkConfigGenerator

type StaticNetworkConfigGenerator struct {
	// contains filtered or unexported fields
}

func (*StaticNetworkConfigGenerator) CheckConfigForGlobalDnsCase

func (s *StaticNetworkConfigGenerator) CheckConfigForGlobalDnsCase(staticNetworkConfigStr string) (bool, error)

CheckConfigForGlobalDnsCase detect whether any of the host-provided YAML configurations contain an interface with auto-dns: false, dhcp: true. TODO: This is a temporary workaround and should be removed once the auto-dns:false, dhcp:true bug is fixed

func (*StaticNetworkConfigGenerator) CheckConfigForMACIdentifier

func (s *StaticNetworkConfigGenerator) CheckConfigForMACIdentifier(staticNetworkConfigStr string) (bool, error)

CheckConfigForMACIdentifier TODO: This is a temporary workaround and should be removed once the mac-identifier bug in nmstate is fixed - RHEL-72440.

func (*StaticNetworkConfigGenerator) FormatStaticNetworkConfigForDB

func (s *StaticNetworkConfigGenerator) FormatStaticNetworkConfigForDB(staticNetworkConfig []*models.HostStaticNetworkConfig) (string, error)

func (*StaticNetworkConfigGenerator) GenerateStaticNetworkConfigData

func (s *StaticNetworkConfigGenerator) GenerateStaticNetworkConfigData(ctx context.Context, staticNetworkConfigStr string) ([]StaticNetworkConfigData, error)

func (*StaticNetworkConfigGenerator) GenerateStaticNetworkConfigDataYAML

func (s *StaticNetworkConfigGenerator) GenerateStaticNetworkConfigDataYAML(staticNetworkConfigStr string) ([]StaticNetworkConfigData, error)

func (*StaticNetworkConfigGenerator) NMStatectlServiceSupported

func (s *StaticNetworkConfigGenerator) NMStatectlServiceSupported(version string) (bool, error)

func (*StaticNetworkConfigGenerator) ShouldUseNmstateService

func (s *StaticNetworkConfigGenerator) ShouldUseNmstateService(staticNetworkConfigStr, openshiftVersion string) (bool, error)

ShouldUseNmstatectlService - Both static networking flows should be maintained: one without nmstate.service and one with it, since nmstate.service isn't available in all RHCOS versions.

func (*StaticNetworkConfigGenerator) ValidateStaticConfigParamsYAML

func (s *StaticNetworkConfigGenerator) ValidateStaticConfigParamsYAML(staticNetworkConfig []*models.HostStaticNetworkConfig) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL