Skip to content

Conversation

@patchback
Copy link

@patchback patchback bot commented Apr 25, 2025

This is a backport of PR #905 as merged into main (d329e7e).

This PR is a rebase of #898 for CI to pass
Thanks @efussi for your collaboration.

Closes #892

This PR is a rebase of #898 for CI to pass
Thanks @efussi for your collaboration.
Closes #892

Reviewed-by: Yuriy Novostavskiy
Reviewed-by: Bianca Henderson <[email protected]>
(cherry picked from commit d329e7e)
@patchback patchback bot mentioned this pull request Apr 25, 2025
@softwarefactory-project-zuul
Copy link

@yurnov
Copy link
Contributor

yurnov commented Apr 25, 2025

Hi @abikouo, please cherry-pick #903 to fix unit-test

att @gravesm @beeankha

@yurnov
Copy link
Contributor

yurnov commented Apr 25, 2025

For the failing integration test, it seems that is some race conditions:

[ERROR]: Task failed: Module failed: Failed to create object: b'{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"namespaces \\"delete\\" not found","reason":"NotFound","details":{"name":"delete","kind":"namespaces"},"code":404}\n'
Origin: /home/runner/collections/ansible_collections/kubernetes/core/tests/integration/targets/k8s_delete/tasks/main.yml:3:7

1 ---
2 - block:
3     - name: Add a daemonset
        ^ column 7

fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "api_key": null,
            "api_version": "v1",
            "append_hash": false,
            "apply": false,
            "ca_cert": null,
            "client_cert": null,
            "client_key": null,
            "context": null,
            "continue_on_error": false,
            "definition": {
                "apiVersion": "apps/v1",
                "kind": "DaemonSet",
                "metadata": {
                    "name": "delete-daemonset",
                    "namespace": "delete"
                },
                "spec": {
                    "selector": {
                        "matchLabels": {
                            "app": "delete-ds"
                        }
                    },
                    "template": {
                        "metadata": {
                            "labels": {
                                "app": "delete-ds"
                            }
                        },
                        "spec": {
                            "containers": [
                                {
                                    "command": [],
                                    "env": [],
                                    "image": "gcr.io/kuar-demo/kuard-amd64:1",
                                    "imagePullPolicy": "Always",
                                    "name": "delete-ds",
                                    "ports": [],
                                    "readinessProbe": {
                                        "exec": {
                                            "command": [
                                                "/bin/true"
                                            ]
                                        },
                                        "initialDelaySeconds": 15
                                    },
                                    "resources": {
                                        "limits": {
                                            "cpu": "100m",
                                            "memory": "100Mi"
                                        }
                                    }
                                }
                            ],
                            "serviceAccount": "default"
                        }
                    }
                }
            },
            "delete_all": false,
            "delete_options": null,
            "force": false,
            "generate_name": null,
            "hidden_fields": null,
            "host": null,
            "impersonate_groups": null,
            "impersonate_user": null,
            "kind": null,
            "kubeconfig": null,
            "label_selectors": null,
            "merge_type": null,
            "name": null,
            "namespace": null,
            "no_proxy": null,
            "password": null,
            "persist_config": null,
            "proxy": null,
            "proxy_headers": null,
            "resource_definition": {
                "apiVersion": "apps/v1",
                "kind": "DaemonSet",
                "metadata": {
                    "name": "delete-daemonset",
                    "namespace": "delete"
                },
                "spec": {
                    "selector": {
                        "matchLabels": {
                            "app": "delete-ds"
                        }
                    },
                    "template": {
                        "metadata": {
                            "labels": {
                                "app": "delete-ds"
                            }
                        },
                        "spec": {
                            "containers": [
                                {
                                    "command": [],
                                    "env": [],
                                    "image": "gcr.io/kuar-demo/kuard-amd64:1",
                                    "imagePullPolicy": "Always",
                                    "name": "delete-ds",
                                    "ports": [],
                                    "readinessProbe": {
                                        "exec": {
                                            "command": [
                                                "/bin/true"
                                            ]
                                        },
                                        "initialDelaySeconds": 15
                                    },
                                    "resources": {
                                        "limits": {
                                            "cpu": "100m",
                                            "memory": "100Mi"
                                        }
                                    }
                                }
                            ],
                            "serviceAccount": "default"
                        }
                    }
                }
            },
            "server_side_apply": null,
            "src": null,
            "state": "present",
            "template": null,
            "username": null,
            "validate": null,
            "validate_certs": null,
            "wait": true,
            "wait_condition": null,
            "wait_sleep": 5,
            "wait_timeout": 400
        }
    },
    "msg": "Failed to create object: b'{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"namespaces \\\\\"delete\\\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"delete\",\"kind\":\"namespaces\"},\"code\":404}\\n'",
    "reason": "Not Found"
}

@beeankha
Copy link
Contributor

please cherry-pick #903 to fix unit-test

Hey @yurnov , I am going to close this backport PR as well as the one for stable-5 and backport the bugfix PR into stable-3 and stable-5. After the backport of the bug is complete, I will trigger a new backport PR for #905 for both stable-3 and stable-5 and we can proceed from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants