Skip to content

Commit

Permalink
Add support for pause annotation to chart CRs (#705)
Browse files Browse the repository at this point in the history
* Add team annotation

* Add support for pause annotation
  • Loading branch information
rossf7 committed Mar 9, 2021
1 parent 5f72274 commit c1ac8c1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s

## [Unreleased]

### Added

- Pause Chart CR reconciliation when it has chart-operator.giantswarm.io/paused=true annotation.

## [2.9.0] - 2021-02-03

### Added
Expand Down
2 changes: 2 additions & 0 deletions helm/chart-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ version: [[ .Version ]]
appVersion: [[ .AppVersion ]]
home: https://github.com/giantswarm/chart-operator
description: A Helm chart for the chart-operator
annotations:
application.giantswarm.io/team: "batman"
restrictions:
clusterSingleton: true
namespaceSingleton: true
Expand Down
4 changes: 4 additions & 0 deletions pkg/annotation/annotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
package annotation

const (
// ChartOperatorPaused annotation when present prevents chart-operator from
// reconciling the resource.
ChartOperatorPaused = "chart-operator.giantswarm.io/paused"

// CordonReason is the name of the annotation that indicates
// the reason of why chart-operator should not apply any update on this chart CR.
CordonReason = "chart-operator.giantswarm.io/cordon-reason"
Expand Down
4 changes: 4 additions & 0 deletions service/controller/chart/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/spf13/afero"
"k8s.io/apimachinery/pkg/runtime"

"github.com/giantswarm/chart-operator/v2/pkg/annotation"
"github.com/giantswarm/chart-operator/v2/pkg/project"
"github.com/giantswarm/chart-operator/v2/service/controller/chart/controllercontext"
)
Expand Down Expand Up @@ -91,6 +92,9 @@ func NewChart(config Config) (*Chart, error) {
InitCtx: initCtxFunc,
K8sClient: config.K8sClient,
Logger: config.Logger,
Pause: map[string]string{
annotation.ChartOperatorPaused: "true",
},
Resources: resources,
NewRuntimeObjectFunc: func() runtime.Object {
return new(v1alpha1.Chart)
Expand Down

0 comments on commit c1ac8c1

Please sign in to comment.