Skip to content

Commit e998cb2

Browse files
committed
fix: update cron field schema description and fix formatting
- Updated the cron field description in provider/script.go to include detailed 6-field format explanation - Fixed formatting issues in documentation (removed extra spaces before comments) - Regenerated documentation to ensure consistency between schema and docs - This ensures the documentation generation preserves the detailed cron description instead of reverting to generic text
1 parent 29acf08 commit e998cb2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/resources/script.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ resource "coder_script" "nightly_update" {
4747
agent_id = coder_agent.dev.agent_id
4848
display_name = "Nightly update"
4949
icon = "/icon/database.svg"
50-
cron = "0 0 22 * * *" # Run at 22:00 (10 PM) every day
50+
cron = "0 0 22 * * *" # Run at 22:00 (10 PM) every day
5151
script = <<EOF
5252
#!/bin/sh
5353
echo "Running nightly update"
@@ -59,7 +59,7 @@ resource "coder_script" "every_5_minutes" {
5959
agent_id = coder_agent.dev.agent_id
6060
display_name = "Health check"
6161
icon = "/icon/heart.svg"
62-
cron = "0 */5 * * * *" # Run every 5 minutes
62+
cron = "0 */5 * * * *" # Run every 5 minutes
6363
script = <<EOF
6464
#!/bin/sh
6565
echo "Health check at $(date)"

provider/script.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func scriptResource() *schema.Resource {
9999
ForceNew: true,
100100
Type: schema.TypeString,
101101
Optional: true,
102-
Description: "The cron schedule to run the script on. This is a cron expression.",
102+
Description: "The cron schedule to run the script on. This uses a 6-field cron expression format: `seconds minutes hours day-of-month month day-of-week`. Note that this differs from the standard Unix 5-field format by including seconds as the first field. Examples: `\"0 0 22 * * *\"` (daily at 10 PM), `\"0 */5 * * * *\"` (every 5 minutes), `\"30 0 9 * * 1-5\"` (weekdays at 9:30 AM).",
103103
ValidateFunc: func(i interface{}, _ string) ([]string, []error) {
104104
v, ok := i.(string)
105105
if !ok {

0 commit comments

Comments
 (0)