Skip to content

Commit

Permalink
Merge pull request #796 from jlandowner/fix/local-run-test
Browse files Browse the repository at this point in the history
fix local-run-test
  • Loading branch information
oruharo authored Aug 3, 2023
2 parents 64ad3cb + 8325d89 commit 61a1ae3
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
20 changes: 10 additions & 10 deletions hack/local-run-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,18 @@ apply-template: kubectl cosmoctl ## Apply template.
add-user: kubectl cosmoctl ## add user
@echo ====== $@ ======
-cosmoctl user create tom --admin 2> /dev/null
-cosmoctl user create team-a-dev --role "team-a-dev" 2> /dev/null
-cosmoctl user create team-a-admin --role "team-a-admin" 2> /dev/null
-cosmoctl user create team-b-dev --role "team-b-dev" 2> /dev/null
-cosmoctl user create team-b-admin --role "team-b-admin" 2> /dev/null
-cosmoctl user create team-ab-dev --role "team-a-dev,team-b-dev" 2> /dev/null
-cosmoctl user create gryffindor-dev --role "gryffindor" 2> /dev/null
-cosmoctl user create gryffindor-admin --role "gryffindor-admin" 2> /dev/null
-cosmoctl user create slytherin-dev --role "slytherin" 2> /dev/null
-cosmoctl user create slytherin-admin --role "slytherin-admin" 2> /dev/null
-cosmoctl user create grytherin --role "gryffindor,slytherin" 2> /dev/null
-cosmoctl user create ldapuser1 --admin --auth-type ldap 2> /dev/null
-cosmoctl user reset-password tom --password vvv
-cosmoctl user reset-password team-a-dev --password xxxxxxxx
-cosmoctl user reset-password team-a-admin --password xxxxxxxx
-cosmoctl user reset-password team-b-dev --password xxxxxxxx
-cosmoctl user reset-password team-b-admin --password xxxxxxxx
-cosmoctl user reset-password team-ab-dev --password xxxxxxxx
-cosmoctl user reset-password gryffindor-dev --password xxxxxxxx
-cosmoctl user reset-password gryffindor-admin --password xxxxxxxx
-cosmoctl user reset-password slytherin-dev --password xxxxxxxx
-cosmoctl user reset-password slytherin-admin --password xxxxxxxx
-cosmoctl user reset-password grytherin --password xxxxxxxx


add-workspace: kubectl cosmoctl ## add workspace
Expand Down
12 changes: 6 additions & 6 deletions hack/local-run-test/templates/dev-code-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ template: ## Create template
cd kubernetes/ && kustomize edit set image $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
kustomize build kubernetes/ | cosmoctl tmpl generate -o cosmo-template.yaml --workspace \
--required-vars CODE-SERVER_STORAGE_GB:20,DOCKER_STORAGE:20
kustomize build team-a | cosmoctl tmpl generate -o team-a-template.yaml --workspace \
--name team-a-codeserver \
--desc 'only for team A' \
--userroles 'team-a-*' \
--required-useraddons team-a-serviceaccount \
kustomize build gryffindor | cosmoctl tmpl generate -o gryffindor-template.yaml --workspace \
--name gryffindor-codeserver \
--desc 'only for gryffindor' \
--userroles 'gryffindor' \
--required-useraddons gryffindor-serviceaccount \
--required-vars CODE-SERVER_STORAGE_GB:20,DOCKER_STORAGE:20

.PHONY: apply
apply: template ## Apply template
kubectl apply -f cosmo-template.yaml
kubectl apply -f team-a-template.yaml
kubectl apply -f gryffindor-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ apiVersion: cosmo-workspace.github.io/v1alpha1
kind: Template
metadata:
annotations:
cosmo-workspace.github.io/required-useraddons: team-a-serviceaccount
cosmo-workspace.github.io/userroles: team-a-*
cosmo-workspace.github.io/required-useraddons: gryffindor-serviceaccount
cosmo-workspace.github.io/userroles: gryffindor
workspace.cosmo-workspace.github.io/deployment: workspace
workspace.cosmo-workspace.github.io/service: workspace
workspace.cosmo-workspace.github.io/service-main-port: main
creationTimestamp: null
labels:
cosmo-workspace.github.io/type: workspace
name: team-a-codeserver
name: gryffindor-codeserver
spec:
description: only for team A
description: only for gryffindor
rawYaml: |
apiVersion: v1
kind: Service
Expand Down
4 changes: 2 additions & 2 deletions hack/local-run-test/templates/iamserviceaccount/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ all: template
.PHONY: template
template:
kustomize build kubernetes | cosmoctl tmpl gen --useraddon \
--name team-a-serviceaccount \
--userroles=team-a-* \
--name gryffindor-serviceaccount \
--userroles=gryffindor,gryffindor-admin \
--disable-nameprefix \
--cluster-scope \
--required-useraddons resource-limitter \
Expand Down
4 changes: 2 additions & 2 deletions hack/local-run-test/templates/iamserviceaccount/addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ metadata:
annotations:
cosmo-workspace.github.io/disable-nameprefix: "true"
cosmo-workspace.github.io/required-useraddons: resource-limitter
cosmo-workspace.github.io/userroles: team-a-*
cosmo-workspace.github.io/userroles: gryffindor,gryffindor-admin
creationTimestamp: null
labels:
cosmo-workspace.github.io/type: useraddon
name: team-a-serviceaccount
name: gryffindor-serviceaccount
spec:
rawYaml: |
apiVersion: v1
Expand Down

0 comments on commit 61a1ae3

Please sign in to comment.