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

Introduce storage abstraction and locking mechanism #5

Merged
merged 7 commits into from
Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from 4 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
25 changes: 13 additions & 12 deletions api/v1alpha1/condition_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// RepositoryCondition contains condition information for a repository
type RepositoryCondition struct {
// SourceCondition contains condition information for a source
type SourceCondition struct {
// Type of the condition, currently ('Ready').
Type RepositoryConditionType `json:"type"`
// +required
Type string `json:"type"`

// Status of the condition, one of ('True', 'False', 'Unknown').
// +required
Status corev1.ConditionStatus `json:"status"`

// LastTransitionTime is the timestamp corresponding to the last status
// change of this condition.
// +optional
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
// +required
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`

// Reason is a brief machine readable explanation for the condition's last
// transition.
// +optional
// +required
Reason string `json:"reason,omitempty"`

// Message is a human readable description of the details of the last
Expand All @@ -29,11 +31,10 @@ type RepositoryCondition struct {
Message string `json:"message,omitempty"`
}

// RepositoryConditionType represents an repository condition value
type RepositoryConditionType string

const (
// RepositoryConditionReady represents the fact that a given repository condition
// is in ready state.
RepositoryConditionReady RepositoryConditionType = "Ready"
// ReadyCondition represents the fact that a given source is in ready state.
ReadyCondition string = "Ready"

// InitializingReason represents the fact that a given source is being initialize.
InitializingReason string = "Initializing"
)
6 changes: 3 additions & 3 deletions api/v1alpha1/gitrepository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ type GitRepositorySpec struct {
// GitRepositoryStatus defines the observed state of GitRepository
type GitRepositoryStatus struct {
// +optional
Conditions []RepositoryCondition `json:"conditions,omitempty"`
Conditions []SourceCondition `json:"conditions,omitempty"`

// LastUpdateTime is the timestamp corresponding to the last status
// change of this repository.
// +optional
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`

// Path to the artifacts of the last repository sync.
// Path to the artifact output of the last repository sync.
// +optional
Artifacts string `json:"artifacts,omitempty"`
Artifact string `json:"artifacts,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/helmrepository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type HelmRepositorySpec struct {
// HelmRepositoryStatus defines the observed state of HelmRepository
type HelmRepositoryStatus struct {
// +optional
Conditions []RepositoryCondition `json:"conditions,omitempty"`
Conditions []SourceCondition `json:"conditions,omitempty"`

// LastUpdateTime is the timestamp corresponding to the last status
// change of this repository.
Expand Down
17 changes: 7 additions & 10 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions config/crd/bases/source.fluxcd.io_gitrepositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ spec:
description: GitRepositoryStatus defines the observed state of GitRepository
properties:
artifacts:
description: Path to the artifacts of the last repository sync.
description: Path to the artifact output of the last repository sync.
type: string
conditions:
items:
description: RepositoryCondition contains condition information for
a repository
description: SourceCondition contains condition information for a
source
properties:
lastTransitionTime:
description: LastTransitionTime is the timestamp corresponding
Expand Down
7 changes: 3 additions & 4 deletions config/crd/bases/source.fluxcd.io_helmrepositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,12 @@ spec:
description: HelmRepositoryStatus defines the observed state of HelmRepository
properties:
artifact:
description: Path to the artifact (index file) of the last repository
sync.
description: Path to the artifact of the last repository index.
type: string
conditions:
items:
description: RepositoryCondition contains condition information for
a repository
description: SourceCondition contains condition information for a
source
properties:
lastTransitionTime:
description: LastTransitionTime is the timestamp corresponding
Expand Down
Loading