Skip to content

Commit

Permalink
enh: check if not implemented
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
  • Loading branch information
acpana committed Jul 16, 2024
1 parent 970419b commit 448a74d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/controller/direct/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package direct
import (
"context"
"fmt"
"strings"

"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/config"
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/registry"
Expand All @@ -42,6 +43,9 @@ func Export(ctx context.Context, url string, config *config.ControllerConfig) (*

u, err := adapter.Export(ctx)
if err != nil {
if strings.Contains(err.Error(), "not supported") {
return nil, nil
}
return nil, err
}

Expand Down
6 changes: 5 additions & 1 deletion pkg/controller/direct/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package registry
import (
"context"
"fmt"
"strings"

"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/config"
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/directbase"
Expand Down Expand Up @@ -62,8 +63,11 @@ func AdapterForURL(ctx context.Context, url string) (directbase.Adapter, error)
}
adapter, err := registration.model.AdapterForURL(ctx, url)
if err != nil {
return nil, err
if !strings.Contains(err.Error(), "not supported") {
return nil, err
}
}

if adapter != nil {
return adapter, nil
}
Expand Down

0 comments on commit 448a74d

Please sign in to comment.