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

Add e2e test for IPBlocksInfo #983

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 pkg/apis/vpc/v1alpha1/ipblocksinfo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

// +genclient
// +genclient:nonNamespaced
//+kubebuilder:object:root=true
//+kubebuilder:resource:scope="Cluster",path=ipblocksinfos

Expand Down

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

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

14 changes: 2 additions & 12 deletions pkg/client/clientset/versioned/typed/vpc/v1alpha1/ipblocksinfo.go

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

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

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

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

4 changes: 0 additions & 4 deletions pkg/client/listers/vpc/v1alpha1/expansion_generated.go

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

43 changes: 6 additions & 37 deletions pkg/client/listers/vpc/v1alpha1/ipblocksinfo.go

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

7 changes: 2 additions & 5 deletions test/e2e/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,15 +620,12 @@ func deleteYAML(filename string, ns string) error {
// tags should be present in pairs, the first tag is the scope, the second tag is the value
// caller should transform the response to the expected resource type
func (data *TestData) queryResource(resourceType string, tags []string) (model.SearchResponse, error) {
tagScopeClusterKey := strings.Replace(common.TagScopeNamespace, "/", "\\/", -1)
tagScopeClusterValue := strings.Replace(tags[0], ":", "\\:", -1)
tagParam := fmt.Sprintf("tags.scope:%s AND tags.tag:%s", tagScopeClusterKey, tagScopeClusterValue)
resourceParam := fmt.Sprintf("%s:%s", common.ResourceType, resourceType)
queryParam := resourceParam + " AND " + tagParam
queryParam := resourceParam
if len(tags) >= 2 {
tagscope := strings.Replace(tags[0], "/", "\\/", -1)
tagtag := strings.Replace(tags[1], ":", "\\:", -1)
tagParam = fmt.Sprintf("tags.scope:%s AND tags.tag:%s", tagscope, tagtag)
tagParam := fmt.Sprintf("tags.scope:%s AND tags.tag:%s", tagscope, tagtag)
queryParam = resourceParam + " AND " + tagParam
}
queryParam += " AND marked_for_delete:false"
Expand Down
Loading
Loading