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

package task: cleaner behaviour when package is installed #6490

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions nodeup/pkg/model/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,6 @@ func (b *DockerBuilder) Build(c *fi.ModelBuilderContext) error {
Source: s(dv.Source),
Hash: s(dv.Hash),
Deps: extraPkgs,

// TODO: PreventStart is now unused?
PreventStart: fi.Bool(true),
}
c.AddTask(packageTask)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ Name: bridge-utils
---
Name: docker-engine
hash: 30f7840704361673db2b62f25b6038628184b056
preventStart: true
source: http://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_1.12.1-0~xenial_amd64.deb
version: 1.12.1-0~xenial
---
Expand Down
1 change: 0 additions & 1 deletion nodeup/pkg/model/tests/dockerbuilder/logflags/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ Name: bridge-utils
---
Name: docker-engine
hash: b758fc88346a1e5eebf7408b0d0c99f4f134166c
preventStart: true
source: http://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_1.12.3-0~xenial_amd64.deb
version: 1.12.3-0~xenial
---
Expand Down
1 change: 0 additions & 1 deletion nodeup/pkg/model/tests/dockerbuilder/simple/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ Name: bridge-utils
---
Name: docker-engine
hash: b758fc88346a1e5eebf7408b0d0c99f4f134166c
preventStart: true
source: http://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_1.12.3-0~xenial_amd64.deb
version: 1.12.3-0~xenial
---
Expand Down
12 changes: 8 additions & 4 deletions upup/pkg/fi/nodeup/nodetasks/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ import (
type Package struct {
Name string

Version *string `json:"version,omitempty"`
Source *string `json:"source,omitempty"`
Hash *string `json:"hash,omitempty"`
PreventStart *bool `json:"preventStart,omitempty"`
Version *string `json:"version,omitempty"`
Source *string `json:"source,omitempty"`
Hash *string `json:"hash,omitempty"`

// Healthy is true if the package installation did not fail
Healthy *bool `json:"healthy,omitempty"`
Expand Down Expand Up @@ -240,6 +239,7 @@ func (e *Package) findYum(c *fi.Context) (*Package, error) {
return nil, nil
}

// Prevent spurious changes
return &Package{
Name: e.Name,
Version: fi.String(installedVersion),
Expand Down Expand Up @@ -347,6 +347,10 @@ func (_ *Package) RenderLocal(t *local.LocalTarget, a, e, changes *Package) erro
}
}

// Make out fields we can't read / can't do anything about
changes.Source = nil
changes.Hash = nil

if !reflect.DeepEqual(changes, &Package{}) {
klog.Warningf("cannot apply package changes for %q: %v", e.Name, changes)
}
Expand Down