-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save VCluster library to K8s repo (#1017)
Since we plan to remove the VCluster GitHub repository, we need to save it within the K8s repository. Afterward, the CI/CD pipeline will update the VCluster folder directly instead of updating the VCluster version in go.mod. Initially, I considered using "go mod vendor" to store the VCluster library. However, "go mod vendor" attempts to download the entire "Vertica Server" repository (where VCluster is located), which is unnecessary. Therefore, I decided to manually copy the VCluster library into the K8s repository instead.
- Loading branch information
1 parent
4b64534
commit 0367389
Showing
248 changed files
with
43,185 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -783,7 +783,7 @@ jobs: | |
docker buildx imagetools create --tag opentext/verticadb-operator-private:${{ github.sha }} ${{ needs.build.outputs.operator-image }} | ||
sync-vcluster: | ||
name: Sync-vcluster-repo | ||
name: Sync-vcluster-code | ||
needs: [ | ||
e2e-leg-1-vcluster, | ||
e2e-leg-2-vcluster, | ||
|
@@ -806,31 +806,37 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: ${{ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && contains(github.ref, 'k8s-sync') && (github.event_name == 'push')}} | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
- name: Run Sync script | ||
- name: Create a PR | ||
run: | | ||
echo "Running sync script" | ||
scripts/vcluster-sync.sh ${{ github.ref }} main ${{ secrets.VCLUSTER_CICD }} | ||
# Get the current branch name | ||
current_branch="${GITHUB_REF#refs/heads/}" | ||
# Define the API endpoint and PR details | ||
api_url="https://api.github.com/repos/${{ github.repository }}/pulls" | ||
title="CICD for VClusterOps Synchronization" | ||
body="This PR was automatically generated by CICD pipeline to sync vclusterOps." | ||
base="main" | ||
head="$current_branch" | ||
# Create the pull request via the GitHub API | ||
curl -X POST "$api_url" \ | ||
-H "Authorization: token ${{ github.token }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-d "$(echo "{\"title\": \"$title\", \"body\": \"$body\", \"head\": \"$head\", \"base\": \"$base\"}")" | ||
notification: | ||
name: team-notification | ||
needs: [sync-vcluster] | ||
runs-on: ubuntu-latest | ||
if: ${{ always() && contains(github.ref, 'k8s-sync') }} | ||
steps: | ||
- name: Get vcluster commit url | ||
run: | | ||
VCLUSTER_REF=$(echo ${{ github.event.head_commit.message }} | awk '{print $NF}') | ||
echo "VCLUSTER_URL=${{ github.server_url }}/vertica/vcluster/commit/$VCLUSTER_REF" >> $GITHUB_ENV | ||
- name: notification on success | ||
if: ${{ always() && contains(needs.sync-vcluster.result, 'success') }} | ||
uses: jdcargile/[email protected] | ||
with: | ||
github-token: ${{ github.token }} | ||
ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }} | ||
notification-summary: Success | worflow ${{ github.workflow }} on branch ${{ github.ref_name }} with <a href="${{ env.VCLUSTER_URL }}">VCluster commit changes</a> | ||
notification-summary: Success | workflow ${{ github.workflow }} on branch ${{ github.ref_name }} | ||
notification-color: 28a745 | ||
verbose-logging: true | ||
|
||
|
@@ -840,6 +846,6 @@ jobs: | |
with: | ||
github-token: ${{ github.token }} | ||
ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }} | ||
notification-summary: Failure | worflow ${{ github.workflow }} on branch ${{ github.ref_name }} with <a href="${{ env.VCLUSTER_URL }}">VCluster commit changes</a> | ||
notification-summary: Failure | workflow ${{ github.workflow }} on branch ${{ github.ref_name }} | ||
notification-color: dc3545 | ||
verbose-logging: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Merge branch | ||
on: | ||
repository_dispatch: | ||
types: curl_request_merge | ||
jobs: | ||
unit-test: | ||
uses: ./.github/workflows/unittests.yaml | ||
|
||
sync-branch: | ||
needs: [unit-test] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Merge branch ${{ github.event.client_payload.source_branch }} -> ${{ github.event.client_payload.target_branch }} | ||
uses: everlytic/[email protected] | ||
with: | ||
source_ref: ${{ github.event.client_payload.source_branch }} | ||
target_branch: ${{ github.event.client_payload.target_branch }} | ||
github_token: ${{ github.token }} | ||
commit_message_template: '[Automated] Merged {source_ref} into target {target_branch}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Unit tests | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
push: | ||
|
||
jobs: | ||
|
||
ut: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
# When changing this, be sure to update the version at: | ||
# vertica/make/build-container/*Dockerfile | ||
go-version: "1.22.5" | ||
|
||
- name: Run unit tests | ||
run: make vet lint test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
coverage.out | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
linters-settings: | ||
depguard: | ||
rules: | ||
main: | ||
allow: | ||
- $gostd | ||
- github.com | ||
- vertica.com | ||
- k8s.io | ||
dupl: | ||
threshold: 100 | ||
funlen: | ||
lines: 100 | ||
statements: 50 | ||
gofmt: | ||
rewrite-rules: | ||
- pattern: 'interface{}' | ||
replacement: 'any' | ||
gci: | ||
local-prefixes: github.com/golangci/golangci-lint | ||
goconst: | ||
min-len: 2 | ||
min-occurrences: 2 | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
disabled-checks: | ||
- dupImport # https://github.com/go-critic/go-critic/issues/845 | ||
- ifElseChain | ||
- octalLiteral | ||
- whyNoLint | ||
- wrapperFunc | ||
gocyclo: | ||
min-complexity: 15 | ||
goimports: | ||
local-prefixes: github.com/golangci/golangci-lint | ||
gomnd: | ||
settings: | ||
mnd: | ||
# don't include the "operation" and "assign" | ||
checks: [argument, case, condition, return] | ||
govet: | ||
check-shadowing: true | ||
settings: | ||
printf: | ||
funcs: | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf | ||
lll: | ||
line-length: 140 | ||
maligned: | ||
suggest-new: true | ||
misspell: | ||
locale: US | ||
nolintlint: | ||
allow-leading-space: false | ||
allow-unused: false # report any unused nolint directives | ||
require-explanation: false # don't require an explanation for nolint directives | ||
require-specific: false # don't require nolint directives to be specific about which linter is being skipped | ||
|
||
linters: | ||
# please, do not use `enable-all`: it's deprecated and will be removed soon. | ||
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint | ||
disable-all: true | ||
enable: | ||
- depguard | ||
- dogsled | ||
- dupl | ||
- errcheck | ||
- exportloopref | ||
- exhaustive | ||
- funlen | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- gofmt | ||
- goimports | ||
- revive | ||
- gomnd | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- lll | ||
- misspell | ||
- nakedret | ||
- nolintlint | ||
- staticcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- whitespace | ||
|
||
# don't enable: | ||
# - asciicheck | ||
# - scopelint | ||
# - gochecknoglobals | ||
# - gocognit | ||
# - godot | ||
# - godox | ||
# - goerr113 | ||
# - interfacer | ||
# - maligned | ||
# - nestif | ||
# - prealloc | ||
# - testpackage | ||
# - revive | ||
# - wsl | ||
|
||
# disabled because of go 1.18 | ||
# in May 2022 | ||
# - bodyclose | ||
# - noctx | ||
# - rowserrcheck | ||
# - structcheck | ||
# - unparam | ||
# | ||
|
||
issues: | ||
# Excluding configuration per-path, per-linter, per-text and per-source | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- gomnd | ||
|
||
# https://github.com/go-critic/go-critic/issues/926 | ||
- linters: | ||
- gocritic | ||
text: "unnecessaryDefer:" | ||
|
||
run: | ||
concurrency: 4 | ||
timeout: 5m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
This document guides you through the contribution process: | ||
|
||
- [Bug Reports](#bug-reports) | ||
- [Feature Requests](#feature-requests) | ||
- [Code Contributions](#code-contributions) | ||
|
||
# Bug Reports | ||
|
||
If you find a bug, [submit an issue](https://github.com/vertica/vcluster/issues) | ||
with a complete and reproducible bug report. | ||
|
||
For issues that are **not suitable** to be reported publicly on the GitHub | ||
issue system (e.g., security related issues), report your issues to [Vertica | ||
open source team](mailto:[email protected]) directly or file a | ||
case with Vertica support, if you have a support account. | ||
|
||
# Feature Requests | ||
|
||
The Vertica team is always open to suggestions--feel free to share your ideas | ||
about how to improve *vcluster-ops*. To provide suggestions, [open an | ||
issue](https://github.com/vertica/vcluster/issues) with details describing | ||
what feature(s) you would like added or changed. | ||
|
||
# Code Contributions | ||
|
||
At this time we are not accepting any code contributions. All development for | ||
this repository is done internally at Vertica. Code is periodically | ||
synchronized from the internal server repository to this public repository. |
Oops, something went wrong.