Skip to content

Conversation

gaurav-splunk
Copy link
Collaborator

@gaurav-splunk gaurav-splunk commented Aug 17, 2021

This PR targets the manual trigger for app update. Here are the key changes -

  1. Polling of app updates can be disabled by setting appsRepoPollInterval=0.
  2. Now, all the CRs, with appFramework enabled, in the initial reconcile will either create a configMap(if not created) or will update the already existing configMap with the manual app update status for that CR and the refCount(i.e. the total number of CRs of that kind in the cluster in that namespace).
  3. We can enable manual trigger for one time by editing the configMap and setting the status to on for that CR.
  4. Once the checking for app update is done, we reset the status for that CR back to off again.

Here is how the configMap looks like for a ClusterMaster and a Standalone CR type -

apiVersion: v1
data:
  ClusterMaster: |-
    status: off
    refCount: 1
  Standalone: |-
    status: off
    refCount: 1
kind: ConfigMap
metadata:
  creationTimestamp: "2021-08-16T23:40:06Z"
  name: splunk-manual-app-update
  namespace: default
  ownerReferences:
  - apiVersion: enterprise.splunk.com/v2
    controller: false
    kind: Standalone
    name: stand1
    uid: b1c5646b-ab53-499f-bf37-fef55118325a
  - apiVersion: enterprise.splunk.com/v2
    controller: false
    kind: ClusterMaster
    name: cm
    uid: 2f3a2671-d872-492b-9b52-9b7538d28a44
  resourceVersion: "73859037"
  selfLink: /api/v1/namespaces/default/configmaps/splunk-manual-app-update
  uid: c25d86b1-746b-47c0-b5f2-8319e2ad6e46

Current Limitation:
All the CRs of the same type with app framework enabled should be either using the manual app update or should be using the polling interval. We might target the mixed behavior in coming releases as an improvement.

@gaurav-splunk gaurav-splunk changed the base branch from develop to feature-appframework August 17, 2021 07:13
@sgontla
Copy link
Contributor

sgontla commented Aug 25, 2021

Had a discussion with @gaurav-splunk , and went through the changes. Some cases(which are not straightforward), will be considered later. Other than that as RemoveConfigMapOwnerRef() is not being used here(We are retaining the configMap when the last CR is deleted), and @kashok-splunk already has the required code for this area, we don't need here.

@smohan-splunk smohan-splunk merged commit 00df9b4 into feature-appframework Aug 25, 2021
gaurav-splunk added a commit that referenced this pull request Sep 22, 2021
* CSPL-1221: Manual trigger for app update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants