Skip to content

Commit cd8ae68

Browse files
authored
Merge pull request #3035 from olucasfreitas/OCM-17621-recursion-fix
OCM-18785 | fix: added verifications to exclude fedramp from autonode feature
2 parents 8ef99a6 + 080601d commit cd8ae68

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

cmd/edit/cluster/cmd.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,14 @@ func run(cmd *cobra.Command, _ []string) {
673673
os.Exit(1)
674674
}
675675
}
676-
677676
// AutoNode configuration
677+
// Check if AutoNode flags are being used with govcloud
678+
if fedramp.Enabled() && (cmd.Flags().Changed(autonode.AutoNodeFlagName) ||
679+
cmd.Flags().Changed(autonode.AutoNodeIAMRoleArnFlagName)) {
680+
_ = r.Reporter.Errorf("AutoNode is not supported for govcloud clusters")
681+
os.Exit(1)
682+
}
683+
678684
autoNodeConfig, err := autonode.SetAutoNode(r, cmd, cluster, args.autonode, args.autoNodeRoleARN)
679685
if err != nil {
680686
_ = r.Reporter.Errorf("%s", err)

pkg/helper/autonode/helpers.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/spf13/cobra"
99

1010
"github.com/openshift/rosa/pkg/aws"
11+
"github.com/openshift/rosa/pkg/fedramp"
1112
"github.com/openshift/rosa/pkg/interactive"
1213
"github.com/openshift/rosa/pkg/ocm"
1314
"github.com/openshift/rosa/pkg/rosa"
@@ -134,6 +135,11 @@ func SetAutoNode(r *rosa.Runtime, cmd *cobra.Command, cluster *cmv1.Cluster, fla
134135

135136
// InteractivePrompt handles interactive mode for AutoNode configuration
136137
func InteractivePrompt(r *rosa.Runtime, cmd *cobra.Command, cluster *cmv1.Cluster) (*AutoNodeConfig, error) {
138+
// AutoNode is not supported in govcloud - skip prompting
139+
if fedramp.Enabled() {
140+
return nil, nil
141+
}
142+
137143
config := &AutoNodeConfig{}
138144

139145
autoNodeMode, autoNodeExists := ocm.GetAutoNodeMode(cluster)

0 commit comments

Comments
 (0)