Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#1086 from jpodivin/removed…
Browse files Browse the repository at this point in the history
…efaults

Removing unused control plane default structure and funcs
  • Loading branch information
openshift-merge-bot[bot] authored Sep 23, 2024
2 parents 646be34 + 78ffe41 commit e81d756
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 41 deletions.
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

0 comments on commit e81d756

Please sign in to comment.