PCP-6413: Use PV/SC mapper for volumeName and storageClassName in PVC syncer - #15
Open
ChellaVigneshKP wants to merge 1 commit into
Open
PCP-6413: Use PV/SC mapper for volumeName and storageClassName in PVC syncer#15ChellaVigneshKP wants to merge 1 commit into
ChellaVigneshKP wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
- GO-2025-3774
- Module: k8s.io/kubernetes
- Found in: v1.32.1
- Fixed in: v1.32.6
- Example Traces:
1. pkg/kubeadm/config.go:11:70: kubeadm.InitKubeadmConfig calls config.DefaultedStaticInitConfiguration, which eventually calls conversion.Convert
2. pkg/kubeadm/config.go:11:70: kubeadm.InitKubeadmConfig calls config.DefaultedStaticInitConfiguration, which eventually calls conversion.Convert
3. pkg/certs/ensure.go:472:24: certs.BuildKubeConfig calls pkiutil.EncodeCertPEM, which eventually calls certs.BuildKubeConfig
4. pkg/kubeadm/config.go:11:70: kubeadm.InitKubeadmConfig calls config.DefaultedStaticInitConfiguration, which eventually calls conversion.Convert
5. pkg/kubeadm/config.go:6:2: kubeadm.init calls config.init, which eventually calls scheme.init
- GO-2026-4394
- Module: go.opentelemetry.io/otel/sdk
- Found in: v1.33.0
- Fixed in: v1.40.0
- Example Traces:
1. pkg/server/server.go:52:2: server.init calls apiserver.init, which eventually calls trace.init
2. pkg/server/server.go:44:2: server.init calls options.init, which eventually calls resource.init
3. pkg/plugin/v1/remote/plugin_grpc.pb.go:235:20: remote.Mutate calls grpc.Invoke, which eventually calls otelgrpc.Event
4. pkg/server/filters/metrics.go:384:13: filters.ExecuteRequest calls proxy.ServeHTTP, which eventually calls otelhttp.RoundTrip
5. pkg/server/filters/metrics.go:384:13: filters.ExecuteRequest calls http.ServeHTTP, which eventually calls otelhttp.serveHTTP
- GO-2025-4240
- Module: k8s.io/kubernetes
- Found in: v1.32.1
- Fixed in: v1.32.10
- Example Traces:
1. pkg/kubeadm/config.go:11:70: kubeadm.InitKubeadmConfig calls config.DefaultedStaticInitConfiguration, which eventually calls conversion.Convert
2. pkg/kubeadm/config.go:11:70: kubeadm.InitKubeadmConfig calls config.DefaultedStaticInitConfiguration, which eventually calls conversion.Convert
3. pkg/cli/start/start.go:31:32: start.init calls runtime.AddToScheme, which eventually calls runtime.AddToScheme
4. pkg/kubeadm/config.go:11:70: kubeadm.InitKubeadmConfig calls config.DefaultedStaticInitConfiguration, which eventually calls conversion.Convert
5. pkg/kubeadm/config.go:6:2: kubeadm.init calls config.init, which eventually calls config.init
- GO-2025-3915
- Module: k8s.io/kubernetes
- Found in: v1.32.1
- Fixed in: v1.32.8
- Example Traces:
1. pkg/controllers/resources/pods/translate/translator.go:672:13: translate.TranslateContainerEnv calls sort.Slice, which eventually calls sort.pdqsort_func
2. pkg/certs/ensure.go:104:30: certs.EnsureCerts calls certs.CreatePKIAssets, which eventually calls certs.CreateTree
3. pkg/kubeadm/config.go:6:2: kubeadm.init calls config.init, which eventually calls componentconfigs.init
4. pkg/syncer/testing/testing.go:63:71: testing.Setup calls output.DeepCopyObject, which eventually calls testing.Setup
5. pkg/kubeadm/config.go:11:70: kubeadm.InitKubeadmConfig calls config.DefaultedStaticInitConfiguration, which eventually calls conversion.Convert
- GO-2025-3922
- Module: github.com/ulikunitz/xz
- Found in: v0.5.11
- Fixed in: v0.5.15
- Example Traces:
1. pkg/server/filters/metrics.go:395:34: filters.ExecuteRequest calls io.ReadAll, which eventually calls xz.readUvarint
2. pkg/server/filters/metrics.go:395:34: filters.ExecuteRequest calls io.ReadAll, which eventually calls xz.UnmarshalBinary
3. pkg/server/filters/metrics.go:395:34: filters.ExecuteRequest calls io.ReadAll, which eventually calls xz.newStreamReader
4. pkg/upgrade/upgrade.go:141:25: upgrade.Upgrade calls selfupdate.UpdateTo, which eventually calls selfupdate.UncompressCommand
5. pkg/upgrade/upgrade.go:16:2: upgrade.init calls selfupdate.init, which eventually calls lzma.init
- GO-2026-4762
- Module: google.golang.org/grpc
- Found in: v1.67.1
- Fixed in: v1.79.3
- Example Traces:
1. pkg/plugin/v1/plugin.go:232:2: v1.Start calls v1.Start$1, which eventually calls v1.Start$1
- GO-2026-4550
- Module: github.com/cloudflare/circl
- Found in: v1.6.1
- Fixed in: v1.6.3
- Example Traces:
1. pkg/platform/version.go:11:2: platform.init calls github.init, which eventually calls ed25519.init
2. pkg/platform/version.go:11:2: platform.init calls github.init, which eventually calls ed448.init
3. pkg/platform/version.go:11:2: platform.init calls github.init, which eventually calls ecc.init
4. pkg/platform/version.go:11:2: platform.init calls github.init, which eventually calls ecc.init
5. pkg/platform/version.go:11:2: platform.init calls github.init, which eventually calls goldilocks.init
Please review these findings and fix the issues before merging.
There was a problem hiding this comment.
- G115: integer overflow conversion rune -> byte, Severity: HIGH
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/util/patch/path.go:48:40
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/controllers/resources/nodes/nodeservice/node_service.go:151:38
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/apiservice/generic.go:115:28
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/apiservice/generic.go:97:17
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/cmd/vcluster/cmd/portforward.go:209:84
-
- G404: Use of weak random number generator (math/rand or math/rand/v2 instead of crypto/rand), Severity: HIGH
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/util/random/rand.go:13:22
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/util/clihelper/clihelper.go:174:17
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/util/clihelper/clihelper.go:166:19
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/platform/random/random.go:13:22
-
- G402: TLS InsecureSkipVerify set to true., Severity: HIGH
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/util/http/transport.go:17:65
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/cli/start/success.go:129:25
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/cli/start/login.go:76:52
-
- G109: Potential Integer overflow made by strconv.Atoi result conversion to int16/32, Severity: HIGH
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/lifecycle/lifecycle.go:346:17
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/lifecycle/lifecycle.go:300:17
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/cmd/vcluster/cmd/portforward.go:209:79
-
- G401: Use of weak cryptographic primitive, Severity: MEDIUM
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/snapshot/s3/store.go:181:11
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/controllers/deploy/deploy.go:457:27
-
- G501: Blocklisted import crypto/md5: weak cryptographic primitive, Severity: MEDIUM
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/snapshot/s3/store.go:21:2
-
- File: /home/runner/_work/bulwark/bulwark/target-repo/pkg/controllers/deploy/deploy.go:5:2
-
Please review these findings and fix the issues before merging.
AmitSahastra
approved these changes
Apr 8, 2026
|
@ChellaVigneshKP you might have to push this fix to upstream as we use the upstream vcluster binary |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What issue type does this pull request address? (keep at least one, remove the others)
/kind bugfix
What does this pull request do? Which issues does it resolve? (use
resolves #<issue_number>if possible)The PVC syncer's translateSelector function calls translate.Default.HostNameCluster() directly to translate volumeName and storageClassName, bypassing the PV and SC mappers. This unconditionally mangles these names even when the PV was synced from the host (hasvcluster.loft.sh/host-pv annotation), making it impossible to bind a PVC to a pre-existing host PV by name.
Additionally, the PV syncer's translate function has the same pattern for storageClassName, causing SC name mismatches between PVs and PVCs on the host when toHost.storageClasses.enabled is false.
This fix replaces 5 instances of HostNameCluster() with mappings.VirtualToHostName() across 2 files, routing through the proper mappers which conditionally translate based on resource origin — host-synced resources retain their original names, vCluster-created resources still get translated normally.
Please provide a short message that should be published in the vcluster release notes
Fixed an issue where vCluster unconditionally mangled volumeName and storageClassName when syncing PVCs to the host, even for PVs synced from the host with the vcluster.loft.sh/host-pv annotation. PVCs with explicit volumeName pointing to a pre-existing host PV nowbind correctly.
What else do we need to know?
The PV mapper (pkg/mappings/resources/persistentvolumes.go:18-29) already had the correct annotation-aware logic — this fix simply ensures the PVC and PV syncers use it instead of bypassing it.
The fix also addresses the PV syncer's storageClassName translation (persistentvolumes/translate.go:20) to prevent SC name mismatches between PVs and PVCs on the host when toHost.storageClasses.enabled is false (mirror mapper scenario).
E2E Tests
Default Test Execution
The mandatory PR suite runs automatically. Only specify additional test suites below if needed.
Adding New Test Suites
When adding a new ginkgo test suite:
Additional test suites
Additional test suite(s) that will be executed before the mandatory PR suite: