Skip to content

Commit

Permalink
add validatedpatterns/patterns-operator
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Hoß <[email protected]>
  • Loading branch information
sebhoss committed Nov 12, 2023
1 parent e0fe3ec commit 461c84d
Show file tree
Hide file tree
Showing 7 changed files with 374 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,10 @@ Files: crd-catalog/traefik/traefik/*
Copyright: The traefik/traefik Authors
License: MIT

Files: crd-catalog/validatedpatterns/patterns-operator/*
Copyright: The validatedpatterns/patterns-operator Authors
License: Apache-2.0

Files: crd-catalog/VictoriaMetrics/operator/*
Copyright: The VictoriaMetrics/operator Authors
License: Apache-2.0
Expand Down
7 changes: 7 additions & 0 deletions code-generator/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,13 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[
"https://github.com/traefik/traefik/blob/master/docs/content/reference/dynamic-configuration/traefik.io_traefikservices.yaml",
],
},
UpstreamSource {
project_name: "validatedpatterns/patterns-operator",
license: APACHE_V2,
urls: &[
"https://github.com/validatedpatterns/patterns-operator/blob/main/config/crd/bases/gitops.hybrid-cloud-patterns.io_patterns.yaml",
],
},
UpstreamSource {
project_name: "VictoriaMetrics/operator",
license: APACHE_V2,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.4
name: patterns.gitops.hybrid-cloud-patterns.io
spec:
group: gitops.hybrid-cloud-patterns.io
names:
kind: Pattern
listKind: PatternList
plural: patterns
shortNames:
- patt
singular: pattern
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.lastStep
name: Step
priority: 1
type: string
- jsonPath: .status.lastError
name: Error
priority: 2
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: Pattern is the Schema for the patterns API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: PatternSpec defines the desired state of Pattern
properties:
analyticsUUID:
description: Analytics UUID. Leave empty to autogenerate a random one. Not PII information
type: string
clusterGroupName:
type: string
extraParameters:
description: '.Name is dot separated per the helm --set syntax, such as: global.something.field'
items:
properties:
name:
type: string
value:
type: string
required:
- name
- value
type: object
type: array
extraValueFiles:
description: URLs to additional Helm parameter files
items:
type: string
type: array
gitOpsSpec:
properties:
manualSync:
description: 'Require manual intervention before Argo will sync new content. Default: False'
type: boolean
type: object
gitSpec:
properties:
hostname:
description: Optional. FQDN of the git server if automatic parsing from TargetRepo is broken
type: string
originRepo:
description: Upstream git repo containing the pattern to deploy. Used when in-cluster fork to point to the upstream pattern repository
type: string
originRevision:
description: Branch, tag or commit in the upstream git repository. Does not support short-sha's. Default to HEAD
type: string
pollInterval:
default: 180
description: 'Interval in seconds to poll for drifts between origin and target repositories. Default: 180 seconds'
type: integer
targetRepo:
description: Git repo containing the pattern to deploy. Must use https/http
type: string
targetRevision:
description: 'Branch, tag, or commit to deploy. Does not support short-sha''s. Default: HEAD'
type: string
required:
- targetRepo
type: object
multiSourceConfig:
properties:
clusterGroupChartGitRevision:
default: main
description: The git reference when deploying the clustergroup helm chart directly from a git repo Defaults to 'main'. (Only used when developing the clustergroup helm chart)
type: string
clusterGroupChartVersion:
default: 0.0.*
description: Which chart version for the clustergroup helm chart Defaults to "0.0.*"
type: string
clusterGroupGitRepoUrl:
description: The url when deploying the clustergroup helm chart directly from a git repo Defaults to '' which means not used (Only used when developing the clustergroup helm chart)
type: string
enabled:
default: true
description: (EXPERIMENTAL) Enable multi-source support when deploying the clustergroup argo application
type: boolean
helmRepoUrl:
default: https://charts.validatedpatterns.io/
description: The helm chart url to fetch the helm charts from in order to deploy the pattern Defaults to https://charts.validatedpatterns.io/
type: string
type: object
required:
- clusterGroupName
- gitSpec
type: object
status:
description: PatternStatus defines the observed state of Pattern
properties:
analyticsSent:
default: 0
type: integer
analyticsUUID:
type: string
appClusterDomain:
type: string
applications:
items:
description: PatternApplicationInfo defines the Applications Status for the Pattern. This structure is part of the PatternStatus as an array The Application Status will be included as part of the Observed state of Pattern
properties:
healthMessage:
type: string
healthStatus:
type: string
name:
type: string
namespace:
type: string
syncStatus:
type: string
type: object
type: array
clusterDomain:
type: string
clusterID:
type: string
clusterName:
type: string
clusterPlatform:
type: string
clusterVersion:
type: string
conditions:
items:
properties:
lastTransitionTime:
description: Last time the condition transitioned from one status to another.
format: date-time
type: string
lastUpdateTime:
description: The last time this condition was updated.
format: date-time
type: string
message:
description: A human readable message indicating details about the transition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of deployment condition.
type: string
required:
- lastUpdateTime
- status
- type
type: object
type: array
lastError:
description: Last error encountered by the pattern
type: string
lastStep:
description: Last action related to the pattern
type: string
version:
description: Number of updates to the pattern
type: integer
type: object
type: object
served: true
storage: true
subresources:
status: {}
1 change: 1 addition & 0 deletions kube-custom-resources-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ gateway_networking_k8s_io_v1alpha2 = []
gateway_networking_k8s_io_v1beta1 = []
gateway_nginx_org_v1alpha1 = []
getambassador_io_v3alpha1 = []
gitops_hybrid_cloud_patterns_io_v1alpha1 = []
grafana_integreatly_org_v1beta1 = []
hazelcast_com_v1alpha1 = []
helm_toolkit_fluxcd_io_v2beta1 = []
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod patterns;
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --filename=./crd-catalog/validatedpatterns/patterns-operator/gitops.hybrid-cloud-patterns.io/v1alpha1/patterns.yaml --derive=Default --derive=PartialEq
// kopium version: 0.16.2

use kube::CustomResource;
use serde::{Serialize, Deserialize};

/// PatternSpec defines the desired state of Pattern
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "gitops.hybrid-cloud-patterns.io", version = "v1alpha1", kind = "Pattern", plural = "patterns")]
#[kube(namespaced)]
#[kube(status = "PatternStatus")]
#[kube(schema = "disabled")]
pub struct PatternSpec {
/// Analytics UUID. Leave empty to autogenerate a random one. Not PII information
#[serde(default, skip_serializing_if = "Option::is_none", rename = "analyticsUUID")]
pub analytics_uuid: Option<String>,
#[serde(rename = "clusterGroupName")]
pub cluster_group_name: String,
/// .Name is dot separated per the helm --set syntax, such as: global.something.field
#[serde(default, skip_serializing_if = "Option::is_none", rename = "extraParameters")]
pub extra_parameters: Option<Vec<PatternExtraParameters>>,
/// URLs to additional Helm parameter files
#[serde(default, skip_serializing_if = "Option::is_none", rename = "extraValueFiles")]
pub extra_value_files: Option<Vec<String>>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "gitOpsSpec")]
pub git_ops_spec: Option<PatternGitOpsSpec>,
#[serde(rename = "gitSpec")]
pub git_spec: PatternGitSpec,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "multiSourceConfig")]
pub multi_source_config: Option<PatternMultiSourceConfig>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct PatternExtraParameters {
pub name: String,
pub value: String,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct PatternGitOpsSpec {
/// Require manual intervention before Argo will sync new content. Default: False
#[serde(default, skip_serializing_if = "Option::is_none", rename = "manualSync")]
pub manual_sync: Option<bool>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct PatternGitSpec {
/// Optional. FQDN of the git server if automatic parsing from TargetRepo is broken
#[serde(default, skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
/// Upstream git repo containing the pattern to deploy. Used when in-cluster fork to point to the upstream pattern repository
#[serde(default, skip_serializing_if = "Option::is_none", rename = "originRepo")]
pub origin_repo: Option<String>,
/// Branch, tag or commit in the upstream git repository. Does not support short-sha's. Default to HEAD
#[serde(default, skip_serializing_if = "Option::is_none", rename = "originRevision")]
pub origin_revision: Option<String>,
/// Interval in seconds to poll for drifts between origin and target repositories. Default: 180 seconds
#[serde(default, skip_serializing_if = "Option::is_none", rename = "pollInterval")]
pub poll_interval: Option<i64>,
/// Git repo containing the pattern to deploy. Must use https/http
#[serde(rename = "targetRepo")]
pub target_repo: String,
/// Branch, tag, or commit to deploy. Does not support short-sha's. Default: HEAD
#[serde(default, skip_serializing_if = "Option::is_none", rename = "targetRevision")]
pub target_revision: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct PatternMultiSourceConfig {
/// The git reference when deploying the clustergroup helm chart directly from a git repo Defaults to 'main'. (Only used when developing the clustergroup helm chart)
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterGroupChartGitRevision")]
pub cluster_group_chart_git_revision: Option<String>,
/// Which chart version for the clustergroup helm chart Defaults to "0.0.*"
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterGroupChartVersion")]
pub cluster_group_chart_version: Option<String>,
/// The url when deploying the clustergroup helm chart directly from a git repo Defaults to '' which means not used (Only used when developing the clustergroup helm chart)
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterGroupGitRepoUrl")]
pub cluster_group_git_repo_url: Option<String>,
/// (EXPERIMENTAL) Enable multi-source support when deploying the clustergroup argo application
#[serde(default, skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
/// The helm chart url to fetch the helm charts from in order to deploy the pattern Defaults to https://charts.validatedpatterns.io/
#[serde(default, skip_serializing_if = "Option::is_none", rename = "helmRepoUrl")]
pub helm_repo_url: Option<String>,
}

/// PatternStatus defines the observed state of Pattern
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct PatternStatus {
#[serde(default, skip_serializing_if = "Option::is_none", rename = "analyticsSent")]
pub analytics_sent: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "analyticsUUID")]
pub analytics_uuid: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "appClusterDomain")]
pub app_cluster_domain: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub applications: Option<Vec<PatternStatusApplications>>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterDomain")]
pub cluster_domain: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterID")]
pub cluster_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterName")]
pub cluster_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterPlatform")]
pub cluster_platform: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterVersion")]
pub cluster_version: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub conditions: Option<Vec<PatternStatusConditions>>,
/// Last error encountered by the pattern
#[serde(default, skip_serializing_if = "Option::is_none", rename = "lastError")]
pub last_error: Option<String>,
/// Last action related to the pattern
#[serde(default, skip_serializing_if = "Option::is_none", rename = "lastStep")]
pub last_step: Option<String>,
/// Number of updates to the pattern
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<i64>,
}

/// PatternApplicationInfo defines the Applications Status for the Pattern. This structure is part of the PatternStatus as an array The Application Status will be included as part of the Observed state of Pattern
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct PatternStatusApplications {
#[serde(default, skip_serializing_if = "Option::is_none", rename = "healthMessage")]
pub health_message: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "healthStatus")]
pub health_status: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub namespace: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "syncStatus")]
pub sync_status: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct PatternStatusConditions {
/// Last time the condition transitioned from one status to another.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "lastTransitionTime")]
pub last_transition_time: Option<String>,
/// The last time this condition was updated.
#[serde(rename = "lastUpdateTime")]
pub last_update_time: String,
/// A human readable message indicating details about the transition.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
/// Status of the condition, one of True, False, Unknown.
pub status: String,
/// Type of deployment condition.
#[serde(rename = "type")]
pub r#type: String,
}

Loading

0 comments on commit 461c84d

Please sign in to comment.