Skip to content

Commit

Permalink
- Remove injectable configmap creation
Browse files Browse the repository at this point in the history
- Generate `deploy.go`
- Fix old bundle path references

Signed-off-by: Ben <[email protected]>
  • Loading branch information
Neon-White committed Apr 2, 2024
1 parent 3277d01 commit ef708c9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 26 deletions.
2 changes: 1 addition & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
mountPath: /var/run/secrets/openshift/serviceaccount
readOnly: true
- name: ocp-injected-ca-bundle
mountPath: /etc/pki/ca-trust/extracted/pem
mountPath: /etc/ocp-injected-ca-bundle.crt
subPath: ocp-injected-ca-bundle.crt
# SHOULD BE RETURNED ONCE COSI IS BACK
# - name: socket
Expand Down
5 changes: 3 additions & 2 deletions pkg/bundle/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3740,7 +3740,7 @@ spec:
skipServiceCheck: true
`

const Sha256_deploy_internal_configmap_ca_inject_yaml = "75f8ab503a683bcebd2ed6a2c9f8da0a4c174a62b4e6ca7e97ebc3da847ca866"
const Sha256_deploy_internal_configmap_ca_inject_yaml = "fac2305a04146c6b553398b1cb69b3ee2f32c5735359f5102590d43d33ccecba"

const File_deploy_internal_configmap_ca_inject_yaml = `apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -6005,7 +6005,7 @@ spec:
sourceNamespace: default
`

const Sha256_deploy_operator_yaml = "1a2c110adc6763047d158e9021ea716e8d16ce734c0302c569b02e114189dff8"
const Sha256_deploy_operator_yaml = "a15f459bcb91b03052ebc5f4ed062619c27f6adc245038a4317b05a69b280516"

const File_deploy_operator_yaml = `apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -6585,3 +6585,4 @@ metadata:
app: prometheus-adapter
name: custom-metrics-prometheus-adapter
`

24 changes: 2 additions & 22 deletions pkg/system/phase2_creating.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ func (r *Reconciler) ReconcilePhaseCreating() error {
"noobaa operator started phase 2/4 - \"Creating\"",
)

if err := r.ReconcileCAInject(); err != nil {
return err
}
if err := r.ReconcileObject(r.ServiceAccount, r.SetDesiredServiceAccount); err != nil {
return err
}
Expand Down Expand Up @@ -483,7 +480,7 @@ func (r *Reconciler) SetDesiredCoreApp() error {
if util.KubeCheckQuiet(r.CaBundleConf) {
configMapVolumeMounts := []corev1.VolumeMount{{
Name: r.CaBundleConf.Name,
MountPath: "/etc/pki/ca-trust/extracted/pem",
MountPath: "/etc/ocp-injected-ca-bundle.crt",
ReadOnly: true,
}}
util.MergeVolumeMountList(&c.VolumeMounts, &configMapVolumeMounts)
Expand Down Expand Up @@ -524,7 +521,7 @@ func (r *Reconciler) SetDesiredCoreApp() error {
if util.KubeCheckQuiet(r.CaBundleConf) {
configMapVolumeMounts := []corev1.VolumeMount{{
Name: r.CaBundleConf.Name,
MountPath: "/etc/pki/ca-trust/extracted/pem",
MountPath: "/etc/ocp-injected-ca-bundle.crt",
ReadOnly: true,
}}
util.MergeVolumeMountList(&c.VolumeMounts, &configMapVolumeMounts)
Expand Down Expand Up @@ -830,23 +827,6 @@ func (r *Reconciler) ReconcileIBMCredentials() error {
return nil
}

// ReconcileCAInject checks if a namespace called openshift-config exist (OCP)
// if so creates a cofig map for OCP to inject supported CAs to
func (r *Reconciler) ReconcileCAInject() error {
ocpConfigNamespace := &corev1.Namespace{
TypeMeta: metav1.TypeMeta{Kind: "Namespace"},
ObjectMeta: metav1.ObjectMeta{
Name: "openshift-config",
},
}
if util.KubeCheckQuiet(ocpConfigNamespace) {
r.Logger.Infof("Found openshift-config ns - will reconcile CA inject configmap: %q", r.CaBundleConf.Name)
if err := r.ReconcileObject(r.CaBundleConf, nil); err != nil {
return err
}
}
return nil
}

// SetDesiredAgentProfile updates the value of the AGENT_PROFILE env
func (r *Reconciler) SetDesiredAgentProfile(profileString string) string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/system/phase4_configuring.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ func (r *Reconciler) setDesiredEndpointMounts(podSpec *corev1.PodSpec, container
util.MergeVolumeList(&podSpec.Volumes, &configMapVolumes)
configMapVolumeMounts := []corev1.VolumeMount{{
Name: r.CaBundleConf.Name,
MountPath: "/etc/pki/ca-trust/extracted/pem",
MountPath: "/etc/ocp-injected-ca-bundle.crt",
ReadOnly: true,
}}
util.MergeVolumeMountList(&container.VolumeMounts, &configMapVolumeMounts)
Expand Down

0 comments on commit ef708c9

Please sign in to comment.