Skip to content

Commit 61e3381

Browse files
etabaktzvatot
authored andcommitted
OCM-17277 | feat: Use deprecation transport to handle backend API deprecation
1 parent 784b40e commit 61e3381

File tree

3 files changed

+4
-264
lines changed

3 files changed

+4
-264
lines changed

pkg/ocm/connection-builder/connection.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"fmt"
1818

1919
"github.com/golang/glog"
20+
"github.com/openshift-online/ocm-common/pkg/deprecation"
2021
sdk "github.com/openshift-online/ocm-sdk-go"
2122
"github.com/openshift-online/ocm-sdk-go/logging"
2223

@@ -120,6 +121,9 @@ func (b *ConnectionBuilder) Build() (result *sdk.Connection, err error) {
120121
func (b *ConnectionBuilder) initConnectionBuilderFromConfig() *sdk.ConnectionBuilder {
121122
builder := sdk.NewConnectionBuilder()
122123

124+
// Add deprecation transport wrapper to automatically handle deprecation headers
125+
builder.TransportWrapper(deprecation.NewTransportWrapper())
126+
123127
// Prepare the builder for the connection adding only the properties that have explicit
124128
// values in the configuration, so that default values won't be overridden:
125129
if b.cfg.TokenURL != "" {

pkg/ocm/deprecation.go

Lines changed: 0 additions & 116 deletions
This file was deleted.

pkg/ocm/deprecation_test.go

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)