Skip to content

Commit

Permalink
Merge pull request #40 from metal-stack/set-fstype
Browse files Browse the repository at this point in the history
* set default fstype to ext4
* delete and recreate storageclasses on reconcile error
  • Loading branch information
mwennrich authored Jun 27, 2022
2 parents da5ae8c + 898d64f commit dcde2fd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion controllers/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ var (
Name: "csi-provisioner",
Image: csiProvisionerImage,
ImagePullPolicy: corev1.PullIfNotPresent,
Args: []string{"--csi-address=$(ADDRESS)", "--v=4"},
Args: []string{"--csi-address=$(ADDRESS)", "--v=4", "--default-fstype=ext4"},
Env: []corev1.EnvVar{
{Name: "ADDRESS", Value: "/var/lib/csi/sockets/pluginproxy/csi.sock"},
},
Expand Down Expand Up @@ -1036,6 +1036,14 @@ func (r *DurosReconciler) deployCSI(ctx context.Context, projectID string, scs [
return nil
})
if err != nil {
// if error is of type Invalid, delete old storage class. Will be recreated immediately on next reconciliation
if apierrors.IsInvalid(err) {
err := r.Shoot.Delete(ctx, obj)
if err != nil {
return err
}
log.Info("storageclass", "name", sc.Name, "operation", "deleted")
}
return err
}
log.Info("storageclass", "name", sc.Name, "operation", op)
Expand Down

0 comments on commit dcde2fd

Please sign in to comment.