Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove References to [docker] in main.py #24

Merged
merged 2 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tekton/base/triggers/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ roleRef:
kind: Role
name: tekton-triggers-example-minimal
---
kind: ClusterRole
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: tekton-triggers-example-clusterrole
Expand All @@ -51,7 +51,7 @@ rules:
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: RoleBinding
metadata:
name: tekton-triggers-example-clusterbinding
subjects:
Expand Down
13 changes: 1 addition & 12 deletions tekton/overlays/secrets/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

ssh = Config._sections['ssh']
literals = Config._sections['literals']
docker = Config._sections['docker']

try:
os.makedirs(".secrets")
Expand All @@ -34,9 +33,6 @@
for key, value in ssh.items():
new_path = shutil.copy(value, '.secrets')
ssh[key] = new_path
for key, value in docker.items():
new_path = shutil.copy(value, '.secrets/.dockerconfigjson')
docker[key] = new_path

input = """apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand All @@ -54,17 +50,10 @@
files:
- {{v}}
{{/ssh}}
{{#docker}}
- name: {{k}}
files:
- {{v}}
type: kubernetes.io/dockerconfigjson
{{/docker}}
"""

literals = [{"k": k, "v": v} for k, v in literals.items()]
ssh = [{"k": k, "v": v} for k, v in ssh.items()]
docker = [{"k": k, "v": v} for k, v in docker.items()]

class bcolors:
HEADER = '\033[95m'
Expand All @@ -83,7 +72,7 @@ class bcolors:

with open('kustomization.yaml', 'w') as f:
sys.stdout = f
print(pystache.render(input, {"literals": literals, "ssh": ssh, "docker": docker}))
print(pystache.render(input, {"literals": literals, "ssh": ssh}))
sys.stdout = original_stdout

print(bcolors.OKGREEN + "Completed..." + bcolors.ENDC)