Skip to content

Commit efa75dd

Browse files
committed
Revert upgrade test changes
1 parent 898fcc7 commit efa75dd

File tree

2 files changed

+25
-37
lines changed

2 files changed

+25
-37
lines changed

tests/framework/resourcemanager.go

+23-22
Original file line numberDiff line numberDiff line change
@@ -701,25 +701,25 @@ func GetReadyNGFPodNames(
701701
"app.kubernetes.io/instance": releaseName,
702702
},
703703
); err != nil {
704-
return nil, fmt.Errorf("error getting list of Pods: %w", err)
704+
return nil, fmt.Errorf("error getting list of NGF Pods: %w", err)
705705
}
706706

707-
if len(podList.Items) > 0 {
708-
var names []string
709-
for _, pod := range podList.Items {
710-
for _, cond := range pod.Status.Conditions {
711-
if cond.Type == core.PodReady && cond.Status == core.ConditionTrue {
712-
names = append(names, pod.Name)
713-
}
707+
if len(podList.Items) == 0 {
708+
return nil, errors.New("unable to find NGF Pod(s)")
709+
}
710+
711+
var names []string
712+
for _, pod := range podList.Items {
713+
for _, cond := range pod.Status.Conditions {
714+
if cond.Type == core.PodReady && cond.Status == core.ConditionTrue {
715+
names = append(names, pod.Name)
714716
}
715717
}
716-
return names, nil
717718
}
718-
719-
return nil, errors.New("unable to find NGF Pod(s)")
719+
return names, nil
720720
}
721721

722-
// GetReadyNginxPodNames returns the name(s) of the Nginx Pod(s).
722+
// GetReadyNginxPodNames returns the name(s) of the NGINX Pod(s).
723723
func GetReadyNginxPodNames(
724724
k8sClient client.Client,
725725
namespace string,
@@ -735,22 +735,23 @@ func GetReadyNginxPodNames(
735735
client.InNamespace(namespace),
736736
client.HasLabels{"gateway.networking.k8s.io/gateway-name"},
737737
); err != nil {
738-
return nil, fmt.Errorf("error getting list of Nginx Pods: %w", err)
738+
return nil, fmt.Errorf("error getting list of NGINX Pods: %w", err)
739739
}
740740

741-
if len(podList.Items) > 0 {
742-
var names []string
743-
for _, pod := range podList.Items {
744-
for _, cond := range pod.Status.Conditions {
745-
if cond.Type == core.PodReady && cond.Status == core.ConditionTrue {
746-
names = append(names, pod.Name)
747-
}
741+
if len(podList.Items) == 0 {
742+
return nil, errors.New("unable to find NGINX Pod(s)")
743+
}
744+
745+
var names []string
746+
for _, pod := range podList.Items {
747+
for _, cond := range pod.Status.Conditions {
748+
if cond.Type == core.PodReady && cond.Status == core.ConditionTrue {
749+
names = append(names, pod.Name)
748750
}
749751
}
750-
return names, nil
751752
}
752753

753-
return nil, errors.New("unable to find NGF Pod(s)")
754+
return names, nil
754755
}
755756

756757
func countNumberOfReadyParents(parents []v1.RouteParentStatus) int {

tests/suite/upgrade_test.go

+2-15
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,14 @@ var _ = Describe("Upgrade testing", Label("nfr", "upgrade"), func() {
4848
teardown(releaseName)
4949

5050
cfg := setupConfig{
51-
releaseName: releaseName,
52-
// chartPath: "oci://ghcr.io/nginx/charts/nginx-gateway-fabric",
51+
releaseName: releaseName,
52+
chartPath: "oci://ghcr.io/nginx/charts/nginx-gateway-fabric",
5353
gwAPIVersion: *gatewayAPIPrevVersion,
5454
deploy: true,
5555
nfr: true,
5656
debugLogLevel: true,
5757
}
5858

59-
// cfg := getDefaultSetupCfg()
60-
// cfg.gwAPIVersion = *gatewayAPIPrevVersion
61-
// cfg.nfr = true
62-
6359
setup(cfg, "--values", valuesFile)
6460

6561
ns = core.Namespace{
@@ -73,13 +69,6 @@ var _ = Describe("Upgrade testing", Label("nfr", "upgrade"), func() {
7369
Expect(resourceManager.WaitForAppsToBeReady(ns.Name)).To(Succeed())
7470

7571
var err error
76-
77-
nginxPodNames, err := framework.GetReadyNginxPodNames(k8sClient, ns.Name, timeoutConfig.GetTimeout)
78-
Expect(err).ToNot(HaveOccurred())
79-
Expect(nginxPodNames).To(HaveLen(1))
80-
81-
setUpPortForward(nginxPodNames[0], ns.Name)
82-
8372
resultsDir, err = framework.CreateResultsDir("ngf-upgrade", version)
8473
Expect(err).ToNot(HaveOccurred())
8574

@@ -90,8 +79,6 @@ var _ = Describe("Upgrade testing", Label("nfr", "upgrade"), func() {
9079
})
9180

9281
AfterEach(func() {
93-
cleanUpPortForward()
94-
9582
Expect(resourceManager.DeleteFromFiles(files, ns.Name)).To(Succeed())
9683
Expect(resourceManager.DeleteNamespace(ns.Name)).To(Succeed())
9784
resultsFile.Close()

0 commit comments

Comments
 (0)