Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Few fixes #14

Merged
merged 1 commit into from
Jul 25, 2022
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ endif

.PHONY: install
install: manifests kustomize ## Install APIResourceSchemas and APIExport into kcp (using $KUBECONFIG or ~/.kube/config).
kustomize build config/kcp | kubectl apply -f -
$(KUSTOMIZE) build config/kcp | kubectl apply -f -

.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall APIResourceSchemas and APIExport from kcp (using $KUBECONFIG or ~/.kube/config). Call with ignore-not-found=true to ignore resource not found errors during deletion.
kustomize build config/kcp | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
$(KUSTOMIZE) build config/kcp | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy-crd
deploy-crd: manifests kustomize ## Deploy controller
Expand Down
4 changes: 1 addition & 3 deletions controllers/configmap_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

kcpclient "github.com/kcp-dev/apimachinery/pkg/client"

"github.com/kcp-dev/logicalcluster"

ctrl "sigs.k8s.io/controller-runtime"
Expand Down Expand Up @@ -55,7 +53,7 @@ type ConfigMapReconciler struct {
func (r *ConfigMapReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := log.FromContext(ctx).WithValues("cluster", req.ClusterName)

ctx = kcpclient.WithCluster(ctx, logicalcluster.New(req.ClusterName))
ctx = logicalcluster.WithCluster(ctx, logicalcluster.New(req.ClusterName))

// Test get
var configMap corev1.ConfigMap
Expand Down
3 changes: 1 addition & 2 deletions controllers/widget_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package controllers
import (
"context"

kcpclient "github.com/kcp-dev/apimachinery/pkg/client"
"github.com/kcp-dev/logicalcluster"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -57,7 +56,7 @@ func (r *WidgetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
logger.Info("Listed all widgets across all workspaces", "count", len(allWidgets.Items))

// Add the logical cluster to the context
ctx = kcpclient.WithCluster(ctx, logicalcluster.New(req.ClusterName))
ctx = logicalcluster.WithCluster(ctx, logicalcluster.New(req.ClusterName))

logger.Info("Getting widget")
var w datav1alpha1.Widget
Expand Down