Skip to content

Commit

Permalink
import consistency: configv1 (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 authored Oct 3, 2024
1 parent 1158534 commit 8f011e8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
14 changes: 7 additions & 7 deletions pkg/clusterversion/clusterversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/golang/glog"
"github.com/openshift-kni/eco-goinfra/pkg/clients"
"github.com/openshift-kni/eco-goinfra/pkg/msg"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/api/config/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
Expand All @@ -24,9 +24,9 @@ const (
// Builder provides a struct for clusterversion object from the cluster and a clusterversion definition.
type Builder struct {
// clusterversion definition, used to create the clusterversion object.
Definition *v1.ClusterVersion
Definition *configv1.ClusterVersion
// Created clusterversion object.
Object *v1.ClusterVersion
Object *configv1.ClusterVersion
// api client to interact with the cluster.
apiClient *clients.Settings
// Used in functions that define or mutate clusterversion definition. errorMsg is processed before the
Expand All @@ -40,7 +40,7 @@ func Pull(apiClient *clients.Settings) (*Builder, error) {

builder := Builder{
apiClient: apiClient,
Definition: &v1.ClusterVersion{
Definition: &configv1.ClusterVersion{
ObjectMeta: metav1.ObjectMeta{
Name: clusterVersionName,
},
Expand Down Expand Up @@ -90,7 +90,7 @@ func (builder *Builder) WithDesiredUpdateImage(desiredUpdateImage string, force
return builder
}

builder.Definition.Spec.DesiredUpdate = &v1.Update{Image: desiredUpdateImage, Force: force}
builder.Definition.Spec.DesiredUpdate = &configv1.Update{Image: desiredUpdateImage, Force: force}

return builder
}
Expand Down Expand Up @@ -150,7 +150,7 @@ func (builder *Builder) WaitUntilAvailable(timeout time.Duration) error {

// WaitUntilConditionTrue waits for timeout duration or until clusterversion gets to a specific status.
func (builder *Builder) WaitUntilConditionTrue(
conditionType v1.ClusterStatusConditionType, timeout time.Duration) error {
conditionType configv1.ClusterStatusConditionType, timeout time.Duration) error {
if valid, err := builder.validate(); !valid {
return err
}
Expand Down Expand Up @@ -193,7 +193,7 @@ func (builder *Builder) WaitUntilUpdateIsCompleted(timeout time.Duration) error

// WaitUntilUpdateHistoryStateTrue waits until there is a history entry indicating an updateHistoryState.
func (builder *Builder) WaitUntilUpdateHistoryStateTrue(
updateHistoryState v1.UpdateState, timeout time.Duration) error {
updateHistoryState configv1.UpdateState, timeout time.Duration) error {
if valid, err := builder.validate(); !valid {
return err
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import (
"github.com/golang/glog"
"github.com/openshift-kni/eco-goinfra/pkg/clients"
"github.com/openshift-kni/eco-goinfra/pkg/msg"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/api/config/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// Builder provides a struct for console object from the cluster and a console definition.
type Builder struct {
// Console definition, used to create the pod object.
Definition *v1.Console
Definition *configv1.Console
// Created console object.
Object *v1.Console
Object *configv1.Console
// api client to interact with the cluster.
apiClient *clients.Settings
// errorMsg is processed before console object is created.
Expand All @@ -31,7 +31,7 @@ func NewBuilder(apiClient *clients.Settings, name string) *Builder {

builder := Builder{
apiClient: apiClient,
Definition: &v1.Console{
Definition: &configv1.Console{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
Expand All @@ -51,7 +51,7 @@ func NewBuilder(apiClient *clients.Settings, name string) *Builder {
func Pull(apiClient *clients.Settings, name string) (*Builder, error) {
builder := Builder{
apiClient: apiClient,
Definition: &v1.Console{
Definition: &configv1.Console{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
Expand Down
8 changes: 4 additions & 4 deletions pkg/infrastructure/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/golang/glog"
"github.com/openshift-kni/eco-goinfra/pkg/clients"
"github.com/openshift-kni/eco-goinfra/pkg/msg"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/api/config/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand All @@ -19,9 +19,9 @@ const (
// Builder provides a struct for infrastructure object from the cluster and a infrastructure definition.
type Builder struct {
// infrastructure definition, used to create the infrastructure object.
Definition *v1.Infrastructure
Definition *configv1.Infrastructure
// Created infrastructure object.
Object *v1.Infrastructure
Object *configv1.Infrastructure
// api client to interact with the cluster.
apiClient *clients.Settings
}
Expand All @@ -32,7 +32,7 @@ func Pull(apiClient *clients.Settings) (*Builder, error) {

builder := Builder{
apiClient: apiClient,
Definition: &v1.Infrastructure{
Definition: &configv1.Infrastructure{
ObjectMeta: metav1.ObjectMeta{
Name: infrastructureName,
},
Expand Down
8 changes: 4 additions & 4 deletions pkg/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/golang/glog"
"github.com/openshift-kni/eco-goinfra/pkg/clients"
"github.com/openshift-kni/eco-goinfra/pkg/msg"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/api/config/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand All @@ -19,9 +19,9 @@ const (
// ConfigBuilder provides a struct for network object from the cluster and a network definition.
type ConfigBuilder struct {
// network definition, used to create the network object.
Definition *v1.Network
Definition *configv1.Network
// Created network object.
Object *v1.Network
Object *configv1.Network
// api client to interact with the cluster.
apiClient *clients.Settings
}
Expand All @@ -32,7 +32,7 @@ func PullConfig(apiClient *clients.Settings) (*ConfigBuilder, error) {

builder := ConfigBuilder{
apiClient: apiClient,
Definition: &v1.Network{
Definition: &configv1.Network{
ObjectMeta: metav1.ObjectMeta{
Name: clusterNetworkName,
},
Expand Down
8 changes: 4 additions & 4 deletions pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/golang/glog"
"github.com/openshift-kni/eco-goinfra/pkg/clients"
"github.com/openshift-kni/eco-goinfra/pkg/msg"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/api/config/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand All @@ -19,9 +19,9 @@ const (
// Builder provides a struct for proxy object from the cluster and a proxy definition.
type Builder struct {
// proxy definition, used to create the proxy object.
Definition *v1.Proxy
Definition *configv1.Proxy
// Created proxy object.
Object *v1.Proxy
Object *configv1.Proxy
// api client to interact with the cluster.
apiClient *clients.Settings
}
Expand All @@ -32,7 +32,7 @@ func Pull(apiClient *clients.Settings) (*Builder, error) {

builder := Builder{
apiClient: apiClient,
Definition: &v1.Proxy{
Definition: &configv1.Proxy{
ObjectMeta: metav1.ObjectMeta{
Name: clusterProxyName,
},
Expand Down

0 comments on commit 8f011e8

Please sign in to comment.