mirror of
				https://github.com/kubenetworks/kubevpn.git
				synced 2025-10-31 18:52:50 +08:00 
			
		
		
		
	feat: update krew version
This commit is contained in:
		
							
								
								
									
										6
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
									
									
									
									
								
							| @@ -93,4 +93,8 @@ container-local: kubevpn-linux-amd64 | |||||||
|  |  | ||||||
| .PHONY: container-test | .PHONY: container-test | ||||||
| container-test: kubevpn-linux-amd64 | container-test: kubevpn-linux-amd64 | ||||||
| 	docker buildx build --platform linux/amd64,linux/arm64 -t docker.io/naison/kubevpn:test -f $(BUILD_DIR)/test.Dockerfile --push . | 	docker buildx build --platform linux/amd64,linux/arm64 -t docker.io/naison/kubevpn:test -f $(BUILD_DIR)/test.Dockerfile --push . | ||||||
|  |  | ||||||
|  | .PHONY: version | ||||||
|  | version: | ||||||
|  | 	go run github.com/wencaiwulue/kubevpn/pkg/util/krew | ||||||
| @@ -2,8 +2,11 @@ package main | |||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"bytes" | 	"bytes" | ||||||
|  | 	"fmt" | ||||||
| 	"os" | 	"os" | ||||||
|  | 	"os/exec" | ||||||
| 	"path" | 	"path" | ||||||
|  | 	"strings" | ||||||
| 	"sync" | 	"sync" | ||||||
| 	"text/template" | 	"text/template" | ||||||
|  |  | ||||||
| @@ -11,10 +14,21 @@ import ( | |||||||
| ) | ) | ||||||
|  |  | ||||||
| func main() { | func main() { | ||||||
| 	filePath := "../../../.github/krew.yaml" | 	// git describe --tags `git rev-list --tags --max-count=1` | ||||||
| 	value := map[string]string{"TagName": "v1.1.20"} | 	commitId, err2 := exec.Command("git", "rev-list", "--tags", "--max-count=1").Output() | ||||||
|  | 	if err2 != nil { | ||||||
|  | 		panic(err2) | ||||||
|  | 	} | ||||||
|  | 	tag, err2 := exec.Command("git", "describe", "--tags", strings.TrimSpace(string(commitId))).Output() | ||||||
|  | 	if err2 != nil { | ||||||
|  | 		panic(err2) | ||||||
|  | 	} | ||||||
|  | 	fmt.Printf("latest tag is %s", strings.TrimSpace(string(tag))) | ||||||
|  | 	tplFile := ".github/krew.yaml" | ||||||
|  | 	dstFile := "plugins/kubevpn.yaml" | ||||||
|  | 	value := map[string]string{"TagName": strings.TrimSpace(string(tag))} | ||||||
|  |  | ||||||
| 	name := path.Base(filePath) | 	name := path.Base(tplFile) | ||||||
| 	var links []string | 	var links []string | ||||||
| 	t := template.New(name).Funcs(map[string]interface{}{ | 	t := template.New(name).Funcs(map[string]interface{}{ | ||||||
| 		"addURIAndSha": func(url, tag string) string { | 		"addURIAndSha": func(url, tag string) string { | ||||||
| @@ -39,7 +53,7 @@ func main() { | |||||||
| 		}, | 		}, | ||||||
| 	}) | 	}) | ||||||
|  |  | ||||||
| 	templateObject, err := t.ParseFiles(filePath) | 	templateObject, err := t.ParseFiles(tplFile) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		panic(err) | 		panic(err) | ||||||
| 	} | 	} | ||||||
| @@ -67,12 +81,12 @@ func main() { | |||||||
| 		}(i, link) | 		}(i, link) | ||||||
| 	} | 	} | ||||||
| 	wg.Wait() | 	wg.Wait() | ||||||
| 	processTemplate, err := ProcessTemplate(filePath, value, sha256Map) | 	processTemplate, err := ProcessTemplate(tplFile, value, sha256Map) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		panic(err) | 		panic(err) | ||||||
| 	} | 	} | ||||||
| 	println(string(processTemplate)) | 	println(string(processTemplate)) | ||||||
| 	err = os.WriteFile("../../../plugins/kubevpn.yaml", processTemplate, 0644) | 	err = os.WriteFile(dstFile, processTemplate, 0644) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		panic(err) | 		panic(err) | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ kind: Plugin | |||||||
| metadata: | metadata: | ||||||
|   name: kubevpn |   name: kubevpn | ||||||
| spec: | spec: | ||||||
|   version: v1.1.27 |   version: v1.1.28 | ||||||
|   homepage: https://github.com/wencaiwulue/kubevpn |   homepage: https://github.com/wencaiwulue/kubevpn | ||||||
|   shortDescription: "A vpn tunnel tools which can connect to kubernetes cluster network" |   shortDescription: "A vpn tunnel tools which can connect to kubernetes cluster network" | ||||||
|   description: | |   description: | | ||||||
| @@ -17,8 +17,8 @@ spec: | |||||||
|       matchLabels: |       matchLabels: | ||||||
|         os: windows |         os: windows | ||||||
|         arch: amd64 |         arch: amd64 | ||||||
|     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.27/kubevpn_v1.1.27_windows_amd64.zip |     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.28/kubevpn_v1.1.28_windows_amd64.zip | ||||||
|     sha256: bef24ccec9cac8f5c205e6608a17697f845ba96aa8b7ff0b6c90ee8a28abfeaf |     sha256: c1292f94523bc51ef3c68b7c01c1c21beb8d3ca6be48a4b05938c139092cd0ed | ||||||
|     files: |     files: | ||||||
|       - from: ./bin/kubevpn.exe |       - from: ./bin/kubevpn.exe | ||||||
|         to: . |         to: . | ||||||
| @@ -29,8 +29,8 @@ spec: | |||||||
|       matchLabels: |       matchLabels: | ||||||
|         os: windows |         os: windows | ||||||
|         arch: arm64 |         arch: arm64 | ||||||
|     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.27/kubevpn_v1.1.27_windows_arm64.zip |     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.28/kubevpn_v1.1.28_windows_arm64.zip | ||||||
|     sha256: a0f5c1c8627341f9833468c85a34dd5c9ee33416525d0137975e7c856c80e6dd |     sha256: b10b16769a791f229ac24a0aa642f59150fcb73d449e2bb83921239f7e77fb48 | ||||||
|     files: |     files: | ||||||
|       - from: ./bin/kubevpn.exe |       - from: ./bin/kubevpn.exe | ||||||
|         to: . |         to: . | ||||||
| @@ -41,8 +41,8 @@ spec: | |||||||
|       matchLabels: |       matchLabels: | ||||||
|         os: windows |         os: windows | ||||||
|         arch: 386 |         arch: 386 | ||||||
|     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.27/kubevpn_v1.1.27_windows_386.zip |     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.28/kubevpn_v1.1.28_windows_386.zip | ||||||
|     sha256: 5dde5bec315490d7a95ee8444c1ce106767d7057f493e6e7989d04f12e7178be |     sha256: 03819683d26210669a9240e6943fc20af6a8a62b91df7aa92b9ee38be01ffd07 | ||||||
|     files: |     files: | ||||||
|       - from: ./bin/kubevpn.exe |       - from: ./bin/kubevpn.exe | ||||||
|         to: . |         to: . | ||||||
| @@ -53,8 +53,8 @@ spec: | |||||||
|       matchLabels: |       matchLabels: | ||||||
|         os: linux |         os: linux | ||||||
|         arch: amd64 |         arch: amd64 | ||||||
|     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.27/kubevpn_v1.1.27_linux_amd64.zip |     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.28/kubevpn_v1.1.28_linux_amd64.zip | ||||||
|     sha256: 621c3b3021ed8d2ee0ba11e20f5bf528a4ee309190dbb131a8ef0f3d6fb3b04a |     sha256: 544b2c53de9fdb1ade5a7b4487d08526596f0fc8e540e76510409b62aedeeeb4 | ||||||
|     files: |     files: | ||||||
|       - from: ./bin/kubevpn |       - from: ./bin/kubevpn | ||||||
|         to: . |         to: . | ||||||
| @@ -65,8 +65,8 @@ spec: | |||||||
|       matchLabels: |       matchLabels: | ||||||
|         os: linux |         os: linux | ||||||
|         arch: arm64 |         arch: arm64 | ||||||
|     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.27/kubevpn_v1.1.27_linux_arm64.zip |     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.28/kubevpn_v1.1.28_linux_arm64.zip | ||||||
|     sha256: b3abe82f1da20521dd3468157e330016646e1d5fce023f5c23535b7b403244df |     sha256: c99df8f999e151b448b2f48f3d07eaf4f9bc722542ba7f4a20904412a25bcbfd | ||||||
|     files: |     files: | ||||||
|       - from: ./bin/kubevpn |       - from: ./bin/kubevpn | ||||||
|         to: . |         to: . | ||||||
| @@ -77,8 +77,8 @@ spec: | |||||||
|       matchLabels: |       matchLabels: | ||||||
|         os: linux |         os: linux | ||||||
|         arch: 386 |         arch: 386 | ||||||
|     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.27/kubevpn_v1.1.27_linux_386.zip |     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.28/kubevpn_v1.1.28_linux_386.zip | ||||||
|     sha256: 96003acf4a951c9f438760f1541a8af4ccbbf6a3f7a70d9477c5a04e87371161 |     sha256: f623dcf8c84ce9d662f5516dbe2272d288d550277139adc105dcea23da643778 | ||||||
|     files: |     files: | ||||||
|       - from: ./bin/kubevpn |       - from: ./bin/kubevpn | ||||||
|         to: . |         to: . | ||||||
| @@ -89,8 +89,8 @@ spec: | |||||||
|       matchLabels: |       matchLabels: | ||||||
|         os: darwin |         os: darwin | ||||||
|         arch: amd64 |         arch: amd64 | ||||||
|     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.27/kubevpn_v1.1.27_darwin_amd64.zip |     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.28/kubevpn_v1.1.28_darwin_amd64.zip | ||||||
|     sha256: d522214a1f2067610dc5f9dd4b2c660cbaecc5a881f5ebd7b3bd0fefbb5e5f89 |     sha256: 917fe6b1bc757ceca3ecb1bebbe5b08e7b1a96aebcff5da54fe29f270b89805c | ||||||
|     files: |     files: | ||||||
|       - from: ./bin/kubevpn |       - from: ./bin/kubevpn | ||||||
|         to: . |         to: . | ||||||
| @@ -101,8 +101,8 @@ spec: | |||||||
|       matchLabels: |       matchLabels: | ||||||
|         os: darwin |         os: darwin | ||||||
|         arch: arm64 |         arch: arm64 | ||||||
|     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.27/kubevpn_v1.1.27_darwin_arm64.zip |     uri: https://github.com/wencaiwulue/kubevpn/releases/download/v1.1.28/kubevpn_v1.1.28_darwin_arm64.zip | ||||||
|     sha256: 93e1b934332ef96551620595923083366ec59af4ad59aecdf16b4f65f9347bcc |     sha256: c86532abfdd0b582c001a994921157abbbb3fcc5f12f28ec76a8e6afbc357916 | ||||||
|     files: |     files: | ||||||
|       - from: ./bin/kubevpn |       - from: ./bin/kubevpn | ||||||
|         to: . |         to: . | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 wencaiwulue
					wencaiwulue