├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── ci.md
│ ├── documentation.md
│ ├── feature_request.md
│ └── question.md
├── PULL_REQUEST_TEMPLATE.md
├── config.yml
├── dependabot.yml
├── label-commenter-config.yml
├── labeler.yml
├── readme
│ └── images
│ │ ├── community.svg
│ │ ├── layer5-community-sign.png
│ │ ├── meshery-logo-dark-text-side.svg
│ │ ├── meshery-logo-light-text-side.svg
│ │ ├── meshsync.svg
│ │ ├── slack-128.png
│ │ └── slack-dark-128.png
├── release-drafter.yml
├── security-insights.yml
├── stale.yml
├── welcome
│ ├── meshery_dark.png
│ └── meshery_light.png
└── workflows
│ ├── build-and-release.yml
│ ├── ci.yml
│ ├── error-codes-updater.yml
│ ├── integration-tests-ci.yml
│ ├── label-commenter.yml
│ ├── labeler.yml
│ ├── multi-platform.yml
│ ├── newcomers-alert.yml
│ ├── release-drafter.yml
│ └── slack.yml
├── .gitignore
├── .golangci.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING-gitflow.md
├── CONTRIBUTING.md
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── all-certmgs.yaml
├── cert-manager-cainjector-c7d4dbdd9-jlstt.yaml
├── cert-manager-webhook-847d7676c9-89rtq.yaml
├── config.yaml
├── go.mod
├── go.sum
├── helpers
└── component_info.json
├── install
├── Makefile.core.mk
└── Makefile.show-help.mk
├── integration-tests
├── .gitignore
├── default_cluster_integration_test.go
├── default_cluster_test_cases_test.go
├── infrastructure
│ ├── docker-compose.yaml
│ ├── meshsync.yaml
│ ├── setup.sh
│ └── test-deployment.yaml
└── unmarshal_object_test.go
├── internal
├── channels
│ ├── broker.go
│ ├── channel.go
│ ├── generic.go
│ └── system.go
├── config
│ ├── config.go
│ ├── config_local.go
│ ├── crd_config.go
│ ├── crd_config_test.go
│ ├── default_config.go
│ ├── error.go
│ └── types.go
├── file
│ ├── file.go
│ ├── writer.go
│ └── yaml_writer.go
├── output
│ ├── composite.go
│ ├── file.go
│ ├── inmemory_deduplicator.go
│ ├── nats.go
│ ├── output.go
│ └── processor.go
└── pipeline
│ ├── error.go
│ ├── handlers.go
│ ├── pipeline.go
│ └── step.go
├── main.go
├── meshsync
├── discovery.go
├── error.go
├── exec.go
├── handlers.go
├── handlers_test.go
├── logstream.go
└── meshsync.go
├── pkg
├── model
│ ├── exec.go
│ ├── log.go
│ ├── model.go
│ ├── model_converter.go
│ ├── preprocessor.go
│ └── process.go
└── utils
│ └── utils.go
└── scripts
├── go-mod-tidy.sh
└── go-test.sh
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug/issue report
3 | about: Report an issue to help improve the project.
4 | title: ''
5 | labels: 'kind/bug'
6 | assignees: ''
7 | ---
8 | **Description**
9 |
10 |
11 | **Expected Behavior**
12 |
13 |
14 | **Screenshots**
15 |
16 |
17 | **Environment:**
18 | - OS: [e.g. Ubuntu]
19 | - Browser: [e.g. Chrome, Safari]
20 | - Version: [e.g. 22]
21 | - Device: [e.g. laptop, iPhone 8]
22 |
23 | ---
24 | [Optional] **To Reproduce**
25 | Steps to reproduce the behavior:
26 | 1. Go to '...'
27 | 2. Click on '....'
28 | 3. Scroll down to '....'
29 | 4. See error
30 |
31 | [Optional] **Additional Context**
32 |
33 |
34 | ### Contributor Resources
35 |
36 | The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the [`master` branch](https://github.com/meshery/meshery.io/tree/master).
37 | - See the [Contributing to Meshery.io Website](https://github.com/mesheryio/meshery.io#contributing-to-the-mesheryio-website) section of the readme.md and other [contributing instructions](https://docs.meshery.io/project/contributing), too.
38 | - See [Meshery site designs](https://www.figma.com/file/SMP3zxOjZztdOLtgN4dS2W/Meshery-UI?node-id=110%3A1) in Figma [(open invite)](https://www.figma.com/team_invite/redeem/qJy1c95qirjgWQODApilR9).
39 | - Fill-in a [Community Member Form](https://meshery.io/newcomer) and join the [Community Slack](http://slack.meshery.io) for access.
40 |
41 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/ci.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 🛠 Continuous Integration / DevOps
3 | about: Improve or update workflows or other automation
4 | title: '[CI]'
5 | labels: 'area/ci'
6 | assignees: ''
7 | ---
8 | #### Current Behavior
9 |
10 |
11 | #### Desired Behavior
12 |
13 |
14 | #### Implementation
15 |
16 |
17 | #### Acceptance Tests
18 |
19 |
20 | ---
21 | #### Contributor [Guides](https://docs.meshery.io/project/contributing) and Resources
22 | - 🛠 [Meshery Build & Release Strategy](https://docs.meshery.io/project/build-and-release)
23 | - 📚 [Instructions for contributing to documentation](https://github.com/meshery/meshery/blob/master/CONTRIBUTING.md#documentation-contribution-flow)
24 | - Meshery documentation [site](https://docs.meshery.io/) and [source](https://github.com/meshery/meshery/tree/master/docs)
25 | - 🎨 Wireframes and [designs for Meshery UI](https://www.figma.com/file/SMP3zxOjZztdOLtgN4dS2W/Meshery-UI) in Figma [(open invite)](https://www.figma.com/team_invite/redeem/qJy1c95qirjgWQODApilR9)
26 | - 🙋🏾🙋🏼 Questions: [Discussion Forum](https://meshery.io/community#community-forums) and [Community Slack](http://slack.meshery.io)
27 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/documentation.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Documentation issue
3 | about: Issues related to documentation.
4 | title: '[Docs]'
5 | labels: 'area/docs'
6 | assignees: ''
7 | ---
8 | **Current State:**
9 |
10 |
11 | **Desired State:**
12 |
13 |
14 | ---
15 | **Contributor Resources**
16 | - [Meshery documentation site](https://docs.meshery.io/)
17 | - [Meshery documentation source](https://github.com/meshery/meshery/tree/master/docs)
18 | - [Instructions for contributing to documentation](https://github.com/meshery/meshery/blob/master/CONTRIBUTING.md#documentation-contribution-flow)
19 |
20 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Suggest an enhancement to this project.
4 | title: ''
5 | labels: 'kind/enhancement'
6 | assignees: ''
7 | ---
8 |
9 | **Current Behavior**
10 |
11 |
12 |
13 | **Desired Behavior**
14 |
15 |
16 |
17 | ### Contributor Resources
18 |
19 | The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the [`master` branch](https://github.com/meshery/meshery.io/tree/master).
20 | - See the [Contributing to Meshery.io Website](https://github.com/meshery/meshery.io#contributing-to-the-mesheryio-website) section of the readme.md and other [contributing instructions](https://docs.meshery.io/project/contributing), too.
21 | - See [Meshery site designs](https://www.figma.com/file/SMP3zxOjZztdOLtgN4dS2W/Meshery-UI?node-id=110%3A1) in Figma [(open invite)](https://www.figma.com/team_invite/redeem/qJy1c95qirjgWQODApilR9).
22 | - Fill-in a [Community Member Form](https://meshery.io/newcomer) and join the [Community Slack](http://slack.meshery.io) for access.
23 |
24 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: General question
3 | about: Request information about the project; clarify behavior of the software
4 | title: '[Question]'
5 | labels: 'kind/question'
6 | assignees: ''
7 | ---
8 |
9 | **How can we help?**
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | **Description**
2 |
3 | This PR fixes #
4 |
5 | **Notes for Reviewers**
6 |
7 |
8 | **[Signed commits](../CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin)**
9 | - [ ] Yes, I signed my commits.
10 |
11 |
12 |
24 |
--------------------------------------------------------------------------------
/.github/config.yml:
--------------------------------------------------------------------------------
1 | ---
2 | #-------------------------------------------------------------------------------
3 | # Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
4 | # Comment to be posted to on first time issues
5 | newIssueWelcomeComment: >
6 | Thanks for opening this issue. A contributor will be by to give feedback soon. In the meantime, please review the [Contributors' Welcome Guide](https://docs.meshery.io/project/community), engage in the [discussion forum](https://meshery.io/community#community-forums), and be sure to join the [community Slack](http://slack.meshery.io/).
7 | # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
8 | # Comment to be posted to on PRs from first time contributors in your repository
9 | newPRWelcomeComment: >
10 | Yay, your first pull request! :thumbsup: A contributor will be by to give feedback soon. In the meantime, please review the [Meshery Contributors' Welcome Guide](https://docs.meshery.io/project/contributing) and sure to join the [community Slack](http://slack.meshery.io/).
11 |
12 | Be sure to double-check that you have signed your commits. Here are instructions for [making signing an implicit activity while peforming a commit](https://github.com/meshery/meshery/blob/master/CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin).
13 |
14 | #-------------------------------------------------------------------------------
15 | # Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
16 | # Comment to be posted to on pull requests merged by a first time user
17 | firstPRMergeComment: >
18 | Thanks for your contribution to Meshery! :tada:
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | [Join the community](http://slack.meshery.io), if you haven't yet and please leave a :star: [star on the project](../stargazers). :smile:
27 |
28 | #-------------------------------------------------------------------------------
29 | # Configuration for request-info - https://github.com/behaviorbot/request-info
30 | # Comment to reply with
31 | requestInfoReplyComment: >
32 | Thanks for opening this issue. We welcome all input! If you could provide a little more information, this will greatly aide in its resolution. :thumbsup:
33 | # *OPTIONAL* Add a list of people whose Issues/PRs will not be commented on
34 | # keys must be GitHub usernames
35 | #requestInfoUserstoExclude:
36 | # - meshery/maintainers
37 |
38 | #-------------------------------------------------------------------------------
39 | # Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot
40 | # *Required* toxicity threshold between 0 and .99 with the higher numbers being the most toxic
41 | # Anything higher than this threshold will be marked as toxic and commented on
42 | sentimentBotToxicityThreshold: .9
43 |
44 | # *Required* Comment to reply with
45 | sentimentBotReplyComment: >
46 | Please be sure to review the code of conduct and be respectful of other users. // @meshery/maintainers
47 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: gomod
4 | directory: "/"
5 | schedule:
6 | interval: monthly
7 | open-pull-requests-limit: 5
8 | labels:
9 | - pr/dependencies
10 | - kind/chore
11 | ignore:
12 | - dependency-name: k8s.io/api
13 | versions:
14 | - ">= 0.20.a"
15 | - "< 0.21"
16 | - dependency-name: k8s.io/apimachinery
17 | versions:
18 | - ">= 0.20.a"
19 | - "< 0.21"
20 | - dependency-name: k8s.io/client-go
21 | versions:
22 | - ">= 0.20.a"
23 | - "< 0.21"
24 |
--------------------------------------------------------------------------------
/.github/label-commenter-config.yml:
--------------------------------------------------------------------------------
1 | comment:
2 | # header: "Please note the following requirement:"
3 | footer: "\
4 | ---\n\n
5 | > Be sure to [join the community](https://slack.meshery.io), if you haven't yet and please leave a :star: [star on the project](../stargazers) :smile:
6 | "
7 |
8 | labels:
9 | - name: issue/design required
10 | labeled:
11 | issue:
12 | body: This issue has been labeled with 'design-required'. Note that prior to commencing on implementation, a design specification needs to be created and reviewed for approval. See [Creating a Functional Specification](https://docs.google.com/document/d/1RP3IWLc-MiQS-QYasqCoVuCH7--G87p5ezE5f_nOzB8/edit?usp=sharing) to create a design spec.
13 | action: open
14 | - name: issue/remind
15 | labeled:
16 | issue:
17 | body: Checking in... it has been awhile since we've heard from you on this issue. Are you still working on it? Please let us know and please don't hesitate to contact a [MeshMate](https://meshery.io/community#meshmates) or any other [community member](https://meshery.io/community/members) for assistance.
18 | action: open
19 | pr:
20 | body: Checking in... it has been awhile since we've heard from you on this issue. Are you still working on it? Please let us know and please don't hesitate to contact a [MeshMate](https://meshery.io/community/meshmates/) or any other [community member](https://meshery.io/community/members) for assistance.
21 | action: open
22 | - name: issue/dco
23 | labeled:
24 | issue:
25 | body: "🚨 Alert! Git Police! We couldn’t help but notice that one or more of your commits is missing a sign-off. _A what?_ A commit sign-off (your email address).\n\n
26 | To amend the commits in this PR with your signoff using the instructions provided in the DCO check. \n\n
27 | To configure your dev environment to automatically signoff on your commits in the future, see [these instructions](https://github.com/meshery/meshery/blob/master/CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin)."
28 | action: open
29 | pr:
30 | body: "🚨 Alert! Git Police! We couldn’t help but notice that one or more of your commits is missing a sign-off. _A what?_ A commit sign-off (your email address).\n\n
31 | To amend the commits in this PR with your signoff using the instructions provided in the DCO check. \n\n
32 | To configure your dev environment to automatically signoff on your commits in the future, see [these instructions](https://github.com/meshery/meshery/blob/master/CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin)."
33 | action: open
34 | - name: component/ui
35 | labeled:
36 | issue:
37 | body: This issue has been labeled with 'component/ui'. 🧰 Here are docs on [Contributing to Meshery UI](https://docs.meshery.io/project/contributing/contributing-ui). 🎨 Here is the [Meshery UI Figma File](https://www.figma.com/file/SMP3zxOjZztdOLtgN4dS2W/Meshery-UI?node-id=4%3A0) File. Lastly, here are docs on [Contributing to Meshery's End-to-End Tests Using Cypress](https://docs.meshery.io/project/contributing/contributing-cypress).
38 | action: open
39 | pr:
40 | body: This PR has been labeled with 'component/ui'. 🧰 Here are docs on [Contributing to Meshery UI](https://docs.meshery.io/project/contributing/contributing-ui). 🎨 Here is the [Meshery UI Figma File](https://www.figma.com/file/SMP3zxOjZztdOLtgN4dS2W/Meshery-UI?node-id=4%3A0) File. Lastly, here are docs on [Contributing to Meshery's End-to-End Tests Using Cypress](https://docs.meshery.io/project/contributing/contributing-cypress)
41 | action: open
42 | - name: component/mesheryctl
43 | labeled:
44 | issue:
45 | body: This issue has been labeled with 'component/mesheryctl'. Note that after making changes you need to update it in the [mesheryctl command tracker](https://docs.google.com/spreadsheets/d/1q63sIGAuCnIeDs8PeM-0BAkNj8BBgPUXhLbe1Y-318o/edit#gid=0) spreadsheet.
46 | action: open
47 | pr:
48 | body: This PR has been labeled with 'component/mesheryctl'. Note that after making changes you need to update it in the [mesheryctl command tracker](https://docs.google.com/spreadsheets/d/1q63sIGAuCnIeDs8PeM-0BAkNj8BBgPUXhLbe1Y-318o/edit#gid=0) spreadsheet.
49 | action: open
50 | # pr:
51 | # body: Hi, please note that this issue will need an approved design specification before implementation proceeds. See [Creating a Functional Specification](https://docs.google.com/document/d/1RP3IWLc-MiQS-QYasqCoVuCH7--G87p5ezE5f_nOzB8/edit?usp=sharing) to create a design spec.
52 | # action: open
53 |
--------------------------------------------------------------------------------
/.github/labeler.yml:
--------------------------------------------------------------------------------
1 | area/ci:
2 | - changed-files:
3 | - any-glob-to-any-file:
4 | - ".github/**/*"
5 | - "install/*"
6 | area/docs:
7 | - changed-files:
8 | - any-glob-to-any-file:
9 | - "README.md"
10 | - "CONTRIBUTING.md"
11 | - "CONTRIBUTING-gitflow.md"
12 | language/go:
13 | - changed-files:
14 | - any-glob-to-any-file:
15 | - "meshsync/*"
16 | - "internal/**/*"
17 | - "pkg/**/*"
--------------------------------------------------------------------------------
/.github/readme/images/community.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.github/readme/images/layer5-community-sign.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meshery/meshsync/9b393dc7ba653e2e92ed8f2dc414442598e06341/.github/readme/images/layer5-community-sign.png
--------------------------------------------------------------------------------
/.github/readme/images/meshery-logo-dark-text-side.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.github/readme/images/meshery-logo-light-text-side.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.github/readme/images/meshsync.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.github/readme/images/slack-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meshery/meshsync/9b393dc7ba653e2e92ed8f2dc414442598e06341/.github/readme/images/slack-128.png
--------------------------------------------------------------------------------
/.github/readme/images/slack-dark-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meshery/meshsync/9b393dc7ba653e2e92ed8f2dc414442598e06341/.github/readme/images/slack-dark-128.png
--------------------------------------------------------------------------------
/.github/release-drafter.yml:
--------------------------------------------------------------------------------
1 | name-template: 'MeshSync v$NEXT_PATCH_VERSION'
2 | tag-template: 'v$NEXT_PATCH_VERSION'
3 | categories:
4 | - title: '🚀 Features'
5 | labels:
6 | - 'kind/feature'
7 | - 'kind/enhancement'
8 | - title: '🐛 Bug Fixes'
9 | labels:
10 | - 'kind/fix'
11 | - 'kind/bugfix'
12 | - 'kind/bug'
13 | - title: '🧰 Maintenance'
14 | labels:
15 | - 'kind/chore'
16 | - 'area/ci'
17 | - 'area/tests'
18 | - title: 📖 Documentation
19 | label: area/docs
20 | change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
21 | template: |
22 | ## What's New
23 | **General**
24 | $CHANGES
25 |
26 | ## Contributors
27 |
28 | Thank you to our contributors for making this release possible:
29 | $CONTRIBUTORS
30 |
--------------------------------------------------------------------------------
/.github/security-insights.yml:
--------------------------------------------------------------------------------
1 | header:
2 | schema-version: 2.0.0
3 | last-updated: '2025-01-01'
4 | last-reviewed: '2025-01-01'
5 | url: https://github.com/meshery/meshsync/blob/master/.github/security-insights.yml
6 | comment: |
7 | This file contains the security insights information for the Meshery project.
8 |
9 | project:
10 | name: meshery
11 | administrators:
12 | - name: Lee Calcote
13 | affiliation: Meshery
14 | email: leecalcote@gmail.com
15 | primary: true
16 | repositories:
17 | - name: meshsync
18 | url: https://github.com/meshery/meshsync
19 | comment: |
20 | Website for Meshery.
21 | vulnerability-reporting:
22 | reports-accepted: true
23 | bug-bounty-available: false
24 |
25 | repository:
26 | url: https://github.com/meshery/meshsync
27 | status: active
28 | accepts-change-request: true
29 | accepts-automated-change-request: false
30 | core-team:
31 | - name: Lee Calcote
32 | affiliation: Meshery
33 | email: leecalcote@gmail.com
34 | primary: true
35 | license:
36 | url: https://github.com/meshery/meshsync/blob/master/LICENSE
37 | expression: https://github.com/meshery/meshsync/blob/master/LICENSE
38 | security:
39 | assessments:
40 | self:
41 | comment: |
42 | Self assessment has not yet been completed.
43 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Number of days of inactivity before an issue becomes stale
2 | daysUntilStale: 45
3 | # Number of days of inactivity before a stale issue is closed
4 | daysUntilClose: 10
5 | # Issues with these labels will never be considered stale
6 | exemptLabels:
7 | - issue/willfix
8 | # Label to use when marking an issue as stale
9 | staleLabel: issue/stale
10 | # Comment to post when marking an issue as stale. Set to `false` to disable
11 | markComment: >
12 | This issue has been automatically marked as stale because it has not had
13 | recent activity. It will be closed if no further activity occurs. Thank you
14 | for your contributions.
15 | # Comment to post when closing a stale issue. Set to `false` to disable
16 | closeComment: >
17 | This issue is being automatically closed due to inactivity.
18 | However, you may choose to reopen this issue.
19 |
--------------------------------------------------------------------------------
/.github/welcome/meshery_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meshery/meshsync/9b393dc7ba653e2e92ed8f2dc414442598e06341/.github/welcome/meshery_dark.png
--------------------------------------------------------------------------------
/.github/welcome/meshery_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meshery/meshsync/9b393dc7ba653e2e92ed8f2dc414442598e06341/.github/welcome/meshery_light.png
--------------------------------------------------------------------------------
/.github/workflows/build-and-release.yml:
--------------------------------------------------------------------------------
1 | name: Meshsync Build and Releaser
2 | on:
3 | push:
4 | branches:
5 | - 'master'
6 | tags:
7 | - 'v*'
8 | paths-ignore:
9 | - 'docs/**'
10 | - '.github/**'
11 | jobs:
12 | build:
13 | name: Build check
14 | runs-on: ubuntu-22.04
15 | steps:
16 | - name: Check out code
17 | uses: actions/checkout@main
18 | with:
19 | fetch-depth: 1
20 | - name: Setup Go
21 | uses: actions/setup-go@main
22 | with:
23 | go-version: '1.23'
24 | check-latest: 'true'
25 | - run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go build -o meshery-meshsync .
26 | docker:
27 | name: Docker build and push
28 | runs-on: ubuntu-22.04
29 | steps:
30 | - name: Check out code
31 | uses: actions/checkout@main
32 | with:
33 | fetch-depth: 1
34 | - name: Setup go
35 | uses: actions/setup-go@main
36 | with:
37 | go-version: '1.23'
38 | check-latest: 'true'
39 | - name: Docker login
40 | uses: docker/login-action@v2
41 | with:
42 | username: ${{ secrets.DOCKER_USERNAME }}
43 | password: ${{ secrets.DOCKER_PASSWORD }}
44 | - name: Docker edge build & tag
45 | if: startsWith(github.ref, 'refs/tags/') != true && success()
46 | run: |
47 | DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:edge-latest --build-arg GIT_COMMITSHA=${GITHUB_SHA::8} --build-arg GIT_VERSION="edge-latest" .
48 | docker tag ${{ secrets.IMAGE_NAME }}:edge-latest ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7}
49 | - name: Docker edge push
50 | if: startsWith(github.ref, 'refs/tags/') != true && success()
51 | run: |
52 | docker push ${{ secrets.IMAGE_NAME }}:edge-latest
53 | docker push ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7}
54 | - name: Docker stable build & tag
55 | if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
56 | run: |
57 | DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:stable-latest --build-arg GIT_COMMITSHA=${GITHUB_SHA::8} --build-arg GIT_VERSION=${GITHUB_REF/refs\/tags\//} .
58 | docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//}
59 | docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7}
60 | - name: Docker stable push
61 | if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
62 | run: |
63 | docker push ${{ secrets.IMAGE_NAME }}:stable-latest
64 | docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//}
65 | docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7}
66 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: Meshsync CI
2 |
3 | on:
4 | # push:
5 | # branches: [ master ]
6 | pull_request:
7 | branches: [ master ]
8 | paths-ignore:
9 | - 'docs/**'
10 | - '.github/**'
11 |
12 | jobs:
13 | golangci-lint:
14 | strategy:
15 | matrix:
16 | platform: [ubuntu-24.04]
17 | go-version: [1.23.x]
18 | runs-on: ${{ matrix.platform }}
19 | steps:
20 | - name: Check out code
21 | uses: actions/checkout@master
22 | - name: Setup go
23 | uses: actions/setup-go@main
24 | with:
25 | go-version: ${{ matrix.go-version }}
26 | - name: golangci-lint
27 | uses: golangci/golangci-lint-action@v6
28 | with:
29 | version: v1.64
30 | args: --timeout=5m
31 | codecov:
32 | needs: golangci-lint
33 | name: Code coverage
34 | if: github.repository == 'meshery/meshsync'
35 | runs-on: ubuntu-24.04
36 | steps:
37 | - name: Checkout code
38 | uses: actions/checkout@master
39 | - name: Setup Go
40 | uses: actions/setup-go@v4
41 | with:
42 | go-version: '1.23.x'
43 | - name: Run unit tests
44 | run: go test --short ./... -race -coverprofile=coverage.txt -covermode=atomic
45 | - name: Upload coverage to Codecov
46 | if: github.repository == 'meshery/meshsync'
47 | uses: codecov/codecov-action@v3
48 | with:
49 | file: ./coverage.txt
50 | flags: unittests
51 | build:
52 | needs: [golangci-lint, codecov]
53 | name: Build
54 | runs-on: ubuntu-24.04
55 | steps:
56 | - name: Checkout code
57 | uses: actions/checkout@master
58 | - name: Setup Go
59 | uses: actions/setup-go@v4
60 | with:
61 | go-version: '1.23.x'
62 | - name: Build
63 | run: make build
64 |
--------------------------------------------------------------------------------
/.github/workflows/error-codes-updater.yml:
--------------------------------------------------------------------------------
1 | name: Meshsync Error Codes Utility Runner
2 | on:
3 | push:
4 | branches:
5 | - 'master'
6 | paths:
7 | - '**.go'
8 |
9 | jobs:
10 | Update-error-codes:
11 | name: Error codes utility
12 | if: github.repository == 'meshery/meshsync'
13 | runs-on: ubuntu-22.04
14 | steps:
15 | - uses: actions/checkout@main
16 | # token here with write access to meshsync repo
17 | with:
18 | token: ${{ secrets.GH_ACCESS_TOKEN }}
19 | ref: 'master'
20 |
21 | - name: Setup Go
22 | uses: actions/setup-go@main
23 | with:
24 | go-version: '1.23'
25 |
26 | - name: Run utility
27 | run: |
28 | go get github.com/meshery/meshkit/cmd/errorutil
29 | go run github.com/meshery/meshkit/cmd/errorutil -d . update --skip-dirs meshery -i ./helpers -o ./helpers
30 | # to update errorutil* files in meshkit repo
31 | - name: Commit changes
32 | uses: stefanzweifel/git-auto-commit-action@v4
33 | with:
34 | commit_user_name: l5io
35 | commit_user_email: ci@meshery.io
36 | commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
37 | commit_options: '--signoff'
38 | commit_message: "run error codes utility"
39 | file_pattern: helpers/ **.go
40 |
41 | # to push changes to meshery docs
42 | - name: Checkout meshery
43 | uses: actions/checkout@main
44 | with:
45 | repository: 'meshery/meshery'
46 | # token with write access to meshery repository
47 | token: ${{ secrets.GH_ACCESS_TOKEN }}
48 | path: 'meshery'
49 | ref: 'master'
50 |
51 | - name: Update and push docs
52 | run: |
53 | echo '{ "errors_export": "" }' | jq --slurpfile export ./helpers/errorutil_errors_export.json '.errors_export = $export[0]' > ./meshery/docs/_data/errorref/meshsync_errors_export.json
54 | cd ./meshery
55 | git config user.name l5io
56 | git config user.email ci@meshery.io
57 | if git diff --exit-code --quiet
58 | then
59 | echo "No changes to commit"
60 | exit
61 | fi
62 | git add ./docs/_data/errorref/meshsync_errors_export.json
63 | git commit -m "[Docs] Error Code Reference: Updated codes for MeshSync" --signoff
64 | git push origin master
65 |
--------------------------------------------------------------------------------
/.github/workflows/integration-tests-ci.yml:
--------------------------------------------------------------------------------
1 | name: Integration Tests
2 | on:
3 | push:
4 | branches:
5 | - "master"
6 | paths:
7 | - "**.go"
8 | - "**.golden"
9 | - "Makefile"
10 | - ".github/workflows/integration-tests-ci.yml"
11 | pull_request:
12 | branches:
13 | - "master"
14 | paths:
15 | - "**.go"
16 | - "**.golden"
17 | - "Makefile"
18 | - ".github/workflows/integration-tests-ci.yml"
19 | workflow_dispatch:
20 | inputs:
21 | logLevel:
22 | description: "Log level"
23 | required: true
24 | default: "warning"
25 |
26 | jobs:
27 | integration-tests:
28 | name: Integration tests
29 | runs-on: ubuntu-24.04
30 | steps:
31 | - uses: actions/checkout@v4
32 | with:
33 | fetch-depth: 2
34 | - name: Setup Go
35 | uses: actions/setup-go@v5
36 | with:
37 | go-version: "1.23"
38 | - name: Install Docker Compose
39 | run: |
40 | sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
41 | sudo chmod +x /usr/local/bin/docker-compose
42 | - name: Set up Docker Buildx
43 | uses: docker/setup-buildx-action@v3
44 | - name: Install Kind and kubectl
45 | uses: helm/kind-action@v1.10.0
46 | - name: Integration tests set up
47 | run: make integration-tests-setup
48 | - name: Integration tests run
49 | run: make integration-tests-run
50 | - name: Integration tests clean up
51 | run: make integration-tests-cleanup
52 | - name: Upload meshsync command output
53 | uses: actions/upload-artifact@v4
54 | if: always()
55 | with:
56 | name: meshsync-command-output
57 | path: integration-tests/*.meshsync-output.txt
58 | if-no-files-found: warn
59 |
--------------------------------------------------------------------------------
/.github/workflows/label-commenter.yml:
--------------------------------------------------------------------------------
1 | name: Label Commenter
2 |
3 | on:
4 | issues:
5 | types:
6 | - labeled
7 |
8 | pull_request_target:
9 | types:
10 | - labeled
11 |
12 | permissions:
13 | contents: read
14 | issues: write
15 | pull-requests: write
16 |
17 | jobs:
18 | comment:
19 | runs-on: ubuntu-22.04
20 | steps:
21 | - uses: actions/checkout@main
22 | with:
23 | ref: master # Set your default branch
24 |
25 | - name: Label Commenter
26 | uses: peaceiris/actions-label-commenter@v1
27 |
--------------------------------------------------------------------------------
/.github/workflows/labeler.yml:
--------------------------------------------------------------------------------
1 | name: "Pull Request Labeler"
2 | on:
3 | - pull_request_target
4 |
5 | jobs:
6 | triage:
7 | permissions:
8 | contents: read
9 | pull-requests: write
10 | runs-on: ubuntu-24.04
11 | steps:
12 | - uses: actions/labeler@v5
13 | with:
14 | repo-token: "${{ secrets.GITHUB_TOKEN }}"
15 |
--------------------------------------------------------------------------------
/.github/workflows/multi-platform.yml:
--------------------------------------------------------------------------------
1 | name: Multi-Platform Build and Release
2 | on:
3 | release:
4 | types: [published]
5 | push:
6 | tags:
7 | - 'v*'
8 | branches:
9 | - 'master'
10 | paths-ignore:
11 | - 'docs/**'
12 | - '.github/**'
13 | workflow_dispatch:
14 | inputs:
15 | release-ver:
16 | description: 'Stable Release Version'
17 | required: true
18 | default: 'v'
19 | stripped-release-ver:
20 | description: 'Stripped Stable Release Version'
21 | required: true
22 | default: ''
23 | release-channel:
24 | description: 'Release Channel'
25 | required: true
26 | default: 'edge'
27 |
28 | env:
29 | GIT_VERSION: ${{github.event.inputs.release-ver}}
30 | GIT_STRIPPED_VERSION: ${{github.event.inputs.stripped-release-ver}}
31 | RELEASE_CHANNEL: ${{github.event.inputs.release-channel}}
32 | GIT_TAG: ${{ github.event.release.tag_name }}
33 |
34 | jobs:
35 | print-inputs:
36 | runs-on: ubuntu-22.04
37 | steps:
38 |
39 | - run: |
40 | echo "Dispatched GIT_VERSION: ${{github.event.inputs.release-ver}}"
41 | echo " Dispatched GIT_STRIPPED_VERSION: ${{github.event.inputs.stripped-release-ver}}"
42 | echo "Env RELEASE_CHANNEL: ${{env.RELEASE_CHANNEL}}"
43 | echo "Env GIT_VERSION: ${{env.GIT_VERSION}}"
44 | echo "Env GIT_STRIPPED_VERSION: ${{env.GIT_STRIPPED_VERSION}}"
45 | echo "Env GIT_TAG: ${{ github.event.release.tag_name }}"
46 |
47 | docker-build:
48 | runs-on: ubuntu-22.04
49 | steps:
50 | -
51 | name: Checkout repo
52 | uses: actions/checkout@main
53 | -
54 | name: Identify Release Values
55 | if: "${{ github.event.inputs.release-ver}} != 'v' }}"
56 | run: |
57 | # GIT_REF=`git symbolic-ref HEAD`
58 | if [[ $GIT_TAG = refs/tags* ]]
59 | then
60 | echo RELEASE_CHANNEL=stable >> $GITHUB_ENV
61 | else
62 | echo RELEASE_CHANNEL=edge >> $GITHUB_ENV
63 | fi
64 | echo "Release channel determined to be $RELEASE_CHANNEL"
65 | LATEST_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g') >> $GITHUB_ENV
66 | GIT_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g') >> $GITHUB_ENV
67 | # GIT_VERSION=$(git describe --tags `git rev-list --tags --max-count=1` --always)
68 | GIT_STRIPPED_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g' | cut -c2-)
69 | echo "GIT_LATEST=$LATEST_VERSION" >> $GITHUB_ENV
70 | echo "GIT_VERSION=$GIT_VERSION" >> $GITHUB_ENV
71 | echo "GIT_STRIPPED_VERSION=$GIT_STRIPPED_VERSION" >> $GITHUB_ENV
72 | shell: bash
73 |
74 | -
75 | name: Set up QEMU
76 | uses: docker/setup-qemu-action@v1
77 | -
78 | name: Set up Docker Buildx
79 | uses: docker/setup-buildx-action@v1
80 | -
81 | name: Docker Meta
82 | id: meta
83 | uses: docker/metadata-action@v3
84 | with:
85 | images: ${{ secrets.IMAGE_NAME }}
86 | flavor: |
87 | latest=false
88 | tags: |
89 | type=raw,value=${{env.RELEASE_CHANNEL}}-{{sha}}
90 | type=semver,pattern={{version}},value=${{env.GIT_STRIPPED_VERSION}}
91 | type=raw,pattern={{version}},value=${{env.RELEASE_CHANNEL}}-${{env.GIT_VERSION}}
92 | type=raw,value=${{env.RELEASE_CHANNEL}}-{{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
93 | type=raw,value=${{env.RELEASE_CHANNEL}}-latest
94 | type=raw,value=${{env.RELEASE_CHANNEL}}-${{env.GIT_VERSION}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
95 | -
96 | name: Login to DockerHub
97 | uses: docker/login-action@v2
98 | with:
99 | username: ${{ secrets.DOCKER_USERNAME }}
100 | password: ${{ secrets.DOCKER_PASSWORD }}
101 | -
102 | name: Build and Push
103 | uses: docker/build-push-action@v2
104 | with:
105 | context: "{{defaultContext}}"
106 | push: true
107 | build-args: |
108 | GIT_STRIPPED_VERSION=${{env.GIT_STRIPPED_VERSION}}
109 | GIT_VERSION=${{env.GIT_VERSION}}
110 | RELEASE_CHANNEL=${{env.RELEASE_CHANNEL}}
111 | tags: ${{ steps.meta.outputs.tags }}
112 | platforms: linux/amd64,linux/arm64
113 |
114 | # -
115 | # name: Docker Hub Description
116 | # uses: peter-evans/dockerhub-description@v3
117 | # with:
118 | # username: ${{ secrets.DOCKER_USERNAME }}
119 | # password: ${{ secrets.DOCKER_PASSWORD }}
120 | # repository: meshery/meshery-docker-extension
121 | # readme-filepath: /install/docker-extension/README.md
122 |
--------------------------------------------------------------------------------
/.github/workflows/newcomers-alert.yml:
--------------------------------------------------------------------------------
1 | name: Newcomers Alert
2 | on:
3 | issues:
4 | types: [labeled]
5 | jobs:
6 | good-first-issue-notify:
7 | if: github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only'
8 | name: Notify Slack for new good-first-issue
9 | runs-on: ubuntu-22.04
10 | steps:
11 | - name: Notify slack
12 | env:
13 | SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
14 | uses: pullreminders/slack-action@master
15 | with:
16 | args: '{\"channel\":\"C019426UBNY\",\"text\":\"A good first issue label was just added to ${{github.event.issue.html_url}}.\"}'
17 |
--------------------------------------------------------------------------------
/.github/workflows/release-drafter.yml:
--------------------------------------------------------------------------------
1 | name: Release Drafter
2 |
3 | on:
4 | workflow_dispatch:
5 | push:
6 | branches:
7 | - master
8 | # paths-ignore:
9 | # - '.github/**'
10 |
11 | permissions:
12 | contents: read
13 | pull-requests: write
14 |
15 | jobs:
16 | update_release_draft:
17 | if: github.repository == 'meshery/meshsync'
18 | runs-on: ubuntu-24.04
19 | steps:
20 | - name: Drafting release
21 | id: release_drafter
22 | uses: release-drafter/release-drafter@v5
23 | with:
24 | config-name: release-drafter.yml
25 | env:
26 | GITHUB_TOKEN: ${{ secrets.RELEASE_NOTES_PAT }}
27 |
--------------------------------------------------------------------------------
/.github/workflows/slack.yml:
--------------------------------------------------------------------------------
1 | name: Slack Notify
2 | on:
3 | watch:
4 | types: [started]
5 | jobs:
6 | star-notify:
7 | if: github.event_name == 'watch'
8 | name: Notify Slack on star
9 | runs-on: ubuntu-22.04
10 | steps:
11 | - name: Get current star count
12 | run: |
13 | echo "STARS=$(curl --silent 'https://api.github.com/repos/${{github.repository}}' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV
14 | - name: Notify slack
15 | env:
16 | SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
17 | uses: pullreminders/slack-action@master
18 | with:
19 | args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"${{ github.actor }} just starred ${{github.repository}}! (https://github.com/${{github.repository}}/stargazers) Total ⭐️: ${{env.STARS}}\"}'
20 | good-first-issue-notify:
21 | if: github.event_name == 'issues' && github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only'
22 | name: Notify Slack for new good-first-issue
23 | runs-on: ubuntu-22.04
24 | steps:
25 | - name: Notify slack
26 | env:
27 | SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
28 | uses: pullreminders/slack-action@master
29 | with:
30 | args: '{\"channel\":\"C019426UBNY\",\"text\":\"A good first issue label was just added to ${{github.event.issue.html_url}}.\"}'
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Binaries for programs and plugins
2 | *.exe
3 | *.exe~
4 | *.dll
5 | *.so
6 | *.dylib
7 |
8 | # Test binary, built with `go test -c`
9 | *.test
10 |
11 | # Output of the go coverage tool, specifically when used with LiteIDE
12 | *.out
13 |
14 | # Dependency directories (remove the comment below to include it)
15 | # vendor/
16 | .idea
17 |
18 | **errorutil_analyze_errors.json
19 | **errorutil_analyze_summary.json
20 | **errorutil_errors_export.json
21 |
22 | .vscode/
23 | cover.html
24 | .DS_Store
25 |
26 | bin/meshsync
27 | meshery-cluster-snapshot-*
--------------------------------------------------------------------------------
/.golangci.yml:
--------------------------------------------------------------------------------
1 | linters-settings:
2 | cyclop:
3 | package-average: 7
4 | govet:
5 | enable:
6 | - shadow
7 | - tests
8 |
9 | # Configuration for golangci-lint that is suitable for a Kubernetes operator project built with Golang
10 | linters:
11 | enable-all: false
12 | disable-all: false
13 | enable:
14 | - gci
15 | - goconst
16 | - gocritic
17 | - govet
18 | - unused
19 | - cyclop
20 |
21 | issues:
22 | exclude-dirs:
23 | - vendor
24 | - bundle
25 | - config
26 | - hack
27 | - helpers
28 | - img
29 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Meshery Community Code of Conduct
2 |
3 | The Meshery community follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
4 |
5 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting maintainers@meshery.io.
6 |
--------------------------------------------------------------------------------
/CONTRIBUTING-gitflow.md:
--------------------------------------------------------------------------------
1 | # Working by Forking
2 | Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or just head straight to the command line:
3 |
4 | ## Clone your fork to your local machine
5 | ```
6 | git clone git@github.com:USERNAME/FORKED-PROJECT.git
7 | ```
8 | Keeping Your Fork Up to Date
9 | While this isn't an absolutely necessary step, if you plan on doing anything more than just a tiny quick fix, you'll want to make sure you keep your fork up to date by tracking the original "upstream" repo that you forked. To do this, you'll need to add a remote:
10 |
11 | ## Add 'upstream' repo to list of remotes
12 | ```
13 | git remote add upstream https://github.com/meshery/meshery.git
14 | ```
15 | ("meshery" is used as the example repo. Be sure to reference the _actual_ repo you're contributing to e.g. "meshery-linkerd").
16 |
17 | ## Verify the new remote named 'upstream'
18 | ```
19 | git remote -v
20 | ```
21 | Whenever you want to update your fork with the latest upstream changes, you'll need to first fetch the upstream repo's branches and latest commits to bring them into your repository:
22 |
23 | ## Fetch from upstream remote
24 | ```
25 | git fetch upstream
26 | ```
27 |
28 | ## View all branches, including those from upstream
29 | ```
30 | git branch -va
31 | ```
32 | Now, checkout your own master branch and merge the upstream repo's master branch:
33 |
34 | ## Checkout your master branch and merge upstream
35 | ```
36 | git checkout master
37 | git merge upstream/master
38 | ```
39 | If there are no unique commits on the local master branch, git will simply perform a fast-forward. However, if you have been making changes on master (in the vast majority of cases you probably shouldn't be - see the next section, you may have to deal with conflicts. When doing so, be careful to respect the changes made upstream.
40 |
41 | Now, your local master branch is up-to-date with everything modified upstream.
42 |
43 | **Create a Branch** (doing your work)
44 | Whenever you begin work on a new feature or bugfix, it's important that you create a new branch. Not only is it proper git workflow, but it also keeps your changes organized and separated from the master branch so that you can easily submit and manage multiple pull requests for every task you complete.
45 |
46 | To create a new branch and start working on it, peform the following flow.
47 |
48 | ## Checkout the master branch - you want your new branch to come from master
49 | ```
50 | git checkout master
51 | ```
52 |
53 | ## Create a new branch (give your branch its own simple informative name)
54 | For enhancements use `feature/your_username/issue#` or `feature/your_username/name_of_feature`
55 |
56 | For bugs use `bug/your_username/issue#` or `bug/your_username/name_of_bug`
57 |
58 | ```
59 | git branch feature/jdoe/567
60 | ```
61 |
62 | ## Switch to your new branch
63 | ```
64 | git checkout feature/jdoe/567
65 | ```
66 | Now, go to town hacking away and making whatever changes you want to.
67 |
68 | ## Submitting your changes (a Pull Request)
69 | Prior to submitting your pull request, you might want to do a few things to clean up your branch and make it as simple as possible for the original repo's maintainer to test, accept, and merge your work.
70 |
71 | In the time that you've been working on your changes, if any commits have been made to the upstream master branch, you will need to rebase your development branch so that merging it will be a simple fast-forward that won't require any conflict resolution work.
72 |
73 | ## Fetch upstream master and merge with your repo's master branch
74 | ```
75 | git fetch upstream
76 | git checkout master
77 | git merge upstream/master
78 | ```
79 |
80 | ## If there were any new commits, rebase your development branch
81 | ```
82 | git checkout feature/jdoe/567
83 | git rebase master
84 | ```
85 | Now, it may be desirable to squash some of your smaller commits down into a small number of larger more cohesive commits. You can do this with an interactive rebase:
86 |
87 | ## Rebase all commits on your development branch
88 | ```
89 | git checkout
90 | git rebase -i master
91 | ```
92 | This will open up a text editor where you can specify which commits to squash.
93 |
94 | ## Submitting
95 | Once you've committed and pushed all of your changes to GitHub, go to the page for your fork on GitHub, select your development branch, and click the pull request button. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update.
96 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing Overview
2 |
3 | Please do! Thank you for your help in improving Meshery! :balloon:
4 |
5 | ---
6 |
7 |
Find the complete set of contributor guides at https://docs.meshery.io/project/contributing
8 |
9 | ---
10 |
11 | All contributors are welcome. Not sure where to start? Please see the [newcomers welcome guide](https://meshery.io/community/newcomers) for how, where, and why to contribute. This project is community-built and welcomes collaboration. Contributors are expected to adhere to our [Code of Conduct](CODE_OF_CONDUCT.md).
12 |
13 | All set to contribute? Grab an open issue with the [help-wanted label](../../labels/help%20wanted) and jump in. Join our [Slack channel](https://slack.meshery.io) and engage in conversation. Create a [new issue](/../../issues/new/choose) if needed. All [pull requests](/../../pulls) should ideally reference an open [issue](/../../issues). Include keywords in your pull request descriptions, as well as commit messages, to [automatically close related issues in GitHub](https://help.github.com/en/github/managing-your-work-on-github/closing-issues-using-keywords).
14 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.23 AS builder
2 | ARG GIT_VERSION
3 | ARG GIT_COMMITSHA
4 |
5 | WORKDIR /build
6 | # Copy the Go Modules manifests
7 | COPY go.mod go.mod
8 | COPY go.sum go.sum
9 | # cache deps before building and copying source so that we don't need to re-download as much
10 | # and so that source changes don't invalidate our downloaded layer
11 | RUN go mod download
12 | # Copy the go source
13 | COPY . .
14 | # Build
15 | RUN CGO_ENABLED=0 GO111MODULE=on go build -ldflags="-w -s -X main.version=$GIT_VERSION -X main.commitsha=$GIT_COMMITSHA" -a -o meshery-meshsync main.go
16 |
17 | # Use distroless as minimal base image to package the manager binary
18 | # Refer to https://github.com/GoogleContainerTools/distroless for more details
19 | FROM gcr.io/distroless/base-debian10
20 | WORKDIR /
21 | ENV GODISTRO="debian"
22 | COPY --from=builder /build/meshery-meshsync .
23 | ENTRYPOINT ["/meshery-meshsync"]
24 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # Copyright Meshery Authors
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
16 |
17 | include install/Makefile.core.mk
18 | include install/Makefile.show-help.mk
19 |
20 | CURRENT_DIR:=$(shell pwd)
21 | MESHSYNC_BINARY_TARGET_RELATIVE:=bin/meshsync
22 | MESHSYNC_BINARY_TARGET_ABSOLUTE:=$(CURRENT_DIR)/$(MESHSYNC_BINARY_TARGET_RELATIVE)
23 | INTEGRATION_TESTS_DIR:=$(CURRENT_DIR)/integration-tests
24 |
25 | ifeq (,$(shell go env GOBIN))
26 | GOBIN=$(shell go env GOPATH)/bin
27 | else
28 | GOBIN=$(shell go env GOBIN)
29 | endif
30 |
31 | #-----------------------------------------------------------------------------
32 | # Docker-based Builds
33 | #-----------------------------------------------------------------------------
34 | .PHONY: docker-check
35 | ## Build Meshsync's docker image
36 | docker: check
37 | docker build -t meshery/meshery-meshsync .
38 |
39 | .PHONY: docker-run
40 | ## Runs Meshsync in docker
41 | docker-run:
42 | (docker rm -f meshery-meshsync) || true
43 | docker run --name meshery-meshsync -d \
44 | -p 10007:10007 \
45 | -e DEBUG=true \
46 | meshery/meshery-meshsync
47 |
48 | PHONY: nats
49 | ## Runs a local instance of NATS server in detached mode
50 | nats:
51 | (docker rm -f nats) || true
52 | docker run --name nats --rm -p 4222:4222 -p 8222:8222 -d nats --http_port 8222
53 |
54 | #-----------------------------------------------------------------------------
55 | # Local Builds
56 | #-----------------------------------------------------------------------------
57 | .PHONY: build
58 | ## Build Meshsync binary to $(MESHSYNC_BINARY_TARGET_RELATIVE)
59 | build:
60 | go build -o $(MESHSYNC_BINARY_TARGET_RELATIVE) main.go
61 |
62 | .PHONY: run-check
63 | ## Runs local instance of Meshsync: can be used during local development
64 | run: nats
65 | go$(v) mod tidy; \
66 | DEBUG=true GOPROXY=direct GOSUMDB=off go run main.go
67 |
68 | .PHONY: check
69 | ## Lint check Meshsync.
70 | check:
71 | $(GOBIN)/golangci-lint run ./...
72 |
73 | .PHONY: go-mod-tidy
74 | ## Run go mod tidy for dependency management
75 | go-mod-tidy:
76 | go mod tidy
77 |
78 | #-----------------------------------------------------------------------------
79 | # Tests
80 | #-----------------------------------------------------------------------------
81 |
82 | # Test covergae
83 | .PHONY: coverage
84 | ## Runs coverage tests for Meshsync
85 | coverage:
86 | go test -v ./... -coverprofile cover.out
87 | go tool cover -html=cover.out -o cover.html
88 | ## Runs unit tests
89 | test: check
90 | go test -failfast --short ./... -race
91 | ## Lint check Golang
92 | lint:
93 | golangci-lint run ./...
94 |
95 | ## Runs integration tests check dependencies (if docker, kind, kubectl are present)
96 | integration-tests-check-dependencies:
97 | ./integration-tests/setup.sh check_dependencies
98 |
99 | ## Runs integration tests set up (runs docker compose with nats and creates a test kind cluster)
100 | ## docker compose exposes nats on default ports to host, so they must be available
101 | integration-tests-setup:
102 | ./integration-tests/infrastructure/setup.sh setup
103 |
104 | ## Runs integration tests clean up (stops docker compose and deletes test cluster)
105 | integration-tests-cleanup:
106 | ./integration-tests/infrastructure/setup.sh cleanup
107 |
108 | ## Runs integration tests
109 | integration-tests-run: build
110 | RUN_INTEGRATION_TESTS=true \
111 | MESHSYNC_BINARY_PATH=$(MESHSYNC_BINARY_TARGET_ABSOLUTE) \
112 | SAVE_MESHSYNC_OUTPUT=true \
113 | go test -v -count=1 -run Integration $(INTEGRATION_TESTS_DIR)
114 |
115 | ## Runs integration tests full cycle (setup, run, cleanup)
116 | integration-tests: integration-tests-setup integration-tests-run integration-tests-cleanup
117 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
35 |
36 | # MeshSync
37 |
38 | MeshSync, an event-driven, continuous discovery and synchronization engine performs the task of ensuring that the state of configuration and status of operation of any supported Meshery platform (e.g. Kubernetes) and environment are known to Meshery Server. When deployed into Kubernetes enviroments, MeshSync runs as a Kubernetes custom controller under the control of Meshery Operator.
39 |
40 | See [MeshSync in Meshery Docs](https://docs.meshery.io/concepts/architecture/meshsync) for additional information.
41 |
42 | ----
43 |
44 | Could be run in two modes:
45 | - nats (default)
46 | - file
47 |
48 | See details on input params in command help output:
49 | ```sh
50 | meshsync --help
51 | ```
52 |
53 |
54 | ## NATS mode
55 | NATS mode is the default mode.
56 |
57 | In that mode, MeshSync expects a NATS connection and outputs Kubernetes resources updates into NATS queue, which is how MeshSync runs when deployed in Kubernetes cluster in conjuction with Meshery Broker.
58 |
59 | ## File mode
60 | File mode is an option to run meshsync without dependency on nats and CRD.
61 |
62 | In that mode meshsync outputs k8s resources updates into file in kubernetes manifest yaml format.
63 |
64 | The result of run is two files:
65 | - meshery-cluster-snapshot-YYYYMMDD-00.yaml
66 | - meshery-cluster-snapshot-YYYYMMDD-00-extended.yaml
67 |
68 | meshery-cluster-snapshot-YYYYMMDD-00-extended.yaml contains all events meshsync produces as output;
69 |
70 | meshery-cluster-snapshot-YYYYMMDD-00.yaml contains a deduplicated version where each resource is presented with one entity.
71 | Deduplication is done by `metadata.uid` field.
72 |
73 |
74 | ### Notes (on file mode)
75 | Right now the format of the generated files is very close to kubernetes manifest yaml format, but not exactly the same.
76 |
77 | Generated files contain `metadata.labels` as array while in kubernetes manifest it should be an object.
78 |
79 | It is due to the format of [KubernetesResourceObjectMeta](pkg/model/model.go#52).
80 |
81 | `kubectl apply --dry-run` returns corresponding error:
82 |
83 | ```sh
84 | kubectl apply --dry-run=client -f meshery-cluster-snapshot-YYYYMMDD-00.yaml
85 |
86 | unable to decode "meshery-cluster-snapshot-YYYYMMDD-00.yaml": json: cannot unmarshal array into Go struct field ObjectMeta.metadata.labels of type map[string]string
87 | ```
88 |
89 |
90 |
91 | ## Join the Meshery community
92 |
93 |
94 | Our projects are community-built and welcome collaboration. 👍 Be sure to see the Contributor Journey Map and Community Handbook for a tour of resources available to you and the Repository Overview for a cursory description of repository by technology and programming language. Jump into community Slack or discussion forum to participate.
95 |
96 |
97 |
Find your MeshMate
98 |
99 |
MeshMates are experienced Meshery community members, who will help you learn your way around, discover live projects, and expand your community network. Connect with a MeshMate today!
100 |
101 | Learn more about the MeshMates program.
102 |
103 |
104 |
131 | Not sure where to start? Grab an open issue with the help-wanted label.
132 |
133 |
134 |
135 |
136 |
137 | ## Contributing
138 |
139 | Please do! We're a warm and welcoming community of open source contributors. Please join. All types of contributions are welcome. Be sure to read the [Contributor Guides](https://docs.meshery.io/project/contributing) for a tour of resources available to you and how to get started.
140 |
141 |
142 |
143 |