Skip to content

Commit

Permalink
Merge pull request #1616 from sttts/sttts-syncer-1.24-0.6
Browse files Browse the repository at this point in the history
0.6: cli/sync: create service account secret in advance to trigger token creation
  • Loading branch information
openshift-merge-robot authored Jul 26, 2022
2 parents 80450a6 + dfb963c commit 789d0ca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/cliplugins/workload/plugin/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ metadata:
name: kcp-syncer-sync-target-name-34b23c4k
namespace: kcp-syncer-sync-target-name-34b23c4k
---
apiVersion: v1
kind: Secret
metadata:
name: kcp-syncer-sync-target-name-34b23c4k-token
namespace: kcp-syncer-sync-target-name-34b23c4k
annotations:
kubernetes.io/service-account.name: kcp-syncer-sync-target-name-34b23c4k
type: kubernetes.io/service-account-token
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down
9 changes: 9 additions & 0 deletions pkg/cliplugins/workload/plugin/syncer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ metadata:
name: {{.ServiceAccount}}
namespace: {{.Namespace}}
---
apiVersion: v1
kind: Secret
metadata:
name: {{.ServiceAccount}}-token
namespace: {{.Namespace}}
annotations:
kubernetes.io/service-account.name: {{.ServiceAccount}}
type: kubernetes.io/service-account-token
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down

0 comments on commit 789d0ca

Please sign in to comment.