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

Update status message to show upgrade type #7518

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

ahreehong
Copy link
Member

@ahreehong ahreehong commented Feb 8, 2024

Issue #, if available:

Description of changes:
Update cluster status to show RollingUpgradeInProgress when the upgrade type is rollingUpgrade and InPlaceUpgradeInProgress when the upgrade type is inPlace.

For worker nodes, it will show RollingUpgradeInProgress if all nodes have upgrade type rollingUpgrade, InPlaceUpgradeInProgress when the upgrade type is inPlace, and UpgradeInProgress if there is a combination of both upgrade types.

Testing (if applicable):

Status:
  Children Reconciled Generation:  5
  Conditions:
    Last Transition Time:  2024-02-12T20:20:23Z
    Message:               Control plane nodes not up-to-date yet, 3 upgrading (0 up to date)
    Reason:                InPlaceUpgradeInProgress
    Severity:              Info
    Status:                False
    Type:                  Ready
    Last Transition Time:  2024-02-12T19:53:16Z
    Status:                True
    Type:                  ControlPlaneInitialized
    Last Transition Time:  2024-02-12T20:20:23Z
    Message:               Control plane nodes not up-to-date yet, 3 upgrading (0 up to date)
    Reason:                InPlaceUpgradeInProgress
    Severity:              Info
    Status:                False
    Type:                  ControlPlaneReady
    Last Transition Time:  2024-02-12T19:53:30Z
    Status:                True
    Type:                  DefaultCNIConfigured
    Last Transition Time:  2024-02-12T20:13:10Z
    Status:                True
    Type:                  WorkersReady
  Observed Generation:     4
  Reconciled Generation:   3
Events:                    <none>

Documentation added/planned (if applicable):

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@eks-distro-bot eks-distro-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 8, 2024
pkg/controller/clusters/status.go Outdated Show resolved Hide resolved
pkg/controller/clusters/status.go Outdated Show resolved Hide resolved
pkg/controller/clusters/status.go Outdated Show resolved Hide resolved
@ahreehong ahreehong force-pushed the update-status-message branch from b5777a7 to 638bac0 Compare February 12, 2024 17:41
@eks-distro-bot eks-distro-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 12, 2024
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: 31 lines in your changes are missing coverage. Please review.

Comparison is base (4583834) 73.48% compared to head (05f34d8) 73.56%.
Report is 38 commits behind head on main.

Files Patch % Lines
pkg/workflows/management/create_workload.go 0.00% 5 Missing and 1 partial ⚠️
pkg/providers/tinkerbell/validate.go 73.68% 4 Missing and 1 partial ⚠️
release/api/v1alpha1/artifacts.go 0.00% 4 Missing ⚠️
pkg/workflows/management/secrets.go 80.00% 3 Missing ⚠️
pkg/clustermanager/cluster_manager.go 88.23% 2 Missing ⚠️
pkg/providers/nutanix/controlplane.go 92.00% 1 Missing and 1 partial ⚠️
pkg/workflows/workload/create_gitops.go 84.61% 2 Missing ⚠️
pkg/workflows/workload/post_delete.go 84.61% 2 Missing ⚠️
cmd/eksctl-anywhere/cmd/createcluster.go 0.00% 1 Missing ⚠️
cmd/eksctl-anywhere/cmd/deletecluster.go 0.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7518      +/-   ##
==========================================
+ Coverage   73.48%   73.56%   +0.07%     
==========================================
  Files         579      580       +1     
  Lines       36357    36504     +147     
==========================================
+ Hits        26718    26853     +135     
- Misses       7875     7888      +13     
+ Partials     1764     1763       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ahreehong ahreehong force-pushed the update-status-message branch from 638bac0 to da830a5 Compare February 12, 2024 17:47
@eks-distro-bot eks-distro-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 12, 2024
go.mod Outdated Show resolved Hide resolved
@ahreehong ahreehong force-pushed the update-status-message branch from da830a5 to 0c7c00f Compare February 12, 2024 18:00
@eks-distro-bot eks-distro-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 12, 2024
@ahreehong ahreehong force-pushed the update-status-message branch from 0c7c00f to d063115 Compare February 12, 2024 19:06
@eks-distro-bot eks-distro-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 12, 2024
Comment on lines 84 to 90
upgradeReason := anywherev1.RollingUpgradeInProgress
if cluster.Spec.ControlPlaneConfiguration.UpgradeRolloutStrategy != nil {
if cluster.Spec.ControlPlaneConfiguration.UpgradeRolloutStrategy.Type == anywherev1.InPlaceStrategyType {
upgradeReason = anywherev1.InPlaceUpgradeInProgress
}
}
conditions.MarkFalse(cluster, anywherev1.ControlPlaneReadyCondition, upgradeReason, clusterv1.ConditionSeverityInfo, "Etcd is not ready")
Copy link
Member

Choose a reason for hiding this comment

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

InPlace is not supported for external etcd. I'd remove this

@@ -218,7 +230,13 @@ func updateWorkersReadyCondition(cluster *anywherev1.Cluster, machineDeployments
// so reflect that on the conditon with an appropriate message.
totalOutdated := totalReplicas - totalUpdatedReplicas
if totalOutdated > 0 {
conditions.MarkFalse(cluster, anywherev1.WorkersReadyCondition, anywherev1.RollingUpgradeInProgress, clusterv1.ConditionSeverityInfo, "Worker nodes not up-to-date yet, %d rolling (%d up to date)", totalReplicas, totalUpdatedReplicas)
upgradeReason := anywherev1.RollingUpgradeInProgress
if cluster.Spec.ControlPlaneConfiguration.UpgradeRolloutStrategy != nil {
Copy link
Member

Choose a reason for hiding this comment

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

nit: can you add a comment saying we are using cp's upgrade strategy here because we already validate that all the machines have the same upgrade strategy.

Comment on lines 1226 to 1245
// func TestUpdateClusterStatusForInPlaceUpgrades(t *testing.T) {
// g := NewWithT(t)

// tests := []struct {
// name string
// machineDeployments []clusterv1.MachineDeployment
// workerNodeGroupConfigurations []anywherev1.WorkerNodeGroupConfiguration
// conditions []anywherev1.Condition
// wantCondition *anywherev1.Condition
// wantErr string
// }{
// {
// name: "control plane replicas out of date, inplace upgrade",
// kcp: test.KubeadmControlPlane(func(kcp *controlplanev1.KubeadmControlPlane) {
// kcp.Status.ReadyReplicas = 3
// kcp.Status.Replicas = 3
// kcp.Status.UpdatedReplicas = 1

// kcp.Status.Conditions = []clusterv1.Condition{
// {
Copy link
Member

Choose a reason for hiding this comment

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

remove commented code

@ahreehong ahreehong force-pushed the update-status-message branch from d063115 to 05f34d8 Compare February 12, 2024 20:45
Copy link
Member

@abhinavmpandey08 abhinavmpandey08 left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm
/woof

@eks-distro-bot
Copy link
Collaborator

@abhinavmpandey08: dog image

In response to this:

/approve
/lgtm
/woof

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.

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavmpandey08

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

@eks-distro-bot eks-distro-bot merged commit bd31bbd into aws:main Feb 12, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants