mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-05 07:45:27 -04:00
Update operator role identification
This commit is contained in:
parent
dbe9bf381c
commit
38498b1981
2 changed files with 14 additions and 4 deletions
|
@ -89,15 +89,25 @@ func (c *Client) ListScalingGroups(ctx context.Context, uid string) (controlPlan
|
|||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("getting scaling group name: %w", err)
|
||||
}
|
||||
if scaleSet == "constellation-scale-set-controlplanes-"+uid {
|
||||
if isControlPlaneInstanceGroup(scaleSet) {
|
||||
controlPlaneGroupIDs = append(controlPlaneGroupIDs, scaleSetID)
|
||||
} else if strings.HasPrefix(scaleSet, "constellation-scale-set-workers-"+uid) {
|
||||
} else if isWorkerInstanceGroup(scaleSet) {
|
||||
workerGroupIDs = append(workerGroupIDs, scaleSetID)
|
||||
}
|
||||
}
|
||||
return controlPlaneGroupIDs, workerGroupIDs, nil
|
||||
}
|
||||
|
||||
// isControlPlaneInstanceGroup returns true if the instance group is a control plane instance group.
|
||||
func isControlPlaneInstanceGroup(instanceGroupName string) bool {
|
||||
return strings.Contains(instanceGroupName, "control-plane")
|
||||
}
|
||||
|
||||
// isWorkerInstanceGroup returns true if the instance group is a worker instance group.
|
||||
func isWorkerInstanceGroup(instanceGroupName string) bool {
|
||||
return strings.Contains(instanceGroupName, "worker")
|
||||
}
|
||||
|
||||
func imageReferenceFromImage(img string) *armcompute.ImageReference {
|
||||
ref := &armcompute.ImageReference{}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue