diff --git a/Dockerfile b/Dockerfile index b03175562..81486cf83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,12 +7,11 @@ RUN git clone https://github.com/konveyor/tackle2-seed FROM quay.io/konveyor/static-report as report FROM registry.access.redhat.com/ubi9/ubi-minimal -ENV REPORT_BUNDLE_PATH=/report COPY --from=builder /opt/app-root/src/bin/hub /usr/local/bin/tackle-hub COPY --from=builder /opt/app-root/src/auth/roles.yaml /tmp/roles.yaml COPY --from=builder /opt/app-root/src/auth/users.yaml /tmp/users.yaml COPY --from=builder /opt/app-root/src/tackle2-seed/resources/ /tmp/seed -COPY --from=report /usr/local/static-report $REPORT_BUNDLE_PATH +COPY --from=report /usr/local/static-report /tmp/report RUN microdnf -y install \ sqlite \ diff --git a/api/analysis.go b/api/analysis.go index 07fd93001..1b00ac6d9 100644 --- a/api/analysis.go +++ b/api/analysis.go @@ -146,12 +146,11 @@ func (h AnalysisHandler) AppLatest(ctx *gin.Context) { defer func() { _ = os.Remove(path) }() - bundle := Settings.ReportBundle.Path tarWriter := tar.NewWriter(ctx.Writer) defer func() { tarWriter.Close() }() - err = tarWriter.AssertDir(bundle) + err = tarWriter.AssertDir(Settings.Report.Path) if err != nil { _ = ctx.Error(err) return @@ -163,7 +162,7 @@ func (h AnalysisHandler) AppLatest(ctx *gin.Context) { } h.Attachment(ctx, fmt.Sprintf("%s.tar.gz", m.Application.Name)) ctx.Status(http.StatusOK) - _ = tarWriter.AddDir(bundle) + _ = tarWriter.AddDir(Settings.Report.Path) _ = tarWriter.AddFile(path, "output.js") } else { writer := AnalysisWriter{ctx: ctx} diff --git a/settings/hub.go b/settings/hub.go index 0f2df11f6..ab27bde8f 100644 --- a/settings/hub.go +++ b/settings/hub.go @@ -26,7 +26,7 @@ const ( EnvFileTTL = "FILE_TTL" EnvAppName = "APP_NAME" EnvDisconnected = "DISCONNECTED" - EnvStaticReportPath = "REPORT_BUNDLE_PATH" + EnvReportPath = "REPORT_PATH" ) type Hub struct { @@ -78,8 +78,8 @@ type Hub struct { Product bool // Disconnected indicates no cluster. Disconnected bool - // ReportBundle settings. - ReportBundle struct { + // Report settings. + Report struct { Path string } } @@ -195,9 +195,9 @@ func (r *Hub) Load() (err error) { b, _ := strconv.ParseBool(s) r.Disconnected = b } - r.ReportBundle.Path, found = os.LookupEnv(EnvStaticReportPath) + r.Report.Path, found = os.LookupEnv(EnvReportPath) if !found { - r.ReportBundle.Path = "/tmp/static-report" + r.Report.Path = "/tmp/report" } return