Install packages updates during bootstrap

This commit is contained in:
Ciprian Hacman 2020-02-27 06:47:04 +02:00
parent 61511b5c43
commit c58b8d5df1
3 changed files with 14 additions and 2 deletions

View File

@ -62,6 +62,8 @@ Values:
* unset means to use the default policy, which is currently to apply OS security updates unless they require a reboot
Required packages are also updated during bootstrapping if the value is not set.
## out
`out` determines the directory into which Kops will write the target output for Terraform and CloudFormation. It defaults to `out/terraform` and `out/cloudformation` respectively.

View File

@ -216,7 +216,9 @@ func (e *Package) findDpkg(c *fi.Context) (*Package, error) {
}
}
if !installed {
target := c.Target.(*local.LocalTarget)
updates := target.HasTag(tags.TagUpdatePolicyAuto)
if !updates && !installed {
return nil, nil
}
@ -264,7 +266,9 @@ func (e *Package) findYum(c *fi.Context) (*Package, error) {
healthy = fi.Bool(true)
}
if !installed {
target := c.Target.(*local.LocalTarget)
updates := target.HasTag(tags.TagUpdatePolicyAuto)
if !updates && !installed {
return nil, nil
}

View File

@ -25,6 +25,12 @@ const (
TagOSRHEL8 = "_rhel8"
TagSystemd = "_systemd"
// Nodes with the "_automatic_upgrade" tag automatically update installed packages
// during bootstrapping and daily for security updates (unless this update would require
// a node reboot). To disable automatic node package updates, set:
// `Cluster.Spec.UpdatePolicy = external`
TagUpdatePolicyAuto = "_automatic_upgrades"
)
type HasTags interface {