-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: support additional volume and mounts #229
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* (c) Copyright IBM Corp. 2024 | ||
* (c) Copyright Instana Inc. 2024 | ||
*/ | ||
|
||
package e2e | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"sigs.k8s.io/e2e-framework/klient/decoder" | ||
"sigs.k8s.io/e2e-framework/klient/k8s/resources" | ||
"sigs.k8s.io/e2e-framework/pkg/envconf" | ||
"sigs.k8s.io/e2e-framework/pkg/features" | ||
) | ||
|
||
func TestExtraVolumeWithSecret(t *testing.T) { | ||
installCrWithExtraVolumeFeature := features.New("extra volume with secret"). | ||
Setup(SetupOperatorDevBuild()). | ||
Setup(WaitForDeploymentToBecomeReady(InstanaOperatorDeploymentName)). | ||
Setup(func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context { | ||
r, err := resources.New(cfg.Client().RESTConfig()) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
t.Logf("Creating dummy secret") | ||
|
||
err = decoder.ApplyWithManifestDir(ctx, r, "../config/samples", "external_secret_instana_agent_key.yaml", []resources.CreateOption{}) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
t.Logf("Secret created") | ||
|
||
t.Logf("Creating dummy agent CR with extra volume") | ||
err = decoder.ApplyWithManifestDir(ctx, r, "../config/samples", "instana_v1_extended_instanaagent.yaml", []resources.CreateOption{}) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
t.Logf("CR created") | ||
|
||
return ctx | ||
}). | ||
Assess("wait for first k8sensor deployment to become ready", WaitForDeploymentToBecomeReady(K8sensorDeploymentName)). | ||
Assess("wait for agent daemonset to become ready", WaitForAgentDaemonSetToBecomeReady()). | ||
Assess("validate secret files are created from extra mounted volume", ValidateSecretsMountedFromExtraVolume()). | ||
Feature() | ||
|
||
// test feature | ||
testEnv.Test(t, installCrWithExtraVolumeFeature) | ||
} |
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
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.
When having a final look, I noticed that this is actually the extended_instanaagent.yaml which shows all available options, but typically just defines the defaults.
Your changes are adding new volumes which would not reflect the default behavior, so probably it would be more consistent to have your values in that file as comment and use a separate file for the test input.
But I also realized that your e2e test is relying on the given yaml to mount the secret, so I am fine for leaving it in as is for now, I might move the test input into a new file eventually, but that should not block the release for now.