@@ -521,154 +521,6 @@ func TestUpgradeFromReplicatedApp(t *testing.T) {
521521 t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
522522}
523523
524- func TestUpgradeEC18FromReplicatedApp (t * testing.T ) {
525- t .Parallel ()
526-
527- RequireEnvVars (t , []string {"SHORT_SHA" })
528-
529- withEnv := map [string ]string {"KUBECONFIG" : "/var/lib/k0s/pki/admin.conf" }
530-
531- tc := docker .NewCluster (& docker.ClusterInput {
532- T : t ,
533- Nodes : 4 ,
534- Distro : "debian-bookworm" ,
535- K0sDir : "/var/lib/k0s" ,
536- })
537- defer tc .Cleanup (withEnv )
538-
539- appVer := fmt .Sprintf ("appver-%s-1.8.0-k8s-1.28" , os .Getenv ("SHORT_SHA" ))
540-
541- downloadECReleaseWithOptions (t , tc , 0 , downloadECReleaseOptions {
542- version : appVer ,
543- })
544-
545- downloadECReleaseWithOptions (t , tc , 1 , downloadECReleaseOptions {
546- version : appVer ,
547- })
548-
549- installSingleNodeWithOptions (t , tc , installOptions {
550- version : appVer ,
551- withEnv : withEnv ,
552- })
553-
554- if err := tc .SetupPlaywright (withEnv ); err != nil {
555- t .Fatalf ("fail to setup playwright: %v" , err )
556- }
557- if stdout , stderr , err := tc .RunPlaywrightTest ("deploy-ec18-app" ); err != nil {
558- t .Fatalf ("fail to run playwright test deploy-ec18-app: %v: %s: %s" , err , stdout , stderr )
559- }
560-
561- t .Logf ("%s: generating a new worker token command" , time .Now ().Format (time .RFC3339 ))
562- stdout , stderr , err := tc .RunPlaywrightTest ("get-ec18-join-worker-command" )
563- if err != nil {
564- t .Fatalf ("fail to generate worker join token:\n stdout: %s\n stderr: %s" , stdout , stderr )
565- }
566- command , err := findJoinCommandInOutput (stdout )
567- if err != nil {
568- t .Fatalf ("fail to find the join command in the output: %v: %s: %s" , err , stdout , stderr )
569- }
570- t .Log ("worker join token command:" , command )
571-
572- t .Logf ("%s: joining worker node to the cluster as a worker" , time .Now ().Format (time .RFC3339 ))
573- if stdout , stderr , err := tc .RunCommandOnNode (1 , strings .Split (command , " " )); err != nil {
574- t .Fatalf ("fail to join worker node to the cluster as a worker: %v: %s: %s" , err , stdout , stderr )
575- }
576-
577- // wait for the nodes to report as ready.
578- t .Logf ("%s: all nodes joined, waiting for them to be ready" , time .Now ().Format (time .RFC3339 ))
579- stdout , stderr , err = tc .RunCommandOnNode (0 , []string {"wait-for-ready-nodes.sh" , "2" }, withEnv )
580- if err != nil {
581- t .Fatalf ("fail to wait for ready nodes: %v: %s: %s" , err , stdout , stderr )
582- }
583-
584- checkInstallationStateWithOptions (t , tc , installationStateOptions {
585- version : appVer ,
586- k8sVersion : "v1.28.11" ,
587- withEnv : withEnv ,
588- })
589-
590- appUpgradeVersion := fmt .Sprintf ("appver-%s-noop" , os .Getenv ("SHORT_SHA" ))
591- testArgs := []string {appUpgradeVersion }
592-
593- t .Logf ("%s: upgrading cluster" , time .Now ().Format (time .RFC3339 ))
594- if stdout , stderr , err := tc .RunPlaywrightTest ("deploy-upgrade" , testArgs ... ); err != nil {
595- t .Fatalf ("fail to run playwright test deploy-app: %v: %s: %s" , err , stdout , stderr )
596- }
597-
598- t .Logf ("%s: re-installing kots cli on node 0" , time .Now ().Format (time .RFC3339 ))
599- line := []string {"install-kots-cli.sh" }
600- if stdout , stderr , err := tc .RunCommandOnNode (0 , line ); err != nil {
601- t .Fatalf ("fail to install kots cli on node 0: %v: %s: %s" , err , stdout , stderr )
602- }
603-
604- checkInstallationStateWithOptions (t , tc , installationStateOptions {
605- version : appUpgradeVersion ,
606- withEnv : withEnv ,
607- })
608-
609- // Download embedded-cluster on additional nodes
610- downloadECReleaseWithOptions (t , tc , 2 , downloadECReleaseOptions {
611- version : appUpgradeVersion ,
612- })
613- downloadECReleaseWithOptions (t , tc , 3 , downloadECReleaseOptions {
614- version : appUpgradeVersion ,
615- })
616-
617- // Join the additional nodes to the cluster
618- joinControllerNode (t , tc , 2 )
619- joinWorkerNode (t , tc , 3 )
620-
621- // wait for all nodes to report as ready
622- waitForNodes (t , tc , 4 , withEnv )
623-
624- // Check worker profiles for the joined nodes
625- checkWorkerProfile (t , tc , 2 )
626- checkWorkerProfile (t , tc , 3 )
627-
628- appUpgradeVersion = fmt .Sprintf ("appver-%s-upgrade" , os .Getenv ("SHORT_SHA" ))
629- testArgs = []string {appUpgradeVersion }
630-
631- t .Logf ("%s: upgrading cluster a second time" , time .Now ().Format (time .RFC3339 ))
632- if stdout , stderr , err := tc .RunPlaywrightTest ("deploy-upgrade" , testArgs ... ); err != nil {
633- t .Fatalf ("fail to run playwright test deploy-app: %v: %s: %s" , err , stdout , stderr )
634- }
635-
636- checkPostUpgradeStateWithOptions (t , tc , postUpgradeStateOptions {
637- withEnv : withEnv ,
638- })
639-
640- // wait for all nodes to report as ready after upgrade
641- waitForNodes (t , tc , 4 , withEnv )
642-
643- // use upgraded binaries to run the reset command
644- // TODO: this is a temporary workaround and should eventually be a feature of EC
645-
646- downloadECReleaseWithOptions (t , tc , 0 , downloadECReleaseOptions {
647- version : appUpgradeVersion ,
648- })
649- downloadECReleaseWithOptions (t , tc , 1 , downloadECReleaseOptions {
650- version : appUpgradeVersion ,
651- })
652-
653- resetInstallationWithOptions (t , tc , 1 , resetInstallationOptions {
654- withEnv : withEnv ,
655- })
656-
657- resetInstallationWithOptions (t , tc , 3 , resetInstallationOptions {
658- withEnv : withEnv ,
659- })
660-
661- resetInstallationWithOptions (t , tc , 2 , resetInstallationOptions {
662- withEnv : withEnv ,
663- })
664-
665- resetInstallationWithOptions (t , tc , 0 , resetInstallationOptions {
666- withEnv : withEnv ,
667- })
668-
669- t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
670- }
671-
672524func TestResetAndReinstall (t * testing.T ) {
673525 t .Parallel ()
674526
@@ -774,50 +626,6 @@ func TestResetAndReinstallAirgap(t *testing.T) {
774626 t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
775627}
776628
777- func TestOldVersionUpgrade (t * testing.T ) {
778- t .Parallel ()
779-
780- RequireEnvVars (t , []string {"SHORT_SHA" })
781-
782- withEnv := map [string ]string {"KUBECONFIG" : "/var/lib/k0s/pki/admin.conf" }
783-
784- tc := docker .NewCluster (& docker.ClusterInput {
785- T : t ,
786- Nodes : 1 ,
787- Distro : "debian-bookworm" ,
788- K0sDir : "/var/lib/k0s" ,
789- })
790- defer tc .Cleanup (withEnv )
791-
792- downloadECReleaseWithOptions (t , tc , 0 , downloadECReleaseOptions {
793- version : fmt .Sprintf ("appver-%s-pre-minio-removal" , os .Getenv ("SHORT_SHA" )),
794- })
795-
796- t .Logf ("%s: installing embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
797- line := []string {"pre-minio-removal-install.sh" , "cli" }
798- if stdout , stderr , err := tc .RunCommandOnNode (0 , line , withEnv ); err != nil {
799- t .Fatalf ("fail to install embedded-cluster on node 0: %v: %s: %s" , err , stdout , stderr )
800- }
801-
802- t .Logf ("%s: checking installation state" , time .Now ().Format (time .RFC3339 ))
803- line = []string {"check-pre-minio-removal-installation-state.sh" , fmt .Sprintf ("%s-pre-minio-removal" , os .Getenv ("SHORT_SHA" ))}
804- if stdout , stderr , err := tc .RunCommandOnNode (0 , line , withEnv ); err != nil {
805- t .Fatalf ("fail to check installation state: %v: %s: %s" , err , stdout , stderr )
806- }
807-
808- t .Logf ("%s: running kots upstream upgrade" , time .Now ().Format (time .RFC3339 ))
809- line = []string {"kots-upstream-upgrade.sh" , os .Getenv ("SHORT_SHA" )}
810- if stdout , stderr , err := tc .RunCommandOnNode (0 , line , withEnv ); err != nil {
811- t .Fatalf ("fail to run kots upstream upgrade: %v: %s: %s" , err , stdout , stderr )
812- }
813-
814- checkPostUpgradeStateWithOptions (t , tc , postUpgradeStateOptions {
815- withEnv : withEnv ,
816- })
817-
818- t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
819- }
820-
821629func TestSingleNodeAirgapUpgrade (t * testing.T ) {
822630 t .Parallel ()
823631
0 commit comments