protected KerberosDescriptor getKerberosDescriptor(Cluster cluster) throws AmbariException {
    // Get the Stack-defined Kerberos Descriptor (aka default Kerberos Descriptor)
    AmbariMetaInfo ambariMetaInfo = injector.getInstance(AmbariMetaInfo.class);


    // !!! FIXME
    @Experimental(feature = ExperimentalFeature.PATCH_UPGRADES,
        comment = "can only take the first stack we find until we can support multiple with Kerberos")
    StackId stackId = getStackId(cluster);

    KerberosDescriptor defaultDescriptor = ambariMetaInfo.getKerberosDescriptor(stackId.getStackName(), stackId.getStackVersion(), false);

    // Get the User-set Kerberos Descriptor
    ArtifactDAO artifactDAO = injector.getInstance(ArtifactDAO.class);
    KerberosDescriptor artifactDescriptor = null;
    ArtifactEntity artifactEntity = artifactDAO.findByNameAndForeignKeys("kerberos_descriptor",
      new TreeMap<>(Collections.singletonMap("cluster", String.valueOf(cluster.getClusterId()))));
    if (artifactEntity != null) {
      Map<String, Object> data = artifactEntity.getArtifactData();

      if (data != null) {
        artifactDescriptor = new KerberosDescriptorFactory().createInstance(data);
      }
    }

    // Calculate and return the composite Kerberos Descriptor
    if (defaultDescriptor == null) {
      return artifactDescriptor;
    } else if (artifactDescriptor == null) {
      return defaultDescriptor;
    } else {
      defaultDescriptor.update(artifactDescriptor);
      return defaultDescriptor;
    }
  }
Retrieve the composite Kerberos Descriptor.
<p>
The composite Kerberos Descriptor is the cluster's stack-specific Kerberos Descriptor overlaid
with changes specified by the user via the cluster's Kerberos Descriptor artifact.

@param cluster the relevant cluster
@return the composite Kerberos Descriptor
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java