-
Notifications
You must be signed in to change notification settings - Fork 7
✨ scaffold fleetconfig v1beta1 resources and webhooks #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-bot
merged 6 commits into
open-cluster-management-io:main
from
arturshadnik:refactor/v1beta1
Aug 22, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a52dcd9
feat: scaffold v1beta1 resources and webhooks
arturshadnik c6291f2
refactor: use a single gate for enabling all webhooks
arturshadnik 02383cd
fix: use correct api group in config manifests
arturshadnik 8e29130
fix: use correct api group in config manifests
arturshadnik 81579c5
chore: remove unused 'config' dir; write crds directly to helm chart
arturshadnik ca38e04
chore: config stuff
arturshadnik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Code generated by tool. DO NOT EDIT. | ||
| # This file is used to track the info used to scaffold your project | ||
| # and allow the plugins properly work. | ||
| # More info: https://book.kubebuilder.io/reference/project-config.html | ||
| cliVersion: v4.7.1 | ||
| layout: | ||
| - go.kubebuilder.io/v4 | ||
| projectName: fleetconfig-controller | ||
| repo: github.com/open-cluster-management-io/lab/fleetconfig-controller | ||
| resources: | ||
| - api: | ||
| crdVersion: v1 | ||
| namespaced: true | ||
| group: fleetconfig.open-cluster-management.io | ||
| kind: FleetConfig | ||
| path: github.com/open-cluster-management-io/lab/fleetconfig-controller/api/v1alpha1 | ||
| version: v1alpha1 | ||
| webhooks: | ||
| defaulting: true | ||
| validation: true | ||
| webhookVersion: v1 | ||
| - api: | ||
| crdVersion: v1 | ||
| group: fleetconfig.open-cluster-management.io | ||
| kind: Hub | ||
| path: github.com/open-cluster-management-io/lab/fleetconfig-controller/api/v1beta1 | ||
| version: v1beta1 | ||
| webhooks: | ||
| defaulting: true | ||
| validation: true | ||
| webhookVersion: v1 | ||
| - api: | ||
| crdVersion: v1 | ||
| group: fleetconfig.open-cluster-management.io | ||
| kind: Spoke | ||
| path: github.com/open-cluster-management-io/lab/fleetconfig-controller/api/v1beta1 | ||
| version: v1beta1 | ||
| webhooks: | ||
| defaulting: true | ||
| validation: true | ||
| webhookVersion: v1 | ||
| version: "3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| Copyright 2024. | ||
|
|
||
| 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 v1beta1 contains API Schema definitions for the v1beta1 API group. | ||
| // +kubebuilder:object:generate=true | ||
| // +groupName=fleetconfig.open-cluster-management.io | ||
| package v1beta1 | ||
|
|
||
| import ( | ||
| "k8s.io/apimachinery/pkg/runtime/schema" | ||
| "sigs.k8s.io/controller-runtime/pkg/scheme" | ||
| ) | ||
|
|
||
| var ( | ||
| // GroupVersion is group version used to register these objects. | ||
| GroupVersion = schema.GroupVersion{Group: "fleetconfig.open-cluster-management.io", Version: "v1beta1"} | ||
|
|
||
| // SchemeBuilder is used to add go types to the GroupVersionKind scheme. | ||
| SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} | ||
|
|
||
| // AddToScheme adds the types in this group-version to the given scheme. | ||
| AddToScheme = SchemeBuilder.AddToScheme | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| /* | ||
| Copyright 2024. | ||
| 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 v1beta1 | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
| // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
|
||
| // HubSpec defines the desired state of Hub | ||
| type HubSpec struct { | ||
| // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
| // Important: Run "make" to regenerate code after modifying this file | ||
| // The following markers will use OpenAPI v3 schema to validate the value | ||
| // More info: https://book.kubebuilder.io/reference/markers/crd-validation.html | ||
|
|
||
| // foo is an example field of Hub. Edit hub_types.go to remove/update | ||
| // +optional | ||
| Foo *string `json:"foo,omitempty"` | ||
| } | ||
|
|
||
| // HubStatus defines the observed state of Hub. | ||
| type HubStatus struct { | ||
| // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
| // Important: Run "make" to regenerate code after modifying this file | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:resource:scope=Cluster | ||
|
|
||
| // Hub is the Schema for the hubs API | ||
| type Hub struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
|
|
||
| // metadata is a standard object metadata | ||
| // +optional | ||
| metav1.ObjectMeta `json:"metadata,omitempty,omitzero"` | ||
|
|
||
| // spec defines the desired state of Hub | ||
| // +required | ||
| Spec HubSpec `json:"spec"` | ||
|
|
||
| // status defines the observed state of Hub | ||
| // +optional | ||
| Status HubStatus `json:"status,omitempty,omitzero"` | ||
| } | ||
TylerGillson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // +kubebuilder:object:root=true | ||
|
|
||
| // HubList contains a list of Hub | ||
| type HubList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []Hub `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| SchemeBuilder.Register(&Hub{}, &HubList{}) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| /* | ||
| Copyright 2024. | ||
|
|
||
| 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 v1beta1 | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
| // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
|
||
| // SpokeSpec defines the desired state of Spoke | ||
| type SpokeSpec struct { | ||
| // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
| // Important: Run "make" to regenerate code after modifying this file | ||
| // The following markers will use OpenAPI v3 schema to validate the value | ||
| // More info: https://book.kubebuilder.io/reference/markers/crd-validation.html | ||
|
|
||
| // foo is an example field of Spoke. Edit spoke_types.go to remove/update | ||
| // +optional | ||
| Foo *string `json:"foo,omitempty"` | ||
| } | ||
|
|
||
| // SpokeStatus defines the observed state of Spoke. | ||
| type SpokeStatus struct { | ||
| // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
| // Important: Run "make" to regenerate code after modifying this file | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:resource:path=spokes,scope=Cluster | ||
|
|
||
| // Spoke is the Schema for the spokes API | ||
| type Spoke struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
|
|
||
| // metadata is a standard object metadata | ||
| // +optional | ||
| metav1.ObjectMeta `json:"metadata,omitempty,omitzero"` | ||
|
|
||
| // spec defines the desired state of Spoke | ||
| // +required | ||
| Spec SpokeSpec `json:"spec"` | ||
|
|
||
| // status defines the observed state of Spoke | ||
| // +optional | ||
| Status SpokeStatus `json:"status,omitempty,omitzero"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
|
|
||
| // SpokeList contains a list of Spoke | ||
| type SpokeList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []Spoke `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| SchemeBuilder.Register(&Spoke{}, &SpokeList{}) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.