base64 is no native filter in jinja
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		@@ -1,6 +1,7 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
import kopf
 | 
			
		||||
import kubernetes
 | 
			
		||||
import base64
 | 
			
		||||
from jinja2 import Template
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -22,8 +23,8 @@ def create_fn(spec, name, namespace, logger, **kwargs):
 | 
			
		||||
        original_crd=name,
 | 
			
		||||
        secret_name=secret_name,
 | 
			
		||||
        namespace=secret_namespace,
 | 
			
		||||
        username="test",
 | 
			
		||||
        password="test"
 | 
			
		||||
        username=base64.b64encode("test"),
 | 
			
		||||
        password=base64.b64encode("test")
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    obj = api.create_namespaced_secret(
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ image:
 | 
			
		||||
  repository: lerentis/bitwarden-crd-operator
 | 
			
		||||
  pullPolicy: IfNotPresent
 | 
			
		||||
  # Overrides the image tag whose default is the chart appVersion.
 | 
			
		||||
  tag: "2685c5b97d76bf00ed4c15519b699ae88682078f"
 | 
			
		||||
  tag: "97fced6969e32d0c7e0975865f26ebbc43f1cd8a"
 | 
			
		||||
 | 
			
		||||
imagePullSecrets: []
 | 
			
		||||
nameOverride: ""
 | 
			
		||||
 
 | 
			
		||||
@@ -8,5 +8,5 @@ metadata:
 | 
			
		||||
  namespace: "{{ namespace }}"
 | 
			
		||||
type: Opaque
 | 
			
		||||
data:
 | 
			
		||||
  username: "{{ username | base64 }}"
 | 
			
		||||
  password: "{{ password | base64 }}"
 | 
			
		||||
  username: "{{ username }}"
 | 
			
		||||
  password: "{{ password }}"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user