-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: changes to support motd #385
base: dev
Are you sure you want to change the base?
Conversation
@@ -9,6 +9,8 @@ import ( | |||
"github.com/IBM-Cloud/ibm-cloud-cli-sdk/bluemix" | |||
"github.com/IBM-Cloud/ibm-cloud-cli-sdk/bluemix/configuration" | |||
"github.com/IBM-Cloud/ibm-cloud-cli-sdk/bluemix/models" | |||
|
|||
// "github.com/IBM-Cloud/ibm-cloud-cli-sdk/plugin" |
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: Remove comment
@@ -1,19 +1,20 @@ | |||
module github.com/IBM-Cloud/ibm-cloud-cli-sdk | |||
|
|||
go 1.20 | |||
go 1.19 |
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.
Let move the go version to match what is on the core CLI
return false | ||
} | ||
|
||
func CheckMessageOfTheDay(client *rest.Client, config core_config.ReadWriter, pluginConfig plugin.PluginConfig, modURL string, ui terminal.UI, version string) { |
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.
The version
parameter is never used in this method. Lets remove it.
if !CheckMessageOftheDayForPlugin(pluginConfig) { | ||
return | ||
} | ||
defer pluginConfig.Set("MessageOfTheDayTime", time.Now().Unix()) |
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.
There needs to a nil check here since this can be null.
Summary
PR contains code to support retrieval of and recordkeeping of update frequency for a "message of the day" similarly to how it works in the core CLI program. There are some assumptions about replicating the entries for MotD that appear in the core program's configuration in plugin configuration files (adding a key "MessageOfTheDayTime" and one key for the location on COS from where the MotD payload can be fetched); this may change later in the review process.