Skip to content
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

[release-4.5] Bug 1868257: dns: Reread cloud credentials secret if it changes #443

Conversation

Miciah
Copy link
Contributor

@Miciah Miciah commented Aug 22, 2020

Manual cherry-pick of #417, #421, and #425.

Improve the logging in the DNS controller and DNS provider implementations
to improve visibility into the controller's operation and to avoid printing
old and possibly misleading status during reconciliation.

* pkg/dns/aws/dns.go (change):
* pkg/dns/azure/dns.go (Ensure, Delete): Log the dnsrecord's spec but not
its status because the controller only updates the status after ensuring or
deleting the dnsrecord.  Log the zone along with the dnsrecord's spec.
* pkg/operator/controller/dns/controller.go (Reconcile): Log when beginning
reconciliation.  When updating the status, log the updated dnsrecord rather
than the old dnsrecord (with the old status), and always log when updating
(not only when the update fails).
(publishRecordToZones): Log when skipping a zone.  Log the dnsrecord's
spec but not its status because the controller only updates the status
after publishRecordToZones returns.
* cmd/ingress-operator/start.go (NewStartCommand): Delete initialization of
the DNS provider.
(cloudCredentialsSecretName, createDNSProvider, getPlatformStatus): Move
from here...
* pkg/operator/controller/dns/controller.go: ...to here.
(New): Delete parameter for DNS provider; the controller now initializes
it.  Add config parameter.  Add watches on the DNS config and
Infrastructure config objects.  Use ToDNSRecords mapper function to
reconcile all DNSRecord objects when a config object changes.
(Config): New type to hold the namespace and operator release version,
which are needed for initializing the DNS provider.
(reconciler): Add Config and infraConfig fields.
(Reconcile): Get the cluster Infrastructure config object, and initialize
or re-initialize the DNS provider if it was not already initialized or if
the Infrastructure config has changed.
(ToDNSRecords): New method.  Return reconcilation requests for all
DNSRecords.
* pkg/operator/operator.go (New): Update initialization of the DNS
controller to pass the controller's config object instead of the DNS
provider object.
* manifests/00-cluster-role.yaml: Allow the operator to list and watch the
dnses and infrastructures config resources.
* pkg/manifests/bindata.go: Regenerate.
Watch the cloud credentials secret and recreate the DNS provider if
the credentials change.

https://bugzilla.redhat.com/show_bug.cgi?id=1854383

This commit fixes bug 1854383.

* pkg/operator/controller/dns/controller.go (New): Watch the cloud
credentials secret and trigger reconciliation if it changes.
(reconciler): Add cloudCredentials field.
(Reconcile): Refactor DNS provider create logic from here...
(createDNSProviderIfNeeded): ...to here.  Check if the cloud credentials
secret data changed in addition to checking the infrastructure status to
determine whether the DNS provider needs to be recreated.
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. label Aug 22, 2020
@openshift-ci-robot
Copy link
Contributor

@Miciah: This pull request references Bugzilla bug 1868257, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.z) matches configured target release for branch (4.5.z)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
  • dependent bug Bugzilla bug 1854383 is in the state VERIFIED, which is one of the valid states (VERIFIED, RELEASE_PENDING, CLOSED (ERRATA))
  • dependent Bugzilla bug 1854383 targets the "4.6.0" release, which is one of the valid target releases: 4.6.0, 4.6.z
  • bug has dependents

In response to this:

Bug 1868257: dns: Reread cloud credentials secret if it changes

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-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Aug 22, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 22, 2020
@Miciah
Copy link
Contributor Author

Miciah commented Aug 22, 2020

TestRouteAdmissionPolicy failed; looks like a test flake.
/test e2e-aws-operator

@Miciah
Copy link
Contributor Author

Miciah commented Aug 22, 2020

Cluster should remain functional during upgrade failed, and I see various kubelet health probes failing. No clear culprit.
/test e2e-aws-upgrade

@Miciah
Copy link
Contributor Author

Miciah commented Aug 22, 2020

/test e2e-aws-upgrade

1 similar comment
@Miciah
Copy link
Contributor Author

Miciah commented Aug 23, 2020

/test e2e-aws-upgrade

@Miciah Miciah changed the title Bug 1868257: dns: Reread cloud credentials secret if it changes [release-4.5] Bug 1868257: dns: Reread cloud credentials secret if it changes Aug 24, 2020
@Miciah
Copy link
Contributor Author

Miciah commented Aug 24, 2020

/test e2e-aws-upgrade

@sgreene570
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 24, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Miciah, sgreene570

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@eparis eparis added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Sep 11, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

6 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit bc26a2b into openshift:release-4.5 Sep 11, 2020
@openshift-ci-robot
Copy link
Contributor

@Miciah: All pull requests linked via external trackers have merged:

Bugzilla bug 1868257 has been moved to the MODIFIED state.

In response to this:

[release-4.5] Bug 1868257: dns: Reread cloud credentials secret if it changes

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants