Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an empty Status field to the Function CRD #970

Open
alexellis opened this issue Jun 9, 2022 · 3 comments · May be fixed by #1104
Open

Add an empty Status field to the Function CRD #970

alexellis opened this issue Jun 9, 2022 · 3 comments · May be fixed by #1104

Comments

@alexellis
Copy link
Member

Add an empty Status field to the Function CRD

Expected Behaviour

The Function CRD should have a Status in its CRD, so that we can expand on readiness concepts later on or store state about the function.

Current Behaviour

This doesn't exist at present.

Which Solution Do You Recommend?

Update the definition for the types, so that kubebuilder generates a status object.

Make sure that it is not mandatory, otherwise it will be a breaking change for anyone applying a new object from YAML.

Codegen will need to be updated so that the Status object is added to the Go SDK for Functions:

https://github.com/openfaas/faas-netes/blob/master/hack/update-codegen.sh

The CRDs will have to be regenerated too:

https://github.com/openfaas/faas-netes/blob/master/hack/update-crds.sh

The inlets-operator already has a status, this may be useful?

https://github.com/inlets/inlets-operator/blob/master/pkg/apis/inletsoperator/v1alpha1/types.go#L40
https://github.com/inlets/inlets-operator/blob/master/pkg/apis/inletsoperator/v1alpha1/types.go#L54

We will probably need to add // +kubebuilder:subresource:status to the Function type.

https://github.com/openfaas/faas-netes/blob/master/pkg/apis/openfaas/v1/types.go#L13

I have been through this exercise once or twice but threw away the code, there may be a couple of surprises or issues to resolve.

@NikhilSharmaWe
Copy link

NikhilSharmaWe commented May 15, 2023

@alexellis I would like to work on this. Do we still need this, just to make sure, since it is an old issue?

If yes, do you need to inform me about something more about what you expect other than what you have mentioned above, since it has been some time since this issue was opened?

@NikhilSharmaWe NikhilSharmaWe linked a pull request May 15, 2023 that will close this issue
11 tasks
@alexellis
Copy link
Member Author

It's tricky as there are so many edge cases including being at 0/0 replicas.

I think the only thing we could potentially do is something like:

ready = owned_deployment.generation == owned_deployment.desired_generation

@NikhilSharmaWe
Copy link

@alexellis For this issue I have created a PR: #1104, adding an empty status field to the function CRD.

We can discuss what are we planning on how to use status to expand on readiness concepts or store the state of a function, providing users useful info about the progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants