-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a show command to the Diki CLI (#412)
* Add supported versions metadata for each ruleset instance * Add ruleset version resolving methods to the provider definitions * Add comments * Add show command implementation * Move JSON defined structures into a separate module * Move ruleset user-friendly names into constant variables for broader access * Add description comments for the new constants * Add functions that showcase each provider's metadata * Refactor showProvider command and additional tabulations * formatting * Rename variables and comments in the metadata and builder packages * Add comment and reference changes to the app command * Add additional comments to the ruleset files * Refactor metadata initalizing builder methods * Fix typo * Add constants to the provider definition files * Add constants to the metadata builder methods * Declare and utilize a new string to Metadata map in main.go * Simplify some code * Tabulation * Remove support for version v1r11 * Correct some nits * Add suggestions * Fix typo * Tabulation * Change comments
- Loading branch information
1 parent
7778256
commit 6e41ef6
Showing
17 changed files
with
382 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and Gardener contributors | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package metadata | ||
|
||
// Version is used to represent a specific version of a ruleset. | ||
type Version struct { | ||
// Version is the name of the ruleset release. | ||
Version string `json:"version"` | ||
// Latest shows if the specific version is the latest one. | ||
Latest bool `json:"latest"` | ||
} | ||
|
||
// Ruleset is used to represent a specific ruleset and it's metadata. | ||
type Ruleset struct { | ||
// ID is the unique identifier of the ruleset. | ||
ID string `json:"id"` | ||
// Name is the user-friendly name of the ruleset. | ||
Name string `json:"name"` | ||
// Versions is used to showcase the supported versions of the specific ruleset. | ||
Versions []Version `json:"versions"` | ||
} | ||
|
||
// Provider is used to represent an available provider by it's name and unique identifier. | ||
type Provider struct { | ||
// ID is the unique identifier of the provider. | ||
ID string `json:"id"` | ||
// Name is the user-friendly name of the provider. | ||
Name string `json:"name"` | ||
} | ||
|
||
// ProviderDetailed is used to represent a specific provider and it's metadata. | ||
type ProviderDetailed struct { | ||
Provider | ||
Rulesets []Ruleset `json:"rulesets"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.