Skip to content

Commit

Permalink
Convert shell script to Go (#3413)
Browse files Browse the repository at this point in the history
* Change to awk

* excluded print and -F

* xargs variation

* go-script to replace ref

* Part 1 - convert sh into go

* Go script

* del exp-openapi

* bin file in gitignore

* exclude bin file

* Revert yaml files

* code change for yaml file

* mv go-script to scripts dir

* required changes

* delete export-openapi.sh

* delete binary file main

* kubectl proxy - log, sleep time, graceful termination

* gen-embedded-openapi target for go script, run make gen-install

* agones - go mod vendor

* tmp dir path change

* fix modifyJSONFiles(), make gen-install

* revert go.mod, go.sum and vendor/modules.txt

* change path
  • Loading branch information
Kalaiselvi84 committed Oct 20, 2023
1 parent f77482f commit 848ede9
Show file tree
Hide file tree
Showing 9 changed files with 6,261 additions and 5,087 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ build/allocation
debug.test
obj
test/sdk/cpp/sdk/
build/scripts/k8s-export-openapi/main

5 changes: 3 additions & 2 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,9 @@ push-agones-sdk-linux-image-amd64: build-agones-sdk-image-amd64
docker push $(sidecar_linux_amd64_tag)

# Generate the Embedded CRD openapi
gen-embedded-openapi:
docker run --rm $(common_mounts) -w $(workdir_path)/build $(build_tag) ./export-openapi.sh
gen-embedded-openapi: ensure-build-image
docker run --rm $(common_mounts) --workdir=$(mount_path)/build/scripts/k8s-export-openapi $(DOCKER_RUN_ARGS) $(build_tag) \
go run -mod=mod ./main.go

# Generate the static install script
gen-install: $(ensure-build-image)
Expand Down
92 changes: 0 additions & 92 deletions build/export-openapi.sh

This file was deleted.

5 changes: 5 additions & 0 deletions build/scripts/k8s-export-openapi/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/agones/agones/build/scripts/k8s-export-openapi

go 1.20

require github.com/itchyny/json2yaml v0.1.4
2 changes: 2 additions & 0 deletions build/scripts/k8s-export-openapi/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/itchyny/json2yaml v0.1.4 h1:/pErVOXGG5iTyXHi/QKR4y3uzhLjGTEmmJIy97YT+k8=
github.com/itchyny/json2yaml v0.1.4/go.mod h1:6iudhBZdarpjLFRNj+clWLAkGft+9uCcjAZYXUH9eGI=
Loading

0 comments on commit 848ede9

Please sign in to comment.