diff --git a/pkg/registry/deployment.go b/pkg/registry/deployment.go index edc97e0..13cd8aa 100644 --- a/pkg/registry/deployment.go +++ b/pkg/registry/deployment.go @@ -17,6 +17,8 @@ limitations under the License. package registry import ( + "fmt" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -213,11 +215,22 @@ func GenerateDeployment(cr *registryv1alpha1.DevfileRegistry, scheme *runtime.Sc }, }, }, + Env: []corev1.EnvVar{ + { + Name: "ANALYTICS_WRITE_KEY", + Value: cr.Spec.Telemetry.RegistryViewerWriteKey, + }, + { + Name: "DEVFILE_REGISTRIES", + Value: fmt.Sprintf("[{\"name\":\"Community\",\"url\":\"http://localhost:8080\",\"fqdn\":\"%s\"}]", + cr.Status.URL), + }, + }, VolumeMounts: []corev1.VolumeMount{ { Name: "viewer-env-file", - MountPath: "/app/apps/registry-viewer/.env.local", - SubPath: ".env.local", + MountPath: "/app/.env.production", + SubPath: ".env.production", }, }, }) @@ -231,7 +244,7 @@ func GenerateDeployment(cr *registryv1alpha1.DevfileRegistry, scheme *runtime.Sc Items: []corev1.KeyToPath{ { Key: ".env.registry-viewer", - Path: ".env.local", + Path: ".env.production", }, }, },