Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing unused control plane default structure and funcs #1086

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"github.com/openstack-k8s-operators/lib-common/modules/common/route"
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
"github.com/openstack-k8s-operators/lib-common/modules/storage"
manilav1 "github.com/openstack-k8s-operators/manila-operator/api/v1beta1"
mariadbv1 "github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1"
Expand Down Expand Up @@ -928,16 +927,6 @@ func (instance *OpenStackControlPlane) InitConditions() {
instance.Status.Conditions.Init(&cl)
}

// SetupDefaults - initializes any CRD field defaults based on environment variables (the defaulting mechanism itself is implemented via webhooks)
func SetupDefaults() {
// Acquire environmental defaults and initialize OpenStackControlPlane defaults with them
openstackControlPlaneDefaults := OpenStackControlPlaneDefaults{
RabbitMqImageURL: util.GetEnvVar("RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT", RabbitMqContainerImage),
}

SetupOpenStackControlPlaneDefaults(openstackControlPlaneDefaults)
}

// IsCustomIssuer - returns true if CustomIssuer is provided and not empty string
func (ca CACertConfig) IsCustomIssuer() bool {
return ca.CustomIssuer != nil && *ca.CustomIssuer != ""
Expand Down
13 changes: 0 additions & 13 deletions apis/core/v1beta1/openstackcontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,9 @@ import (

var ctlplaneWebhookClient client.Client

// OpenStackControlPlaneDefaults -
type OpenStackControlPlaneDefaults struct {
RabbitMqImageURL string
}

var openstackControlPlaneDefaults OpenStackControlPlaneDefaults

// log is for logging in this package.
var openstackcontrolplanelog = logf.Log.WithName("openstackcontrolplane-resource")

// SetupOpenStackControlPlaneDefaults - initialize OpenStackControlPlane spec defaults for use with internal webhooks
func SetupOpenStackControlPlaneDefaults(defaults OpenStackControlPlaneDefaults) {
openstackControlPlaneDefaults = defaults
openstackcontrolplanelog.Info("OpenStackControlPlane defaults initialized", "defaults", defaults)
}

// SetupWebhookWithManager sets up the Webhook with the Manager.
func (r *OpenStackControlPlane) SetupWebhookWithManager(mgr ctrl.Manager) error {
if ctlplaneWebhookClient == nil {
Expand Down
15 changes: 0 additions & 15 deletions apis/core/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ func main() {
dataplanev1.SetupDefaults()

// Defaults for anything else that was not covered by OpenStackClient nor service operator defaults
corev1.SetupDefaults()
corev1.SetupVersionDefaults()

// Webhooks
Expand Down
1 change: 0 additions & 1 deletion tests/functional/ctlplane/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ var _ = BeforeSuite(func() {
core_ctrl.SetupVersionDefaults()
openstack.SetupServiceOperatorDefaults()
openstackclientv1.SetupDefaults()
corev1.SetupDefaults()
corev1.SetupVersionDefaults()

err = (&client_ctrl.OpenStackClientReconciler{
Expand Down
Loading