Repository: kubernetes-sigs/kueue
Pull request #230 (2022-04-24 06:30:36)

feat: clusterQueue add status field
Signed-off-by: kerthcet <kerthcet@gmail.com>

<!--  Thanks for sending a pull request!  Here are some tips for you:

1. If this is your first time, please read our contributor guidelines: https://git.k8s.io/community/contributors/guide/first-contribution.md#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. For reference on required PR/issue labels, read here:
https://git.k8s.io/community/contributors/devel/sig-release/release.md#issuepr-kind-label
3. Ensure you have added or ran the appropriate tests for your PR: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
4. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
5. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->

#### What type of PR is this?
/kind feature

<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature

Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:

#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Part of https://github.com/kubernetes-sigs/kueue/issues/134

#### Special notes for your reviewer:



k8s-ci-robot: Hi @kerthcet. Thanks for your PR.

I'm waiting for a [kubernetes-sigs](https://github.com/orgs/kubernetes-sigs/people) member to verify that this patch is reasonable to test. If it is, they should reply with `/ok-to-test` on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should [join the org](https://git.k8s.io/community/community-membership.md#member) to skip this step.

Once the patch is verified, the new status will be reflected by the `ok-to-test` label.

I understand the commands that are listed [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fkueue).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>

k8s-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/kueue/pull/230#" title="Author self-approved">kerthcet</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **ahg-g** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @ahg-g` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fkueue).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/kubernetes-sigs/kueue/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["ahg-g"]} -->
denkensk: /ok-to-test
k8s-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/kueue/pull/230#" title="Author self-approved">kerthcet</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please ask for approval from **ahg-g** after the PR has been reviewed.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fkueue).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/kubernetes-sigs/kueue/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["ahg-g"]} -->
k8s-ci-robot: @kerthcet: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-test-unit-main | 2a490054e3e2c963d0c9ad3cb99f0745adb05a6a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-unit-main/1519889462526480384) | true | `/test pull-kueue-test-unit-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @kerthcet: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-test-unit-main | 915a619ccb7382d9c762dc613557475603399098 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-unit-main/1519897535844454400) | true | `/test pull-kueue-test-unit-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kerthcet: I changed the implement as now we will insert CQs to cohort in any case and we will not remove them unless the delete action. But we will still maintain the `status` both in qManager and cache, so that when popping elements in scheduling, we will filter out not ready CQs, which is more efficiency. Also in snapshotting, we will exclude not ready CQs also. @ahg-g 
k8s-ci-robot: @kerthcet: PR needs rebase.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>
k8s-ci-robot: @kerthcet: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-test-integration-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-integration-main/1520689398201454592) | true | `/test pull-kueue-test-integration-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @kerthcet: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-test-integration-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-integration-main/1520689398201454592) | true | `/test pull-kueue-test-integration-main`
pull-kueue-build-image-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-build-image-main/1520689398415364096) | true | `/test pull-kueue-build-image-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @kerthcet: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-test-integration-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-integration-main/1520689398201454592) | true | `/test pull-kueue-test-integration-main`
pull-kueue-build-image-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-build-image-main/1520689398415364096) | true | `/test pull-kueue-build-image-main`
pull-kueue-test-unit-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-unit-main/1520689398142734336) | true | `/test pull-kueue-test-unit-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @kerthcet: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-test-integration-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-integration-main/1520689398201454592) | true | `/test pull-kueue-test-integration-main`
pull-kueue-build-image-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-build-image-main/1520689398415364096) | true | `/test pull-kueue-build-image-main`
pull-kueue-test-unit-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-unit-main/1520689398142734336) | true | `/test pull-kueue-test-unit-main`
pull-kueue-verify-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-verify-main/1520689398281146368) | true | `/test pull-kueue-verify-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @kerthcet: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-test-integration-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-integration-main/1520689398201454592) | true | `/test pull-kueue-test-integration-main`
pull-kueue-build-image-main | 611abdadbeb09202f48983ecb1784602c9c1761a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-build-image-main/1520689398415364096) | true | `/test pull-kueue-build-image-main`
pull-kueue-verify-main | 23aba6b77fabc56921785743bc9d0f115364354a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-verify-main/1520695513219862528) | true | `/test pull-kueue-verify-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @kerthcet: PR needs rebase.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>
k8s-ci-robot: @kerthcet: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-verify-main | 23aba6b77fabc56921785743bc9d0f115364354a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-verify-main/1520695513219862528) | true | `/test pull-kueue-verify-main`
pull-kueue-build-image-main | 2a42e82996dda7e4901b9cf3deb6da67818ca278 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-build-image-main/1520698087385862144) | true | `/test pull-kueue-build-image-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @kerthcet: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-verify-main | 23aba6b77fabc56921785743bc9d0f115364354a | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-verify-main/1520695513219862528) | true | `/test pull-kueue-verify-main`
pull-kueue-build-image-main | 2a42e82996dda7e4901b9cf3deb6da67818ca278 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-build-image-main/1520698087385862144) | true | `/test pull-kueue-build-image-main`
pull-kueue-test-integration-main | 2a42e82996dda7e4901b9cf3deb6da67818ca278 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-integration-main/1520698087318753280) | true | `/test pull-kueue-test-integration-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @kerthcet: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-build-image-main | 2a42e82996dda7e4901b9cf3deb6da67818ca278 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-build-image-main/1520698087385862144) | true | `/test pull-kueue-build-image-main`
pull-kueue-test-integration-main | 2a42e82996dda7e4901b9cf3deb6da67818ca278 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-integration-main/1520698087318753280) | true | `/test pull-kueue-test-integration-main`
pull-kueue-verify-main | 2a42e82996dda7e4901b9cf3deb6da67818ca278 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-verify-main/1520698087352307712) | true | `/test pull-kueue-verify-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @kerthcet: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-build-image-main | 2a42e82996dda7e4901b9cf3deb6da67818ca278 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-build-image-main/1520698087385862144) | true | `/test pull-kueue-build-image-main`
pull-kueue-test-integration-main | 2a42e82996dda7e4901b9cf3deb6da67818ca278 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-integration-main/1520698087318753280) | true | `/test pull-kueue-test-integration-main`
pull-kueue-verify-main | 2a42e82996dda7e4901b9cf3deb6da67818ca278 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-verify-main/1520698087352307712) | true | `/test pull-kueue-verify-main`
pull-kueue-test-unit-main | 2a42e82996dda7e4901b9cf3deb6da67818ca278 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-unit-main/1520698087264227328) | true | `/test pull-kueue-test-unit-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kerthcet: Sorry for the force-pushed due to some conflicts. I changed the implement:
1. Only cache will manage the clusterQueue status
2. We'll filter inactive clusterQueues in Snapshot.
3. When resourceFlavor created, scheduler will be waked.

@ahg-g PTAL if you have time.
k8s-ci-robot: @kerthcet: PR needs rebase.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>
k8s-ci-robot: @kerthcet: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-kueue-test-integration-main | 956096adf7639be299d1672d5bdc5761fcae8613 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_kueue/230/pull-kueue-test-integration-main/1522484865910444032) | true | `/test pull-kueue-test-integration-main`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=kueue&pr=230). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Akerthcet). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/kueue/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kerthcet: updated @ahg-g 
ahg-g: Thanks, please squash

Patch:
diff --git a/Makefile b/Makefile
index 29e84db42..75c67f002 100644
--- a/Makefile
+++ b/Makefile
@@ -113,9 +113,9 @@ test: generate fmt vet ## Run tests.
 	$(GO_CMD) test $(GO_TEST_FLAGS) ./pkg/... -coverprofile cover.out
 
 .PHONY: test-integration
-test-integration: manifests generate fmt vet envtest ginkgo ## Run tests.
+test-integration: manifests generate fmt vet envtest ## Run tests.
 	KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" \
-	$(GINKGO) -v $(INTEGRATION_TARGET)
+	$(GO_CMD) test -v $(INTEGRATION_TARGET)
 
 .PHONY: ci-lint
 ci-lint: golangci-lint
@@ -206,8 +206,3 @@ ENVTEST = $(shell pwd)/bin/setup-envtest
 .PHONY: envtest
 envtest: ## Download envtest-setup locally if necessary.
 	@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
-
-GINKGO = $(shell pwd)/bin/ginkgo
-.PHONY: ginkgo
-ginkgo: ## Download ginkgo locally if necessary.
-	@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install github.com/onsi/ginkgo/v2/ginkgo@v2.1.4
diff --git a/apis/kueue/v1alpha1/workload_webhook.go b/apis/kueue/v1alpha1/workload_webhook.go
index 1b206a2ac..e5bdf87c5 100644
--- a/apis/kueue/v1alpha1/workload_webhook.go
+++ b/apis/kueue/v1alpha1/workload_webhook.go
@@ -18,8 +18,6 @@ package v1alpha1
 
 import (
 	"k8s.io/apimachinery/pkg/runtime"
-	"k8s.io/apimachinery/pkg/util/validation"
-	"k8s.io/apimachinery/pkg/util/validation/field"
 	"k8s.io/klog/v2"
 	ctrl "sigs.k8s.io/controller-runtime"
 	"sigs.k8s.io/controller-runtime/pkg/webhook"
@@ -60,45 +58,15 @@ var _ webhook.Validator = &Workload{}
 
 // ValidateCreate implements webhook.Validator so a webhook will be registered for the type
 func (r *Workload) ValidateCreate() error {
-	return ValidateWorkload(r).ToAggregate()
+	return nil
 }
 
 // ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
 func (r *Workload) ValidateUpdate(old runtime.Object) error {
-	return ValidateWorkload(r).ToAggregate()
+	return nil
 }
 
 // ValidateDelete implements webhook.Validator so a webhook will be registered for the type
 func (r *Workload) ValidateDelete() error {
 	return nil
 }
-
-func ValidateWorkload(obj *Workload) field.ErrorList {
-	var allErrs field.ErrorList
-	specField := field.NewPath("spec")
-	podSetsField := specField.Child("podSets")
-	if len(obj.Spec.PodSets) == 0 {
-		allErrs = append(allErrs, field.Required(podSetsField, "at least one podSet is required"))
-	}
-
-	for i, podSet := range obj.Spec.PodSets {
-		if podSet.Count <= 0 {
-			allErrs = append(allErrs, field.Invalid(
-				podSetsField.Index(i).Child("count"),
-				podSet.Count,
-				"count must be greater than 0"),
-			)
-		}
-	}
-
-	if len(obj.Spec.PriorityClassName) > 0 {
-		msgs := validation.IsDNS1123Subdomain(obj.Spec.PriorityClassName)
-		if len(msgs) > 0 {
-			classNameField := specField.Child("priorityClassName")
-			for _, msg := range msgs {
-				allErrs = append(allErrs, field.Invalid(classNameField, obj.Spec.PriorityClassName, msg))
-			}
-		}
-	}
-	return allErrs
-}
diff --git a/go.mod b/go.mod
index 7df77698b..4728562dc 100644
--- a/go.mod
+++ b/go.mod
@@ -5,8 +5,8 @@ go 1.18
 require (
 	github.com/go-logr/logr v1.2.2
 	github.com/google/go-cmp v0.5.7
-	github.com/onsi/ginkgo/v2 v2.1.4
-	github.com/onsi/gomega v1.19.0
+	github.com/onsi/ginkgo/v2 v2.1.3
+	github.com/onsi/gomega v1.18.1
 	github.com/prometheus/client_golang v1.12.1
 	go.uber.org/zap v1.21.0
 	k8s.io/api v0.23.4
@@ -54,9 +54,9 @@ require (
 	go.uber.org/atomic v1.9.0 // indirect
 	go.uber.org/multierr v1.7.0 // indirect
 	golang.org/x/crypto v0.0.0-20220210151621-f4118a5b28e2 // indirect
-	golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
+	golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
 	golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
-	golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
+	golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
 	golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
 	golang.org/x/text v0.3.7 // indirect
 	golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
diff --git a/go.sum b/go.sum
index 87e52a232..5c8aa213f 100644
--- a/go.sum
+++ b/go.sum
@@ -182,6 +182,7 @@ github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE
 github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
 github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
 github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
 github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
@@ -266,6 +267,7 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
 github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
@@ -383,19 +385,23 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
 github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
 github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
+github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
 github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
 github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
 github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
+github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
 github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
-github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY=
-github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU=
+github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
+github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc=
+github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
 github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
 github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
 github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
-github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
-github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
+github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
+github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
+github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
 github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
 github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
 github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
@@ -625,14 +631,15 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v
 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
 golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
+golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
 golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
-golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk=
+golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -709,6 +716,7 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -732,9 +740,10 @@ golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 h1:OH54vjqzRWmbJ62fjuhxy7AxFFgoHN0/DPc/UrL8cAs=
-golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c=
+golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
@@ -808,6 +817,7 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u
 golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go
index 2554c750c..7bdbd9b2b 100644
--- a/pkg/cache/cache.go
+++ b/pkg/cache/cache.go
@@ -80,6 +80,19 @@ func newCohort(name string, size int) *Cohort {
 	}
 }
 
+type ClusterQueueStatus int
+
+const (
+	// Pending means the ClusterQueue is accepted but not yet active,
+	// this can be because of a missing ResourceFlavor referenced by the ClusterQueue.
+	// In this state, the ClusterQueue can't admit new workloads and its quota can't be borrowed
+	// by other active ClusterQueues in the cohort.
+	Pending ClusterQueueStatus = iota
+	// Active means the ClusterQueue can admit new workloads and its quota
+	// can be borrowed by other ClusterQueues in the cohort.
+	Active
+)
+
 // ClusterQueue is the internal implementation of kueue.ClusterQueue that
 // holds admitted workloads.
 type ClusterQueue struct {
@@ -93,6 +106,7 @@ type ClusterQueue struct {
 	// Those keys define the affinity terms of a workload
 	// that can be matched against the flavors.
 	LabelKeys map[corev1.ResourceName]sets.String
+	Status    ClusterQueueStatus
 }
 
 // FlavorLimits holds a processed ClusterQueue flavor quota.
@@ -114,6 +128,10 @@ func (c *Cache) newClusterQueue(cq *kueue.ClusterQueue) (*ClusterQueue, error) {
 	return cqImpl, nil
 }
 
+func (c *ClusterQueue) Active() bool {
+	return c.Status == Active
+}
+
 func (c *ClusterQueue) update(in *kueue.ClusterQueue, resourceFlavors map[string]*kueue.ResourceFlavor) error {
 	c.RequestableResources = resourceLimitsByName(in.Spec.Resources)
 	nsSelector, err := metav1.LabelSelectorAsSelector(in.Spec.NamespaceSelector)
@@ -136,13 +154,22 @@ func (c *ClusterQueue) update(in *kueue.ClusterQueue, resourceFlavors map[string
 		usedResources[r.Name] = usedFlavors
 	}
 	c.UsedResources = usedResources
-	c.UpdateLabelKeys(resourceFlavors)
+	c.UpdateWithFlavors(resourceFlavors)
 	return nil
 }
 
-// UpdateLabelKeys updates a ClusterQueue's LabelKeys based on the passed ResourceFlavors set.
+// UpdateWithFlavors updates a ClusterQueue based on the passed ResourceFlavors set.
 // Exported only for testing.
-func (c *ClusterQueue) UpdateLabelKeys(flavors map[string]*kueue.ResourceFlavor) {
+func (c *ClusterQueue) UpdateWithFlavors(flavors map[string]*kueue.ResourceFlavor) {
+	if flavorNotFound := c.updateLabelKeys(flavors); flavorNotFound {
+		c.Status = Pending
+		return
+	}
+	c.Status = Active
+}
+
+func (c *ClusterQueue) updateLabelKeys(flavors map[string]*kueue.ResourceFlavor) bool {
+	var flavorNotFound bool
 	labelKeys := map[corev1.ResourceName]sets.String{}
 	for rName, flvLimits := range c.RequestableResources {
 		if len(flvLimits) == 0 {
@@ -154,9 +181,9 @@ func (c *ClusterQueue) UpdateLabelKeys(flavors map[string]*kueue.ResourceFlavor)
 				for k := range flv.Labels {
 					resKeys.Insert(k)
 				}
+			} else {
+				flavorNotFound = true
 			}
-			// We don't error here on missing flavor since ResourceFlavor add events may
-			// come after ClusterQueue add/update.
 		}
 
 		if len(resKeys) != 0 {
@@ -168,6 +195,8 @@ func (c *ClusterQueue) UpdateLabelKeys(flavors map[string]*kueue.ResourceFlavor)
 	if len(labelKeys) != 0 {
 		c.LabelKeys = labelKeys
 	}
+
+	return flavorNotFound
 }
 
 func (c *ClusterQueue) addWorkload(w *kueue.Workload) error {
@@ -205,22 +234,45 @@ func (c *ClusterQueue) updateWorkloadUsage(wi *workload.Info, m int64) {
 	}
 }
 
-func (c *Cache) AddOrUpdateResourceFlavor(rf *kueue.ResourceFlavor) {
-	c.Lock()
-	c.resourceFlavors[rf.Name] = rf
+func (c *Cache) updateClusterQueues() sets.String {
+	cqs := sets.NewString()
+
 	for _, cq := range c.clusterQueues {
+		prevStatus := cq.Status
 		// We call update on all ClusterQueues irrespective of which CQ actually use this flavor
 		// because it is not expensive to do so, and is not worth tracking which ClusterQueues use
 		// which flavors.
-		cq.UpdateLabelKeys(c.resourceFlavors)
+		cq.UpdateWithFlavors(c.resourceFlavors)
+		curStatus := cq.Status
+		if prevStatus == Pending && curStatus == Active {
+			cqs.Insert(cq.Name)
+		}
 	}
-	c.Unlock()
+	return cqs
+}
+
+func (c *Cache) AddOrUpdateResourceFlavor(rf *kueue.ResourceFlavor) sets.String {
+	c.Lock()
+	defer c.Unlock()
+	c.resourceFlavors[rf.Name] = rf
+	return c.updateClusterQueues()
 }
 
-func (c *Cache) DeleteResourceFlavor(rf *kueue.ResourceFlavor) {
+func (c *Cache) DeleteResourceFlavor(rf *kueue.ResourceFlavor) sets.String {
 	c.Lock()
+	defer c.Unlock()
 	delete(c.resourceFlavors, rf.Name)
-	c.Unlock()
+	return c.updateClusterQueues()
+}
+
+func (c *Cache) ClusterQueueActive(name string) bool {
+	c.RLock()
+	defer c.RUnlock()
+	cq, exists := c.clusterQueues[name]
+	if !exists {
+		return false
+	}
+	return cq != nil && cq.Active()
 }
 
 func (c *Cache) AddClusterQueue(ctx context.Context, cq *kueue.ClusterQueue) error {
@@ -264,12 +316,14 @@ func (c *Cache) UpdateClusterQueue(cq *kueue.ClusterQueue) error {
 	if err := cqImpl.update(cq, c.resourceFlavors); err != nil {
 		return err
 	}
-	if cqImpl.Cohort != nil {
-		if cqImpl.Cohort.Name != cq.Spec.Cohort {
-			c.deleteClusterQueueFromCohort(cqImpl)
-			c.addClusterQueueToCohort(cqImpl, cq.Spec.Cohort)
-		}
-	} else {
+
+	if cqImpl.Cohort == nil {
+		c.addClusterQueueToCohort(cqImpl, cq.Spec.Cohort)
+		return nil
+	}
+
+	if cqImpl.Cohort.Name != cq.Spec.Cohort {
+		c.deleteClusterQueueFromCohort(cqImpl)
 		c.addClusterQueueToCohort(cqImpl, cq.Spec.Cohort)
 	}
 	return nil
@@ -340,14 +394,14 @@ func (c *Cache) DeleteWorkload(w *kueue.Workload) error {
 		return errWorkloadNotAdmitted
 	}
 
-	qc, ok := c.clusterQueues[string(w.Spec.Admission.ClusterQueue)]
+	cq, ok := c.clusterQueues[string(w.Spec.Admission.ClusterQueue)]
 	if !ok {
 		return errCqNotFound
 	}
 
 	c.cleanupAssumedState(w)
 
-	qc.deleteWorkload(w)
+	cq.deleteWorkload(w)
 	return nil
 }
 
@@ -407,6 +461,7 @@ func (c *Cache) Usage(cqObj *kueue.ClusterQueue) (kueue.UsedResources, int, erro
 	if cq == nil {
 		return nil, 0, errCqNotFound
 	}
+
 	usage := make(kueue.UsedResources, len(cq.UsedResources))
 	for rName, usedRes := range cq.UsedResources {
 		rUsage := make(map[string]kueue.Usage)
diff --git a/pkg/cache/snapshot.go b/pkg/cache/snapshot.go
index e82239824..ef684e04a 100644
--- a/pkg/cache/snapshot.go
+++ b/pkg/cache/snapshot.go
@@ -17,13 +17,16 @@ limitations under the License.
 package cache
 
 import (
+	"k8s.io/apimachinery/pkg/util/sets"
+
 	kueue "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
 	"sigs.k8s.io/kueue/pkg/workload"
 )
 
 type Snapshot struct {
-	ClusterQueues   map[string]*ClusterQueue
-	ResourceFlavors map[string]*kueue.ResourceFlavor
+	ClusterQueues            map[string]*ClusterQueue
+	ResourceFlavors          map[string]*kueue.ResourceFlavor
+	InactiveClusterQueueSets sets.String
 }
 
 func (c *Cache) Snapshot() Snapshot {
@@ -31,10 +34,15 @@ func (c *Cache) Snapshot() Snapshot {
 	defer c.RUnlock()
 
 	snap := Snapshot{
-		ClusterQueues:   make(map[string]*ClusterQueue, len(c.clusterQueues)),
-		ResourceFlavors: make(map[string]*kueue.ResourceFlavor, len(c.resourceFlavors)),
+		ClusterQueues:            make(map[string]*ClusterQueue, len(c.clusterQueues)),
+		ResourceFlavors:          make(map[string]*kueue.ResourceFlavor, len(c.resourceFlavors)),
+		InactiveClusterQueueSets: sets.NewString(),
 	}
 	for _, cq := range c.clusterQueues {
+		if !cq.Active() {
+			snap.InactiveClusterQueueSets.Insert(cq.Name)
+			continue
+		}
 		snap.ClusterQueues[cq.Name] = cq.snapshot()
 	}
 	for _, rf := range c.resourceFlavors {
@@ -44,10 +52,12 @@ func (c *Cache) Snapshot() Snapshot {
 	for _, cohort := range c.cohorts {
 		cohortCopy := newCohort(cohort.Name, len(cohort.members))
 		for cq := range cohort.members {
-			cqCopy := snap.ClusterQueues[cq.Name]
-			cqCopy.accumulateResources(cohortCopy)
-			cqCopy.Cohort = cohortCopy
-			cohortCopy.members[cqCopy] = struct{}{}
+			if cq.Active() {
+				cqCopy := snap.ClusterQueues[cq.Name]
+				cqCopy.accumulateResources(cohortCopy)
+				cqCopy.Cohort = cohortCopy
+				cohortCopy.members[cqCopy] = struct{}{}
+			}
 		}
 	}
 	return snap
@@ -63,6 +73,7 @@ func (c *ClusterQueue) snapshot() *ClusterQueue {
 		Workloads:            make(map[string]*workload.Info, len(c.Workloads)),
 		LabelKeys:            c.LabelKeys, // Shallow copy is enough.
 		NamespaceSelector:    c.NamespaceSelector,
+		Status:               c.Status,
 	}
 	for res, flavors := range c.UsedResources {
 		flavorsCopy := make(map[string]int64, len(flavors))
diff --git a/pkg/controller/core/clusterqueue_controller.go b/pkg/controller/core/clusterqueue_controller.go
index cd316d2ad..45c4d9c4f 100644
--- a/pkg/controller/core/clusterqueue_controller.go
+++ b/pkg/controller/core/clusterqueue_controller.go
@@ -107,6 +107,7 @@ func (r *ClusterQueueReconciler) Create(e event.CreateEvent) bool {
 	if err := r.cache.AddClusterQueue(ctx, cq); err != nil {
 		log.Error(err, "Failed to add clusterQueue to cache")
 	}
+
 	if err := r.qManager.AddClusterQueue(ctx, cq); err != nil {
 		log.Error(err, "Failed to add clusterQueue to queue manager")
 	}
@@ -133,6 +134,7 @@ func (r *ClusterQueueReconciler) Update(e event.UpdateEvent) bool {
 	}
 	log := r.log.WithValues("clusterQueue", klog.KObj(cq))
 	log.V(2).Info("ClusterQueue update event")
+
 	if err := r.cache.UpdateClusterQueue(cq); err != nil {
 		log.Error(err, "Failed to update clusterQueue in cache")
 	}
diff --git a/pkg/controller/core/core.go b/pkg/controller/core/core.go
index 617766dfd..edb2aa5b9 100644
--- a/pkg/controller/core/core.go
+++ b/pkg/controller/core/core.go
@@ -37,7 +37,7 @@ func SetupControllers(mgr ctrl.Manager, qManager *queue.Manager, cc *cache.Cache
 	if err := NewWorkloadReconciler(mgr.GetClient(), qManager, cc, qRec, cqRec).SetupWithManager(mgr); err != nil {
 		return "Workload", err
 	}
-	if err := NewResourceFlavorReconciler(cc).SetupWithManager(mgr); err != nil {
+	if err := NewResourceFlavorReconciler(qManager, cc).SetupWithManager(mgr); err != nil {
 		return "ResourceFlavor", err
 	}
 	return "", nil
diff --git a/pkg/controller/core/resourceflavor_controller.go b/pkg/controller/core/resourceflavor_controller.go
index 8fb51ab35..402918c53 100644
--- a/pkg/controller/core/resourceflavor_controller.go
+++ b/pkg/controller/core/resourceflavor_controller.go
@@ -26,18 +26,21 @@ import (
 
 	kueue "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
 	"sigs.k8s.io/kueue/pkg/cache"
+	"sigs.k8s.io/kueue/pkg/queue"
 )
 
 // ResourceFlavorReconciler reconciles a ResourceFlavor object
 type ResourceFlavorReconciler struct {
-	log   logr.Logger
-	cache *cache.Cache
+	log      logr.Logger
+	qManager *queue.Manager
+	cache    *cache.Cache
 }
 
-func NewResourceFlavorReconciler(cache *cache.Cache) *ResourceFlavorReconciler {
+func NewResourceFlavorReconciler(qMgr *queue.Manager, cache *cache.Cache) *ResourceFlavorReconciler {
 	return &ResourceFlavorReconciler{
-		log:   ctrl.Log.WithName("resourceflavor-reconciler"),
-		cache: cache,
+		log:      ctrl.Log.WithName("resourceflavor-reconciler"),
+		cache:    cache,
+		qManager: qMgr,
 	}
 }
 
@@ -53,9 +56,15 @@ func (r *ResourceFlavorReconciler) Create(e event.CreateEvent) bool {
 	if !match {
 		return false
 	}
+
 	log := r.log.WithValues("resourceFlavor", klog.KObj(flv))
 	log.V(2).Info("ResourceFlavor create event")
-	r.cache.AddOrUpdateResourceFlavor(flv.DeepCopy())
+
+	// As long as one clusterQueue becomes active,
+	// we should inform clusterQueue controller to broadcast the event.
+	if cqNames := r.cache.AddOrUpdateResourceFlavor(flv.DeepCopy()); len(cqNames) > 0 {
+		r.qManager.QueueInadmissibleWorkloads(cqNames)
+	}
 	return false
 }
 
@@ -64,9 +73,13 @@ func (r *ResourceFlavorReconciler) Delete(e event.DeleteEvent) bool {
 	if !match {
 		return false
 	}
+
 	log := r.log.WithValues("resourceFlavor", klog.KObj(flv))
 	log.V(2).Info("ResourceFlavor delete event")
-	r.cache.DeleteResourceFlavor(flv)
+
+	if cqNames := r.cache.DeleteResourceFlavor(flv); len(cqNames) > 0 {
+		r.qManager.QueueInadmissibleWorkloads(cqNames)
+	}
 	return false
 }
 
@@ -75,9 +88,13 @@ func (r *ResourceFlavorReconciler) Update(e event.UpdateEvent) bool {
 	if !match {
 		return false
 	}
+
 	log := r.log.WithValues("resourceFlavor", klog.KObj(flv))
 	log.V(2).Info("ResourceFlavor update event")
-	r.cache.AddOrUpdateResourceFlavor(flv.DeepCopy())
+
+	if cqNames := r.cache.AddOrUpdateResourceFlavor(flv.DeepCopy()); len(cqNames) > 0 {
+		r.qManager.QueueInadmissibleWorkloads(cqNames)
+	}
 	return false
 }
 
diff --git a/pkg/controller/core/workload_controller.go b/pkg/controller/core/workload_controller.go
index 71ac5e97d..6f71e54ad 100644
--- a/pkg/controller/core/workload_controller.go
+++ b/pkg/controller/core/workload_controller.go
@@ -94,6 +94,12 @@ func (r *WorkloadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
 		return ctrl.Result{}, client.IgnoreNotFound(err)
 	}
 
+	if status == pending && !r.cache.ClusterQueueActive(cqName) {
+		err := workload.UpdateStatusIfChanged(ctx, r.client, &wl, kueue.WorkloadAdmitted, corev1.ConditionFalse,
+			"Inadmissible", fmt.Sprintf("ClusterQueue %s is inactive", cqName))
+		return ctrl.Result{}, client.IgnoreNotFound(err)
+	}
+
 	if status == admitted {
 		err := workload.UpdateStatusIfChanged(ctx, r.client, &wl, kueue.WorkloadAdmitted, corev1.ConditionTrue, "", "")
 		return ctrl.Result{}, client.IgnoreNotFound(err)
diff --git a/pkg/queue/manager.go b/pkg/queue/manager.go
index f0c07db88..8f065814e 100644
--- a/pkg/queue/manager.go
+++ b/pkg/queue/manager.go
@@ -77,7 +77,6 @@ func (m *Manager) AddClusterQueue(ctx context.Context, cq *kueue.ClusterQueue) e
 	if err != nil {
 		return err
 	}
-
 	m.clusterQueues[cq.Name] = cqImpl
 
 	cohort := cq.Spec.Cohort
@@ -106,7 +105,7 @@ func (m *Manager) AddClusterQueue(ctx context.Context, cq *kueue.ClusterQueue) e
 
 	queued := m.queueAllInadmissibleWorkloadsInCohort(cqImpl)
 	if queued || addedWorkloads {
-		m.cond.Broadcast()
+		m.Broadcast()
 	}
 	return nil
 }
@@ -118,8 +117,8 @@ func (m *Manager) UpdateClusterQueue(cq *kueue.ClusterQueue) error {
 	if !ok {
 		return errClusterQueueDoesNotExist
 	}
-	oldCohort := cqImpl.Cohort()
 
+	oldCohort := cqImpl.Cohort()
 	// TODO(#8): recreate heap based on a change of queueing policy.
 	cqImpl.Update(cq)
 	newCohort := cqImpl.Cohort()
@@ -129,7 +128,7 @@ func (m *Manager) UpdateClusterQueue(cq *kueue.ClusterQueue) error {
 
 	// TODO(#8): Selectively move workloads based on the exact event.
 	if m.queueAllInadmissibleWorkloadsInCohort(cqImpl) {
-		m.cond.Broadcast()
+		m.Broadcast()
 	}
 
 	return nil
@@ -145,9 +144,7 @@ func (m *Manager) DeleteClusterQueue(cq *kueue.ClusterQueue) {
 	delete(m.clusterQueues, cq.Name)
 
 	cohort := cq.Spec.Cohort
-	if cohort != "" {
-		m.deleteCohort(cohort, cq.Name)
-	}
+	m.deleteCohort(cohort, cq.Name)
 }
 
 func (m *Manager) AddQueue(ctx context.Context, q *kueue.Queue) error {
@@ -176,7 +173,7 @@ func (m *Manager) AddQueue(ctx context.Context, q *kueue.Queue) error {
 	}
 	cq := m.clusterQueues[qImpl.ClusterQueue]
 	if cq != nil && cq.AddFromQueue(qImpl) {
-		m.cond.Broadcast()
+		m.Broadcast()
 	}
 	qImpl.reportPendingWorkloads()
 	return nil
@@ -197,7 +194,7 @@ func (m *Manager) UpdateQueue(q *kueue.Queue) error {
 		}
 		newCQ := m.clusterQueues[string(q.Spec.ClusterQueue)]
 		if newCQ != nil && newCQ.AddFromQueue(qImpl) {
-			m.cond.Broadcast()
+			m.Broadcast()
 		}
 	}
 	qImpl.update(q)
@@ -282,7 +279,7 @@ func (m *Manager) addOrUpdateWorkload(w *kueue.Workload) bool {
 		return false
 	}
 	cq.PushOrUpdate(w)
-	m.cond.Broadcast()
+	m.Broadcast()
 	return true
 }
 
@@ -293,30 +290,28 @@ func (m *Manager) RequeueWorkload(ctx context.Context, info *workload.Info, imme
 	m.Lock()
 	defer m.Unlock()
 
+	q := m.queues[queueKeyForWorkload(info.Obj)]
+	if q == nil {
+		return false
+	}
+
 	var w kueue.Workload
-	// Always get the newest workload to avoid requeuing the out-of-date obj.
 	err := m.client.Get(ctx, client.ObjectKeyFromObject(info.Obj), &w)
 	// Since the client is cached, the only possible error is NotFound
 	if apierrors.IsNotFound(err) || w.Spec.Admission != nil {
 		return false
 	}
 
-	q := m.queues[queueKeyForWorkload(&w)]
-	if q == nil {
-		return false
-	}
-	q.AddOrUpdate(&w)
+	q.AddIfNotPresent(info)
 	q.reportPendingWorkloads()
 	cq := m.clusterQueues[q.ClusterQueue]
 	if cq == nil {
 		return false
 	}
 
-	// TODO(#162) Update the info object instead of constructing one.
-	info = workload.NewInfo(&w)
 	added := cq.RequeueIfNotPresent(info, immediate)
 	if added {
-		m.cond.Broadcast()
+		m.Broadcast()
 	}
 	return added
 }
@@ -358,7 +353,33 @@ func (m *Manager) QueueAssociatedInadmissibleWorkloads(w *kueue.Workload) {
 	}
 
 	if m.queueAllInadmissibleWorkloadsInCohort(cq) {
-		m.cond.Broadcast()
+		m.Broadcast()
+	}
+}
+
+// QueueInadmissibleWorkloads moves all inadmissibleWorkloads in
+// corresponding ClusterQueues to heap. If at least one workload queued,
+// we will broadcast the event.
+func (m *Manager) QueueInadmissibleWorkloads(cqNames sets.String) {
+	m.Lock()
+	defer m.Unlock()
+	if len(cqNames) == 0 {
+		return
+	}
+
+	var queued bool
+	for name := range cqNames {
+		cq, exists := m.clusterQueues[name]
+		if !exists {
+			continue
+		}
+		if m.queueAllInadmissibleWorkloadsInCohort(cq) {
+			queued = true
+		}
+	}
+
+	if queued {
+		m.Broadcast()
 	}
 }
 
@@ -403,7 +424,7 @@ func (m *Manager) UpdateWorkload(oldW, w *kueue.Workload) bool {
 // Heads.
 func (m *Manager) CleanUpOnContext(ctx context.Context) {
 	<-ctx.Done()
-	m.cond.Broadcast()
+	m.Broadcast()
 }
 
 // Heads returns the heads of the queues, along with their associated ClusterQueue.
@@ -472,6 +493,9 @@ func (m *Manager) addCohort(cohort string, cqName string) {
 }
 
 func (m *Manager) deleteCohort(cohort string, cqName string) {
+	if cohort == "" {
+		return
+	}
 	if m.cohorts[cohort] != nil {
 		m.cohorts[cohort].Delete(cqName)
 		if len(m.cohorts[cohort]) == 0 {
@@ -485,6 +509,10 @@ func (m *Manager) updateCohort(oldCohort string, newCohort string, cqName string
 	m.addCohort(newCohort, cqName)
 }
 
+func (m *Manager) Broadcast() {
+	m.cond.Broadcast()
+}
+
 func SetupIndexes(indexer client.FieldIndexer) error {
 	err := indexer.IndexField(context.Background(), &kueue.Workload{}, workloadQueueKey, func(o client.Object) []string {
 		wl := o.(*kueue.Workload)
diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go
index 96933c2c4..fab6b3d43 100644
--- a/pkg/scheduler/scheduler.go
+++ b/pkg/scheduler/scheduler.go
@@ -181,8 +181,10 @@ func (s *Scheduler) nominate(ctx context.Context, workloads []workload.Info, sna
 		cq := snap.ClusterQueues[w.ClusterQueue]
 		ns := corev1.Namespace{}
 		e := entry{Info: w}
-		if cq == nil {
-			e.inadmissibleReason = "ClusterQueue not found"
+		if snap.InactiveClusterQueueSets.Has(w.ClusterQueue) {
+			e.inadmissibleReason = fmt.Sprintf("ClusterQueue %s is inactive", w.ClusterQueue)
+		} else if cq == nil {
+			e.inadmissibleReason = fmt.Sprintf("ClusterQueue %s not found", w.ClusterQueue)
 		} else if err := s.client.Get(ctx, types.NamespacedName{Name: w.Obj.Namespace}, &ns); err != nil {
 			e.inadmissibleReason = fmt.Sprintf("Could not obtain workload namespace: %v", err)
 		} else if !cq.NamespaceSelector.Matches(labels.Set(ns.Labels)) {
@@ -488,7 +490,7 @@ func (e entryOrdering) Less(i, j int) bool {
 
 func (s *Scheduler) requeueAndUpdate(log logr.Logger, ctx context.Context, e entry) {
 	added := s.queues.RequeueWorkload(ctx, &e.Info, e.status != "")
-	log.V(2).Info("Workload re-queued", "workload", klog.KObj(e.Obj), "queue", klog.KRef(e.Obj.Namespace, e.Obj.Spec.QueueName), "added", added, "status", e.status)
+	log.V(2).Info("Workload re-queued", "workload", klog.KObj(e.Obj), "clusterQueue", e.ClusterQueue, "queue", klog.KRef(e.Obj.Namespace, e.Obj.Spec.QueueName), "added", added, "status", e.status)
 
 	if e.status == "" {
 		err := workload.UpdateStatus(ctx, s.client, e.Obj, kueue.WorkloadAdmitted, corev1.ConditionFalse, "Pending", e.inadmissibleReason)


Test patch:
diff --git a/apis/kueue/v1alpha1/workload_webhook_test.go b/apis/kueue/v1alpha1/workload_webhook_test.go
deleted file mode 100644
index 61a0feaaa..000000000
--- a/apis/kueue/v1alpha1/workload_webhook_test.go
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-Copyright 2022 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package v1alpha1_test
-
-// Rename the package to avoid circular dependencies which is caused by "sigs.k8s.io/kueue/pkg/util/testing".
-// See also: https://github.com/golang/go/wiki/CodeReviewComments#import-dot
-
-import (
-	"testing"
-
-	"github.com/google/go-cmp/cmp"
-	"github.com/google/go-cmp/cmp/cmpopts"
-	corev1 "k8s.io/api/core/v1"
-	"k8s.io/apimachinery/pkg/util/validation/field"
-
-	. "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
-	testingutil "sigs.k8s.io/kueue/pkg/util/testing"
-)
-
-func TestValidateWorkload(t *testing.T) {
-	const (
-		objName = "name"
-		objNs   = "ns"
-	)
-	specField := field.NewPath("spec")
-	podSetsField := specField.Child("podSets")
-	testCases := map[string]struct {
-		workload *Workload
-		wantErr  field.ErrorList
-	}{
-		"should have at least one podSet": {
-			workload: testingutil.MakeWorkload(objName, objNs).PodSets(nil).Obj(),
-			wantErr: field.ErrorList{
-				field.Required(podSetsField, ""),
-			},
-		},
-		"count should be greater than 0": {
-			workload: testingutil.MakeWorkload(objName, objNs).PodSets([]PodSet{
-				{
-					Name:  "main",
-					Count: -1,
-					Spec: corev1.PodSpec{
-						Containers: []corev1.Container{
-							{
-								Name: "c",
-								Resources: corev1.ResourceRequirements{
-									Requests: make(corev1.ResourceList),
-								},
-							},
-						},
-					},
-				},
-			}).Obj(),
-			wantErr: field.ErrorList{
-				field.Invalid(podSetsField.Index(0).Child("count"), int32(-1), ""),
-			},
-		},
-		"should have valid priorityClassName": {
-			workload: testingutil.MakeWorkload(objName, objNs).PriorityClass("invalid_class").Obj(),
-			wantErr: field.ErrorList{
-				field.Invalid(specField.Child("priorityClassName"), "invalid_class", ""),
-			},
-		},
-	}
-	for name, tc := range testCases {
-		t.Run(name, func(t *testing.T) {
-			errList := ValidateWorkload(tc.workload)
-			if len(errList) != 1 {
-				t.Errorf("Unexpected error: %v, want %v", errList, tc.wantErr)
-			}
-			if diff := cmp.Diff(tc.wantErr[0], errList[0], cmpopts.IgnoreFields(field.Error{}, "Detail")); diff != "" {
-				t.Errorf("ValidateWorkload() mismatch (-want +got):\n%s", diff)
-			}
-		})
-	}
-}
diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go
index 470e77d46..6b906bb03 100644
--- a/pkg/cache/cache_test.go
+++ b/pkg/cache/cache_test.go
@@ -81,6 +81,23 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 		{
 			ObjectMeta: metav1.ObjectMeta{Name: "d"},
 		},
+		{
+			ObjectMeta: metav1.ObjectMeta{Name: "e"},
+			Spec: kueue.ClusterQueueSpec{
+				Resources: []kueue.Resource{
+					{
+						Name: corev1.ResourceCPU,
+						Flavors: []kueue.Flavor{{
+							Name: "nonexistent-flavor",
+							Quota: kueue.Quota{
+								Min: resource.MustParse("15"),
+							},
+						}},
+					},
+				},
+				Cohort: "two",
+			},
+		},
 	}
 	setup := func(cache *Cache) {
 		cache.AddOrUpdateResourceFlavor(&kueue.ResourceFlavor{
@@ -117,6 +134,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					NamespaceSelector: labels.Nothing(),
 					LabelKeys:         map[corev1.ResourceName]sets.String{corev1.ResourceCPU: sets.NewString("cpuType")},
 					UsedResources:     Resources{corev1.ResourceCPU: {"default": 0}},
+					Status:            Active,
 				},
 				"b": {
 					Name: "b",
@@ -126,23 +144,36 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					NamespaceSelector: labels.Nothing(),
 					UsedResources:     Resources{corev1.ResourceCPU: {"default": 0}},
 					LabelKeys:         map[corev1.ResourceName]sets.String{corev1.ResourceCPU: sets.NewString("cpuType")},
+					Status:            Active,
 				},
 				"c": {
 					Name:                 "c",
 					RequestableResources: map[corev1.ResourceName][]FlavorLimits{},
 					NamespaceSelector:    labels.Nothing(),
 					UsedResources:        Resources{},
+					Status:               Active,
 				},
 				"d": {
 					Name:                 "d",
 					RequestableResources: map[corev1.ResourceName][]FlavorLimits{},
 					NamespaceSelector:    labels.Nothing(),
 					UsedResources:        Resources{},
+					Status:               Active,
+				},
+				"e": {
+					Name: "e",
+					RequestableResources: map[corev1.ResourceName][]FlavorLimits{
+						corev1.ResourceCPU: {{Name: "nonexistent-flavor", Min: 15000}},
+					},
+					NamespaceSelector: labels.Nothing(),
+					UsedResources:     Resources{corev1.ResourceCPU: {"nonexistent-flavor": 0}},
+					LabelKeys:         nil,
+					Status:            Pending,
 				},
 			},
 			wantCohorts: map[string]sets.String{
 				"one": sets.NewString("a", "b"),
-				"two": sets.NewString("c"),
+				"two": sets.NewString("c", "e"),
 			},
 		},
 		{
@@ -167,6 +198,7 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					NamespaceSelector: labels.Nothing(),
 					LabelKeys:         map[corev1.ResourceName]sets.String{corev1.ResourceCPU: sets.NewString("cpuType")},
 					UsedResources:     Resources{corev1.ResourceCPU: {"default": 0}},
+					Status:            Active,
 				},
 				"b": {
 					Name: "b",
@@ -176,23 +208,36 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					NamespaceSelector: labels.Nothing(),
 					UsedResources:     Resources{corev1.ResourceCPU: {"default": 0}},
 					LabelKeys:         map[corev1.ResourceName]sets.String{corev1.ResourceCPU: sets.NewString("cpuType")},
+					Status:            Active,
 				},
 				"c": {
 					Name:                 "c",
 					RequestableResources: map[corev1.ResourceName][]FlavorLimits{},
 					NamespaceSelector:    labels.Nothing(),
 					UsedResources:        Resources{},
+					Status:               Active,
 				},
 				"d": {
 					Name:                 "d",
 					RequestableResources: map[corev1.ResourceName][]FlavorLimits{},
 					NamespaceSelector:    labels.Nothing(),
 					UsedResources:        Resources{},
+					Status:               Active,
+				},
+				"e": {
+					Name: "e",
+					RequestableResources: map[corev1.ResourceName][]FlavorLimits{
+						corev1.ResourceCPU: {{Name: "nonexistent-flavor", Min: 15000}},
+					},
+					NamespaceSelector: labels.Nothing(),
+					UsedResources:     Resources{corev1.ResourceCPU: {"nonexistent-flavor": 0}},
+					LabelKeys:         nil,
+					Status:            Pending,
 				},
 			},
 			wantCohorts: map[string]sets.String{
 				"one": sets.NewString("a", "b"),
-				"two": sets.NewString("c"),
+				"two": sets.NewString("c", "e"),
 			},
 		},
 		{
@@ -227,6 +272,25 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 							NamespaceSelector: &metav1.LabelSelector{}, // everything
 						},
 					},
+					{
+						ObjectMeta: metav1.ObjectMeta{Name: "e"},
+						Spec: kueue.ClusterQueueSpec{
+							Resources: []kueue.Resource{
+								{
+									Name: corev1.ResourceCPU,
+									Flavors: []kueue.Flavor{
+										{
+											Name: "default",
+											Quota: kueue.Quota{
+												Min: resource.MustParse("5"),
+												Max: pointer.Quantity(resource.MustParse("10")),
+											},
+										},
+									},
+								}},
+							Cohort: "two",
+						},
+					},
 				}
 				for _, c := range clusterQueues {
 					if err := cache.UpdateClusterQueue(&c); err != nil {
@@ -247,29 +311,43 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					NamespaceSelector: labels.Nothing(),
 					LabelKeys:         map[corev1.ResourceName]sets.String{corev1.ResourceCPU: sets.NewString("cpuType", "region")},
 					UsedResources:     Resources{corev1.ResourceCPU: {"default": 0}},
+					Status:            Active,
 				},
 				"b": {
 					Name:                 "b",
 					RequestableResources: map[corev1.ResourceName][]FlavorLimits{},
 					NamespaceSelector:    labels.Everything(),
 					UsedResources:        Resources{},
+					Status:               Active,
 				},
 				"c": {
 					Name:                 "c",
 					RequestableResources: map[corev1.ResourceName][]FlavorLimits{},
 					NamespaceSelector:    labels.Nothing(),
 					UsedResources:        Resources{},
+					Status:               Active,
 				},
 				"d": {
 					Name:                 "d",
 					RequestableResources: map[corev1.ResourceName][]FlavorLimits{},
 					NamespaceSelector:    labels.Nothing(),
 					UsedResources:        Resources{},
+					Status:               Active,
+				},
+				"e": {
+					Name: "e",
+					RequestableResources: map[corev1.ResourceName][]FlavorLimits{
+						corev1.ResourceCPU: {{Name: "default", Min: 5000, Max: pointer.Int64(10000)}},
+					},
+					NamespaceSelector: labels.Nothing(),
+					UsedResources:     Resources{corev1.ResourceCPU: {"default": 0}},
+					LabelKeys:         map[corev1.ResourceName]sets.String{corev1.ResourceCPU: sets.NewString("cpuType", "region")},
+					Status:            Active,
 				},
 			},
 			wantCohorts: map[string]sets.String{
 				"one": sets.NewString("b"),
-				"two": sets.NewString("a", "c"),
+				"two": sets.NewString("a", "c", "e"),
 			},
 		},
 		{
@@ -293,17 +371,88 @@ func TestCacheClusterQueueOperations(t *testing.T) {
 					NamespaceSelector: labels.Nothing(),
 					UsedResources:     Resources{corev1.ResourceCPU: {"default": 0}},
 					LabelKeys:         map[corev1.ResourceName]sets.String{corev1.ResourceCPU: sets.NewString("cpuType")},
+					Status:            Active,
 				},
 				"c": {
 					Name:                 "c",
 					RequestableResources: map[corev1.ResourceName][]FlavorLimits{},
 					NamespaceSelector:    labels.Nothing(),
 					UsedResources:        Resources{},
+					Status:               Active,
+				},
+				"e": {
+					Name: "e",
+					RequestableResources: map[corev1.ResourceName][]FlavorLimits{
+						corev1.ResourceCPU: {{Name: "nonexistent-flavor", Min: 15000}},
+					},
+					NamespaceSelector: labels.Nothing(),
+					UsedResources:     Resources{corev1.ResourceCPU: {"nonexistent-flavor": 0}},
+					LabelKeys:         nil,
+					Status:            Pending,
 				},
 			},
 			wantCohorts: map[string]sets.String{
 				"one": sets.NewString("b"),
-				"two": sets.NewString("c"),
+				"two": sets.NewString("c", "e"),
+			},
+		},
+		{
+			name: "add resource flavors",
+			operation: func(cache *Cache) {
+				setup(cache)
+				cache.AddOrUpdateResourceFlavor(&kueue.ResourceFlavor{
+					ObjectMeta: metav1.ObjectMeta{Name: "nonexistent-flavor"},
+				})
+			},
+			wantClusterQueues: map[string]*ClusterQueue{
+				"a": {
+					Name: "a",
+					RequestableResources: map[corev1.ResourceName][]FlavorLimits{
+						corev1.ResourceCPU: {{Name: "default", Min: 10000, Max: pointer.Int64(20000)}},
+					},
+					NamespaceSelector: labels.Nothing(),
+					LabelKeys:         map[corev1.ResourceName]sets.String{corev1.ResourceCPU: sets.NewString("cpuType")},
+					UsedResources:     Resources{corev1.ResourceCPU: {"default": 0}},
+					Status:            Active,
+				},
+				"b": {
+					Name: "b",
+					RequestableResources: map[corev1.ResourceName][]FlavorLimits{
+						corev1.ResourceCPU: {{Name: "default", Min: 15000}},
+					},
+					NamespaceSelector: labels.Nothing(),
+					UsedResources:     Resources{corev1.ResourceCPU: {"default": 0}},
+					LabelKeys:         map[corev1.ResourceName]sets.String{corev1.ResourceCPU: sets.NewString("cpuType")},
+					Status:            Active,
+				},
+				"c": {
+					Name:                 "c",
+					RequestableResources: map[corev1.ResourceName][]FlavorLimits{},
+					NamespaceSelector:    labels.Nothing(),
+					UsedResources:        Resources{},
+					Status:               Active,
+				},
+				"d": {
+					Name:                 "d",
+					RequestableResources: map[corev1.ResourceName][]FlavorLimits{},
+					NamespaceSelector:    labels.Nothing(),
+					UsedResources:        Resources{},
+					Status:               Active,
+				},
+				"e": {
+					Name: "e",
+					RequestableResources: map[corev1.ResourceName][]FlavorLimits{
+						corev1.ResourceCPU: {{Name: "nonexistent-flavor", Min: 15000}},
+					},
+					NamespaceSelector: labels.Nothing(),
+					UsedResources:     Resources{corev1.ResourceCPU: {"nonexistent-flavor": 0}},
+					LabelKeys:         nil,
+					Status:            Active,
+				},
+			},
+			wantCohorts: map[string]sets.String{
+				"one": sets.NewString("a", "b"),
+				"two": sets.NewString("c", "e"),
 			},
 		},
 	}
diff --git a/pkg/cache/snapshot_test.go b/pkg/cache/snapshot_test.go
index a590ff764..0e1234d1c 100644
--- a/pkg/cache/snapshot_test.go
+++ b/pkg/cache/snapshot_test.go
@@ -101,6 +101,27 @@ func TestSnapshot(t *testing.T) {
 				},
 			},
 		},
+		{
+			ObjectMeta: metav1.ObjectMeta{
+				Name: "flavor-nonexistent-cq",
+			},
+			Spec: kueue.ClusterQueueSpec{
+				Cohort: "foo",
+				Resources: []kueue.Resource{
+					{
+						Name: corev1.ResourceCPU,
+						Flavors: []kueue.Flavor{
+							{
+								Name: "nonexistent-flavor",
+								Quota: kueue.Quota{
+									Min: resource.MustParse("100"),
+								},
+							},
+						},
+					},
+				},
+			},
+		},
 		{
 			ObjectMeta: metav1.ObjectMeta{
 				Name: "bar",
@@ -138,7 +159,12 @@ func TestSnapshot(t *testing.T) {
 			ObjectMeta: metav1.ObjectMeta{Name: "spot"},
 			Labels:     map[string]string{"baz": "bar", "instance": "spot"},
 		},
+		{
+			ObjectMeta: metav1.ObjectMeta{Name: "default"},
+			Labels:     nil,
+		},
 	}
+
 	for i := range flavors {
 		cache.AddOrUpdateResourceFlavor(&flavors[i])
 	}
@@ -222,31 +248,44 @@ func TestSnapshot(t *testing.T) {
 				},
 			},
 		},
+		{
+			ObjectMeta: metav1.ObjectMeta{Name: "sigma"},
+			Spec: kueue.WorkloadSpec{
+				PodSets: []kueue.PodSet{
+					{
+						Name:  "main",
+						Count: 5,
+						Spec: utiltesting.PodSpecForRequest(map[corev1.ResourceName]string{
+							corev1.ResourceCPU: "1",
+						}),
+					},
+				},
+				Admission: nil,
+			},
+		},
 	}
 	for _, w := range workloads {
 		cache.AddOrUpdateWorkload(w.DeepCopy())
 	}
 	snapshot := cache.Snapshot()
-	wantCohorts := []Cohort{
-		{
-			Name: "foo",
-			RequestableResources: Resources{
-				corev1.ResourceCPU: map[string]int64{
-					"demand": 100_000,
-					"spot":   300_000,
-				},
-				"example.com/gpu": map[string]int64{
-					"default": 50,
-				},
+	wantCohort := Cohort{
+		Name: "foo",
+		RequestableResources: Resources{
+			corev1.ResourceCPU: map[string]int64{
+				"demand": 100_000,
+				"spot":   300_000,
 			},
-			UsedResources: Resources{
-				corev1.ResourceCPU: map[string]int64{
-					"demand": 10_000,
-					"spot":   10_000,
-				},
-				"example.com/gpu": map[string]int64{
-					"default": 15,
-				},
+			"example.com/gpu": map[string]int64{
+				"default": 50,
+			},
+		},
+		UsedResources: Resources{
+			corev1.ResourceCPU: map[string]int64{
+				"demand": 10_000,
+				"spot":   10_000,
+			},
+			"example.com/gpu": map[string]int64{
+				"default": 15,
 			},
 		},
 	}
@@ -254,7 +293,7 @@ func TestSnapshot(t *testing.T) {
 		ClusterQueues: map[string]*ClusterQueue{
 			"foofoo": {
 				Name:   "foofoo",
-				Cohort: &wantCohorts[0],
+				Cohort: &wantCohort,
 				RequestableResources: map[corev1.ResourceName][]FlavorLimits{
 					corev1.ResourceCPU: {
 						{
@@ -278,10 +317,11 @@ func TestSnapshot(t *testing.T) {
 				},
 				LabelKeys:         map[corev1.ResourceName]sets.String{corev1.ResourceCPU: {"baz": {}, "foo": {}, "instance": {}}},
 				NamespaceSelector: labels.Nothing(),
+				Status:            Active,
 			},
 			"foobar": {
 				Name:   "foobar",
-				Cohort: &wantCohorts[0],
+				Cohort: &wantCohort,
 				RequestableResources: map[corev1.ResourceName][]FlavorLimits{
 					corev1.ResourceCPU: {
 						{
@@ -310,6 +350,7 @@ func TestSnapshot(t *testing.T) {
 				},
 				NamespaceSelector: labels.Nothing(),
 				LabelKeys:         map[corev1.ResourceName]sets.String{corev1.ResourceCPU: {"baz": {}, "instance": {}}},
+				Status:            Active,
 			},
 			"bar": {
 				Name: "bar",
@@ -326,9 +367,14 @@ func TestSnapshot(t *testing.T) {
 				},
 				Workloads:         map[string]*workload.Info{},
 				NamespaceSelector: labels.Nothing(),
+				Status:            Active,
 			},
 		},
 		ResourceFlavors: map[string]*kueue.ResourceFlavor{
+			"default": {
+				ObjectMeta: metav1.ObjectMeta{Name: "default"},
+				Labels:     nil,
+			},
 			"demand": {
 				ObjectMeta: metav1.ObjectMeta{Name: "demand"},
 				Labels:     map[string]string{"foo": "bar", "instance": "demand"},
@@ -338,6 +384,7 @@ func TestSnapshot(t *testing.T) {
 				Labels:     map[string]string{"baz": "bar", "instance": "spot"},
 			},
 		},
+		InactiveClusterQueueSets: sets.String{"flavor-nonexistent-cq": {}},
 	}
 	if diff := cmp.Diff(wantSnapshot, snapshot, cmpopts.IgnoreUnexported(Cohort{})); diff != "" {
 		t.Errorf("Unexpected Snapshot (-want,+got):\n%s", diff)
diff --git a/pkg/queue/manager_test.go b/pkg/queue/manager_test.go
index acb4c4bfb..26bc385ed 100644
--- a/pkg/queue/manager_test.go
+++ b/pkg/queue/manager_test.go
@@ -23,7 +23,6 @@ import (
 	"time"
 
 	"github.com/google/go-cmp/cmp"
-	"github.com/google/go-cmp/cmp/cmpopts"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 	"k8s.io/apimachinery/pkg/util/sets"
@@ -701,8 +700,6 @@ func TestHeads(t *testing.T) {
 	}
 }
 
-var ignoreTypeMeta = cmpopts.IgnoreTypes(metav1.TypeMeta{})
-
 // TestHeadAsync ensures that Heads call is blocked until the queues are filled
 // asynchronously.
 func TestHeadsAsync(t *testing.T) {
@@ -711,10 +708,7 @@ func TestHeadsAsync(t *testing.T) {
 		t.Fatalf("Failed adding kueue scheme: %s", err)
 	}
 	now := time.Now().Truncate(time.Second)
-	clusterQueues := []*kueue.ClusterQueue{
-		utiltesting.MakeClusterQueue("fooCq").Obj(),
-		utiltesting.MakeClusterQueue("barCq").Obj(),
-	}
+	cq := utiltesting.MakeClusterQueue("fooCq").Obj()
 	wl := kueue.Workload{
 		ObjectMeta: metav1.ObjectMeta{
 			Name:              "a",
@@ -722,90 +716,68 @@ func TestHeadsAsync(t *testing.T) {
 		},
 		Spec: kueue.WorkloadSpec{QueueName: "foo"},
 	}
-	var newWl kueue.Workload
-	queues := []kueue.Queue{
-		{
-			ObjectMeta: metav1.ObjectMeta{Name: "foo"},
-			Spec: kueue.QueueSpec{
-				ClusterQueue: "fooCq",
-			},
+	q := kueue.Queue{
+		ObjectMeta: metav1.ObjectMeta{Name: "foo"},
+		Spec: kueue.QueueSpec{
+			ClusterQueue: "fooCq",
 		},
+	}
+	wantHeads := []workload.Info{
 		{
-			ObjectMeta: metav1.ObjectMeta{Name: "bar"},
-			Spec: kueue.QueueSpec{
-				ClusterQueue: "barCq",
-			},
+			Obj:          &wl,
+			ClusterQueue: "fooCq",
 		},
 	}
 	cases := map[string]struct {
 		initialObjs []client.Object
 		op          func(context.Context, *Manager)
-		wantHeads   []workload.Info
 	}{
 		"AddClusterQueue": {
-			initialObjs: []client.Object{&wl, &queues[0]},
+			initialObjs: []client.Object{&wl, &q},
 			op: func(ctx context.Context, mgr *Manager) {
-				if err := mgr.AddQueue(ctx, &queues[0]); err != nil {
+				if err := mgr.AddQueue(ctx, &q); err != nil {
 					t.Errorf("Failed adding queue: %s", err)
 				}
 				mgr.AddOrUpdateWorkload(&wl)
 				go func() {
-					if err := mgr.AddClusterQueue(ctx, clusterQueues[0]); err != nil {
+					if err := mgr.AddClusterQueue(ctx, cq); err != nil {
 						t.Errorf("Failed adding clusterQueue: %v", err)
 					}
 				}()
 			},
-			wantHeads: []workload.Info{
-				{
-					Obj:          &wl,
-					ClusterQueue: "fooCq",
-				},
-			},
 		},
 		"AddQueue": {
 			initialObjs: []client.Object{&wl},
 			op: func(ctx context.Context, mgr *Manager) {
-				if err := mgr.AddClusterQueue(ctx, clusterQueues[0]); err != nil {
+				if err := mgr.AddClusterQueue(ctx, cq); err != nil {
 					t.Errorf("Failed adding clusterQueue: %v", err)
 				}
 				go func() {
-					if err := mgr.AddQueue(ctx, &queues[0]); err != nil {
+					if err := mgr.AddQueue(ctx, &q); err != nil {
 						t.Errorf("Failed adding queue: %s", err)
 					}
 				}()
 			},
-			wantHeads: []workload.Info{
-				{
-					Obj:          &wl,
-					ClusterQueue: "fooCq",
-				},
-			},
 		},
 		"AddWorkload": {
 			op: func(ctx context.Context, mgr *Manager) {
-				if err := mgr.AddClusterQueue(ctx, clusterQueues[0]); err != nil {
+				if err := mgr.AddClusterQueue(ctx, cq); err != nil {
 					t.Errorf("Failed adding clusterQueue: %v", err)
 				}
-				if err := mgr.AddQueue(ctx, &queues[0]); err != nil {
+				if err := mgr.AddQueue(ctx, &q); err != nil {
 					t.Errorf("Failed adding queue: %s", err)
 				}
 				go func() {
 					mgr.AddOrUpdateWorkload(&wl)
 				}()
 			},
-			wantHeads: []workload.Info{
-				{
-					Obj:          &wl,
-					ClusterQueue: "fooCq",
-				},
-			},
 		},
 		"UpdateWorkload": {
 			op: func(ctx context.Context, mgr *Manager) {
-				if err := mgr.AddClusterQueue(ctx, clusterQueues[0]); err != nil {
+				if err := mgr.AddClusterQueue(ctx, cq); err != nil {
 					t.Errorf("Failed adding clusterQueue: %v", err)
 				}
-				if err := mgr.AddQueue(ctx, &queues[0]); err != nil {
+				if err := mgr.AddQueue(ctx, &q); err != nil {
 					t.Errorf("Failed adding queue: %s", err)
 				}
 				go func() {
@@ -814,20 +786,14 @@ func TestHeadsAsync(t *testing.T) {
 					mgr.UpdateWorkload(wlCopy, &wl)
 				}()
 			},
-			wantHeads: []workload.Info{
-				{
-					Obj:          &wl,
-					ClusterQueue: "fooCq",
-				},
-			},
 		},
 		"RequeueWorkload": {
 			initialObjs: []client.Object{&wl},
 			op: func(ctx context.Context, mgr *Manager) {
-				if err := mgr.AddClusterQueue(ctx, clusterQueues[0]); err != nil {
+				if err := mgr.AddClusterQueue(ctx, cq); err != nil {
 					t.Errorf("Failed adding clusterQueue: %v", err)
 				}
-				if err := mgr.AddQueue(ctx, &queues[0]); err != nil {
+				if err := mgr.AddQueue(ctx, &q); err != nil {
 					t.Errorf("Failed adding queue: %s", err)
 				}
 				// Remove the initial workload from the manager.
@@ -836,72 +802,6 @@ func TestHeadsAsync(t *testing.T) {
 					mgr.RequeueWorkload(ctx, workload.NewInfo(&wl), true)
 				}()
 			},
-			wantHeads: []workload.Info{
-				{
-					Obj:          &wl,
-					ClusterQueue: "fooCq",
-				},
-			},
-		},
-		"RequeueWithOutOfDateWorkload": {
-			initialObjs: []client.Object{&wl},
-			op: func(ctx context.Context, mgr *Manager) {
-				if err := mgr.AddClusterQueue(ctx, clusterQueues[0]); err != nil {
-					t.Errorf("Failed adding clusterQueue: %v", err)
-				}
-				if err := mgr.AddQueue(ctx, &queues[0]); err != nil {
-					t.Errorf("Failed adding queue: %s", err)
-				}
-
-				newWl = wl
-				newWl.Annotations = map[string]string{"foo": "bar"}
-				if err := mgr.client.Update(ctx, &newWl, &client.UpdateOptions{}); err != nil {
-					t.Errorf("Failed to update the workload; %s", err)
-				}
-				// Remove the initial workload from the manager.
-				mgr.Heads(ctx)
-				go func() {
-					mgr.RequeueWorkload(ctx, workload.NewInfo(&wl), true)
-				}()
-			},
-			wantHeads: []workload.Info{
-				{
-					Obj:          &newWl,
-					ClusterQueue: "fooCq",
-				},
-			},
-		},
-		"RequeueWithQueueChangedWorkload": {
-			initialObjs: []client.Object{&wl},
-			op: func(ctx context.Context, mgr *Manager) {
-				for _, cq := range clusterQueues {
-					if err := mgr.AddClusterQueue(ctx, cq); err != nil {
-						t.Errorf("Failed adding clusterQueue: %v", err)
-					}
-				}
-				for _, q := range queues {
-					if err := mgr.AddQueue(ctx, &q); err != nil {
-						t.Errorf("Failed adding queue: %s", err)
-					}
-				}
-
-				newWl = wl
-				newWl.Spec.QueueName = "bar"
-				if err := mgr.client.Update(ctx, &newWl, &client.UpdateOptions{}); err != nil {
-					t.Errorf("Failed to update the workload; %s", err)
-				}
-				// Remove the initial workload from the manager.
-				mgr.Heads(ctx)
-				go func() {
-					mgr.RequeueWorkload(ctx, workload.NewInfo(&wl), true)
-				}()
-			},
-			wantHeads: []workload.Info{
-				{
-					Obj:          &newWl,
-					ClusterQueue: "barCq",
-				},
-			},
 		},
 	}
 	for name, tc := range cases {
@@ -913,7 +813,7 @@ func TestHeadsAsync(t *testing.T) {
 			go manager.CleanUpOnContext(ctx)
 			tc.op(ctx, manager)
 			heads := manager.Heads(ctx)
-			if diff := cmp.Diff(tc.wantHeads, heads, ignoreTypeMeta); diff != "" {
+			if diff := cmp.Diff(wantHeads, heads); diff != "" {
 				t.Errorf("GetHeads returned wrong heads (-want,+got):\n%s", diff)
 			}
 		})
diff --git a/pkg/scheduler/scheduler_test.go b/pkg/scheduler/scheduler_test.go
index 0d7773eb0..886153cf5 100644
--- a/pkg/scheduler/scheduler_test.go
+++ b/pkg/scheduler/scheduler_test.go
@@ -175,6 +175,25 @@ func TestSchedule(t *testing.T) {
 				},
 			},
 		},
+		{
+			ObjectMeta: metav1.ObjectMeta{Name: "flavor-nonexistent-cq"},
+			Spec: kueue.ClusterQueueSpec{
+				QueueingStrategy: kueue.StrictFIFO,
+				Resources: []kueue.Resource{
+					{
+						Name: corev1.ResourceCPU,
+						Flavors: []kueue.Flavor{
+							{
+								Name: "nonexistent-flavor",
+								Quota: kueue.Quota{
+									Min: resource.MustParse("50"),
+								},
+							},
+						},
+					},
+				},
+			},
+		},
 	}
 	queues := []kueue.Queue{
 		{
@@ -213,6 +232,24 @@ func TestSchedule(t *testing.T) {
 				ClusterQueue: "eng-beta",
 			},
 		},
+		{
+			ObjectMeta: metav1.ObjectMeta{
+				Namespace: "sales",
+				Name:      "flavor-nonexistent-queue",
+			},
+			Spec: kueue.QueueSpec{
+				ClusterQueue: "flavor-nonexistent-cq",
+			},
+		},
+		{
+			ObjectMeta: metav1.ObjectMeta{
+				Namespace: "sales",
+				Name:      "cq-nonexistent-queue",
+			},
+			Spec: kueue.QueueSpec{
+				ClusterQueue: "nonexistent-cq",
+			},
+		},
 	}
 	cases := map[string]struct {
 		workloads []kueue.Workload
@@ -688,6 +725,53 @@ func TestSchedule(t *testing.T) {
 			},
 			wantScheduled: []string{"eng-alpha/new"},
 		},
+		"workload should not fit in nonexistent clusterQueue": {
+			workloads: []kueue.Workload{
+				{
+					ObjectMeta: metav1.ObjectMeta{
+						Namespace: "sales",
+						Name:      "foo",
+					},
+					Spec: kueue.WorkloadSpec{
+						QueueName: "cq-nonexistent-queue",
+						PodSets: []kueue.PodSet{
+							{
+								Name:  "one",
+								Count: 10,
+								Spec: utiltesting.PodSpecForRequest(map[corev1.ResourceName]string{
+									corev1.ResourceCPU: "1",
+								}),
+							},
+						},
+					},
+				},
+			},
+		},
+		"workload should not fit in flavor nonexistent clusterQueue": {
+			workloads: []kueue.Workload{
+				{
+					ObjectMeta: metav1.ObjectMeta{
+						Namespace: "sales",
+						Name:      "foo",
+					},
+					Spec: kueue.WorkloadSpec{
+						QueueName: "flavor-nonexistent-queue",
+						PodSets: []kueue.PodSet{
+							{
+								Name:  "one",
+								Count: 10,
+								Spec: utiltesting.PodSpecForRequest(map[corev1.ResourceName]string{
+									corev1.ResourceCPU: "1",
+								}),
+							},
+						},
+					},
+				},
+			},
+			wantLeft: map[string]sets.String{
+				"flavor-nonexistent-cq": sets.NewString("foo"),
+			},
+		},
 	}
 	for name, tc := range cases {
 		t.Run(name, func(t *testing.T) {
@@ -721,6 +805,9 @@ func TestSchedule(t *testing.T) {
 					t.Fatalf("Inserting queue %s/%s in manager: %v", q.Namespace, q.Name, err)
 				}
 			}
+			for i := range resourceFlavors {
+				cqCache.AddOrUpdateResourceFlavor(resourceFlavors[i])
+			}
 			for _, cq := range clusterQueues {
 				if err := cqCache.AddClusterQueue(ctx, &cq); err != nil {
 					t.Fatalf("Inserting clusterQueue %s in cache: %v", cq.Name, err)
@@ -729,9 +816,6 @@ func TestSchedule(t *testing.T) {
 					t.Fatalf("Inserting clusterQueue %s in manager: %v", cq.Name, err)
 				}
 			}
-			for i := range resourceFlavors {
-				cqCache.AddOrUpdateResourceFlavor(resourceFlavors[i])
-			}
 			workloadWatch, err := cl.Watch(ctx, &kueue.WorkloadList{})
 			if err != nil {
 				t.Fatalf("Failed setting up watch: %v", err)
@@ -915,6 +999,7 @@ func TestEntryAssignFlavors(t *testing.T) {
 					},
 				},
 			},
+			wantMsg: "insufficient quota for flavor default, 1000 more needed",
 		},
 		"multiple flavors, fits": {
 			wlPods: []kueue.PodSet{
@@ -970,6 +1055,7 @@ func TestEntryAssignFlavors(t *testing.T) {
 					},
 				},
 			},
+			wantMsg: "insufficient quota for flavor one, 2100 more needed, insufficient quota for flavor two, 100 more needed",
 		},
 		"multiple flavors, fits while skipping tainted flavor": {
 			wlPods: []kueue.PodSet{
@@ -1226,7 +1312,7 @@ func TestEntryAssignFlavors(t *testing.T) {
 				LabelKeys: map[corev1.ResourceName]sets.String{corev1.ResourceCPU: sets.NewString("cpuType")},
 			},
 			wantFits: false,
-			wantMsg:  "doesn't match with node affinity",
+			wantMsg:  "flavor one doesn't match with node affinity",
 		},
 		"multiple specs, fit different flavors": {
 			wlPods: []kueue.PodSet{
@@ -1359,6 +1445,7 @@ func TestEntryAssignFlavors(t *testing.T) {
 					},
 				},
 			},
+			wantMsg: "insufficient quota for flavor one, 1000 more needed after borrowing",
 		},
 		"past max": {
 			wlPods: []kueue.PodSet{
@@ -1392,6 +1479,7 @@ func TestEntryAssignFlavors(t *testing.T) {
 					},
 				},
 			},
+			wantMsg: "borrowing limit for flavor one exceeded",
 		},
 		"resource not listed in clusterQueue": {
 			wlPods: []kueue.PodSet{
@@ -1413,6 +1501,23 @@ func TestEntryAssignFlavors(t *testing.T) {
 			wantFits: false,
 			wantMsg:  "resource unavailable in ClusterQueue",
 		},
+		"flavor not found": {
+			wlPods: []kueue.PodSet{
+				{
+					Count: 1,
+					Name:  "main",
+					Spec: utiltesting.PodSpecForRequest(map[corev1.ResourceName]string{
+						corev1.ResourceCPU: "1",
+					}),
+				},
+			},
+			clusterQueue: cache.ClusterQueue{
+				RequestableResources: map[corev1.ResourceName][]cache.FlavorLimits{
+					corev1.ResourceCPU: {{Name: "nonexistent-flavor", Min: 1000}},
+				},
+			},
+			wantMsg: "flavor nonexistent-flavor not found",
+		},
 	}
 	for name, tc := range cases {
 		t.Run(name, func(t *testing.T) {
@@ -1426,13 +1531,13 @@ func TestEntryAssignFlavors(t *testing.T) {
 					},
 				}),
 			}
-			tc.clusterQueue.UpdateLabelKeys(resourceFlavors)
+			tc.clusterQueue.UpdateWithFlavors(resourceFlavors)
 			status := e.assignFlavors(log, resourceFlavors, &tc.clusterQueue)
 			if status.IsSuccess() != tc.wantFits {
 				t.Errorf("e.assignFlavors(_)=%t, want %t", status.IsSuccess(), tc.wantFits)
 			}
 			if !tc.wantFits {
-				if !strings.Contains(status.Message(), tc.wantMsg) {
+				if len(tc.wantMsg) == 0 || !strings.Contains(status.Message(), tc.wantMsg) {
 					t.Errorf("got msg %s, want msg containing %s", status.Message(), tc.wantMsg)
 				}
 			}
diff --git a/pkg/util/testing/wrappers.go b/pkg/util/testing/wrappers.go
index c401352fa..6df5edbe1 100644
--- a/pkg/util/testing/wrappers.go
+++ b/pkg/util/testing/wrappers.go
@@ -204,16 +204,6 @@ func (w *WorkloadWrapper) Priority(priority *int32) *WorkloadWrapper {
 	return w
 }
 
-func (w *WorkloadWrapper) PodSets(podSets []kueue.PodSet) *WorkloadWrapper {
-	w.Spec.PodSets = podSets
-	return w
-}
-
-func (w *WorkloadWrapper) Toleration(t corev1.Toleration) *WorkloadWrapper {
-	w.Spec.PodSets[0].Spec.Tolerations = append(w.Spec.PodSets[0].Spec.Tolerations, t)
-	return w
-}
-
 // AdmissionWrapper wraps an Admission
 type AdmissionWrapper struct{ kueue.Admission }
 
@@ -396,7 +386,7 @@ func MakeRuntimeClass(name, handler string) *RuntimeClassWrapper {
 	}}
 }
 
-// PodOverhead adds a Overhead to the RuntimeClass.
+// Overhead adds a Overhead to the RuntimeClass.
 func (rc *RuntimeClassWrapper) PodOverhead(resources corev1.ResourceList) *RuntimeClassWrapper {
 	rc.Overhead = &nodev1.Overhead{
 		PodFixed: resources,
diff --git a/test/integration/controller/core/workload_controller_test.go b/test/integration/controller/core/workload_controller_test.go
index 947ff9552..3b65bc5ff 100644
--- a/test/integration/controller/core/workload_controller_test.go
+++ b/test/integration/controller/core/workload_controller_test.go
@@ -112,6 +112,8 @@ var _ = ginkgo.Describe("Workload controller", func() {
 
 	ginkgo.When("the workload is admitted", func() {
 		ginkgo.BeforeEach(func() {
+			flavor := testing.MakeResourceFlavor(flavorOnDemand).Obj()
+			gomega.Expect(k8sClient.Create(ctx, flavor)).Should(gomega.Succeed())
 			clusterQueue = testing.MakeClusterQueue("cluster-queue").
 				Resource(testing.MakeResource(resourceGPU).
 					Flavor(testing.MakeFlavor(flavorOnDemand, "5").Max("10").Obj()).Obj()).
diff --git a/test/integration/framework/framework.go b/test/integration/framework/framework.go
index b6c89a072..ca5b40bbb 100644
--- a/test/integration/framework/framework.go
+++ b/test/integration/framework/framework.go
@@ -221,6 +221,26 @@ func ExpectWorkloadsToBePending(ctx context.Context, k8sClient client.Client, wl
 	}, Timeout, Interval).Should(gomega.Equal(len(wls)), "Not enough workloads are pending")
 }
 
+func ExpectWorkloadsToBeFrozen(ctx context.Context, k8sClient client.Client, cq string, wls ...*kueue.Workload) {
+	gomega.EventuallyWithOffset(1, func() int {
+		frozen := 0
+		var updatedWorkload kueue.Workload
+		for _, wl := range wls {
+			gomega.ExpectWithOffset(1, k8sClient.Get(ctx, client.ObjectKeyFromObject(wl), &updatedWorkload)).To(gomega.Succeed())
+			idx := workload.FindConditionIndex(&updatedWorkload.Status, kueue.WorkloadAdmitted)
+			if idx == -1 {
+				continue
+			}
+			msg := fmt.Sprintf("ClusterQueue %s is inactive", cq)
+			cond := updatedWorkload.Status.Conditions[idx]
+			if cond.Status == corev1.ConditionFalse && cond.Reason == "Inadmissible" && wl.Spec.Admission == nil && cond.Message == msg {
+				frozen++
+			}
+		}
+		return frozen
+	}, Timeout, Interval).Should(gomega.Equal(len(wls)), "Not enough workloads are frozen")
+}
+
 func ExpectPendingWorkloadsMetric(q *kueue.Queue, v int) {
 	metric := metrics.PendingWorkloads.WithLabelValues(string(q.Spec.ClusterQueue), queue.Key(q))
 	gomega.EventuallyWithOffset(1, func() int {
diff --git a/test/integration/scheduler/scheduler_test.go b/test/integration/scheduler/scheduler_test.go
index c4600dc30..bdd7ee289 100644
--- a/test/integration/scheduler/scheduler_test.go
+++ b/test/integration/scheduler/scheduler_test.go
@@ -166,35 +166,41 @@ var _ = ginkgo.Describe("Scheduler", func() {
 		framework.ExpectPendingWorkloadsMetric(prodQueue, 0)
 	})
 
-	ginkgo.It("Should schedule workloads on tolerated flavors", func() {
-		ginkgo.By("checking a workload without toleration starts on the non-tainted flavor")
-		wl1 := testing.MakeWorkload("on-demand-wl1", ns.Name).Queue(prodQueue.Name).Request(corev1.ResourceCPU, "5").Obj()
-		gomega.Expect(k8sClient.Create(ctx, wl1)).Should(gomega.Succeed())
-
-		expectAdmission := testing.MakeAdmission(prodClusterQ.Name).Flavor(corev1.ResourceCPU, onDemandFlavor.Name).Obj()
-		wlCopy := &kueue.Workload{}
-		gomega.Eventually(func() *kueue.Admission {
-			gomega.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(wl1), wlCopy)).To(gomega.Succeed())
-			return wlCopy.Spec.Admission
-		}, framework.Timeout, framework.Interval).Should(testing.Equal(expectAdmission))
+	ginkgo.It("Should schedule jobs on tolerated flavors", func() {
+		ginkgo.By("checking a job without toleration starts on the non-tainted flavor")
+		job1 := testing.MakeJob("on-demand-job1", ns.Name).Queue(prodQueue.Name).Request(corev1.ResourceCPU, "5").Obj()
+		gomega.Expect(k8sClient.Create(ctx, job1)).Should(gomega.Succeed())
+		createdJob1 := &batchv1.Job{}
+		gomega.Eventually(func() *bool {
+			lookupKey := types.NamespacedName{Name: job1.Name, Namespace: job1.Namespace}
+			gomega.Expect(k8sClient.Get(ctx, lookupKey, createdJob1)).Should(gomega.Succeed())
+			return createdJob1.Spec.Suspend
+		}, framework.Timeout, framework.Interval).Should(gomega.Equal(pointer.Bool(false)))
+		gomega.Expect(createdJob1.Spec.Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(onDemandFlavor.Name))
 		framework.ExpectPendingWorkloadsMetric(prodQueue, 0)
 
-		ginkgo.By("checking a second workload without toleration doesn't start")
-		wl2 := testing.MakeWorkload("on-demand-wl2", ns.Name).Queue(prodQueue.Name).Request(corev1.ResourceCPU, "5").Obj()
-		gomega.Expect(k8sClient.Create(ctx, wl2)).Should(gomega.Succeed())
-		framework.ExpectWorkloadsToBePending(ctx, k8sClient, wl2)
-		framework.ExpectPendingWorkloadsMetric(prodQueue, 1)
-
-		ginkgo.By("checking a third workload with toleration starts")
-		wl3 := testing.MakeWorkload("on-demand-wl3", ns.Name).Queue(prodQueue.Name).Toleration(spotToleration).Request(corev1.ResourceCPU, "5").Obj()
-		gomega.Expect(k8sClient.Create(ctx, wl3)).Should(gomega.Succeed())
-
-		expectAdmission = testing.MakeAdmission(prodClusterQ.Name).Flavor(corev1.ResourceCPU, spotTaintedFlavor.Name).Obj()
-		gomega.Eventually(func() *kueue.Admission {
-			gomega.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(wl3), wlCopy)).To(gomega.Succeed())
-			return wlCopy.Spec.Admission
-		}, framework.Timeout, framework.Interval).Should(testing.Equal(expectAdmission))
-		framework.ExpectPendingWorkloadsMetric(prodQueue, 1)
+		// TODO(#8): uncomment the following once we have proper re-queueing.
+		// ginkgo.By("checking a second job without toleration doesn't start")
+		// job2 := testing.MakeJob("on-demand-job2", namespace).Queue(queue.Name).Request(corev1.ResourceCPU, "5").Obj()
+		// gomega.Expect(k8sClient.Create(ctx, job2)).Should(gomega.Succeed())
+		// createdJob2 := &batchv1.Job{}
+		// gomega.Consistently(func() bool {
+		// 	lookupKey := types.NamespacedName{Name: job2.Name, Namespace: job2.Namespace}
+		// 	return k8sClient.Get(ctx, lookupKey, createdJob2) == nil && *createdJob2.Spec.Suspend
+		// }, consistentDuration, interval).Should(gomega.BeTrue())
+
+		ginkgo.By("checking a third job with toleration starts")
+		job3 := testing.MakeJob("spot-job3", ns.Name).Queue(prodQueue.Name).
+			Toleration(spotToleration).
+			Request(corev1.ResourceCPU, "5").Obj()
+		gomega.Expect(k8sClient.Create(ctx, job3)).Should(gomega.Succeed())
+		createdJob3 := &batchv1.Job{}
+		gomega.Eventually(func() *bool {
+			gomega.Expect(k8sClient.Get(ctx, types.NamespacedName{Name: job3.Name, Namespace: job3.Namespace}, createdJob3)).Should(gomega.Succeed())
+			return createdJob3.Spec.Suspend
+		}, framework.Timeout, framework.Interval).Should(gomega.Equal(pointer.Bool(false)))
+		gomega.Expect(createdJob3.Spec.Template.Spec.NodeSelector[instanceKey]).Should(gomega.Equal(spotTaintedFlavor.Name))
+		framework.ExpectPendingWorkloadsMetric(prodQueue, 0)
 	})
 
 	ginkgo.It("Should schedule jobs using borrowed ClusterQueue", func() {
@@ -627,8 +633,7 @@ var _ = ginkgo.Describe("Scheduler", func() {
 		strictFIFOClusterQ := testing.MakeClusterQueue("strict-fifo-cq").
 			QueueingStrategy(kueue.StrictFIFO).
 			Resource(testing.MakeResource(corev1.ResourceCPU).
-				Flavor(testing.MakeFlavor(onDemandFlavor.Name,
-					"5").Max("5").Obj()).
+				Flavor(testing.MakeFlavor(onDemandFlavor.Name, "5").Max("5").Obj()).
 				Obj()).
 			Obj()
 		gomega.Expect(k8sClient.Create(ctx, strictFIFOClusterQ)).Should(gomega.Succeed())
@@ -659,4 +664,60 @@ var _ = ginkgo.Describe("Scheduler", func() {
 			return wl3.Spec.Admission == nil
 		}, framework.ConsistentDuration, framework.Interval).Should(gomega.Equal(true))
 	})
+
+	ginkgo.Context("When clusterQueue references nonexistent flavors", func() {
+		var (
+			fooFlavor *kueue.ResourceFlavor
+			fooQ      *kueue.Queue
+			fooCq     *kueue.ClusterQueue
+		)
+
+		ginkgo.BeforeEach(func() {
+			fooCq = testing.MakeClusterQueue("foo-cq").
+				QueueingStrategy(kueue.BestEffortFIFO).
+				Resource(testing.MakeResource(corev1.ResourceCPU).
+					Flavor(testing.MakeFlavor("foo-flavor", "15").Obj()).
+					Obj()).
+				Obj()
+			gomega.Expect(k8sClient.Create(ctx, fooCq)).Should(gomega.Succeed())
+			fooQ = testing.MakeQueue("foo-queue", ns.Name).ClusterQueue(fooCq.Name).Obj()
+			gomega.Expect(k8sClient.Create(ctx, fooQ)).Should(gomega.Succeed())
+		})
+
+		ginkgo.AfterEach(func() {
+			gomega.Expect(framework.DeleteClusterQueue(ctx, k8sClient, fooCq)).To(gomega.Succeed())
+			gomega.Expect(framework.DeleteResourceFlavor(ctx, k8sClient, fooFlavor)).To(gomega.Succeed())
+		})
+
+		ginkgo.It("Should be inactive until the flavor is created", func() {
+			ginkgo.By("Creating one workload")
+			wl := testing.MakeWorkload("workload", ns.Name).Queue(fooQ.Name).Request(corev1.ResourceCPU, "1").Obj()
+			gomega.Expect(k8sClient.Create(ctx, wl)).Should(gomega.Succeed())
+			framework.ExpectWorkloadsToBeFrozen(ctx, k8sClient, fooCq.Name, wl)
+
+			ginkgo.By("Creating foo flavor")
+			fooFlavor = testing.MakeResourceFlavor("foo-flavor").Obj()
+			gomega.Expect(k8sClient.Create(ctx, fooFlavor)).Should(gomega.Succeed())
+			framework.ExpectWorkloadsToBeAdmitted(ctx, k8sClient, fooCq.Name, wl)
+		})
+
+		ginkgo.It("Should be inactive when corresponding flavors deleted", func() {
+			ginkgo.By("Creating foo flavors")
+			fooFlavor = testing.MakeResourceFlavor("foo-flavor").Obj()
+			gomega.Expect(k8sClient.Create(ctx, fooFlavor)).Should(gomega.Succeed())
+
+			ginkgo.By("Creating one workload")
+			wl1 := testing.MakeWorkload("workload", ns.Name).Queue(fooQ.Name).Request(corev1.ResourceCPU, "1").Obj()
+			gomega.Expect(k8sClient.Create(ctx, wl1)).Should(gomega.Succeed())
+			framework.ExpectWorkloadsToBeAdmitted(ctx, k8sClient, fooCq.Name, wl1)
+
+			ginkgo.By("Deleting foo flavors")
+			gomega.Expect(framework.DeleteResourceFlavor(ctx, k8sClient, fooFlavor)).To(gomega.Succeed())
+
+			ginkgo.By("Creating another workloads")
+			wl2 := testing.MakeWorkload("wl-2", ns.Name).Queue(fooQ.Name).Request(corev1.ResourceCPU, "1").Obj()
+			gomega.Expect(k8sClient.Create(ctx, wl2)).Should(gomega.Succeed())
+			framework.ExpectWorkloadsToBeFrozen(ctx, k8sClient, fooCq.Name, wl2)
+		})
+	})
 })
diff --git a/test/integration/webhook/v1alpha1/workload_test.go b/test/integration/webhook/v1alpha1/workload_test.go
index b08f086ae..4aa2effce 100644
--- a/test/integration/webhook/v1alpha1/workload_test.go
+++ b/test/integration/webhook/v1alpha1/workload_test.go
@@ -17,7 +17,6 @@ import (
 	"github.com/onsi/ginkgo/v2"
 	"github.com/onsi/gomega"
 	corev1 "k8s.io/api/core/v1"
-	"k8s.io/apimachinery/pkg/api/errors"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/types"
 
@@ -28,8 +27,6 @@ import (
 
 var ns *corev1.Namespace
 
-const workloadName = "workload-test"
-
 var _ = ginkgo.BeforeEach(func() {
 	ns = &corev1.Namespace{
 		ObjectMeta: metav1.ObjectMeta{
@@ -44,10 +41,23 @@ var _ = ginkgo.AfterEach(func() {
 })
 
 var _ = ginkgo.Describe("Workload defaulting webhook", func() {
-	ginkgo.Context("When creating a Workload", func() {
+	ginkgo.Context("When creating Workload", func() {
 		ginkgo.It("Should set default values", func() {
 			ginkgo.By("Creating a new Workload")
-			workload := testing.MakeWorkload(workloadName, ns.Name).Obj()
+			workload := testing.MakeWorkload("workload1", ns.Name).Obj()
+			workload.Spec.PodSets = []v1alpha1.PodSet{
+				{
+					Count: 2,
+					Spec: corev1.PodSpec{
+						Containers: []corev1.Container{
+							{
+								Name:  "test",
+								Image: "fake-image",
+							},
+						},
+					},
+				},
+			}
 			gomega.Expect(k8sClient.Create(ctx, workload)).Should(gomega.Succeed())
 
 			created := &v1alpha1.Workload{}
@@ -60,47 +70,3 @@ var _ = ginkgo.Describe("Workload defaulting webhook", func() {
 		})
 	})
 })
-
-var _ = ginkgo.Describe("Workload validating webhook", func() {
-	ginkgo.Context("When creating a Workload", func() {
-		ginkgo.It("Should validate Workload", func() {
-			ginkgo.By("Creating a new Workload")
-			workload := testing.MakeWorkload(workloadName, ns.Name).
-				PodSets([]v1alpha1.PodSet{
-					{
-						Name:  "main",
-						Count: -1,
-						Spec: corev1.PodSpec{
-							Containers: []corev1.Container{
-								{
-									Name: "c",
-									Resources: corev1.ResourceRequirements{
-										Requests: make(corev1.ResourceList),
-									},
-								},
-							},
-						},
-					},
-				}).
-				PriorityClass("invalid_class").
-				Obj()
-			err := k8sClient.Create(ctx, workload)
-			gomega.Expect(err).Should(gomega.HaveOccurred())
-			gomega.Expect(errors.IsForbidden(err)).Should(gomega.BeTrue(), "error: %v", err)
-		})
-	})
-
-	ginkgo.Context("When updating a Workload", func() {
-		ginkgo.It("Should validate spec.podSet.count", func() {
-			ginkgo.By("Creating a new Workload")
-			workload := testing.MakeWorkload(workloadName, ns.Name).Obj()
-			gomega.Expect(k8sClient.Create(ctx, workload)).Should(gomega.Succeed())
-
-			ginkgo.By("Updating the Workload")
-			workload.Spec.PodSets[0].Count = -1
-			err := k8sClient.Update(ctx, workload)
-			gomega.Expect(err).Should(gomega.HaveOccurred())
-			gomega.Expect(errors.IsForbidden(err)).Should(gomega.BeTrue(), "error: %v", err)
-		})
-	})
-})