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

🧹 change lr default version to 9.0.0 #4525

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions providers-sdk/v1/lr/cli/cmd/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import (

func init() {
docsYamlCmd.Flags().String("docs-file", "", "optional file path to write content to a file")
docsYamlCmd.Flags().String("version", defaultVersion, "optional version to mark resource, default is latest")
docsYamlCmd.Flags().String("version", defaultVersionField, "optional version to mark resource, default is latest")
docsCmd.AddCommand(docsYamlCmd)
docsJSONCmd.Flags().String("dist", "", "folder for output json generation")
docsCmd.AddCommand(docsJSONCmd)
rootCmd.AddCommand(docsCmd)
}

const defaultVersion = "latest"
const defaultVersionField = "9.0.0"

var docsCmd = &cobra.Command{
Use: "docs",
Expand Down Expand Up @@ -175,7 +175,7 @@ func ensureDefaults(id string, entry *docs.LrDocsEntry, version string) *docs.Lr
}
if entry.MinMondooVersion == "" {
entry.MinMondooVersion = version
} else if entry.MinMondooVersion == defaultVersion && version != defaultVersion {
} else if entry.MinMondooVersion == defaultVersionField && version != defaultVersionField {
// Update to specified version if previously set to default
entry.MinMondooVersion = version
}
Expand Down Expand Up @@ -204,7 +204,7 @@ func mergeFields(version string, entry *docs.LrDocsEntry, fields []*lr.BasicFiel
MinMondooVersion: version,
}
entry.Fields[f.ID] = fDoc
} else if entry.Fields[f.ID].MinMondooVersion == "latest" && version != "latest" {
} else if entry.Fields[f.ID].MinMondooVersion == defaultVersionField && version != defaultVersionField {
entry.Fields[f.ID].MinMondooVersion = version
}
// Scrub field version if same as resource
Expand Down
Loading