Skip to content

Commit

Permalink
feat: kubefirst-api deployment (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
CristhianF7 authored Oct 9, 2024
1 parent 2c326f9 commit 3a997b5
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 54 deletions.
16 changes: 8 additions & 8 deletions providers/akamai/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,25 +253,25 @@ func CreateAkamaiCluster(definition *pkgtypes.ClusterDefinition) error {
}

if ctrl.InstallKubefirstPro {
log.Info().Msg("waiting for kubefirst-api Deployment to transition to Running")
kubefirstAPI, err := k8s.ReturnDeploymentObject(
log.Info().Msg("waiting for kubefirst-pro-api Deployment to transition to Running")
kubefirstProAPI, err := k8s.ReturnDeploymentObject(
kcfg.Clientset,
"app.kubernetes.io/name",
"kubefirst-api",
"kubefirst-pro-api",
"kubefirst",
1200,
)
if err != nil {
log.Error().Msgf("error finding kubefirst api Deployment: %s", err)
log.Error().Msgf("error finding kubefirst-pro-api Deployment: %s", err)
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error finding kubefirst api Deployment: %w", err)
return fmt.Errorf("error finding kubefirst-pro-api Deployment: %w", err)
}

_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstAPI, 300)
_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstProAPI, 300)
if err != nil {
log.Error().Msgf("error waiting for kubefirst-api to transition to Running: %s", err)
log.Error().Msgf("error waiting for kubefirst-pro-api to transition to Running: %s", err)
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error waiting for kubefirst-api to transition to Running: %w", err)
return fmt.Errorf("error waiting for kubefirst-pro-api to transition to Running: %w", err)
}
}

Expand Down
12 changes: 6 additions & 6 deletions providers/aws/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,23 +247,23 @@ func CreateAWSCluster(definition *pkgtypes.ClusterDefinition) error {
}

if ctrl.InstallKubefirstPro {
log.Info().Msg("waiting for kubefirst-api Deployment to transition to Running")
kubefirstAPI, err := k8s.ReturnDeploymentObject(
log.Info().Msg("waiting for kubefirst-pro-api Deployment to transition to Running")
kubefirstProAPI, err := k8s.ReturnDeploymentObject(
ctrl.Kcfg.Clientset,
"app.kubernetes.io/name",
"kubefirst-api",
"kubefirst-pro-api",
"kubefirst",
1200,
)
if err != nil {
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error finding kubefirst-api Deployment: %w", err)
return fmt.Errorf("error finding kubefirst-pro-api Deployment: %w", err)
}

_, err = k8s.WaitForDeploymentReady(ctrl.Kcfg.Clientset, kubefirstAPI, 300)
_, err = k8s.WaitForDeploymentReady(ctrl.Kcfg.Clientset, kubefirstProAPI, 300)
if err != nil {
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error waiting for kubefirst-api deployment to enter Ready state: %w", err)
return fmt.Errorf("error waiting for kubefirst-pro-api deployment to enter Ready state: %w", err)
}
}

Expand Down
16 changes: 8 additions & 8 deletions providers/civo/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,25 +241,25 @@ func CreateCivoCluster(definition *pkgtypes.ClusterDefinition) error {
}

if ctrl.InstallKubefirstPro {
log.Info().Msg("waiting for kubefirst-api Deployment to transition to Running")
kubefirstAPI, err := k8s.ReturnDeploymentObject(
log.Info().Msg("waiting for kubefirst-pro-api Deployment to transition to Running")
kubefirstProAPI, err := k8s.ReturnDeploymentObject(
kcfg.Clientset,
"app.kubernetes.io/name",
"kubefirst-api",
"kubefirst-pro-api",
"kubefirst",
1200,
)
if err != nil {
log.Error().Msgf("Error finding kubefirst api Deployment: %s", err)
log.Error().Msgf("Error finding kubefirst-pro-api Deployment: %s", err)
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error finding kubefirst api Deployment: %w", err)
return fmt.Errorf("error finding kubefirst-pro-api Deployment: %w", err)
}

_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstAPI, 300)
_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstProAPI, 300)
if err != nil {
log.Error().Msgf("Error waiting for kubefirst-api to transition to Running: %s", err)
log.Error().Msgf("Error waiting for kubefirst-pro-api to transition to Running: %s", err)
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error waiting for kubefirst-api to transition to Running: %w", err)
return fmt.Errorf("error waiting for kubefirst-pro-api to transition to Running: %w", err)
}
}

Expand Down
16 changes: 8 additions & 8 deletions providers/digitalocean/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,25 +235,25 @@ func CreateDigitaloceanCluster(definition *pkgtypes.ClusterDefinition) error {
}

if ctrl.InstallKubefirstPro {
log.Info().Msg("waiting for kubefirst-api Deployment to transition to Running")
kubefirstAPI, err := k8s.ReturnDeploymentObject(
log.Info().Msg("waiting for kubefirst-pro-api Deployment to transition to Running")
kubefirstProAPI, err := k8s.ReturnDeploymentObject(
kcfg.Clientset,
"app.kubernetes.io/name",
"kubefirst-api",
"kubefirst-pro-api",
"kubefirst",
1200,
)
if err != nil {
log.Error().Msgf("Error finding kubefirst api Deployment: %s", err)
log.Error().Msgf("Error finding kubefirst-pro-api Deployment: %s", err)
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error finding kubefirst api Deployment: %w", err)
return fmt.Errorf("error finding kubefirst-pro-api Deployment: %w", err)
}

_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstAPI, 300)
_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstProAPI, 300)
if err != nil {
log.Error().Msgf("Error waiting for kubefirst-api to transition to Running: %s", err)
log.Error().Msgf("Error waiting for kubefirst-pro-api to transition to Running: %s", err)
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error waiting for kubefirst-api to transition to Running: %w", err)
return fmt.Errorf("error waiting for kubefirst-pro-api to transition to Running: %w", err)
}
}

Expand Down
16 changes: 8 additions & 8 deletions providers/google/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,25 +266,25 @@ func CreateGoogleCluster(definition *pkgtypes.ClusterDefinition) error {
}

if ctrl.InstallKubefirstPro {
log.Info().Msg("waiting for kubefirst-api Deployment to transition to Running")
kubefirstAPI, err := k8s.ReturnDeploymentObject(
log.Info().Msg("waiting for kubefirst-pro-api Deployment to transition to Running")
kubefirstProAPI, err := k8s.ReturnDeploymentObject(
kcfg.Clientset,
"app.kubernetes.io/name",
"kubefirst-api",
"kubefirst-pro-api",
"kubefirst",
1200,
)
if err != nil {
log.Error().Msgf("Error finding kubefirst api Deployment: %s", err)
log.Error().Msgf("Error finding kubefirst-pro-api Deployment: %s", err)
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error finding kubefirst-api deployment: %w", err)
return fmt.Errorf("error finding kubefirst-pro-api deployment: %w", err)
}

_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstAPI, 300)
_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstProAPI, 300)
if err != nil {
log.Error().Msgf("Error waiting for kubefirst-api to transition to Running: %s", err)
log.Error().Msgf("Error waiting for kubefirst-pro-api to transition to Running: %s", err)
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error waiting for kubefirst-api deployment to be ready: %w", err)
return fmt.Errorf("error waiting for kubefirst-pro-api deployment to be ready: %w", err)
}
}

Expand Down
16 changes: 8 additions & 8 deletions providers/k3s/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,25 +243,25 @@ func CreateK3sCluster(definition *pkgtypes.ClusterDefinition) error {
}

if ctrl.InstallKubefirstPro {
log.Info().Msg("waiting for kubefirst-api Deployment to transition to Running")
kubefirstAPI, err := k8s.ReturnDeploymentObject(
log.Info().Msg("waiting for kubefirst-pro-api Deployment to transition to Running")
kubefirstProAPI, err := k8s.ReturnDeploymentObject(
kcfg.Clientset,
"app.kubernetes.io/name",
"kubefirst-api",
"kubefirst-pro-api",
"kubefirst",
1200,
)
if err != nil {
log.Error().Msgf("Error finding kubefirst api Deployment: %s", err)
log.Error().Msgf("Error finding kubefirst-pro-api Deployment: %s", err)
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error finding kubefirst api Deployment: %w", err)
return fmt.Errorf("error finding kubefirst-pro-api Deployment: %w", err)
}

_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstAPI, 300)
_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstProAPI, 300)
if err != nil {
log.Error().Msgf("Error waiting for kubefirst-api to transition to Running: %s", err)
log.Error().Msgf("Error waiting for kubefirst-pro-api to transition to Running: %s", err)
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error waiting for kubefirst-api to transition to Running: %w", err)
return fmt.Errorf("error waiting for kubefirst-pro-api to transition to Running: %w", err)
}
}

Expand Down
16 changes: 8 additions & 8 deletions providers/vultr/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,26 +242,26 @@ func CreateVultrCluster(definition *pkgtypes.ClusterDefinition) error {
}

if ctrl.InstallKubefirstPro {
log.Info().Msg("waiting for kubefirst-api Deployment to transition to Running")
kubefirstAPI, err := k8s.ReturnDeploymentObject(
log.Info().Msg("waiting for kubefirst-pro-api Deployment to transition to Running")
kubefirstProAPI, err := k8s.ReturnDeploymentObject(
kcfg.Clientset,
"app.kubernetes.io/name",
"kubefirst-api",
"kubefirst-pro-api",
"kubefirst",
1200,
)
if err != nil {
log.Error().Msgf("Error finding kubefirst api Deployment: %s", err)
log.Error().Msgf("Error finding kubefirst-pro-api Deployment: %s", err)
ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error finding kubefirst api Deployment: %w", err)
return fmt.Errorf("error finding kubefirst-pro-api Deployment: %w", err)
}

_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstAPI, 300)
_, err = k8s.WaitForDeploymentReady(kcfg.Clientset, kubefirstProAPI, 300)
if err != nil {
log.Error().Msgf("Error waiting for kubefirst-api to transition to Running: %s", err)
log.Error().Msgf("Error waiting for kubefirst-pro-api to transition to Running: %s", err)

ctrl.UpdateClusterOnError(err.Error())
return fmt.Errorf("error waiting for kubefirst-api to transition to Running: %w", err)
return fmt.Errorf("error waiting for kubefirst-pro-api to transition to Running: %w", err)
}
}

Expand Down

0 comments on commit 3a997b5

Please sign in to comment.