Skip to content

Commit b459e69

Browse files
Merge pull request openshift#683 from bergmannf/fix-pr-send-infra-resize
[OSD-28273] Add new required OHSS flag for infra node resize.
2 parents 1fecebe + 439c4e9 commit b459e69

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cmd/cluster/resize/infra_node.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ type Infra struct {
5454

5555
// reason to provide for resize
5656
justification string
57+
58+
// OHSS ticket to reference in SL
59+
ohss string
5760
}
5861

5962
func newCmdResizeInfra() *cobra.Command {
@@ -87,10 +90,12 @@ func newCmdResizeInfra() *cobra.Command {
8790
infraResizeCmd.Flags().StringVar(&r.instanceType, "instance-type", "", "(optional) Override for an AWS or GCP instance type to resize the infra nodes to, by default supported instance types are automatically selected.")
8891
infraResizeCmd.Flags().StringVar(&r.reason, "reason", "", "The reason for this command, which requires elevation, to be run (usually an OHSS or PD ticket)")
8992
infraResizeCmd.Flags().StringVar(&r.justification, "justification", "", "The justification behind resize")
93+
infraResizeCmd.Flags().StringVar(&r.ohss, "ohss", "", "OHSS ticket tracking this infra node resize")
9094

9195
infraResizeCmd.MarkFlagRequired("cluster-id")
9296
infraResizeCmd.MarkFlagRequired("justification")
9397
infraResizeCmd.MarkFlagRequired("reason")
98+
infraResizeCmd.MarkFlagRequired("ohss")
9499

95100
return infraResizeCmd
96101
}
@@ -437,7 +442,7 @@ func (r *Infra) RunInfra(ctx context.Context) error {
437442
}
438443
}
439444

440-
postCmd := generateServiceLog(tempMp, r.instanceType, r.justification, r.clusterId)
445+
postCmd := generateServiceLog(tempMp, r.instanceType, r.justification, r.clusterId, r.ohss)
441446
if err := postCmd.Run(); err != nil {
442447
fmt.Println("Failed to generate service log. Please manually send a service log to the customer for the blocked egresses with:")
443448
fmt.Printf("osdctl servicelog post %v -t %v -p %v\n",
@@ -541,12 +546,12 @@ func getInstanceType(mp *hivev1.MachinePool) (string, error) {
541546
}
542547

543548
// Adding change in serviceLog as per the cloud provider.
544-
func generateServiceLog(mp *hivev1.MachinePool, instanceType, justification, clusterId string) servicelog.PostCmdOptions {
549+
func generateServiceLog(mp *hivev1.MachinePool, instanceType, justification, clusterId, ohss string) servicelog.PostCmdOptions {
545550
if mp.Spec.Platform.AWS != nil {
546551
return servicelog.PostCmdOptions{
547552
Template: resizedInfraNodeServiceLogTemplate,
548553
ClusterId: clusterId,
549-
TemplateParams: []string{fmt.Sprintf("INSTANCE_TYPE=%s", instanceType), fmt.Sprintf("JUSTIFICATION=%s", justification)},
554+
TemplateParams: []string{fmt.Sprintf("INSTANCE_TYPE=%s", instanceType), fmt.Sprintf("JUSTIFICATION=%s", justification), fmt.Sprintf("JIRA_ID=%s", ohss)},
550555
}
551556
} else if mp.Spec.Platform.GCP != nil {
552557
return servicelog.PostCmdOptions{

0 commit comments

Comments
 (0)