@@ -351,11 +351,7 @@ func TestParseWithMacAddress(t *testing.T) {
351351 if _ , _ , _ , err := parseRun ([]string {invalidMacAddress , "img" , "cmd" }); err != nil && err .Error () != "invalidMacAddress is not a valid mac address" {
352352 t .Fatalf ("Expected an error with %v mac-address, got %v" , invalidMacAddress , err )
353353 }
354- config , hostConfig , nwConfig := mustParse (t , validMacAddress )
355- if config .MacAddress != "92:d0:c6:0a:29:33" { //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.44.
356- t .Fatalf ("Expected the config to have '92:d0:c6:0a:29:33' as container-wide MacAddress, got '%v'" ,
357- config .MacAddress ) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.44.
358- }
354+ _ , hostConfig , nwConfig := mustParse (t , validMacAddress )
359355 defaultNw := hostConfig .NetworkMode .NetworkName ()
360356 if nwConfig .EndpointsConfig [defaultNw ].MacAddress != "92:d0:c6:0a:29:33" {
361357 t .Fatalf ("Expected the default endpoint to have the MacAddress '92:d0:c6:0a:29:33' set, got '%v'" , nwConfig .EndpointsConfig [defaultNw ].MacAddress )
@@ -576,7 +572,6 @@ func TestParseNetworkConfig(t *testing.T) {
576572 name string
577573 flags []string
578574 expected map [string ]* networktypes.EndpointSettings
579- expectedCfg container.Config
580575 expectedHostCfg container.HostConfig
581576 expectedErr string
582577 }{
@@ -680,7 +675,6 @@ func TestParseNetworkConfig(t *testing.T) {
680675 MacAddress : "02:32:1c:23:00:04" ,
681676 },
682677 },
683- expectedCfg : container.Config {MacAddress : "02:32:1c:23:00:04" },
684678 expectedHostCfg : container.HostConfig {NetworkMode : "net1" },
685679 },
686680 {
@@ -698,7 +692,6 @@ func TestParseNetworkConfig(t *testing.T) {
698692 MacAddress : "52:0f:f3:dc:50:10" ,
699693 },
700694 },
701- expectedCfg : container.Config {MacAddress : "52:0f:f3:dc:50:10" },
702695 expectedHostCfg : container.HostConfig {NetworkMode : "net1" },
703696 },
704697 {
@@ -745,15 +738,14 @@ func TestParseNetworkConfig(t *testing.T) {
745738
746739 for _ , tc := range tests {
747740 t .Run (tc .name , func (t * testing.T ) {
748- config , hConfig , nwConfig , err := parseRun (tc .flags )
741+ _ , hConfig , nwConfig , err := parseRun (tc .flags )
749742
750743 if tc .expectedErr != "" {
751744 assert .Error (t , err , tc .expectedErr )
752745 return
753746 }
754747
755748 assert .NilError (t , err )
756- assert .DeepEqual (t , config .MacAddress , tc .expectedCfg .MacAddress ) //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.44.
757749 assert .DeepEqual (t , hConfig .NetworkMode , tc .expectedHostCfg .NetworkMode )
758750 assert .DeepEqual (t , nwConfig .EndpointsConfig , tc .expected , cmpopts .EquateComparable (netip.Addr {}))
759751 })
0 commit comments