import yaml
from textwrap import dedent


def create_cron_resource(name="cron", minute=5, image="cron-image"):
    """Create a CronTab resource from parameters.

    Args:
        name (str): name of the resource
        minute (int): time set for the minutes in the CRON specifications.
        image (str): image used for the CRON specifications.

    Returns:
        dict[str, object]: the generated CronTab resource.

    """
    return next(
        yaml.safe_load_all(
            dedent(
                f"""
            ---
            apiVersion: stable.example.com/v1
            kind: CronTab
            metadata:
                name: {name}
                namespace: default
            spec:
                cronSpec: "* * * * {minute}"
                image: {image}
            """
            )
        )
    )