-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add missing GlanceAPI webhook #363
Conversation
@@ -5,7 +5,6 @@ metadata: | |||
spec: | |||
serviceUser: glance | |||
serviceAccount: glance | |||
containerImage: quay.io/podified-antelope-centos9/openstack-glance-api:current-podified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/test glance-operator-build-deploy-tempest |
api/v1beta1/glanceapi_webhook.go
Outdated
// log is for logging in this package. | ||
var glanceapilog = logf.Log.WithName("glanceapi-resource") | ||
|
||
// SetupGlanceAPIDefaults - initialize Glance spec defaults for use with either internal or external webhooks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/initialize Glance/initialize GlanceAPI/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, updating it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
/test glance-operator-build-deploy-tempest |
// SetupGlanceAPIDefaults - initialize GlanceAPI spec defaults for use with either internal or external webhooks | ||
func SetupGlanceAPIDefaults(defaults GlanceAPIDefaults) { | ||
glanceAPIDefaults = defaults | ||
glancelog.Info("Glance defaults initialized", "defaults", defaults) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also need something that pulls-in the ENV vars and sets them in the GlanceAPIDefaults
, like we do here [1]. Maybe I just am missing where you're already doing this, however.
[1]
glance-operator/api/v1beta1/common.go
Lines 114 to 121 in 66fbd23
func SetupDefaults() { | |
// Acquire environmental defaults and initialize Glance defaults with them | |
glanceDefaults := GlanceDefaults{ | |
ContainerImageURL: util.GetEnvVar("RELATED_IMAGE_GLANCE_API_IMAGE_URL_DEFAULT", GlanceAPIContainerImage), | |
} | |
SetupGlanceDefaults(glanceDefaults) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I need that function too in common.go
. Updating the patch in a moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
In general it is not allowed to create a glanceAPI instance without defining the top-level Glance CR. However, if for any, unknown reason a glanceAPI CR is created, it will always fail because of the required .spec.ContainerImage field that appears to be empty or simply not defined. This patch introduces the glanceAPI missing webhook that covers at the glanceAPI level the ContainerImage propagationa/definition. Signed-off-by: Francesco Pantano <[email protected]>
/test glance-operator-build-deploy-tempest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprince, fmount The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
f304ac5
into
openstack-k8s-operators:main
In general it is not allowed to create a
glanceAPI
instance without defining the top-levelGlance
CR
.However, if for any, unknown reason a
glanceAPI
CR
is created, it will always fail because of the required.spec.ContainerImage
field that appears to be empty or simply not defined.This patch introduces the
glanceAPI
missingwebhook
that covers at theglanceAPI
level theContainerImage
propagation/definition.