Skip to content

Commit

Permalink
MeshKit upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: leecalcote <[email protected]>
Signed-off-by: Antonette Caldwell <[email protected]>
  • Loading branch information
leecalcote authored and acald-creator committed Oct 4, 2022
1 parent c70e6da commit e7b3b1e
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Meshery Adapter for NGINX Build and Releaser
name: Meshery-Nginx SM Build and Release
on:
push:
branches:
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
name: Check & Review code
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
fetch-depth: 1
- name: Run golangci-lint
go-version: 1.19
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
Expand Down Expand Up @@ -48,12 +48,18 @@ jobs:
name: Static check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: dominikh/[email protected]
with:
version: "2022.1.1"
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: dominikh/[email protected]
with:
install-go: false
version: "2022.1"
vet:
name: Vet
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2etests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Nginx Adapter - control plane and addons
name: E2E Test Nginx SM Adapter - Control Plane and Addons

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/error-ref-publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ jobs:
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: '--signoff'
commit_message: '[Docs] Error Code Reference: Meshery Adapter for OSM updated'
commit_message: '[Docs] Error Code Reference: Meshery Adapter for NGINX Service Mesh updated'
file_pattern: docs/
2 changes: 1 addition & 1 deletion .github/workflows/update-oam-defs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ jobs:
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: "--signoff"
commit_message: "[Patterns] Pattern components generated from latest Kuma Helm chart"
commit_message: "[Patterns] Pattern components generated from latest Nginx Service Mesh Helm chart"
branch: master
4 changes: 0 additions & 4 deletions build/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ func NewConfig(version string) manifests.Config {
SpecPath: "spec.versions[0].schema.openAPIV3Schema.properties.spec"}, false),
ExtractCrds: func(manifest string) []string {
crds := strings.Split(manifest, "---")
// trim the spaces
for _, crd := range crds {
crd = strings.TrimSpace(crd)
}
return crds
},
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ replace (
require (
github.com/google/uuid v1.3.0
github.com/layer5io/meshery-adapter-library v0.5.10
github.com/layer5io/meshkit v0.6.0
github.com/layer5io/meshkit v0.6.2
github.com/layer5io/service-mesh-performance v0.3.4
gopkg.in/yaml.v2 v2.4.0
k8s.io/apimachinery v0.25.1
k8s.io/apimachinery v0.25.2
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ github.com/layer5io/learn-layer5/smi-conformance v0.0.0-20210317075357-06b4f88b3
github.com/layer5io/learn-layer5/smi-conformance v0.0.0-20210317075357-06b4f88b3e34/go.mod h1:BQPLwdJt7v7y0fXIejI4whR9zMyX07Wjt5xrbgEmHLw=
github.com/layer5io/meshery-adapter-library v0.5.10 h1:Qgr6vDx2s10mkhtk7Mnz5I73m/9yf2yyjCkPMeB4jmA=
github.com/layer5io/meshery-adapter-library v0.5.10/go.mod h1:Sg6WNN82uRo2kiFDEMc/LM/AJ/Pu6ZmBZGbFxZuC7zc=
github.com/layer5io/meshkit v0.6.0 h1:gDMG5k43WpaM5YgVTZFCz0zH8tmtw27z5/eiuFx5jeo=
github.com/layer5io/meshkit v0.6.0/go.mod h1:1yyleAJTOzSzTA44u3cg764Yk0+pvCUwb/KikLkjea8=
github.com/layer5io/meshkit v0.6.2 h1:QUDIuem9XN8atTfoBokuHbHyRpfpycZs6+iwbccRDlE=
github.com/layer5io/meshkit v0.6.2/go.mod h1:RRrfwtykKlT6sbAnfoXq3Fib70YQpCCAxrc9/2dhnLw=
github.com/layer5io/service-mesh-performance v0.3.2-0.20210122142912-a94e0658b021/go.mod h1:W153amv8aHAeIWxO7b7d7Vibt9RhaEVh4Uh+RG+BumQ=
github.com/layer5io/service-mesh-performance v0.3.4 h1:aw/elsx0wkry7SyiQRIj31wW7TPCP4YfhINdNOLXVg8=
github.com/layer5io/service-mesh-performance v0.3.4/go.mod h1:W153amv8aHAeIWxO7b7d7Vibt9RhaEVh4Uh+RG+BumQ=
Expand Down Expand Up @@ -1478,8 +1478,8 @@ k8s.io/apiextensions-apiserver v0.25.1/go.mod h1:67sgnMs2yIO2iV4DpCdS91vlP+pdnVI
k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg=
k8s.io/apimachinery v0.17.2/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg=
k8s.io/apimachinery v0.17.3/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g=
k8s.io/apimachinery v0.25.1 h1:t0XrnmCEHVgJlR2arwO8Awp9ylluDic706WePaYCBTI=
k8s.io/apimachinery v0.25.1/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA=
k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs=
k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA=
k8s.io/apiserver v0.17.0/go.mod h1:ABM+9x/prjINN6iiffRVNCBR2Wk7uY4z+EtEGZD48cg=
k8s.io/apiserver v0.17.2/go.mod h1:lBmw/TtQdtxvrTk0e2cgtOxHizXI+d0mmGQURIHQZlo=
k8s.io/apiserver v0.25.1 h1:A3gnoQL6lhqRiwWN6f2DGBGdCb+7brCSTrW3klR9Xwc=
Expand Down
1 change: 0 additions & 1 deletion internal/config/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
)

func getOperations(dev adapter.Operations) adapter.Operations {

versions, _ := getLatestReleaseNames(3)

dev[NginxOperation] = &adapter.Operation{
Expand Down
2 changes: 0 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func init() {

// main is the entrypoint of the adaptor
func main() {

// Initialize Logger instance
log, err := logger.New(serviceName, logger.Options{
Format: logger.SyslogLogFormat,
Expand Down Expand Up @@ -153,7 +152,6 @@ func registerDynamicCapabilities(port string, log logger.Handler) {
<-ticker.C
registerWorkloads(port, log)
}

}

func registerWorkloads(port string, log logger.Handler) {
Expand Down
8 changes: 3 additions & 5 deletions nginx/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@ var (

// ErrParseOAMConfig represents the error which is
// generated during the OAM configuration parsing
ErrParseOAMConfig = errors.New(ErrParseOAMConfigCode, errors.Alert, []string{"error parsing the configuration"}, []string{"Error occured while parsing configuration in the request made by Meshery Server"}, []string{"Could not unmarshall OAM config recieved via ProcessOAM gRPC call into a valid Config struct"}, []string{"Check if Meshery Server is creating valid config for ProcessOAM gRPC call. This error should never happen and can be reported as a bug in Meshery Server. Also, confirm that Meshery Server and Adapters are referring to same config struct provided in MeshKit"})
ErrParseOAMConfig = errors.New(ErrParseOAMConfigCode, errors.Alert, []string{"error parsing the configuration"}, []string{"Error occurred while parsing configuration in the request made by Meshery Server"}, []string{"Could not unmarshall OAM config received via ProcessOAM gRPC call into a valid Config struct"}, []string{"Check if Meshery Server is creating valid config for ProcessOAM gRPC call. This error should never happen and can be reported as a bug in Meshery Server. Also, confirm that Meshery Server and Adapters are referring to same config struct provided in MeshKit"})
)

// ErrInstallNginx is the error for install mesh
func ErrInstallNginx(err error) error {
return errors.New(ErrInstallNginxCode, errors.Alert, []string{"Error with Nginx installation"}, []string{err.Error()}, []string{}, []string{})

}

// ErrMeshConfig is the error for mesh config
Expand Down Expand Up @@ -88,7 +87,7 @@ func ErrCustomOperation(err error) error {

// ErrApplyHelmChart is the occurend while applying helm chart
func ErrApplyHelmChart(err error) error {
return errors.New(ErrApplyHelmChartCode, errors.Alert, []string{"Error occured while applying Helm Chart"}, []string{err.Error()}, []string{}, []string{})
return errors.New(ErrApplyHelmChartCode, errors.Alert, []string{"Error occurred while applying Helm Chart"}, []string{err.Error()}, []string{}, []string{})
}

// ErrProcessOAM is a generic error which is thrown when an OAM operations fails
Expand All @@ -108,6 +107,5 @@ func ErrParseNginxCoreComponent(err error) error {

// ErrLoadNamespace is the occurend while applying namespace
func ErrLoadNamespace(err error) error {
return errors.New(ErrLoadNamespaceCode, errors.Alert, []string{"Error occured while applying namespace "}, []string{err.Error()}, []string{"Trying to access a namespace which is not available"}, []string{"Verify presence of namespace. Confirm Meshery ServiceAccount permissions"})

return errors.New(ErrLoadNamespaceCode, errors.Alert, []string{"Error occurred while applying namespace "}, []string{err.Error()}, []string{"Trying to access a namespace which is not available"}, []string{"Verify presence of namespace. Confirm Meshery ServiceAccount permissions"})
}
3 changes: 1 addition & 2 deletions nginx/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (nginx *Nginx) applyHelmChart(del bool, version, namespace string, kubeconf
}

// Set deployment override flag to disable automatic sidecar injection in the meshery namespace.
// This is to prevent Meshery from having connectivy issues with other meshes or non-meshed services.
// This is to prevent Meshery from having connectivity issues with other meshes or non-meshed services.
// This is equal to using the Helm flag: --set autoInjection.disabledNamespaces={"meshery"}
overrideVal := map[string]interface{}{
"autoInjection": map[string]interface{}{
Expand Down Expand Up @@ -160,7 +160,6 @@ func (nginx *Nginx) applyManifest(manifest []byte, isDel bool, namespace string,
errMx.Unlock()
return
}

}(config)
}

Expand Down
2 changes: 1 addition & 1 deletion nginx/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (nginx *Nginx) ApplyOperation(ctx context.Context, opReq adapter.OperationR
operation = "removed"
}
if err != nil {
summary := fmt.Sprintf("Error while labelling %s", opReq.Namespace)
summary := fmt.Sprintf("Error while labeling %s", opReq.Namespace)
hh.streamErr(summary, ee, err)
return
}
Expand Down
2 changes: 0 additions & 2 deletions nginx/sample_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ func (nginx *Nginx) LoadToMesh(namespace string, service string, remove bool, ku
errMx.Unlock()
return
}

}(config)
}

Expand Down Expand Up @@ -168,7 +167,6 @@ func (nginx *Nginx) LoadNamespaceToMesh(namespace string, remove bool, kubeconfi
errMx.Unlock()
return
}

}(config)
}

Expand Down

0 comments on commit e7b3b1e

Please sign in to comment.