Skip to content

Commit

Permalink
Use Go 1.23
Browse files Browse the repository at this point in the history
Signed-off-by: 1gtm <[email protected]>
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
1gtm authored and tamalsaha committed Aug 17, 2024
1 parent d2bcbd7 commit 37bff70
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v1
with:
go-version: '1.22'
go-version: '1.23'
id: go

- name: Set up QEMU
Expand All @@ -47,10 +47,10 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v1
with:
go-version: '1.22'
go-version: '1.23'
id: go

- name: Create Kubernetes ${{ matrix.k8s }} cluster
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ TAG := $(VERSION)_$(OS)_$(ARCH)
TAG_PROD := $(TAG)
TAG_DBG := $(VERSION)-dbg_$(OS)_$(ARCH)

GO_VERSION ?= 1.22
GO_VERSION ?= 1.23
BUILD_IMAGE ?= ghcr.io/appscode/golang-dev:$(GO_VERSION)
CHART_TEST_IMAGE ?= quay.io/helmpack/chart-testing:v3.5.1
CHART_TEST_IMAGE ?= quay.io/helmpack/chart-testing:v3.11.0

OUTBIN = bin/$(BIN)-$(OS)-$(ARCH)
ifeq ($(OS),windows)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func NewController(
return provider, nil
}
}
return nil, fmt.Errorf(fmt.Sprintf("no provider registered for cluster id: %s in ClusterBinding controller", clusterID))
return nil, fmt.Errorf("no provider registered for cluster id: %s in ClusterBinding controller", clusterID)
},
getProviderSecret: func(provider *konnectormodels.ProviderInfo) (*corev1.Secret, error) {
cb, err := provider.BindInformer.KubeBind().V1alpha1().ClusterBindings().Lister().ClusterBindings(provider.Namespace).Get("cluster")
Expand Down Expand Up @@ -145,7 +145,7 @@ func NewController(
func(ns string) committer.Patcher[*v1alpha1.ClusterBinding] {
providerInfo, err := konnectormodels.GetProviderInfoWithProviderNamespace(providerInfos, ns)
if err != nil {
klog.Warningf(err.Error())
klog.Warningln(err)
return nil
}
return providerInfo.BindClient.KubeBindV1alpha1().ClusterBindings(ns)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (r *reconciler) ensureRightScopedServiceBinding(ctx context.Context, bindin
sb.Spec.Providers[i].ClusterUID = binding.Status.Provider.ClusterUID
sb.Spec.Providers[i].ClusterName = binding.Status.Provider.ClusterName
if err = r.updateServiceBinding(ctx, &sb); err != nil {
klog.Errorf(err.Error())
klog.Errorln(err)
return err
}
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func NewController(
func(ns string) committer.Patcher[*v1alpha1.APIServiceExport] {
provider, err := konnectormodels.GetProviderInfoWithProviderNamespace(providerInfos, ns)
if err != nil {
klog.Errorf(fmt.Sprintf("failed to get any provider with namespace: %s", ns))
klog.Errorf("failed to get any provider with namespace: %s", ns)
return nil
}
return provider.BindClient.KubeBindV1alpha1().APIServiceExports(ns)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (r *reconciler) reconcile(ctx context.Context, obj *unstructured.Unstructur
return err
}

klog.Infof(fmt.Sprintf("reconciling object %s/%s for provider %s", obj.GetNamespace(), obj.GetName(), provider.ClusterID))
klog.Infof("reconciling object %s/%s for provider %s", obj.GetNamespace(), obj.GetName(), provider.ClusterID)

ns := obj.GetNamespace()
if ns != "" {
Expand Down Expand Up @@ -104,7 +104,7 @@ func (r *reconciler) reconcile(ctx context.Context, obj *unstructured.Unstructur
}

if obj, err = r.ensureDownstreamFinalizer(ctx, obj); err != nil {
klog.Errorf(err.Error())
klog.Errorln(err)
return err
}

Expand Down Expand Up @@ -151,7 +151,7 @@ func (r *reconciler) reconcile(ctx context.Context, obj *unstructured.Unstructur

// just in case, checking for finalizer
if obj, err = r.ensureDownstreamFinalizer(ctx, obj); err != nil {
klog.Errorf(err.Error())
klog.Errorln(err)
return err
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func NewController(
if _, err = kmc.CreateOrPatch(ctx, consumerKubeClient, consumerSecret, func(_ client.Object, _ bool) client.Object {
return consumerSecret
}); err != nil && !strings.Contains(err.Error(), errorAlreadyExists) {
klog.Errorf(err.Error())
klog.Errorln(err)
return "", err
}

Expand Down Expand Up @@ -437,7 +437,7 @@ func (c *controller) processNextWorkItem(ctx context.Context) bool {

if err := c.process(ctx, key); err != nil {
runtime.HandleError(fmt.Errorf("%q controller failed to sync %q, err: %w", controllerName, key, err))
klog.Errorf(err.Error())
klog.Errorln(err)
c.queue.AddRateLimited(key)
return true
}
Expand All @@ -450,7 +450,7 @@ func splitMetaNamespaceKeyWithClusterID(key string) (clusterId, namespace, name
switch len(parts) {
case 1:
// name only, no namespace
return "", "", "", fmt.Errorf(fmt.Sprintf("unexpected object key format: %q", key))
return "", "", "", fmt.Errorf("unexpected object key format: %q", key)
case 2:
// cluster id and name
return parts[0], "", parts[1], nil
Expand All @@ -473,7 +473,7 @@ func (c *controller) process(ctx context.Context, key string) error {

provider, err := konnectormodels.GetProviderInfoWithClusterID(c.providerInfos, clusterID)
if err != nil {
klog.Errorf(err.Error())
klog.Errorln(err)
return err
}

Expand All @@ -489,7 +489,7 @@ func (c *controller) process(ctx context.Context, key string) error {
})

if err != nil && !errors.IsNotFound(err) && !strings.Contains(err.Error(), errorContextDeadlineExceeded) {
klog.Errorf(err.Error())
klog.Errorln(err)
return err
} else if err != nil && (errors.IsNotFound(err) || strings.Contains(err.Error(), errorContextDeadlineExceeded)) {
logger.V(2).Info("Upstream object disappeared")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ func (r *reconciler) reconcile(ctx context.Context, obj *unstructured.Unstructur
if found {
newSecretRefName, err := r.ensureStatusSecret(ctx, provider, obj.DeepCopy(), downstream, newStatus, ns)
if err != nil {
klog.Errorf(err.Error())
klog.Errorln(err)
return err
}
if err := unstructured.SetNestedField(downstream.Object, newStatus, "status"); err != nil {
runtime.HandleError(err)
klog.Errorf(err.Error())
klog.Errorln(err)
return nil // nothing we can do here
}
if newSecretRefName != "" {
if err = unstructured.SetNestedField(downstream.Object, newSecretRefName, "status", "secretRef", "name"); err != nil {
klog.Errorf(err.Error())
klog.Errorln(err)
return err
}
}
Expand Down

0 comments on commit 37bff70

Please sign in to comment.