Skip to content

Commit

Permalink
fix: environment struct and export cluster status (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
CristhianF7 authored Sep 26, 2023
1 parent 373cb53 commit 0849144
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
3 changes: 3 additions & 0 deletions internal/controller/kubefirst.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ func (clctrl *ClusterController) ExportClusterRecord() error {
return err
}

cluster.Status = "provisioned"
cluster.InProgress = false

time.Sleep(time.Second * 10)

consoleCloudUrl := fmt.Sprintf("https://kubefirst.%s", cluster.DomainName)
Expand Down
36 changes: 21 additions & 15 deletions pkg/types/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,26 @@ type ProxyImportRequest struct {
Url string `bson:"url" json:"url"`
}

type Environment struct {
Name string `bson:"name" json:"name"`
Color string `bson:"color" json:"color"`
Description string `bson:"description,omitempty" json:"description,omitempty"`
}

type WorkloadCluster struct {
AdminEmail string `bson:"admin_email,omitempty" json:"admin_email,omitempty"`
CloudProvider string `bson:"cloud_provider,omitempty" json:"cloud_provider,omitempty"`
ClusterID string `bson:"cluster_id,omitempty" json:"cluster_id,omitempty"`
ClusterName string `bson:"cluster_name,omitempty" json:"cluster_name,omitempty"`
ClusterType string `bson:"cluster_type,omitempty" json:"cluster_type,omitempty"`
CloudRegion string `bson:"cloud_region,omitempty" json:"cloud_region,omitempty"`
CreationTimestamp string `bson:"creation_timestamp" json:"creation_timestamp"`
DomainName string `bson:"domain_name,omitempty" json:"domain_name,omitempty"`
DnsProvider string `bson:"dns_provider,omitempty" json:"dns_provider,omitempty"`
Environment string `bson:"environment,omitempty" json:"environment,omitempty"`
GitAuth GitAuth `bson:"git_auth,omitempty" json:"git_auth,omitempty"`
InstanceSize string `bson:"instance_size,omitempty" json:"instance_size,omitempty"`
MachineType string `bson:"machine_type,omitempty" json:"machine_type,omitempty"`
NodeCount int `bson:"node_count,omitempty" json:"node_count,omitempty"`
Status string `bson:"status,omitempty" json:"status,omitempty"`
AdminEmail string `bson:"admin_email,omitempty" json:"admin_email,omitempty"`
CloudProvider string `bson:"cloud_provider,omitempty" json:"cloud_provider,omitempty"`
ClusterID string `bson:"cluster_id,omitempty" json:"cluster_id,omitempty"`
ClusterName string `bson:"cluster_name,omitempty" json:"cluster_name,omitempty"`
ClusterType string `bson:"cluster_type,omitempty" json:"cluster_type,omitempty"`
CloudRegion string `bson:"cloud_region,omitempty" json:"cloud_region,omitempty"`
CreationTimestamp string `bson:"creation_timestamp" json:"creation_timestamp"`
DomainName string `bson:"domain_name,omitempty" json:"domain_name,omitempty"`
DnsProvider string `bson:"dns_provider,omitempty" json:"dns_provider,omitempty"`
Environment Environment `bson:"environment,omitempty" json:"environment,omitempty"`
GitAuth GitAuth `bson:"git_auth,omitempty" json:"git_auth,omitempty"`
InstanceSize string `bson:"instance_size,omitempty" json:"instance_size,omitempty"`
MachineType string `bson:"machine_type,omitempty" json:"machine_type,omitempty"`
NodeCount int `bson:"node_count,omitempty" json:"node_count,omitempty"`
Status string `bson:"status,omitempty" json:"status,omitempty"`
}

0 comments on commit 0849144

Please sign in to comment.