-
Notifications
You must be signed in to change notification settings - Fork 195
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
Added Koperator end to end tests #987
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6df5501
test(docs/install): added install e2e test
pregnor bd41f3b
test(docs/install): added localversion 4 Koperator
pregnor bdce649
feat(e2e): added uninstall koperator and dep
bartam1 d9331f2
Refactor after Pregnor PR merge
bartam1 b796dcd
fix based on review Panyuenlau
bartam1 9d78d96
fix: _kubectlRemoveWarnings
bartam1 2cd5d0d
add: description for utils
bartam1 5dd0266
refactor filenames and utils
bartam1 46b2d71
update: go.mod
bartam1 16f2904
fix: _test suffix and listAllK8sResources
bartam1 2b05149
fix: using --output not -o
bartam1 c315b37
remove: checkExistenceOfK8sResource
bartam1 1d66fe3
fix: fn description and extend log
bartam1 d68b2ca
fix: check returned error for waitK8sResourceCondition
bartam1 53694b9
refactor: topic and consume produce
bartam1 cc6b1fc
fix: union to instersect
bartam1 63ed2cd
refactor: uninstall into helmDescriptior
bartam1 3addfae
refactor: using dynamically dependencies CRDs
bartam1 3efc5f9
fix: missing error checks
bartam1 abea29c
formatting: waitK8sResourceCondition
bartam1 b6683a2
refactor: move version type into const.go
bartam1 917afad
formatting: waitK8sResourceCondition
bartam1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
// Copyright © 2023 Cisco Systems, Inc. and/or its affiliates | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package e2e | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
// HelmDescriptors. | ||
var ( | ||
// certManagerHelmDescriptor describes the cert-manager Helm component. | ||
certManagerHelmDescriptor = helmDescriptor{ | ||
Repository: "https://charts.jetstack.io", | ||
ChartName: "cert-manager", | ||
ChartVersion: "v1.11.0", | ||
ReleaseName: "cert-manager", | ||
Namespace: "cert-manager", | ||
SetValues: map[string]string{ | ||
"installCRDs": "true", | ||
}, | ||
RemoteCRDPathVersionTemplate: "https://github.com/jetstack/cert-manager/releases/download/v%s/cert-manager.crds.yaml", | ||
} | ||
|
||
// koperatorLocalHelmDescriptor describes the Koperator Helm component with | ||
// a local chart and version. | ||
koperatorLocalHelmDescriptor = helmDescriptor{ | ||
Repository: "../../charts/kafka-operator", | ||
ChartVersion: LocalVersion, | ||
ReleaseName: "kafka-operator", | ||
Namespace: "kafka", | ||
SetValues: map[string]string{ | ||
"crd.enabled": "true", | ||
}, | ||
LocalCRDSubpaths: []string{"templates/crds.yaml"}, | ||
LocalCRDTemplateRenderValues: map[string]string{ | ||
"crd.enabled": "true", | ||
}, | ||
} | ||
|
||
// koperatorLocalHelmDescriptor describes the Koperator Helm component with | ||
// a remote latest chart and version. | ||
koperatorRemoteLatestHelmDescriptor = helmDescriptor{ //nolint:unused // Note: intentional possibly needed in the future for upgrade test. | ||
Repository: "https://kubernetes-charts.banzaicloud.com", | ||
ChartName: "kafka-operator", | ||
ChartVersion: "", // Note: empty string translates to latest final version. | ||
ReleaseName: "kafka-operator", | ||
Namespace: "kafka", | ||
SetValues: map[string]string{ | ||
"crd.enabled": "true", | ||
}, | ||
RemoteCRDPathVersionTemplate: "https://github.com/banzaicloud/koperator/releases/download/%s/kafka-operator.crds.yaml", | ||
} | ||
|
||
// prometheusOperatorHelmDescriptor describes the prometheus-operator Helm | ||
// component. | ||
prometheusOperatorHelmDescriptor = helmDescriptor{ | ||
Repository: "https://prometheus-community.github.io/helm-charts", | ||
ChartName: "kube-prometheus-stack", | ||
ChartVersion: "42.0.1", | ||
ReleaseName: "prometheus-operator", | ||
Namespace: "prometheus", | ||
SetValues: map[string]string{ | ||
"prometheusOperator.createCustomResource": "true", | ||
"defaultRules.enabled": "false", | ||
"alertmanager.enabled": "false", | ||
"grafana.enabled": "false", | ||
"kubeApiServer.enabled": "false", | ||
"kubelet.enabled": "false", | ||
"kubeControllerManager.enabled": "false", | ||
"coreDNS.enabled": "false", | ||
"kubeEtcd.enabled": "false", | ||
"kubeScheduler.enabled": "false", | ||
"kubeProxy.enabled": "false", | ||
"kubeStateMetrics.enabled": "false", | ||
"nodeExporter.enabled": "false", | ||
"prometheus.enabled": "false", | ||
}, | ||
} | ||
|
||
// zookeeperOperatorHelmDescriptor describes the zookeeper-operator Helm | ||
// component. | ||
zookeeperOperatorHelmDescriptor = helmDescriptor{ | ||
Repository: "https://charts.pravega.io", | ||
ChartName: "zookeeper-operator", | ||
ChartVersion: "0.2.14", | ||
ReleaseName: "zookeeper-operator", | ||
Namespace: "zookeeper", | ||
SetValues: map[string]string{ | ||
"crd.create": "true", | ||
}, | ||
} | ||
|
||
// dependencyCRDs storing the Koperator dependencies CRDs name | ||
// It should be initialized once with the Initialize() member function | ||
dependencyCRDs dependencyCRDsType | ||
|
||
// ErrorNotFound is for handling that error case when resource is not found | ||
ErrorNotFound = errors.New("not found") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really somewhat unsure if we should handle these consts like this. Instead I'd think it would be better to have them locally where they are relevant. Like for example we keep this file for stuff that we use everywhere, like default timeouts, some templates, that sort of thing. We also move all of the other stuff to where they are relevant, like kcat to the listener tests or zookeeper kind to the zookeeper tests.
What do others think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I better like this. I dont have to find const variables in different places especially when they can be used in other test files. Im not sure yet which const variable will be not used in another tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When Im working and dont know have we got const variable for this so far or not then it is better to just check the const.go and use if there is. I dont like to waste time for searching in multiple files.