From 027c5a4c0ca7917a08ab554b3fe5ab1f7db4388b Mon Sep 17 00:00:00 2001 From: ashish111333 Date: Sat, 3 Aug 2024 04:38:11 +0530 Subject: [PATCH 1/4] adds printer columns for cyclops modules --- cyclops-ctrl/api/v1alpha1/module_types.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cyclops-ctrl/api/v1alpha1/module_types.go b/cyclops-ctrl/api/v1alpha1/module_types.go index f53611db..d31b8e4b 100644 --- a/cyclops-ctrl/api/v1alpha1/module_types.go +++ b/cyclops-ctrl/api/v1alpha1/module_types.go @@ -94,8 +94,11 @@ type HistoryEntry struct { Values apiextensionsv1.JSON `json:"values"` } -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printercolumn:name="reconcilation-status",type=string,JSONpath=`.status.ReconcilationStatus.Status` +// +kubebuilder:printercolumn:name="path",type=string,JSONpath=`.spec.template.path` +// +kubebuilder:printercolumn:name="version",type=string,JSONpath=`.spec.template.version` // Module is the Schema for the modules API type Module struct { From aafd86042ec6bb585401aaeebf2f9fd84d4a0e86 Mon Sep 17 00:00:00 2001 From: ashish111333 Date: Sat, 3 Aug 2024 20:19:05 +0530 Subject: [PATCH 2/4] minor fix --- cyclops-ctrl/api/v1alpha1/module_types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyclops-ctrl/api/v1alpha1/module_types.go b/cyclops-ctrl/api/v1alpha1/module_types.go index d31b8e4b..9d0e5c82 100644 --- a/cyclops-ctrl/api/v1alpha1/module_types.go +++ b/cyclops-ctrl/api/v1alpha1/module_types.go @@ -96,7 +96,7 @@ type HistoryEntry struct { // +kubebuilder:object:root=true // +kubebuilder:subresource:status -// +kubebuilder:printercolumn:name="reconcilation-status",type=string,JSONpath=`.status.ReconcilationStatus.Status` +// +kubebuilder:printercolumn:name="reconcilation-status",type=string,JSONpath=`.status.reconcilationStatus.Status` // +kubebuilder:printercolumn:name="path",type=string,JSONpath=`.spec.template.path` // +kubebuilder:printercolumn:name="version",type=string,JSONpath=`.spec.template.version` From 79ed9c873d24d4c7b42f3ba52157f64ecd3d0890 Mon Sep 17 00:00:00 2001 From: ashish111333 Date: Sun, 4 Aug 2024 17:45:02 +0530 Subject: [PATCH 3/4] changed controller-gen version --- cyclops-ctrl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyclops-ctrl/Makefile b/cyclops-ctrl/Makefile index 3ddace4e..5082d7fc 100644 --- a/cyclops-ctrl/Makefile +++ b/cyclops-ctrl/Makefile @@ -132,7 +132,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions KUSTOMIZE_VERSION ?= v5.0.0 -CONTROLLER_TOOLS_VERSION ?= v0.11.3 +CONTROLLER_TOOLS_VERSION ?= v0.14.0 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" .PHONY: kustomize From cf6095bfcea8d9f80e1bb320c2472b62092089de Mon Sep 17 00:00:00 2001 From: ashish111333 Date: Sun, 4 Aug 2024 17:49:48 +0530 Subject: [PATCH 4/4] "ran make manifests and make generate" --- .../api/v1alpha1/zz_generated.deepcopy.go | 1 - .../crd/bases/cyclops-ui.com_modules.yaml | 20 +++++---- .../cyclops-ui.com_templateauthrules.yaml | 42 +++++++++++++------ .../bases/cyclops-ui.com_templatestores.yaml | 20 +++++---- cyclops-ctrl/config/rbac/role.yaml | 1 - 5 files changed, 54 insertions(+), 30 deletions(-) diff --git a/cyclops-ctrl/api/v1alpha1/zz_generated.deepcopy.go b/cyclops-ctrl/api/v1alpha1/zz_generated.deepcopy.go index 09676bab..0bce7172 100644 --- a/cyclops-ctrl/api/v1alpha1/zz_generated.deepcopy.go +++ b/cyclops-ctrl/api/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2023. diff --git a/cyclops-ctrl/config/crd/bases/cyclops-ui.com_modules.yaml b/cyclops-ctrl/config/crd/bases/cyclops-ui.com_modules.yaml index 898e8f72..426f786b 100644 --- a/cyclops-ctrl/config/crd/bases/cyclops-ui.com_modules.yaml +++ b/cyclops-ctrl/config/crd/bases/cyclops-ui.com_modules.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: modules.cyclops-ui.com spec: group: cyclops-ui.com @@ -21,9 +20,11 @@ spec: description: Module is the Schema for the modules 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' + 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 history: items: @@ -53,9 +54,12 @@ spec: type: object type: array 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' + 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 diff --git a/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templateauthrules.yaml b/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templateauthrules.yaml index 64a78303..293e73e7 100644 --- a/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templateauthrules.yaml +++ b/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templateauthrules.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: templateauthrules.cyclops-ui.com spec: group: cyclops-ui.com @@ -21,14 +20,19 @@ spec: description: TemplateAuthRule is the Schema for the modules 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' + 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' + 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 @@ -43,8 +47,15 @@ spec: valid secret key. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + TODO: Add other useful fields. apiVersion, kind, uid? + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. type: string optional: description: Specify whether the Secret or its key must be defined @@ -63,8 +74,15 @@ spec: valid secret key. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + TODO: Add other useful fields. apiVersion, kind, uid? + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. type: string optional: description: Specify whether the Secret or its key must be defined diff --git a/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml b/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml index b2df7e5b..e213d22d 100644 --- a/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml +++ b/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: templatestores.cyclops-ui.com spec: group: cyclops-ui.com @@ -22,14 +21,19 @@ spec: as a starting point 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' + 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' + 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 diff --git a/cyclops-ctrl/config/rbac/role.yaml b/cyclops-ctrl/config/rbac/role.yaml index 450664da..c4d0d040 100644 --- a/cyclops-ctrl/config/rbac/role.yaml +++ b/cyclops-ctrl/config/rbac/role.yaml @@ -2,7 +2,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - creationTimestamp: null name: manager-role rules: - apiGroups: