Skip to content

Commit

Permalink
remove unused OLM catalog rollout code
Browse files Browse the repository at this point in the history
  • Loading branch information
sjenning committed May 16, 2023
1 parent 69ec30b commit 590b145
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 136 deletions.
Expand Up @@ -2977,25 +2977,6 @@ func (r *HostedControlPlaneReconciler) reconcileOperatorLifecycleManager(ctx con
}); err != nil {
return fmt.Errorf("failed to reconcile red hat operators deployment: %w", err)
}

catalogRolloutSA := manifests.CatalogRolloutServiceAccount(hcp.Namespace)
if _, err := createOrUpdate(ctx, r, catalogRolloutSA, func() error {
return olm.ReconcileCatalogRolloutServiceAccount(catalogRolloutSA, p.OwnerRef)
}); err != nil {
return fmt.Errorf("failed to reconcile catalog rollout service account: %w", err)
}
catalogRolloutRole := manifests.CatalogRolloutRole(hcp.Namespace)
if _, err := createOrUpdate(ctx, r, catalogRolloutRole, func() error {
return olm.ReconcileCatalogRolloutRole(catalogRolloutRole, p.OwnerRef)
}); err != nil {
return fmt.Errorf("failed to reconcile catalog rollout role: %w", err)
}
catalogRolloutRoleBinding := manifests.CatalogRolloutRoleBinding(hcp.Namespace)
if _, err := createOrUpdate(ctx, r, catalogRolloutRoleBinding, func() error {
return olm.ReconcileCatalogRolloutRoleBinding(catalogRolloutRoleBinding, p.OwnerRef)
}); err != nil {
return fmt.Errorf("failed to reconcile catalog rollout rolebinding: %w", err)
}
}

catalogOperatorMetricsService := manifests.CatalogOperatorMetricsService(hcp.Namespace)
Expand Down
Expand Up @@ -39,15 +39,6 @@ func CertifiedOperatorsService(ns string) *corev1.Service {
}
}

func CertifiedOperatorsCronJob(ns string) *batchv1.CronJob {
return &batchv1.CronJob{
ObjectMeta: metav1.ObjectMeta{
Name: "certified-operators-catalog-rollout",
Namespace: ns,
},
}
}

// Community Operators Catalog

func CommunityOperatorsDeployment(ns string) *appsv1.Deployment {
Expand All @@ -68,15 +59,6 @@ func CommunityOperatorsService(ns string) *corev1.Service {
}
}

func CommunityOperatorsCronJob(ns string) *batchv1.CronJob {
return &batchv1.CronJob{
ObjectMeta: metav1.ObjectMeta{
Name: "community-operators-catalog-rollout",
Namespace: ns,
},
}
}

// RedHatMarketplace Operators Catalog

func RedHatMarketplaceOperatorsDeployment(ns string) *appsv1.Deployment {
Expand All @@ -97,15 +79,6 @@ func RedHatMarketplaceOperatorsService(ns string) *corev1.Service {
}
}

func RedHatMarketplaceOperatorsCronJob(ns string) *batchv1.CronJob {
return &batchv1.CronJob{
ObjectMeta: metav1.ObjectMeta{
Name: "redhat-marketplace-catalog-rollout",
Namespace: ns,
},
}
}

// RedHat Operators Catalog

func RedHatOperatorsDeployment(ns string) *appsv1.Deployment {
Expand All @@ -126,44 +99,6 @@ func RedHatOperatorsService(ns string) *corev1.Service {
}
}

func RedHatOperatorsCronJob(ns string) *batchv1.CronJob {
return &batchv1.CronJob{
ObjectMeta: metav1.ObjectMeta{
Name: "redhat-operators-catalog-rollout",
Namespace: ns,
},
}
}

// Catalog Rollout

func CatalogRolloutRole(ns string) *rbacv1.Role {
return &rbacv1.Role{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog-rollout",
Namespace: ns,
},
}
}

func CatalogRolloutRoleBinding(ns string) *rbacv1.RoleBinding {
return &rbacv1.RoleBinding{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog-rollout",
Namespace: ns,
},
}
}

func CatalogRolloutServiceAccount(ns string) *corev1.ServiceAccount {
return &corev1.ServiceAccount{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog-rollout",
Namespace: ns,
},
}
}

// Catalog Operator

func CatalogOperatorMetricsService(ns string) *corev1.Service {
Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -14,7 +14,6 @@ import (
imagev1 "github.com/openshift/api/image/v1"

corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"

"github.com/openshift/hypershift/support/certs"
"github.com/openshift/hypershift/support/config"
Expand Down Expand Up @@ -165,29 +164,6 @@ func generateModularDailyCronSchedule(input []byte) string {
return fmt.Sprintf("%d %d * * *", m.Int64(), h.Int64())
}

var (
catalogRolloutRole = assets.MustRole(content.ReadFile, "assets/catalog-rollout.role.yaml")
catalogRolloutRoleBinding = assets.MustRoleBinding(content.ReadFile, "assets/catalog-rollout.rolebinding.yaml")
)

func ReconcileCatalogRolloutServiceAccount(sa *corev1.ServiceAccount, ownerRef config.OwnerRef) error {
ownerRef.ApplyTo(sa)
return nil
}

func ReconcileCatalogRolloutRole(role *rbacv1.Role, ownerRef config.OwnerRef) error {
ownerRef.ApplyTo(role)
role.Rules = catalogRolloutRole.DeepCopy().Rules
return nil
}

func ReconcileCatalogRolloutRoleBinding(roleBinding *rbacv1.RoleBinding, ownerRef config.OwnerRef) error {
ownerRef.ApplyTo(roleBinding)
roleBinding.RoleRef = catalogRolloutRoleBinding.DeepCopy().RoleRef
roleBinding.Subjects = catalogRolloutRoleBinding.DeepCopy().Subjects
return nil
}

func ReconcileCatalogServiceMonitor(sm *prometheusoperatorv1.ServiceMonitor, ownerRef config.OwnerRef, clusterID string, metricsSet metrics.MetricsSet) error {
ownerRef.ApplyTo(sm)

Expand Down

0 comments on commit 590b145

Please sign in to comment.