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
Move DNS provider initialization to DNS controller #417
Move DNS provider initialization to DNS controller #417
Conversation
} | ||
|
||
// Initialize or re-initialize the DNS provider. | ||
if r.infraConfig == nil || !reflect.DeepEqual(infraConfig.Spec, r.infraConfig.Spec) || !reflect.DeepEqual(infraConfig.Status, r.infraConfig.Status) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Miciah why is it necessary to compare spec of configv1.Infrastructure
? According to the EP, operators should use status:
But since the users are going to be specifying the service endpoints for APIs, there is chance of user error and operators picking up invalid or incorrect information. Therefore, the service endpoints will be mirrored to the status section after basic validations by a [controller][TODO-link-to-section] and the cluster operators will use the information from the status section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've removed the || !reflect.DeepEqual(infraConfig.Spec, r.infraConfig.Spec)
.
b837a23
to
a5ef198
Compare
* 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.
e2e-aws-operator failed on |
a5ef198
to
476710f
Compare
Failed to provision the cluster. /test e2e-aws-operator |
Failed on |
// configuration. | ||
func (r *reconciler) createDNSProvider(dnsConfig *configv1.DNS, platformStatus *configv1.PlatformStatus) (dns.Provider, error) { | ||
// If no DNS configuration is provided, don't try to set up provider clients. | ||
// TODO: the provider configuration can be refactored into the provider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to work on this TODO now, since the DNS controller is already being moved around? If you think this would be helpful at the moment, I could work on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I guess it would make sense to wait til #416 is finished to make things less confusing, but that's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to work on this TODO now, since the DNS controller is already being moved around?
I prefer that the TODO is addressed in a separate PR due to time constraints and to keep this PR focused on the refactor needed for supporting AWS/Azure custom endpoints.
/test e2e-aws-operator If this continues, we may need to bump the timeout in waitForRouteIngressConditions(). |
#400 should fix it. (Hint hint! * grin *.) |
Same failure as #417 (comment). Retesting since #400 has yet to merge (waiting for CI to pass) and hopefully we get lucky. If not, hold until #400 merges. |
/test e2e-aws-operator |
Failed on |
Now that #400 has merged, let's try again. /test e2e-aws-operator |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danehans, Miciah 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 |
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 theDNS
config andInfrastructure
config objects. UseToDNSRecords
mapper function to reconcile allDNSRecord
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
): AddConfig
andinfraConfig
fields.(
Reconcile
): Get the clusterInfrastructure
config object, and initialize or re-initialize the DNS provider if it was not already initialized or if theInfrastructure
config has changed.(
ToDNSRecords
): New method. Return reconcilation requests for allDNSRecords
.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 thednses
andinfrastructures
config resources.pkg/manifests/bindata.go
: Regenerate.