Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(job): add logging limits #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NikitaCOEUR
Copy link

Description

This PR adds support for setting log limits on Rundeck jobs in the Terraform provider. The new attribute log_limit allows users to configure log output limits, define actions to take when these limits are reached, and specify custom status.

Added Features:

  • log_limit attribute for Rundeck jobs to manage logging behavior.
    • output: Maximum total line-count or size of the log.
    • action: The action to take when the log limit is reached (halt or truncate).
    • status: Custom status for halted jobs due to log limits.

Example Usage

resource "rundeck_job" "example_with_log_limit" {
    name              = "Example Job with Log Limit"
    project_name      = rundeck_project.terraform.name
    description       = "An example job with log limit settings"

    log_limit {
        output = "100MB"
        action = "halt"
        status = "failed"
    }

    command {
        shell_command = "echo 'Hello, World!'"
    }
}

Testing

  • Added new acceptance tests to validate log limit behavior.
  • I was unable to fully test the acceptance tests. Could someone please validate them?

Notes

  • This change is backward compatible.
  • The properties action and status have been made required along with output to avoid a bug where setting these properties to null in the resource declaration caused a cyclic drift. Specifically, the state file would show null for these properties while the ReadJob function would return default values (failed for status and halt for action). This discrepancy led to unnecessary resource updates.
  • Please review the new schema and provide feedback regarding additional validations or edge cases.

@NikitaCOEUR
Copy link
Author

@fdevans can you take a look at this please ?

Thank you.

@fdevans fdevans self-requested a review October 22, 2024 19:19
@fdevans fdevans added this to the v0.5.0 milestone Nov 4, 2024
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.

2 participants