Bugfix: gitops policy linked to software package with env var fails to apply (#40944)

This commit is contained in:
Martin Angers
2026-03-04 14:03:34 -05:00
committed by GitHub
parent 4cbc4fdd5e
commit 1fa339298b
3 changed files with 146 additions and 0 deletions
+5
View File
@@ -1329,6 +1329,11 @@ func parsePolicyInstallSoftware(baseDir string, teamName *string, policy *Policy
if err != nil {
return fmt.Errorf("failed to read install_software.package_path file %q: %v", policy.InstallSoftware.PackagePath, err)
}
// Replace $var and ${var} with env values.
fileBytes, err = ExpandEnvBytes(fileBytes)
if err != nil {
return fmt.Errorf("failed to expand environment in file %q: %v", policy.InstallSoftware.PackagePath, err)
}
var policyInstallSoftwareSpec fleet.SoftwarePackageSpec
if err := YamlUnmarshal(fileBytes, &policyInstallSoftwareSpec); err != nil {
// see if the issue is that a package path was passed in that references multiple packages