kubernetes-sigs / kubernetes-sigs/cluster-api

Contract validation utility

Open
#13,254 5 comments 0 reactions 1 assignee Claimed by @richardcase View on GitHub
kind/feature lifecycle/active priority/important-longterm triage/accepted
Dominant language
Go
Stars
4.3k
Forks
1.6k
Avg merge
1d 3h
Merged PRs (30d)
113

Description

### What would you like to be added (User Story)?

As a provider implementor, I want a utility that validates my resource kinds against a contract, so that i know my implementation adheres to the relevant CAPI contract.

### Detailed Description

When implementing a provider, it's required that CRD contain certain fields to adhere to the contract for the specific provider type. There are docs that detail the contract fields (like this for [InfraCluster](https://cluster-api.sigs.k8s.io/developer/providers/contracts/infra-cluster)) but there is no automated way to determine if the CRD actually adheres to the contract.

Its proposed that we create a utility that does the following:

- Validates a CRD against a specific contract definition
- Generates contract documentation for a specific contract definition

This will require that contracts are declared in some way and that this is kept up to date when the contract changes.

### Anything else you would like to add?

_No response_

### Label(s) to be applied

/kind feature
One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.