Skip to content

Commit

Permalink
proper setting of environment variables for the registry viewer deplo…
Browse files Browse the repository at this point in the history
…yment.

Signed-off-by: Michael Valdron <mvaldron@redhat.com>
  • Loading branch information
michael-valdron committed Jan 31, 2023
1 parent cde0f16 commit d55f7d4
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions pkg/registry/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
},
},
})
Expand All @@ -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",
},
},
},
Expand Down

0 comments on commit d55f7d4

Please sign in to comment.