Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into deprecate-tc-spec…
Browse files Browse the repository at this point in the history
…-fields
  • Loading branch information
metlos committed Oct 1, 2024
2 parents 2e83d9b + 315bbf1 commit 374daa0
Show file tree
Hide file tree
Showing 10 changed files with 363 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @MatousJobanek @xcoulon @alexeykazakov @rajivnathan @ranakan19 @sbryzak @mfrancisc
* @MatousJobanek @xcoulon @alexeykazakov @rajivnathan @ranakan19 @mfrancisc
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/codeready-toolchain/toolchain-e2e

require (
github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27
github.com/codeready-toolchain/api v0.0.0-20240927104325-b5bfcb3cb1b0
github.com/codeready-toolchain/toolchain-common v0.0.0-20240905135929-d55d86fdd41e
github.com/davecgh/go-spew v1.1.1
github.com/fatih/color v1.12.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z
github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo=
github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA=
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27 h1:uEH8HAM81QZBccuqQpGKJUoJQe28+DFSYi/mRKZDYrA=
github.com/codeready-toolchain/api v0.0.0-20240815232340-d0c164a83d27/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E=
github.com/codeready-toolchain/api v0.0.0-20240927104325-b5bfcb3cb1b0 h1:7cXHlRpoi1Owo8fYawl80PUsVWz+9AtMge6OJ4DjvWU=
github.com/codeready-toolchain/api v0.0.0-20240927104325-b5bfcb3cb1b0/go.mod h1:ie9p4LenCCS0LsnbWp6/xwpFDdCWYE0KWzUO6Sk1g0E=
github.com/codeready-toolchain/toolchain-common v0.0.0-20240905135929-d55d86fdd41e h1:xTqyuImyon/P2QfV5NIJDsVkEWqb9b6Ax9INsmzpI1Q=
github.com/codeready-toolchain/toolchain-common v0.0.0-20240905135929-d55d86fdd41e/go.mod h1:aIbki5CFsykeqZn2/ZwvUb3Krx2f2Tbq58R6MGnk6H8=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
Expand Down
21 changes: 21 additions & 0 deletions make/clean.mk
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,24 @@ clean-toolchain-crds:
CRD_NAME=`oc get $${CRD} --template '{{.metadata.name}}'`; \
oc delete crd $${CRD_NAME}; \
done

.PHONY: force-remove-finalizers-from-e2e-resources
## Sometimes after a failed run, the cluster doesn't have our operators running but still contain our resources
## with finalizers. This target removes those finalizers so that the subsequent call to some "clean-*" target
## doesn't get stuck.
## This goal is not called by default so that an attempt to clean up "cleanly" is always attempted first. If that
## fails, you can call this goal explicitly before attempting the cleanup again.
force-remove-finalizers-from-e2e-resources:
$(Q)for CRD in `oc get crd -o name | grep toolchain`; do \
CRD_NAME=`oc get $${CRD} --template='{{.metadata.name}}'`; \
for RES in `oc get $${CRD_NAME} --all-namespaces -ogo-template='{{range .items}}{{.metadata.name}},{{if ne .metadata.namespace nil}}{{.metadata.namespace}}{{else}}{{end}}{{"\n"}}{{end}}'`; do \
NAME=`echo $${RES} | cut -d',' -f1`; \
NS=`echo $${RES} | cut -d',' -f2`; \
if [ -z "$$NS" ]; then \
oc patch $${CRD_NAME} $${NAME} -p '{"metadata":{"finalizers": null}}' --type=merge; \
else \
oc patch $${CRD_NAME} $${NAME} -n $${NS} -p '{"metadata":{"finalizers": null}}' --type=merge; \
fi \
done \
done

6 changes: 5 additions & 1 deletion make/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ vet:

.PHONY: go-test-skip-all
go-test-skip-all:
go test ./... -skip '.*'
go test ./... -skip '.*'

.PHONY: pre-verify
pre-verify:
echo "No Pre-requisite needed"
1 change: 0 additions & 1 deletion make/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ create-host-resources: create-spaceprovisionerconfigs-for-members tiers-via-ksct
-oc apply -f deploy/host-operator/${ENVIRONMENT}/ -n ${HOST_NS}
# patch toolchainconfig to prevent webhook deploy for 2nd member, a 2nd webhook deploy causes the webhook verification in e2e tests to fail
# since e2e environment has 2 member operators running in the same cluster
# for details on how the TOOLCHAINCLUSTER_NAME is composed see https://github.com/codeready-toolchain/toolchain-cicd/blob/master/scripts/add-cluster.sh
if [[ ${SECOND_MEMBER_MODE} == true ]]; then \
TOOLCHAIN_CLUSTER_NAME=`oc get toolchaincluster -n ${HOST_NS} --no-headers -o custom-columns=":metadata.name" | grep "2$$"`; \
if [[ -z $${TOOLCHAIN_CLUSTER_NAME} ]]; then \
Expand Down
5 changes: 2 additions & 3 deletions multicluster_setup.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ toolchain-member-status False ...
[source,bash]
----
# create/configure the ToolchainCluster resources on host and member clusters
$ curl -sSL https://raw.githubusercontent.com/codeready-toolchain/toolchain-common/master/scripts/add-cluster.sh | bash -s -- -t member -mn ${MEMBER_NS} -hn ${HOST_NS}
$ curl -sSL https://raw.githubusercontent.com/codeready-toolchain/toolchain-common/master/scripts/add-cluster.sh | bash -s -- -t host -mn ${MEMBER_NS} -hn ${HOST_NS}
$ ksctl adm register-member --host-ns="${HOST_NS}" --member-ns="${MEMBER_NS}" --host-kubeconfig="${HOME}/.kube/host-config" --member-kubeconfig="${HOME}/.kube/member-config"
# verify
$ oc config use-context host-admin && oc get toolchainstatus -n ${HOST_NS}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/parallel/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ func TestProxyFlow(t *testing.T) {
proxyWorkspaceURL := hostAwait.ProxyURLWithWorkspaceContext("notexist")
hostAwaitWithShorterTimeout := hostAwait.WithRetryOptions(wait.TimeoutOption(time.Second * 3)) // we expect an error so we can use a shorter timeout
_, err := hostAwaitWithShorterTimeout.CreateAPIProxyClient(t, user.token, proxyWorkspaceURL)
require.EqualError(t, err, `an error on the server ("unable to get target cluster: the requested space is not available") has prevented the request from succeeding`)
require.EqualError(t, err, `an error on the server ("unable to get target cluster: access to workspace 'notexist' is forbidden") has prevented the request from succeeding`)
})

t.Run("invalid request headers", func(t *testing.T) {
Expand Down
Loading

0 comments on commit 374daa0

Please sign in to comment.