Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 1 addition & 28 deletions ocp_resources/cron_job.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
from ocp_resources.constants import TIMEOUT_4MINUTES
from ocp_resources.resource import NamespacedResource


class CronJob(NamespacedResource):
"""
CronJob object. API reference:
https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/cron-job-v1/
"""

api_group = NamespacedResource.ApiGroup.BATCH

def __init__(
self,
name=None,
namespace=None,
client=None,
teardown=True,
schedule=None,
job_template=None,
timezone=None,
Expand All @@ -24,20 +18,10 @@ def __init__(
suspend=None,
successful_jobs_history_limit=None,
failed_jobs_history_limit=None,
privileged_client=None,
yaml_file=None,
delete_timeout=TIMEOUT_4MINUTES,
**kwargs,
):
"""
Args:
name (str): Name of the CronJob resource
namespace (str): Namespace of CronJob resource
client: (DynamicClient): DynamicClient for api calls
teardown (bool): Indicates if the resource should be torn down at the end
privileged_client (DynamicClient): Privileged client for api calls
yaml_file (str): yaml file for the resource.
delete_timeout (int, optional): timeout associated with delete action
schedule (str): schedule of the cron job
job_template (dict): describes the job that would be created when a cronjob would be executed
Example:
Expand All @@ -49,19 +33,8 @@ def __init__(
failed_jobs_history_limit (int, optional): number of failed jobs to retain
starting_deadline_seconds (int, optional): deadline in seconds, for starting a job, in case it does not
start at scheduled time


"""
super().__init__(
name=name,
namespace=namespace,
client=client,
teardown=teardown,
privileged_client=privileged_client,
yaml_file=yaml_file,
delete_timeout=delete_timeout,
**kwargs,
)
super().__init__(**kwargs)
self.job_template = job_template
self.schedule = schedule
self.timezone = timezone
Expand Down