Skip to content

Commit

Permalink
chore: add resolved field to public tool reference
Browse files Browse the repository at this point in the history
The resolved field exposes whether the controller has resolved the tool
reference and the fields are up to date.

Signed-off-by: Donnie Adams <[email protected]>
  • Loading branch information
thedadams committed Dec 3, 2024
1 parent 0adf82e commit b540b7e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions apiclient/types/toolreference.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type ToolReferenceManifest struct {
type ToolReference struct {
Metadata
ToolReferenceManifest
Resolved bool `json:"resolved,omitempty"`
Error string `json:"error,omitempty"`
Builtin bool `json:"builtin,omitempty"`
Description string `json:"description,omitempty"`
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/handlers/toolreferences.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ func convertToolReference(toolRef v1.ToolReference) types.ToolReference {
ToolType: toolRef.Spec.Type,
Reference: toolRef.Spec.Reference,
},
Builtin: toolRef.Spec.Builtin,
Error: toolRef.Status.Error,
Builtin: toolRef.Spec.Builtin,
Error: toolRef.Status.Error,
Resolved: toolRef.Generation == toolRef.Status.ObservedGeneration,
}
if toolRef.Spec.Active == nil {
tf.Active = true
Expand Down
6 changes: 6 additions & 0 deletions pkg/storage/openapi/generated/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b540b7e

Please sign in to comment.