Skip to content

Conversation

@NickCraver
Copy link
Collaborator

Doing a set of suggestions here following our call - cc @amsoedal! I've just merged up latest, will do a test run here but wanted to get changes to make it a bit more extensible for other clouds and easier to consume in front of your eyes. Philo added some color around the purposes for the public events (makes sense!), so was trying to make using them a bit cleaner on the client side, e.g.:

if (evt is AzureMaintenanceEvent ame && ame.NotificationType == AzureMaintenanceEvent.NotificationTypes.NodeMaintenanceStarting)

The extensibility model would be other cloud providers adding a PR here, which would consist in total of their handler (if different) and adding to the base ServerMaintenanceEvent (not meant to be externally extensible at the moment).

Can you please provide thoughts?

case var _ when key.SequenceEqual(nameof(SSLPort).AsSpan()) && Int32.TryParse(value.ToString(), out var port):
SSLPort = port;
case var _ when key.SequenceEqual("SSLPort".AsSpan()) && int.TryParse(value.ToString(), NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out var port):
SslPort = port;
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest: Do we want to use Format.TryParseInt32() here instead?


/// <summary>
/// IPAddress of the node event is intended for.
/// IPAddress of the node event is intended for
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: delete this old line?

@amsoedal amsoedal self-requested a review October 6, 2021 15:47
@NickCraver NickCraver merged commit b6bb559 into amsoedal/az_maintenance_events Oct 6, 2021
@NickCraver NickCraver deleted the craver/1865-tweaks branch October 6, 2021 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants