Skip to content

Commit 2a4859f

Browse files
authored
Merge pull request #7 from IBM/debug
Fix Value reconciliation issue in operator
2 parents 624a5dd + 726ec95 commit 2a4859f

File tree

10 files changed

+7
-167
lines changed

10 files changed

+7
-167
lines changed

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,8 @@ FROM gcr.io/distroless/static:nonroot
3333

3434
ENV OPERATOR=/usr/local/bin/ibm-object-csi-operator \
3535
USER_UID=1001 \
36-
USER_NAME=ibm-object-csi-operator \
37-
IBMObjectCSI_CR_YAML=/usr/local/etc/csi_v1alpha1_ibmobjectcsi.yaml
36+
USER_NAME=ibm-object-csi-operator
3837

39-
COPY --from=builder /workspace/config/samples/csi_v1alpha1_ibmobjectcsi.yaml ${IBMObjectCSI_CR_YAML}
40-
#RUN chmod 0444 ${IBMObjectCSI_CR_YAML}
4138

4239

4340
WORKDIR /

config/manager/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ kind: Kustomization
55
images:
66
- name: controller
77
newName: ambikanair/ibm-object-csi-driver-operator
8-
newTag: rename
8+
newTag: debug

config/samples/csi_v1alpha1_ibmobjectcsi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
# and csi-provisioner, csi-attacher, csi-snapshotter and livenessprobe sidecars.
1414
controller:
1515
repository: icr.io/ibm/ibm-object-csi-driver
16-
tag: "v1.0.2-alpha"
16+
tag: "v1.0.1-alpha"
1717
imagePullPolicy: IfNotPresent
1818
affinity:
1919
nodeAffinity:
@@ -29,7 +29,7 @@ spec:
2929
# and csi-node-driver-registrar and livenessprobe sidecars.
3030
node:
3131
repository: icr.io/ibm/ibm-object-csi-driver
32-
tag: "v1.0.2-alpha"
32+
tag: "v1.0.1-alpha"
3333
imagePullPolicy: Always
3434
affinity:
3535
nodeAffinity:

controllers/ibmobjectcsi_controller.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,6 @@ func (r *IBMObjectCSIReconciler) Reconcile(ctx context.Context, req ctrl.Request
113113
//setting default values for a Kubernetes Custom Resource using the Scheme's Default() method, based on the Go type definition of the Custom Resource.
114114
//This ensures that the CR has all the required fields with default values before further processing or reconciliation by the operator.
115115
r.Scheme.Default(instance.Unwrap())
116-
changed := instance.SetDefaults()
117-
// update CR if there was changes after defaulting
118-
if changed {
119-
err = r.Update(context.TODO(), instance.Unwrap())
120-
if err != nil {
121-
err = fmt.Errorf("failed to update IBMObjectCSI CR: %v", err)
122-
return reconcile.Result{}, err
123-
}
124-
}
125116
if err := r.ControllerHelper.AddFinalizerIfNotPresent(
126117
instance, instance.Unwrap()); err != nil {
127118
return reconcile.Result{}, err

controllers/internal/crutils/default_setter.go

Lines changed: 0 additions & 71 deletions
This file was deleted.

controllers/internal/crutils/ibmobjectcsi.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ func (c *IBMObjectCSI) GetCSINodeImage() string {
8383
return c.Spec.Node.Repository + ":" + c.Spec.Node.Tag
8484
}
8585

86-
func (c *IBMObjectCSI) GetDefaultSidecarImageByName(name string) string {
87-
if sidecar, found := config.DefaultSidecarsByName[name]; found {
88-
return fmt.Sprintf("%s:%s", sidecar.Repository, sidecar.Tag)
89-
}
90-
return ""
91-
}
92-
9386
func (c *IBMObjectCSI) GetCSIControllerSelectorLabels() labels.Set {
9487
return common.GetSelectorLabels(config.CSIController.String())
9588
}

controllers/syncer/csi_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func (s *csiControllerSyncer) getSidecarImageByName(name string) string {
255255
if sidecar != nil {
256256
return fmt.Sprintf("%s:%s", sidecar.Repository, sidecar.Tag)
257257
}
258-
return s.driver.GetDefaultSidecarImageByName(name)
258+
return ""
259259
}
260260

261261
func (s *csiControllerSyncer) getCSIProvisionerImage() string {

controllers/syncer/csi_node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,15 @@ func (s *csiNodeSyncer) getCSINodeDriverRegistrarImage() string {
303303
if sidecar != nil {
304304
return fmt.Sprintf("%s:%s", sidecar.Repository, sidecar.Tag)
305305
}
306-
return s.driver.GetDefaultSidecarImageByName(config.CSINodeDriverRegistrar)
306+
return ""
307307
}
308308

309309
func (s *csiNodeSyncer) getLivenessProbeImage() string {
310310
sidecar := s.getSidecarByName(config.LivenessProbe)
311311
if sidecar != nil {
312312
return fmt.Sprintf("%s:%s", sidecar.Repository, sidecar.Tag)
313313
}
314-
return s.driver.GetDefaultSidecarImageByName(config.LivenessProbe)
314+
return ""
315315
}
316316

317317
func (s *csiNodeSyncer) getCSINodeDriverRegistrarPullPolicy() corev1.PullPolicy {

main.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
objectdriverv1alpha1 "github.ibm.com/alchemy-containers/ibm-object-csi-driver-operator/api/v1alpha1"
3636
"github.ibm.com/alchemy-containers/ibm-object-csi-driver-operator/controllers"
3737
"github.ibm.com/alchemy-containers/ibm-object-csi-driver-operator/controllers/util/common"
38-
operatorConfig "github.ibm.com/alchemy-containers/ibm-object-csi-driver-operator/pkg/config"
3938
//+kubebuilder:scaffold:imports
4039
)
4140

@@ -70,12 +69,6 @@ func main() {
7069

7170
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
7271

73-
err := operatorConfig.LoadDefaultsOfIBMObjectCSI()
74-
if err != nil {
75-
log.Error(err, "Failed to load default IBMObjectCSI custom resource config")
76-
os.Exit(1)
77-
}
78-
7972
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
8073
Scheme: scheme,
8174
Metrics: metricsserver.Options{BindAddress: metricsAddr},

pkg/config/settings.go

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)