splunk / splunk-operator

Splunk Operator for Kubernetes
Other
210 stars 115 forks source link

CSPL-2626 - Github issue #1284, #1326 - Initialize phase early, update aws-sdk-go, CR status change #1335

Closed akondur closed 4 months ago

akondur commented 5 months ago

Solving Github issue 1284 and Github issue 1326

Example of Standalone with invalid spec showing the error message in the CR fields.

Spec:

apiVersion: enterprise.splunk.com/v4
kind: Standalone
metadata:
  name: ido
  finalizers:
  - enterprise.splunk.com/delete-pvc
spec:
  replicas: 1
  appRepo:
    appInstallPeriodSeconds: 90
    appSources:
    - location: custom/
      name: custom
      scope: local
      volumeName: csh
    - location: base/
      name: base
      scope: local
      volumeName: csh
    appsRepoPollIntervalSeconds: 120
    installMaxRetries: 3
    volumes:
    - endpoint: https://s3-eu-central-1.amazonaws.com
      name: splunkapps
      path: bucketname/splunk-apps/csh
      provider: aws
      region: eu-central-1
      storageType: s

CR Status/kubectl showing the right values:

bash% k get stdaln -o yaml | grep -i message -A 5 -B 5
      appsStatusMaxConcurrentAppDownloads: 5
      bundlePushStatus: {}
      isDeploymentInProgress: false
      lastAppInfoCheckTime: 0
      version: 0
    message: 'invalid Volume Name for App Source: custom. volume: csh, doesn''t exist'
    phase: Error
    readyReplicas: 0
    replicas: 0
    resourceRevMap: {}
    selector: ""
bash% kubectl get stdaln
NAME   PHASE   DESIRED   READY   AGE   MESSAGE
ido    Error   0         0       26s   invalid Volume Name for App Source: custom. volume: csh, doesn't exist