Skip to content

Commit

Permalink
add openshift/ptp-operator
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Hoß <[email protected]>
  • Loading branch information
sebhoss committed Apr 5, 2024
1 parent 2bc67ab commit 77df02a
Show file tree
Hide file tree
Showing 12 changed files with 346 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,10 @@ Files: crd-catalog/openshift/managed-upgrade-operator/*
Copyright: The openshift/managed-upgrade-operator Authors
License: Apache-2.0

Files: crd-catalog/openshift/ptp-operator/*
Copyright: The openshift/ptp-operator Authors
License: Apache-2.0

Files: crd-catalog/otterize/helm-charts/*
Copyright: The otterize/helm-charts Authors
License: Apache-2.0
Expand Down
9 changes: 9 additions & 0 deletions code-generator/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2447,6 +2447,15 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[
"https://github.com/openshift/managed-upgrade-operator/blob/master/deploy/crds/upgrade.managed.openshift.io_upgradeconfigs.yaml",
],
},
UpstreamSource {
project_name: "openshift/ptp-operator",
license: APACHE_V2,
urls: &[
"https://github.com/openshift/ptp-operator/blob/master/config/crd/bases/ptp.openshift.io_nodeptpdevices.yaml",
"https://github.com/openshift/ptp-operator/blob/master/config/crd/bases/ptp.openshift.io_ptpconfigs.yaml",
"https://github.com/openshift/ptp-operator/blob/master/config/crd/bases/ptp.openshift.io_ptpoperatorconfigs.yaml",
],
},
UpstreamSource {
project_name: "otterize/helm-charts",
license: APACHE_V2,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
apiVersion: "apiextensions.k8s.io/v1"
kind: "CustomResourceDefinition"
metadata:
annotations:
controller-gen.kubebuilder.io/version: "v0.9.2"
name: "nodeptpdevices.ptp.openshift.io"
spec:
group: "ptp.openshift.io"
names:
kind: "NodePtpDevice"
listKind: "NodePtpDeviceList"
plural: "nodeptpdevices"
singular: "nodeptpdevice"
scope: "Namespaced"
versions:
- name: "v1"
schema:
openAPIV3Schema:
description: "NodePtpDevice is the Schema for the nodeptpdevices 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: "NodePtpDeviceSpec defines the desired state of NodePtpDevice"
type: "object"
status:
description: "NodePtpDeviceStatus defines the observed state of NodePtpDevice"
properties:
devices:
description: "INSERT ADDITIONAL STATUS FIELD - define observed state of cluster Important: Run \"make\" to regenerate code after modifying this file"
items:
properties:
name:
type: "string"
profile:
type: "string"
type: "object"
type: "array"
hwconfig:
items:
properties:
config:
x-kubernetes-preserve-unknown-fields: true
deviceID:
type: "string"
failed:
type: "boolean"
status:
type: "string"
vendorID:
type: "string"
type: "object"
type: "array"
type: "object"
type: "object"
served: true
storage: true
subresources:
status: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Error: unknown empty dict type for plugins
138 changes: 138 additions & 0 deletions crd-catalog/openshift/ptp-operator/ptp.openshift.io/v1/ptpconfigs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
apiVersion: "apiextensions.k8s.io/v1"
kind: "CustomResourceDefinition"
metadata:
annotations:
controller-gen.kubebuilder.io/version: "v0.9.2"
name: "ptpconfigs.ptp.openshift.io"
spec:
group: "ptp.openshift.io"
names:
kind: "PtpConfig"
listKind: "PtpConfigList"
plural: "ptpconfigs"
singular: "ptpconfig"
scope: "Namespaced"
versions:
- name: "v1"
schema:
openAPIV3Schema:
description: "PtpConfig is the Schema for the ptpconfigs 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: "PtpConfigSpec defines the desired state of PtpConfig"
properties:
profile:
items:
properties:
interface:
type: "string"
name:
type: "string"
phc2sysConf:
type: "string"
phc2sysOpts:
type: "string"
plugins:
additionalProperties:
x-kubernetes-preserve-unknown-fields: true
type: "object"
ptp4lConf:
type: "string"
ptp4lOpts:
type: "string"
ptpClockThreshold:
properties:
holdOverTimeout:
default: 5
description: "clock state to stay in holdover state in secs"
format: "int64"
type: "integer"
maxOffsetThreshold:
default: 100
description: "max offset in nano secs"
format: "int64"
type: "integer"
minOffsetThreshold:
default: -100
description: "min offset in nano secs"
format: "int64"
type: "integer"
type: "object"
ptpSchedulingPolicy:
enum:
- "SCHED_OTHER"
- "SCHED_FIFO"
type: "string"
ptpSchedulingPriority:
format: "int64"
maximum: 65.0
minimum: 1.0
type: "integer"
ptpSettings:
additionalProperties:
type: "string"
type: "object"
ts2phcConf:
type: "string"
ts2phcOpts:
type: "string"
required:
- "name"
type: "object"
type: "array"
recommend:
items:
properties:
match:
items:
properties:
nodeLabel:
type: "string"
nodeName:
type: "string"
type: "object"
type: "array"
priority:
format: "int64"
type: "integer"
profile:
type: "string"
required:
- "priority"
- "profile"
type: "object"
type: "array"
required:
- "profile"
- "recommend"
type: "object"
status:
description: "PtpConfigStatus defines the observed state of PtpConfig"
properties:
matchList:
description: "INSERT ADDITIONAL STATUS FIELD - define observed state of cluster Important: Run \"make\" to regenerate code after modifying this file"
items:
properties:
nodeName:
type: "string"
profile:
type: "string"
required:
- "nodeName"
- "profile"
type: "object"
type: "array"
type: "object"
type: "object"
served: true
storage: true
subresources:
status: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Error: unknown empty dict type for plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: "apiextensions.k8s.io/v1"
kind: "CustomResourceDefinition"
metadata:
annotations:
controller-gen.kubebuilder.io/version: "v0.9.2"
name: "ptpoperatorconfigs.ptp.openshift.io"
spec:
group: "ptp.openshift.io"
names:
kind: "PtpOperatorConfig"
listKind: "PtpOperatorConfigList"
plural: "ptpoperatorconfigs"
singular: "ptpoperatorconfig"
scope: "Namespaced"
versions:
- additionalPrinterColumns:
- description: "Event Enabled"
jsonPath: ".spec.ptpEventConfig.enableEventPublisher"
name: "Event Enabled"
type: "boolean"
name: "v1"
schema:
openAPIV3Schema:
description: "PtpOperatorConfig is the Schema for the ptpoperatorconfigs 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: "PtpOperatorConfigSpec defines the desired state of PtpOperatorConfig"
properties:
daemonNodeSelector:
additionalProperties:
type: "string"
type: "object"
plugins:
additionalProperties:
x-kubernetes-preserve-unknown-fields: true
type: "object"
ptpEventConfig:
description: "EventConfig to configure event sidecar"
properties:
enableEventPublisher:
default: false
description: "EnableEventPublisher will deploy event proxy as a sidecar"
type: "boolean"
storageType:
description: "StorageType is the name of StorageClass providing persist storage used by HTTP transport to store subscription data"
type: "string"
transportHost:
description: "TransportHost format is <protocol>://<transport-service>.<namespace>.svc.cluster.local:<transport-port> Example HTTP transport: \"http://ptp-event-publisher-service-NODE_NAME.openshift-ptp.svc.cluster.local:9043\" Example AMQP transport: \"amqp://amq-router-service-name.amq-namespace.svc.cluster.local\""
type: "string"
type: "object"
required:
- "daemonNodeSelector"
type: "object"
status:
description: "PtpOperatorConfigStatus defines the observed state of PtpOperatorConfig"
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 @@ -308,6 +308,7 @@ projectcontour_io = []
prometheusservice_services_k8s_aws = []
ps_percona_com = []
psmdb_percona_com = []
ptp_openshift_io = []
pxc_percona_com = []
quay_redhat_com = []
quota_codeflare_dev = []
Expand Down
7 changes: 7 additions & 0 deletions kube-custom-resources-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2454,6 +2454,11 @@ apiVersion `psmdb.percona.com/v1`:
- `PerconaServerMongoDBBackup`
- `PerconaServerMongoDBRestore`
## ptp_openshift_io
apiVersion `ptp.openshift.io/v1`:
- `NodePtpDevice`
## pxc_percona_com
apiVersion `pxc.percona.com/v1`:
Expand Down Expand Up @@ -3681,6 +3686,8 @@ pub mod prometheusservice_services_k8s_aws;
pub mod ps_percona_com;
#[cfg(feature = "psmdb_percona_com")]
pub mod psmdb_percona_com;
#[cfg(feature = "ptp_openshift_io")]
pub mod ptp_openshift_io;
#[cfg(feature = "pxc_percona_com")]
pub mod pxc_percona_com;
#[cfg(feature = "quay_redhat_com")]
Expand Down
1 change: 1 addition & 0 deletions kube-custom-resources-rs/src/ptp_openshift_io/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod v1;
1 change: 1 addition & 0 deletions kube-custom-resources-rs/src/ptp_openshift_io/v1/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod nodeptpdevices;
49 changes: 49 additions & 0 deletions kube-custom-resources-rs/src/ptp_openshift_io/v1/nodeptpdevices.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --filename=./crd-catalog/openshift/ptp-operator/ptp.openshift.io/v1/nodeptpdevices.yaml --derive=Default --derive=PartialEq
// kopium version: 0.17.2

use kube::CustomResource;
use serde::{Serialize, Deserialize};
use std::collections::HashMap;

/// NodePtpDeviceSpec defines the desired state of NodePtpDevice
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "ptp.openshift.io", version = "v1", kind = "NodePtpDevice", plural = "nodeptpdevices")]
#[kube(namespaced)]
#[kube(status = "NodePtpDeviceStatus")]
#[kube(schema = "disabled")]
pub struct NodePtpDeviceSpec {
}

/// NodePtpDeviceStatus defines the observed state of NodePtpDevice
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct NodePtpDeviceStatus {
/// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster Important: Run "make" to regenerate code after modifying this file
#[serde(default, skip_serializing_if = "Option::is_none")]
pub devices: Option<Vec<NodePtpDeviceStatusDevices>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub hwconfig: Option<Vec<NodePtpDeviceStatusHwconfig>>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct NodePtpDeviceStatusDevices {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub profile: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct NodePtpDeviceStatusHwconfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config: Option<HashMap<String, serde_json::Value>>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "deviceID")]
pub device_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub failed: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "vendorID")]
pub vendor_id: Option<String>,
}

0 comments on commit 77df02a

Please sign in to comment.