Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions operatoringress/v1/0000_50_dns-record.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ spec:
description: status is the most recently observed status of the dnsRecord.
type: object
properties:
observedGeneration:
description: observedGeneration is the most recently observed generation
of the DNSRecord. When the DNSRecord is updated, the controller updates
the corresponding record in each managed zone. If an update for a
particular zone fails, that failure is recorded in the status condition
for the zone so that the controller can determine that it needs to
retry the update for that specific zone.
type: integer
format: int64
zones:
description: zones are the status of the record in each zone.
type: array
Expand Down
9 changes: 9 additions & 0 deletions operatoringress/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ type DNSRecordSpec struct {
type DNSRecordStatus struct {
// zones are the status of the record in each zone.
Zones []DNSZoneStatus `json:"zones,omitempty"`

// observedGeneration is the most recently observed generation of the
// DNSRecord. When the DNSRecord is updated, the controller updates the
// corresponding record in each managed zone. If an update for a
// particular zone fails, that failure is recorded in the status
// condition for the zone so that the controller can determine that it
// needs to retry the update for that specific zone.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like different zones could have different observed generations. What happens if some zones are generation 8 and others are at generation 12?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be worthy to move this to DNSZoneCondition to match the direction upstream is heading with https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/1623-standardize-conditions/README.md

Copy link
Contributor Author

@Miciah Miciah May 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like different zones could have different observed generations. What happens if some zones are generation 8 and others are at generation 12?

The current logic is that the controller will see that the generation has changed, update each zone, and update the status for each zone. If updating a zone fails, then the status for that zone will reflect that the update failed, and the next time the controller's control loop runs, it sees that it has a zone with status condition Failed=True and retries the update.

Maybe it would be worthy to move this to DNSZoneCondition to match the direction upstream is heading with https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/1623-standardize-conditions/README.md

That's an interesting proposal. As described above, the controller can do the right thing with a single status.observedGenerate field, but would you like me to change it to status.zones[*].observedGeneration for consistency with the KEP you cited?

}

// DNSZoneStatus is the status of a record within a specific zone.
Expand Down
5 changes: 3 additions & 2 deletions operatoringress/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.