private ExtensionLinkEntity createExtensionLinkEntity(StackInfo stackInfo, ExtensionInfo extensionInfo) throws AmbariException {
    StackEntity stack = stackDAO.find(stackInfo.getName(), stackInfo.getVersion());
    ExtensionEntity extension = extensionDAO.find(extensionInfo.getName(), extensionInfo.getVersion());

    ExtensionLinkEntity linkEntity = new ExtensionLinkEntity();
    linkEntity.setStack(stack);
    linkEntity.setExtension(extension);
    return linkEntity;
  }
Updates the extension version of the currently linked extension to the stack version
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementHelper.java