m/n/k/reconciler: implement updates

The reconciler now checks if already present object are equal to the 
expected object, and else updates them. If the update fails due to 
immutable fields, the object is instead deleted and recreated.

Also, the reconciler now logs create/update/delete operations.

For the CSI driver, the StorageCapacity and RequiresRepublish were added 
and set to their default value. If we don't do this, the API server will 
add these defaults, and then our update comparison fails. There is also 
a new test which ensures that expected objects have all defaults already 
applied. This test will fail if a Kubernetes upgrade adds new fields 
with default values.

Closes #288.

Change-Id: Ibfb37d07b4613ae1a883ad47715feeda87135820
Reviewed-on: https://review.monogon.dev/c/monogon/+/2893
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/node/kubernetes/reconciler/resources_storageclass.go b/metropolis/node/kubernetes/reconciler/resources_storageclass.go
index d8191ce..b242bbf 100644
--- a/metropolis/node/kubernetes/reconciler/resources_storageclass.go
+++ b/metropolis/node/kubernetes/reconciler/resources_storageclass.go
@@ -49,8 +49,13 @@
 	return err
 }
 
-func (r resourceStorageClasses) Delete(ctx context.Context, name string) error {
-	return r.StorageV1().StorageClasses().Delete(ctx, name, meta.DeleteOptions{})
+func (r resourceStorageClasses) Update(ctx context.Context, el meta.Object) error {
+	_, err := r.StorageV1().StorageClasses().Update(ctx, el.(*storage.StorageClass), meta.UpdateOptions{})
+	return err
+}
+
+func (r resourceStorageClasses) Delete(ctx context.Context, name string, opts meta.DeleteOptions) error {
+	return r.StorageV1().StorageClasses().Delete(ctx, name, opts)
 }
 
 func (r resourceStorageClasses) Expected() []meta.Object {