diff --git a/hack/local-run-test/Makefile b/hack/local-run-test/Makefile index 66f101c4..1f1d6969 100644 --- a/hack/local-run-test/Makefile +++ b/hack/local-run-test/Makefile @@ -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 diff --git a/hack/local-run-test/templates/dev-code-server/Makefile b/hack/local-run-test/templates/dev-code-server/Makefile index 264f97dc..0642c76a 100644 --- a/hack/local-run-test/templates/dev-code-server/Makefile +++ b/hack/local-run-test/templates/dev-code-server/Makefile @@ -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 \ No newline at end of file + kubectl apply -f gryffindor-template.yaml \ No newline at end of file diff --git a/hack/local-run-test/templates/dev-code-server/team-a-template.yaml b/hack/local-run-test/templates/dev-code-server/gryffindor-template.yaml similarity index 93% rename from hack/local-run-test/templates/dev-code-server/team-a-template.yaml rename to hack/local-run-test/templates/dev-code-server/gryffindor-template.yaml index 4a24333c..d02338f3 100644 --- a/hack/local-run-test/templates/dev-code-server/team-a-template.yaml +++ b/hack/local-run-test/templates/dev-code-server/gryffindor-template.yaml @@ -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 diff --git a/hack/local-run-test/templates/dev-code-server/team-a/kustomization.yaml b/hack/local-run-test/templates/dev-code-server/gryffindor/kustomization.yaml similarity index 100% rename from hack/local-run-test/templates/dev-code-server/team-a/kustomization.yaml rename to hack/local-run-test/templates/dev-code-server/gryffindor/kustomization.yaml diff --git a/hack/local-run-test/templates/iamserviceaccount/Makefile b/hack/local-run-test/templates/iamserviceaccount/Makefile index 8d98092e..712dcdbd 100644 --- a/hack/local-run-test/templates/iamserviceaccount/Makefile +++ b/hack/local-run-test/templates/iamserviceaccount/Makefile @@ -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 \ diff --git a/hack/local-run-test/templates/iamserviceaccount/addon.yaml b/hack/local-run-test/templates/iamserviceaccount/addon.yaml index b618c6f9..84fb370a 100644 --- a/hack/local-run-test/templates/iamserviceaccount/addon.yaml +++ b/hack/local-run-test/templates/iamserviceaccount/addon.yaml @@ -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