Skip to content
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

Added capability to provide metadata prefetch memory request and limits in pod spec #472

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chrisThePattyEater
Copy link
Collaborator

Added capability to provide metadata prefetch memory request and limits in pod spec to fuse csi annotations Additionally added unit tests verifying changes.

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test

/kind feature

/kind flake

What this PR does / why we need it:
This pr adds functionality to allow fuse driver users to provide custom metadata prefetch sidecar memory and limits. The changes add additional annotations and variables to extract prefetch limits and requests if provided and uses those values for the prefetch sidecar config if provided. Otherwise it uses default values

Which issue(s) this PR fixes:

Fixes https://b.corp.google.com/issues/385198703

Does this PR introduce a user-facing change?:


@chrisThePattyEater chrisThePattyEater force-pushed the fuechr/metadata-prefetch-memory-override branch 2 times, most recently from ddbec01 to ae919db Compare February 12, 2025 17:59
pkg/webhook/sidecar_spec.go Outdated Show resolved Hide resolved
@chrisThePattyEater chrisThePattyEater force-pushed the fuechr/metadata-prefetch-memory-override branch 2 times, most recently from b47e337 to 2689b35 Compare February 12, 2025 21:49
cmd/webhook/main.go Outdated Show resolved Hide resolved
}
}

func FakeConfig() *Config {
fakeImage1 := "fake-repo/fake-sidecar-image:v999.999.999-gke.0@sha256:c9cd4cde857ab8052f416609184e2900c0004838231ebf1c3817baa37f21d847"
fakeImage2 := "fake-repo/fake-sidecar-image:v888.888.888-gke.0@sha256:c9cd4cde857ab8052f416609184e2900c0004838231ebf1c3817baa37f21d847"

return LoadConfig(fakeImage1, fakeImage2, "Always", "250m", "250m", "256Mi", "256Mi", "5Gi", "5Gi")
return LoadConfig(fakeImage1, fakeImage2, "Always", "250m", "250m", "256Mi", "256Mi", "5Gi", "5Gi", "-1", "-1")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to use relevant values when testing your changes. If the resource is memory, then use memory units.

@@ -226,6 +226,87 @@ func TestPrepareConfig(t *testing.T) {
},
expectErr: false,
},
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a test that doesn't provide limits and verify we use defaults?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that every other test that doesn't provide limits

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. In that case the current tests should be failing because the wantConfig should contain the default values.

@chrisThePattyEater chrisThePattyEater force-pushed the fuechr/metadata-prefetch-memory-override branch 2 times, most recently from cc48065 to f0dbe0b Compare February 18, 2025 23:27
pkg/webhook/injection.go Outdated Show resolved Hide resolved
@chrisThePattyEater chrisThePattyEater force-pushed the fuechr/metadata-prefetch-memory-override branch 2 times, most recently from 0bb0029 to 5922247 Compare February 19, 2025 00:09
…ts to fuse csi annotations> Additionally added unit tests verifying changes.
@chrisThePattyEater chrisThePattyEater force-pushed the fuechr/metadata-prefetch-memory-override branch from 5922247 to 0c243a8 Compare February 19, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants