From 60da36c3c6ebca5c8876527e8f71f0d41fb8d4b7 Mon Sep 17 00:00:00 2001 From: Francesco Canovai Date: Wed, 13 Nov 2024 15:04:25 +0100 Subject: [PATCH] docs: minor changes Signed-off-by: Francesco Canovai --- api/v1/doc.go | 20 +++++++++++++++++++ api/v1/objectstore_types.go | 8 ++++++-- .../cnpgi/instance/internal/client/client.go | 3 ++- .../cnpgi/instance/internal/client/doc.go | 2 +- internal/cnpgi/instance/manager.go | 2 +- 5 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 api/v1/doc.go diff --git a/api/v1/doc.go b/api/v1/doc.go new file mode 100644 index 0000000..7c10880 --- /dev/null +++ b/api/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The CloudNativePG 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 v1 contains API Schema definitions for the barmancloud v1 API group +// +kubebuilder:object:generate=true +// +groupName=barmancloud.cnpg.io +package v1 diff --git a/api/v1/objectstore_types.go b/api/v1/objectstore_types.go index 713e584..70c2a52 100644 --- a/api/v1/objectstore_types.go +++ b/api/v1/objectstore_types.go @@ -43,6 +43,7 @@ func (i InstanceSidecarConfiguration) GetCacheTTL() int { type ObjectStoreSpec struct { Configuration barmanapi.BarmanObjectStoreConfiguration `json:"configuration"` + // +optional InstanceSidecarConfiguration InstanceSidecarConfiguration `json:"instanceSidecarConfiguration,omitempty"` } @@ -54,13 +55,16 @@ type ObjectStoreStatus struct { // +kubebuilder:object:root=true // +kubebuilder:subresource:status +// +genclient +// +kubebuilder:storageversion // ObjectStore is the Schema for the objectstores API. type ObjectStore struct { metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.ObjectMeta `json:"metadata"` - Spec ObjectStoreSpec `json:"spec,omitempty"` + Spec ObjectStoreSpec `json:"spec"` + // +optional Status ObjectStoreStatus `json:"status,omitempty"` } diff --git a/internal/cnpgi/instance/internal/client/client.go b/internal/cnpgi/instance/internal/client/client.go index 7daf5e3..450179d 100644 --- a/internal/cnpgi/instance/internal/client/client.go +++ b/internal/cnpgi/instance/internal/client/client.go @@ -7,9 +7,10 @@ import ( "time" "github.com/cloudnative-pg/machinery/pkg/log" - v1 "github.com/cloudnative-pg/plugin-barman-cloud/api/v1" corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" + + v1 "github.com/cloudnative-pg/plugin-barman-cloud/api/v1" ) type cachedSecret struct { diff --git a/internal/cnpgi/instance/internal/client/doc.go b/internal/cnpgi/instance/internal/client/doc.go index 6fb4839..dbb2140 100644 --- a/internal/cnpgi/instance/internal/client/doc.go +++ b/internal/cnpgi/instance/internal/client/doc.go @@ -1,3 +1,3 @@ -// Package client provides an extended client that is capable of caching multiple secrets without relying on +// Package client provides an extended client that is capable of caching multiple secrets without relying on // informers package client diff --git a/internal/cnpgi/instance/manager.go b/internal/cnpgi/instance/manager.go index 6e46c57..dfcb75c 100644 --- a/internal/cnpgi/instance/manager.go +++ b/internal/cnpgi/instance/manager.go @@ -2,7 +2,6 @@ package instance import ( "context" - extendedclient "github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/instance/internal/client" "os" "path" @@ -19,6 +18,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" barmancloudv1 "github.com/cloudnative-pg/plugin-barman-cloud/api/v1" + extendedclient "github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/instance/internal/client" ) var scheme = runtime.NewScheme()