Skip to content

Commit

Permalink
chore: gofmt, lint
Browse files Browse the repository at this point in the history
  • Loading branch information
a9p committed Jan 30, 2023
1 parent 6b772af commit 26a7526
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/controller/common/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ limitations under the License.
package v1beta1

import (
corev1 "k8s.io/api/core/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
)

// AlgorithmSpec is the specification for a HP or NAS algorithm.
Expand All @@ -31,7 +31,7 @@ type AlgorithmSpec struct {
AlgorithmSettings []AlgorithmSetting `json:"algorithmSettings,omitempty"`

// Suggestion service Deployment spec
SuggestionSpec appsv1.DeploymentSpec `json:suggestionSpec,omitempty`
SuggestionSpec appsv1.DeploymentSpec `json:"suggestionSpec,omitempty"`
}

// AlgorithmSetting represents key-value pair for HP or NAS algorithm settings.
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller.v1beta1/suggestion/suggestion_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (r *ReconcileSuggestion) ReconcileSuggestion(instance *suggestionsv1beta1.S
suggestionNsName := types.NamespacedName{Name: instance.GetName(), Namespace: instance.GetNamespace()}
logger := log.WithValues("Suggestion", suggestionNsName)

// TODO(a9p): the next few blocks are from config.go::GetSuggestionConfigData,
// TODO(a9p): the next few blocks are from config.go::GetSuggestionConfigData,
// this should be pulled out into a utility function if correct
// Get katib config map
configMap := &corev1.ConfigMap{}
Expand All @@ -215,7 +215,7 @@ func (r *ReconcileSuggestion) ReconcileSuggestion(instance *suggestionsv1beta1.S
return err
}
// Try to find SuggestionConfig for the algorithm
suggestionConfigData, _ = suggestionsConfig[instance.Spec.Algorithm.AlgorithmName]
suggestionConfigData = suggestionsConfig[instance.Spec.Algorithm.AlgorithmName]
}

// If ResumePolicy is FromVolume or PersistentVolumeClaimSpec provided, volume is reconciled for suggestion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func (g *General) ConvertExperiment(s *suggestionsv1beta1.Suggestion, e *experim
Algorithm: &suggestionapi.AlgorithmSpec{
AlgorithmName: e.Spec.Algorithm.AlgorithmName,
AlgorithmSettings: convertAlgorithmSettings(e.Spec.Algorithm.AlgorithmSettings),
SuggestionSpec: s.Spec.Algorithm.SuggestionSpec.DeepCopy(),
SuggestionSpec: s.Spec.Algorithm.SuggestionSpec.DeepCopy(),
},
Objective: &suggestionapi.ObjectiveSpec{
Type: convertObjectiveType(e.Spec.Objective.Type),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -976,6 +977,7 @@ func newFakeRequest() *suggestionapi.GetSuggestionsRequest {
Value: "value",
},
},
SuggestionSpec: &appsv1.DeploymentSpec{},
},
EarlyStopping: &suggestionapi.EarlyStoppingSpec{
AlgorithmName: earlyStoppingAlgorithmName,
Expand Down

0 comments on commit 26a7526

Please sign in to comment.