public K8sApiCatalog Merge()

in src/Azure.Deployments.Extensibility.Extensions.Kubernetes/Api/ApiCatalog/K8sApiCatalog.cs [46:62]


        public K8sApiCatalog Merge(ImmutableArray<K8sApiMetadata> additionalRecords)
        {
            var mergedRecords = this.records
                .Concat(additionalRecords)
                .GroupBy(x => (x.Group, x.Version, x.Kind, x.Plural, x.Namespaced))
                .Select(g => new K8sApiMetadata(
                    g.Key.Group,
                    g.Key.Version,
                    g.Key.Kind,
                    g.Key.Plural,
                    g.Key.Namespaced,
                    g.SelectMany(x => x.MajorMinorServerVersions).Distinct().ToImmutableArray().Sort()))
                .Order()
                .ToImmutableArray();

            return new K8sApiCatalog(mergedRecords);
        }