code: func (k *KeyManager) Run(ctx context.Context) error {
  	k.mu.Lock()
  	ctx = log.WithModule(ctx, "keymanager")
  	var (
  		clusters []*api.Cluster
  		err      error
  	)
  	k.store.View(func(readTx store.ReadTx) {
  		clusters, err = store.FindClusters(readTx, store.ByName(k.config.ClusterName))
  	})
  
  	if err != nil {
  		log.G(ctx).Errorf("reading cluster config failed, %v", err)
  		k.mu.Unlock()
  		return err
  	}
  
  	cluster := clusters[0]
  	if len(cluster.NetworkBootstrapKeys) == 0 {
  		for _, subsys := range k.config.Subsystems {
  			for i := 0; i < keyringSize; i++ {
  				k.keyRing.keys = append(k.keyRing.keys, k.allocateKey(ctx, subsys))
  			}
  		}
  		if err := k.updateKey(cluster); err != nil {
  			log.G(ctx).Errorf("store update failed %v", err)
  		}
  	} else {
  		k.keyRing.lClock = cluster.EncryptionKeyLamportClock
  		k.keyRing.keys = cluster.NetworkBootstrapKeys
  	}
  
  	ticker := time.NewTicker(k.config.RotationInterval)
  	defer ticker.Stop()
  
  	k.ctx, k.cancel = context.WithCancel(ctx)
  	k.mu.Unlock()
  
  	for {
  		select {
  		case <-ticker.C:
  			k.rotateKey(ctx)
  		case <-k.ctx.Done():
  			return nil
  		}
  	}
  }
docs: // Run starts the keymanager, it doesn't return