Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the opvic v1alpha1 API group +kubebuilder:object:generate=true +groupName=opvic.skillz.com
Index ¶
- Constants
- Variables
- type Extraction
- type LocalStrategy
- type LocalVersion
- type Regex
- type RemoteStrategy
- type RemoteVersion
- type Resources
- type Version
- type VersionTracker
- func (in *VersionTracker) DeepCopy() *VersionTracker
- func (in *VersionTracker) DeepCopyInto(out *VersionTracker)
- func (in *VersionTracker) DeepCopyObject() runtime.Object
- func (v *VersionTracker) GetLocalVersion() LocalVersion
- func (v *VersionTracker) GetName() string
- func (v *VersionTracker) GetObjectList() (client.ObjectList, error)
- func (v *VersionTracker) GetResourceKind() string
- func (v *VersionTracker) SetDefaults() VersionTracker
- func (v *VersionTracker) Validate() error
- type VersionTrackerList
- type VersionTrackerSpec
- type VersionTrackerStatus
Constants ¶
const (
FieldSelection LocalStrategy = "FieldSelection"
ImageTag LocalStrategy = "ImageTag"
HelmStrategyChartVersion RemoteStrategy = "chartVersion"
HelmStrategyAppVersion RemoteStrategy = "appVersion"
GithubStrategyReleases RemoteStrategy = "releases"
GithubStrategyTags RemoteStrategy = "tags"
)
Variables ¶
var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "opvic.skillz.com", Version: "v1alpha1"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
var (
ImageTagDefaults = LocalVersion{
FieldSelector: ".spec.containers[0].image",
Extraction: Extraction{
Regex: Regex{
Pattern: `.*:(.*)$`,
Result: "$1",
},
},
}
)
Functions ¶
This section is empty.
Types ¶
type Extraction ¶
type Extraction struct {
// Regex to extract the version from the field
// +optional
Regex Regex `json:"regex,omitempty"`
}
func (*Extraction) DeepCopy ¶
func (in *Extraction) DeepCopy() *Extraction
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Extraction.
func (*Extraction) DeepCopyInto ¶
func (in *Extraction) DeepCopyInto(out *Extraction)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LocalStrategy ¶
type LocalStrategy string
type LocalVersion ¶
type LocalVersion struct {
// +kubebuilder:validation:Enum = ["ImageTag", "FieldSelection"]
// +kubebuilder:default=ImageTag
// +kubebuilder:validation:Required
Strategy LocalStrategy `json:"strategy"`
// Jsonpath to extract the version from the resource
// +kubebuilder:Pattern=^.+$
// +optional
FieldSelector string `json:"fieldSelector"`
// +optional
Extraction Extraction `json:"extraction"`
}
func (*LocalVersion) DeepCopy ¶
func (in *LocalVersion) DeepCopy() *LocalVersion
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVersion.
func (*LocalVersion) DeepCopyInto ¶
func (in *LocalVersion) DeepCopyInto(out *LocalVersion)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Regex ¶
type Regex struct {
// Regex pattern to extract the version from the field
// +kubebuilder:validation:Required
Pattern string `json:"pattern"`
// +kubebuilder:validation:Required
// +kubebuilder:default=$1
Result string `json:"result"`
}
func (*Regex) DeepCopy ¶
func (in *Regex) DeepCopy() *Regex
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Regex.
func (*Regex) DeepCopyInto ¶
func (in *Regex) DeepCopyInto(out *Regex)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RemoteStrategy ¶
type RemoteStrategy string
type RemoteVersion ¶
type RemoteVersion struct {
// +kubebuilder:validation:Enum = ["github", "helm-repo"]
// +kubebuilder:default=github
// +kubebuilder:validation:Required
Provider string `json:"provider"`
// +kubebuilder:validation:Enum = ["releases", "tags", "chartVersion", "appVersion"]
// +kubebuilder:validation:Required
Strategy RemoteStrategy `json:"strategy"`
// Repository to get the remote version from.
// e.g owner/repo or https://charts.bitnami.com/bitnami
// +kubebuilder:validation:Required
Repo string `json:"repo"`
// Helm chart name to track. Required if `provider` is `helm-repo`
// +optional
Chart string `json:"chart,omitempty"`
// +optional
Extraction Extraction `json:"extraction"`
// +optional
Constraint string `json:"constraint,omitempty"`
}
func (*RemoteVersion) DeepCopy ¶
func (in *RemoteVersion) DeepCopy() *RemoteVersion
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteVersion.
func (*RemoteVersion) DeepCopyInto ¶
func (in *RemoteVersion) DeepCopyInto(out *RemoteVersion)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Resources ¶
type Resources struct {
// +kubebuilder:default=Pods
// +kubebuilder:validation:Enum = [Nodes, Pods, Deployments, DaemonSets, StatefulSets, ReplicaSets, CronJobs, Jobs]
// Specifies the strategy to find the resources to track.(Default: `Pods`)
// +optional
Strategy string `json:"strategy"`
// List of Namespaces to use when querying for resources (Default to query all namespaces)
// +optional
Namespaces []string `json:"namespaces"`
// Label selector to use when querying for resources
Selector *metav1.LabelSelector `json:"selector"`
}
func (*Resources) DeepCopy ¶
func (in *Resources) DeepCopy() *Resources
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resources.
func (*Resources) DeepCopyInto ¶
func (in *Resources) DeepCopyInto(out *Resources)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Version ¶ added in v0.1.2
type Version struct {
ResourceCount int `json:"resourceCount"`
ResourceKind string `json:"resourceKind"`
ExtractedFrom string `json:"extractedFrom"`
Version string `json:"version"`
}
func (*Version) DeepCopy ¶ added in v0.1.2
func (in *Version) DeepCopy() *Version
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Version.
func (*Version) DeepCopyInto ¶ added in v0.1.2
func (in *Version) DeepCopyInto(out *Version)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VersionTracker ¶
type VersionTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec VersionTrackerSpec `json:"spec,omitempty"`
Status VersionTrackerStatus `json:"status,omitempty"`
}
VersionTracker is the Schema for the versiontrackers API
func (*VersionTracker) DeepCopy ¶
func (in *VersionTracker) DeepCopy() *VersionTracker
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionTracker.
func (*VersionTracker) DeepCopyInto ¶
func (in *VersionTracker) DeepCopyInto(out *VersionTracker)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*VersionTracker) DeepCopyObject ¶
func (in *VersionTracker) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*VersionTracker) GetLocalVersion ¶
func (v *VersionTracker) GetLocalVersion() LocalVersion
func (*VersionTracker) GetObjectList ¶
func (v *VersionTracker) GetObjectList() (client.ObjectList, error)
GetObjectList returns client.ObjectList based on resource strategy It will be used to query for resources to track
func (*VersionTracker) GetResourceKind ¶
func (v *VersionTracker) GetResourceKind() string
GetKind returns the kind of the resource based on local version strategy
func (*VersionTracker) SetDefaults ¶
func (v *VersionTracker) SetDefaults() VersionTracker
type VersionTrackerList ¶
type VersionTrackerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []VersionTracker `json:"items"`
}
VersionTrackerList contains a list of VersionTracker
func (*VersionTrackerList) DeepCopy ¶
func (in *VersionTrackerList) DeepCopy() *VersionTrackerList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionTrackerList.
func (*VersionTrackerList) DeepCopyInto ¶
func (in *VersionTrackerList) DeepCopyInto(out *VersionTrackerList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*VersionTrackerList) DeepCopyObject ¶
func (in *VersionTrackerList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type VersionTrackerSpec ¶
type VersionTrackerSpec struct {
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Required
// Name of the app that is being tracked
Name string `json:"name"`
// +kubebuilder:validation:Required
Resources Resources `json:"resources"`
// +kubebuilder:validation:Required
LocalVersion LocalVersion `json:"localVersion"`
// +optional
RemoteVersion RemoteVersion `json:"remoteVersion"`
}
VersionTrackerSpec defines the desired state of VersionTracker
func (*VersionTrackerSpec) DeepCopy ¶
func (in *VersionTrackerSpec) DeepCopy() *VersionTrackerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionTrackerSpec.
func (*VersionTrackerSpec) DeepCopyInto ¶
func (in *VersionTrackerSpec) DeepCopyInto(out *VersionTrackerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VersionTrackerStatus ¶
type VersionTrackerStatus struct {
ID *string `json:"id,omitempty"`
Namespace *string `json:"namespace,omitempty"`
TotalResourceCount *int `json:"totalResourceCount,omitempty"`
UniqVersions []*string `json:"uniqVersions,omitempty"`
Versions []*Version `json:"versions,omitempty"`
LocalVersion *LocalVersion `json:"localVersion,omitempty"`
RemoteVersion *RemoteVersion `json:"remoteVersion,omitempty"`
}
VersionTrackerStatus defines the observed state of VersionTracker
func (*VersionTrackerStatus) DeepCopy ¶
func (in *VersionTrackerStatus) DeepCopy() *VersionTrackerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionTrackerStatus.
func (*VersionTrackerStatus) DeepCopyInto ¶
func (in *VersionTrackerStatus) DeepCopyInto(out *VersionTrackerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.