From d87f6382990bca4fe23c2d9413f1f9c36252fb72 Mon Sep 17 00:00:00 2001 From: Michael Shen Date: Thu, 12 Sep 2024 14:50:13 -0400 Subject: [PATCH] Revert clusters_mgmt v2alpha1 to v1 v2alpha1 was removed again in https://github.com/openshift-online/ocm-api-model/pull/982 Signed-off-by: Michael Shen --- frontend/go.mod | 12 +++---- frontend/go.sum | 18 ++++------ frontend/pkg/frontend/frontend.go | 16 ++++----- frontend/pkg/frontend/ocm.go | 56 +++++++++++++++---------------- go.work.sum | 4 +++ internal/go.mod | 10 +++--- internal/go.sum | 16 ++++----- internal/ocm/internalid.go | 34 +++++++++---------- internal/ocm/internalid_test.go | 16 ++++----- internal/ocm/ocm.go | 16 ++++----- tooling/image-sync/go.mod | 2 +- tooling/image-sync/go.sum | 4 +-- 12 files changed, 99 insertions(+), 105 deletions(-) diff --git a/frontend/go.mod b/frontend/go.mod index 62f5dc487..1d298f6de 100644 --- a/frontend/go.mod +++ b/frontend/go.mod @@ -9,7 +9,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 - github.com/openshift-online/ocm-sdk-go v0.1.439 + github.com/openshift-online/ocm-sdk-go v0.1.441 github.com/prometheus/client_golang v1.20.3 github.com/spf13/cobra v1.8.1 golang.org/x/exp v0.0.0-20240707233637-46b078467d37 @@ -21,7 +21,7 @@ require github.com/klauspost/compress v1.17.9 // indirect require ( github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/data/azcosmos v1.0.3 // indirect + github.com/Azure/azure-sdk-for-go/sdk/data/azcosmos v1.1.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/aymerick/douceur v0.2.0 // indirect @@ -54,11 +54,11 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/crypto v0.25.0 // indirect + golang.org/x/crypto v0.26.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/frontend/go.sum b/frontend/go.sum index ba277a132..a8dd50643 100644 --- a/frontend/go.sum +++ b/frontend/go.sum @@ -4,8 +4,7 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkc github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= -github.com/Azure/azure-sdk-for-go/sdk/data/azcosmos v1.0.3 h1:gBWC0dYF3aO+7xGxL0Ccjv9BmnV30C8VZIrUPlMct6g= -github.com/Azure/azure-sdk-for-go/sdk/data/azcosmos v1.0.3/go.mod h1:7LBWaO4KRASAo9VpfhpxQKkdY6PBwkv9UDKzL9Sajuw= +github.com/Azure/azure-sdk-for-go/sdk/data/azcosmos v1.1.0 h1:c726lgbwpwFBuj+Fyrwuh/vUilqFo+hUAOUNjsKj5DI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= @@ -111,8 +110,7 @@ github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE= github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk= -github.com/openshift-online/ocm-sdk-go v0.1.439 h1:ELrJjmYgtzhdUY1cOJ0chtbhBEGz682EiTvojt5/xVM= -github.com/openshift-online/ocm-sdk-go v0.1.439/go.mod h1:CiAu2jwl3ITKOxkeV0Qnhzv4gs35AmpIzVABQLtcI2Y= +github.com/openshift-online/ocm-sdk-go v0.1.441 h1:9qht/dFxoE6n2uZc/w2k5I1yu85Q2HnbHkelmKbrWL8= github.com/openshift/api v0.0.0-20240429104249-ac9356ba1784 h1:SmOZFMxuAH4d1Cj7dOftVyo4Wg/mEC4pwz6QIJJsAkc= github.com/openshift/api v0.0.0-20240429104249-ac9356ba1784/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -148,8 +146,7 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/exp v0.0.0-20240707233637-46b078467d37 h1:uLDX+AfeFCct3a2C7uIWBKMJIR3CJMhcgfrUAqjRK6w= golang.org/x/exp v0.0.0-20240707233637-46b078467d37/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -160,8 +157,7 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -171,12 +167,10 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= diff --git a/frontend/pkg/frontend/frontend.go b/frontend/pkg/frontend/frontend.go index e06e195a0..f151178a2 100644 --- a/frontend/pkg/frontend/frontend.go +++ b/frontend/pkg/frontend/frontend.go @@ -20,7 +20,7 @@ import ( azcorearm "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/google/uuid" - cmv2alpha1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v2alpha1" + cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1" ocmerrors "github.com/openshift-online/ocm-sdk-go/errors" "golang.org/x/sync/errgroup" @@ -177,7 +177,7 @@ func (f *Frontend) ArmResourceList(writer http.ResponseWriter, request *http.Req } // Create the request with initial parameters: - clustersRequest := f.clusterServiceConfig.Conn.ClustersMgmt().V2alpha1().Clusters().List().Search(query) + clustersRequest := f.clusterServiceConfig.Conn.ClustersMgmt().V1().Clusters().List().Search(query) clustersRequest.Size(pageSize) clustersRequest.Page(pageNumber) @@ -843,8 +843,8 @@ func (f *Frontend) CreateOrUpdateNodePool(writer http.ResponseWriter, request *h return } - if csCluster.State() == cmv2alpha1.ClusterStateUninstalling { - f.logger.Error(fmt.Sprintf("failed to create node pool for cluster %s as it is in %v state", clusterResourceID, cmv2alpha1.ClusterStateUninstalling)) + if csCluster.State() == cmv1.ClusterStateUninstalling { + f.logger.Error(fmt.Sprintf("failed to create node pool for cluster %s as it is in %v state", clusterResourceID, cmv1.ClusterStateUninstalling)) arm.WriteInternalServerError(writer) return } @@ -1217,7 +1217,7 @@ func (f *Frontend) MarshalResource(ctx context.Context, resourceID *arm.Resource } switch doc.InternalID.Kind() { - case cmv2alpha1.ClusterKind: + case cmv1.ClusterKind: csCluster, err := f.clusterServiceConfig.GetCSCluster(ctx, doc.InternalID) if err != nil { f.logger.Error(err.Error()) @@ -1233,7 +1233,7 @@ func (f *Frontend) MarshalResource(ctx context.Context, resourceID *arm.Resource return nil, arm.NewInternalServerError() } - case cmv2alpha1.NodePoolKind: + case cmv1.NodePoolKind: csNodePool, err := f.clusterServiceConfig.GetCSNodePool(ctx, doc.InternalID) if err != nil { f.logger.Error(err.Error()) @@ -1259,7 +1259,7 @@ func (f *Frontend) MarshalResource(ctx context.Context, resourceID *arm.Resource // marshalCSCluster renders a CS Cluster object in JSON format, applying // the necessary conversions for the API version of the request. -func marshalCSCluster(csCluster *cmv2alpha1.Cluster, doc *database.ResourceDocument, versionedInterface api.Version) ([]byte, error) { +func marshalCSCluster(csCluster *cmv1.Cluster, doc *database.ResourceDocument, versionedInterface api.Version) ([]byte, error) { hcpCluster := ConvertCStoHCPOpenShiftCluster(doc.Key, csCluster) hcpCluster.TrackedResource.Resource.SystemData = doc.SystemData hcpCluster.TrackedResource.Tags = maps.Clone(doc.Tags) @@ -1269,7 +1269,7 @@ func marshalCSCluster(csCluster *cmv2alpha1.Cluster, doc *database.ResourceDocum // marshalCSNodePool renders a CS NodePool object in JSON format, applying // the necessary conversions for the API version of the request. -func marshalCSNodePool(csNodePool *cmv2alpha1.NodePool, doc *database.ResourceDocument, versionedInterface api.Version) ([]byte, error) { +func marshalCSNodePool(csNodePool *cmv1.NodePool, doc *database.ResourceDocument, versionedInterface api.Version) ([]byte, error) { hcpNodePool := ConvertCStoNodePool(doc.Key, csNodePool) hcpNodePool.TrackedResource.Resource.SystemData = doc.SystemData hcpNodePool.TrackedResource.Tags = maps.Clone(doc.Tags) diff --git a/frontend/pkg/frontend/ocm.go b/frontend/pkg/frontend/ocm.go index 7b23d1091..4e2fadee2 100644 --- a/frontend/pkg/frontend/ocm.go +++ b/frontend/pkg/frontend/ocm.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - cmv2alpha1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v2alpha1" + cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1" configv1 "github.com/openshift/api/config/v1" "github.com/Azure/ARO-HCP/internal/api" @@ -20,28 +20,28 @@ const ( csCCSEnabled bool = true ) -func convertListeningToVisibility(listening cmv2alpha1.ListeningMethod) (visibility api.Visibility) { +func convertListeningToVisibility(listening cmv1.ListeningMethod) (visibility api.Visibility) { switch listening { - case cmv2alpha1.ListeningMethodExternal: + case cmv1.ListeningMethodExternal: visibility = api.VisibilityPublic - case cmv2alpha1.ListeningMethodInternal: + case cmv1.ListeningMethodInternal: visibility = api.VisibilityPrivate } return } -func convertVisibilityToListening(visibility api.Visibility) (listening cmv2alpha1.ListeningMethod) { +func convertVisibilityToListening(visibility api.Visibility) (listening cmv1.ListeningMethod) { switch visibility { case api.VisibilityPublic: - listening = cmv2alpha1.ListeningMethodExternal + listening = cmv1.ListeningMethodExternal case api.VisibilityPrivate: - listening = cmv2alpha1.ListeningMethodInternal + listening = cmv1.ListeningMethodInternal } return } // ConvertCStoHCPOpenShiftCluster converts a CS Cluster object into HCPOpenShiftCluster object -func ConvertCStoHCPOpenShiftCluster(resourceID *arm.ResourceID, cluster *cmv2alpha1.Cluster) *api.HCPOpenShiftCluster { +func ConvertCStoHCPOpenShiftCluster(resourceID *arm.ResourceID, cluster *cmv1.Cluster) *api.HCPOpenShiftCluster { hcpcluster := &api.HCPOpenShiftCluster{ TrackedResource: arm.TrackedResource{ Location: cluster.Region().ID(), @@ -106,7 +106,7 @@ func ConvertCStoHCPOpenShiftCluster(resourceID *arm.ResourceID, cluster *cmv2alp } // BuildCSCluster creates a CS Cluster object from an HCPOpenShiftCluster object -func (f *Frontend) BuildCSCluster(ctx context.Context, hcpCluster *api.HCPOpenShiftCluster, updating bool) (*cmv2alpha1.Cluster, error) { +func (f *Frontend) BuildCSCluster(ctx context.Context, hcpCluster *api.HCPOpenShiftCluster, updating bool) (*cmv1.Cluster, error) { resourceID, err := ResourceIDFromContext(ctx) if err != nil { return nil, fmt.Errorf("could not get parsed resource ID: %w", err) @@ -142,7 +142,7 @@ func (f *Frontend) BuildCSCluster(ctx context.Context, hcpCluster *api.HCPOpenSh additionalProperties["provisioner_noop_deprovision"] = "true" } - clusterBuilder := cmv2alpha1.NewCluster() + clusterBuilder := cmv1.NewCluster() // FIXME HcpOpenShiftCluster attributes not being passed: // PlatformProfile.OutboundType (no CS equivalent?) @@ -153,13 +153,13 @@ func (f *Frontend) BuildCSCluster(ctx context.Context, hcpCluster *api.HCPOpenSh if !updating { clusterBuilder = clusterBuilder. Name(hcpCluster.Name). - Flavour(cmv2alpha1.NewFlavour(). + Flavour(cmv1.NewFlavour(). ID(csFlavourId)). - Region(cmv2alpha1.NewCloudRegion(). + Region(cmv1.NewCloudRegion(). ID(f.location)). - CloudProvider(cmv2alpha1.NewCloudProvider(). + CloudProvider(cmv1.NewCloudProvider(). ID(csCloudProvider)). - Azure(cmv2alpha1.NewAzure(). + Azure(cmv1.NewAzure(). TenantID(tenantID). SubscriptionID(resourceID.SubscriptionID). ResourceGroupName(resourceID.ResourceGroupName). @@ -167,22 +167,22 @@ func (f *Frontend) BuildCSCluster(ctx context.Context, hcpCluster *api.HCPOpenSh ManagedResourceGroupName(hcpCluster.Properties.Spec.Platform.ManagedResourceGroup). SubnetResourceID(hcpCluster.Properties.Spec.Platform.SubnetID). NetworkSecurityGroupResourceID(hcpCluster.Properties.Spec.Platform.NetworkSecurityGroupID)). - Product(cmv2alpha1.NewProduct(). + Product(cmv1.NewProduct(). ID(csProductId)). - Hypershift(cmv2alpha1.NewHypershift(). + Hypershift(cmv1.NewHypershift(). Enabled(csHypershifEnabled)). MultiAZ(csMultiAzEnabled). - CCS(cmv2alpha1.NewCCS().Enabled(csCCSEnabled)). - Version(cmv2alpha1.NewVersion(). + CCS(cmv1.NewCCS().Enabled(csCCSEnabled)). + Version(cmv1.NewVersion(). ID(hcpCluster.Properties.Spec.Version.ID). ChannelGroup(hcpCluster.Properties.Spec.Version.ChannelGroup)). - Network(cmv2alpha1.NewNetwork(). + Network(cmv1.NewNetwork(). Type(string(hcpCluster.Properties.Spec.Network.NetworkType)). PodCIDR(hcpCluster.Properties.Spec.Network.PodCIDR). ServiceCIDR(hcpCluster.Properties.Spec.Network.ServiceCIDR). MachineCIDR(hcpCluster.Properties.Spec.Network.MachineCIDR). HostPrefix(int(hcpCluster.Properties.Spec.Network.HostPrefix))). - API(cmv2alpha1.NewClusterAPI(). + API(cmv1.NewClusterAPI(). Listening(convertVisibilityToListening(hcpCluster.Properties.Spec.API.Visibility))). FIPS(hcpCluster.Properties.Spec.FIPS). EtcdEncryption(hcpCluster.Properties.Spec.EtcdEncryption) @@ -194,7 +194,7 @@ func (f *Frontend) BuildCSCluster(ctx context.Context, hcpCluster *api.HCPOpenSh } } - proxyBuilder := cmv2alpha1.NewProxy() + proxyBuilder := cmv1.NewProxy() // Cluster Service allows an empty HTTPProxy on PATCH but not PUT. if updating || hcpCluster.Properties.Spec.Proxy.HTTPProxy != "" { proxyBuilder = proxyBuilder. @@ -225,7 +225,7 @@ func (f *Frontend) BuildCSCluster(ctx context.Context, hcpCluster *api.HCPOpenSh } // ConvertCStoNodePool converts a CS Node Pool object into HCPOpenShiftClusterNodePool object -func ConvertCStoNodePool(resourceID *arm.ResourceID, np *cmv2alpha1.NodePool) *api.HCPOpenShiftClusterNodePool { +func ConvertCStoNodePool(resourceID *arm.ResourceID, np *cmv1.NodePool) *api.HCPOpenShiftClusterNodePool { nodePool := &api.HCPOpenShiftClusterNodePool{ TrackedResource: arm.TrackedResource{ Resource: arm.Resource{ @@ -278,8 +278,8 @@ func ConvertCStoNodePool(resourceID *arm.ResourceID, np *cmv2alpha1.NodePool) *a } // BuildCSNodePool creates a CS Node Pool object from an HCPOpenShiftClusterNodePool object -func (f *Frontend) BuildCSNodePool(ctx context.Context, nodePool *api.HCPOpenShiftClusterNodePool, updating bool) (*cmv2alpha1.NodePool, error) { - npBuilder := cmv2alpha1.NewNodePool() +func (f *Frontend) BuildCSNodePool(ctx context.Context, nodePool *api.HCPOpenShiftClusterNodePool, updating bool) (*cmv1.NodePool, error) { + npBuilder := cmv1.NewNodePool() // FIXME HCPOpenShiftClusterNodePool attributes not being passed: // PlatformProfile.EncryptionAtHost (no CS equivalent?) @@ -289,12 +289,12 @@ func (f *Frontend) BuildCSNodePool(ctx context.Context, nodePool *api.HCPOpenShi if !updating { npBuilder = npBuilder. ID(nodePool.Name). - Version(cmv2alpha1.NewVersion(). + Version(cmv1.NewVersion(). ID(nodePool.Properties.Spec.Version.ID). ChannelGroup(nodePool.Properties.Spec.Version.ChannelGroup). AvailableUpgrades(nodePool.Properties.Spec.Version.AvailableUpgrades...)). Subnet(nodePool.Properties.Spec.Platform.SubnetID). - AzureNodePool(cmv2alpha1.NewAzureNodePool(). + AzureNodePool(cmv1.NewAzureNodePool(). ResourceName(nodePool.Name). VMSize(nodePool.Properties.Spec.Platform.VMSize). OSDiskSizeGibibytes(int(nodePool.Properties.Spec.Platform.DiskSizeGiB)). @@ -312,13 +312,13 @@ func (f *Frontend) BuildCSNodePool(ctx context.Context, nodePool *api.HCPOpenShi if nodePool.Properties.Spec.Replicas != 0 { npBuilder.Replicas(int(nodePool.Properties.Spec.Replicas)) } else { - npBuilder.Autoscaling(cmv2alpha1.NewNodePoolAutoscaling(). + npBuilder.Autoscaling(cmv1.NewNodePoolAutoscaling(). MinReplica(int(nodePool.Properties.Spec.Autoscaling.Min)). MaxReplica(int(nodePool.Properties.Spec.Autoscaling.Max))) } for _, t := range nodePool.Properties.Spec.Taints { - npBuilder = npBuilder.Taints(cmv2alpha1.NewTaint(). + npBuilder = npBuilder.Taints(cmv1.NewTaint(). Effect(string(t.Effect)). Key(t.Key). Value(t.Value)) diff --git a/go.work.sum b/go.work.sum index 652e973d4..172e10282 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1434,6 +1434,8 @@ golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5H golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1448,6 +1450,7 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1541,6 +1544,7 @@ golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= diff --git a/internal/go.mod b/internal/go.mod index c02d5b85c..bdc7f1c04 100644 --- a/internal/go.mod +++ b/internal/go.mod @@ -44,16 +44,16 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect - golang.org/x/crypto v0.25.0 // indirect + golang.org/x/crypto v0.26.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/tools v0.23.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/internal/go.sum b/internal/go.sum index 0eadb9840..d1eaa16c9 100644 --- a/internal/go.sum +++ b/internal/go.sum @@ -119,8 +119,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= @@ -142,8 +142,7 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -152,8 +151,7 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -161,12 +159,10 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= diff --git a/internal/ocm/internalid.go b/internal/ocm/internalid.go index 1416ac865..6e0a95ee1 100644 --- a/internal/ocm/internalid.go +++ b/internal/ocm/internalid.go @@ -9,13 +9,13 @@ import ( "path" "strings" - cmv2alpha1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v2alpha1" + cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1" ) const ( - v2alpha1Pattern = "/api/clusters_mgmt/v2alpha1" - v2alpha1ClusterPattern = v2alpha1Pattern + "/clusters/*" - v2alpha1NodePoolPattern = v2alpha1ClusterPattern + "/node_pools/*" + v1Pattern = "/api/clusters_mgmt/v1" + v1ClusterPattern = v1Pattern + "/clusters/*" + v1NodePoolPattern = v1ClusterPattern + "/node_pools/*" ) // InternalID represents a Cluster Service resource. @@ -29,14 +29,14 @@ func (id *InternalID) validate() error { // This is where we will catch and convert any legacy API versions // to the version the RP is actively using. // - // For example, once the RP is using "v2" we will convert "v2alpha1" + // For example, once the RP is using "v2" we will convert "v1" // and any other legacy transitional versions we see to "v2". - if match, _ = path.Match(v2alpha1ClusterPattern, id.path); match { + if match, _ = path.Match(v1ClusterPattern, id.path); match { return nil } - if match, _ = path.Match(v2alpha1NodePoolPattern, id.path); match { + if match, _ = path.Match(v1NodePoolPattern, id.path); match { return nil } @@ -75,12 +75,12 @@ func (id *InternalID) Kind() string { var match bool var kind string - if match, _ = path.Match(v2alpha1ClusterPattern, id.path); match { - kind = cmv2alpha1.ClusterKind + if match, _ = path.Match(v1ClusterPattern, id.path); match { + kind = cmv1.ClusterKind } - if match, _ = path.Match(v2alpha1NodePoolPattern, id.path); match { - kind = cmv2alpha1.NodePoolKind + if match, _ = path.Match(v1NodePoolPattern, id.path); match { + kind = cmv1.NodePoolKind } return kind @@ -89,13 +89,13 @@ func (id *InternalID) Kind() string { // GetClusterClient returns a v1 ClusterClient from the InternalID. // This works for both cluster and node pool resources. The transport // is most likely to be a Connection object from the SDK. -func (id *InternalID) GetClusterClient(transport http.RoundTripper) (*cmv2alpha1.ClusterClient, bool) { +func (id *InternalID) GetClusterClient(transport http.RoundTripper) (*cmv1.ClusterClient, bool) { var thisPath string = id.path var lastPath string for thisPath != lastPath { - if match, _ := path.Match(v2alpha1ClusterPattern, thisPath); match { - return cmv2alpha1.NewClusterClient(transport, thisPath), true + if match, _ := path.Match(v1ClusterPattern, thisPath); match { + return cmv1.NewClusterClient(transport, thisPath), true } else { lastPath = thisPath thisPath = path.Dir(thisPath) @@ -107,9 +107,9 @@ func (id *InternalID) GetClusterClient(transport http.RoundTripper) (*cmv2alpha1 // GetNodePoolClient returns a v1 NodePoolClient from the InternalID. // The transport is most likely to be a Connection object from the SDK. -func (id *InternalID) GetNodePoolClient(transport http.RoundTripper) (*cmv2alpha1.NodePoolClient, bool) { - if match, _ := path.Match(v2alpha1NodePoolPattern, id.path); match { - return cmv2alpha1.NewNodePoolClient(transport, id.path), true +func (id *InternalID) GetNodePoolClient(transport http.RoundTripper) (*cmv1.NodePoolClient, bool) { + if match, _ := path.Match(v1NodePoolPattern, id.path); match { + return cmv1.NewNodePoolClient(transport, id.path), true } return nil, false } diff --git a/internal/ocm/internalid_test.go b/internal/ocm/internalid_test.go index 340d7ed08..8decc7627 100644 --- a/internal/ocm/internalid_test.go +++ b/internal/ocm/internalid_test.go @@ -9,7 +9,7 @@ import ( "net/http" "testing" - cmv2alpha1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v2alpha1" + cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1" ) type FakeTransport struct{} @@ -32,15 +32,15 @@ func TestInternalID(t *testing.T) { expectErr: true, }, { - name: "parse v2alpha1 cluster", - path: "/api/clusters_mgmt/v2alpha1/clusters/abc", - kind: cmv2alpha1.ClusterKind, + name: "parse v1 cluster", + path: "/api/clusters_mgmt/v1/clusters/abc", + kind: cmv1.ClusterKind, expectErr: false, }, { - name: "parse v2alpha1 node pool", - path: "/api/clusters_mgmt/v2alpha1/clusters/abc/node_pools/def", - kind: cmv2alpha1.NodePoolKind, + name: "parse v1 node pool", + path: "/api/clusters_mgmt/v1/clusters/abc/node_pools/def", + kind: cmv1.NodePoolKind, expectErr: false, }, } @@ -74,7 +74,7 @@ func TestInternalID(t *testing.T) { if _, ok := internalID.GetClusterClient(transport); !ok { t.Errorf("failed to get cluster client") } - if kind == cmv2alpha1.NodePoolKind { + if kind == cmv1.NodePoolKind { if _, ok := internalID.GetNodePoolClient(transport); !ok { t.Errorf("failed to get node pool client") } diff --git a/internal/ocm/ocm.go b/internal/ocm/ocm.go index 57a197861..fc40c19ed 100644 --- a/internal/ocm/ocm.go +++ b/internal/ocm/ocm.go @@ -8,7 +8,7 @@ import ( "fmt" sdk "github.com/openshift-online/ocm-sdk-go" - cmv2alpha1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v2alpha1" + cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1" ) type ClusterServiceConfig struct { @@ -29,7 +29,7 @@ type ClusterServiceConfig struct { } // GetCSCluster creates and sends a GET request to fetch a cluster from Clusters Service -func (csc *ClusterServiceConfig) GetCSCluster(ctx context.Context, internalID InternalID) (*cmv2alpha1.Cluster, error) { +func (csc *ClusterServiceConfig) GetCSCluster(ctx context.Context, internalID InternalID) (*cmv1.Cluster, error) { client, ok := internalID.GetClusterClient(csc.Conn) if !ok { return nil, fmt.Errorf("OCM path is not a cluster: %s", internalID) @@ -46,8 +46,8 @@ func (csc *ClusterServiceConfig) GetCSCluster(ctx context.Context, internalID In } // PostCSCluster creates and sends a POST request to create a cluster in Clusters Service -func (csc *ClusterServiceConfig) PostCSCluster(ctx context.Context, cluster *cmv2alpha1.Cluster) (*cmv2alpha1.Cluster, error) { - clustersAddResponse, err := csc.Conn.ClustersMgmt().V2alpha1().Clusters().Add().Body(cluster).SendContext(ctx) +func (csc *ClusterServiceConfig) PostCSCluster(ctx context.Context, cluster *cmv1.Cluster) (*cmv1.Cluster, error) { + clustersAddResponse, err := csc.Conn.ClustersMgmt().V1().Clusters().Add().Body(cluster).SendContext(ctx) if err != nil { return nil, err } @@ -59,7 +59,7 @@ func (csc *ClusterServiceConfig) PostCSCluster(ctx context.Context, cluster *cmv } // UpdateCSCluster sends a PATCH request to update a cluster in Clusters Service -func (csc *ClusterServiceConfig) UpdateCSCluster(ctx context.Context, internalID InternalID, cluster *cmv2alpha1.Cluster) (*cmv2alpha1.Cluster, error) { +func (csc *ClusterServiceConfig) UpdateCSCluster(ctx context.Context, internalID InternalID, cluster *cmv1.Cluster) (*cmv1.Cluster, error) { client, ok := internalID.GetClusterClient(csc.Conn) if !ok { return nil, fmt.Errorf("OCM path is not a cluster: %s", internalID) @@ -86,7 +86,7 @@ func (csc *ClusterServiceConfig) DeleteCSCluster(ctx context.Context, internalID } // GetCSNodePool creates and sends a GET request to fetch a node pool from Clusters Service -func (csc *ClusterServiceConfig) GetCSNodePool(ctx context.Context, internalID InternalID) (*cmv2alpha1.NodePool, error) { +func (csc *ClusterServiceConfig) GetCSNodePool(ctx context.Context, internalID InternalID) (*cmv1.NodePool, error) { client, ok := internalID.GetNodePoolClient(csc.Conn) if !ok { return nil, fmt.Errorf("OCM path is not a node pool: %s", internalID) @@ -103,7 +103,7 @@ func (csc *ClusterServiceConfig) GetCSNodePool(ctx context.Context, internalID I } // PostCSNodePool creates and sends a POST request to create a node pool in Clusters Service -func (csc *ClusterServiceConfig) PostCSNodePool(ctx context.Context, clusterInternalID InternalID, nodePool *cmv2alpha1.NodePool) (*cmv2alpha1.NodePool, error) { +func (csc *ClusterServiceConfig) PostCSNodePool(ctx context.Context, clusterInternalID InternalID, nodePool *cmv1.NodePool) (*cmv1.NodePool, error) { client, ok := clusterInternalID.GetClusterClient(csc.Conn) if !ok { return nil, fmt.Errorf("OCM path is not a cluster: %s", clusterInternalID) @@ -120,7 +120,7 @@ func (csc *ClusterServiceConfig) PostCSNodePool(ctx context.Context, clusterInte } // UpdateCSNodePool sends a PATCH request to update a node pool in Clusters Service -func (csc *ClusterServiceConfig) UpdateCSNodePool(ctx context.Context, internalID InternalID, nodePool *cmv2alpha1.NodePool) (*cmv2alpha1.NodePool, error) { +func (csc *ClusterServiceConfig) UpdateCSNodePool(ctx context.Context, internalID InternalID, nodePool *cmv1.NodePool) (*cmv1.NodePool, error) { client, ok := internalID.GetNodePoolClient(csc.Conn) if !ok { return nil, fmt.Errorf("OCM path is not a node pool: %s", internalID) diff --git a/tooling/image-sync/go.mod b/tooling/image-sync/go.mod index 21937ae28..50bb64202 100644 --- a/tooling/image-sync/go.mod +++ b/tooling/image-sync/go.mod @@ -75,7 +75,7 @@ require ( github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/proglottis/gpgme v0.1.3 // indirect - github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/sagikazarmark/locafero v0.6.0 // indirect diff --git a/tooling/image-sync/go.sum b/tooling/image-sync/go.sum index d693a17c1..1a9311ea3 100644 --- a/tooling/image-sync/go.sum +++ b/tooling/image-sync/go.sum @@ -162,8 +162,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/proglottis/gpgme v0.1.3 h1:Crxx0oz4LKB3QXc5Ea0J19K/3ICfy3ftr5exgUK1AU0= github.com/proglottis/gpgme v0.1.3/go.mod h1:fPbW/EZ0LvwQtH8Hy7eixhp1eF3G39dtx7GUN+0Gmy0= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=