In this commit, we add e2e tests for the `karmadactl apply`
command to ensure it handles various scenarios correctly.
The tests include:
- Applying configurations without propagating them into member clusters.
- Applying configurations with propagation into specific member clusters.
- Applying configurations and propagating them to all member clusters.
- Verifying that no resources were created during `--dry-run` mode.
- Ensuring the command returns an error for an invalid flag.
- Ensuring the command returns an error when the specified file does not exist.
- Applying configurations with the `--namespace` flag to ensure resources are created in the specified namespace.
- Applying configurations with the `--force-conflicts` flag to ensure conflicts are forcefully resolved during server-side apply.
- Applying configurations using the `--kustomize` flag to process a kustomization directory.
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
Co-authored-by: zhzhuang-zju <m17799853869@163.com>
Co-authored-by: Chang <changzhen5@huawei.com>
In this commit, we unify the generation of random string
length by utilizing `RandomStrLength` global constant.
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
In this commit, we add e2e tests for the `karmadactl taint`
command to ensure it handles various scenarios correctly.
The tests include:
- Applying taints with different effects (NoSchedule, NoExecute) to a cluster.
- Reapplying taints without the `--overwrite` flag to ensure an error is returned.
- Overwriting existing taints using the `--overwrite` flag.
- Removing taints from a cluster.
- Running the taint command in `--dry-run` mode to ensure no actual changes are made.
- Verifying that taints were not applied during `--dry-run` mode.
- Ensuring the command returns an error for an invalid flag.
- Ensuring the command returns an error when attempting to taint a non-existent cluster.
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
Co-authored-by: zhzhuang-zju <m17799853869@163.com>
In this commit, we unify access to cluster members
in `test/helper/NewFederatedResourceQuota()` by passing
`clusterNames` as an input parameter. This commit is also
a follow-up of this PR #5226.
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
In this commit, we test `karmadactl options` on listing
all available global options successfully and returning
an error for invalid flag in options.
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>