openfaas / openfaas/faas

Add missing attributes to /system/function/{functionName}

Open
#848 35 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

design/review proposal
Dominant language
Go
Stars
26.2k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

Expected Behaviour

Attributes used to create a function with the POST endpoint should be mirrored when retrieving the function meta data using the GET endpoint

Current Behaviour

The attributes are currently as follows:

Name POST GET
service
  • - [x]  
  • - [x] - called name
network
  • - [x]  
  • - [ ] - missing
image
  • - [x]  
  • - [x]
envProcess
  • - [x]  
  • - [x]
envVars
  • - [x]  
  • - [ ] - missing
constraints
  • - [x]  
  • - [ ] - missing
labels
  • - [x]  
  • - [x]
annotations
  • - [x]  
  • - [x]
secrets
  • - [x]  
  • - [ ] - missing
registryAuth
  • - [x]  
  • - [ ] - missing but maybe not include as its sensitive
limits
  • - [x]  
  • - [ ] - missing
requests
  • - [x]  
  • - [ ] - missing
readOnlyRootFilesystem
  • - [x] added
  • - [ ] - missing

Possible Solution

  1. swagger.yml add missing attributes to FunctionListEntry
  2. gateway/requests/requests.go add missing attributes to Function type
  3. faas-swarm/handlers/reader.go add missing attributes in readServices func
  4. faas-netes add missing attributes
  5. faas-operator add missing attributes
  6. faas-cli describe verb when merged may need updating

Context

I'm writing a terraform provider for openfaas, to work well with terraform, it's best if the underlying infrastructure apis have mirrored POST/GET endpoints. This is also a very common practice in REST apis

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with swagger.yml's FunctionListEntry and gateway/requests/requests.go's Function type, then trace readServices in faas-swarm/handlers/reader.go. Check the corresponding faas-netes and faas-operator implementations and the faas-cli describe verb. Done means the GET function metadata mirrors the POST attributes, with the sensitive registryAuth decision resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, openapi
Domain
api, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.