Skip to content

Commit

Permalink
Merge branch 'master' into bug/vaibhav135/6115
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhav135 committed Aug 30, 2022
2 parents 8c1486e + 983728b commit 3deadaa
Show file tree
Hide file tree
Showing 44 changed files with 176 additions and 78 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/test_adapters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,17 @@ jobs:
- name: Pattern apply (Install service mesh)
run: |
cat ./${{ inputs.patternfile_name }}
mesheryctl pattern apply -f ./${{ inputs.patternfile_name }}
for n in {1..3}
do
x=$(mesheryctl pattern apply -f ./${{ inputs.patternfile_name }})
echo "pattern apply log: $x"
if [[ $x == "*invalid workload of type:*" ]];
then
sleep 30
else
break
fi
done
- name: Check adapter logs
run: |
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "cmd/gowrk2"]
path = cmd/gowrk2
url = https://github.com/layer5io/gowrk2
[submodule "server/cmd/gowrk2"]
path = server/cmd/gowrk2
url = https://github.com/layer5io/gowrk2/
13 changes: 13 additions & 0 deletions docs/_compatibility/meshery-kuma/08-30-2022-09-16-08_be7c0796.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
timestamp: "2022-08-30 09:15:48 UTC Tue"
meshery-component: meshery-kuma
meshery-component-version: edge
meshery-server-version: "v0.6.3"
k8s-distro: minikube
k8s-version: "v1.23.9"
service-mesh: Kuma
service-mesh-version: "1.8.0"
tests:
pod/kuma-control-plane: "Running"
overall-status: "passing"
---
13 changes: 13 additions & 0 deletions docs/_compatibility/meshery-kuma/08-30-2022-13-08-08_23c3ed82.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
timestamp: "2022-08-30 13:07:40 UTC Tue"
meshery-component: meshery-kuma
meshery-component-version: edge
meshery-server-version: "v0.6.3"
k8s-distro: minikube
k8s-version: "v1.23.9"
service-mesh: Kuma
service-mesh-version: "1.8.0"
tests:
pod/kuma-control-plane: "Running"
overall-status: "passing"
---
13 changes: 13 additions & 0 deletions docs/_compatibility/meshery-kuma/08-30-2022-13-14-08_3ca44ec5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
timestamp: "2022-08-30 13:14:07 UTC Tue"
meshery-component: meshery-kuma
meshery-component-version: edge
meshery-server-version: "v0.6.3"
k8s-distro: minikube
k8s-version: "v1.22.2"
service-mesh: Kuma
service-mesh-version: "1.8.0"
tests:
pod/kuma-control-plane: "Running"
overall-status: "passing"
---
13 changes: 13 additions & 0 deletions docs/_compatibility/meshery-kuma/08-30-2022-14-20-08_e81b1050.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
timestamp: "2022-08-30 14:19:45 UTC Tue"
meshery-component: meshery-kuma
meshery-component-version: edge
meshery-server-version: "v0.6.3"
k8s-distro: minikube
k8s-version: "v1.23.9"
service-mesh: Kuma
service-mesh-version: "1.8.0"
tests:
pod/kuma-control-plane: "Running"
overall-status: "passing"
---
15 changes: 15 additions & 0 deletions docs/_compatibility/meshery-osm/08-30-2022-13-37-08_12a6719f.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
timestamp: "2022-08-30 13:37:19 UTC Tue"
meshery-component: meshery-osm
meshery-component-version: edge
meshery-server-version: "v0.6.3"
k8s-distro: minikube
k8s-version: "v1.20.11"
service-mesh: OSM
service-mesh-version: "v1.2.0"
tests:
pod/osm-bootstrap: "Not Running"
pod/osm-controller: "Not Running"
pod/osm-injector: "Not Running"
overall-status: "failing"
---
File renamed without changes.
9 changes: 9 additions & 0 deletions mesheryctl/internal/cli/root/pattern/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/layer5io/meshery/mesheryctl/internal/cli/root/config"
"github.com/layer5io/meshery/mesheryctl/pkg/utils"
"github.com/layer5io/meshery/server/models"
"github.com/layer5io/meshery/server/models/pattern/core"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -222,13 +223,21 @@ mesheryctl pattern apply [pattern-name]
return err
}

pf, err := core.NewPatternFile([]byte(patternFile))
if err != nil {
return errors.Wrap(err, "Pattern appears invalid. Could not parse successfully")
}

s := utils.CreateDefaultSpinner("Applying pattern "+pf.Name, "")
s.Start()
res, err := client.Do(req)
if err != nil {
return err
}

defer res.Body.Close()
body, err := io.ReadAll(res.Body)
s.Stop()
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion mesheryctl/internal/cli/root/system/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (hc *HealthChecker) Run() error {
return nil
}

//Run preflight healthchecks to verify environment health
// Run preflight healthchecks to verify environment health
func (hc *HealthChecker) RunPreflightHealthChecks() error {
// Docker healthchecks are only invoked when it's not a PreRunExecution
// or it's a PreRunExecution and current platform is docker
Expand Down
2 changes: 1 addition & 1 deletion mesheryctl/pkg/utils/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
var minAPIVersion = [3]int{1, 12, 0}
var minKubectlVersion = minAPIVersion

//GetK8sVersionInfo returns version.Info for the Kubernetes cluster.
// GetK8sVersionInfo returns version.Info for the Kubernetes cluster.
func GetK8sVersionInfo() (*version.Info, error) {
// create an kubernetes client
client, err := meshkitkube.New([]byte(""))
Expand Down
5 changes: 3 additions & 2 deletions mesheryctl/pkg/utils/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,10 @@ func ContainsStringPrefix(arr []string, str string) bool {
}

// TransformYAML takes in:
// yamlByt - YAML Byte slice that needs to be modified
//
// yamlByt - YAML Byte slice that needs to be modified
// transform - function that will be executed on that value, the returned value will replace the current value
// keys - takes in a series of keys which are supposed to be nested, numbers can also be passed to access an array
// keys - takes in a series of keys which are supposed to be nested, numbers can also be passed to access an array
func TransformYAML(yamlByt []byte, transform func(interface{}) (interface{}, error), keys ...string) ([]byte, error) {
var data map[string]interface{}

Expand Down
4 changes: 2 additions & 2 deletions mesheryctl/pkg/utils/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func DownloadDockerComposeFile(ctx *config.Context, force bool) error {
fileURL := ""

if ctx.Channel == "edge" {
fileURL = "https://raw.githubusercontent.com/" + constants.GetMesheryGitHubOrg() + "/" + constants.GetMesheryGitHubRepo() + "/master/docker-compose.yaml"
fileURL = "https://raw.githubusercontent.com/" + constants.GetMesheryGitHubOrg() + "/" + constants.GetMesheryGitHubRepo() + "/master/install/docker/docker-compose.yaml"
} else if ctx.Channel == "stable" {
if ctx.Version == "latest" {
ReleaseTag, err = GetLatestStableReleaseTag()
Expand All @@ -349,7 +349,7 @@ func DownloadDockerComposeFile(ctx *config.Context, force bool) error {
ReleaseTag = currCtx.GetVersion()
}

fileURL = "https://raw.githubusercontent.com/" + constants.GetMesheryGitHubOrg() + "/" + constants.GetMesheryGitHubRepo() + "/" + ReleaseTag + "/docker-compose.yaml"
fileURL = "https://raw.githubusercontent.com/" + constants.GetMesheryGitHubOrg() + "/" + constants.GetMesheryGitHubRepo() + "/" + ReleaseTag + "/install/docker/docker-compose.yaml"
} else {
return errors.Errorf("unknown channel %s", ctx.Channel)
}
Expand Down
14 changes: 7 additions & 7 deletions provider-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion provider-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"eslint": "^7.32.0",
"eslint-config-next": "^12.2.5",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react": "^7.31.1",
"http-proxy": "^1.18.1",
"nodemon": "^2.0.18",
"nyc": "^15.1.0",
Expand Down
1 change: 1 addition & 0 deletions server/cmd/gowrk2
Submodule gowrk2 added at aabd83
Empty file removed server/cmd/gowrk2/text.txt
Empty file.
2 changes: 1 addition & 1 deletion server/handlers/common_handlers.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Package handlers : collection of handlers (aka "HTTP middleware")
// Package handlers : collection of handlers (aka "HTTP middleware")
package handlers

import (
Expand Down
8 changes: 4 additions & 4 deletions server/handlers/content_modifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"gopkg.in/yaml.v2"
)

//To be used while adding metadata to patterns,filters and applicationss
// To be used while adding metadata to patterns,filters and applicationss
type ContentModifier struct {
token string
provider models.Provider
Expand All @@ -30,8 +30,8 @@ func NewContentModifier(token string,
}
}

//TODO: Similar mechanisms for filters and applications
//Takes in response bytes, and add metadata to it based on some checks
// TODO: Similar mechanisms for filters and applications
// Takes in response bytes, and add metadata to it based on some checks
func (mc *ContentModifier) AddMetadataForPatterns(ctx context.Context, contentBytes *[]byte) error {
var patternsPage models.MesheryPatternPage
err := json.Unmarshal(*contentBytes, &patternsPage)
Expand Down Expand Up @@ -77,7 +77,7 @@ func (mc *ContentModifier) AddMetadataForPatterns(ctx context.Context, contentBy
return err
}

//takes a patternfile and returns the status of its current support by using dry run
// takes a patternfile and returns the status of its current support by using dry run
func (mc *ContentModifier) isPatternSupported(ctx context.Context, patternfile string) (msg string, ok bool) {
var pattern map[string]interface{}
err := yaml.Unmarshal([]byte(patternfile), &pattern)
Expand Down
34 changes: 16 additions & 18 deletions server/handlers/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,26 @@
// This should demonstrate all the possible comment annotations
// that are available to turn go code into a fully compliant swagger 2.0 spec
//
// Schemes: http
// BasePath: /
// Version: 0.4.27
// License: Apache-2.0 http://www.apache.org/licenses/LICENSE-2.0.txt
//
// Schemes: http
// BasePath: /
// Version: 0.4.27
// License: Apache-2.0 http://www.apache.org/licenses/LICENSE-2.0.txt
// Consumes:
// - application/json
// - multipart/form-data
//
// Consumes:
// - application/json
// - multipart/form-data
// Produces:
// - application/json
//
// Produces:
// - application/json
//
// Security:
// - token: []
//
// SecurityDefinitions:
// token:
// type: apiKey
// name: token
// in: cookie
// Security:
// - token: []
//
// SecurityDefinitions:
// token:
// type: apiKey
// name: token
// in: cookie
//
// swagger:meta
package handlers
Expand Down
2 changes: 1 addition & 1 deletion server/handlers/events_streamer.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Package handlers :collection of handlers (aka "HTTP middleware")
// Package handlers :collection of handlers (aka "HTTP middleware")
package handlers

import (
Expand Down
2 changes: 1 addition & 1 deletion server/handlers/fetch_results_handler.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Package handlers : collection of handlers (aka "HTTP middleware")
// Package handlers : collection of handlers (aka "HTTP middleware")
package handlers

import (
Expand Down
2 changes: 1 addition & 1 deletion server/handlers/grafana_handlers.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Package handlers : collection of handlers (aka "HTTP middleware")
// Package handlers : collection of handlers (aka "HTTP middleware")
package handlers

import (
Expand Down
2 changes: 1 addition & 1 deletion server/handlers/handler_instance.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Package handlers : collection of handlers (aka "HTTP middleware")
// Package handlers : collection of handlers (aka "HTTP middleware")
package handlers

import (
Expand Down
3 changes: 1 addition & 2 deletions server/handlers/k8sconfig_handler.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Package handlers : collection of handlers (aka "HTTP middleware")
// Package handlers : collection of handlers (aka "HTTP middleware")
package handlers

import (
Expand Down Expand Up @@ -246,7 +246,6 @@ func (h *Handler) KubernetesPingHandler(w http.ResponseWriter, req *http.Request
return
}
http.Error(w, "Empty contextID. Pass the context ID(in query parameter \"context\") of the kuberenetes to be pinged", http.StatusBadRequest)
return
}

func (h *Handler) LoadContextsAndPersist(token string, prov models.Provider) ([]*models.K8sContext, error) {
Expand Down
2 changes: 1 addition & 1 deletion server/handlers/load_test_handler.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Package handlers : collection of handlers (aka "HTTP middleware")
// Package handlers : collection of handlers (aka "HTTP middleware")
package handlers

import (
Expand Down
2 changes: 1 addition & 1 deletion server/handlers/load_test_preferences_handler.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Package handlers : collection of handlers (aka "HTTP middleware")
// Package handlers : collection of handlers (aka "HTTP middleware")
package handlers

import (
Expand Down
2 changes: 1 addition & 1 deletion server/handlers/mesh_ops_handlers.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Package handlers : collection of handlers (aka "HTTP middleware")
// Package handlers : collection of handlers (aka "HTTP middleware")
package handlers

import (
Expand Down
10 changes: 6 additions & 4 deletions server/handlers/meshery_filter_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ type MesheryFilterRequestBody struct {
//
// Returns the Meshery Filter file saved by the current user with the given id
// responses:
// 200: mesheryFilterResponseWrapper
//
// 200: mesheryFilterResponseWrapper
func (h *Handler) GetMesheryFilterFileHandler(
rw http.ResponseWriter,
r *http.Request,
Expand All @@ -50,7 +50,8 @@ func (h *Handler) GetMesheryFilterFileHandler(
//
// Returns all the Meshery Filters saved by the current user
// responses:
// 200: mesheryFiltersResponseWrapper
//
// 200: mesheryFiltersResponseWrapper
//
// FilterFileRequestHandler will handle requests of both type GET and POST
// on the route /api/filter
Expand All @@ -77,8 +78,8 @@ func (h *Handler) FilterFileRequestHandler(
//
// Used to save/update a Meshery Filter
// responses:
// 200: mesheryFilterResponseWrapper
//
// 200: mesheryFilterResponseWrapper
func (h *Handler) handleFilterPOST(
rw http.ResponseWriter,
r *http.Request,
Expand Down Expand Up @@ -220,7 +221,8 @@ func (h *Handler) GetCatalogMesheryFiltersHandler(
//
// Deletes a meshery filter with ID: id
// responses:
// 200: noContentWrapper
//
// 200: noContentWrapper
//
// DeleteMesheryFilterHandler deletes a filter with the given id
func (h *Handler) DeleteMesheryFilterHandler(
Expand Down
Loading

0 comments on commit 3deadaa

Please sign in to comment.