Skip to content

Commit

Permalink
chore: prevent distro switch from k0s
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Apr 8, 2024
1 parent 584da1d commit d2ca0d0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/setup/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,13 @@ func InitConfig(vConfig *config.VirtualClusterConfig) error {
}
}

// check if previously we were using k0s as distro
if vConfig.Distro() != vclusterconfig.K0SDistro {
_, err = os.Stat("/data/k0s")
if err == nil {
return fmt.Errorf("seems like you were using k0s as a distro before and now have switched to %s, please make sure to not switch between vCluster distros", vConfig.Distro())
}
}

return nil
}

0 comments on commit d2ca0d0

Please sign in to comment.