Skip to content

fix: issue-5041 #5042

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

Merged
merged 1 commit into from
Jul 6, 2021
Merged

Conversation

cndoit18
Copy link
Contributor

@cndoit18 cndoit18 commented Jul 6, 2021

Signed-off-by: cndoit18 [email protected]

Description of the change:
fix #5041

Motivation for the change:

Checklist

If the pull request includes user-facing changes, extra documentation is required:

@openshift-ci openshift-ci bot requested review from estroz and marc-obrien July 6, 2021 03:47
@cndoit18 cndoit18 changed the title fix: fix issue-5041 fix: issue-5041 Jul 6, 2021
@cndoit18 cndoit18 force-pushed the fix-issue-5041 branch 2 times, most recently from df83db7 to a16ce91 Compare July 6, 2021 04:45
@danquah
Copy link

danquah commented Jul 6, 2021

That seems to fix it. I've added the full log-output with--zap-devel with the fix applied. I ran it for about two minutes to ensure we got two reconcilation attempts due to the default --reconcile-period = 1m0s. I've also added another log-output with the bug present (1.8.0) below it.

One thing - I've noticied this Operation cannot be fulfilled on loops.charts.my.domain \"loop-sample\": the object has been modified; please apply your changes to the latest version and try again error before, I don't think it's related to this issue, but it does seem a bit wird.

2021-07-06T04:39:07.665Z	INFO	cmd	Version	{"Go Version": "go1.16.5", "GOOS": "linux", "GOARCH": "amd64", "helm-operator": "v1.9.0+git", "commit": "df83db76a0fdf1cd6c31b1a9146ef030ce9197b9"}
2021-07-06T04:39:07.665Z	INFO	cmd	Watch namespaces not configured by environment variable WATCH_NAMESPACE or file. Watching all namespaces.	{"Namespace": ""}
2021-07-06T04:39:08.273Z	INFO	controller-runtime.metrics	metrics server is starting to listen	{"addr": "127.0.0.1:8080"}
2021-07-06T04:39:08.364Z	INFO	helm.controller	Watching resource	{"apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "namespace": "", "reconcilePeriod": "1m0s"}
I0706 04:39:08.365664       1 leaderelection.go:243] attempting to acquire leader lease operator-system/operator...
2021-07-06T04:39:08.366Z	INFO	controller-runtime.manager	starting metrics server	{"path": "/metrics"}
I0706 04:39:08.378284       1 leaderelection.go:253] successfully acquired lease operator-system/operator
2021-07-06T04:39:08.464Z	DEBUG	controller-runtime.manager.events	Normal	{"object": {"kind":"ConfigMap","namespace":"operator-system","name":"operator","uid":"cddb2781-dfaa-4846-a54b-9f93fe6716bb","apiVersion":"v1","resourceVersion":"622"}, "reason": "LeaderElection", "message": "operator-controller-manager-58b5c65cb8-qhbld_bc46c67b-f916-4091-bcab-5826cf1e52da became leader"}
2021-07-06T04:39:08.464Z	INFO	controller-runtime.manager.controller.loop-controller	Starting EventSource	{"source": "kind source: charts.my.domain/v1alpha1, Kind=Loop"}
2021-07-06T04:39:08.569Z	INFO	controller-runtime.manager.controller.loop-controller	Starting Controller
2021-07-06T04:39:08.569Z	INFO	controller-runtime.manager.controller.loop-controller	Starting workers	{"worker count": 6}
2021-07-06T04:39:20.902Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T04:39:23.572Z	DEBUG	helm.controller	Adding finalizer	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "finalizer": "helm.sdk.operatorframework.io/uninstall-release"}
2021-07-06T04:39:23.664Z	INFO	controller-runtime.manager.controller.loop-controller	Starting EventSource	{"source": "kind source: /v1, Kind=ConfigMap"}
2021-07-06T04:39:23.765Z	INFO	helm.controller	Watching dependent resource	{"ownerApiVersion": "charts.my.domain/v1alpha1", "ownerKind": "Loop", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.765Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.765Z	INFO	helm.controller	Installed release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T04:39:23.765Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "default", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.765Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "local-path-storage", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.765Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "extension-apiserver-authentication", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
+---
2021-07-06T04:39:23.765Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
+# Source: loop/templates/config.yaml
2021-07-06T04:39:23.765Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kubelet-config-1.21", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
+apiVersion: v1
2021-07-06T04:39:23.765Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-proxy", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
+kind: ConfigMap
+metadata:
2021-07-06T04:39:23.765Z	DEBUG	helm.controller	Config values	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "values": {}}
+  name: testmap
+data:
+  test-key: "test-value"

2021-07-06T04:39:23.765Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "operator-manager-config", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.766Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "testmap", "namespace": "loop-install", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.766Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "coredns", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.766Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-node-lease", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.766Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "cluster-info", "namespace": "kube-public", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.766Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kubeadm-config", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.766Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-public", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.766Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.766Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "local-path-config", "namespace": "local-path-storage", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.768Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "loop-install", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:23.864Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T04:39:23.971Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T04:39:24.390Z	ERROR	controller-runtime.manager.controller.loop-controller	Reconciler error	{"name": "loop-sample", "namespace": "loop-install", "error": "Operation cannot be fulfilled on loops.charts.my.domain \"loop-sample\": the object has been modified; please apply your changes to the latest version and try again"}
github.com/go-logr/zapr.(*zapLogger).Error
	/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:132
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:302
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:253
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.2
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:216
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:185
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:155
k8s.io/apimachinery/pkg/util/wait.BackoffUntil
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:156
k8s.io/apimachinery/pkg/util/wait.JitterUntil
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:185
k8s.io/apimachinery/pkg/util/wait.UntilWithContext
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:99
2021-07-06T04:39:24.390Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T04:39:24.471Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T04:39:24.480Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T04:39:24.574Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T04:39:24.681Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:26.694Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:28.714Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:30.748Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:32.769Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:34.769Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:36.790Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:38.808Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:40.823Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:42.843Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:44.861Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:46.876Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:48.894Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:50.909Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:52.922Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:54.952Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:56.969Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:39:59.007Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:01.026Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:03.053Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:05.037Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:07.052Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:09.068Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:11.086Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:13.107Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:15.124Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:17.142Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:19.159Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:21.179Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:23.194Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:24.424Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T04:40:24.453Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T04:40:25.212Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:27.232Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:29.246Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:31.262Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:33.277Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:35.260Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:37.275Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:39.290Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:41.308Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:43.326Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:45.345Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:47.360Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:49.389Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:51.409Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:53.425Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:55.442Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:57.458Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:40:59.477Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:01.492Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:03.517Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:05.500Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:07.517Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:09.535Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:11.554Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:13.572Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:15.590Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:17.611Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:19.630Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
x	2021-07-06T04:41:21.654Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:23.669Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:24.449Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T04:41:24.643Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T04:41:25.688Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:27.707Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:29.724Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:31.742Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T04:41:33.755Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}

Heres a similar run from version 1.8.0 for comparison

2021-07-05T20:46:32.655Z	INFO	cmd	Version	{"Go Version": "go1.16.5", "GOOS": "linux", "GOARCH": "amd64", "helm-operator": "v1.8.0", "commit": "d3bd87c6900f70b7df618340e1d63329c7cd651e"}
2021-07-05T20:46:32.656Z	INFO	cmd	Watch namespaces not configured by environment variable WATCH_NAMESPACE or file. Watching all namespaces.	{"Namespace": ""}
2021-07-05T20:46:33.358Z	INFO	controller-runtime.metrics	metrics server is starting to listen	{"addr": "127.0.0.1:8080"}
2021-07-05T20:46:33.359Z	INFO	helm.controller	Watching resource	{"apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "namespace": "", "reconcilePeriod": "1m0s"}
I0705 20:46:33.454779       1 leaderelection.go:243] attempting to acquire leader lease operator-system/operator...
2021-07-05T20:46:33.455Z	INFO	controller-runtime.manager	starting metrics server	{"path": "/metrics"}
I0705 20:46:33.468834       1 leaderelection.go:253] successfully acquired lease operator-system/operator
2021-07-05T20:46:33.468Z	DEBUG	controller-runtime.manager.events	Normal	{"object": {"kind":"ConfigMap","namespace":"operator-system","name":"operator","uid":"b0bfe8f1-96cd-4b29-91f1-41bb32e0f074","apiVersion":"v1","resourceVersion":"621"}, "reason": "LeaderElection", "message": "operator-controller-manager-58b5c65cb8-xlf9w_21f0a77c-a83f-401c-8867-b855a0638ad6 became leader"}
2021-07-05T20:46:33.469Z	INFO	controller-runtime.manager.controller.loop-controller	Starting EventSource	{"source": "kind source: charts.my.domain/v1alpha1, Kind=Loop"}
2021-07-05T20:46:33.570Z	INFO	controller-runtime.manager.controller.loop-controller	Starting Controller
2021-07-05T20:46:33.570Z	INFO	controller-runtime.manager.controller.loop-controller	Starting workers	{"worker count": 6}
2021-07-05T20:46:46.527Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-05T20:46:48.671Z	DEBUG	helm.controller	Adding finalizer	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "finalizer": "helm.sdk.operatorframework.io/uninstall-release"}
2021-07-05T20:46:48.680Z	INFO	controller-runtime.manager.controller.loop-controller	Starting EventSource	{"source": "kind source: /v1, Kind=ConfigMap"}
+---
+# Source: loop/templates/config.yaml
2021-07-05T20:46:48.781Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "coredns", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.781Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "testmap", "namespace": "loop-install", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.782Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-proxy", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.782Z	INFO	helm.controller	Watching dependent resource	{"ownerApiVersion": "charts.my.domain/v1alpha1", "ownerKind": "Loop", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.782Z	INFO	helm.controller	Installed release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
+apiVersion: v1
2021-07-05T20:46:48.782Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
+kind: ConfigMap
2021-07-05T20:46:48.782Z	DEBUG	helm.controller	Config values	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "values": {}}
2021-07-05T20:46:48.782Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kubelet-config-1.21", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.782Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.782Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "operator-manager-config", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
+metadata:
2021-07-05T20:46:48.782Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-public", "apiVersion": "v1", "kind": "ConfigMap"}
+  name: testmap
2021-07-05T20:46:48.782Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kubeadm-config", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
+data:
2021-07-05T20:46:48.782Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "default", "apiVersion": "v1", "kind": "ConfigMap"}
+  test-key: "test-value"
2021-07-05T20:46:48.782Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}

2021-07-05T20:46:48.782Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "cluster-info", "namespace": "kube-public", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.783Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-node-lease", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.786Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "local-path-storage", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.787Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "loop-install", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.789Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "local-path-config", "namespace": "local-path-storage", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.789Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "extension-apiserver-authentication", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:48.854Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-05T20:46:49.961Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:51.365Z	INFO	helm.controller	Upgraded release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "force": false}
2021-07-05T20:46:51.365Z	DEBUG	helm.controller	Config values	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "values": {}}
 ---
 # Source: loop/templates/config.yaml
 apiVersion: v1
 kind: ConfigMap
 metadata:
   name: testmap
 data:
   test-key: "test-value"

2021-07-05T20:46:51.455Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-05T20:46:52.455Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:54.554Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
 ---
 # Source: loop/templates/config.yaml
 apiVersion: v1
 kind: ConfigMap
 metadata:
   name: testmap
 data:
   test-key: "test-value"
2021-07-05T20:46:54.671Z	INFO	helm.controller	Upgraded release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "force": false}

2021-07-05T20:46:54.672Z	DEBUG	helm.controller	Config values	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "values": {}}
2021-07-05T20:46:56.534Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:46:58.553Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:00.572Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:02.589Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:04.610Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:06.628Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:08.640Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:10.658Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:12.674Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:14.691Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:16.709Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:18.723Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:20.738Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:22.751Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:24.774Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:26.759Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:28.775Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:30.794Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:32.812Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:34.829Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:36.846Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:38.863Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:40.880Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:42.894Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:44.917Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:46.938Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:48.787Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-05T20:47:49.288Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:51.487Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
 ---
 # Source: loop/templates/config.yaml
 apiVersion: v1
2021-07-05T20:47:51.786Z	INFO	helm.controller	Upgraded release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "force": false}
2021-07-05T20:47:51.786Z	DEBUG	helm.controller	Config values	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "values": {}}
 kind: ConfigMap
 metadata:
   name: testmap
 data:
   test-key: "test-value"

2021-07-05T20:47:53.508Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:55.526Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:57.509Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:47:59.525Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:01.545Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:03.560Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:05.579Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:07.598Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:09.613Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:11.634Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:13.653Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:15.671Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:17.686Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:19.703Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:21.719Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:23.767Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:25.782Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:27.769Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-05T20:48:29.786Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}

@danquah
Copy link

danquah commented Jul 6, 2021

I just ran the test again and got the bug again. Don't know if something changed between df83db7 and a16ce91 ? I'll be AFK for an hour or so and then I'll try the test again. For reference, this is the script I use for testing:

#!/usr/bin/env bash
set -exuo pipefail
IFS=$'\n\t'

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd "${SCRIPT_DIR}"

# Clone and build the operator sdk
if [[ ! -d operator-sdk ]]; then
  git clone [email protected]:operator-framework/operator-sdk.git
fi
cd operator-sdk

# Modify the following to check out the revision you want to test.
# Make sure we're in sync with head of the branch we're trackingt || true
git remote add cndoit18 [email protected]:cndoit18/operator-sdk.git || true
git checkout --track cndoit18/fix-issue-5041 || true
git fetch cndoit18
git reset --hard cndoit18/fix-issue-5041
cd -

# Create the chart, clearing out old versions.
if [[ -d chart ]]; then
  rm -fr chart
fi
mkdir -p chart/helmloop/templates
  cat <<EOF > chart/helmloop/Chart.yaml
apiVersion: v2
appVersion: 1.0
description: test chart
name: loop
type: application
version: 1.0
EOF

cat <<EOF > chart/helmloop/templates/config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: testmap
data:
  test-key: "test-value"
EOF

touch chart/helmloop/values.yaml
touch chart/helmloop/NOTES.txt

# Build the operator-sdk cli and the base-image we'll need for the operator.
cd operator-sdk
make build
make image/helm-operator
cd -

# Remove built operator if it exists.
if [[ -d operator ]]; then
  rm -fr operator
fi
mkdir operator
cd operator

# Create an operator for the chart
../operator-sdk/build/operator-sdk init --plugins helm --helm-chart ../chart/helmloop/

# Overwrite the dockerfile, in effect just updating the FROM. This allows us
# to inject our previously built base image.
cat <<EOF >./Dockerfile
# Build the manager binary
FROM quay.io/operator-framework/helm-operator:dev
# FROM quay.io/operator-framework/helm-operator:v1.8.0

ENV HOME=/opt/helm
COPY watches.yaml ${HOME}/watches.yaml
COPY helm-charts  ${HOME}/helm-charts
WORKDIR ${HOME}
EOF

# Add debugging.
cat <<EOF >>./config/default/kustomization.yaml
patches:
- patch: |-
    - op: add
      path: /spec/template/spec/containers/1/args/-
      value: --zap-devel
    - op: add
      path: /spec/template/spec/containers/1/imagePullPolicy
      value: IfNotPresent
  target:
    kind: Deployment
EOF

# Build the operator docker image
make docker-build

# Setup the cluster
kind delete cluster --name helmloop || true
kind create cluster --name helmloop

# Load our operator docker image
kind load docker-image --name helmloop controller:latest

# Deploy, wait for it to be ready
make install deploy
kubectl wait --namespace operator-system \
  --for=condition=ready pod \
  --timeout="60s" \
  --selector="control-plane=controller-manager"

# Install a single instance of our crd.
kubectl create namespace loop-install
kubectl apply -n loop-install -f config/samples/charts_*

# Monitor the managers logs for looping.
kubectl -n operator-system logs deployment/operator-controller-manager -c manager -f

@cndoit18
Copy link
Contributor Author

cndoit18 commented Jul 6, 2021

@danquah Thank you very much, I will verify it against your script

@cndoit18 cndoit18 force-pushed the fix-issue-5041 branch 5 times, most recently from 5e0971f to 7dc744f Compare July 6, 2021 07:01
@cndoit18
Copy link
Contributor Author

cndoit18 commented Jul 6, 2021

I have verified it, please try again @danquah

@danquah
Copy link

danquah commented Jul 6, 2021

I'll give it a whirl - brb

@cndoit18 cndoit18 force-pushed the fix-issue-5041 branch 2 times, most recently from c8f2f22 to caced7a Compare July 6, 2021 07:25
@danquah
Copy link

danquah commented Jul 6, 2021

New test-run of commit c8f2f22 - seems to work - I'll do a new run of caced7a and report back ...

2021-07-06T07:27:51.551Z	INFO	cmd	Version	{"Go Version": "go1.16.5", "GOOS": "linux", "GOARCH": "amd64", "helm-operator": "v1.9.0+git", "commit": "c8f2f220fcb335dcb748e90a03ce6530591501f4"}
2021-07-06T07:27:51.552Z	INFO	cmd	Watch namespaces not configured by environment variable WATCH_NAMESPACE or file. Watching all namespaces.	{"Namespace": ""}
2021-07-06T07:27:52.461Z	INFO	controller-runtime.metrics	metrics server is starting to listen	{"addr": "127.0.0.1:8080"}
2021-07-06T07:27:52.552Z	INFO	helm.controller	Watching resource	{"apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "namespace": "", "reconcilePeriod": "1m0s"}
I0706 07:27:52.553440       1 leaderelection.go:243] attempting to acquire leader lease operator-system/operator...
2021-07-06T07:27:52.553Z	INFO	controller-runtime.manager	starting metrics server	{"path": "/metrics"}
I0706 07:27:52.572550       1 leaderelection.go:253] successfully acquired lease operator-system/operator
2021-07-06T07:27:52.651Z	DEBUG	controller-runtime.manager.events	Normal	{"object": {"kind":"ConfigMap","namespace":"operator-system","name":"operator","uid":"c2b1bd34-0645-408e-8d99-f5f1642b146a","apiVersion":"v1","resourceVersion":"641"}, "reason": "LeaderElection", "message": "operator-controller-manager-58b5c65cb8-d2dnn_0bd40cf1-866a-40ae-a855-4f28cf44d6ba became leader"}
2021-07-06T07:27:52.655Z	INFO	controller-runtime.manager.controller.loop-controller	Starting EventSource	{"source": "kind source: charts.my.domain/v1alpha1, Kind=Loop"}
2021-07-06T07:27:52.950Z	INFO	controller-runtime.manager.controller.loop-controller	Starting Controller
2021-07-06T07:27:52.951Z	INFO	controller-runtime.manager.controller.loop-controller	Starting workers	{"worker count": 6}
2021-07-06T07:28:11.891Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T07:28:15.326Z	DEBUG	helm.controller	Adding finalizer	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "finalizer": "helm.sdk.operatorframework.io/uninstall-release"}
2021-07-06T07:28:15.343Z	INFO	controller-runtime.manager.controller.loop-controller	Starting EventSource	{"source": "kind source: /v1, Kind=ConfigMap"}
+---
2021-07-06T07:28:15.516Z	INFO	helm.controller	Watching dependent resource	{"ownerApiVersion": "charts.my.domain/v1alpha1", "ownerKind": "Loop", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "coredns", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.516Z	INFO	helm.controller	Installed release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "default", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kubeadm-config", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
+# Source: loop/templates/config.yaml
2021-07-06T07:28:15.516Z	DEBUG	helm.controller	Config values	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "values": {}}
+apiVersion: v1
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-public", "apiVersion": "v1", "kind": "ConfigMap"}
+kind: ConfigMap
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-node-lease", "apiVersion": "v1", "kind": "ConfigMap"}
+metadata:
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "loop-install", "apiVersion": "v1", "kind": "ConfigMap"}
+  name: testmap
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
+data:
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "extension-apiserver-authentication", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "testmap", "namespace": "loop-install", "apiVersion": "v1", "kind": "ConfigMap"}
+  test-key: "test-value"

2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kubelet-config-1.21", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "operator-manager-config", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "cluster-info", "namespace": "kube-public", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-proxy", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "local-path-config", "namespace": "local-path-storage", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.518Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "local-path-storage", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.539Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T07:28:15.719Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T07:28:15.753Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T07:28:15.919Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T07:28:16.333Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:18.351Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:20.381Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:22.406Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:24.557Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:26.584Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:28.631Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:30.682Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:32.728Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:34.761Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:36.790Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:38.823Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:40.813Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:42.839Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:44.859Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:46.882Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:48.903Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:50.946Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:52.968Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:54.993Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:57.090Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:59.115Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:01.136Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:03.161Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:05.181Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:07.681Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:09.699Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:11.723Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:13.736Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:15.472Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T07:29:15.552Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T07:29:15.770Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:17.782Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:19.798Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:21.844Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:23.960Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:25.979Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:28.010Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:30.030Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:32.117Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:34.136Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:36.156Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:38.193Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:40.217Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:42.208Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:44.225Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:46.244Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:48.257Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:50.273Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:52.289Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:54.313Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:56.338Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:58.356Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:00.372Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:02.401Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:04.426Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:06.442Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:08.458Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:10.486Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:12.470Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:14.503Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:15.494Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T07:30:15.692Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T07:30:16.523Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:18.541Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:20.595Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:22.620Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:24.641Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:26.657Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}

@cndoit18 cndoit18 marked this pull request as draft July 6, 2021 07:45
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 6, 2021
@cndoit18
Copy link
Contributor Author

cndoit18 commented Jul 6, 2021

New test-run of commit c8f2f22 - seems to work - I'll do a new run of caced7a and report back ...

2021-07-06T07:27:51.551Z	INFO	cmd	Version	{"Go Version": "go1.16.5", "GOOS": "linux", "GOARCH": "amd64", "helm-operator": "v1.9.0+git", "commit": "c8f2f220fcb335dcb748e90a03ce6530591501f4"}
2021-07-06T07:27:51.552Z	INFO	cmd	Watch namespaces not configured by environment variable WATCH_NAMESPACE or file. Watching all namespaces.	{"Namespace": ""}
2021-07-06T07:27:52.461Z	INFO	controller-runtime.metrics	metrics server is starting to listen	{"addr": "127.0.0.1:8080"}
2021-07-06T07:27:52.552Z	INFO	helm.controller	Watching resource	{"apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "namespace": "", "reconcilePeriod": "1m0s"}
I0706 07:27:52.553440       1 leaderelection.go:243] attempting to acquire leader lease operator-system/operator...
2021-07-06T07:27:52.553Z	INFO	controller-runtime.manager	starting metrics server	{"path": "/metrics"}
I0706 07:27:52.572550       1 leaderelection.go:253] successfully acquired lease operator-system/operator
2021-07-06T07:27:52.651Z	DEBUG	controller-runtime.manager.events	Normal	{"object": {"kind":"ConfigMap","namespace":"operator-system","name":"operator","uid":"c2b1bd34-0645-408e-8d99-f5f1642b146a","apiVersion":"v1","resourceVersion":"641"}, "reason": "LeaderElection", "message": "operator-controller-manager-58b5c65cb8-d2dnn_0bd40cf1-866a-40ae-a855-4f28cf44d6ba became leader"}
2021-07-06T07:27:52.655Z	INFO	controller-runtime.manager.controller.loop-controller	Starting EventSource	{"source": "kind source: charts.my.domain/v1alpha1, Kind=Loop"}
2021-07-06T07:27:52.950Z	INFO	controller-runtime.manager.controller.loop-controller	Starting Controller
2021-07-06T07:27:52.951Z	INFO	controller-runtime.manager.controller.loop-controller	Starting workers	{"worker count": 6}
2021-07-06T07:28:11.891Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T07:28:15.326Z	DEBUG	helm.controller	Adding finalizer	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "finalizer": "helm.sdk.operatorframework.io/uninstall-release"}
2021-07-06T07:28:15.343Z	INFO	controller-runtime.manager.controller.loop-controller	Starting EventSource	{"source": "kind source: /v1, Kind=ConfigMap"}
+---
2021-07-06T07:28:15.516Z	INFO	helm.controller	Watching dependent resource	{"ownerApiVersion": "charts.my.domain/v1alpha1", "ownerKind": "Loop", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "coredns", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.516Z	INFO	helm.controller	Installed release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "default", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kubeadm-config", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
+# Source: loop/templates/config.yaml
2021-07-06T07:28:15.516Z	DEBUG	helm.controller	Config values	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample", "values": {}}
+apiVersion: v1
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-public", "apiVersion": "v1", "kind": "ConfigMap"}
+kind: ConfigMap
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-node-lease", "apiVersion": "v1", "kind": "ConfigMap"}
+metadata:
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "loop-install", "apiVersion": "v1", "kind": "ConfigMap"}
+  name: testmap
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
+data:
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "extension-apiserver-authentication", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.516Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "testmap", "namespace": "loop-install", "apiVersion": "v1", "kind": "ConfigMap"}
+  test-key: "test-value"

2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kubelet-config-1.21", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "operator-manager-config", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "cluster-info", "namespace": "kube-public", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-proxy", "namespace": "kube-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.517Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "local-path-config", "namespace": "local-path-storage", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.518Z	DEBUG	predicate	Skipping reconciliation for dependent resource creation	{"name": "kube-root-ca.crt", "namespace": "local-path-storage", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:15.539Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T07:28:15.719Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T07:28:15.753Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T07:28:15.919Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T07:28:16.333Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:18.351Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:20.381Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:22.406Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:24.557Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:26.584Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:28.631Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:30.682Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:32.728Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:34.761Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:36.790Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:38.823Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:40.813Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:42.839Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:44.859Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:46.882Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:48.903Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:50.946Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:52.968Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:54.993Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:57.090Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:28:59.115Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:01.136Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:03.161Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:05.181Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:07.681Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:09.699Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:11.723Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:13.736Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:15.472Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T07:29:15.552Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T07:29:15.770Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:17.782Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:19.798Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:21.844Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:23.960Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:25.979Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:28.010Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:30.030Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:32.117Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:34.136Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:36.156Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:38.193Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:40.217Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:42.208Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:44.225Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:46.244Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:48.257Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:50.273Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:52.289Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:54.313Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:56.338Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:29:58.356Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:00.372Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:02.401Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:04.426Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:06.442Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:08.458Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:10.486Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:12.470Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:14.503Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:15.494Z	DEBUG	helm.controller	Reconciling	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop"}
2021-07-06T07:30:15.692Z	INFO	helm.controller	Reconciled release	{"namespace": "loop-install", "name": "loop-sample", "apiVersion": "charts.my.domain/v1alpha1", "kind": "Loop", "release": "loop-sample"}
2021-07-06T07:30:16.523Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:18.541Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:20.595Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:22.620Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:24.641Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}
2021-07-06T07:30:26.657Z	DEBUG	predicate	Reconciling due to dependent resource update	{"name": "operator", "namespace": "operator-system", "apiVersion": "v1", "kind": "ConfigMap"}

Please wait a moment, I'll verify the other cases

@cndoit18 cndoit18 marked this pull request as ready for review July 6, 2021 08:26
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 6, 2021
@cndoit18
Copy link
Contributor Author

cndoit18 commented Jul 6, 2021

@danquah It has solved. 👋

@danquah
Copy link

danquah commented Jul 6, 2021

Awesome! - I'll run a test right away and report back.

@cndoit18 cndoit18 force-pushed the fix-issue-5041 branch 2 times, most recently from 710da63 to ca0e907 Compare July 6, 2021 08:33
@cndoit18
Copy link
Contributor Author

cndoit18 commented Jul 6, 2021

I will use this script to check #4937
thank you @danquah

#!/usr/bin/env bash
set -exuo pipefail
IFS=$'\n\t'

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd "${SCRIPT_DIR}"

# Clone and build the operator sdk
if [[ ! -d operator-sdk ]]; then
  git clone [email protected]:operator-framework/operator-sdk.git
fi
cd operator-sdk

# Modify the following to check out the revision you want to test.
# Make sure we're in sync with head of the branch we're trackingt || true
git remote add cndoit18 [email protected]:cndoit18/operator-sdk.git || true
git checkout --track cndoit18/fix-issue-5041 || true
git fetch cndoit18
git reset --hard cndoit18/fix-issue-5041
cd -

# Create the chart, clearing out old versions.
if [[ -d chart ]]; then
  rm -fr chart
fi
mkdir -p chart/helmloop/templates
  cat <<EOF > chart/helmloop/Chart.yaml
apiVersion: v2
appVersion: 1.0
description: test chart
name: loop
type: application
version: 1.0
EOF

cat <<EOF > chart/helmloop/templates/config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: testmap
data:
  test-key: {{ randAlphaNum 10 | quote }}
EOF

touch chart/helmloop/values.yaml
touch chart/helmloop/NOTES.txt

# Build the operator-sdk cli and the base-image we'll need for the operator.
cd operator-sdk
make build
make image/helm-operator
cd -

# Remove built operator if it exists.
if [[ -d operator ]]; then
  rm -fr operator
fi
mkdir operator
cd operator

# Create an operator for the chart
../operator-sdk/build/operator-sdk init --plugins helm --helm-chart ../chart/helmloop/

# Overwrite the dockerfile, in effect just updating the FROM. This allows us
# to inject our previously built base image.
cat <<EOF >./Dockerfile
# Build the manager binary
FROM quay.io/operator-framework/helm-operator:dev
# FROM quay.io/operator-framework/helm-operator:v1.8.0

ENV HOME=/opt/helm
COPY watches.yaml ${HOME}/watches.yaml
COPY helm-charts  ${HOME}/helm-charts
WORKDIR ${HOME}
EOF

# Add debugging.
cat <<EOF >>./config/default/kustomization.yaml
patches:
- patch: |-
    - op: add
      path: /spec/template/spec/containers/1/args/-
      value: --zap-devel
    - op: add
      path: /spec/template/spec/containers/1/imagePullPolicy
      value: IfNotPresent
  target:
    kind: Deployment
EOF

# Build the operator docker image
make docker-build

# Setup the cluster
kind delete cluster --name helmloop || true
kind create cluster --name helmloop

# Load our operator docker image
kind load docker-image --name helmloop controller:latest

# Deploy, wait for it to be ready
make install deploy
kubectl wait --namespace operator-system \
  --for=condition=ready pod \
  --timeout="60s" \
  --selector="control-plane=controller-manager"

# Install a single instance of our crd.
kubectl create namespace loop-install
kubectl apply -n loop-install -f config/samples/charts_*

# Monitor the managers logs for looping.
kubectl -n operator-system logs deployment/operator-controller-manager -c manager -f

@danquah
Copy link

danquah commented Jul 6, 2021

You are most welcome and thank you for your hard work 🙏🏾

@estroz estroz merged commit 57ac0fe into operator-framework:master Jul 6, 2021
@estroz
Copy link
Member

estroz commented Jul 6, 2021

/cherry-pick v1.8.x

@estroz
Copy link
Member

estroz commented Jul 6, 2021

/cherry-pick v1.9.x

@openshift-cherrypick-robot

@estroz: new pull request created: #5045

In response to this:

/cherry-pick v1.8.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-cherrypick-robot

@estroz: new pull request created: #5046

In response to this:

/cherry-pick v1.9.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@joelanford
Copy link
Member

@cndoit18 Sorry I didn't see this and comment sooner. It looks like we're now using the templating inputs in our comparisons (i.e. the chart and the config) rather than the output (the resulting manifest).

I'm curious if you considered cases where changes to the templating execution itself could cause a template to be rendered differently such that comparing just the chart and config would be insufficient?

For example, perhaps a helm release pulls in a new version of the sprig template library that fixes a bug in the way a template works. Or perhaps the helm-operator introduces a post-renderer that injects some custom labels or annotations necessary for a new helm-operator feature to work.

In either of these cases, a user may upgrade their operator to pull these changes in, but then not actually receive a Helm release upgrade until they make a change somewhere in their chart or custom object's spec.

@cndoit18
Copy link
Contributor Author

cndoit18 commented Jul 6, 2021

@cndoit18 Sorry I didn't see this and comment sooner. It looks like we're now using the templating inputs in our comparisons (i.e. the chart and the config) rather than the output (the resulting manifest).

I'm curious if you considered cases where changes to the templating execution itself could cause a template to be rendered differently such that comparing just the chart and config would be insufficient?

For example, perhaps a helm release pulls in a new version of the sprig template library that fixes a bug in the way a template works. Or perhaps the helm-operator introduces a post-renderer that injects some custom labels or annotations necessary for a new helm-operator feature to work.

In either of these cases, a user may upgrade their operator to pull these changes in, but then not actually receive a Helm release upgrade until they make a change somewhere in their chart or custom object's spec.

It is possible, I will read the helm code carefully and come up with a better solution. thank you

@cndoit18 cndoit18 deleted the fix-issue-5041 branch July 6, 2021 23:39
cndoit18 added a commit to cndoit18/operator-sdk that referenced this pull request Jul 14, 2021
cndoit18 added a commit to cndoit18/operator-sdk that referenced this pull request Jul 14, 2021
cndoit18 added a commit to cndoit18/operator-sdk that referenced this pull request Jul 14, 2021
cndoit18 added a commit to cndoit18/operator-sdk that referenced this pull request Jul 14, 2021
cndoit18 added a commit to cndoit18/operator-sdk that referenced this pull request Jul 14, 2021
cndoit18 added a commit to cndoit18/operator-sdk that referenced this pull request Jul 14, 2021
cndoit18 added a commit to cndoit18/operator-sdk that referenced this pull request Jul 14, 2021
cndoit18 added a commit to cndoit18/operator-sdk that referenced this pull request Jul 15, 2021
varshaprasad96 added a commit to varshaprasad96/operator-sdk that referenced this pull request Jul 28, 2021
This PR reverts:
1. Revert release equality comparison logic
ref: operator-framework#5042
2. Changes made to the updated logic which caused charts to upgrade constantly -
ref: operator-framework#4937

Signed-off-by: varshaprasad96 <[email protected]>
varshaprasad96 added a commit to varshaprasad96/operator-sdk that referenced this pull request Aug 2, 2021
This reverts commit 57ac0fe.

Signed-off-by: varshaprasad96 <[email protected]>
varshaprasad96 added a commit that referenced this pull request Aug 3, 2021
* Revert "fix: issue-5041 (#5042)"

This reverts commit 57ac0fe.

Signed-off-by: varshaprasad96 <[email protected]>

* Revert "fix(helm): properly compare existing and candidate releases (#4937)"

This reverts commit cae12a2.

Signed-off-by: varshaprasad96 <[email protected]>

* add changelog fragment

Signed-off-by: varshaprasad96 <[email protected]>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/operator-sdk that referenced this pull request Aug 3, 2021
This reverts commit 57ac0fe.

Signed-off-by: varshaprasad96 <[email protected]>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/operator-sdk that referenced this pull request Aug 3, 2021
This reverts commit 57ac0fe.

Signed-off-by: varshaprasad96 <[email protected]>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/operator-sdk that referenced this pull request Aug 3, 2021
This reverts commit 57ac0fe.

Signed-off-by: varshaprasad96 <[email protected]>
bentito pushed a commit to bentito/operator-sdk that referenced this pull request Aug 24, 2021
…ramework#5097)

* Revert "fix: issue-5041 (operator-framework#5042)"

This reverts commit 57ac0fe.

Signed-off-by: varshaprasad96 <[email protected]>

* Revert "fix(helm): properly compare existing and candidate releases (operator-framework#4937)"

This reverts commit cae12a2.

Signed-off-by: varshaprasad96 <[email protected]>

* add changelog fragment

Signed-off-by: varshaprasad96 <[email protected]>
twasyl pushed a commit to twasyl/operator-sdk that referenced this pull request Sep 3, 2021
…ramework#5097)

* Revert "fix: issue-5041 (operator-framework#5042)"

This reverts commit 57ac0fe.

Signed-off-by: varshaprasad96 <[email protected]>

* Revert "fix(helm): properly compare existing and candidate releases (operator-framework#4937)"

This reverts commit cae12a2.

Signed-off-by: varshaprasad96 <[email protected]>

* add changelog fragment

Signed-off-by: varshaprasad96 <[email protected]>
Signed-off-by: Thierry Wasylczenko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm operator logs full deploy yaml every reconcile cycle even when no changes after upgrading to 1.9 from 1.7
6 participants