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

Implement compileMeta endpoint according to SDD 0031 #218

Merged
merged 2 commits into from
May 28, 2024
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
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