Skip to content

Commit dbefa63

Browse files
committed
wip updating example
1 parent 2425666 commit dbefa63

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

examples/kcp/main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"fmt"
2222
"os"
2323

24+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2425
"k8s.io/apimachinery/pkg/runtime"
2526
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
2627
ctrl "sigs.k8s.io/controller-runtime"
@@ -44,9 +45,12 @@ func (r *reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
4445
log := log.FromContext(ctx).WithValues("chaospod", req.NamespacedName)
4546
log.V(1).Info("reconciling chaos pod")
4647

47-
log.Info(fmt.Sprintf("%+v\n\n%+v\n", ctx, req))
48+
fmt.Println("***************************************")
49+
fmt.Println(req.ClusterName)
50+
fmt.Println("***************************************")
51+
// log.Info(fmt.Sprintf("%+v\n\n%+v\n", ctx, req))
4852

49-
var chaospod api.ChaosPod
53+
chaospod := api.ChaosPod{ObjectMeta: metav1.ObjectMeta{ClusterName: req.ClusterName}}
5054
if err := r.Get(ctx, req.NamespacedName, &chaospod); err != nil {
5155
log.Error(err, "unable to get chaosctl")
5256
return ctrl.Result{}, err
@@ -56,6 +60,7 @@ func (r *reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
5660
}
5761

5862
func main() {
63+
5964
ctrl.SetLogger(zap.New())
6065

6166
cfg := ctrl.GetConfigOrDie()

0 commit comments

Comments
 (0)