fix(api): 停服时 CR 已不存在返回 404 not_found,与唤醒一致
This commit is contained in:
3 files changed
+70
-1
No files matched your search
@@ -1853,6 +1853,9 @@ func (c *fakeCluster) WorldVolumeExists(_ context.Context, n string) (bool, erro
|
||||
}
|
||||
|
||||
func (c *fakeCluster) SetDesiredState(_ context.Context, n string, s v1alpha1.DesiredState) error {
|
||||
if _, ok := c.byName[n]; !ok {
|
||||
return ErrNotFound // the MinecraftServer is gone, as K8sCluster.getServer reports it
|
||||
}
|
||||
if err := c.wakeErr[n]; err != nil && s == v1alpha1.DesiredRunning {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user