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 all dependencies and github actions to latest versions #196

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.19' ]
go: [ '1.21' ]
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.49.0
version: v1.57.0

kube-linter:
name: Kube YAML
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.19' ]
go: [ '1.21' ]
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout source
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.19' ]
go: [ '1.21' ]
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout source
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.19' ]
go: [ '1.21' ]
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout source
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-and-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.19' ]
go: [ '1.21' ]
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand All @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.19' ]
go: [ '1.21' ]
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand All @@ -54,7 +54,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.19' ]
go: [ '1.21' ]
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand All @@ -73,7 +73,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.19' ]
go: [ '1.21' ]
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand All @@ -92,7 +92,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.19' ]
go: [ '1.21' ]
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand All @@ -111,7 +111,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.19' ]
go: [ '1.21' ]
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.21 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
10 changes: 5 additions & 5 deletions addons/agent_mirrorpeer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request)
}

klog.Infof("creating s3 buckets")
err = r.createS3(ctx, req, mirrorPeer, scr.Namespace)
err = r.createS3(ctx, mirrorPeer, scr.Namespace)
if err != nil {
klog.Error(err, "Failed to create ODR S3 resources")
return ctrl.Result{}, err
Expand Down Expand Up @@ -158,8 +158,8 @@ func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request)

// Trying this at last to allow bootstrapping to be completed
if mirrorPeer.Spec.OverlappingCIDR {
klog.Infof("enabling multiclusterservice", "MirrorPeer", mirrorPeer.GetName(), "Peers", mirrorPeer.Spec.Items)
err := r.enableMulticlusterService(ctx, scr.Name, scr.Namespace, &mirrorPeer)
klog.Info("enabling multiclusterservice", "MirrorPeer", mirrorPeer.GetName(), "Peers", mirrorPeer.Spec.Items)
err := r.enableMulticlusterService(ctx, scr.Name, scr.Namespace)
if err != nil {
return ctrl.Result{}, fmt.Errorf("failed to enable multiclusterservice for storagecluster %q in namespace %q: %v", scr.Name, scr.Namespace, err)
}
Expand Down Expand Up @@ -258,7 +258,7 @@ func (r *MirrorPeerReconciler) labelRBDStorageClasses(ctx context.Context, stora
return errs
}

func (r *MirrorPeerReconciler) createS3(ctx context.Context, req ctrl.Request, mirrorPeer multiclusterv1alpha1.MirrorPeer, scNamespace string) error {
func (r *MirrorPeerReconciler) createS3(ctx context.Context, mirrorPeer multiclusterv1alpha1.MirrorPeer, scNamespace string) error {
noobaaOBC, err := r.getS3bucket(ctx, mirrorPeer, scNamespace)
if err != nil {
if errors.IsNotFound(err) {
Expand Down Expand Up @@ -303,7 +303,7 @@ func (r *MirrorPeerReconciler) getS3bucket(ctx context.Context, mirrorPeer multi
}

// enableMulticlusterService sets the multiclusterservice flag on StorageCluster if submariner globalnet is enabled
func (r *MirrorPeerReconciler) enableMulticlusterService(ctx context.Context, storageClusterName string, namespace string, mp *multiclusterv1alpha1.MirrorPeer) error {
func (r *MirrorPeerReconciler) enableMulticlusterService(ctx context.Context, storageClusterName string, namespace string) error {
klog.Infof("Enabling MCS for StorageCluster %q in %q namespace.", storageClusterName, namespace)
var sc ocsv1.StorageCluster
err := r.SpokeClient.Get(ctx, types.NamespacedName{
Expand Down
7 changes: 3 additions & 4 deletions addons/blue_secret_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/source"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -48,7 +47,7 @@ func (r *BlueSecretReconciler) SetupWithManager(mgr ctrl.Manager) error {

return ctrl.NewControllerManagedBy(mgr).
Named("bluesecret_controller").
Watches(&source.Kind{Type: &corev1.Secret{}}, &handler.EnqueueRequestForObject{},
Watches(&corev1.Secret{}, &handler.EnqueueRequestForObject{},
builder.WithPredicates(predicate.GenerationChangedPredicate{}, predicate.LabelChangedPredicate{}, blueSecretPredicate)).
Complete(r)
}
Expand All @@ -57,14 +56,14 @@ func (r *BlueSecretReconciler) Reconcile(ctx context.Context, req ctrl.Request)
var err error
var secret corev1.Secret

klog.Infof("Reconciling blue secret", "secret", req.NamespacedName.String())
klog.Info("Reconciling blue secret", "secret", req.NamespacedName.String())
err = r.SpokeClient.Get(ctx, req.NamespacedName, &secret)
if err != nil {
if errors.IsNotFound(err) {
klog.Infof("Could not find secret. Ignoring since it must have been deleted")
return ctrl.Result{}, nil
}
klog.Errorf("Failed to get secret.", err)
klog.Error("Failed to get secret.", err)
return ctrl.Result{}, err
}

Expand Down
7 changes: 3 additions & 4 deletions addons/green_secret_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/source"
)

// GreenSecretReconciler reconciles a MirrorPeer object
Expand Down Expand Up @@ -54,7 +53,7 @@ func (r *GreenSecretReconciler) SetupWithManager(mgr ctrl.Manager) error {

return ctrl.NewControllerManagedBy(mgr).
Named("greensecret_controller").
Watches(&source.Kind{Type: &corev1.Secret{}}, &handler.EnqueueRequestForObject{},
Watches(&corev1.Secret{}, &handler.EnqueueRequestForObject{},
builder.WithPredicates(predicate.GenerationChangedPredicate{}, greenSecretPredicate)).
Complete(r)
}
Expand All @@ -63,14 +62,14 @@ func (r *GreenSecretReconciler) Reconcile(ctx context.Context, req ctrl.Request)
var err error
var greenSecret corev1.Secret

klog.Infof("Reconciling green secret", "secret", req.NamespacedName.String())
klog.Info("Reconciling green secret", "secret", req.NamespacedName.String())
err = r.HubClient.Get(ctx, req.NamespacedName, &greenSecret)
if err != nil {
if errors.IsNotFound(err) {
klog.Infof("Could not find secret. Ignoring since it must have been deleted")
return ctrl.Result{}, nil
}
klog.Errorf("Failed to get secret.", err)
klog.Error("Failed to get secret.", err)
return ctrl.Result{}, err
}

Expand Down
9 changes: 4 additions & 5 deletions addons/maintenance_mode_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/source"
)

type MaintenanceModeReconciler struct {
Expand All @@ -34,7 +33,7 @@ type MaintenanceModeReconciler struct {
func (r *MaintenanceModeReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
Named("maintenancemode_controller").
Watches(&source.Kind{Type: &ramenv1alpha1.MaintenanceMode{}}, &handler.EnqueueRequestForObject{},
Watches(&ramenv1alpha1.MaintenanceMode{}, &handler.EnqueueRequestForObject{},
builder.WithPredicates(predicate.GenerationChangedPredicate{})).
Complete(r)
}
Expand All @@ -49,7 +48,7 @@ func (r *MaintenanceModeReconciler) Reconcile(ctx context.Context, req ctrl.Requ
klog.Infof("Could not find MaintenanceMode. Ignoring since object must have been deleted.")
return ctrl.Result{}, nil
}
klog.Errorf("Failed to get MaintenanceMode.", err)
klog.Error("Failed to get MaintenanceMode.", err)
return ctrl.Result{}, err
}

Expand Down Expand Up @@ -80,7 +79,7 @@ func (r *MaintenanceModeReconciler) Reconcile(ctx context.Context, req ctrl.Requ
klog.Errorf("failed to complete maintenance actions on %s. err=%v", mmode.Name, err)
return result, err
}
if !result.Requeue && err == nil {
if !result.Requeue {
mmode.Finalizers = utils.RemoveString(mmode.Finalizers, MaintenanceModeFinalizer)
err = r.SpokeClient.Update(ctx, &mmode)
if err != nil {
Expand Down Expand Up @@ -136,7 +135,7 @@ func (r *MaintenanceModeReconciler) startMaintenanceActions(ctx context.Context,
SetStatus(mmode, mode, ramenv1alpha1.MModeStateError, err)
return result, err
}
if !result.Requeue && err == nil {
if !result.Requeue {
SetStatus(mmode, mode, ramenv1alpha1.MModeStateCompleted, nil)
}
return result, err
Expand Down
8 changes: 4 additions & 4 deletions addons/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ func runSpokeManager(ctx context.Context, options AddonAgentOptions) {
if err = mgr.Add(manager.RunnableFunc(func(ctx context.Context) error {
klog.Infof("Waiting for MaintenanceMode CRD to be created. MaintenanceMode controller is not running yet.")
// Wait for 45s as it takes time for MaintenanceMode CRD to be created.
return runtimewait.PollUntilWithContext(ctx, 15*time.Second,
return runtimewait.PollUntilContextCancel(ctx, 15*time.Second, true,
func(ctx context.Context) (done bool, err error) {
var crd extv1.CustomResourceDefinition
readErr := mgr.GetAPIReader().Get(ctx, types.NamespacedName{Name: "maintenancemodes.ramendr.openshift.io"}, &crd)
if readErr != nil {
klog.Errorf("Unable to get MaintenanceMode CRD", readErr)
klog.Error("Unable to get MaintenanceMode CRD", readErr)
// Do not initialize err as we want to retry.
// err!=nil or done==true will end polling.
done = false
Expand All @@ -239,7 +239,7 @@ func runSpokeManager(ctx context.Context, options AddonAgentOptions) {
SpokeClient: mgr.GetClient(),
SpokeClusterName: options.SpokeClusterName,
}).SetupWithManager(mgr); err != nil {
klog.Errorf("Unable to create MaintenanceMode controller.", err)
klog.Error("Unable to create MaintenanceMode controller.", err)
return
}
klog.Infof("MaintenanceMode CRD exists. MaintenanceMode controller is now running.")
Expand All @@ -250,7 +250,7 @@ func runSpokeManager(ctx context.Context, options AddonAgentOptions) {
return
})
})); err != nil {
klog.Errorf("unable to poll MaintenanceMode", err)
klog.Error("unable to poll MaintenanceMode", err)
os.Exit(1)
}

Expand Down
9 changes: 4 additions & 5 deletions addons/s3_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/source"
)

// S3SecretReconciler reconciles a MirrorPeer object
Expand Down Expand Up @@ -59,7 +58,7 @@ func (r *S3SecretReconciler) SetupWithManager(mgr ctrl.Manager) error {

return ctrl.NewControllerManagedBy(mgr).
Named("s3secret_controller").
Watches(&source.Kind{Type: &obv1alpha1.ObjectBucketClaim{}}, &handler.EnqueueRequestForObject{},
Watches(&obv1alpha1.ObjectBucketClaim{}, &handler.EnqueueRequestForObject{},
builder.WithPredicates(predicate.GenerationChangedPredicate{}, s3BucketPredicate)).
Complete(r)
}
Expand All @@ -68,14 +67,14 @@ func (r *S3SecretReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
var err error
var obc obv1alpha1.ObjectBucketClaim

klog.Infof("Reconciling OBC", "OBC", req.NamespacedName.String())
klog.Info("Reconciling OBC", "OBC", req.NamespacedName.String())
err = r.SpokeClient.Get(ctx, req.NamespacedName, &obc)
if err != nil {
if errors.IsNotFound(err) {
klog.Infof("Could not find OBC. Ignoring since object must have been deleted.")
klog.Info("Could not find OBC. Ignoring since object must have been deleted.")
return ctrl.Result{}, nil
}
klog.Errorf("Failed to get OBC.", err)
klog.Error("Failed to get OBC.", err)
return ctrl.Result{}, err
}

Expand Down
2 changes: 1 addition & 1 deletion addons/s3_secret_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (r *S3SecretReconciler) syncBlueSecretForS3(ctx context.Context, name strin
}

if storageClusterRef == nil {
klog.Error("failed to find storage cluster ref using spoke cluster name %s from mirrorpeers ", r.SpokeClusterName)
klog.Errorf("failed to find storage cluster ref using spoke cluster name %s from mirrorpeers ", r.SpokeClusterName)
return err
}

Expand Down
Loading
Loading