forked from gitpod-io/gitpod
-
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.
[ws-manager-mk2] support storage quotas (gitpod-io#17606)
* [ws-manager-mk2] add support for storage quotas This way, on workspace create, `ws-daemon` can set XFS limits for `/workspace` * [preview] set smaller /workspace limits This way we don't have to spend more on preview environments. * [ws-daemon] warn when xfs is missing * Partial revert of "Revert "[ws-daemon] Restart IWS if ws-daemon is restarted (gitpod-io#17552)" (gitpod-io#17645)" This reverts commit e082b7f. It avoids reverts on notify.go and workspace_provider.go. * [ws-daemon] log when handling running workspaces * [test] add test for xfs quotas
- Loading branch information
Showing
10 changed files
with
260 additions
and
38 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
56 changes: 35 additions & 21 deletions
56
components/ws-daemon/pkg/controller/mocks.go → components/ws-daemon/pkg/controller/mock.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,43 @@ | ||
// Copyright (c) 2023 Gitpod GmbH. All rights reserved. | ||
// Licensed under the GNU Affero General Public License (AGPL). | ||
// See License.AGPL.txt in the project root for license information. | ||
|
||
package integration | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
|
||
agent "github.com/gitpod-io/gitpod/test/pkg/agent/workspace/api" | ||
) | ||
|
||
type DiskClient struct { | ||
rpcClient *RpcClient | ||
} | ||
|
||
func Disk(rsa *RpcClient) DiskClient { | ||
return DiskClient{rsa} | ||
} | ||
|
||
var NoSpaceErrorMsg = "No space left on device" | ||
|
||
func (d DiskClient) Fallocate(testFilePath string, spaceToAllocate string) error { | ||
var resp agent.ExecResponse | ||
err := d.rpcClient.Call("WorkspaceAgent.Exec", &agent.ExecRequest{ | ||
Dir: "/workspace", | ||
Command: "fallocate", | ||
Args: []string{"-l", spaceToAllocate, testFilePath}, | ||
}, &resp) | ||
|
||
if err != nil { | ||
return fmt.Errorf("error: %w", err) | ||
} | ||
if resp.ExitCode != 0 { | ||
return fmt.Errorf("returned returned rc: %d err: %v", resp.ExitCode, resp.Stderr) | ||
} | ||
if strings.Contains(resp.Stdout, NoSpaceErrorMsg) { | ||
return fmt.Errorf(resp.Stdout) | ||
} | ||
|
||
return nil | ||
} |
Oops, something went wrong.