Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable error messages related to networks/network interface cards #344

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions agent/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1209,14 +1209,6 @@ var _ = Describe("bootstrap", func() {
}`
})

Context("and no physical network interfaces exist", func() {
It("raises an error", func() {
err := boot.Run()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("Number of network settings '1' is greater than the number of network devices '0"))
})
})

Context("and a single physical network interface exists", func() {
BeforeEach(func() {
stubInterfaces([][]string{{"eth0", "aa:bb:cc"}})
Expand Down Expand Up @@ -1264,14 +1256,6 @@ var _ = Describe("bootstrap", func() {
}`
})

Context("and no physical network interfaces exist", func() {
It("raises an error", func() {
err := boot.Run()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("Number of network settings '1' is greater than the number of network devices '0"))
})
})

Context("and a single physical network interface exists", func() {
BeforeEach(func() {
stubInterfaces([][]string{{"eth0", "aa:bb:cc"}})
Expand Down Expand Up @@ -1336,10 +1320,9 @@ var _ = Describe("bootstrap", func() {
stubInterfaces([][]string{{"eth0", "aa:bb:cc"}})
})

It("raises an error", func() {
It("succeeds", func() {
err := boot.Run()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("Number of network settings '2' is greater than the number of network devices '1"))
Expect(err).ToNot(HaveOccurred())
})
})

Expand Down
4 changes: 0 additions & 4 deletions platform/net/interface_configuration_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ func NewInterfaceConfigurationCreator(logger boshlog.Logger) InterfaceConfigurat
}

func (creator interfaceConfigurationCreator) CreateInterfaceConfigurations(networks boshsettings.Networks, interfacesByMAC map[string]string) ([]StaticInterfaceConfiguration, []DHCPInterfaceConfiguration, error) {
if !networks.HasInterfaceAlias() && len(interfacesByMAC) < len(networks) {
return nil, nil, bosherr.Errorf("Number of network settings '%d' is greater than the number of network devices '%d'", len(networks), len(interfacesByMAC))
}

// In cases where we only have one network and it has no MAC address (either because the IAAS doesn't give us one or
// it's an old CPI), if we only have one interface, we should map them
if len(networks) == 1 && len(interfacesByMAC) == 1 {
Expand Down
12 changes: 0 additions & 12 deletions platform/net/interface_configuration_creator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,6 @@ var _ = Describe("InterfaceConfigurationCreator", func() {
Expect(len(dhcpInterfaceConfigurations)).To(Equal(0))
})
})

Context("And there are no network devices", func() {
BeforeEach(func() {
interfacesByMAC = map[string]string{}
})

It("returns an error", func() {
_, _, err := interfaceConfigurationCreator.CreateInterfaceConfigurations(networks, interfacesByMAC)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("Number of network settings '1' is greater than the number of network devices '0'"))
})
})
})

Context("And the network has an alias", func() {
Expand Down
Loading