github.com/cilium/cilium@v1.16.2/pkg/kvstore/backwards_compat.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Cilium
     3  
     4  package kvstore
     5  
     6  import "context"
     7  
     8  const (
     9  	// OperationalPath is the base path to store the operational details in the kvstore.
    10  	OperationalPath = "cilium-net/operational"
    11  
    12  	// servicePathV1 is the base path for the services stored in the kvstore.
    13  	servicePathV1 = OperationalPath + "/Services/"
    14  )
    15  
    16  // deleteLegacyPrefixes removes old kvstore prefixes of non-persistent keys
    17  // which have been used in the past but have been obsoleted since. We remove
    18  // them on agent start to ensure that as users upgrade, we do not leave behind
    19  // stale keys
    20  //
    21  // Rules:
    22  //
    23  //   - For non-persistent state, obsoletd prefixes can be deleted as soon as the
    24  //     prefix has been declared obsolete
    25  //   - For persistent configuration stored in the kvstore, a forward upgrade
    26  //     path must be created which automatically removes the old keys on successful
    27  //     translation.
    28  func deleteLegacyPrefixes(ctx context.Context) {
    29  	// Delete all keys in old services prefix
    30  	Client().DeletePrefix(ctx, servicePathV1)
    31  }