Skip to content

Commit dd250ff

Browse files
authored
sync: stage to production (#1628)
sync-branches: New code has just landed in stage, so let's bring production up to speed!
2 parents af55666 + 277c34e commit dd250ff

File tree

108 files changed

+1862
-1431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1862
-1431
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
```
2121
# To run tests locally run:
2222
make db/teardown db/setup db/migrate
23-
make ocm/setup OCM_OFFLINE_TOKEN=<ocm-offline-token> OCM_ENV=development
23+
make ocm/setup
2424
make verify lint binary test test/integration
2525
```

.github/workflows/ci.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ jobs:
5454
name: "Verify & Test"
5555
runs-on: ubuntu-latest
5656
env:
57-
# TODO make sure that the secrets are configured for your repository
5857
OCM_ENV: integration
59-
E2E: "true"
6058
# Dummy SSO variables
6159
SSO_CLIENT_ID: ${{ secrets.SSO_CLIENT_ID }}
6260
SSO_CLIENT_SECRET: ${{ secrets.SSO_CLIENT_SECRET }}
@@ -71,8 +69,6 @@ jobs:
7169
# Dummy Central TLS env variables
7270
CENTRAL_TLS_CERT: central_tls_cert # pragma: allowlist secret - dummy value
7371
CENTRAL_TLS_KEY: central_tls_key # pragma: allowlist secret - dummy value
74-
# So that OCM secrets are initialised
75-
DOCKER_PR_CHECK: true
7672
TEST_TIMEOUT: 30m
7773
services:
7874
postgres:
@@ -108,6 +104,15 @@ jobs:
108104
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
109105
restore-keys: |
110106
${{ runner.os }}-go-
107+
- name: Go mod tidy
108+
run: |
109+
go mod tidy
110+
- name: Clean and generate files
111+
run: |
112+
make clean/go-generated && make generate
113+
- name: Test that there were no changes
114+
run: |
115+
git diff --exit-code
111116
- name: Setup tests secrets
112117
run: |
113118
make ocm/setup aws/setup redhatsso/setup centralcert/setup observatorium/setup secrets/touch
@@ -118,7 +123,7 @@ jobs:
118123
GOPATH=$(go env GOPATH)
119124
export GOPATH
120125
export PATH=${PATH}:$GOPATH/bin
121-
make verify binary test
126+
make verify binary test test/integration
122127
timeout-minutes: 14
123128
build-push-images:
124129
name: "Build and push fleet* images to quay.io"
@@ -138,6 +143,8 @@ jobs:
138143
uses: actions/checkout@v2
139144
with:
140145
fetch-depth: 0 # Critical for correct image detection in Makefile
146+
- name: Set up Docker Buildx
147+
uses: docker/setup-buildx-action@v3
141148
- name: Build and push fleet-manager-tools image to quay.io
142149
if: github.event_name == 'push'
143150
env:
@@ -146,4 +153,4 @@ jobs:
146153
- name: Build and push fleetshard-operator image to quay.io
147154
run: make image/push/fleetshard-operator
148155
- name: Build and push fleet-manager image to quay.io
149-
run: make image/push/fleet-manager
156+
run: make image/push/fleet-manager IMAGE_PLATFORM=linux/amd64,linux/arm64

.golangci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ linters-settings:
4242
includes:
4343
- G601
4444
revive:
45-
min-confidence: 0
4645
rules:
4746
- name: blank-imports
4847
- name: context-as-argument
@@ -87,14 +86,13 @@ linters-settings:
8786
enabled-checks:
8887
- commentFormatting
8988
nolintlint:
90-
allow-leading-space: false # require machine-readable nolint directives (i.e. with no leading space)
9189
allow-unused: false # report any unused nolint directives
9290
require-explanation: false # don't require an explanation for nolint directives
9391
require-specific: true # require nolint directives to be specific about which linter is being skipped
9492
staticcheck:
9593
go: "1.20"
9694
checks: [ all,-ST1000,-ST1001,-ST1003,-ST1005,-SA1019,-SA4001,-ST1016 ]
97-
wrapcheck:
95+
wrapcheck: {}
9896
# ignoreSigRegexps: uncomment to add ignore rules
9997

10098
linters:
@@ -114,6 +112,7 @@ linters:
114112
# - gochecknoinits
115113
# - gocognit
116114
# - goconst
115+
- ginkgolinter
117116
- exportloopref
118117
- gocritic
119118
# - gocyclo
@@ -146,7 +145,7 @@ linters:
146145
# - typecheck
147146
# - unconvert
148147
# - unparam
149-
# - unused
148+
- unused
150149
# - varcheck
151150
# - whitespace
152151
- wrapcheck

.openshift-ci/e2e-runtime/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ COPY --from=quay.io/operator-framework/operator-sdk:v1.25 /usr/local/bin/operato
1111

1212
ENV GOPATH=/go
1313
ENV GOROOT=/usr/local/go
14-
ENV PATH="/usr/local/go/bin:${PATH}"
14+
ENV PATH="${GOROOT}/bin:${PATH}"
1515

1616
RUN ln -s /usr/bin/oc /usr/bin/kubectl
1717

.openshift-ci/e2e-runtime/e2e_dockerized.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ AWS_SESSION_TOKEN=$(aws configure get aws_session_token --profile=saml)
2222
FLEET_MANAGER_IMAGE=$(make -s -C "$GITROOT" full-image-tag)
2323

2424
# Run the necessary docker actions out of the container
25-
preload_dependency_images
2625
ensure_fleet_manager_image_exists
2726

2827
docker build -t acscs-e2e -f "$GITROOT/.openshift-ci/e2e-runtime/Dockerfile" "${GITROOT}"

.openshift-ci/tests/e2e-test.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ fi
1919
up.sh
2020

2121
log "Environment up and running"
22-
log "Waiting for fleet-manager to complete leader election..."
23-
# Don't have a better way yet to wait until fleet-manager has completed the leader election.
24-
$KUBECTL -n "$ACSCS_NAMESPACE" logs -l application=fleet-manager -c fleet-manager -f --tail=-1 |
25-
grep -q --line-buffered --max-count=1 'started leading' || true
26-
sleep 1
2722

2823
FAIL=0
2924
if [[ "$SKIP_TESTS" == "true" ]]; then

.secrets.baseline

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
"filename": "e2e/e2e_test.go",
334334
"hashed_secret": "7f38822bc2b03e97325ff310099f457f6f788daf",
335335
"is_verified": false,
336-
"line_number": 267
336+
"line_number": 268
337337
}
338338
],
339339
"fleetshard/pkg/central/cloudprovider/dbclient_moq.go": [
@@ -370,27 +370,27 @@
370370
"line_number": 983
371371
}
372372
],
373-
"pkg/client/fleetmanager/api_moq.go": [
373+
"pkg/client/fleetmanager/mocks/client_moq.go": [
374374
{
375375
"type": "Secret Keyword",
376-
"filename": "pkg/client/fleetmanager/api_moq.go",
376+
"filename": "pkg/client/fleetmanager/mocks/client_moq.go",
377377
"hashed_secret": "44e17306b837162269a410204daaa5ecee4ec22c",
378378
"is_verified": false,
379-
"line_number": 583
379+
"line_number": 584
380380
},
381381
{
382382
"type": "Secret Keyword",
383-
"filename": "pkg/client/fleetmanager/api_moq.go",
383+
"filename": "pkg/client/fleetmanager/mocks/client_moq.go",
384384
"hashed_secret": "0ff50155b4f57adeccae93f27dc23efe2a8b7824",
385385
"is_verified": false,
386-
"line_number": 584
386+
"line_number": 585
387387
},
388388
{
389389
"type": "Secret Keyword",
390-
"filename": "pkg/client/fleetmanager/api_moq.go",
390+
"filename": "pkg/client/fleetmanager/mocks/client_moq.go",
391391
"hashed_secret": "5ce1b8d4fb9dae5c02b2017e39e7267a21cea37f",
392392
"is_verified": false,
393-
"line_number": 593
393+
"line_number": 594
394394
}
395395
],
396396
"pkg/client/iam/client_moq.go": [
@@ -493,70 +493,70 @@
493493
"filename": "templates/service-template.yml",
494494
"hashed_secret": "13032f402fed753c2248419ea4f69f99931f6dbc",
495495
"is_verified": false,
496-
"line_number": 522
496+
"line_number": 524
497497
},
498498
{
499499
"type": "Base64 High Entropy String",
500500
"filename": "templates/service-template.yml",
501501
"hashed_secret": "30025f80f6e22cdafb85db387d50f90ea884576a",
502502
"is_verified": false,
503-
"line_number": 522
503+
"line_number": 524
504504
},
505505
{
506506
"type": "Base64 High Entropy String",
507507
"filename": "templates/service-template.yml",
508508
"hashed_secret": "355f24fd038bcaf85617abdcaa64af51ed19bbcf",
509509
"is_verified": false,
510-
"line_number": 522
510+
"line_number": 524
511511
},
512512
{
513513
"type": "Base64 High Entropy String",
514514
"filename": "templates/service-template.yml",
515515
"hashed_secret": "3d8a1dcd2c3c765ce35c9a9552d23273cc4ddace",
516516
"is_verified": false,
517-
"line_number": 522
517+
"line_number": 524
518518
},
519519
{
520520
"type": "Base64 High Entropy String",
521521
"filename": "templates/service-template.yml",
522522
"hashed_secret": "4ac7b0522761eba972467942cd5cd7499dd2c361",
523523
"is_verified": false,
524-
"line_number": 522
524+
"line_number": 524
525525
},
526526
{
527527
"type": "Base64 High Entropy String",
528528
"filename": "templates/service-template.yml",
529529
"hashed_secret": "7639ab2a6bcf2ea30a055a99468c9cd844d4c22a",
530530
"is_verified": false,
531-
"line_number": 522
531+
"line_number": 524
532532
},
533533
{
534534
"type": "Base64 High Entropy String",
535535
"filename": "templates/service-template.yml",
536536
"hashed_secret": "b56360daf4793d2a74991a972b34d95bc00fb2da",
537537
"is_verified": false,
538-
"line_number": 522
538+
"line_number": 524
539539
},
540540
{
541541
"type": "Base64 High Entropy String",
542542
"filename": "templates/service-template.yml",
543543
"hashed_secret": "c9a73ef9ee8ce9f38437227801c70bcc6740d1a1",
544544
"is_verified": false,
545-
"line_number": 522
545+
"line_number": 524
546546
},
547547
{
548548
"type": "Base64 High Entropy String",
549549
"filename": "templates/service-template.yml",
550550
"hashed_secret": "14736999d9940728c5294277831a702f7882dece",
551551
"is_verified": false,
552-
"line_number": 559
552+
"line_number": 561
553553
},
554554
{
555555
"type": "Secret Keyword",
556556
"filename": "templates/service-template.yml",
557557
"hashed_secret": "4e199b4a1c40b497a95fcd1cd896351733849949",
558558
"is_verified": false,
559-
"line_number": 706,
559+
"line_number": 708,
560560
"is_secret": false
561561
}
562562
],
@@ -586,5 +586,5 @@
586586
}
587587
]
588588
},
589-
"generated_at": "2024-01-17T10:24:51Z"
589+
"generated_at": "2024-01-25T17:36:32Z"
590590
}

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
FROM registry.ci.openshift.org/openshift/release:golang-1.20 AS build
1+
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.20 AS build
22

3+
USER root
34
RUN mkdir /src /rds_ca
45
ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /rds_ca/aws-rds-ca-global-bundle.pem
5-
66
WORKDIR /src
7+
8+
RUN go env -w GOCACHE=/go/.cache; \
9+
go env -w GOMODCACHE=/go/pkg/mod
10+
711
RUN --mount=type=cache,target=/go/pkg/mod/ \
812
--mount=type=bind,source=go.sum,target=go.sum \
913
--mount=type=bind,source=go.mod,target=go.mod \
1014
go mod download -x
1115

1216
COPY . ./
1317

14-
ARG GOARCH
18+
ARG TARGETARCH
1519

1620
RUN --mount=type=cache,target=/go/pkg/mod/ \
1721
--mount=type=cache,target=/go/.cache/ \
18-
make binary GOOS=linux GOARCH=${GOARCH}
22+
make binary GOOS=linux GOARCH=${TARGETARCH}
1923

2024
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9 as standard
2125

Dockerfile.tools

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
FROM registry.ci.openshift.org/openshift/release:golang-1.20 AS build
2-
1+
FROM registry.access.redhat.com/ubi8/go-toolset:1.20 AS build
2+
USER root
33
RUN mkdir /src
44
WORKDIR /src
55
COPY . ./

0 commit comments

Comments
 (0)