Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
28f0e4f
Add additional wait condition to allow for proper installer exits
hendrie6 Jan 26, 2026
071b18f
Enhance update status check to look in other sources
hendrie6 Jan 28, 2026
871f708
Refactor Windows update script for clarity and functionality
hendrie6 Jan 30, 2026
43c1bb8
Merge branch 'rgl:master' into master
hendrie6 Jan 30, 2026
2352146
Add GitHub Actions workflow for releasing plugin
hendrie6 Jan 30, 2026
939229c
Add GITHUB_TOKEN to workflow environment
hendrie6 Jan 30, 2026
a38d7bf
Refactor build workflow by removing GPG import
hendrie6 Jan 30, 2026
3b80b23
Add GitHub Actions workflow for release process
hendrie6 Jan 30, 2026
094f53f
Update GitHub Actions workflow for build process
hendrie6 Jan 30, 2026
595e2df
Remove GitHub Actions workflow for releasing plugin
hendrie6 Jan 30, 2026
fc5351d
Modify release workflow for Windows plugin build
hendrie6 Jan 30, 2026
5520cd3
Update release workflow to build plugins for Windows and Linux
hendrie6 Jan 30, 2026
458f303
Change overwrite option to overwrite_files in release.yml
hendrie6 Jan 30, 2026
124c36a
Enhance release workflow for Windows and Linux plugins
hendrie6 Jan 30, 2026
3ca9a83
Update zip file naming convention in release workflow
hendrie6 Jan 30, 2026
c19f5c3
Modify release workflow to include versioned filenames
hendrie6 Jan 30, 2026
166d439
Delete .github/workflows/main.yml
hendrie6 Jan 30, 2026
20e59de
Update build commands to include versioning and flags
hendrie6 Jan 30, 2026
2e774a2
Refactor Windows Update script for clarity and robustness
hendrie6 Jan 30, 2026
ab89572
Restore comments and parameters in windows-update.ps1
hendrie6 Jan 30, 2026
856bb3b
Update comments and parameters in windows-update.ps1
hendrie6 Jan 31, 2026
59c0427
Update comments and improve error handling in script
hendrie6 Feb 2, 2026
3feb6af
Added reboot_delay ability
hendrie6 Feb 2, 2026
9de9470
Update windows-update.ps1
hendrie6 Feb 2, 2026
2382ad2
Update README with reboot_delay default value
hendrie6 Feb 2, 2026
a10310e
Delete windows-update.ps1
hendrie6 Feb 2, 2026
14824ae
Restore commented documentation in windows-update.ps1
hendrie6 Feb 2, 2026
1977e09
Remove outdated comments and improve script structure
hendrie6 Feb 2, 2026
25707fd
Change build runner from Windows to Ubuntu
hendrie6 Feb 2, 2026
230769c
Change build runner from Ubuntu to Windows 2022
hendrie6 Feb 2, 2026
8ec0432
Restore commented documentation in windows-update.ps1
hendrie6 Feb 3, 2026
508eed0
Update comments and parameters in windows-update.ps1
hendrie6 Feb 3, 2026
28730a1
Adding UseExtendedValidation
hendrie6 Feb 3, 2026
74f85b4
Fixed boolean using string comparison
hendrie6 Feb 3, 2026
614f6c7
Adjusting UseExtendedValidation to use a switch
hendrie6 Feb 3, 2026
545f83b
Fix missing newline at end of provisioner.hcl2spec.go
hendrie6 Feb 3, 2026
15e74b6
Add files via upload
hendrie6 Feb 3, 2026
887d8a4
Add files via upload
hendrie6 Feb 4, 2026
fd51dfb
Remove outdated comments and improve script structure
hendrie6 Feb 4, 2026
9fb0234
Update build.yml to match master branch
hendrie6 Feb 4, 2026
5f91bdc
Delete .github/workflows/release.yml
hendrie6 Feb 5, 2026
95106f0
Updated readme to include new parameters
hendrie6 Feb 5, 2026
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ build {
"include:$true",
]
update_limit = 25
reboot_delay = 900
use_extended_validation = true
}
}
```
Expand All @@ -72,6 +74,10 @@ build {

**NB** If the `update_limit` attribute is not declared, it defaults to `1000`.

**NB** If the `reboot_delay` attribute is not declared, it defaults to `0`. reboot_delay is in seconds. It delays reboots after windows updates have completed.

**NB** If the `use_extended_validation` attribute is not declared, it defaults to 'false'. use_extended_validation accepts boolean values (true/false). If set to true, windows update completion is validated by either the exiting of the windows installer process or event logs / CBS logs that validate the completion. Some Windows updates complete, but do not exit the TiWorker.exe process to validate the completion. This parameter handles those types of scenarios, ensuring this windows update module finalizes successfully.

The general filter syntax is:

ACTION:EXPRESSION
Expand Down
32 changes: 24 additions & 8 deletions update/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ type Config struct {
// Adds a limit to how many updates are installed at a time
UpdateLimit int `mapstructure:"update_limit"`

// Adds the ability to delay the reboot command after updates are installed
// Default is 0 seconds
RebootDelay int `mapstructure:"reboot_delay"`

// Adds the ability to use additional logs for validation of windows installations
// Default is false
UseExtendedValidation bool `mapstructure:"use_extended_validation"`

// Max times the provisioner will try install the updates
// in case of failure.
UpdateMaxRetries int `mapstructure:"update_max_retries"`
Expand Down Expand Up @@ -322,15 +330,23 @@ func (p *Provisioner) retryable(ctx context.Context, f func(ctx context.Context)
}

func (p *Provisioner) windowsUpdateCommand() string {
// Build the inner PowerShell command
innerCmd := fmt.Sprintf(
"%s%s%s -UpdateLimit %d -RebootDelay %d",
windowsUpdatePath,
searchCriteriaArgument(p.config.SearchCriteria),
filtersArgument(p.config.Filters),
p.config.UpdateLimit,
p.config.RebootDelay)

// If UseExtendedValidation was requested, add it to the inner command
if p.config.UseExtendedValidation {
innerCmd += " -UseExtendedValidation"
}

return fmt.Sprintf(
"PowerShell -ExecutionPolicy Bypass -OutputFormat Text -EncodedCommand %s",
base64.StdEncoding.EncodeToString(
encodeUtf16Le(fmt.Sprintf(
"%s%s%s -UpdateLimit %d",
windowsUpdatePath,
searchCriteriaArgument(p.config.SearchCriteria),
filtersArgument(p.config.Filters),
p.config.UpdateLimit))))
base64.StdEncoding.EncodeToString(encodeUtf16Le(innerCmd)))
}

func (p *Provisioner) windowsUpdateCheckForRebootRequiredCommand() string {
Expand Down Expand Up @@ -389,4 +405,4 @@ func escapePowerShellString(value string) string {
"'%s'",
// escape single quotes with another single quote.
strings.ReplaceAll(value, "'", "''"))
}
}
34 changes: 19 additions & 15 deletions update/provisioner.hcl2spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading