Skip to content

Commit

Permalink
Merge branch 'master' into permRef
Browse files Browse the repository at this point in the history
  • Loading branch information
iArchitSharma committed May 16, 2024
2 parents 8f258b2 + b54d8a3 commit ca61bbe
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 10 deletions.
5 changes: 5 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,9 @@ connection, credential
- [CLI] Colorizing output
- [CLI] Mesheryctl Code coverage goal: 40%

**Catalog**

- [Catalog] Intellectual property protections for user-produced content
- [UI/Server] Improved performance and stability in catalog interactions to facilitate payment processing

Refer to [Meshery Roadmap](https://docs.google.com/document/d/1kvcz8jdvFwXmYBBaY2-3fHHUUoy1GJLpZZXuoxZQoOk/edit#) document for detailed info.
15 changes: 15 additions & 0 deletions docs/_compatibility/meshery-linkerd/05-16-2024-00-22-05_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
timestamp: "2024-05-16 00:22:28 UTC Thu"
meshery-component: meshery-linkerd
meshery-component-version: edge
meshery-server-version: "v0.7.57"
k8s-distro: minikube
k8s-version: "v1.29.0"
service-mesh: Linkerd
service-mesh-version: "stable-2.14.10"
tests:
pod/linkerd-destination: "Not Running"
pod/linkerd-identity: "Not Running"
pod/linkerd-proxy-injector: "Not Running"
overall-status: "failing"
---
2 changes: 1 addition & 1 deletion docs/_data/discuss/meshery.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_data/discuss/mesheryctl.json

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions docs/_integrations/linkerd/edge-24.5.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
component: edge-24.5.2
integrations:
- authorizationpolicy.Linkerd
- externalworkload.Linkerd
- jaegerlinkerdaddon_meshmodel.json
- linkerdmesh_meshmodel.json
- meshtlsauthentication.Linkerd
- networkauthentication.Linkerd
- server.Linkerd
- serverauthorization.Linkerd
- serviceprofile.Linkerd
- smilinkerdaddon_meshmodel.json
- vizlinkerdaddon_meshmodel.json
---
15 changes: 15 additions & 0 deletions docs/_integrations/linkerd/edge-24.5.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
component: edge-24.5.3
integrations:
- authorizationpolicy.Linkerd
- externalworkload.Linkerd
- jaegerlinkerdaddon_meshmodel.json
- linkerdmesh_meshmodel.json
- meshtlsauthentication.Linkerd
- networkauthentication.Linkerd
- server.Linkerd
- serverauthorization.Linkerd
- serviceprofile.Linkerd
- smilinkerdaddon_meshmodel.json
- vizlinkerdaddon_meshmodel.json
---
4 changes: 4 additions & 0 deletions docs/_models/grafana-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ components:
colorIcon: assets/img/integrations/grafana-operator/components/grafana-alert-rule-group/icons/color/grafana-alert-rule-group-color.svg
whiteIcon: assets/img/integrations/grafana-operator/components/grafana-alert-rule-group/icons/white/grafana-alert-rule-group-white.svg
description:
- name: grafana-contact-point
colorIcon: assets/img/integrations/grafana-operator/components/grafana-contact-point/icons/color/grafana-contact-point-color.svg
whiteIcon: assets/img/integrations/grafana-operator/components/grafana-contact-point/icons/white/grafana-contact-point-white.svg
description:
featureList: [
"Centralize the analysis, visualization, and alerting for all of your data with Grafana.",
"Meshery discovers your Grafana servers. Easily import existing Grafana dashboards and panels into Meshery",
Expand Down
28 changes: 22 additions & 6 deletions server/models/pattern/core/pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
registry "github.com/layer5io/meshkit/models/meshmodel/registry"
regv1beta1 "github.com/layer5io/meshkit/models/meshmodel/registry/v1beta1"
"github.com/layer5io/meshkit/models/oam/core/v1alpha1"
mutils "github.com/layer5io/meshkit/utils"
"github.com/layer5io/meshkit/utils/manifests"
"github.com/sirupsen/logrus"
cytoscapejs "gonum.org/v1/gonum/graph/formats/cytoscapejs"
Expand Down Expand Up @@ -155,7 +156,7 @@ type Pattern struct {
// PatternID is the moniker use to uniquely identify any given pattern
// Convention: SMP-###-v#.#.#
PatternID string `yaml:"patternID,omitempty" json:"patternID,omitempty"`
Services map[string]*Service `yaml:"services,omitempty" json:"services,omitempty"`
Services map[string]*Service `yaml:"services" json:"services"`
}

// Service represents the services defined within the appfile
Expand Down Expand Up @@ -525,12 +526,8 @@ func createPatternServiceFromK8s(manifest map[string]interface{}, regManager *re
kind, _ := manifest["kind"].(string)
metadata, _ := manifest["metadata"].(map[string]interface{})
name, _ := metadata["name"].(string)
namespace, _ := metadata["namespace"].(string)
labels, _ := metadata["labels"].(map[string]interface{})
annotations, _ := metadata["annotations"].(map[string]interface{})
if namespace == "" {
namespace = "default"
}
fmt.Printf("%+#v\n", manifest)
// rest will store a map of everything other than the above mentioned fields
rest := map[string]interface{}{}
Expand Down Expand Up @@ -588,7 +585,6 @@ func createPatternServiceFromK8s(manifest map[string]interface{}, regManager *re
Name: name,
Type: comp.Component.Kind,
APIVersion: comp.Component.Version,
Namespace: namespace,
Model: comp.Model.Name,
Labels: castedLabel,
Annotations: castedAnnotation,
Expand All @@ -601,9 +597,29 @@ func createPatternServiceFromK8s(manifest map[string]interface{}, regManager *re
},
}

assignNamespaceForNamespacedScopedComp(&svc, metadata, comp)
return id, svc, nil
}

func assignNamespaceForNamespacedScopedComp(svc *Service, metadata map[string]interface{}, compDef *modelv1beta1.ComponentDefinition) *Service {
if isNamespacedComponent(compDef) {
namespace, _ := mutils.Cast[string](metadata["namespace"])
if namespace == "" {
svc.Namespace = "default"
} else {
svc.Namespace = namespace
}
}
return svc
}

// Checks whether the component is namespaced scope or not.
// While determining if an error occurs, the conversion process skips assigning a namespace value. If comp is originally namespaced scope, then k8s automatically assign a "default" namespace.
func isNamespacedComponent(comp *modelv1beta1.ComponentDefinition) bool {
isNamespaced, _ := mutils.Cast[bool](comp.Metadata["isNamespaced"])
return isNamespaced
}

// getCytoscapeElementID returns the element id for a given service
func getCytoscapeElementID(name string, svc *Service) string {
mpi, ok := svc.Traits["meshmap"] // check if service has meshmap as trait
Expand Down
2 changes: 1 addition & 1 deletion server/models/pattern/stages/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func Validator(prov ServiceInfoProvider, act ServiceActionProvider, validate boo
act.Terminate(err)
return
}
act.Log(fmt.Sprintf("%s version for %s: %s", svc.Model, svc.Name, wc.Model.Version)) //Eg: kubernetes version for Namespace: v1.25.0
act.Log(fmt.Sprintf("%s version for %s: %s", svc.Model, svc.Name, wc.Model.Model.Version)) //Eg: kubernetes version for Namespace: v1.25.0
if core.Format {
svc.Settings = core.Format.DePrettify(svc.Settings, false)
}
Expand Down
2 changes: 1 addition & 1 deletion ui/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ function K8sContextMenu({
src={
connectionMetadataState
? `/${connectionMetadataState[CONNECTION_KINDS.KUBERNETES]?.icon}`
: ''
: '/static/img/kubernetes.svg'
}
width="24px"
height="24px"
Expand Down

0 comments on commit ca61bbe

Please sign in to comment.