forked from rancher/rancher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes the local upgrade failure (rancher#48292)
* Fixes the local upgrade failure * Updating changes for rke1 upgrade * go mod changes to reflect rke1 state file * Resolvong go.mod conflicts
- Loading branch information
1 parent
0b3445f
commit ac9893e
Showing
4 changed files
with
108 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
//go:build validation | ||
|
||
package upgrade | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/rancher/rancher/tests/v2/actions/upgradeinput" | ||
"github.com/rancher/shepherd/clients/rancher" | ||
"github.com/rancher/shepherd/pkg/session" | ||
"github.com/stretchr/testify/require" | ||
"github.com/stretchr/testify/suite" | ||
) | ||
|
||
var verifyIngress = true | ||
|
||
type UpgradeWorkloadTestSuite struct { | ||
suite.Suite | ||
session *session.Session | ||
client *rancher.Client | ||
clusters []upgradeinput.Cluster | ||
} | ||
|
||
func (u *UpgradeWorkloadTestSuite) TearDownSuite() { | ||
u.session.Cleanup() | ||
} | ||
|
||
func (u *UpgradeWorkloadTestSuite) SetupSuite() { | ||
testSession := session.NewSession() | ||
u.session = testSession | ||
|
||
client, err := rancher.NewClient("", testSession) | ||
require.NoError(u.T(), err) | ||
|
||
u.client = client | ||
|
||
clusters, err := upgradeinput.LoadUpgradeKubernetesConfig(client) | ||
require.NoError(u.T(), err) | ||
|
||
u.clusters = clusters | ||
} | ||
|
||
func (u *UpgradeWorkloadTestSuite) TestWorkloadPreUpgrade() { | ||
for _, cluster := range u.clusters { | ||
cluster := cluster | ||
u.Run(cluster.Name, func() { | ||
cluster.FeaturesToTest.Ingress = &verifyIngress | ||
createPreUpgradeWorkloads(u.T(), u.client, cluster.Name, cluster.FeaturesToTest, nil, containerImage) | ||
}) | ||
} | ||
} | ||
|
||
func (u *UpgradeWorkloadTestSuite) TestWorkloadPostUpgrade() { | ||
for _, cluster := range u.clusters { | ||
cluster := cluster | ||
u.Run(cluster.Name, func() { | ||
cluster.FeaturesToTest.Ingress = &verifyIngress | ||
createPostUpgradeWorkloads(u.T(), u.client, cluster.Name, cluster.FeaturesToTest) | ||
}) | ||
} | ||
} | ||
|
||
func TestWorkloadUpgradeTestSuite(t *testing.T) { | ||
suite.Run(t, new(UpgradeWorkloadTestSuite)) | ||
} |