Skip to content
Merged
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
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
BUNDLE_IMAGE_NAME: ${{ github.repository }}-bundle

jobs:
build-push-release:
Expand Down Expand Up @@ -137,6 +138,47 @@ jobs:

mv dist/install.yaml func-operator.yaml

- name: Generate bundle manifests
run: |
# Use digest from whichever build step ran (latest or non-latest)
if [ "${{ steps.version.outputs.is_latest }}" == "true" ]; then
IMAGE_DIGEST="${{ steps.build_latest.outputs.digest }}"
else
IMAGE_DIGEST="${{ steps.build_non_latest.outputs.digest }}"
fi

make bundle \
IMG=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${IMAGE_DIGEST} \
VERSION=${{ steps.version.outputs.full }} \
USE_IMAGE_DIGESTS=true

- name: Build and push bundle image (latest version)
if: steps.version.outputs.is_latest == 'true'
uses: docker/build-push-action@v6
with:
context: .
file: bundle.Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.BUNDLE_IMAGE_NAME }}:v${{ steps.version.outputs.full }}
${{ env.REGISTRY }}/${{ env.BUNDLE_IMAGE_NAME }}:v${{ steps.version.outputs.major_minor }}
${{ env.REGISTRY }}/${{ env.BUNDLE_IMAGE_NAME }}:v${{ steps.version.outputs.major }}
${{ env.REGISTRY }}/${{ env.BUNDLE_IMAGE_NAME }}:latest

- name: Build and push bundle image (non-latest version)
if: steps.version.outputs.is_latest == 'false'
uses: docker/build-push-action@v6
with:
context: .
file: bundle.Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.BUNDLE_IMAGE_NAME }}:v${{ steps.version.outputs.full }}
${{ env.REGISTRY }}/${{ env.BUNDLE_IMAGE_NAME }}:v${{ steps.version.outputs.major_minor }}
${{ env.REGISTRY }}/${{ env.BUNDLE_IMAGE_NAME }}:v${{ steps.version.outputs.major }}

- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
47 changes: 47 additions & 0 deletions config/manifests/bases/func-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
annotations:
alm-examples: '[]'
capabilities: Basic Install
name: func-operator.v0.0.0
namespace: placeholder
spec:
apiservicedefinitions: {}
customresourcedefinitions:
owned:
- description: Function is the Schema for the functions API.
displayName: Function
kind: Function
name: functions.functions.dev
version: v1alpha1
description: Operator for serverless functions
displayName: Functions Operator
icon:
- base64data: ""
mediatype: ""
install:
spec:
deployments: null
strategy: ""
installModes:
- supported: false
type: OwnNamespace
- supported: false
type: SingleNamespace
- supported: false
type: MultiNamespace
- supported: true
type: AllNamespaces
keywords:
- faas
links:
- name: Func Operator
url: https://func-operator.domain
maintainers:
- email: email@example.com
name: creydr
maturity: alpha
provider:
name: knative
version: 0.0.0
1 change: 0 additions & 1 deletion config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
## Append samples of your project ##
resources:
- v1alpha1_function.yaml
- _v1alpha1_function.yaml
# +kubebuilder:scaffold:manifestskustomizesamples
10 changes: 9 additions & 1 deletion config/samples/v1alpha1_function.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@ metadata:
app.kubernetes.io/name: func-operator
app.kubernetes.io/managed-by: kustomize
name: function-sample
namespace: default
spec:
# TODO(user): Add fields here
source:
repositoryUrl: https://github.com/your-org/your-function.git
authSecretRef:
name: git-credentials
registry:
path: quay.io/your-username/my-function
authSecretRef:
name: registry-credentials