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

Update the API parameter from user to username #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

altmas5
Copy link

@altmas5 altmas5 commented Mar 17, 2023

user is Deprecated in version 6.4. #62
See ZBXNEXT-8085
cc @pdecat

Copy link
Member

@pdecat pdecat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @altmas5, thanks for this PR!

However, in its current state it breaks compatibility with Zabbix versions older than 5.4.

And in the current state of the provider, it has compatibility issues with versions 5.0 and newer, e.g. :

@@ -87,7 +87,7 @@ func providerConfigure(d *schema.ResourceData, terraformVersion string) (interfa

api.SetClient(client)

if _, err := api.Login(d.Get("user").(string), d.Get("password").(string)); err != nil {
if _, err := api.Login(d.Get("username").(string), d.Get("password").(string)); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply changing user into username will break compatibility with Zabbix versions older than 5.4

ZBXNEXT-6474 user.login: Renamed parameter user → username.

https://www.zabbix.com/documentation/5.4/en/manual/api/changes_5.2_-_5.4#user

@@ -16,7 +16,7 @@ import (
func Provider() *schema.Provider {
p := &schema.Provider{
Schema: map[string]*schema.Schema{
"user": &schema.Schema{
"username": &schema.Schema{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it is required to rename the provider attribute, as it is a breaking change.
Even so less if we want to maintain compatibility with older Zabbix versions which use user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants