Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/component_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Component tests

on:
pull_request:
branches:
- main
- 'release-*'
paths-ignore:
- 'docs/**'
- '**.adoc'
- '**.md'
- 'LICENSE'
push:
branches:
- main
- 'release-*'
paths-ignore:
- 'docs/**'
- '**.adoc'
- '**.md'
- 'LICENSE'

concurrency:
group: ${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
kubernetes-component:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Checkout common repo code
uses: actions/checkout@v4
with:
repository: 'project-codeflare/codeflare-common'
ref: 'main'
path: 'common'

- name: Set Go
uses: actions/setup-go@v3
with:
go-version: v1.20

- name: Setup and start KinD cluster
uses: ./common/github-actions/kind

- name: Run component tests
run: |
export USE_EXISTING_CLUSTER=true
export CODEFLARE_TEST_OUTPUT_DIR=${{ env.TEMP_DIR }}
echo "CODEFLARE_TEST_OUTPUT_DIR=${CODEFLARE_TEST_OUTPUT_DIR}" >> $GITHUB_ENV

set -euo pipefail
# Install Ginkgo
go install github.com/onsi/ginkgo/v2/ginkgo

ginkgo -v ./controllers/ | tee ${CODEFLARE_TEST_OUTPUT_DIR}/gotest.log

- name: Export all KinD pod logs
uses: ./common/github-actions/kind-export-logs
if: always() && steps.deploy.outcome == 'success'
with:
output-directory: ${CODEFLARE_TEST_OUTPUT_DIR}

- name: Upload logs
uses: actions/upload-artifact@v3
if: always() && steps.deploy.outcome == 'success'
with:
name: logs
retention-days: 10
path: |
${{ env.CODEFLARE_TEST_OUTPUT_DIR }}/**/*.log
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN go mod download
# Copy the Go sources
COPY main.go main.go
COPY pkg/ pkg/
COPY controllers/ controllers/

# Build
USER root
Expand Down
10 changes: 10 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: codeflare.dev
layout:
- go.kubebuilder.io/v3
Expand All @@ -6,4 +10,10 @@ plugins:
scorecard.sdk.operatorframework.io/v2: {}
projectName: codeflare-operator
repo: github.com/project-codeflare/codeflare-operator
resources:
- controller: true
domain: codeflare.dev
group: ray
kind: RayCluster
version: v1
version: "3"
44 changes: 44 additions & 0 deletions config/crd/test/crd-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
# name must match the spec fields below, and be in the form: <plural>.<group>
name: routes.route.openshift.io
spec:
# group name to use for REST API: /apis/<group>/<version>
group: route.openshift.io
# list of versions supported by this CustomResourceDefinition
versions:
- name: v1
# Each version can be enabled/disabled by Served flag.
served: true
# One and only one version must be marked as the storage version.
storage: true
schema:
openAPIV3Schema:
type: object
x-kubernetes-preserve-unknown-fields: true
additionalPrinterColumns:
- name: Host
type: string
jsonPath: .status.ingress[0].host
- name: Admitted
type: string
jsonPath: .status.ingress[0].conditions[?(@.type=="Admitted")].status
- name: Service
type: string
jsonPath: .spec.to.name
- name: TLS
type: string
jsonPath: .spec.tls.type
subresources:
# enable spec/status
status: {}
# either Namespaced or Cluster
scope: Namespaced
names:
# plural name to be used in the URL: /apis/<group>/<version>/<plural>
plural: routes
# singular name to be used as an alias on the CLI and for display
singular: route
# kind is normally the CamelCased singular type. Your resource manifests use this.
kind: Route
Loading