forked from konflux-ci/e2e-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: RHTAPBUGS-941 and RTAPBUGS-942 Merge pkg/apis and pkg/clients i…
…n one folder under /pkg/clients + All interaction with RHTAP controllers should not be placed in utils folder (konflux-ci#880) * RHTAPBUGS-941 and RTAPBUGS-942 * improvements * fix "Implicit memory aliasing in for loop." * update Guidelines.md * split pkg/utils/util.go * fix * fix Potential HTTP request made with variable url
- Loading branch information
Showing
105 changed files
with
994 additions
and
925 deletions.
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
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
pkg/utils/common/controller.go → pkg/clients/common/controller.go
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
File renamed without changes.
File renamed without changes.
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,60 @@ | ||
package common | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"time" | ||
|
||
toolchainv1alpha1 "github.com/codeready-toolchain/api/api/v1alpha1" | ||
"github.com/redhat-appstudio/e2e-tests/pkg/utils" | ||
"github.com/redhat-appstudio/e2e-tests/pkg/utils/common" | ||
|
||
k8sErrors "k8s.io/apimachinery/pkg/api/errors" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/types" | ||
) | ||
|
||
// CreateProxyPlugin creates an object of ProxyPlugin for the OpenShift route target | ||
func (s *SuiteController) CreateProxyPlugin(proxyPluginName, proxyPluginNamespace, routeName, routeNamespace string) (*toolchainv1alpha1.ProxyPlugin, error) { | ||
// Create the ProxyPlugin object | ||
proxyPlugin := common.NewProxyPlugin(proxyPluginName, proxyPluginNamespace, routeName, routeNamespace) | ||
|
||
if err := s.KubeRest().Create(context.Background(), proxyPlugin); err != nil { | ||
return nil, fmt.Errorf("unable to create proxy plugin due to %v", err) | ||
} | ||
return proxyPlugin, nil | ||
} | ||
|
||
// DeleteProxyPlugin deletes the ProxyPlugin object | ||
func (s *SuiteController) DeleteProxyPlugin(proxyPluginName, proxyPluginNamespace string) (bool, error) { | ||
proxyPlugin := &toolchainv1alpha1.ProxyPlugin{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: proxyPluginName, | ||
Namespace: proxyPluginNamespace, | ||
}, | ||
} | ||
|
||
if err := s.KubeRest().Delete(context.Background(), proxyPlugin); err != nil { | ||
return false, err | ||
} | ||
err := utils.WaitUntil(func() (done bool, err error) { | ||
err = s.KubeRest().Get(context.Background(), types.NamespacedName{ | ||
Namespace: proxyPluginNamespace, | ||
Name: proxyPluginName, | ||
}, proxyPlugin) | ||
|
||
if err != nil { | ||
if k8sErrors.IsNotFound(err) { | ||
return true, nil | ||
} | ||
return false, fmt.Errorf("deletion of proxy plugin has been timedout:: %v", err) | ||
} | ||
return false, nil | ||
}, 5*time.Minute) | ||
|
||
if err != nil { | ||
return false, err | ||
} | ||
|
||
return true, nil | ||
} |
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
pkg/utils/gitops/controller.go → pkg/clients/gitops/controller.go
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
pkg/utils/imagecontroller/controller.go → pkg/clients/imagecontroller/controller.go
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
pkg/utils/integration/controller.go → pkg/clients/integration/controller.go
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.