Skip to content

Commit 48472c0

Browse files
committed
move annotation code to pkg/kubernetes
On-behalf-of: @SAP christoph.mewes@sap.com
1 parent 012dbd1 commit 48472c0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

pkg/generic/generic.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import (
3939
mcreconcile "sigs.k8s.io/multicluster-runtime/pkg/reconcile"
4040

4141
brokerv1alpha1 "github.com/platform-mesh/resource-broker/api/broker/v1alpha1"
42+
"github.com/platform-mesh/resource-broker/pkg/kubernetes"
4243
brokerutils "github.com/platform-mesh/resource-broker/pkg/utils"
4344
)
4445

@@ -551,7 +552,7 @@ func (gr *genericReconciler) newProvider(ctx context.Context, consumerObj *unstr
551552
if err != nil {
552553
return fmt.Errorf("failed to get resource from consumer cluster %q: %w", gr.consumerName, err)
553554
}
554-
brokerutils.SetAnnotation(consumerObj, newProviderClusterAnn, gr.newProviderName)
555+
kubernetes.SetAnnotation(consumerObj, newProviderClusterAnn, gr.newProviderName)
555556
if err := gr.consumerCluster.GetClient().Update(ctx, consumerObj); err != nil {
556557
return fmt.Errorf("failed to set new provider cluster annotation in consumer: %w", err)
557558
}
@@ -646,7 +647,7 @@ func (gr *genericReconciler) decorateInProvider(ctx context.Context, providerNam
646647
}
647648
}
648649

649-
brokerutils.SetAnnotation(obj, consumerClusterAnn, gr.consumerName)
650+
kubernetes.SetAnnotation(obj, consumerClusterAnn, gr.consumerName)
650651
if err := providerCluster.GetClient().Update(ctx, obj); err != nil {
651652
return fmt.Errorf("failed to set annotations in provider: %w", err)
652653
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
1515
limitations under the License.
1616
*/
1717

18-
package utils
18+
package kubernetes
1919

2020
import (
2121
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
1515
limitations under the License.
1616
*/
1717

18-
package utils
18+
package kubernetes
1919

2020
import (
2121
"testing"

0 commit comments

Comments
 (0)