Skip to content

Commit 220aa92

Browse files
committed
add validation doc.go and move content from README.md there; fix typo
1 parent d6deb25 commit 220aa92

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,5 @@ Contains the API definitions used by [Operator Lifecycle Manager][olm] (OLM) and
66

77
`pkg/validation` exposes a convenient set of interfaces to validate Kubernetes object manifests, primarily for use in an Operator project.
88

9-
Additionally this package defines a valid Operator [manifests format][registry-manifests] by exposing a set of `interfaces.Validator`'s to verify them and their constituent manifests. These bundles typically consist of a [Package Manifest][pkg-man] and a set of versioned [bundles][registry-manifests]. Each bundle contains a [ClusterServiceVersion][csv] and one or more [CustomResourceDefinition][crd]'s.
10-
11-
This library reports errors and warnings for missing mandatory and optional fields, respectively. It also supports validation of `ClusterServiceVersion` YAML manifests for any data types inconsistent with those in OLM's [`ClusterServiceVersion`][csv-type] type.
12-
139
[olm]:https://github.com/operator-framework/operator-lifecycle-manager
1410
[marketplace]:https://github.com/operator-framework/operator-marketplace
15-
[registry-manifests]:https://github.com/operator-framework/operator-registry/#manifest-format
16-
[csv]:https://github.com/operator-framework/operator-lifecycle-manager/blob/master/Documentation/design/building-your-csv.md
17-
[pkg-man]:https://github.com/operator-framework/operator-lifecycle-manager#discovery-catalogs-and-automated-upgrades
18-
[crd]:https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
19-
[csv-type]:https://github.com/operator-framework/operator-lifecycle-manager/blob/master/pkg/api/apis/operators/v1alpha1/clusterserviceversion_types.go#L359:6

pkg/validation/doc.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This package defines the valid Operator manifests directory format
2+
// by exposing a set of interfaces.Validator's to verify a directory and
3+
// its constituent manifests. A manifests directory consists of a
4+
// Package Manifest and a set of versioned Bundles. Each Bundle contains a
5+
// ClusterServiceVersion and one or more CustomResourceDefinition's.
6+
//
7+
// Errors and warnings, both represented by the errors.Error type, are
8+
// returned by exported functions for missing mandatory and optional fields,
9+
// respectively. Each Error implements the error interface.
10+
//
11+
// Manifest and Bundle format: https://github.com/operator-framework/operator-registry/#manifest-format
12+
// ClusterServiceVersion documentation: https://github.com/operator-framework/operator-lifecycle-manager/blob/master/Documentation/design/building-your-csv.md
13+
// Package manifest documentation: https://github.com/operator-framework/operator-lifecycle-manager#discovery-catalogs-and-automated-upgrades
14+
// CustomResourceDefinition documentation: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
15+
package validation

pkg/validation/errors/error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type Error struct {
5959
Detail string
6060
}
6161

62-
// Error strut implements the 'error' interface to define custom error formatting.
62+
// Error implements the 'error' interface to define custom error formatting.
6363
func (e Error) Error() string {
6464
detail := e.Detail
6565
if detail != "" {

0 commit comments

Comments
 (0)