Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft]Verify: verification for splunk upgrade scenario #1195

Open
wants to merge 92 commits into
base: feature-level2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
bed6401
Added changeAnnotation method
tgarg-splunk Jun 14, 2023
7de6f36
Refined changeClusterManagerAnnotations
tgarg-splunk Jun 15, 2023
f4453a1
test case for upgrade scenario
vivekr-splunk Jun 15, 2023
32c385d
Modified kuttl cases
tgarg-splunk Jun 21, 2023
8efb456
Added kuttl tests; Updated LicenseMaster
tgarg-splunk Jun 22, 2023
3c75c99
Fixed uninstall kuttl test
tgarg-splunk Jun 22, 2023
ee474fc
Fixed unit test
tgarg-splunk Jun 22, 2023
35a2eb0
Removed changeAnnotation from licenseMaster
tgarg-splunk Jun 23, 2023
d9540fd
Added branch in int-tests
tgarg-splunk Jun 23, 2023
5a17a5f
Completed code coverage tests
tgarg-splunk Jun 26, 2023
706dc96
Added upgradeScenario and related methods for CM
tgarg-splunk Jun 15, 2023
c5af670
Added label selectors to get Current Image
tgarg-splunk Jun 15, 2023
237ecdf
Changed pod.Spec to pod.Status
tgarg-splunk Jun 15, 2023
5966d87
Added changeAnnotations for MC
tgarg-splunk Jun 21, 2023
b827bd9
Added kuttl test cases
tgarg-splunk Jun 22, 2023
a1159a8
Fixed unit test
tgarg-splunk Jun 23, 2023
3aa032b
Fixed SmartStore unit test
tgarg-splunk Jun 23, 2023
f0e73c8
Added code coverage test
tgarg-splunk Jun 26, 2023
53f6f68
using fake client instead of mock
vivekr-splunk Jun 27, 2023
8301fd9
removed creating statefulset and service
vivekr-splunk Jun 27, 2023
8353d25
Corrected LMCurrentImage method
tgarg-splunk Jun 26, 2023
dab93db
Completed Coverage tests for CM
tgarg-splunk Jun 27, 2023
fb77880
Refined changeClusterManagerAnnotations
tgarg-splunk Jun 15, 2023
b6c70d5
test case for upgrade scenario
vivekr-splunk Jun 15, 2023
6957966
Modified kuttl cases
tgarg-splunk Jun 21, 2023
70c73c2
Added kuttl tests; Updated LicenseMaster
tgarg-splunk Jun 22, 2023
4a945eb
Fixed unit test
tgarg-splunk Jun 22, 2023
a2c9f6d
Removed changeAnnotation from licenseMaster
tgarg-splunk Jun 23, 2023
86baa21
Completed code coverage tests
tgarg-splunk Jun 26, 2023
b24fca7
Resolved all conflict issues
tgarg-splunk Jun 28, 2023
1d0cc57
Added comments
tgarg-splunk Jun 28, 2023
10cc0b6
Updated upgradeScenario to check if statefulSet exists
tgarg-splunk Jun 30, 2023
27ddd67
Fixed Unit tests
tgarg-splunk Jun 30, 2023
3cfce1d
Allow update if no change in image
tgarg-splunk Jun 30, 2023
d8565e3
Added methods and tests for MC
tgarg-splunk Jun 29, 2023
5093bc7
Check if statefulSet exists for MC
tgarg-splunk Jul 6, 2023
ffe679f
Added gateway and clusterManager health model
tgarg-splunk Jul 7, 2023
0378e94
Added common APIs, changed upgrade condition
tgarg-splunk Jul 10, 2023
6904df6
Added provisioner
tgarg-splunk Jul 10, 2023
a116e9c
Added only warning if annotation not found
tgarg-splunk Jul 10, 2023
3695b41
Add warning
tgarg-splunk Jul 10, 2023
43dfc53
Added provisioner to controller
tgarg-splunk Jul 10, 2023
80e6acc
Updated upgradeCondition
tgarg-splunk Jul 11, 2023
d9f912d
Added Warning Phase
tgarg-splunk Jul 11, 2023
3db7d4c
updated changeAnnotation to work with no ref
tgarg-splunk Jul 11, 2023
1c1531a
Fixed unit tests
tgarg-splunk Jul 11, 2023
f9c171f
Handled not found error
tgarg-splunk Jul 11, 2023
e464fc4
Added info and peers endpoint
tgarg-splunk Jul 11, 2023
6c6b995
Added MC functions
tgarg-splunk Jul 12, 2023
e2e4433
Removed blank lines; handled errors in changeAnnotation
tgarg-splunk Jul 12, 2023
fe1d66f
Only call changeAnnotation if LM is ready
tgarg-splunk Jul 12, 2023
4e983b4
Handled errors
tgarg-splunk Jul 12, 2023
4515880
Removed redundant checks
tgarg-splunk Jul 12, 2023
8423f9a
Added tests, conditions
tgarg-splunk Jul 13, 2023
b2d7bc1
Return if CM list is empty
tgarg-splunk Jul 13, 2023
0d178a1
removed superfluous nil err check
tgarg-splunk Jul 13, 2023
77f9a74
Removed branch from workflow
tgarg-splunk Jul 14, 2023
f6323dc
Merge branch 'CSPL-2094-LM-upgrade-strategy' into cspl-2343
tgarg-splunk Jul 14, 2023
130c778
Added branch to workflow
tgarg-splunk Jul 14, 2023
4ea6c0d
Merge branch 'CSPL-2094-LM-upgrade-strategy' into verify
tgarg-splunk Jul 14, 2023
93e5ca0
Fixed test cases
tgarg-splunk Jul 14, 2023
6b33a49
Added provisioner to test cases, added branch to workflow
tgarg-splunk Jul 14, 2023
077f130
Fixed comment
tgarg-splunk Jul 17, 2023
52914dd
Fixed unit test
tgarg-splunk Jul 17, 2023
2091b8b
Added sites, status and server endpoints
tgarg-splunk Jul 17, 2023
bc5354f
updated deployment types
tgarg-splunk Jul 17, 2023
809fc9c
Merge branch 'feature-level2' into verify
tgarg-splunk Jul 17, 2023
b87576b
Merge branch 'cspl-2343' into verify
tgarg-splunk Jul 17, 2023
b7e34c4
Fixed unit tests
tgarg-splunk Jul 17, 2023
dd11793
added few provisioner changes with manager code
vivekr-splunk Jul 20, 2023
bfca12a
changed test cases for controller
vivekr-splunk Jul 20, 2023
070fbee
fixed test case
vivekr-splunk Jul 20, 2023
619e21f
remove mc upgrade code
vivekr-splunk Jul 20, 2023
5d5851a
fixed cm test (only one)
vivekr-splunk Jul 20, 2023
28694ae
fixed cm test
vivekr-splunk Jul 21, 2023
c5bd737
adding conditions and types to all the fields
vivekr-splunk Jul 24, 2023
e692811
added resty for http client
vivekr-splunk Jul 24, 2023
adb2b16
fixed test case
vivekr-splunk Jul 26, 2023
64c601f
fixed meta object argument
vivekr-splunk Jul 26, 2023
37b1f6e
fixed meta object argument
vivekr-splunk Jul 26, 2023
b6620b6
Added maintenance mode
tgarg-splunk Jul 27, 2023
59ad0aa
Fixed controller code
tgarg-splunk Jul 27, 2023
5f96a5c
changes to support lm
vivekr-splunk Aug 1, 2023
1855c51
working license manager verification code
vivekr-splunk Aug 2, 2023
0b0989a
working license manager verification code after PR review
vivekr-splunk Aug 2, 2023
ef92864
Merge branch 'develop' into verify
vivekr-splunk Aug 23, 2023
cb0b5e7
fixed some test cases
vivekr-splunk Aug 23, 2023
74937ec
fixed some test cases
vivekr-splunk Aug 23, 2023
fe0cce8
upgrading go 1.21
vivekr-splunk Sep 11, 2023
fed6f8a
changed ioutils to os
vivekr-splunk Sep 12, 2023
ad0882a
changed few formatting issues
vivekr-splunk Sep 13, 2023
a5ae87f
adding lm to upgrade testing
vivekr-splunk Sep 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/helm-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Helm Test WorkFlow
on:
push:
branches:
- verify
- develop
- main
jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/int-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Integration Test WorkFlow
on:
push:
branches:
- verify
- develop
- main
- feature**
Expand Down
3 changes: 3 additions & 0 deletions api/v3/clustermaster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ type ClusterMasterStatus struct {

// Telemetry App installation flag
TelAppInstalled bool `json:"telAppInstalled"`

// Indicates if the cluster is in maintenance mode.
MaintenanceMode bool `json:"maintenance_mode"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
22 changes: 17 additions & 5 deletions api/v4/clustermanager_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const (
// ClusterManagerPausedAnnotation is the annotation that pauses the reconciliation (triggers
// an immediate requeue)
ClusterManagerPausedAnnotation = "clustermanager.enterprise.splunk.com/paused"
// ClusterManagerPausedAnnotation is the annotation that pauses the reconciliation (triggers
// an immediate requeue)
ClusterManagerMaintenanceAnnotation = "clustermanager.enterprise.splunk.com/maintenance"
)

// ClusterManagerSpec defines the desired state of ClusterManager
Expand Down Expand Up @@ -67,6 +70,15 @@ type ClusterManagerStatus struct {

// Telemetry App installation flag
TelAppInstalled bool `json:"telAppInstalled"`

// Indicates if the cluster is in maintenance mode.
MaintenanceMode bool `json:"maintenanceMode"`

// Conditions represent the latest available observations of an object's state
Conditions []metav1.Condition `json:"conditions"`

// ErrorMessage shows current error if there are any
ErrorMessage string `json:"errorMessage"`
}

// BundlePushInfo Indicates if bundle push required
Expand Down Expand Up @@ -116,13 +128,13 @@ func (cmstr *ClusterManager) NewEvent(eventType, reason, message string) corev1.
return corev1.Event{
ObjectMeta: metav1.ObjectMeta{
GenerateName: reason + "-",
Namespace: cmstr.ObjectMeta.Namespace,
Namespace: cmstr.Namespace,
},
InvolvedObject: corev1.ObjectReference{
Kind: "Clustermanager",
Namespace: cmstr.Namespace,
Name: cmstr.Name,
UID: cmstr.UID,
Kind: "SearchHeadCluster",
vivekr-splunk marked this conversation as resolved.
Show resolved Hide resolved
Namespace: cmstr.GetNamespace(),
Name: cmstr.GetName(),
UID: cmstr.GetUID(),
APIVersion: GroupVersion.String(),
},
Reason: reason,
Expand Down
8 changes: 7 additions & 1 deletion api/v4/indexercluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ type IndexerClusterMemberStatus struct {

// Flag indicating if this peer belongs to the current committed generation and is searchable.
Searchable bool `json:"is_searchable"`

// Conditions represent the latest available observations of an object's state
Conditions []metav1.Condition `json:"conditions"`

// ErrorMessage shows current error if there are any
ErrorMessage string `json:"errorMessage"`
}

// IndexerClusterStatus defines the observed state of a Splunk Enterprise indexer cluster
Expand Down Expand Up @@ -152,7 +158,7 @@ func (icstr *IndexerCluster) NewEvent(eventType, reason, message string) corev1.
return corev1.Event{
ObjectMeta: metav1.ObjectMeta{
GenerateName: reason + "-",
Namespace: icstr.ObjectMeta.Namespace,
Namespace: icstr.Namespace,
},
InvolvedObject: corev1.ObjectReference{
Kind: "IndexerCluster",
Expand Down
8 changes: 7 additions & 1 deletion api/v4/licensemanager_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ type LicenseManagerStatus struct {

// Telemetry App installation flag
TelAppInstalled bool `json:"telAppInstalled"`

// Conditions represent the latest available observations of an object's state
Conditions []metav1.Condition `json:"conditions"`

// ErrorMessage shows current error if there are any
ErrorMessage string `json:"errorMessage"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -91,7 +97,7 @@ func (lmstr *LicenseManager) NewEvent(eventType, reason, message string) corev1.
return corev1.Event{
ObjectMeta: metav1.ObjectMeta{
GenerateName: reason + "-",
Namespace: lmstr.ObjectMeta.Namespace,
Namespace: lmstr.Namespace,
},
InvolvedObject: corev1.ObjectReference{
Kind: "LicenseManager",
Expand Down
16 changes: 11 additions & 5 deletions api/v4/monitoringconsole_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ type MonitoringConsoleStatus struct {

// App Framework status
AppContext AppDeploymentContext `json:"appContext,omitempty"`

// Conditions represent the latest available observations of an object's state
Conditions []metav1.Condition `json:"conditions"`

// ErrorMessage shows current error if there are any
ErrorMessage string `json:"errorMessage"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -99,13 +105,13 @@ func (mcnsl *MonitoringConsole) NewEvent(eventType, reason, message string) core
return corev1.Event{
ObjectMeta: metav1.ObjectMeta{
GenerateName: reason + "-",
Namespace: mcnsl.ObjectMeta.Namespace,
Namespace: mcnsl.Namespace,
},
InvolvedObject: corev1.ObjectReference{
Kind: "MonitoringConsole",
Namespace: mcnsl.Namespace,
Name: mcnsl.Name,
UID: mcnsl.UID,
Kind: "SearchHeadCluster",
Namespace: mcnsl.GetNamespace(),
Name: mcnsl.GetName(),
UID: mcnsl.GetUID(),
APIVersion: GroupVersion.String(),
},
Reason: reason,
Expand Down
14 changes: 10 additions & 4 deletions api/v4/searchheadcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ type SearchHeadClusterSpec struct {

// Splunk Enterprise App repository. Specifies remote App location and scope for Splunk App management
AppFrameworkConfig AppFrameworkSpec `json:"appRepo,omitempty"`

// Conditions represent the latest available observations of an object's state
Conditions []metav1.Condition `json:"conditions"`

// ErrorMessage shows current error if there are any
ErrorMessage string `json:"errorMessage"`
}

// SearchHeadClusterMemberStatus is used to track the status of each search head cluster member
Expand Down Expand Up @@ -161,13 +167,13 @@ func (shcstr *SearchHeadCluster) NewEvent(eventType, reason, message string) cor
return corev1.Event{
ObjectMeta: metav1.ObjectMeta{
GenerateName: reason + "-",
Namespace: shcstr.ObjectMeta.Namespace,
Namespace: shcstr.GetNamespace(),
},
InvolvedObject: corev1.ObjectReference{
Kind: "SearchHeadCluster",
Namespace: shcstr.Namespace,
Name: shcstr.Name,
UID: shcstr.UID,
Namespace: shcstr.GetNamespace(),
Name: shcstr.GetName(),
UID: shcstr.GetUID(),
APIVersion: GroupVersion.String(),
},
Reason: reason,
Expand Down
16 changes: 11 additions & 5 deletions api/v4/standalone_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ type StandaloneSpec struct {

// Splunk Enterprise App repository. Specifies remote App location and scope for Splunk App management
AppFrameworkConfig AppFrameworkSpec `json:"appRepo,omitempty"`

// Conditions represent the latest available observations of an object's state
Conditions []metav1.Condition `json:"conditions"`

// ErrorMessage shows current error if there are any
ErrorMessage string `json:"errorMessage"`
}

// StandaloneStatus defines the observed state of a Splunk Enterprise standalone instances.
Expand Down Expand Up @@ -115,13 +121,13 @@ func (standln *Standalone) NewEvent(eventType, reason, message string) corev1.Ev
return corev1.Event{
ObjectMeta: metav1.ObjectMeta{
GenerateName: reason + "-",
Namespace: standln.ObjectMeta.Namespace,
Namespace: standln.Namespace,
},
InvolvedObject: corev1.ObjectReference{
Kind: "Standalone",
Namespace: standln.Namespace,
Name: standln.Name,
UID: standln.UID,
Kind: "SearchHeadCluster",
Namespace: standln.GetNamespace(),
Name: standln.GetName(),
UID: standln.GetUID(),
APIVersion: GroupVersion.String(),
},
Reason: reason,
Expand Down
59 changes: 52 additions & 7 deletions api/v4/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading