Skip to content

Commit d52eb28

Browse files
authored
CSI: Recover the workloads with stale COS Volume (#2)
* bump dependencies Signed-off-by: Ashima-Ashima1 <[email protected]> * stale volume issue fix Signed-off-by: Ashima-Ashima1 <[email protected]> * stale volume issue fix Signed-off-by: Ashima-Ashima1 <[email protected]> * stale volume issue fix Signed-off-by: Ashima-Ashima1 <[email protected]> * stale volume issue fix Signed-off-by: Ashima-Ashima1 <[email protected]> * stale volume issue fix Signed-off-by: Ashima-Ashima1 <[email protected]> * stale volume issue fix Signed-off-by: Ashima-Ashima1 <[email protected]> * stale volume issue fix Signed-off-by: Ashima-Ashima1 <[email protected]> * update copyright Signed-off-by: Ashima-Ashima1 <[email protected]> --------- Signed-off-by: Ashima-Ashima1 <[email protected]>
1 parent ad19b9d commit d52eb28

27 files changed

+1732
-1268
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
124124
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
125125
.PHONY: docker-build
126126
docker-build: test ## Build docker image with the manager.
127-
docker build -t ${IMG} .
127+
docker build -t ${IMG} . --platform linux/amd64
128128

129129
.PHONY: docker-push
130130
docker-push: ## Push docker image with the manager.
@@ -184,7 +184,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
184184

185185
## Tool Versions
186186
KUSTOMIZE_VERSION ?= v3.8.7
187-
CONTROLLER_TOOLS_VERSION ?= v0.11.1
187+
CONTROLLER_TOOLS_VERSION ?= v0.14.0
188188

189189
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
190190
.PHONY: kustomize

PROJECT

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,13 @@ resources:
2020
kind: IBMObjectCSI
2121
path: github.ibm.com/alchemy-containers/ibm-object-csi-driver-operator/api/v1alpha1
2222
version: v1alpha1
23+
- api:
24+
crdVersion: v1
25+
namespaced: true
26+
controller: true
27+
domain: ibm.com
28+
group: csi
29+
kind: FixStaleVolume
30+
path: github.ibm.com/alchemy-containers/ibm-object-csi-driver-operator/api/v1alpha1
31+
version: v1alpha1
2332
version: "3"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
7878

7979
## License
8080

81-
Copyright 2023.
81+
Copyright 2024.
8282

8383
Licensed under the Apache License, Version 2.0 (the "License");
8484
you may not use this file except in compliance with the License.

api/v1alpha1/fixstalevolume_types.go

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
Copyright 2024.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
25+
26+
// FixStaleVolumeSpec defines the desired state of FixStaleVolume
27+
28+
type FixStaleVolumeSpec struct {
29+
NoOfLogLines int64 `json:"noOfLogLines,omitempty"`
30+
Deployment []DeploymentData `json:"deploymentData,omitempty"`
31+
}
32+
33+
type DeploymentData struct {
34+
DeploymentName string `json:"deploymentName,omitempty"`
35+
DeploymentNamespace string `json:"deploymentNamespace,omitempty"`
36+
}
37+
38+
// FixStaleVolumeStatus defines the observed state of FixStaleVolume
39+
type FixStaleVolumeStatus struct {
40+
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
41+
// Important: Run "make" to regenerate code after modifying this file
42+
}
43+
44+
//+kubebuilder:object:root=true
45+
//+kubebuilder:subresource:status
46+
47+
// FixStaleVolume is the Schema for the fixstalevolumes API
48+
type FixStaleVolume struct {
49+
metav1.TypeMeta `json:",inline"`
50+
metav1.ObjectMeta `json:"metadata,omitempty"`
51+
52+
Spec FixStaleVolumeSpec `json:"spec,omitempty"`
53+
Status FixStaleVolumeStatus `json:"status,omitempty"`
54+
}
55+
56+
//+kubebuilder:object:root=true
57+
58+
// FixStaleVolumeList contains a list of FixStaleVolume
59+
type FixStaleVolumeList struct {
60+
metav1.TypeMeta `json:",inline"`
61+
metav1.ListMeta `json:"metadata,omitempty"`
62+
Items []FixStaleVolume `json:"items"`
63+
}
64+
65+
func init() {
66+
SchemeBuilder.Register(&FixStaleVolume{}, &FixStaleVolumeList{})
67+
}

api/v1alpha1/groupversion_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2023.
2+
Copyright 2024.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

api/v1alpha1/ibmobjectcsi_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2023.
2+
Copyright 2024.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 110 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.14.0
7+
name: fixstalevolumes.csi.ibm.com
8+
spec:
9+
group: csi.ibm.com
10+
names:
11+
kind: FixStaleVolume
12+
listKind: FixStaleVolumeList
13+
plural: fixstalevolumes
14+
singular: fixstalevolume
15+
scope: Namespaced
16+
versions:
17+
- name: v1alpha1
18+
schema:
19+
openAPIV3Schema:
20+
description: FixStaleVolume is the Schema for the fixstalevolumes API
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
properties:
41+
deploymentData:
42+
items:
43+
properties:
44+
deploymentName:
45+
type: string
46+
deploymentNamespace:
47+
type: string
48+
type: object
49+
type: array
50+
noOfLogLines:
51+
format: int64
52+
type: integer
53+
type: object
54+
status:
55+
description: FixStaleVolumeStatus defines the observed state of FixStaleVolume
56+
type: object
57+
type: object
58+
served: true
59+
storage: true
60+
subresources:
61+
status: {}

0 commit comments

Comments
 (0)