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

Removing cert keys from cm #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
10 changes: 0 additions & 10 deletions chart/dapr-shared/templates/_daemondeployshared.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,6 @@
configMapKeyRef:
name: {{ .Release.Name }}-shared-cm
key: dapr-trust-anchors
- name: DAPR_CERT_CHAIN
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-shared-cm
key: dapr-cert-chain
- name: DAPR_CERT_KEY
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-shared-cm
key: dapr-cert-key
- name: DAPR_CONTROL_PLANE_NAMESPACE
value: {{ default "dapr-system" .Values.shared.controlPlane.namespace }}
- name: DAPR_API_TOKEN
Expand Down
20 changes: 8 additions & 12 deletions cmd/shared-init/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ import (
)

const (
daprTrustAnchorsConfigMapKey string = "dapr-trust-anchors"
daprTrustCertChainConfigMapKey string = "dapr-cert-chain"
daprTrustCertKeyConfigMapKey string = "dapr-cert-key"
namespaceDefault string = "default"
DaprSystemNamespace string = "dapr-system"
DaprControlPlaneNamespace string = "DAPR_CONTROL_PLANE_NAMESPACE"
DaprSharedInstanceNamespace string = "DAPR_SHARED_INSTANCE_NAMESPACE"
namespaceFilePath = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"
daprTrustAnchorsConfigMapKey string = "dapr-trust-anchors"
namespaceDefault string = "default"
DaprSystemNamespace string = "dapr-system"
DaprControlPlaneNamespace string = "DAPR_CONTROL_PLANE_NAMESPACE"
DaprSharedInstanceNamespace string = "DAPR_SHARED_INSTANCE_NAMESPACE"
namespaceFilePath = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"
)

var configMapName string
Expand Down Expand Up @@ -98,7 +96,7 @@ func InitHandler() {

c := NewDaprSidecarClient(kubeClient)

rootCert, certChain, certKey := c.Get(ctx, LookupEnvOrString(DaprControlPlaneNamespace, DaprSystemNamespace))
rootCert, _, _ := c.Get(ctx, LookupEnvOrString(DaprControlPlaneNamespace, DaprSystemNamespace))

namespace := getNamespace()
configMap := &corev1.ConfigMap{
Expand All @@ -107,9 +105,7 @@ func InitHandler() {
Namespace: namespace,
},
Data: map[string]string{
daprTrustAnchorsConfigMapKey: rootCert,
daprTrustCertChainConfigMapKey: certChain,
daprTrustCertKeyConfigMapKey: certKey,
daprTrustAnchorsConfigMapKey: rootCert,
},
}

Expand Down
Loading