Skip to content

Commit

Permalink
[ws-daemon] Search and replace ws-sync
Browse files Browse the repository at this point in the history
This should have happened in gitpod-io#2003

/werft https=true
  • Loading branch information
Christian Weichel committed Oct 19, 2020
1 parent 38d0062 commit 8d1664f
Show file tree
Hide file tree
Showing 27 changed files with 91 additions and 893 deletions.
2 changes: 1 addition & 1 deletion .werft/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ components:
path: gcp-sa-registry-auth
registryCerts: []

wsSync:
wsDaemon:
hostWorkspaceArea: /mnt/disks/ssd0/workspaces
volumes:
- name: gcloud-tmp
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/builtin-registry-certs-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{{ if (index .Values "docker-registry" "enabled") }}
{{- $regName := include "gitpod.builtinRegistry.name" . -}}
{{- $ca := genCA "wssync-ca" 365 -}}
{{- $ca := genCA "wsdaemon-ca" 365 -}}
{{- $cert := genSignedCert (include "gitpod.fullname" . ) nil ( list $regName ) 365 $ca -}}
apiVersion: v1
kind: Secret
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/ws-daemon-tlssecret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{- $this := dict "root" . "gp" $.Values "comp" $comp -}}
{{- if not $comp.disabled -}}
{{- $altNames := list ( printf "%s.%s" (include "gitpod.fullname" .) .Release.Namespace ) ( printf "%s.%s.svc" "ws-daemon" .Release.Namespace ) ( printf "wsdaemon" ) -}}
{{- $ca := genCA "wssync-ca" 365 -}}
{{- $ca := genCA "wsdaemon-ca" 365 -}}
{{- $cert := genSignedCert (include "gitpod.fullname" . ) nil $altNames 365 $ca -}}
apiVersion: v1
kind: Secret
Expand Down
24 changes: 12 additions & 12 deletions components/content-service/pkg/git/porcelain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,31 @@ func TestParsePorcelain(t *testing.T) {
{`# branch.oid e48df267d11a16a04101e3f503aef27f8352e7fb
# branch.head cw/git-status
1 .M N... 100644 100644 100644 9f8efaf877a34290b1ec672ea76ed23ae1f6fc0e 9f8efaf877a34290b1ec672ea76ed23ae1f6fc0e ../../client/wsready.d.ts
1 .M N... 100644 100644 100644 fecd2cb9388debfa8b55eff29042940c6b48e34f fecd2cb9388debfa8b55eff29042940c6b48e34f ../../client/wssync_grpc_pb.d.ts
1 .M N... 100644 100644 100644 21d9ddf581bb8c76d4c57e751d6ca70f20d6d988 21d9ddf581bb8c76d4c57e751d6ca70f20d6d988 ../../client/wssync_grpc_pb.js
1 .M N... 100644 100644 100644 0fdd088bb302577f8d9f7b1e24bf1982f1e0b339 0fdd088bb302577f8d9f7b1e24bf1982f1e0b339 ../../client/wssync_pb.d.ts
1 .M N... 100644 100644 100644 5aebcbc6f8e2c400440b08e1ef9a8cf207121ba0 5aebcbc6f8e2c400440b08e1ef9a8cf207121ba0 ../../client/wssync_pb.js
1 .M N... 100644 100644 100644 fecd2cb9388debfa8b55eff29042940c6b48e34f fecd2cb9388debfa8b55eff29042940c6b48e34f ../../client/wsdaemon_grpc_pb.d.ts
1 .M N... 100644 100644 100644 21d9ddf581bb8c76d4c57e751d6ca70f20d6d988 21d9ddf581bb8c76d4c57e751d6ca70f20d6d988 ../../client/wsdaemon_grpc_pb.js
1 .M N... 100644 100644 100644 0fdd088bb302577f8d9f7b1e24bf1982f1e0b339 0fdd088bb302577f8d9f7b1e24bf1982f1e0b339 ../../client/wsdaemon_pb.d.ts
1 .M N... 100644 100644 100644 5aebcbc6f8e2c400440b08e1ef9a8cf207121ba0 5aebcbc6f8e2c400440b08e1ef9a8cf207121ba0 ../../client/wsdaemon_pb.js
1 .M N... 100644 100644 100644 afb7787839a21a1c6ec96b11ac771966e6e59e27 afb7787839a21a1c6ec96b11ac771966e6e59e27 ../../go.mod
1 .M N... 100644 100644 100644 6e158cd7a2cddc9904ca4958bb2a919ef76aa93b 6e158cd7a2cddc9904ca4958bb2a919ef76aa93b ../../go.sum
1 .M N... 100644 100644 100644 59cbc1f794f8d0809985b8400824defc1812118a 59cbc1f794f8d0809985b8400824defc1812118a ../internal/session/workspace.go
1 .M N... 100644 100644 100644 33136abd6ca52574c44ce9dc4c6892ff1dc4747a 33136abd6ca52574c44ce9dc4c6892ff1dc4747a wssync.pb.go
1 .M N... 100644 100644 100644 4108d304df5c42949c54b8b84dff7af06684ddcc 4108d304df5c42949c54b8b84dff7af06684ddcc wssync.proto
1 .M N... 100644 100644 100644 33136abd6ca52574c44ce9dc4c6892ff1dc4747a 33136abd6ca52574c44ce9dc4c6892ff1dc4747a wsdaemon.pb.go
1 .M N... 100644 100644 100644 4108d304df5c42949c54b8b84dff7af06684ddcc 4108d304df5c42949c54b8b84dff7af06684ddcc wsdaemon.proto
1 .M N... 100644 100644 100644 d6ea4d281da87355dad7040893bf8b0328dc0c60 d6ea4d281da87355dad7040893bf8b0328dc0c60 ../syncd/service.go
? ../../../../foo`,
&porcelainStatus{
BranchOID: "e48df267d11a16a04101e3f503aef27f8352e7fb",
BranchHead: "cw/git-status",
UncommitedFiles: []string{
"../../client/wsready.d.ts",
"../../client/wssync_grpc_pb.d.ts",
"../../client/wssync_grpc_pb.js",
"../../client/wssync_pb.d.ts",
"../../client/wssync_pb.js",
"../../client/wsdaemon_grpc_pb.d.ts",
"../../client/wsdaemon_grpc_pb.js",
"../../client/wsdaemon_pb.d.ts",
"../../client/wsdaemon_pb.js",
"../../go.mod",
"../../go.sum",
"../internal/session/workspace.go",
"wssync.pb.go",
"wssync.proto",
"wsdaemon.pb.go",
"wsdaemon.proto",
"../syncd/service.go",
},
UntrackedFiles: []string{
Expand Down
12 changes: 6 additions & 6 deletions components/ws-daemon-api/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ mv github.com/gitpod-io/gitpod/ws-daemon/api/* go && rm -rf github.com

GO111MODULE=on go get github.com/golang/mock/mockgen@latest
cd go
mockgen -package mock -source=wssync.pb.go > mock/mock_wssync.go
mockgen -package mock -source=daemon.pb.go > mock/mock_wsdaemon.go


echo "updating JSON tags"
go get github.com/fatih/gomodifytags
# remove depreated json tags
gomodifytags -line 0,$(cat wssync.pb.go|wc -l) -file wssync.pb.go -remove-tags json -w >/dev/null
gomodifytags -line 0,$(cat daemon.pb.go|wc -l) -file daemon.pb.go -remove-tags json -w >/dev/null
# add new JSON tags
gomodifytags -line 0,$(cat wssync.pb.go|wc -l) -file wssync.pb.go -add-tags json -transform camelcase -add-options json=omitempty -w >/dev/null
gomodifytags -line 0,$(cat daemon.pb.go|wc -l) -file daemon.pb.go -add-tags json -transform camelcase -add-options json=omitempty -w >/dev/null
# remove JSON tags for XXX_
for line in $(grep -n xxx wssync.pb.go | cut -f1 -d: | paste -sd " " -); do
gomodifytags -line $line -file wssync.pb.go -remove-tags json -w >/dev/null
gomodifytags -line $line -file wssync.pb.go -add-tags json:"-" -w >/dev/null
for line in $(grep -n xxx daemon.pb.go | cut -f1 -d: | paste -sd " " -); do
gomodifytags -line $line -file daemon.pb.go -remove-tags json -w >/dev/null
gomodifytags -line $line -file daemon.pb.go -add-tags json:"-" -w >/dev/null
done
cd ..

Expand Down
10 changes: 5 additions & 5 deletions components/ws-daemon-api/go/daemon.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions components/ws-daemon-api/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/gitpod-io/gitpod/ws-daemon/api
go 1.14

require (
github.com/fatih/gomodifytags v1.9.0 // indirect
github.com/gitpod-io/gitpod/content-service/api v0.0.0-00010101000000-000000000000
github.com/golang/mock v1.4.3
github.com/golang/protobuf v1.3.5
Expand Down
7 changes: 7 additions & 0 deletions components/ws-daemon-api/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
github.com/fatih/gomodifytags v1.9.0 h1:57iX6liPpgl5LiFIc/gf6opTK5jkBSjuZPsKvRJKvFU=
github.com/fatih/gomodifytags v1.9.0/go.mod h1:TbUyEjH1Zo0GkJd2Q52oVYqYcJ0eGNqG8bsiOb75P9c=
github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4=
github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw=
Expand Down Expand Up @@ -42,6 +48,7 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20180824175216-6c1c5e93cdc1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8d1664f

Please sign in to comment.