Skip to content

Commit

Permalink
Cluster's CRDs printing was petrified when kubectl get
Browse files Browse the repository at this point in the history
  • Loading branch information
testisnullus committed Sep 18, 2023
1 parent e5603dd commit 2e130bf
Show file tree
Hide file tree
Showing 19 changed files with 173 additions and 26 deletions.
4 changes: 4 additions & 0 deletions apis/clusters/v1beta1/cadence_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ type CadenceStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="ID",type=string,JSONPath=`.status.id`
//+kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
//+kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`

// Cadence is the Schema for the cadences API
type Cadence struct {
Expand Down
4 changes: 4 additions & 0 deletions apis/clusters/v1beta1/cassandra_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ type CassandraDataCentre struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="ID",type=string,JSONPath=`.status.id`
//+kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
//+kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`

// Cassandra is the Schema for the cassandras API
type Cassandra struct {
Expand Down
4 changes: 4 additions & 0 deletions apis/clusters/v1beta1/kafka_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ type KafkaStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="ID",type=string,JSONPath=`.status.id`
//+kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
//+kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`

// Kafka is the Schema for the kafkas API
type Kafka struct {
Expand Down
4 changes: 4 additions & 0 deletions apis/clusters/v1beta1/kafkaconnect_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ type KafkaConnectStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="ID",type=string,JSONPath=`.status.id`
//+kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
//+kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`

// KafkaConnect is the Schema for the kafkaconnects API
type KafkaConnect struct {
Expand Down
4 changes: 4 additions & 0 deletions apis/clusters/v1beta1/opensearch_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ type OpenSearchStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="ID",type=string,JSONPath=`.status.id`
//+kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
//+kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`

// OpenSearch is the Schema for the opensearches API
type OpenSearch struct {
Expand Down
4 changes: 4 additions & 0 deletions apis/clusters/v1beta1/postgresql_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ type PgStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="ID",type=string,JSONPath=`.status.id`
//+kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
//+kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`

// PostgreSQL is the Schema for the postgresqls API
type PostgreSQL struct {
Expand Down
4 changes: 4 additions & 0 deletions apis/clusters/v1beta1/redis_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ type RedisStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="ID",type=string,JSONPath=`.status.id`
//+kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
//+kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`

// Redis is the Schema for the redis API
type Redis struct {
Expand Down
4 changes: 4 additions & 0 deletions apis/clusters/v1beta1/zookeeper_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ type ZookeeperStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="ID",type=string,JSONPath=`.status.id`
//+kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`
//+kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`

// Zookeeper is the Schema for the zookeepers API
type Zookeeper struct {
Expand Down
15 changes: 14 additions & 1 deletion config/crd/bases/clusters.instaclustr.com_cadences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: cadence
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .status.id
name: ID
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .spec.version
name: Version
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: Cadence is the Schema for the cadences API
Expand Down
15 changes: 14 additions & 1 deletion config/crd/bases/clusters.instaclustr.com_cassandras.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: cassandra
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .status.id
name: ID
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .spec.version
name: Version
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: Cassandra is the Schema for the cassandras API
Expand Down
15 changes: 14 additions & 1 deletion config/crd/bases/clusters.instaclustr.com_kafkaconnects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: kafkaconnect
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .status.id
name: ID
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .spec.version
name: Version
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: KafkaConnect is the Schema for the kafkaconnects API
Expand Down
15 changes: 14 additions & 1 deletion config/crd/bases/clusters.instaclustr.com_kafkas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: kafka
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .status.id
name: ID
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .spec.version
name: Version
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: Kafka is the Schema for the kafkas API
Expand Down
15 changes: 14 additions & 1 deletion config/crd/bases/clusters.instaclustr.com_opensearches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: opensearch
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .status.id
name: ID
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .spec.version
name: Version
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: OpenSearch is the Schema for the opensearches API
Expand Down
15 changes: 14 additions & 1 deletion config/crd/bases/clusters.instaclustr.com_postgresqls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: postgresql
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .status.id
name: ID
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .spec.version
name: Version
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: PostgreSQL is the Schema for the postgresqls API
Expand Down
15 changes: 14 additions & 1 deletion config/crd/bases/clusters.instaclustr.com_redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: redis
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .status.id
name: ID
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .spec.version
name: Version
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: Redis is the Schema for the redis API
Expand Down
15 changes: 14 additions & 1 deletion config/crd/bases/clusters.instaclustr.com_zookeepers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: zookeeper
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .status.id
name: ID
type: string
- jsonPath: .status.state
name: State
type: string
- jsonPath: .spec.version
name: Version
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: Zookeeper is the Schema for the zookeepers API
Expand Down
2 changes: 1 addition & 1 deletion config/samples/clusters_v1beta1_cadence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
# - email: "rostyslp@netapp.com"
privateNetworkCluster: false
dataCentres:
- region: "US_EAST_1"
- region: "US_EAST_2"
network: "10.12.0.0/16"
# if you use multi-region mode please provide
# non-overlapping CIDR block for the secondary mode cluster
Expand Down
6 changes: 3 additions & 3 deletions config/samples/clusters_v1beta1_postgresql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ spec:
# - email: "rostyslp@netapp.com"
# description: "test 222"
slaTier: "NON_PRODUCTION"
userRef:
- namespace: default
name: postgresqluser-sample
# userRef:
# - namespace: default
# name: postgresqluser-sample
privateNetworkCluster: false
synchronousModeStrict: false
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ package openapi

import (
"context"
"errors"
"net/http"
)

// ClusterMaintenanceEventsV2APIService is a service that implements the logic for the ClusterMaintenanceEventsV2APIServicer
Expand All @@ -32,9 +30,14 @@ func (s *ClusterMaintenanceEventsV2APIService) ClusterManagementV2DataSourcesClu
// Add api_cluster_maintenance_events_v2_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.

// TODO: Uncomment the next line to return response Response(200, []ClusterMaintenanceEventsV2{}) or use other options such as http.Ok ...
// return Response(200, []ClusterMaintenanceEventsV2{}), nil

return Response(http.StatusNotImplemented, nil), errors.New("ClusterManagementV2DataSourcesClusterClusterIdMaintenanceEventsV2InProgressV2Get method not implemented")
return Response(200, []ClusterMaintenanceEventsV2{{
MaintenanceEvents: []ClusterMaintenanceEventV2{
{
Id: CreatedID,
},
},
},
}), nil
}

// ClusterManagementV2DataSourcesClusterClusterIdMaintenanceEventsV2PastV2Get -
Expand All @@ -43,9 +46,14 @@ func (s *ClusterMaintenanceEventsV2APIService) ClusterManagementV2DataSourcesClu
// Add api_cluster_maintenance_events_v2_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.

// TODO: Uncomment the next line to return response Response(200, []ClusterMaintenanceEventsV2{}) or use other options such as http.Ok ...
// return Response(200, []ClusterMaintenanceEventsV2{}), nil

return Response(http.StatusNotImplemented, nil), errors.New("ClusterManagementV2DataSourcesClusterClusterIdMaintenanceEventsV2PastV2Get method not implemented")
return Response(200, []ClusterMaintenanceEventsV2{{
MaintenanceEvents: []ClusterMaintenanceEventV2{
{
Id: CreatedID,
},
},
},
}), nil
}

// ClusterManagementV2DataSourcesClusterClusterIdMaintenanceEventsV2UpcomingV2Get -
Expand All @@ -54,9 +62,14 @@ func (s *ClusterMaintenanceEventsV2APIService) ClusterManagementV2DataSourcesClu
// Add api_cluster_maintenance_events_v2_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.

// TODO: Uncomment the next line to return response Response(200, []ClusterMaintenanceEventSchedulesV2{}) or use other options such as http.Ok ...
// return Response(200, []ClusterMaintenanceEventSchedulesV2{}), nil

return Response(http.StatusNotImplemented, nil), errors.New("ClusterManagementV2DataSourcesClusterClusterIdMaintenanceEventsV2UpcomingV2Get method not implemented")
return Response(200, []ClusterMaintenanceEventsV2{{
MaintenanceEvents: []ClusterMaintenanceEventV2{
{
Id: CreatedID,
},
},
},
}), nil
}

// ClusterManagementV2OperationsMaintenanceEventsMaintenanceEventIdV2RescheduleMaintenanceEventV2Put - Reschedule a maintenance event
Expand All @@ -65,7 +78,5 @@ func (s *ClusterMaintenanceEventsV2APIService) ClusterManagementV2OperationsMain
// Add api_cluster_maintenance_events_v2_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.

// TODO: Uncomment the next line to return response Response(200, ClusterMaintenanceEventScheduleV2{}) or use other options such as http.Ok ...
// return Response(200, ClusterMaintenanceEventScheduleV2{}), nil

return Response(http.StatusNotImplemented, nil), errors.New("ClusterManagementV2OperationsMaintenanceEventsMaintenanceEventIdV2RescheduleMaintenanceEventV2Put method not implemented")
return Response(200, ClusterMaintenanceEventScheduleV2{}), nil
}

0 comments on commit 2e130bf

Please sign in to comment.