Skip to content

Commit 1878342

Browse files
authored
feat: remove kam resources from operator (#765)
* feat: remove kam resources from gitops-operator Signed-off-by: saumeya <saumeyakatyal@gmail.com> * remove comments Signed-off-by: saumeya <saumeyakatyal@gmail.com> * bundle Signed-off-by: saumeya <saumeyakatyal@gmail.com> * change Signed-off-by: saumeya <saumeyakatyal@gmail.com> * remove ds_store Signed-off-by: saumeya <saumeyakatyal@gmail.com> * Remove .DS_Store from controllers folder Signed-off-by: saumeya <saumeyakatyal@gmail.com> --------- Signed-off-by: saumeya <saumeyakatyal@gmail.com>
1 parent 991add7 commit 1878342

36 files changed

Lines changed: 33 additions & 826 deletions

bundle/manifests/gitops-operator.clusterserviceversion.yaml

Lines changed: 12 additions & 19 deletions
Large diffs are not rendered by default.

config/manifests/bases/gitops-operator.clusterserviceversion.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,6 @@ spec:
155155
- devtools
156156
- gitops
157157
- pipelines
158-
links:
159-
- name: Day 1 Operations
160-
url: https://github.com/redhat-developer/kam/tree/master/docs/journey/day1
161-
- name: Day 2 Operations
162-
url: https://github.com/redhat-developer/kam/tree/master/docs/journey/day2
163158
maintainers:
164159
- email: shbose@redhat.com
165160
name: shoubhik

config/manifests/patches/description.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
target OpenShift and Kubernetes clusters\n* Support for the Helm and Kustomize
1212
templating tools\n* Configuration drift detection and visualization on live clusters\n*
1313
Audit trails of rollouts to the clusters\n* Monitoring and logging integration
14-
with OpenShift\n* Automated GitOps bootstrapping using Tekton and Argo CD with
15-
[GitOps Application Manager CLI](https://github.com/redhat-developer/kam)\n\n##
16-
Components\n* Argo CD 2.7.6\n* GitOps Application Manager CLI ([download](https://github.com/redhat-developer/kam/releases))\n\n##
14+
with OpenShift\n##Components\n* Argo CD 2.7.6\n\n##
1715
How to Install \nAfter installing the OpenShift GitOps operator, an instance of
1816
Argo CD is installed in the `openshift-gitops` namespace which has sufficent privileges
1917
for managing cluster configurations. You can create additional Argo CD instances

controllers/consoleplugin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const (
4141
kubeAppLabelPartOf = "app.kubernetes.io/part-of"
4242
kubeAppLabelRuntimeNamespace = "app.kubernetes.io/runtime-namespace"
4343
httpdConfigMapName = "httpd-cfg"
44+
kubeAppLabelName = "app.kubernetes.io/name"
4445
)
4546

4647
func getPluginPodSpec() corev1.PodSpec {

controllers/gitopsservice_controller.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,6 @@ func (r *ReconcileGitopsService) Reconcile(ctx context.Context, request reconcil
254254
return result, err
255255
}
256256

257-
if result, err := r.reconcileCLIServer(instance, request); err != nil {
258-
return result, err
259-
}
260-
261257
dynamicPluginStartOCPVersion := os.Getenv(dynamicPluginStartOCPVersionEnv)
262258
if dynamicPluginStartOCPVersion == "" {
263259
dynamicPluginStartOCPVersion = common.DefaultDynamicPluginStartOCPVersion

controllers/gitopsservice_controller_test.go

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -70,26 +70,6 @@ func TestImageFromEnvVariable(t *testing.T) {
7070
}
7171
})
7272

73-
t.Run("Kam Image present as env variable", func(t *testing.T) {
74-
image := "quay.io/org/test"
75-
t.Setenv(cliImageEnvName, image)
76-
77-
deployment := newDeploymentForCLI()
78-
79-
got := deployment.Spec.Template.Spec.Containers[0].Image
80-
if got != image {
81-
t.Errorf("Image mismatch: got %s, want %s", got, image)
82-
}
83-
})
84-
t.Run("env variable for Kam image not found", func(t *testing.T) {
85-
deployment := newDeploymentForCLI()
86-
87-
got := deployment.Spec.Template.Spec.Containers[0].Image
88-
if got != cliImage {
89-
t.Errorf("Image mismatch: got %s, want %s", got, cliImage)
90-
}
91-
})
92-
9373
}
9474

9575
func TestReconcileDefaultForArgoCDNodeplacement(t *testing.T) {
@@ -497,53 +477,6 @@ func TestReconcile_BackendSecurityContext(t *testing.T) {
497477
assert.DeepEqual(t, securityContext, want)
498478
}
499479

500-
func TestReconcile_KamSecurityContext(t *testing.T) {
501-
logf.SetLogger(argocd.ZapLogger(true))
502-
s := scheme.Scheme
503-
addKnownTypesToScheme(s)
504-
505-
util.SetConsoleAPIFound(true)
506-
defer util.SetConsoleAPIFound(false)
507-
508-
// Testing on OCP versions < 4.11.0
509-
fakeClient := fake.NewClientBuilder().WithScheme(s).WithObjects(util.NewClusterVersion("4.12.1"), newGitopsService()).Build()
510-
reconciler := newReconcileGitOpsService(fakeClient, s)
511-
512-
_, err := reconciler.Reconcile(context.TODO(), newRequest("test", "test"))
513-
assertNoError(t, err)
514-
515-
deployment := appsv1.Deployment{}
516-
err = fakeClient.Get(context.TODO(), types.NamespacedName{Name: cliName, Namespace: serviceNamespace}, &deployment)
517-
assertNoError(t, err)
518-
519-
// Testing on OCP versions < 4.11.0
520-
521-
fakeClient = fake.NewClientBuilder().WithScheme(s).WithObjects(util.NewClusterVersion("4.12.1"), newGitopsService()).Build()
522-
reconciler = newReconcileGitOpsService(fakeClient, s)
523-
524-
_, err = reconciler.Reconcile(context.TODO(), newRequest("test", "test"))
525-
assertNoError(t, err)
526-
527-
deployment = appsv1.Deployment{}
528-
err = fakeClient.Get(context.TODO(), types.NamespacedName{Name: cliName, Namespace: serviceNamespace}, &deployment)
529-
assertNoError(t, err)
530-
531-
securityContext := deployment.Spec.Template.Spec.Containers[0].SecurityContext
532-
want := &corev1.SecurityContext{
533-
AllowPrivilegeEscalation: util.BoolPtr(false),
534-
Capabilities: &corev1.Capabilities{
535-
Drop: []corev1.Capability{
536-
"ALL",
537-
},
538-
},
539-
RunAsNonRoot: util.BoolPtr(true),
540-
SeccompProfile: &corev1.SeccompProfile{
541-
Type: corev1.SeccompProfileTypeRuntimeDefault,
542-
},
543-
}
544-
assert.DeepEqual(t, securityContext, want)
545-
}
546-
547480
func TestReconcile_testArgoCDForOperatorUpgrade(t *testing.T) {
548481
logf.SetLogger(argocd.ZapLogger(true))
549482
s := scheme.Scheme

0 commit comments

Comments
 (0)