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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ kubectl get function my-function -o yaml
The status will include:
- Function name and conditions
- Git information (branch, commit, last checked time)
- Deployment details (image, runtime, build time, deployer)
- Deployment details (image, revision, runtime, build time, deployer)
- Middleware status (current and available versions, auto-update settings, pending rebuild status)

## Advanced Use Cases
Expand Down Expand Up @@ -309,6 +309,7 @@ make lint
| `git.lastChecked` | timestamp | Last time the repository was checked |
| `deployment.image` | string | Container image of the deployed function |
| `deployment.imageBuilt` | timestamp | When the current image was built |
| `deployment.revision` | string | Latest commit SHA of the deployed revision |
| `deployment.deployer` | string | Tool/method used to deploy the function (e.g., "func") |
| `deployment.runtime` | string | Detected function runtime |
| `middleware.current` | string | Current middleware version in use |
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha1/function_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ type FunctionStatusGit struct {
type FunctionStatusDeployment struct {
Image string `json:"image,omitempty"`
ImageBuilt metav1.Time `json:"imageBuilt,omitempty"`
Revision string `json:"revision,omitempty"`
Deployer string `json:"deployer,omitempty"`
Runtime string `json:"runtime,omitempty"`
}
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/functions.dev_functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ spec:
imageBuilt:
format: date-time
type: string
revision:
type: string
runtime:
type: string
type: object
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ require (
sigs.k8s.io/yaml v1.6.0 // indirect
)

replace knative.dev/func => knative.dev/func v0.47.1-0.20260421122411-87ce20dd94e4
replace knative.dev/func => knative.dev/func v0.48.1-0.20260427113619-77707d1de8b6
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEK
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
Expand Down Expand Up @@ -503,8 +501,8 @@ knative.dev/client/pkg v0.0.0-20260414023335-1977a50c04df h1:lVwgz0nFbAiYQUhAVdU
knative.dev/client/pkg v0.0.0-20260414023335-1977a50c04df/go.mod h1:aAFzTzKkLSK6I6W4g/+QUMpv5ty2UcOngcXxzn+a1FE=
knative.dev/eventing v0.48.1-0.20260414191034-3b3ea1d037e6 h1:maXR76gTo6zpNjZOir4npylXw5wQX2BcXisq8fcaf4c=
knative.dev/eventing v0.48.1-0.20260414191034-3b3ea1d037e6/go.mod h1:Y3FYNf5gNCIuqv+NzUAmqfbHJ8n+TxXSsZoV/20jfV0=
knative.dev/func v0.47.1-0.20260421122411-87ce20dd94e4 h1:IjCmEXwcA19aomt7mznmz3wk8qlVesUj2EigI0LPT/I=
knative.dev/func v0.47.1-0.20260421122411-87ce20dd94e4/go.mod h1:R8TiTtGRnIvWSr4EJG6NvEYeB6Fjuj/wBrR7Gw6Ka24=
knative.dev/func v0.48.1-0.20260427113619-77707d1de8b6 h1:TLTpkrxoiZ1gbVA/xBQWFgSBbFmTiu7QID5Olrf8O74=
knative.dev/func v0.48.1-0.20260427113619-77707d1de8b6/go.mod h1:R8TiTtGRnIvWSr4EJG6NvEYeB6Fjuj/wBrR7Gw6Ka24=
knative.dev/networking v0.0.0-20260407015926-cc2f0572b3c2 h1:8QlbccV/8/YO2zIoCAOvjU/0t5HxMiWyo480cwohrlQ=
knative.dev/networking v0.0.0-20260407015926-cc2f0572b3c2/go.mod h1:a3XBEpYEpWTSz6DdKNXA6+hcny6SSs5J9FChfPxUJMM=
knative.dev/pkg v0.0.0-20260414003832-e65cbe95a718 h1:/8xILwHO82gYQXgqQgP9jbSpxg8rmsl/mk1YrYtY/hs=
Expand Down
22 changes: 14 additions & 8 deletions internal/controller/function_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,18 @@ type middlewareCheck interface {
}

type middlewareUpToDate struct {
currentImage string
serviceReady string
currentVersion string
autoUpdate autoUpdateStatus
currentImage string
currentRevision string
serviceReady string
currentVersion string
autoUpdate autoUpdateStatus
}

func (middlewareUpToDate) middlewareCheck() {}

type middlewareOutdated struct {
currentImage string
currentRevision string
serviceReady string
currentVersion string
availableVersion string
Expand Down Expand Up @@ -292,15 +294,17 @@ func (r *FunctionReconciler) checkMiddlewareState(ctx context.Context, function

if latestVersion == desc.Middleware.Version {
return middlewareUpToDate{
currentImage: desc.Image,
serviceReady: desc.Ready,
currentVersion: desc.Middleware.Version,
autoUpdate: autoUpdate,
currentImage: desc.Image,
currentRevision: desc.Revision,
serviceReady: desc.Ready,
currentVersion: desc.Middleware.Version,
autoUpdate: autoUpdate,
}, nil
}

return middlewareOutdated{
currentImage: desc.Image,
currentRevision: desc.Revision,
serviceReady: desc.Ready,
currentVersion: desc.Middleware.Version,
availableVersion: latestVersion,
Expand Down Expand Up @@ -330,6 +334,7 @@ func (r *FunctionReconciler) handleMiddlewareUpdate(ctx context.Context, functio
case middlewareUpToDate:
logger.Info("Function is on latest middleware. No redeploy needed", "version", check.currentVersion)
function.Status.Deployment.Image = check.currentImage
function.Status.Deployment.Revision = check.currentRevision
function.Status.Middleware.Current = check.currentVersion
function.Status.Middleware.AutoUpdate.Enabled = check.autoUpdate.enabled
function.Status.Middleware.AutoUpdate.Source = check.autoUpdate.source
Expand All @@ -339,6 +344,7 @@ func (r *FunctionReconciler) handleMiddlewareUpdate(ctx context.Context, functio

case middlewareOutdated:
function.Status.Deployment.Image = check.currentImage
function.Status.Deployment.Revision = check.currentRevision
function.Status.Middleware.Current = check.currentVersion
function.Status.Middleware.AutoUpdate.Enabled = check.autoUpdate.enabled
function.Status.Middleware.AutoUpdate.Source = check.autoUpdate.source
Expand Down
4 changes: 3 additions & 1 deletion internal/controller/function_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ var _ = Describe("Function Controller", func() {
Middleware: functions.Middleware{
Version: "v1.0.0",
},
Image: "my-image:v1.2.3",
Image: "my-image:v1.2.3",
Revision: "my-revision",
}, nil)
funcMock.EXPECT().GetLatestMiddlewareVersion(mock.Anything, mock.Anything, mock.Anything).Return("v1.0.0", nil)

Expand All @@ -241,6 +242,7 @@ var _ = Describe("Function Controller", func() {
},
statusChecks: func(status *functionsdevv1alpha1.FunctionStatus) {
Expect(status.Deployment.Image).Should(Equal("my-image:v1.2.3"))
Expect(status.Deployment.Revision).Should(Equal("my-revision"))
Expect(status.Deployment.Deployer).Should(Equal("keda"))
Expect(status.Deployment.Runtime).Should(Equal("node"))
},
Expand Down
Loading