Skip to content

Commit

Permalink
Implement compileMeta endpoint according to SDD 0031 (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastjan authored May 28, 2024
1 parent 77806ea commit 6252cdd
Show file tree
Hide file tree
Showing 8 changed files with 799 additions and 134 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require (
github.com/projectsyn/lieutenant-operator v1.6.0
github.com/stretchr/testify v1.9.0
github.com/taion809/haikunator v0.0.0-20150324135039-4e414e676fd1
go.uber.org/multierr v1.11.0
k8s.io/api v0.30.1
k8s.io/apimachinery v0.30.1
sigs.k8s.io/controller-runtime v0.18.3
Expand Down
133 changes: 133 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ components:
$ref: '#/components/schemas/ClusterFacts'
dynamicFacts:
$ref: '#/components/schemas/DynamicClusterFacts'
compileMeta:
$ref: '#/components/schemas/ClusterCompileMeta'
gitRepo:
$ref: '#/components/schemas/GitRepo'
tenantGitRepoRevision:
Expand Down Expand Up @@ -160,6 +162,104 @@ components:
major: "1"
minor: "20"
platform: linux/amd64
# ClusterCompileMeta is exported from k8s. Must match the k8s structure.
# kubectl get --raw /openapi/v3/apis/syn.tools/v1alpha1 | yq --prettyPrint '.components.schemas["tools.syn.v1alpha1.Cluster"].properties.status.properties.compileMeta'
ClusterCompileMeta:
description: CompileMeta contains information about the last compilation with Commodore.
type: object
properties:
commodoreBuildInfo:
description: CommodoreBuildInfo is the freeform build information reported by the Commodore binary used for the last compilation.
type: object
additionalProperties:
type: string
global:
description: Global contains the information of the global configuration used for the last compilation.
type: object
properties:
gitSha:
description: GitSHA is the git commit SHA of the used commit.
type: string
path:
description: Path is the path inside the git repository where the configuration is stored.
type: string
url:
description: URL is the URL of the git repository.
type: string
version:
description: |-
Version is the version of the configuration.
Can point to a tag, branch or any other git reference.
type: string
instances:
description: |-
Instances contains the information of the component instances used for the last compilation.
The key is the name of the component instance.
type: object
additionalProperties:
description: CompileMetaInstanceVersionInfo contains information about the version of a component instance.
type: object
properties:
component:
description: Component is the name of a component instance.
type: string
gitSha:
description: GitSHA is the git commit SHA of the used commit.
type: string
path:
description: Path is the path inside the git repository where the configuration is stored.
type: string
url:
description: URL is the URL of the git repository.
type: string
version:
description: |-
Version is the version of the configuration.
Can point to a tag, branch or any other git reference.
type: string
lastCompile:
description: LastCompile is the time of the last successful compilation.
type: string
format: date-time
packages:
description: Packages contains the information of the packages used for the last compilation.
type: object
additionalProperties:
description: CompileMetaVersionInfo contains information about the version of a configuration repo or a package.
type: object
properties:
gitSha:
description: GitSHA is the git commit SHA of the used commit.
type: string
path:
description: Path is the path inside the git repository where the configuration is stored.
type: string
url:
description: URL is the URL of the git repository.
type: string
version:
description: |-
Version is the version of the configuration.
Can point to a tag, branch or any other git reference.
type: string
tenant:
description: Tenant contains the information of the tenant configuration used for the last compilation.
type: object
properties:
gitSha:
description: GitSHA is the git commit SHA of the used commit.
type: string
path:
description: Path is the path inside the git repository where the configuration is stored.
type: string
url:
description: URL is the URL of the git repository.
type: string
version:
description: |-
Version is the version of the configuration.
Can point to a tag, branch or any other git reference.
type: string
Cluster:
allOf:
- $ref: '#/components/schemas/ClusterId'
Expand Down Expand Up @@ -623,6 +723,39 @@ paths:
$ref: '#/components/schemas/Reason'
default:
$ref: '#/components/responses/Default'
/clusters/{clusterId}/compileMeta:
post:
operationId: postClusterCompileMeta
summary: Stores compilation metadata for a cluster
description: |
Stores compilation metadata for a cluster.
Intended for commodore to report the last compilation.
Contains version information and timestamps.
tags:
- cluster
- metadata
- version-information
parameters:
- $ref: '#/components/parameters/ClusterIdParameter'
requestBody:
description: Stores compilation metadata for a cluster
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ClusterCompileMeta'
responses:
'204':
description: Data stored
'403':
description: Cluster update forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Reason'
default:
$ref: '#/components/responses/Default'
/install/steward.json:
get:
operationId: installSteward
Expand Down
Loading

0 comments on commit 6252cdd

Please sign in to comment.