Skip to content

Commit

Permalink
Remove succeeded field from firewall status. (#247)
Browse files Browse the repository at this point in the history
* Remove `succeeded` field from firewall status.

The field is not set by metal-api anyway (see metal-stack/metal-api#209) and introduces a regression for migrated shoots.

* Update controller-registration.
  • Loading branch information
Gerrit91 authored Apr 5, 2022
1 parent 1939a6b commit 096c2a2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 60 deletions.
4 changes: 2 additions & 2 deletions example/controller-registration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ metadata:
name: provider-metal
type: helm
providerConfig:
chart: H4sIAAAAAAAAA+0ca2/bRjKf+SsWyhVoDyfqYVnOCcjhXMdt3UtswfalOBwOwYpcSYwoLrskbatp/vvNvsglRYqindhNyoEBk8uZ2dndmdmZfWiBmUsCwrrkLiZB5NGgGzJ647lQtCYx9nvPHgx9gKPDQ/EfoPhfPA8ORoPh4XA85uWD8UF/9AwdPrzqekiiGDOEnjFK4114dd+/UFjUjv/JErPY3uC1f986+ACPR6PK8R+OCuM/7A+Hh89Q/1M2tAr+5OOPQ+8tYXzcJ+hmYOEwzF779uCF/XfLJZHDvDAWhcfoJ+KvkcOVAs0pQ/GSoB+VEqE3XGPQVCkQSnXKCvCaTFCtslk3xcqfun++dqi3f5c69oI+pI46+z8cFv3/0cFRa/+PAr3egk4WXANwTJBt9+DvhgQuZb2FFy+Tme3QdU9rSfawxM6qp+m6Dg1iRn0flIaRhRfFUAqqZEdLlNcmZKs63p5eXp1dnKs3cofXoU96VXz47INO5MepjwMykdzOgjnDgJU4ccJ04S+UrQiTL5bV66EpyIoXRDktEuCZTyJktjtKwpAqh6YKvWAhfJtDGSNOjDLRUE40KzS5f3H+qt7+YwJDA50U3TsSbBz/DfsH/WEb/z0GNBn/d0vihzBB23HYKBas8f+D4XBcGP/huI3/Hgc+fOgil8y9gKAOD9I6qPvxo1UfqHE6mCYEtmUy8fGM+JENgaS9IhvJTrwkM8ICAnpke7THq8rxqGBxg/1EyfThA/ICx0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ttNBCCw3g/zA18G8AeAAA
values:
image:
tag: v0.18.9
tag: v0.18.10
---
apiVersion: core.gardener.cloud/v1beta1
kind: ControllerRegistration
Expand Down
1 change: 0 additions & 1 deletion pkg/apis/metal/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@ type InfrastructureStatus struct {
}

type FirewallStatus struct {
Succeeded bool
MachineID string
}
1 change: 0 additions & 1 deletion pkg/apis/metal/v1alpha1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@ type InfrastructureStatus struct {
}

type FirewallStatus struct {
Succeeded bool `json:"succeeded"`
MachineID string `json:"machineID"`
}
2 changes: 0 additions & 2 deletions pkg/apis/metal/v1alpha1/zz_generated.conversion.go

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

1 change: 0 additions & 1 deletion pkg/controller/infrastructure/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func updateProviderStatus(ctx context.Context, c client.Client, infrastructure *
Kind: "InfrastructureStatus",
},
Firewall: metalv1alpha1.FirewallStatus{
Succeeded: providerStatus.Firewall.Succeeded,
MachineID: providerStatus.Firewall.MachineID,
},
}}
Expand Down
60 changes: 7 additions & 53 deletions pkg/controller/infrastructure/actuator_reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
metalapi "github.com/metal-stack/gardener-extension-provider-metal/pkg/apis/metal"
"github.com/metal-stack/gardener-extension-provider-metal/pkg/apis/metal/helper"
metalgo "github.com/metal-stack/metal-go"
metalfirewall "github.com/metal-stack/metal-go/api/client/firewall"
mn "github.com/metal-stack/metal-lib/pkg/net"

extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller"
Expand Down Expand Up @@ -73,8 +72,6 @@ var (
firewallActionDeleteAndRecreate firewallReconcileAction = "delete"
// firewallActionDoNothing nothing needs to be done for this firewall
firewallActionDoNothing firewallReconcileAction = "nothing"
// firewallActionUpdateCreationProgress firewall creation has not yet succeeded
firewallActionUpdateCreationProgress firewallReconcileAction = "update-creation-progress"
// firewallActionCreate create a new firewall and write infrastructure status
firewallActionCreate firewallReconcileAction = "create"
// firewallActionStatusUpdateOnMigrate infrastructure status is not present, but a metal firewall machine is present.
Expand Down Expand Up @@ -154,7 +151,7 @@ func (a *actuator) Reconcile(ctx context.Context, infrastructure *extensionsv1al
// TODO migrate to a state-machine or to a dedicated controller
func reconcileFirewall(ctx context.Context, r *firewallReconciler) error {
// detect which next action is required
action, status, err := firewallNextAction(ctx, r)
action, status, err := firewallNextAction(r)
if err != nil {
return err
}
Expand All @@ -171,18 +168,7 @@ func reconcileFirewall(ctx context.Context, r *firewallReconciler) error {
r.logger.Info("firewall created", "cluster-id", r.clusterID, "cluster", r.cluster.Shoot.Name, "machine-id", r.providerStatus.Firewall.MachineID)

r.providerStatus.Firewall.MachineID = machineID
// TODO this is a BUG, see https://github.com/metal-stack/metal-api/issues/209
r.providerStatus.Firewall.Succeeded = true
return updateProviderStatus(ctx, r.c, r.infrastructure, r.providerStatus, &nodeCIDR)
case firewallActionUpdateCreationProgress:
succeeded, err := hasFirewallSucceeded(r.machineIDInStatus, r.mclient)
if err != nil {
return err
}

r.logger.Info("firewall creation in progress", "cluster-id", r.clusterID, "cluster", r.cluster.Shoot.Name, "succeeded", succeeded)
r.providerStatus.Firewall.Succeeded = succeeded
return updateProviderStatus(ctx, r.c, r.infrastructure, r.providerStatus, r.infrastructure.Status.NodesCIDR)
case firewallActionRecreate:
err := deleteFirewallFromStatus(ctx, r)
if err != nil {
Expand All @@ -196,8 +182,7 @@ func reconcileFirewall(ctx context.Context, r *firewallReconciler) error {
r.logger.Info("firewall created", "cluster-id", r.clusterID, "cluster", r.cluster.Shoot.Name, "machine-id", r.providerStatus.Firewall.MachineID)

r.providerStatus.Firewall.MachineID = machineID
// TODO this is a BUG, see https://github.com/metal-stack/metal-api/issues/209
r.providerStatus.Firewall.Succeeded = true

return updateProviderStatus(ctx, r.c, r.infrastructure, r.providerStatus, &nodeCIDR)
case firewallActionDeleteAndRecreate:
err := deleteFirewall(r.logger, r.machineIDInStatus, r.infrastructureConfig.ProjectID, r.clusterTag, r.mclient)
Expand All @@ -216,8 +201,6 @@ func reconcileFirewall(ctx context.Context, r *firewallReconciler) error {
}
r.logger.Info("firewall created", "cluster-id", r.clusterID, "cluster", r.cluster.Shoot.Name, "machine-id", r.providerStatus.Firewall.MachineID)
r.providerStatus.Firewall.MachineID = machineID
// TODO this is a BUG, see https://github.com/metal-stack/metal-api/issues/209
r.providerStatus.Firewall.Succeeded = true
return updateProviderStatus(ctx, r.c, r.infrastructure, r.providerStatus, &nodeCIDR)
case firewallActionStatusUpdateOnMigrate:
r.providerStatus.Firewall = *status
Expand All @@ -227,14 +210,10 @@ func reconcileFirewall(ctx context.Context, r *firewallReconciler) error {
}
}

func firewallNextAction(ctx context.Context, r *firewallReconciler) (firewallReconcileAction, *metalapi.FirewallStatus, error) {
if !r.providerStatus.Firewall.Succeeded && r.machineIDInStatus != "" {
return firewallActionUpdateCreationProgress, nil, nil
}

func firewallNextAction(r *firewallReconciler) (firewallReconcileAction, *metalapi.FirewallStatus, error) {
firewalls, err := metalclient.FindClusterFirewalls(r.mclient, r.clusterTag, r.infrastructureConfig.ProjectID)
if err != nil {
r.logger.Error(err, "firewalls not found", "clustertag", r.clusterTag, "projectid", r.infrastructureConfig.ProjectID)
r.logger.Error(err, "unable to fetch cluster firewalls", "clustertag", r.clusterTag, "projectid", r.infrastructureConfig.ProjectID)
return firewallActionDoNothing, nil, &controllererrors.RequeueAfterError{
Cause: err,
RequeueAfter: 30 * time.Second,
Expand All @@ -256,13 +235,12 @@ func firewallNextAction(ctx context.Context, r *firewallReconciler) (firewallRec
r.logger.Info("firewall exists but status is empty, assuming migration", "clusterid", r.clusterID, "machineid", r.machineIDInStatus)
return firewallActionStatusUpdateOnMigrate, &metalapi.FirewallStatus{
MachineID: encodeMachineID(*fw.Partition.ID, *fw.ID),
Succeeded: *fw.Allocation.Succeeded,
}, nil
}

if *fw.ID != r.machineIDInStatus {
r.logger.Error(
fmt.Errorf("machine id of this cluster's firewall differs from infrastructure status"),
fmt.Errorf("machine id of this cluster's firewall differs from infrastructure status, not reconciling firewall anymore"),
"leaving as it is, but something unexpected must have happened in the past. if you want to get to a clean state, remove the firewall by hand (causes downtime!) and reconcile infrastructure again",
"clusterID", r.clusterID,
"expectedMachineID", r.machineIDInStatus,
Expand Down Expand Up @@ -324,31 +302,8 @@ func firewallNextAction(ctx context.Context, r *firewallReconciler) (firewallRec
}
}

func hasFirewallSucceeded(machineID string, mclient *metalgo.Driver) (bool, error) {
resp, err := mclient.FirewallGet(machineID)
if err != nil {
switch e := err.(type) {
case *metalfirewall.FindFirewallDefault:
if e.Code() >= 500 {
return false, &controllererrors.RequeueAfterError{
Cause: e,
RequeueAfter: 5 * time.Second,
}
}
default:
return false, e
}
}

if resp.Firewall == nil || resp.Firewall.Allocation == nil || resp.Firewall.Allocation.Succeeded == nil {
return false, fmt.Errorf("firewall %q was created but has no allocation", machineID)
}

return *resp.Firewall.Allocation.Succeeded, nil
}

func createFirewall(ctx context.Context, r *firewallReconciler) (machineID string, nodeCIDR string, err error) {
nodeCIDR, err = ensureNodeNetwork(ctx, r)
nodeCIDR, err = ensureNodeNetwork(r)
if err != nil {
r.logger.Error(err, "firewalls node network", "nodecidr", nodeCIDR)
return "", "", &controllererrors.RequeueAfterError{
Expand Down Expand Up @@ -550,7 +505,7 @@ func clearIPTags(mclient *metalgo.Driver, ip string) error {
return err
}

func ensureNodeNetwork(ctx context.Context, r *firewallReconciler) (string, error) {
func ensureNodeNetwork(r *firewallReconciler) (string, error) {
if r.cluster.Shoot.Spec.Networking.Nodes != nil {
return *r.cluster.Shoot.Spec.Networking.Nodes, nil
}
Expand Down Expand Up @@ -684,7 +639,6 @@ func renderFirewallUserData(kubeconfig string) (string, error) {

func deleteFirewallFromStatus(ctx context.Context, r *firewallReconciler) error {
r.providerStatus.Firewall.MachineID = ""
r.providerStatus.Firewall.Succeeded = false
err := updateProviderStatus(ctx, r.c, r.infrastructure, r.providerStatus, r.infrastructure.Status.NodesCIDR)
if err != nil {
return err
Expand Down

0 comments on commit 096c2a2

Please sign in to comment.