Skip to content

Commit 65d974d

Browse files
committed
chore: openshift-snc with disable-cluster-readiness flag export kubeconfig
Previously we introduced the disable-cluster-readiness to allow early access to the cluster, within that commit we hide the kubeconfig export when the flag was enable, actually it can be exported no matter the value of the flag. This commit enables it. Fixes #719. Signed-off-by: Adrian Riobo <ariobolo@redhat.com>
1 parent 5755770 commit 65d974d

13 files changed

Lines changed: 233 additions & 195 deletions

File tree

cmd/mapt/cmd/aws/hosts/rhelai.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"github.com/redhat-developer/mapt/cmd/mapt/cmd/params"
55
maptContext "github.com/redhat-developer/mapt/pkg/manager/context"
66
rhelai "github.com/redhat-developer/mapt/pkg/provider/aws/action/rhel-ai"
7-
apiRHELAI "github.com/redhat-developer/mapt/pkg/targets/host/rhelai"
7+
apiRHELAI "github.com/redhat-developer/mapt/pkg/target/host/rhelai"
88
"github.com/spf13/cobra"
99
"github.com/spf13/pflag"
1010
"github.com/spf13/viper"

cmd/mapt/cmd/aws/services/kind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/redhat-developer/mapt/cmd/mapt/cmd/params"
77
maptContext "github.com/redhat-developer/mapt/pkg/manager/context"
88
"github.com/redhat-developer/mapt/pkg/provider/aws/action/kind"
9-
kindApi "github.com/redhat-developer/mapt/pkg/targets/service/kind"
9+
kindApi "github.com/redhat-developer/mapt/pkg/target/service/kind"
1010
"github.com/spf13/cobra"
1111
"github.com/spf13/pflag"
1212
"github.com/spf13/viper"

cmd/mapt/cmd/aws/services/openshift-snc.go renamed to cmd/mapt/cmd/aws/services/snc.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package services
33
import (
44
params "github.com/redhat-developer/mapt/cmd/mapt/cmd/params"
55
maptContext "github.com/redhat-developer/mapt/pkg/manager/context"
6-
openshiftsnc "github.com/redhat-developer/mapt/pkg/provider/aws/action/openshift-snc"
6+
openshiftsnc "github.com/redhat-developer/mapt/pkg/provider/aws/action/snc"
7+
sncApi "github.com/redhat-developer/mapt/pkg/target/service/snc"
78
"github.com/spf13/cobra"
89
"github.com/spf13/pflag"
910
"github.com/spf13/viper"
@@ -13,8 +14,10 @@ const (
1314
cmdOpenshiftSNC = "openshift-snc"
1415
cmdOpenshiftSNCDesc = "Manage an OpenShift Single Node Cluster based on OpenShift Local. This is not intended for production use"
1516

16-
ocpVersion = "version"
17-
ocpVersionDesc = "version for Openshift. If not set it will pick latest available version"
17+
ocpVersion = "version"
18+
ocpDefaultVersion = "4.21.0"
19+
ocpVersionDesc = "version for Openshift."
20+
1821
pullSecretFile = "pull-secret-file"
1922
pullSecretFileDesc = "file path of image pull secret (download from https://console.redhat.com/openshift/create/local)"
2023
disableClusterReadiness = "disable-cluster-readiness"
@@ -58,7 +61,7 @@ func createSNC() *cobra.Command {
5861
DebugLevel: viper.GetUint(params.DebugLevel),
5962
Tags: viper.GetStringMapString(params.Tags),
6063
},
61-
&openshiftsnc.OpenshiftSNCArgs{
64+
&sncApi.SNCArgs{
6265
ComputeRequest: params.ComputeRequestArgs(),
6366
Spot: params.SpotArgs(),
6467
Version: viper.GetString(ocpVersion),
@@ -73,7 +76,7 @@ func createSNC() *cobra.Command {
7376
}
7477
flagSet := pflag.NewFlagSet(params.CreateCmdName, pflag.ExitOnError)
7578
flagSet.StringP(params.ConnectionDetailsOutput, "", "", params.ConnectionDetailsOutputDesc)
76-
flagSet.StringP(ocpVersion, "", "", ocpVersionDesc)
79+
flagSet.StringP(ocpVersion, "", ocpDefaultVersion, ocpVersionDesc)
7780
flagSet.Bool(disableClusterReadiness, false, disableClusterReadinessDesc)
7881
flagSet.StringP(params.LinuxArch, "", params.LinuxArchDefault, params.LinuxArchDesc)
7982
flagSet.StringP(pullSecretFile, "", "", pullSecretFileDesc)

cmd/mapt/cmd/azure/hosts/rhelai.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"github.com/redhat-developer/mapt/cmd/mapt/cmd/params"
55
maptContext "github.com/redhat-developer/mapt/pkg/manager/context"
66
rhelai "github.com/redhat-developer/mapt/pkg/provider/azure/action/rhel-ai"
7-
apiRHELAI "github.com/redhat-developer/mapt/pkg/targets/host/rhelai"
7+
apiRHELAI "github.com/redhat-developer/mapt/pkg/target/host/rhelai"
88
"github.com/spf13/cobra"
99
"github.com/spf13/pflag"
1010
"github.com/spf13/viper"

cmd/mapt/cmd/azure/services/kind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/redhat-developer/mapt/cmd/mapt/cmd/params"
88
maptContext "github.com/redhat-developer/mapt/pkg/manager/context"
99
"github.com/redhat-developer/mapt/pkg/provider/azure/action/kind"
10-
kindApi "github.com/redhat-developer/mapt/pkg/targets/service/kind"
10+
kindApi "github.com/redhat-developer/mapt/pkg/target/service/kind"
1111
"github.com/spf13/cobra"
1212
"github.com/spf13/pflag"
1313
"github.com/spf13/viper"

pkg/provider/aws/action/openshift-snc/constants.go

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package openshiftsnc
2+
3+
import "fmt"
4+
5+
var (
6+
diskSize int = 200
7+
8+
// This is managed by https://github.com/devtools-qe-incubator/cloud-importer
9+
amiProduct = "Linux/UNIX"
10+
// amiProductDescription = "Red Hat Enterprise Linux"
11+
amiRegex = "openshift-local-%s-%s-*"
12+
amiUserDefault = "core"
13+
amiOwner = "391597328979"
14+
// amiOriginRegion = "us-east-1"
15+
16+
// SSM
17+
ocpPullSecretID = "ocppullsecretid"
18+
kapass = "kapass"
19+
devpass = "devpass"
20+
)
21+
22+
func amiName(version, arch *string) string { return fmt.Sprintf(amiRegex, *version, *arch) }
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package openshiftsnc
2+
3+
// This is the AWS policy required to use SSM service in order to set the values
4+
// within userdata
5+
var requiredPolicies = []string{"arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"}

0 commit comments

Comments
 (0)