Repository: kubernetes-sigs/kueue

Issue:
[flaky test] ManageJobsWithoutQueueName when manageJobsWithoutQueueName=true and ManagedJobsNamespaceSelectorAlwaysRespected=false should not suspend Jobs from unmanaged JobSet
/kind flake 

**What happened**:
failure on unrelated branch: https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_kueue/7655/pull-kueue-test-e2e-customconfigs-main/1991476538075254784
**What you expected to happen**:
no failure
**How to reproduce it (as minimally and precisely as possible)**:
ci
**Anything else we need to know?**:
```
End To End Custom Configs handling Suite: kindest/node:v1.34.0: [It] ManageJobsWithoutQueueName when manageJobsWithoutQueueName=true and ManagedJobsNamespaceSelectorAlwaysRespected=false should not suspend Jobs from unmanaged JobSet expand_less	2m8s
{Timed out after 45.000s.
The function passed to Eventually failed at /home/prow/go/src/sigs.k8s.io/kueue/test/e2e/customconfigs/managejobswithoutqueuename_test.go:159 with:
Expected
    <string>: 
to equal
    <string>: Completed failed [FAILED] Timed out after 45.000s.
The function passed to Eventually failed at /home/prow/go/src/sigs.k8s.io/kueue/test/e2e/customconfigs/managejobswithoutqueuename_test.go:159 with:
Expected
    <string>: 
to equal
    <string>: Completed
In [It] at: /home/prow/go/src/sigs.k8s.io/kueue/test/e2e/customconfigs/managejobswithoutqueuename_test.go:160 @ 11/20/25 12:13:21.036
}
[open stderropen_in_new](https://prow.k8s.io/spyglass/lens/junit/iframe?req=%7B%22artifacts%22%3A%5B%22artifacts%2Frun-test-e2e-customconfigs-1.34.0%2Fjunit.xml%22%5D%2C%22index%22%3A2%2C%22src%22%3A%22gs%2Fkubernetes-ci-logs%2Fpr-logs%2Fpull%2Fkubernetes-sigs_kueue%2F7655%2Fpull-kueue-test-e2e-customconfigs-main%2F1991476538075254784%22%7D&topURL=https%3A//prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_kueue/7655/pull-kueue-test-e2e-customconfigs-main/1991476538075254784&lensIndex=2#)
```

Hints from issue comments:
@mimowo: cc @kannon92 @kannon92: cc @MaysaMacedo @kannon92: Should we just increase timeout for JobSet to go complete?

@mimowo: > Should we just increase timeout for JobSet to go complete?

If this helps based on the logs then sure@kannon92: /assign

I opened up https://github.com/kubernetes-sigs/kueue/pull/7784.

Solution patch:
diff --git a/apis/config/v1beta1/zz_generated.conversion.go b/apis/config/v1beta1/zz_generated.conversion.go
index a2705d29a..655a873f5 100644
--- a/apis/config/v1beta1/zz_generated.conversion.go
+++ b/apis/config/v1beta1/zz_generated.conversion.go
@@ -629,7 +629,7 @@ func autoConvert_v1beta2_MultiKueue_To_v1beta1_MultiKueue(in *v1beta2.MultiKueue
 	out.WorkerLostTimeout = (*metav1.Duration)(unsafe.Pointer(in.WorkerLostTimeout))
 	out.DispatcherName = (*string)(unsafe.Pointer(in.DispatcherName))
 	out.ExternalFrameworks = *(*[]MultiKueueExternalFramework)(unsafe.Pointer(&in.ExternalFrameworks))
-	// WARNING: in.ClusterProfileConfig requires manual conversion: does not exist in peer-type
+	// WARNING: in.ClusterProfile requires manual conversion: does not exist in peer-type
 	return nil
 }
 
diff --git a/apis/config/v1beta2/configuration_types.go b/apis/config/v1beta2/configuration_types.go
index 1da9ed503..bcffcd024 100644
--- a/apis/config/v1beta2/configuration_types.go
+++ b/apis/config/v1beta2/configuration_types.go
@@ -276,9 +276,9 @@ type MultiKueue struct {
 	// +optional
 	ExternalFrameworks []MultiKueueExternalFramework `json:"externalFrameworks,omitempty"`
 
-	// ClusterProfileConfig defines configuration for using the ClusterProfile API.
+	// ClusterProfile defines configuration for using the ClusterProfile API.
 	// +optional
-	ClusterProfileConfig *ClusterProfileConfig `json:"clusterProfileConfig,omitempty"`
+	ClusterProfile *ClusterProfile `json:"clusterProfile,omitempty"`
 }
 
 // MultiKueueExternalFramework defines a framework that is not built-in.
@@ -372,8 +372,8 @@ type InternalCertManagement struct {
 	WebhookSecretName *string `json:"webhookSecretName,omitempty"`
 }
 
-// ClusterProfileConfig defines configuration for using the ClusterProfile API in MultiKueue.
-type ClusterProfileConfig struct {
+// ClusterProfile defines configuration for using the ClusterProfile API in MultiKueue.
+type ClusterProfile struct {
 	// CredentialsProviders defines a list of providers to obtain credentials of worker clusters
 	// using the ClusterProfile API.
 	CredentialsProviders []ClusterProfileCredentialsProvider `json:"credentialsProviders,omitempty"`
diff --git a/apis/config/v1beta2/zz_generated.deepcopy.go b/apis/config/v1beta2/zz_generated.deepcopy.go
index 033b4af1f..6c4da46d7 100644
--- a/apis/config/v1beta2/zz_generated.deepcopy.go
+++ b/apis/config/v1beta2/zz_generated.deepcopy.go
@@ -79,7 +79,7 @@ func (in *ClientConnection) DeepCopy() *ClientConnection {
 }
 
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ClusterProfileConfig) DeepCopyInto(out *ClusterProfileConfig) {
+func (in *ClusterProfile) DeepCopyInto(out *ClusterProfile) {
 	*out = *in
 	if in.CredentialsProviders != nil {
 		in, out := &in.CredentialsProviders, &out.CredentialsProviders
@@ -90,12 +90,12 @@ func (in *ClusterProfileConfig) DeepCopyInto(out *ClusterProfileConfig) {
 	}
 }
 
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProfileConfig.
-func (in *ClusterProfileConfig) DeepCopy() *ClusterProfileConfig {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProfile.
+func (in *ClusterProfile) DeepCopy() *ClusterProfile {
 	if in == nil {
 		return nil
 	}
-	out := new(ClusterProfileConfig)
+	out := new(ClusterProfile)
 	in.DeepCopyInto(out)
 	return out
 }
@@ -440,9 +440,9 @@ func (in *MultiKueue) DeepCopyInto(out *MultiKueue) {
 		*out = make([]MultiKueueExternalFramework, len(*in))
 		copy(*out, *in)
 	}
-	if in.ClusterProfileConfig != nil {
-		in, out := &in.ClusterProfileConfig, &out.ClusterProfileConfig
-		*out = new(ClusterProfileConfig)
+	if in.ClusterProfile != nil {
+		in, out := &in.ClusterProfile, &out.ClusterProfile
+		*out = new(ClusterProfile)
 		(*in).DeepCopyInto(*out)
 	}
 }
diff --git a/cmd/kueue/main.go b/cmd/kueue/main.go
index 878c6ca63..224d845c7 100644
--- a/cmd/kueue/main.go
+++ b/cmd/kueue/main.go
@@ -379,7 +379,7 @@ func setupControllers(ctx context.Context, mgr ctrl.Manager, cCache *schdcache.C
 			multikueue.WithWorkerLostTimeout(cfg.MultiKueue.WorkerLostTimeout.Duration),
 			multikueue.WithAdapters(adapters),
 			multikueue.WithDispatcherName(ptr.Deref(cfg.MultiKueue.DispatcherName, configapi.MultiKueueDispatcherModeAllAtOnce)),
-			multikueue.WithClusterProfiles(cfg.MultiKueue.ClusterProfileConfig),
+			multikueue.WithClusterProfiles(cfg.MultiKueue.ClusterProfile),
 		); err != nil {
 			return fmt.Errorf("could not setup MultiKueue controller: %w", err)
 		}
diff --git a/keps/693-multikueue/README.md b/keps/693-multikueue/README.md
index 7a2e6ee70..42af00057 100644
--- a/keps/693-multikueue/README.md
+++ b/keps/693-multikueue/README.md
@@ -257,18 +257,18 @@ The controller obtains cluster credentials based on the `MultiKueueCluster` spec
 
   The authentication flow is as follows:
   1. The controller reads the `ClusterProfile` object referenced by the `MultiKueueCluster`. The `ClusterProfile` contains a list of access providers.
-  2. The controller uses this configuration to match the access provider with the credentials provider and invoke the credential plugin binary. The list of credentials providers is configured in the `CredentialsProviders` section under `ClusterProfileConfig` in the `MultiKueue` in the Configuration API.
+  2. The controller uses this configuration to match the access provider with the credentials provider and invoke the credential plugin binary. The list of credentials providers is configured in the `CredentialsProviders` section under `ClusterProfile` in the `MultiKueue` in the Configuration API.
 
 ```go
 type MultiKueue struct {
   ...
-	// ClusterProfileConfig defines configuration for using the ClusterProfile API.
+	// ClusterProfile defines configuration for using the ClusterProfile API.
 	// +optional
-	ClusterProfileConfig *ClusterProfileConfig `json:"clusterProfileConfig,omitempty"`
+	ClusterProfile *ClusterProfile `json:"clusterProfile,omitempty"`
 }
 
-// ClusterProfileConfig defines configuration for using the ClusterProfile API in MultiKueue.
-type ClusterProfileConfig struct {
+// ClusterProfile defines configuration for using the ClusterProfile API in MultiKueue.
+type ClusterProfile struct {
 	// CredentialsProviders defines a list of providers to obtain credentials of worker clusters
 	// using the ClusterProfile API.
 	CredentialsProviders []ClusterProfileCredentialsProvider `json:"credentialsProviders,omitempty"`
diff --git a/pkg/controller/admissionchecks/multikueue/controllers.go b/pkg/controller/admissionchecks/multikueue/controllers.go
index 84a98f5f7..ffe04a59f 100644
--- a/pkg/controller/admissionchecks/multikueue/controllers.go
+++ b/pkg/controller/admissionchecks/multikueue/controllers.go
@@ -42,7 +42,7 @@ type SetupOptions struct {
 	eventsBatchPeriod    time.Duration
 	adapters             map[string]jobframework.MultiKueueAdapter
 	dispatcherName       string
-	clusterProfileConfig *configapi.ClusterProfileConfig
+	clusterProfileConfig *configapi.ClusterProfile
 }
 
 type SetupOption func(o *SetupOptions)
@@ -93,7 +93,7 @@ func WithDispatcherName(dispatcherName string) SetupOption {
 	}
 }
 
-func WithClusterProfiles(clusterProfiles *configapi.ClusterProfileConfig) SetupOption {
+func WithClusterProfiles(clusterProfiles *configapi.ClusterProfile) SetupOption {
 	return func(o *SetupOptions) {
 		o.clusterProfileConfig = clusterProfiles
 	}
diff --git a/site/content/en/docs/reference/kueue-config.v1beta2.md b/site/content/en/docs/reference/kueue-config.v1beta2.md
index bd5ea5e8f..4caac8323 100644
--- a/site/content/en/docs/reference/kueue-config.v1beta2.md
+++ b/site/content/en/docs/reference/kueue-config.v1beta2.md
@@ -85,7 +85,7 @@ connection.</p>
 </tbody>
 </table>
 
-## `ClusterProfileConfig`     {#config-kueue-x-k8s-io-v1beta2-ClusterProfileConfig}
+## `ClusterProfile`     {#config-kueue-x-k8s-io-v1beta2-ClusterProfile}
     
 
 **Appears in:**
@@ -93,7 +93,7 @@ connection.</p>
 - [MultiKueue](#config-kueue-x-k8s-io-v1beta2-MultiKueue)
 
 
-<p>ClusterProfileConfig defines configuration for using the ClusterProfile API in MultiKueue.</p>
+<p>ClusterProfile defines configuration for using the ClusterProfile API in MultiKueue.</p>
 
 
 <table class="table">
@@ -117,7 +117,7 @@ using the ClusterProfile API.</p>
 
 **Appears in:**
 
-- [ClusterProfileConfig](#config-kueue-x-k8s-io-v1beta2-ClusterProfileConfig)
+- [ClusterProfile](#config-kueue-x-k8s-io-v1beta2-ClusterProfile)
 
 
 <p>ClusterProfileCredentialsProvider defines a credentials provider in the ClusterProfile API.</p>
@@ -635,11 +635,11 @@ by the generic MultiKueue adapter. Each entry defines how to handle a specific
 GroupVersionKind (GVK) for MultiKueue operations.</p>
 </td>
 </tr>
-<tr><td><code>clusterProfileConfig</code><br/>
-<a href="#config-kueue-x-k8s-io-v1beta2-ClusterProfileConfig"><code>ClusterProfileConfig</code></a>
+<tr><td><code>clusterProfile</code><br/>
+<a href="#config-kueue-x-k8s-io-v1beta2-ClusterProfile"><code>ClusterProfile</code></a>
 </td>
 <td>
-   <p>ClusterProfileConfig defines configuration for using the ClusterProfile API.</p>
+   <p>ClusterProfile defines configuration for using the ClusterProfile API.</p>
 </td>
 </tr>
 </tbody>



Test patch:
diff --git a/test/e2e/customconfigs/managejobswithoutqueuename_test.go b/test/e2e/customconfigs/managejobswithoutqueuename_test.go
index 6dc6bdf6b..d0ee9c49a 100644
--- a/test/e2e/customconfigs/managejobswithoutqueuename_test.go
+++ b/test/e2e/customconfigs/managejobswithoutqueuename_test.go
@@ -123,16 +123,16 @@ var _ = ginkgo.Describe("ManageJobsWithoutQueueName", ginkgo.Ordered, func() {
 							Replicas:    1,
 							Parallelism: 1,
 							Completions: 1,
-							Image:       "busybox",
-							Args:        []string{"sleep", "2s"},
+							Image:       util.GetAgnHostImage(),
+							Args:        util.BehaviorExitFast,
 						},
 						testingjobset.ReplicatedJobRequirements{
 							Name:        "test-job-2",
 							Replicas:    1,
 							Parallelism: 1,
 							Completions: 1,
-							Image:       "busybox",
-							Args:        []string{"sleep", "2s"},
+							Image:       util.GetAgnHostImage(),
+							Args:        util.BehaviorExitFast,
 						},
 					).Obj()
 				util.MustCreate(ctx, k8sClient, newJobSet)
@@ -145,9 +145,18 @@ var _ = ginkgo.Describe("ManageJobsWithoutQueueName", ginkgo.Ordered, func() {
 					g.Expect(jobs.Items).To(gomega.HaveLen(2))
 					for _, job := range jobs.Items {
 						g.Expect(job.Spec.Suspend).To(gomega.HaveValue(gomega.BeFalse()))
-						for _, job := range jobs.Items {
-							g.Expect(job.Status.Active).To(gomega.Equal(int32(1)))
-						}
+					}
+				}, util.LongTimeout, util.Interval).Should(gomega.Succeed())
+			})
+
+			ginkgo.By("verifying that the jobs are complete", func() {
+				gomega.Eventually(func(g gomega.Gomega) {
+					jobs := &batchv1.JobList{}
+					g.Expect(k8sClient.List(ctx, jobs, client.InNamespace(ns.Name))).To(gomega.Succeed())
+					g.Expect(jobs.Items).To(gomega.HaveLen(2))
+					for _, job := range jobs.Items {
+						g.Expect(job.Spec.Suspend).To(gomega.HaveValue(gomega.BeFalse()))
+						g.Expect(job.Status.Succeeded).To(gomega.Equal(int32(1)))
 					}
 				}, util.LongTimeout, util.Interval).Should(gomega.Succeed())
 			})