Skip to content

Commit

Permalink
Merge pull request #3488 from julianvmodesto/logrotate-coreos
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue.

Enable logrotate for Kubernetes configs on CoreOS

Addresses #2710.

Also, remove logrotate crontab because logrotate ships with a systemd timer, `logrotate.timer`, to run logrotate daily.
  • Loading branch information
Kubernetes Submit Queue committed Oct 9, 2017
2 parents 859bc17 + 8cb2b68 commit 7cfa1b7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions nodeup/pkg/model/logrotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,15 @@ type LogrotateBuilder struct {
var _ fi.ModelBuilder = &LogrotateBuilder{}

func (b *LogrotateBuilder) Build(c *fi.ModelBuilderContext) error {
if b.Distribution == distros.DistributionCoreOS {
glog.Infof("Detected CoreOS; won't install logrotate")
return nil
}

if b.Distribution == distros.DistributionContainerOS {
glog.Infof("Detected ContainerOS; won't install logrotate")
return nil
} else if b.Distribution == distros.DistributionCoreOS {
glog.Infof("Detected CoreOS; won't install logrotate")
} else {
c.AddTask(&nodetasks.Package{Name: "logrotate"})
}

c.AddTask(&nodetasks.Package{Name: "logrotate"})

k8sVersion, err := util.ParseKubernetesVersion(b.Cluster.Spec.KubernetesVersion)
if err != nil || k8sVersion == nil {
return fmt.Errorf("unable to parse KubernetesVersion %q", b.Cluster.Spec.KubernetesVersion)
Expand Down

0 comments on commit 7cfa1b7

Please sign in to comment.