Skip to content

Commit 35e6bea

Browse files
Revert "feat(conformance): validate implementation flags (#3715)" (#3920)
This reverts commit 564720a.
1 parent a07680f commit 35e6bea

File tree

4 files changed

+6
-114
lines changed

4 files changed

+6
-114
lines changed

conformance/conformance.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,13 @@ func DefaultOptions(t *testing.T) suite.ConformanceOptions {
7272
namespaceAnnotations := suite.ParseKeyValuePairs(*flags.NamespaceAnnotations)
7373
conformanceProfiles := suite.ParseConformanceProfiles(*flags.ConformanceProfiles)
7474

75-
implementation, err := suite.ParseImplementation(
75+
implementation := suite.ParseImplementation(
7676
*flags.ImplementationOrganization,
7777
*flags.ImplementationProject,
7878
*flags.ImplementationURL,
7979
*flags.ImplementationVersion,
8080
*flags.ImplementationContact,
8181
)
82-
require.NoError(t, err, "error parsing implementation details")
8382

8483
return suite.ConformanceOptions{
8584
AllowCRDsMismatch: *flags.AllowCRDsMismatch,
@@ -93,7 +92,7 @@ func DefaultOptions(t *testing.T) suite.ConformanceOptions {
9392
ExemptFeatures: exemptFeatures,
9493
ManifestFS: []fs.FS{&Manifests},
9594
GatewayClassName: *flags.GatewayClassName,
96-
Implementation: *implementation,
95+
Implementation: implementation,
9796
Mode: *flags.Mode,
9897
NamespaceAnnotations: namespaceAnnotations,
9998
NamespaceLabels: namespaceLabels,

conformance/utils/suite/suite.go

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"errors"
2222
"fmt"
2323
"io/fs"
24-
neturl "net/url"
2524
"slices"
2625
"sort"
2726
"strings"
@@ -559,33 +558,14 @@ func (suite *ConformanceTestSuite) Report() (*confv1.ConformanceReport, error) {
559558

560559
// ParseImplementation parses implementation-specific flag arguments and
561560
// creates a *confv1a1.Implementation.
562-
func ParseImplementation(org, project, url, version, contact string) (*confv1.Implementation, error) {
563-
if org == "" {
564-
return nil, errors.New("organization must be set")
565-
}
566-
if project == "" {
567-
return nil, errors.New("project must be set")
568-
}
569-
if url == "" {
570-
return nil, errors.New("url must be set")
571-
}
572-
if version == "" {
573-
return nil, errors.New("version must be set")
574-
}
575-
if contact == "" {
576-
return nil, errors.New("contact must be set")
577-
}
578-
if _, err := neturl.ParseRequestURI(url); err != nil {
579-
return nil, errors.New("url is malformed")
580-
}
581-
582-
return &confv1.Implementation{
561+
func ParseImplementation(org, project, url, version, contact string) confv1.Implementation {
562+
return confv1.Implementation{
583563
Organization: org,
584564
Project: project,
585565
URL: url,
586566
Version: version,
587567
Contact: strings.Split(contact, ","),
588-
}, nil
568+
}
589569
}
590570

591571
// ParseConformanceProfiles parses flag arguments and converts the string to

conformance/utils/suite/suite_test.go

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -538,89 +538,3 @@ func namesToFeatureSet(names []string) FeaturesSet {
538538
}
539539
return featureSet
540540
}
541-
542-
func TestParseImplementation(t *testing.T) {
543-
testCases := []struct {
544-
name string
545-
org string
546-
project string
547-
url string
548-
version string
549-
contact string
550-
expected *confv1.Implementation
551-
expectedErr error
552-
}{
553-
{
554-
name: "missing organization",
555-
project: "test-project",
556-
url: "https://example.com",
557-
version: "v1.0.0",
558-
contact: "[email protected]",
559-
expectedErr: errors.New("organization must be set"),
560-
},
561-
{
562-
name: "missing project",
563-
org: "test-org",
564-
url: "https://example.com",
565-
version: "v1.0.0",
566-
contact: "[email protected]",
567-
expectedErr: errors.New("project must be set"),
568-
},
569-
{
570-
name: "missing url",
571-
org: "test-org",
572-
project: "test-project",
573-
version: "v1.0.0",
574-
contact: "[email protected]",
575-
expectedErr: errors.New("url must be set"),
576-
},
577-
{
578-
name: "missing version",
579-
org: "test-org",
580-
project: "test-project",
581-
url: "https://example.com",
582-
contact: "[email protected]",
583-
expectedErr: errors.New("version must be set"),
584-
},
585-
{
586-
name: "missing contact",
587-
org: "test-org",
588-
project: "test-project",
589-
url: "https://example.com",
590-
version: "v1.0.0",
591-
expectedErr: errors.New("contact must be set"),
592-
},
593-
{
594-
name: "malformed url",
595-
org: "test-org",
596-
project: "test-project",
597-
url: "invalid-url",
598-
version: "v1.0.0",
599-
contact: "[email protected]",
600-
expectedErr: errors.New("url is malformed"),
601-
},
602-
{
603-
name: "valid input",
604-
org: "test-org",
605-
project: "test-project",
606-
url: "https://example.com",
607-
version: "v1.0.0",
608-
609-
expected: &confv1.Implementation{
610-
Organization: "test-org",
611-
Project: "test-project",
612-
URL: "https://example.com",
613-
Version: "v1.0.0",
614-
Contact: []string{"[email protected]", "[email protected]"},
615-
},
616-
},
617-
}
618-
619-
for _, tc := range testCases {
620-
t.Run(tc.name, func(t *testing.T) {
621-
result, err := ParseImplementation(tc.org, tc.project, tc.url, tc.version, tc.contact)
622-
assert.Equal(t, tc.expected, result)
623-
assert.Equal(t, tc.expectedErr, err)
624-
})
625-
}
626-
}

pkg/test/cel/grpcroute_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,7 @@ func TestGRPCRouteRule(t *testing.T) {
341341
}
342342
return rules
343343
}(),
344-
},
345-
}
344+
}}
346345

347346
for _, tc := range tests {
348347
t.Run(tc.name, func(t *testing.T) {

0 commit comments

Comments
 (0)