Skip to content
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

Syncing latest changes from main for kubernetes-csi-addons #233

Merged
merged 16 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,12 @@ resources:
kind: EncryptionKeyRotationCronJob
path: github.com/csi-addons/kubernetes-csi-addons/api/csiaddons/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
controller: true
domain: openshift.io
group: csiaddons
kind: NetworkFenceClass
path: github.com/csi-addons/kubernetes-csi-addons/api/csiaddons/v1alpha1
version: v1alpha1
version: "3"
67 changes: 67 additions & 0 deletions api/csiaddons/v1alpha1/networkfenceclass_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
Copyright 2022 The Kubernetes-CSI-Addons Authors.

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 v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// NetworkFenceClassSpec specifies parameters that an underlying storage system uses
// to get client for network fencing. Upon creating a NetworkFenceClass object, a RPC will be set
// to the storage system that matches the provisioner to get the client for network fencing.
// +kubebuilder:validation:XValidation:rule="has(self.parameters) == has(oldSelf.parameters)",message="parameters are immutable"
type NetworkFenceClassSpec struct {
// Provisioner is the name of storage provisioner
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="provisioner is immutable"
Provisioner string `json:"provisioner"`
// Parameters is a key-value map with storage provisioner specific configurations for
// creating volume replicas
// +kubebuilder:validation:Optional
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="parameters are immutable"
Parameters map[string]string `json:"parameters,omitempty"`
}

// NetworkFenceClassStatus defines the observed state of NetworkFenceClass
type NetworkFenceClassStatus struct {
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster

// NetworkFenceClass is the Schema for the networkfenceclasses API
type NetworkFenceClass struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec NetworkFenceClassSpec `json:"spec,omitempty"`
Status NetworkFenceClassStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// NetworkFenceClassList contains a list of NetworkFenceClass
type NetworkFenceClassList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []NetworkFenceClass `json:"items"`
}

func init() {
SchemeBuilder.Register(&NetworkFenceClass{}, &NetworkFenceClassList{})
}
98 changes: 97 additions & 1 deletion api/csiaddons/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/replication.storage/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "EncryptionKeyRotationCronJob")
os.Exit(1)
}

if err = (&controllers.NetworkFenceClassReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "NetworkFenceClass")
os.Exit(1)
}
//+kubebuilder:scaffold:builder

if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.16.5
name: csiaddonsnodes.csiaddons.openshift.io
spec:
group: csiaddons.openshift.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.16.5
name: encryptionkeyrotationcronjobs.csiaddons.openshift.io
spec:
group: csiaddons.openshift.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.16.5
name: encryptionkeyrotationjobs.csiaddons.openshift.io
spec:
group: csiaddons.openshift.io
Expand Down
74 changes: 74 additions & 0 deletions config/crd/bases/csiaddons.openshift.io_networkfenceclasses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.5
name: networkfenceclasses.csiaddons.openshift.io
spec:
group: csiaddons.openshift.io
names:
kind: NetworkFenceClass
listKind: NetworkFenceClassList
plural: networkfenceclasses
singular: networkfenceclass
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: NetworkFenceClass is the Schema for the networkfenceclasses 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: |-
NetworkFenceClassSpec specifies parameters that an underlying storage system uses
to get client for network fencing. Upon creating a NetworkFenceClass object, a RPC will be set
to the storage system that matches the provisioner to get the client for network fencing.
properties:
parameters:
additionalProperties:
type: string
description: |-
Parameters is a key-value map with storage provisioner specific configurations for
creating volume replicas
type: object
x-kubernetes-validations:
- message: parameters are immutable
rule: self == oldSelf
provisioner:
description: Provisioner is the name of storage provisioner
type: string
x-kubernetes-validations:
- message: provisioner is immutable
rule: self == oldSelf
required:
- provisioner
type: object
x-kubernetes-validations:
- message: parameters are immutable
rule: has(self.parameters) == has(oldSelf.parameters)
status:
description: NetworkFenceClassStatus defines the observed state of NetworkFenceClass
type: object
type: object
served: true
storage: true
subresources:
status: {}
2 changes: 1 addition & 1 deletion config/crd/bases/csiaddons.openshift.io_networkfences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.16.5
name: networkfences.csiaddons.openshift.io
spec:
group: csiaddons.openshift.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.16.5
name: reclaimspacecronjobs.csiaddons.openshift.io
spec:
group: csiaddons.openshift.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.16.5
name: reclaimspacejobs.csiaddons.openshift.io
spec:
group: csiaddons.openshift.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.16.5
name: volumegroupreplicationclasses.replication.storage.openshift.io
spec:
group: replication.storage.openshift.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.16.5
name: volumegroupreplicationcontents.replication.storage.openshift.io
spec:
group: replication.storage.openshift.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.16.5
name: volumegroupreplications.replication.storage.openshift.io
spec:
group: replication.storage.openshift.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.16.5
name: volumereplicationclasses.replication.storage.openshift.io
spec:
group: replication.storage.openshift.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
controller-gen.kubebuilder.io/version: v0.16.5
name: volumereplications.replication.storage.openshift.io
spec:
group: replication.storage.openshift.io
Expand Down
Loading
Loading