Skip to content

Commit

Permalink
Remove HAS controllers (#481)
Browse files Browse the repository at this point in the history
* Remove HAS controllers

Signed-off-by: John Collier <[email protected]>

* Update dockerfile

Signed-off-by: John Collier <[email protected]>

* Fix tests

Signed-off-by: John Collier <[email protected]>

* Fix tests

Signed-off-by: John Collier <[email protected]>

* Fix entrypoint

Signed-off-by: John Collier <[email protected]>

---------

Signed-off-by: John Collier <[email protected]>
  • Loading branch information
johnmcollier authored Jun 8, 2024
1 parent bda93f1 commit 338ad7f
Show file tree
Hide file tree
Showing 94 changed files with 11 additions and 23,646 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/build-cdq-analysis-image.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .github/workflows/pact_postmerge.yml

This file was deleted.

70 changes: 0 additions & 70 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,76 +127,6 @@ jobs:
fetch-depth: 0
- name: Check if dockerimage build is working
run: docker build -f ./Dockerfile .
build-cdq-analysis-image:
name: Check CDQ Analysis Image Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Change to the cdq-analysis directory
run: cd cdq-analysis/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Check if dockerimage build is working
run: docker build -f ./Dockerfile .
pact:
name: Pact tests
runs-on: ubuntu-latest
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
PR_CHECK: true
OPERATOR_SDK_VERSION: v1.14.0
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Operator SDK ${{ env.OPERATOR_SDK_VERSION }}
uses: actions/cache@v2
id: cache-operator-sdk
with:
path: ~/cache
key: operator-sdk-${{ env.OPERATOR_SDK_VERSION }}
- name: Download Operator SDK ${{ env.OPERATOR_SDK_VERSION }}
if: steps.cache-operator-sdk.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache
wget https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk_linux_amd64 -O ~/cache/operator-sdk-${OPERATOR_SDK_VERSION} > /dev/null -O ~/cache/operator-sdk-${OPERATOR_SDK_VERSION} > /dev/null
chmod +x ~/cache/operator-sdk-${OPERATOR_SDK_VERSION}
- name: Install Operator SDK ${{ env.OPERATOR_SDK_VERSION }}
run: |
mkdir -p ~/bin
cp ~/cache/operator-sdk-${OPERATOR_SDK_VERSION} ~/bin/operator-sdk
echo "$HOME/bin" >> $GITHUB_PATH
- name: Cache go modules
id: cache-mod
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
if: steps.cache-mod.outputs.cache-hit != 'true'
- name: Test Pact contracts
run: |
go get github.com/pact-foundation/pact-go/[email protected]
go install github.com/pact-foundation/pact-go/[email protected]
sudo /home/runner/go/bin/pact-go -l DEBUG install
COMMIT_SHA=${COMMIT_SHA:0:7}
make pact
kube-linter:
runs-on: ubuntu-latest
steps:
Expand Down
30 changes: 0 additions & 30 deletions .tekton/push-cdq-analysis.yaml

This file was deleted.

15 changes: 1 addition & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,19 @@ WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
COPY cdq-analysis/ cdq-analysis/
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# Copy the go source
COPY main.go main.go
# ToDo: Uncomment once API added
COPY controllers/ controllers/
COPY webhooks/ webhooks/
COPY pkg pkg/
COPY gitops gitops/

# Build
RUN CGO_ENABLED=0 GOOS=linux go build -a -o manager main.go

# Build the tini binary
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9 as tini-builder
RUN microdnf update --setopt=install_weak_deps=0 -y && microdnf install git cmake make gcc gcc-c++
# build tini
RUN git clone --branch v0.19.0 https://github.com/krallin/tini /tini
WORKDIR /tini
ENV CFLAGS="-DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"
RUN cmake . && make tini

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9
RUN microdnf update --setopt=install_weak_deps=0 -y && microdnf install git
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
Expand All @@ -48,8 +37,6 @@ COPY --from=builder /workspace/manager .
COPY appdata.gitconfig /.gitconfig
RUN chgrp -R 0 /.gitconfig && chmod -R g=u /.gitconfig

# copy tini
COPY --from=tini-builder /tini/tini /usr/bin
WORKDIR /

USER 1001
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ lint:
unit-tests:
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" SKIP_PACT_TESTS=true go test ./... -coverprofile cover.out -v

cdq-analysis-unit-tests:
cd ./cdq-analysis && go test ./... -coverprofile cover.out -v

pact-tests:
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -v --run TestContracts

Expand All @@ -159,7 +156,6 @@ pact: manifests generate fmt vet envtest ## Run just Pact tests.
test: manifests generate fmt vet envtest ## Run tests.
make unit-tests
make pact-tests
make cdq-analysis-unit-tests

##@ Build

Expand Down
24 changes: 0 additions & 24 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,4 @@ plugins:
scorecard.sdk.operatorframework.io/v2: {}
projectName: application-service
repo: github.com/redhat-appstudio/application-service
resources:
- controller: true
domain: redhat.com
group: appstudio
kind: Application
version: v1alpha1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
- controller: true
domain: redhat.com
group: appstudio
kind: Component
version: v1alpha1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
- controller: true
domain: redhat.com
group: appstudio
kind: ComponentDetectionQuery
version: v1alpha1
version: "3"
27 changes: 0 additions & 27 deletions cdq-analysis/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions cdq-analysis/entrypoint.sh

This file was deleted.

Loading

0 comments on commit 338ad7f

Please sign in to comment.