Request reconcile using patch instead of update
This should prevent the generation of the object getting bumped, as observed on a GKE K8s 1.18 cluster using the logic before this commit. We only want to generation to increase when there are actual changes to the `spec` of a resource, as some controllers use the `generation` value to make assumptions about what they should do during a reconciliation. Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
@@ -41,6 +41,10 @@ func (a bucketAdapter) asClientObject() client.Object {
|
||||
return a.Bucket
|
||||
}
|
||||
|
||||
func (a bucketAdapter) deepCopyClientObject() client.Object {
|
||||
return a.Bucket.DeepCopy()
|
||||
}
|
||||
|
||||
// sourcev1.BucketList
|
||||
|
||||
type bucketListAdapter struct {
|
||||
@@ -70,6 +74,10 @@ func (a helmChartAdapter) asClientObject() client.Object {
|
||||
return a.HelmChart
|
||||
}
|
||||
|
||||
func (a helmChartAdapter) deepCopyClientObject() client.Object {
|
||||
return a.HelmChart.DeepCopy()
|
||||
}
|
||||
|
||||
// sourcev1.HelmChartList
|
||||
|
||||
type helmChartListAdapter struct {
|
||||
@@ -99,6 +107,10 @@ func (a gitRepositoryAdapter) asClientObject() client.Object {
|
||||
return a.GitRepository
|
||||
}
|
||||
|
||||
func (a gitRepositoryAdapter) deepCopyClientObject() client.Object {
|
||||
return a.GitRepository.DeepCopy()
|
||||
}
|
||||
|
||||
// sourcev1.GitRepositoryList
|
||||
|
||||
type gitRepositoryListAdapter struct {
|
||||
@@ -128,6 +140,10 @@ func (a helmRepositoryAdapter) asClientObject() client.Object {
|
||||
return a.HelmRepository
|
||||
}
|
||||
|
||||
func (a helmRepositoryAdapter) deepCopyClientObject() client.Object {
|
||||
return a.HelmRepository.DeepCopy()
|
||||
}
|
||||
|
||||
// sourcev1.HelmRepositoryList
|
||||
|
||||
type helmRepositoryListAdapter struct {
|
||||
|
||||
Reference in New Issue
Block a user