Skip to content

Commit aaf5d2b

Browse files
Rakshitha-Kamathandrewschoen
authored andcommitted
Fix all the violations and warnings
Signed-off-by: Rakshitha-Kamath <[email protected]>
1 parent 376631b commit aaf5d2b

File tree

7 files changed

+3770
-20
lines changed

7 files changed

+3770
-20
lines changed

.tekton/grafana-9-0-pull-request.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ spec:
2424
value: '{{revision}}'
2525
- name: output-image
2626
value: quay.io/rhceph-ci/grafana:on-pr-{{revision}}
27-
- name: image-expires-after
28-
value: 5d
2927
- name: build-platforms
3028
value:
3129
- linux/x86_64
@@ -83,19 +81,19 @@ spec:
8381
description: Skip checks against built image
8482
name: skip-checks
8583
type: string
86-
- default: "false"
84+
- default: "true"
8785
description: Execute the build with network isolation
8886
name: hermetic
8987
type: string
90-
- default: ""
88+
- default: '[{"type": "gomod", "path": "."}, {"type": "rpm", "path": "."}]'
9189
description: Build dependencies to be prefetched by Cachi2
9290
name: prefetch-input
9391
type: string
9492
- default: ""
9593
description: Image tag expiration time, time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.
9694
name: image-expires-after
9795
type: string
98-
- default: "false"
96+
- default: "true"
9997
description: Build a source image.
10098
name: build-source-image
10199
type: string
@@ -190,6 +188,8 @@ spec:
190188
value: $(params.output-image).prefetch
191189
- name: ociArtifactExpiresAfter
192190
value: $(params.image-expires-after)
191+
- name: ACTIVATION_KEY
192+
value: rkamath-activation-key
193193
runAfter:
194194
- clone-repository
195195
taskRef:
@@ -561,6 +561,11 @@ spec:
561561
value: $(tasks.build-image-index.results.IMAGE_URL)
562562
- name: IMAGE_DIGEST
563563
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
564+
- name: ADDITIONAL_TAGS
565+
value:
566+
- "pull-request-{{pull_request_number}}"
567+
- "from-branch-{{source_branch}}"
568+
- "{{target_branch}}-$(tasks.clone-repository.results.commit-timestamp)"
564569
runAfter:
565570
- build-image-index
566571
taskRef:

.tekton/grafana-9-0-push.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,19 @@ spec:
8080
description: Skip checks against built image
8181
name: skip-checks
8282
type: string
83-
- default: "false"
83+
- default: "true"
8484
description: Execute the build with network isolation
8585
name: hermetic
8686
type: string
87-
- default: ""
87+
- default: '[{"type": "gomod", "path": "."}, {"type": "rpm", "path": "."}]'
8888
description: Build dependencies to be prefetched by Cachi2
8989
name: prefetch-input
9090
type: string
9191
- default: ""
9292
description: Image tag expiration time, time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.
9393
name: image-expires-after
9494
type: string
95-
- default: "false"
95+
- default: "true"
9696
description: Build a source image.
9797
name: build-source-image
9898
type: string

Dockerfile

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Build stage 1
22

3-
#FROM brew.registry.redhat.io/rh-osbs/openshift/golang-builder:rhel_9_golang_1.23 AS builder
4-
FROM quay.io/projectquay/golang:1.24 AS builder
3+
ARG BASE_IMAGE=brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.24
4+
5+
FROM ${BASE_IMAGE} AS builder
56

67
COPY grafana grafana
78

@@ -12,7 +13,8 @@ ENV GOFLAGS="-mod=vendor"
1213
RUN go run -mod vendor build.go -dev build
1314

1415
# Build stage 2
15-
FROM registry.redhat.io/ubi10/ubi-minimal:latest
16+
#FROM registry.redhat.io/ubi10/ubi-minimal:latest
17+
FROM registry.access.redhat.com/ubi10-minimal:latest
1618

1719
# Update the image to get the latest CVE updates
1820
RUN microdnf update -y
@@ -26,17 +28,17 @@ ENV PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bi
2628
GF_PATHS_PROVISIONING="/etc/grafana/provisioning"
2729

2830
RUN rm -rf $GF_PATHS_HOME && mkdir -p $GF_PATHS_HOME
29-
COPY --from=builder go/grafana/bin/grafana /usr/bin/grafana
30-
COPY --from=builder go/grafana/bin/grafana-server /usr/bin/grafana-server
31-
COPY --from=builder go/grafana/bin/grafana-cli /usr/bin/grafana-cli
32-
COPY --from=builder go/grafana/conf $GF_PATHS_HOME/conf/
33-
COPY --from=builder go/grafana/docs $GF_PATHS_HOME/docs/
34-
COPY --from=builder go/grafana/public $GF_PATHS_HOME/public/
35-
COPY --from=builder go/grafana/scripts $GF_PATHS_HOME/scripts/
31+
COPY --from=builder /grafana/pkg/cmd/grafana /usr/bin/grafana
32+
COPY --from=builder /grafana/pkg/cmd/grafana-server /usr/bin/grafana-server
33+
COPY --from=builder /grafana/pkg/cmd/grafana-cli /usr/bin/grafana-cli
34+
COPY --from=builder /grafana/conf $GF_PATHS_HOME/conf/
35+
COPY --from=builder /grafana/docs $GF_PATHS_HOME/docs/
36+
COPY --from=builder /grafana/public $GF_PATHS_HOME/public/
37+
COPY --from=builder /grafana/scripts $GF_PATHS_HOME/scripts/
3638

3739
RUN rm -rf /etc/grafana && mkdir -p /etc/grafana
38-
COPY --from=builder go/grafana/conf/sample.ini $GF_PATHS_CONFIG
39-
COPY --from=builder go/grafana/conf/ldap.toml /etc/grafana/ldap.toml
40+
COPY --from=builder /grafana/conf/sample.ini $GF_PATHS_CONFIG
41+
COPY --from=builder /grafana/conf/ldap.toml /etc/grafana/ldap.toml
4042
COPY ./run.sh /run.sh
4143

4244
# Create grafana user/group
@@ -72,4 +74,8 @@ LABEL name="grafana"
7274
LABEL description="Red Hat Ceph Storage Grafana container"
7375
LABEL summary="Grafana container on RHEL 9 for Red Hat Ceph Storage"
7476
LABEL io.k8s.display-name="Grafana on RHEL 9"
77+
LABEL io.k8s.description="grafana-container"
7578
LABEL io.openshift.tags="rhceph ceph dashboard grafana"
79+
LABEL cpe=cpe:/a:redhat:ceph_storage:9::el10
80+
LABEL org.opencontainers.image.created="${BUILD_DATE}"
81+

0 commit comments

Comments
 (0)