Remote provisioning: fix webhook event processing (#103122)

Set the namespace in the context on Insert
This commit is contained in:
Roberto Jiménez Sánchez
2025-03-31 17:35:49 +02:00
committed by GitHub
parent 4c2790c41b
commit 1ebcb3f604

View File

@ -379,6 +379,7 @@ func (s *persistentStore) cleanupClaims(ctx context.Context) error {
func (s *persistentStore) Insert(ctx context.Context, job *provisioning.Job) (*provisioning.Job, error) {
s.generateJobName(job) // Side-effect: updates the job's name.
ctx = request.WithNamespace(ctx, job.GetNamespace())
obj, err := s.jobStore.Create(ctx, job, nil, &metav1.CreateOptions{})
if apierrors.IsAlreadyExists(err) {
return nil, apifmt.Errorf("job '%s' in '%s' already exists: %w", job.GetName(), job.GetNamespace(), err)