This pull request includes several changes to the internal/controller package, focusing on improving the handling of context values, imports, and annotations in Kubernetes resources. The most important changes include adding a new context key type, updating import statements, and modifying annotations in the syncControllerSTS method.
Context Handling Enhancements:
Introduced a new ctxKey type to manage context values more effectively in internal/controller/automq_controller.go. ([internal/controller/automq_controller.goR54-R55](diffhunk://#diff-518ef86c8cca5a146f361950294aa1dfdfd9bfad14b9c8250befa4a56f6f8b9dR54-R55))
Added a context value for hash-configmap in the scriptConfigmap method. ([internal/controller/automq_controller.goR236](diffhunk://#diff-518ef86c8cca5a146f361950294aa1dfdfd9bfad14b9c8250befa4a56f6f8b9dR236))
Import Statement Updates:
Updated import statements in internal/controller/automq_controller.go to include time and hash, and removed redundant time import. ([[1]](diffhunk://#diff-518ef86c8cca5a146f361950294aa1dfdfd9bfad14b9c8250befa4a56f6f8b9dR23-R29), [[2]](diffhunk://#diff-518ef86c8cca5a146f361950294aa1dfdfd9bfad14b9c8250befa4a56f6f8b9dL40))
Updated import statements in internal/controller/automq_controller_c.go to include strconv and strings, and removed redundant imports. ([[1]](diffhunk://#diff-d245a0c3141d1e204d50f91a2f2453511e1f4a157f48d9df14a0f5452d1415b5R22-R24), [[2]](diffhunk://#diff-d245a0c3141d1e204d50f91a2f2453511e1f4a157f48d9df14a0f5452d1415b5L33-L34))
Added strings import in internal/controller/init_contrainer.go and removed redundant import. ([internal/controller/init_contrainer.goR20-L23](diffhunk://#diff-58135be650bae09717c90237ebaa393af4377509ef90d671fc42b6937200c7ddR20-L23))
Annotation Modifications:
Modified the syncControllerSTS method to include configmap/script-hash annotation and updated Prometheus annotations. ([internal/controller/automq_controller_c.goR302-R317](diffhunk://#diff-d245a0c3141d1e204d50f91a2f2453511e1f4a157f48d9df14a0f5452d1415b5R302-R317))
This pull request includes several changes to the
internal/controller
package, focusing on improving the handling of context values, imports, and annotations in Kubernetes resources. The most important changes include adding a new context key type, updating import statements, and modifying annotations in thesyncControllerSTS
method.Context Handling Enhancements:
ctxKey
type to manage context values more effectively ininternal/controller/automq_controller.go
. ([internal/controller/automq_controller.goR54-R55](diffhunk://#diff-518ef86c8cca5a146f361950294aa1dfdfd9bfad14b9c8250befa4a56f6f8b9dR54-R55)
)hash-configmap
in thescriptConfigmap
method. ([internal/controller/automq_controller.goR236](diffhunk://#diff-518ef86c8cca5a146f361950294aa1dfdfd9bfad14b9c8250befa4a56f6f8b9dR236)
)Import Statement Updates:
internal/controller/automq_controller.go
to includetime
andhash
, and removed redundanttime
import. ([[1]](diffhunk://#diff-518ef86c8cca5a146f361950294aa1dfdfd9bfad14b9c8250befa4a56f6f8b9dR23-R29)
,[[2]](diffhunk://#diff-518ef86c8cca5a146f361950294aa1dfdfd9bfad14b9c8250befa4a56f6f8b9dL40)
)internal/controller/automq_controller_c.go
to includestrconv
andstrings
, and removed redundant imports. ([[1]](diffhunk://#diff-d245a0c3141d1e204d50f91a2f2453511e1f4a157f48d9df14a0f5452d1415b5R22-R24)
,[[2]](diffhunk://#diff-d245a0c3141d1e204d50f91a2f2453511e1f4a157f48d9df14a0f5452d1415b5L33-L34)
)strings
import ininternal/controller/init_contrainer.go
and removed redundant import. ([internal/controller/init_contrainer.goR20-L23](diffhunk://#diff-58135be650bae09717c90237ebaa393af4377509ef90d671fc42b6937200c7ddR20-L23)
)Annotation Modifications:
syncControllerSTS
method to includeconfigmap/script-hash
annotation and updated Prometheus annotations. ([internal/controller/automq_controller_c.goR302-R317](diffhunk://#diff-d245a0c3141d1e204d50f91a2f2453511e1f4a157f48d9df14a0f5452d1415b5R302-R317)
)