Skip to content
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
4 changes: 2 additions & 2 deletions pkg/dns/alibaba/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func newFakeProvider(public, private Service) dns.Provider {
}
}

func TestGetRR(t *testing.T) {
func Test_getRR(t *testing.T) {
cases := []struct {
dnsName string
domainName string
Expand Down Expand Up @@ -90,7 +90,7 @@ func TestGetRR(t *testing.T) {
}
}

func TestParseZone(t *testing.T) {
func Test_parseZone(t *testing.T) {
cases := []struct {
id string
tags map[string]string
Expand Down
2 changes: 1 addition & 1 deletion pkg/dns/alibaba/util/numbers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
)

func TestClamp(t *testing.T) {
func Test_Clamp(t *testing.T) {
cases := []struct {
val int64
min int64
Expand Down
4 changes: 2 additions & 2 deletions pkg/dns/aws/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
configv1 "github.com/openshift/api/config/v1"
)

func TestZoneMatchesTags(t *testing.T) {
func Test_zoneMatchesTags(t *testing.T) {
cases := []struct {
name string
tagsForZone map[string]string
Expand Down Expand Up @@ -90,7 +90,7 @@ func TestZoneMatchesTags(t *testing.T) {
}
}

func TestZoneIDFromResource(t *testing.T) {
func Test_zoneIDFromResource(t *testing.T) {
cases := []struct {
resource string
expectedZoneID string
Expand Down
4 changes: 2 additions & 2 deletions pkg/dns/azure/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func fakeManager(fc *client.FakeDNSClient) (dns.Provider, error) {
return mgr, nil
}

func TestEnsureDNS(t *testing.T) {
func Test_Ensure(t *testing.T) {
c := client.Config{}
fc, _ := client.NewFake(c)
mgr, err := fakeManager(fc)
Expand Down Expand Up @@ -58,7 +58,7 @@ func TestEnsureDNS(t *testing.T) {
}
}

func TestDeleteDNS(t *testing.T) {
func Test_Delete(t *testing.T) {
c := client.Config{}
fc, err := client.NewFake(c)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/dns/gcp/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var (
DefaultProject = "defaultProject"
)

func TestParseZone(t *testing.T) {
func Test_ParseZone(t *testing.T) {
cases := []struct {
name string
providedZone string
Expand Down
4 changes: 2 additions & 2 deletions pkg/dns/ibm/private/dnssvcs_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestDelete(t *testing.T) {
func Test_Delete(t *testing.T) {
zone := configv1.DNSZone{
ID: "zoneID",
}
Expand Down Expand Up @@ -156,7 +156,7 @@ func TestDelete(t *testing.T) {
}
}

func TestCreateOrUpdate(t *testing.T) {
func Test_createOrUpdateDNSRecord(t *testing.T) {
zone := configv1.DNSZone{
ID: "zoneID",
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/dns/ibm/public/cis_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
dnsclient "github.com/openshift/cluster-ingress-operator/pkg/dns/ibm/public/client"
)

func TestDelete(t *testing.T) {
func Test_Delete(t *testing.T) {
zone := configv1.DNSZone{
ID: "zoneID",
}
Expand Down Expand Up @@ -150,7 +150,7 @@ func TestDelete(t *testing.T) {
}
}

func TestCreateOrUpdate(t *testing.T) {
func Test_createOrUpdateDNSRecord(t *testing.T) {
zone := configv1.DNSZone{
ID: "zoneID",
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/controller/canary/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
)

func TestCycleServicePort(t *testing.T) {
func Test_cycleServicePort(t *testing.T) {
tPort1 := intstr.IntOrString{
StrVal: "80",
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/controller/canary/daemonset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func TestDesiredCanaryDaemonSet(t *testing.T) {
func Test_desiredCanaryDaemonSet(t *testing.T) {
// canaryImageName is the ingress-operator image
canaryImageName := "openshift/origin-cluster-ingress-operator:latest"
daemonset := desiredCanaryDaemonSet(canaryImageName)
Expand Down Expand Up @@ -86,7 +86,7 @@ func TestDesiredCanaryDaemonSet(t *testing.T) {
}
}

func TestCanaryDaemonsetChanged(t *testing.T) {
func Test_canaryDaemonsetChanged(t *testing.T) {
testCases := []struct {
description string
mutate func(*appsv1.DaemonSet)
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/controller/canary/namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
projectv1 "github.com/openshift/api/project/v1"
)

func TestCanaryNamespaceChanged(t *testing.T) {
func Test_canaryNamespaceChanged(t *testing.T) {
testCases := []struct {
description string
mutate func(*corev1.Namespace)
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/controller/canary/route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
)

func TestDesiredCanaryRoute(t *testing.T) {
func Test_desiredCanaryRoute(t *testing.T) {
daemonsetRef := metav1.OwnerReference{
Name: "test",
}
Expand Down Expand Up @@ -85,7 +85,7 @@ func TestDesiredCanaryRoute(t *testing.T) {
}
}

func TestCanaryRouteChanged(t *testing.T) {
func Test_canaryRouteChanged(t *testing.T) {
testCases := []struct {
description string
mutate func(*routev1.Route)
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/controller/canary/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"k8s.io/apimachinery/pkg/types"
)

func TestDesiredCanaryService(t *testing.T) {
func Test_desiredCanaryService(t *testing.T) {
daemonsetRef := metav1.OwnerReference{
Name: "test",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ func newIngressController(name, defaultCertificateSecretName, domain string, adm
return ingresscontroller
}

// TestDesiredRouterCertsGlobalSecret verifies that we get the expected global
// Test_desiredRouterCertsGlobalSecret verifies that we get the expected global
// secret for the default ingresscontroller and for various combinations of
// ingresscontrollers and default certificate secrets.
func TestDesiredRouterCertsGlobalSecret(t *testing.T) {
func Test_desiredRouterCertsGlobalSecret(t *testing.T) {
type testInputs struct {
ingresses []operatorv1.IngressController
secrets []corev1.Secret
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/controller/certificate/default_cert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ u3YLAbyW/lHhOCiZu2iAI8AbmXem9lW6Tr7p/97s0w==
`
)

func TestDesiredRouterDefaultCertificateSecret(t *testing.T) {
func Test_desiredRouterDefaultCertificateSecret(t *testing.T) {
ca, err := crypto.GetCAFromBytes([]byte(cert), []byte(key))
if err != nil {
t.Fatalf("failed to create CA")
Expand Down
10 changes: 5 additions & 5 deletions pkg/operator/controller/dns/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/fake"
)

func TestPublishRecordToZones(t *testing.T) {
func Test_publishRecordToZones(t *testing.T) {
tests := []struct {
name string
zones []configv1.DNSZone
Expand Down Expand Up @@ -225,7 +225,7 @@ func TestPublishRecordToZonesMergesStatus(t *testing.T) {
}
}

func TestMigrateDNSRecordStatus(t *testing.T) {
func Test_migrateRecordStatusConditions(t *testing.T) {
tests := []struct {
name string
conditions []iov1.DNSZoneCondition
Expand Down Expand Up @@ -366,7 +366,7 @@ func TestMigrateDNSRecordStatus(t *testing.T) {
}
}

func TestDnsZoneStatusSlicesEqual(t *testing.T) {
func Test_dnsZoneStatusSlicesEqual(t *testing.T) {
testCases := []struct {
description string
expected bool
Expand Down Expand Up @@ -622,7 +622,7 @@ func TestDnsZoneStatusSlicesEqual(t *testing.T) {
}
}

func TestRecordIsAlreadyPublishedToZone(t *testing.T) {
func Test_recordIsAlreadyPublishedToZone(t *testing.T) {
var (
zoneWithId = configv1.DNSZone{ID: "foo"}
zoneWithTag = configv1.DNSZone{Tags: map[string]string{"foo": "bar"}}
Expand Down Expand Up @@ -777,7 +777,7 @@ func TestRecordIsAlreadyPublishedToZone(t *testing.T) {
}
}

func TestCustomCABundle(t *testing.T) {
func Test_customCABundle(t *testing.T) {
cases := []struct {
name string
cm *corev1.ConfigMap
Expand Down
16 changes: 8 additions & 8 deletions pkg/operator/controller/ingress/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// TestSetDefaultDomain verifies that setDefaultDomain behaves correctly.
func TestSetDefaultDomain(t *testing.T) {
// Test_setDefaultDomain verifies that setDefaultDomain behaves correctly.
func Test_setDefaultDomain(t *testing.T) {
ingressConfig := &configv1.Ingress{
Spec: configv1.IngressSpec{
Domain: "apps.mycluster.com",
Expand Down Expand Up @@ -855,7 +855,7 @@ func TestSetDefaultPublishingStrategyHandlesUpdates(t *testing.T) {
}
}

func TestTLSProfileSpecForSecurityProfile(t *testing.T) {
func Test_tlsProfileSpecForSecurityProfile(t *testing.T) {
invalidTLSVersion := configv1.TLSProtocolVersion("abc")
invalidCiphers := []string{"ECDHE-ECDSA-AES256-GCM-SHA384", "invalid cipher"}
validCiphers := []string{"ECDHE-ECDSA-AES256-GCM-SHA384"}
Expand Down Expand Up @@ -1017,7 +1017,7 @@ func TestTLSProfileSpecForSecurityProfile(t *testing.T) {
}
}

func TestTLSProfileSpecForIngressController(t *testing.T) {
func Test_tlsProfileSpecForIngressController(t *testing.T) {
testCases := []struct {
description string
icProfile *configv1.TLSSecurityProfile
Expand Down Expand Up @@ -1161,7 +1161,7 @@ func TestTLSProfileSpecForIngressController(t *testing.T) {
}
}

func TestValidateHTTPHeaderBufferValues(t *testing.T) {
func Test_validateHTTPHeaderBufferValues(t *testing.T) {
testCases := []struct {
description string
tuningOptions operatorv1.IngressControllerTuningOptions
Expand Down Expand Up @@ -1220,7 +1220,7 @@ func TestValidateHTTPHeaderBufferValues(t *testing.T) {

// TestValidateClientTLS verifies the validateClientTLS accepts PCRE-compliant
// patterns and rejects invalid patterns.
func TestValidateClientTLS(t *testing.T) {
func Test_validateClientTLS(t *testing.T) {
testCases := []struct {
description string
pattern string
Expand Down Expand Up @@ -1265,10 +1265,10 @@ func TestValidateClientTLS(t *testing.T) {
}
}

// TestIsProxyProtocolNeeded verifies that IsProxyProtocolNeeded returns the
// Test_IsProxyProtocolNeeded verifies that IsProxyProtocolNeeded returns the
// expected values for various platforms and endpoint publishing strategy
// parameters.
func TestIsProxyProtocolNeeded(t *testing.T) {
func Test_IsProxyProtocolNeeded(t *testing.T) {
var (
awsPlatform = configv1.PlatformStatus{
Type: configv1.AWSPlatformType,
Expand Down
12 changes: 6 additions & 6 deletions pkg/operator/controller/ingress/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func getRouterDeploymentComponents(t *testing.T) (*operatorv1.IngressController,
return ic, ingressConfig, infraConfig, apiConfig, networkConfig, proxyNeeded, clusterProxyConfig
}

func TestDesiredRouterDeployment(t *testing.T) {
func Test_desiredRouterDeployment(t *testing.T) {
ic, ingressConfig, infraConfig, apiConfig, networkConfig, proxyNeeded, clusterProxyConfig := getRouterDeploymentComponents(t)

deployment, err := desiredRouterDeployment(ic, ingressControllerImage, ingressConfig, infraConfig, apiConfig, networkConfig, proxyNeeded, false, nil, clusterProxyConfig)
Expand Down Expand Up @@ -897,7 +897,7 @@ func checkContainerPort(t *testing.T, d *appsv1.Deployment, portName string, por
t.Errorf("deployment %s container does not have port with name %s and number %d", d.Name, portName, port)
}

func TestInferTLSProfileSpecFromDeployment(t *testing.T) {
func Test_inferTLSProfileSpecFromDeployment(t *testing.T) {
testCases := []struct {
description string
containers []corev1.Container
Expand Down Expand Up @@ -1107,7 +1107,7 @@ func TestDeploymentHash(t *testing.T) {
}
}

func TestDeploymentConfigChanged(t *testing.T) {
func Test_deploymentConfigChanged(t *testing.T) {
pointerTo := func(ios intstr.IntOrString) *intstr.IntOrString { return &ios }
testCases := []struct {
description string
Expand Down Expand Up @@ -1749,7 +1749,7 @@ func TestDeploymentConfigChanged(t *testing.T) {
}
}

func TestDurationToHAProxyTimespec(t *testing.T) {
func Test_durationToHAProxyTimespec(t *testing.T) {
testCases := []struct {
inputDuration time.Duration
expectedOutput string
Expand Down Expand Up @@ -1795,7 +1795,7 @@ func TestDurationToHAProxyTimespec(t *testing.T) {
}
}

func TestCapReloadIntervalValue(t *testing.T) {
func Test_capReloadIntervalValue(t *testing.T) {
testCases := []struct {
inputDuration time.Duration
expectedOutput time.Duration
Expand Down Expand Up @@ -1828,7 +1828,7 @@ func TestCapReloadIntervalValue(t *testing.T) {
}
}

func TestGetMIMETypes(t *testing.T) {
func Test_GetMIMETypes(t *testing.T) {
testCases := []struct {
mimeArrayInput []operatorv1.CompressionMIMEType
expectedOutput string
Expand Down
Loading