Skip to content

Commit 85a50e1

Browse files
authored
PS Week 51-2025 Support (#194)
* chore: Added patch profile method (#193) Signed-off-by: Sivaanand Murugesan <[email protected]> * fix: added registry sync function Signed-off-by: Sivaanand Murugesan <[email protected]> --------- Signed-off-by: Sivaanand Murugesan <[email protected]>
1 parent 9fbcfc1 commit 85a50e1

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

client/cluster.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,19 @@ func (h *V1Client) UpdateClusterProfileValues(uid string, profiles *models.V1Spe
211211
return err
212212
}
213213

214+
// PatchClusterProfileValues patches (adds/updates) a cluster's profile values without replacing all profiles.
215+
// Unlike UpdateClusterProfileValues (PUT), this uses PATCH to only modify specified profiles,
216+
// preserving any other profiles (like add-ons) attached to the cluster.
217+
func (h *V1Client) PatchClusterProfileValues(uid string, profiles *models.V1SpectroClusterProfiles) error {
218+
resolveNotifications := true
219+
params := clientv1.NewV1SpectroClustersPatchProfilesParamsWithContext(h.ctx).
220+
WithUID(uid).
221+
WithBody(profiles).
222+
WithResolveNotification(&resolveNotifications)
223+
_, err := h.Client.V1SpectroClustersPatchProfiles(params)
224+
return err
225+
}
226+
214227
// ImportClusterGeneric imports a cluster using a generic import manifest.
215228
func (h *V1Client) ImportClusterGeneric(meta *models.V1ObjectMetaInputEntity) (string, error) {
216229
params := clientv1.NewV1SpectroClustersGenericImportParamsWithContext(h.ctx).

client/registry.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,17 @@ func (h *V1Client) DeleteOciBasicRegistry(uid string) error {
216216
return err
217217
}
218218

219+
// GetOciBasicRegistrySyncStatus retrieves the sync status of an OCI Basic registry by UID.
220+
func (h *V1Client) GetOciBasicRegistrySyncStatus(uid string) (*models.V1RegistrySyncStatus, error) {
221+
params := clientv1.NewV1BasicOciRegistriesUIDSyncStatusParamsWithContext(h.ctx).
222+
WithUID(uid)
223+
resp, err := h.Client.V1BasicOciRegistriesUIDSyncStatus(params)
224+
if err != nil {
225+
return nil, err
226+
}
227+
return resp.Payload, nil
228+
}
229+
219230
// GetOciEcrRegistry retrieves an existing ECR OCI registry by UID.
220231
func (h *V1Client) GetOciEcrRegistry(uid string) (*models.V1EcrRegistry, error) {
221232
params := clientv1.NewV1EcrRegistriesUIDGetParamsWithContext(h.ctx).

0 commit comments

Comments
 (0)