Skip to content
  • Stephen Greene's avatar
    ingress: Reconcile openshift-ingress namespace on upgrade · ea085e72
    Stephen Greene authored
    Commits `263c2aaf` and `35052567` added new annotations and labels to the
    openshift-ingress namespace, which is managed by the ingress-operator.
    
    This commit adds logic to reconcile the openshift-ingress namespace
    resource during cluster upgrades. To prevent overwriting changes made to
    the namespace resource by other controllers (or cluster-admins), the
    namespace reconciliation logic added in this commit explicitly syncs
    namespace labels and annotations that the operator sets.
    
    pkg/operator/controller/ingress/namespace.go:
    
    Refactor `ensureRouterNamespace` so that it handles creating and updating
    the openshift-ingress namespace resource (and nothing else).
    
    Add new functions: `currentRouterNamespace`, `updateRouterNamespace`, &
    `routerNamespaceChanged`.
    
    Move existing Service Account and Cluster Role Binding creation logic
    into new functions, `ensureRouterServiceAccount`, and
    `ensureRouterClusterRoleBinding`.
    
    pkg/operator/controller/ingress/controller.go:
    
    Update `ensureRouterNamespace` calling site. Add new calling sites
    for `ensureRouterServiceAccount` and `ensureRouterClusterRoleBinding`.
    
    This commit resolves Bug 1954330.
    ea085e72