Skip to content

Commit

Permalink
resolving issues and generate YAMLs
Browse files Browse the repository at this point in the history
Signed-off-by: Santosh Kaluskar <[email protected]>
  • Loading branch information
Santosh1176 committed Sep 7, 2022
1 parent 62487db commit 815f979
Show file tree
Hide file tree
Showing 22 changed files with 349 additions and 99 deletions.
10 changes: 10 additions & 0 deletions api/v1beta1/artifact_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,30 @@ import (
// Artifact represents the output of a source synchronisation.
type Artifact struct {
// Path is the relative file path of this artifact.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +required
Path string `json:"path"`

// URL is the HTTP address of this artifact.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +required
URL string `json:"url"`

// Revision is a human readable identifier traceable in the origin source
// system. It can be a Git commit SHA, Git tag, a Helm index timestamp, a Helm
// chart version, etc.
// +kubebuilder:validation:MaxLength=65
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
// +optional
Revision string `json:"revision"`

// Checksum is the SHA256 checksum of the artifact.
// +kubebuilder:validation:MaxLength=65
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
// +optional
Checksum string `json:"checksum"`

Expand Down
8 changes: 3 additions & 5 deletions api/v1beta1/bucket_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ type BucketSpec struct {
// Ignore overrides the set of excluded patterns in the .sourceignore format
// (which is the same as .gitignore). If not provided, a default will be used,
// consult the documentation for your version to find out what those are.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +kubebuilder:validation:MaxLength=5119
// +optional
Ignore *string `json:"ignore,omitempty"`

Expand Down Expand Up @@ -110,7 +108,7 @@ type BucketStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`

// URL is the download link for the artifact output of the last Bucket sync.
// +kubebuilder:validation:MaxLength=250
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +optional
URL string `json:"url,omitempty"`
Expand Down Expand Up @@ -220,7 +218,7 @@ type Bucket struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:validation:required
Spec BucketSpec `json:"spec,omitempty"`
Spec BucketSpec `json:"spec"`
// +kubebuilder:default={"observedGeneration":-1}
Status BucketStatus `json:"status,omitempty"`
}
Expand Down
18 changes: 9 additions & 9 deletions api/v1beta1/gitrepository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type GitRepositorySpec struct {
// The repository URL, can be a HTTP/S or SSH address.

// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +required
URL string `json:"url"`
Expand Down Expand Up @@ -73,7 +73,7 @@ type GitRepositorySpec struct {
// Ignore overrides the set of excluded patterns in the .sourceignore format
// (which is the same as .gitignore). If not provided, a default will be used,
// consult the documentation for your version to find out what those are.
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:MaxLength=5119
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +optional
Ignore *string `json:"ignore,omitempty"`
Expand Down Expand Up @@ -135,7 +135,7 @@ type GitRepositoryInclude struct {
// GitRepositoryRef defines the Git ref used for pull and checkout operations.
type GitRepositoryRef struct {
// The Git branch to checkout, defaults to master.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=244
// +kubebuilder:validation:Pattern=`^[\-._a-zA-Z0-9]+$`
// +optional
Branch string `json:"branch,omitempty"`
Expand All @@ -147,14 +147,14 @@ type GitRepositoryRef struct {
Tag string `json:"tag,omitempty"`

// The Git tag semver expression, takes precedence over Tag.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^[\-._0-9]+$`
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
// +optional
SemVer string `json:"semver,omitempty"`

// The Git commit SHA to checkout, if specified Tag filters will be ignored.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$
// +kubebuilder:validation:MaxLength=65
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
// +optional
Commit string `json:"commit,omitempty"`
}
Expand All @@ -181,7 +181,7 @@ type GitRepositoryStatus struct {

// URL is the download link for the artifact output of the last repository
// sync.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +optional
URL string `json:"url,omitempty"`
Expand Down Expand Up @@ -299,7 +299,7 @@ type GitRepository struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:validation:required
Spec GitRepositorySpec `json:"spec,omitempty"`
Spec GitRepositorySpec `json:"spec"`
// +kubebuilder:default={"observedGeneration":-1}
Status GitRepositoryStatus `json:"status,omitempty"`
}
Expand Down
11 changes: 6 additions & 5 deletions api/v1beta1/helmchart_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type HelmChartSpec struct {
// The chart version semver expression, ignored for charts from GitRepository
// and Bucket sources. Defaults to latest when omitted.
// +kubebuilder:default:=*
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +optional
Version string `json:"version,omitempty"`
Expand Down Expand Up @@ -97,9 +97,8 @@ const (
// the typed referenced object at namespace level.
type LocalHelmChartSourceReference struct {
// APIVersion of the referent.
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`

// +optional
APIVersion string `json:"apiVersion,omitempty"`

Expand All @@ -111,7 +110,7 @@ type LocalHelmChartSourceReference struct {

// Name of the referent.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +required
Name string `json:"name"`
Expand All @@ -128,6 +127,8 @@ type HelmChartStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`

// URL is the download link for the last chart pulled.
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +optional
URL string `json:"url,omitempty"`

Expand Down Expand Up @@ -260,7 +261,7 @@ type HelmChart struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:validation:required
Spec HelmChartSpec `json:"spec,omitempty"`
Spec HelmChartSpec `json:"spec"`
// +kubebuilder:default={"observedGeneration":-1}
Status HelmChartStatus `json:"status,omitempty"`
}
Expand Down
6 changes: 3 additions & 3 deletions api/v1beta1/helmrepository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (
type HelmRepositorySpec struct {
// The Helm repository URL, a valid URL contains at least a protocol and host.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +required
URL string `json:"url"`
Expand Down Expand Up @@ -88,7 +88,7 @@ type HelmRepositoryStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`

// URL is the download link for the last index fetched.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +optional
URL string `json:"url,omitempty"`
Expand Down Expand Up @@ -201,7 +201,7 @@ type HelmRepository struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:validation:required
Spec HelmRepositorySpec `json:"spec,omitempty"`
Spec HelmRepositorySpec `json:"spec"`
// +kubebuilder:default={"observedGeneration":-1}
Status HelmRepositoryStatus `json:"status,omitempty"`
}
Expand Down
9 changes: 4 additions & 5 deletions api/v1beta2/artifact_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,20 @@ type Artifact struct {
// managing the Source. It can be used to retrieve the Artifact for
// consumption, e.g. by another controller applying the Artifact contents.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +required
URL string `json:"url"`

// Revision is a human-readable identifier traceable in the origin source
// system. It can be a Git commit SHA, Git tag, a Helm chart version, etc.
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
// +optional
Revision string `json:"revision"`

// Checksum is the SHA256 checksum of the Artifact file.
// +kubebuilder:validation:MaxLength=250
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +kubebuilder:validation:MaxLength=65
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
// +optional
Checksum string `json:"checksum"`

Expand Down
7 changes: 3 additions & 4 deletions api/v1beta2/bucket_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ type BucketSpec struct {
// Ignore overrides the set of excluded patterns in the .sourceignore format
// (which is the same as .gitignore). If not provided, a default will be used,
// consult the documentation for your version to find out what those are.
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +kubebuilder:validation:MaxLength=5119
// +optional
Ignore *string `json:"ignore,omitempty"`

Expand Down Expand Up @@ -127,7 +126,7 @@ type BucketStatus struct {
// URL is the dynamic fetch link for the latest Artifact.
// It is provided on a "best effort" basis, and using the precise
// BucketStatus.Artifact data is recommended.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +optional
URL string `json:"url,omitempty"`
Expand Down Expand Up @@ -185,7 +184,7 @@ type Bucket struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:validation:required
Spec BucketSpec `json:"spec,omitempty"`
Spec BucketSpec `json:"spec"`
// +kubebuilder:default={"observedGeneration":-1}
Status BucketStatus `json:"status,omitempty"`
}
Expand Down
15 changes: 7 additions & 8 deletions api/v1beta2/gitrepository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const (
type GitRepositorySpec struct {
// URL specifies the Git repository URL, it can be an HTTP/S or SSH address.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +required
URL string `json:"url"`
Expand Down Expand Up @@ -85,7 +85,7 @@ type GitRepositorySpec struct {
// Ignore overrides the set of excluded patterns in the .sourceignore format
// (which is the same as .gitignore). If not provided, a default will be used,
// consult the documentation for your version to find out what those are.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=5119
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +optional
Ignore *string `json:"ignore,omitempty"`
Expand Down Expand Up @@ -161,7 +161,7 @@ type GitRepositoryRef struct {
//
// When GitRepositorySpec.GitImplementation is set to 'go-git', a shallow
// clone of the specified branch is performed.
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:MaxLength=244
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +optional
Branch string `json:"branch,omitempty"`
Expand All @@ -174,7 +174,7 @@ type GitRepositoryRef struct {

// SemVer tag expression to check out, takes precedence over Tag.
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^[\-._0-9]+$`
// +kubebuilder:validation:Pattern=`^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
// +optional
SemVer string `json:"semver,omitempty"`

Expand All @@ -183,8 +183,7 @@ type GitRepositoryRef struct {
// When GitRepositorySpec.GitImplementation is set to 'go-git', this can be
// combined with Branch to shallow clone the branch, in which the commit is
// expected to exist.
// +kubebuilder:validation:MaxLength=250
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
// +optional
Commit string `json:"commit,omitempty"`
}
Expand Down Expand Up @@ -215,7 +214,7 @@ type GitRepositoryStatus struct {
// URL is the dynamic fetch link for the latest Artifact.
// It is provided on a "best effort" basis, and using the precise
// GitRepositoryStatus.Artifact data is recommended.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +optional
URL string `json:"url,omitempty"`
Expand Down Expand Up @@ -293,7 +292,7 @@ type GitRepository struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:validation:required
Spec GitRepositorySpec `json:"spec,omitempty"`
Spec GitRepositorySpec `json:"spec"`
// +kubebuilder:default={"observedGeneration":-1}
Status GitRepositoryStatus `json:"status,omitempty"`
}
Expand Down
10 changes: 5 additions & 5 deletions api/v1beta2/helmchart_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type HelmChartSpec struct {
// Version is the chart version semver expression, ignored for charts from
// GitRepository and Bucket sources. Defaults to latest when omitted.
// +kubebuilder:default:=*
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern=`^[\-._0-9]+$`
// +optional
Version string `json:"version,omitempty"`
Expand Down Expand Up @@ -103,7 +103,7 @@ const (
// the typed referenced object at namespace level.
type LocalHelmChartSourceReference struct {
// APIVersion of the referent.
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +optional
APIVersion string `json:"apiVersion,omitempty"`
Expand All @@ -116,7 +116,7 @@ type LocalHelmChartSourceReference struct {

// Name of the referent.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
// +required
Name string `json:"name"`
Expand Down Expand Up @@ -150,7 +150,7 @@ type HelmChartStatus struct {
// URL is the dynamic fetch link for the latest Artifact.
// It is provided on a "best effort" basis, and using the precise
// BucketStatus.Artifact data is recommended.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +optional
URL string `json:"url,omitempty"`
Expand Down Expand Up @@ -225,7 +225,7 @@ type HelmChart struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:validation:required
Spec HelmChartSpec `json:"spec,omitempty"`
Spec HelmChartSpec `json:"spec"`
// +kubebuilder:default={"observedGeneration":-1}
Status HelmChartStatus `json:"status,omitempty"`
}
Expand Down
6 changes: 3 additions & 3 deletions api/v1beta2/helmrepository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type HelmRepositorySpec struct {
// URL of the Helm repository, a valid URL contains at least a protocol and
// host.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +required
URL string `json:"url"`
Expand Down Expand Up @@ -118,7 +118,7 @@ type HelmRepositoryStatus struct {
// URL is the dynamic fetch link for the latest Artifact.
// It is provided on a "best effort" basis, and using the precise
// HelmRepositoryStatus.Artifact data is recommended.
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
// +optional
URL string `json:"url,omitempty"`
Expand Down Expand Up @@ -175,7 +175,7 @@ type HelmRepository struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:validation:required
Spec HelmRepositorySpec `json:"spec,omitempty"`
Spec HelmRepositorySpec `json:"spec"`
// +kubebuilder:default={"observedGeneration":-1}
Status HelmRepositoryStatus `json:"status,omitempty"`
}
Expand Down
Loading

0 comments on commit 815f979

Please sign in to comment.