Add artifact type to API
This commit is contained in:
parent
fa6bccbc72
commit
461c015273
|
@ -0,0 +1,41 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 The Flux CD contributors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package v1alpha1
|
||||||
|
|
||||||
|
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
|
// Artifact represents the output of a source synchronisation
|
||||||
|
type Artifact struct {
|
||||||
|
// Path is the local file path of this artifact.
|
||||||
|
// +required
|
||||||
|
Path string `json:"path"`
|
||||||
|
|
||||||
|
// URL is the HTTP address of this artifact.
|
||||||
|
// +required
|
||||||
|
URL string `json:"url"`
|
||||||
|
|
||||||
|
// Revision is a human readable identifier traceable in the origin source system.
|
||||||
|
// It can be a commit sha, git tag, a helm index timestamp,
|
||||||
|
// a helm chart version, a checksum, etc.
|
||||||
|
// +optional
|
||||||
|
Revision string `json:"revision"`
|
||||||
|
|
||||||
|
// LastUpdateTime is the timestamp corresponding to the last
|
||||||
|
// update of this artifact.
|
||||||
|
// +required
|
||||||
|
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
|
||||||
|
}
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 The Flux CD contributors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -67,14 +67,13 @@ type GitRepositoryStatus struct {
|
||||||
// +optional
|
// +optional
|
||||||
Conditions []SourceCondition `json:"conditions,omitempty"`
|
Conditions []SourceCondition `json:"conditions,omitempty"`
|
||||||
|
|
||||||
// LastUpdateTime is the timestamp corresponding to the last status
|
// URL is the download link for the artifact output of the last repository sync.
|
||||||
// change of this repository.
|
|
||||||
// +optional
|
// +optional
|
||||||
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
|
URL string `json:"url,omitempty"`
|
||||||
|
|
||||||
// Path to the artifact output of the last repository sync.
|
// Artifact represents the output of the last successful repository sync.
|
||||||
// +optional
|
// +optional
|
||||||
Artifact string `json:"artifacts,omitempty"`
|
Artifact *Artifact `json:"artifact,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// +kubebuilder:object:root=true
|
// +kubebuilder:object:root=true
|
||||||
|
|
|
@ -37,14 +37,13 @@ type HelmRepositoryStatus struct {
|
||||||
// +optional
|
// +optional
|
||||||
Conditions []SourceCondition `json:"conditions,omitempty"`
|
Conditions []SourceCondition `json:"conditions,omitempty"`
|
||||||
|
|
||||||
// LastUpdateTime is the timestamp corresponding to the last status
|
// URL is the download link for the last index fetched.
|
||||||
// change of this repository.
|
|
||||||
// +optional
|
// +optional
|
||||||
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
|
URL string `json:"url,omitempty"`
|
||||||
|
|
||||||
// Path to the artifact of the last repository index.
|
// Artifact represents the output of the last successful repository sync.
|
||||||
// +optional
|
// +optional
|
||||||
Artifact string `json:"artifact,omitempty"`
|
Artifact *Artifact `json:"artifact,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// +kubebuilder:object:root=true
|
// +kubebuilder:object:root=true
|
||||||
|
|
|
@ -25,6 +25,22 @@ import (
|
||||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *Artifact) DeepCopyInto(out *Artifact) {
|
||||||
|
*out = *in
|
||||||
|
in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Artifact.
|
||||||
|
func (in *Artifact) DeepCopy() *Artifact {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(Artifact)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *GitRepository) DeepCopyInto(out *GitRepository) {
|
func (in *GitRepository) DeepCopyInto(out *GitRepository) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
@ -135,9 +151,10 @@ func (in *GitRepositoryStatus) DeepCopyInto(out *GitRepositoryStatus) {
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if in.LastUpdateTime != nil {
|
if in.Artifact != nil {
|
||||||
in, out := &in.LastUpdateTime, &out.LastUpdateTime
|
in, out := &in.Artifact, &out.Artifact
|
||||||
*out = (*in).DeepCopy()
|
*out = new(Artifact)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,9 +253,10 @@ func (in *HelmRepositoryStatus) DeepCopyInto(out *HelmRepositoryStatus) {
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if in.LastUpdateTime != nil {
|
if in.Artifact != nil {
|
||||||
in, out := &in.LastUpdateTime, &out.LastUpdateTime
|
in, out := &in.Artifact, &out.Artifact
|
||||||
*out = (*in).DeepCopy()
|
*out = new(Artifact)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,9 +93,30 @@ spec:
|
||||||
status:
|
status:
|
||||||
description: GitRepositoryStatus defines the observed state of GitRepository
|
description: GitRepositoryStatus defines the observed state of GitRepository
|
||||||
properties:
|
properties:
|
||||||
artifacts:
|
artifact:
|
||||||
description: Path to the artifact output of the last repository sync.
|
description: Artifact represents the output of the last successful repository
|
||||||
type: string
|
sync.
|
||||||
|
properties:
|
||||||
|
lastUpdateTime:
|
||||||
|
description: LastUpdateTime is the timestamp corresponding to the
|
||||||
|
last update of this artifact.
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
path:
|
||||||
|
description: Path is the local file path of this artifact.
|
||||||
|
type: string
|
||||||
|
revision:
|
||||||
|
description: Revision is a human readable identifier traceable in
|
||||||
|
the origin source system. It can be a commit sha, git tag, a helm
|
||||||
|
index timestamp, a helm chart version, a checksum, etc.
|
||||||
|
type: string
|
||||||
|
url:
|
||||||
|
description: URL is the HTTP address of this artifact.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- path
|
||||||
|
- url
|
||||||
|
type: object
|
||||||
conditions:
|
conditions:
|
||||||
items:
|
items:
|
||||||
description: SourceCondition contains condition information for a
|
description: SourceCondition contains condition information for a
|
||||||
|
@ -126,10 +147,9 @@ spec:
|
||||||
- type
|
- type
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
lastUpdateTime:
|
url:
|
||||||
description: LastUpdateTime is the timestamp corresponding to the last
|
description: URL is the download link for the artifact output of the
|
||||||
status change of this repository.
|
last repository sync.
|
||||||
format: date-time
|
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
|
|
@ -64,8 +64,29 @@ spec:
|
||||||
description: HelmRepositoryStatus defines the observed state of HelmRepository
|
description: HelmRepositoryStatus defines the observed state of HelmRepository
|
||||||
properties:
|
properties:
|
||||||
artifact:
|
artifact:
|
||||||
description: Path to the artifact of the last repository index.
|
description: Artifact represents the output of the last successful repository
|
||||||
type: string
|
sync.
|
||||||
|
properties:
|
||||||
|
lastUpdateTime:
|
||||||
|
description: LastUpdateTime is the timestamp corresponding to the
|
||||||
|
last update of this artifact.
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
path:
|
||||||
|
description: Path is the local file path of this artifact.
|
||||||
|
type: string
|
||||||
|
revision:
|
||||||
|
description: Revision is a human readable identifier traceable in
|
||||||
|
the origin source system. It can be a commit sha, git tag, a helm
|
||||||
|
index timestamp, a helm chart version, a checksum, etc.
|
||||||
|
type: string
|
||||||
|
url:
|
||||||
|
description: URL is the HTTP address of this artifact.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- path
|
||||||
|
- url
|
||||||
|
type: object
|
||||||
conditions:
|
conditions:
|
||||||
items:
|
items:
|
||||||
description: SourceCondition contains condition information for a
|
description: SourceCondition contains condition information for a
|
||||||
|
@ -96,10 +117,8 @@ spec:
|
||||||
- type
|
- type
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
lastUpdateTime:
|
url:
|
||||||
description: LastUpdateTime is the timestamp corresponding to the last
|
description: URL is the download link for the last index fetched.
|
||||||
status change of this repository.
|
|
||||||
format: date-time
|
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
|
Loading…
Reference in New Issue