Skip to content

Commit 0a9d85d

Browse files
feat: Apply suggestions from code review
Co-authored-by: Manoj Surudwad <[email protected]>
1 parent 812b844 commit 0a9d85d

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

api/v1alpha1/addon_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ type NutanixKonnectorAgent struct {
371371
// Addon strategy used to deploy the Nutanix konnector-agent to the k8s cluster.
372372
// +kubebuilder:default=HelmAddon
373373
// +kubebuilder:validation:Optional
374-
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
374+
// +kubebuilder:validation:Enum=HelmAddon
375375
Strategy AddonStrategy `json:"strategy,omitzero"`
376376
}
377377

docs/content/addons/konnector-agent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Konnector Agent addon enables automatic registration of Kubernetes clusters
77

88
## Overview
99

10-
The Konnector Agent addon provides:
10+
Konnector Agent's addon management via CAREN(Cluster API Runtime Extensions - Nutanix) provides:
1111

1212
- **Automatic cluster registration** with Nutanix Prism Central
1313
- **Lifecycle management** through Cluster API hooks
@@ -193,6 +193,6 @@ kubectl logs hook-preinstall -n ntnx-system
193193

194194
## References
195195

196-
- [Konnector Agent Repository](https://github.com/nutanix-core/k8s-agent)
196+
- [Konnector Agent ](https://portal.nutanix.com/page/documents/details?targetId=Prism-Central-Guide-vpc_7_3:mul-cluster-kubernetes-clusters-manage-pc-c.html)
197197
- [Cluster API Add-on Provider for Helm](https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm)
198198
- [Cluster API Runtime Hooks](https://cluster-api.sigs.k8s.io/tasks/experimental-features/runtime-sdk/hooks.html)

hack/addons/kustomize/konnector-agent/kustomization.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99

1010
helmCharts:
1111
- name: konnector-agent
12-
namespace: kube-system
12+
namespace: ntnx-system
1313
#repo: https://mesosphere.github.io/charts/stable
1414
repo: http://192.168.1.7:8080
1515
releaseName: konnector-agent

pkg/handlers/lifecycle/konnectoragent/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
// Package konnector-agent provides a handler for managing k8s agent deployments on clusters
55
//
6-
// +kubebuilder:rbac:groups=addons.cluster.x-k8s.io,resources=clusterresourcesets,verbs=watch;list;get;create;patch;update;delete
6+
// +kubebuilder:rbac:groups=addons.cluster.x-k8s.io,resources=helmchartproxies,verbs=watch;list;get;create;patch;update;delete
77
// +kubebuilder:rbac:groups="",resources=configmaps,verbs=watch;list;get;create;patch;update;delete
88
package konnectoragent

pkg/handlers/lifecycle/konnectoragent/handler.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,6 @@ func (n *DefaultKonnectorAgent) BeforeClusterDelete(
398398
resp.SetStatus(runtimehooksv1.ResponseStatusSuccess)
399399
resp.SetRetryAfterSeconds(5) // Quick retry to start monitoring
400400

401-
case v1alpha1.AddonStrategyClusterResourceSet:
402-
log.Info("ClusterResourceSet strategy does not require cleanup")
403-
resp.SetStatus(runtimehooksv1.ResponseStatusSuccess)
404401
case "":
405402
log.Info("No strategy specified, skipping cleanup")
406403
resp.SetStatus(runtimehooksv1.ResponseStatusSuccess)
@@ -413,7 +410,7 @@ func (n *DefaultKonnectorAgent) BeforeClusterDelete(
413410
}
414411
}
415412

416-
func (n *DefaultKonnectorAgent) deleteHelmChart(
413+
func (n *DefaultKonnectorAgent) deleteHelmChartProxy(
417414
ctx context.Context,
418415
cluster *clusterv1.Cluster,
419416
log logr.Logger,
@@ -442,7 +439,7 @@ func (n *DefaultKonnectorAgent) deleteHelmChart(
442439
err := n.client.Get(ctx, ctrlclient.ObjectKeyFromObject(hcp), currentHCP)
443440
if err != nil {
444441
if ctrlclient.IgnoreNotFound(err) == nil {
445-
log.Info("K8s Registration Agent HelmChartProxy already deleted", "name", hcp.Name)
442+
log.Info("Konnector Agent HelmChartProxy is not present on cluster", "name", hcp.Name)
446443
return nil
447444
}
448445
return fmt.Errorf("failed to get HelmChartProxy %q: %w", ctrlclient.ObjectKeyFromObject(hcp), err)

0 commit comments

Comments
 (0)