Skip to content

Commit

Permalink
feat bottlerocket
Browse files Browse the repository at this point in the history
  • Loading branch information
jokestax committed Dec 8, 2024
1 parent f180568 commit d3469e5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/controller/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ func (clctrl *ClusterController) CreateTokens(kind string) interface{} {
gitopsTemplateTokens.Kubeconfig = clctrl.ProviderConfig.Kubeconfig
gitopsTemplateTokens.KubefirstArtifactsBucket = clctrl.KubefirstArtifactsBucketName
gitopsTemplateTokens.AtlantisWebhookURL = clctrl.AtlantisWebhookURL
gitopsTemplateTokens.AMIType = clctrl.AMIType

if clctrl.ECR {
gitopsTemplateTokens.ContainerRegistryURL = fmt.Sprintf("%s.dkr.ecr.%s.amazonaws.com", *iamCaller.Account, clctrl.CloudRegion)
Expand Down
4 changes: 4 additions & 0 deletions internal/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type ClusterController struct {
K3sAuth types.K3sAuth
AwsAccessKeyID string
AwsSecretAccessKey string
AMIType string
NodeType string
NodeCount int
PostInstallCatalogApps []types.GitopsCatalogApp
Expand Down Expand Up @@ -227,6 +228,9 @@ func (clctrl *ClusterController) InitController(def *types.ClusterDefinition) er

clctrl.ECR = def.ECR

if def.CloudProvider == "aws" {
clctrl.AMIType = def.AMIType
}
if def.GitopsTemplateBranch != "" {
clctrl.GitopsTemplateBranch = def.GitopsTemplateBranch
} else {
Expand Down
1 change: 1 addition & 0 deletions pkg/providerConfigs/detokenize.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func detokenizeGitops(tokens *GitopsDirectoryValues, gitProtocol string, useClou
newContents = strings.ReplaceAll(newContents, "<NODE_COUNT>", strconv.Itoa(tokens.NodeCount))

// AWS
newContents = strings.ReplaceAll(newContents, "<AMI_TYPE>", tokens.AMIType)
newContents = strings.ReplaceAll(newContents, "<AWS_ACCOUNT_ID>", tokens.AwsAccountID)
newContents = strings.ReplaceAll(newContents, "<AWS_IAM_ARN_ACCOUNT_ROOT>", tokens.AwsIamArnAccountRoot)
newContents = strings.ReplaceAll(newContents, "<AWS_NODE_CAPACITY_TYPE>", tokens.AwsNodeCapacityType)
Expand Down
1 change: 1 addition & 0 deletions pkg/providerConfigs/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type GitopsDirectoryValues struct {
AwsKmsKeyID string
AwsNodeCapacityType string
AwsAccountID string
AMIType string

AzureStorageResourceGroup string
AzureStorageContainerName string
Expand Down
3 changes: 2 additions & 1 deletion pkg/types/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ type ClusterDefinition struct {
GitProtocol string `json:"git_protocol" binding:"required,oneof=ssh https"`

// AWS
ECR bool `json:"ecr,omitempty"`
ECR bool `json:"ecr,omitempty"`
AMIType string `json:"ami_type" binding:"required"`

// Azure
AzureDNSZoneResourceGroup string `json:"azure_dns_zone_resource_group,omitempty"`
Expand Down

0 comments on commit d3469e5

Please sign in to comment.