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

Refactor InitWriterConfig #9922

Merged
merged 2 commits into from
Apr 9, 2024
Merged

Refactor InitWriterConfig #9922

merged 2 commits into from
Apr 9, 2024

Conversation

Staniel
Copy link
Contributor

@Staniel Staniel commented Apr 5, 2024

Type of change

Select the type of your PR

  • Refactoring

Description

Refactor the InitWriterConfig in the kafka-init module to use the shared classes, fix #9881

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md
  • Supply screenshots for visual changes, such as Grafana dashboards

Signed-off-by: Lixin Yao <lixin_yao@apple.com>
@Staniel Staniel requested a review from scholzj April 5, 2024 04:30
@scholzj scholzj added this to the 0.41.0 milestone Apr 5, 2024
@scholzj scholzj requested a review from ppatierno April 5, 2024 09:59
@scholzj
Copy link
Member

scholzj commented Apr 5, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

I think the system tests failed because the config libraries cannot handle true / false unless they are in lower case and the Cluster Operator sets it in upper case. I think you have to update the method for parsing the boolean in ConfigParameterParser to use equalsIgnoreCase instead:

    /**
     * A Java Boolean
     */
    ConfigParameterParser<Boolean> BOOLEAN = configValue -> {
        if (configValue.equalsIgnoreCase("true") || configValue.equalsIgnoreCase("false")) {
            return Boolean.parseBoolean(configValue);
        } else {
            throw new InvalidConfigurationException("Failed to parse. Value " + configValue + " is not valid");
        }
    };

Signed-off-by: Lixin Yao <lixin_yao@apple.com>
@Staniel
Copy link
Contributor Author

Staniel commented Apr 8, 2024

I think the system tests failed because the config libraries cannot handle true / false unless they are in lower case and the Cluster Operator sets it in upper case. I think you have to update the method for parsing the boolean in ConfigParameterParser to use equalsIgnoreCase instead:

    /**
     * A Java Boolean
     */
    ConfigParameterParser<Boolean> BOOLEAN = configValue -> {
        if (configValue.equalsIgnoreCase("true") || configValue.equalsIgnoreCase("false")) {
            return Boolean.parseBoolean(configValue);
        } else {
            throw new InvalidConfigurationException("Failed to parse. Value " + configValue + " is not valid");
        }
    };

Done

@scholzj
Copy link
Member

scholzj commented Apr 9, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM.

Copy link
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the PR!

@scholzj scholzj merged commit b8e6f52 into strimzi:main Apr 9, 2024
21 checks passed
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.

Use the new configuration classes in InitWriterConfig
3 participants