Commit d4598ed0 authored by Konstantinos Samaras-Tsakiris's avatar Konstantinos Samaras-Tsakiris
Browse files

Watch labels

parent dcb67303
Pipeline #2285859 passed with stages
in 9 minutes and 54 seconds
......@@ -29,8 +29,12 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
m_metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
m_labels "k8s.io/apimachinery/pkg/labels"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/builder"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
)
......@@ -143,6 +147,8 @@ func (r *DrupalSiteReconciler) Reconcile(ctx context.Context, req ctrl.Request)
func (r *DrupalSiteReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&webservicesv1a1.DrupalSite{}).
Owns(&buildv1.BuildConfig{}, builder.WithPredicates(predicate.LabelSelectorPredicate(m_metav1.SetAsLabelSelector(m_labels.Set{"key": "value"}))).
Owns(&imagev1.ImageStream{}).
Owns(&appsv1.DeploymentConfig{}).
Owns(&corev1.Service{}).
Owns(&corev1.PersistentVolumeClaim{}).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment