Skip to content

Instantly share code, notes, and snippets.

@sumanthkumarc
Created August 3, 2022 17:16
Show Gist options
  • Save sumanthkumarc/d5150dbc4ee37bd645a78f4a5bdaa9b8 to your computer and use it in GitHub Desktop.
Save sumanthkumarc/d5150dbc4ee37bd645a78f4a5bdaa9b8 to your computer and use it in GitHub Desktop.
Code to ensure dp token signing key
// Copied from https://github.com/kumahq/kuma/blob/master/pkg/defaults/mesh/mesh.go#L60
created, err := ensureDataplaneTokenSigningKey(ctx, resManager, meshName)
if err != nil {
return errors.Wrap(err, "could not create default Dataplane Token Signing Key")
}
if created {
resKey := tokens.SigningKeyResourceKey(issuer.DataplaneTokenSigningKeyPrefix(meshName), tokens.DefaultSerialNumber, meshName)
log.Info("default Dataplane Token Signing Key created", "mesh", meshName, "name", resKey.Name)
} else {
log.Info("Dataplane Token Signing Key already exists", "mesh", meshName)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment