Skip to content

Commit

Permalink
update acc
Browse files Browse the repository at this point in the history
  • Loading branch information
nitesh3108 committed Jun 10, 2024
1 parent 846b855 commit 99f7f59
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
3 changes: 3 additions & 0 deletions api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ type ObservabilityComponentType string
// ClientType - the type of the client
type ClientType string

// AccType - the type of the client
type AccType string

const (
// Replication - placeholder for replication constant
Replication ModuleType = "replication"
Expand Down
15 changes: 11 additions & 4 deletions controllers/acc_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,18 @@ const (

// AccFinalizerName - the name of the finalizer
AccFinalizerName = "finalizer.dell.com"

// AccVersion
AccVersion = "v1.0.0"
)

var (
accdMutex sync.RWMutex
accConfigVersionKey = fmt.Sprintf("%s/%s", AccMetadataPrefix, "ApexConnectivityClientConfigVersion")

// AccVersionKey
AccVersionKey = fmt.Sprintf("%s/%s", AccMetadataPrefix, "AccVersion")

// AccStopWatch - watcher stop handle
AccStopWatch = make(chan struct{})
)
Expand Down Expand Up @@ -204,7 +210,6 @@ func (r *ApexConnectivityClientReconciler) Reconcile(ctx context.Context, req ct
syncErr := r.SyncACC(ctx, *acc, *op)
if syncErr == nil && !requeue.Requeue {
log.Infof("ACC --> SyncACC nil")
//if err = DeployApexConnectivityClient(ctx, false, *op, *acc, crc); err != nil {
if err = utils.UpdateAccStatus(ctx, acc, r, newStatus); err != nil {
log.Error(err, "Failed to update CR status")
return utils.LogBannerAndReturn(reconcile.Result{Requeue: true}, err)
Expand Down Expand Up @@ -400,12 +405,15 @@ func applyAccConfigVersionAnnotations(ctx context.Context, instance *csmv1.ApexC
log := logger.GetLogger(ctx)

// If client has not been initialized yet, we first annotate the client with the config version annotation

annotations := instance.GetAnnotations()
isUpdated := false
if annotations == nil {
annotations = make(map[string]string)
}

annotations[AccVersionKey] = AccVersion
instance.SetAnnotations(annotations)

if _, ok := annotations[accConfigVersionKey]; !ok {
annotations[accConfigVersionKey] = instance.Spec.Client.ConfigVersion
isUpdated = true
Expand Down Expand Up @@ -508,8 +516,7 @@ func (r *ApexConnectivityClientReconciler) SyncACC(ctx context.Context, cr csmv1
}

apexName := "ApexConnectivityClient"

// sync statefulset
// sync StatefulSet
if err = statefulset.SyncStatefulSet(ctx, controller.StatefulSet, cluster.ClusterK8sClient, apexName); err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ rules:
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["list", "watch"]
verbs: ["list", "watch" "update"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["list", "watch"]
verbs: ["list", "watch" "create" "update" "delete"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["list", "watch", "create", "delete"]
Expand All @@ -47,7 +47,7 @@ rules:
verbs: ["list", "watch"]
- apiGroups: ["apps"]
resources: ["statefulsets"]
verbs: ["list", "watch"]
verbs: ["list", "watch" "update" "patch"]
- apiGroups: ["apps"]
resources: ["daemonsets"]
verbs: ["list", "watch"]
Expand Down
4 changes: 0 additions & 4 deletions pkg/drivers/commonconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ import (
)

const (
// AccManifest - deployment resources for Apex Connectivity Client
AccManifest string = "statefulset.yaml"

// AccNamespace - deployment namespace
AccNamespace string = "<NAMESPACE>"

Expand Down Expand Up @@ -560,7 +557,6 @@ func GetCSIDriver(ctx context.Context, cr csmv1.ContainerStorageModule, operator

// ModifyApexConnectivityClientCR - update the custom resource
func ModifyApexConnectivityClientCR(yamlString string, cr csmv1.ApexConnectivityClient) string {
fmt.Println("ACC --> Inside ModifyApexConnectivityClientCR")
namespace := ""
aggregatorURL := AggregatorURLDefault
connectivityClientImage := ""
Expand Down

0 comments on commit 99f7f59

Please sign in to comment.