-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore!: remove Executor from knuu #508
Merged
mojtaba-esk
merged 10 commits into
mojtaba/457-removing-loadEnvVars
from
mojtaba/467-deprecate-Executor
Jul 24, 2024
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7d90326
chore: rename TestScope field
mojtaba-esk aff7ad5
chore: bump k8s version to fix the DOS Vulnerability
mojtaba-esk 5762664
chore: bumped go version to fix it
mojtaba-esk 71f402f
chore: deprecate Executor
mojtaba-esk 0b81b81
fix: rename the deprecated NewExecutor
mojtaba-esk 188941f
Merge branch 'mojtaba/457-removing-loadEnvVars' into mojtaba/505-bump…
mojtaba-esk b5469c0
Merge branch 'mojtaba/505-bump-k8s-version-to-fix-the-DOS-Vulnerabili…
mojtaba-esk 8af9e86
Merge branch 'mojtaba/457-removing-loadEnvVars' into mojtaba/467-depr…
mojtaba-esk 1e6eef3
chore: refactor e2e system tests to new knuu obj (#520)
mojtaba-esk 494314e
Merge branch 'mojtaba/457-removing-loadEnvVars' into mojtaba/467-depr…
mojtaba-esk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,53 @@ | ||
package e2e | ||
|
||
import ( | ||
"context" | ||
|
||
"k8s.io/apimachinery/pkg/api/resource" | ||
|
||
"github.com/celestiaorg/knuu/pkg/knuu" | ||
) | ||
|
||
const ( | ||
executorDefaultImage = "docker.io/nicolaka/netshoot:latest" | ||
sleepCommand = "sleep" | ||
infinityArg = "infinity" | ||
) | ||
|
||
var ( | ||
executorMemoryLimit = resource.MustParse("100Mi") | ||
executorCpuLimit = resource.MustParse("100m") | ||
) | ||
|
||
func NewExecutor(ctx context.Context, executorName string) (*knuu.Instance, error) { | ||
i, err := knuu.NewInstance(executorName) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if err := i.SetImage(executorDefaultImage); err != nil { | ||
return nil, err | ||
} | ||
|
||
if err := i.Commit(); err != nil { | ||
return nil, err | ||
} | ||
|
||
if err := i.SetArgs(sleepCommand, infinityArg); err != nil { | ||
return nil, err | ||
} | ||
|
||
if err := i.SetMemory(executorMemoryLimit.String(), executorMemoryLimit.String()); err != nil { | ||
return nil, err | ||
} | ||
|
||
if err := i.SetCPU(executorCpuLimit.String()); err != nil { | ||
return nil, err | ||
} | ||
|
||
if err := i.Start(); err != nil { | ||
return nil, err | ||
} | ||
|
||
return i, nil | ||
} |
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we only creating this for compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so, then since we want to do a breaking change, we should just leave this out as we don't want to keep it around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this is not created for compatibility. It is moved to the e2e pkg to be served as a utility function to avoid redundant codes in our tests.