Description of problem: In some cases when serving certs were changed, the file observer controller that was part of operator process have not triggered restart of operator. This was because when the serving cert was empty when the operator started, a bug in code caused the to be not observed by file observer at all. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
This was already fixed and verified in master. We don't see this happening anymore.
Since we have comprehensive unit tests that exercise all these scenarios. Will verify this directly. $ oc version Client Version: v4.2.18 Server Version: 4.2.0-0.nightly-2020-02-05-211938 Kubernetes Version: v1.14.6+f0fa3b6 Related test code can cover the fix: $ git clone https://github.com/openshift/library-go.git # or git pull if already cloned $ git branch -a $ cd ~ $ git checkout remotes/origin/release-4.2 $ cd ~/library-go/pkg/controller/fileobserver $ ls observer.go observer_polling.go observer_polling_test.go OWNERS $ go test -v -run TestObserverPolling === RUN TestObserverPolling === RUN TestObserverPolling/start_with_existing_non-empty_file_with_no_change_and_initial_content_set === RUN TestObserverPolling/start_with_existing_non-empty_file_with_no_change_and_no_initial_content_set === RUN TestObserverPolling/start_with_existing_non-empty_file_that_change === RUN TestObserverPolling/start_with_existing_non-empty_file_and_no_initial_content_that_change === RUN TestObserverPolling/start_with_existing_empty_file_with_no_change === RUN TestObserverPolling/start_with_existing_empty_file_and_no_initial_content_with_no_change === RUN TestObserverPolling/start_with_existing_empty_file_that_change_content === RUN TestObserverPolling/start_with_existing_empty_file_and_empty_initial_content_that_change_content === RUN TestObserverPolling/start_with_non-existing_file_with_no_change === RUN TestObserverPolling/start_with_non-existing_file_that_is_created_as_empty_file === RUN TestObserverPolling/start_with_non-existing_file_that_is_created_as_non-empty_file === RUN TestObserverPolling/start_with_existing_file_with_content_that_is_deleted === RUN TestObserverPolling/start_with_existing_file_with_content_and_not_initial_content_set_that_is_deleted --- PASS: TestObserverPolling (5.35s) --- PASS: TestObserverPolling/start_with_existing_non-empty_file_with_no_change_and_initial_content_set (0.41s) observer_polling_test.go:201: created file "/tmp/observer-poll-test681776228/TestObserverPolling/start_with_existing_non-empty_file_with_no_change_and_initial_content_set/testfile" with content: "non-empty" observer_polling_test.go:242: starting observing changes ... --- PASS: TestObserverPolling/start_with_existing_non-empty_file_with_no_change_and_no_initial_content_set (0.41s) observer_polling_test.go:201: created file "/tmp/observer-poll-test681776228/TestObserverPolling/start_with_existing_non-empty_file_with_no_change_and_no_initial_content_set/testfile" with content: "non-empty" observer_polling_test.go:242: starting observing changes ... --- PASS: TestObserverPolling/start_with_existing_non-empty_file_that_change (0.41s) observer_polling_test.go:201: created file "/tmp/observer-poll-test681776228/TestObserverPolling/start_with_existing_non-empty_file_that_change/testfile" with content: "non-empty" observer_polling_test.go:242: starting observing changes ... observer_polling_test.go:245: writing "change" ... observer_polling_test.go:206: observed "file testfile was modified" --- PASS: TestObserverPolling/start_with_existing_non-empty_file_and_no_initial_content_that_change (0.41s) observer_polling_test.go:201: created file "/tmp/observer-poll-test681776228/TestObserverPolling/start_with_existing_non-empty_file_and_no_initial_content_that_change/testfile" with content: "non-empty" observer_polling_test.go:242: starting observing changes ... observer_polling_test.go:245: writing "change" ... observer_polling_test.go:206: observed "file testfile was modified" --- PASS: TestObserverPolling/start_with_existing_empty_file_with_no_change (0.41s) observer_polling_test.go:201: created file "/tmp/observer-poll-test681776228/TestObserverPolling/start_with_existing_empty_file_with_no_change/testfile" with content: "" observer_polling_test.go:242: starting observing changes ... observer_polling_test.go:245: writing "" ... --- PASS: TestObserverPolling/start_with_existing_empty_file_and_no_initial_content_with_no_change (0.41s) observer_polling_test.go:201: created file "/tmp/observer-poll-test681776228/TestObserverPolling/start_with_existing_empty_file_and_no_initial_content_with_no_change/testfile" with content: "" observer_polling_test.go:242: starting observing changes ... observer_polling_test.go:245: writing "" ... --- PASS: TestObserverPolling/start_with_existing_empty_file_that_change_content (0.41s) observer_polling_test.go:201: created file "/tmp/observer-poll-test681776228/TestObserverPolling/start_with_existing_empty_file_that_change_content/testfile" with content: "" observer_polling_test.go:242: starting observing changes ... observer_polling_test.go:245: writing "change" ... observer_polling_test.go:206: observed "file testfile was modified" --- PASS: TestObserverPolling/start_with_existing_empty_file_and_empty_initial_content_that_change_content (0.41s) observer_polling_test.go:201: created file "/tmp/observer-poll-test681776228/TestObserverPolling/start_with_existing_empty_file_and_empty_initial_content_that_change_content/testfile" with content: "" observer_polling_test.go:242: starting observing changes ... observer_polling_test.go:245: writing "change" ... observer_polling_test.go:206: observed "file testfile was modified" --- PASS: TestObserverPolling/start_with_non-existing_file_with_no_change (0.41s) observer_polling_test.go:242: starting observing changes ... --- PASS: TestObserverPolling/start_with_non-existing_file_that_is_created_as_empty_file (0.41s) observer_polling_test.go:242: starting observing changes ... observer_polling_test.go:245: writing "" ... observer_polling_test.go:206: observed "file testfile was created" --- PASS: TestObserverPolling/start_with_non-existing_file_that_is_created_as_non-empty_file (0.41s) observer_polling_test.go:242: starting observing changes ... observer_polling_test.go:245: writing "non-empty" ... observer_polling_test.go:206: observed "file testfile was created" --- PASS: TestObserverPolling/start_with_existing_file_with_content_that_is_deleted (0.41s) observer_polling_test.go:201: created file "/tmp/observer-poll-test681776228/TestObserverPolling/start_with_existing_file_with_content_that_is_deleted/testfile" with content: "non-empty" observer_polling_test.go:242: starting observing changes ... observer_polling_test.go:206: observed "file testfile was deleted" --- PASS: TestObserverPolling/start_with_existing_file_with_content_and_not_initial_content_set_that_is_deleted (0.41s) observer_polling_test.go:201: created file "/tmp/observer-poll-test681776228/TestObserverPolling/start_with_existing_file_with_content_and_not_initial_content_set_that_is_deleted/testfile" with content: "non-empty" observer_polling_test.go:242: starting observing changes ... observer_polling_test.go:206: observed "file testfile was deleted" PASS ok _/home/kewang/work/testing/library-go/pkg/controller/fileobserver 5.348s We can see all related test cases have been passed.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:0395