Skip to content

Add support to set the agent name in the docker cli

Viktor Nagy (GitLab) requested to merge nagyv-gitlab-master-patch-85601 into master

Closes gitlab-org/gitlab#334335 (closed).

A lot of formatting changes from Kustomize. I they must have changed how it works (they did some serious internals refactoring not long ago, probably related).

➜ KPT_PACKAGE_PATH=build/deployment/gitlab-agent go run ./cmd/cli generate --name-prefix=abc- --namespace=x1 --agent-token=adasdsad --agent-version=v14.0.1 | kubectl apply -f -
clusterrole.rbac.authorization.k8s.io/cilium-alert-read unchanged
clusterrole.rbac.authorization.k8s.io/gitlab-agent-gitops-read-all unchanged
clusterrole.rbac.authorization.k8s.io/gitlab-agent-gitops-write-all unchanged
clusterrolebinding.rbac.authorization.k8s.io/cilium-alert-read configured
clusterrolebinding.rbac.authorization.k8s.io/gitlab-agent-gitops-read-all configured
clusterrolebinding.rbac.authorization.k8s.io/gitlab-agent-gitops-write-all configured
Error from server (NotFound): error when creating "STDIN": namespaces "x1" not found
Error from server (NotFound): error when creating "STDIN": namespaces "x1" not found
Error from server (NotFound): error when creating "STDIN": namespaces "x1" not found
➜ kubectl create ns x1
namespace/x1 created
➜ KPT_PACKAGE_PATH=build/deployment/gitlab-agent go run ./cmd/cli generate --name-prefix=abc- --namespace=x1 --agent-token=adasdsad --agent-version=v14.0.1 | kubectl apply -f -
serviceaccount/abc-gitlab-agent created
clusterrole.rbac.authorization.k8s.io/cilium-alert-read unchanged
clusterrole.rbac.authorization.k8s.io/gitlab-agent-gitops-read-all unchanged
clusterrole.rbac.authorization.k8s.io/gitlab-agent-gitops-write-all unchanged
clusterrolebinding.rbac.authorization.k8s.io/cilium-alert-read unchanged
clusterrolebinding.rbac.authorization.k8s.io/gitlab-agent-gitops-read-all unchanged
clusterrolebinding.rbac.authorization.k8s.io/gitlab-agent-gitops-write-all unchanged
secret/abc-gitlab-agent-token-854hmb7tb4 created
deployment.apps/abc-gitlab-agent created
➜ KPT_PACKAGE_PATH=build/deployment/gitlab-agent go run ./cmd/cli generate --name-prefix=xyz- --namespace=x1 --agent-token=adasdsad --agent-version=v14.0.1 | kubectl apply -f -
serviceaccount/xyz-gitlab-agent created
clusterrole.rbac.authorization.k8s.io/cilium-alert-read unchanged
clusterrole.rbac.authorization.k8s.io/gitlab-agent-gitops-read-all unchanged
clusterrole.rbac.authorization.k8s.io/gitlab-agent-gitops-write-all unchanged
clusterrolebinding.rbac.authorization.k8s.io/cilium-alert-read configured
clusterrolebinding.rbac.authorization.k8s.io/gitlab-agent-gitops-read-all configured
clusterrolebinding.rbac.authorization.k8s.io/gitlab-agent-gitops-write-all configured
secret/xyz-gitlab-agent-token-854hmb7tb4 created
deployment.apps/xyz-gitlab-agent created
➜ kg pods -n x1
NAME                                READY   STATUS    RESTARTS   AGE
abc-gitlab-agent-746799d546-q9dxh   1/1     Running   0          25s
xyz-gitlab-agent-64b9768bdc-9xlmb   0/1     Running   0          8s
Edited by Mikhail Mazurskiy

Merge request reports