MCPcopy Create free account
hub / github.com/encoder-run/operator / PostgresSecretInputToCRD

Function PostgresSecretInputToCRD

pkg/graph/converters/storage.go:94–111  ·  view source on GitHub ↗
(storageCRD *v1alpha1.Storage, input *model.PostgresInput)

Source from the content-addressed store, hash-verified

92}
93
94func PostgresSecretInputToCRD(storageCRD *v1alpha1.Storage, input *model.PostgresInput) (*corev1.Secret, error) {
95 secretCRD := &corev1.Secret{
96 ObjectMeta: v1.ObjectMeta{
97 Name: storageCRD.Name,
98 Namespace: storageCRD.Namespace,
99 },
100 }
101 secretCRD.StringData = map[string]string{
102 "host": input.Host,
103 "port": fmt.Sprintf("%d", input.Port),
104 "database": input.Database,
105 "username": input.Username,
106 "password": input.Password,
107 "ssl_mode": input.SSLMode,
108 "timezone": input.Timezone,
109 }
110 return secretCRD, nil
111}

Callers 1

AddFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected