Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
test: add more logs to know the kubefedconfig content
Browse files Browse the repository at this point in the history
  • Loading branch information
Hector Fernandez committed Oct 5, 2020
1 parent 7b5efb4 commit 710f39a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/common/crudtester.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ func (c *FederatedTypeCrudTester) getRemoteStatus(fedObject *unstructured.Unstru
}
if resource.Status != nil {
for _, cluster := range resource.Status.Clusters {
c.tl.Logf("Current status of resource for cluster '%s' with value: %v", cluster.Name, resource.Status)
if cluster.Name == clusterName && cluster.Status == status.ClusterPropagationOK {
c.tl.Logf("resource remote status for cluster '%s': %v", cluster.Name, cluster.RemoteStatus)
if cluster.RemoteStatus != nil {
Expand Down
12 changes: 11 additions & 1 deletion test/e2e/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,16 @@ var _ = Describe("Federated", func() {

for _, remoteStatusTypeName := range containedTypeNames {
if typeConfigName == remoteStatusTypeName {

It("should be created, read its remote status and deleted successfully", func() {
kubeFedConfig := &v1beta1.KubeFedConfig{}
client := genericclient.NewForConfigOrDie(f.KubeConfig())
err := client.Get(context.TODO(), kubeFedConfig, f.KubeFedSystemNamespace(), util.KubeFedConfigName)
if err != nil {
tl.Fatalf("Error collecting the kubefedconfig file: %v", err)
}
tl.Logf("Show the content of the kubefedconfig file: '%v'", kubeFedConfig)

typeConfig, testObjectsFunc := getCrudTestInput(f, tl, typeConfigName, fixture)
crudTester, targetObject, overrides := initCrudTest(f, tl, typeConfig, testObjectsFunc)
fedObject := crudTester.CheckCreate(targetObject, overrides)
Expand Down Expand Up @@ -272,7 +281,8 @@ func getCrudTestInput(f framework.KubeFedFramework, tl common.TestLogger,
// Enable the Status Collection for this type of resource
tc := typeConfig.(*v1beta1.FederatedTypeConfig)
for _, typeName := range containedTypeNames {
if tc.Spec.TargetType.Kind == typeName {
tl.Logf("TypeConfig name: %s", tc.GetName())
if tc.GetName() == typeName {
tl.Logf("Enabling remote status collection for %v", typeConfig.GetFederatedType().Kind)
statusCollection := v1beta1.StatusCollectionEnabled
tc.Spec.StatusCollection = &statusCollection
Expand Down

0 comments on commit 710f39a

Please sign in to comment.