anodizer_core/config/publishers/krew.rs
1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4use super::super::{StringOrBool, deserialize_string_or_bool_opt};
5use super::{CommitAuthorConfig, RepositoryConfig};
6
7// ---------------------------------------------------------------------------
8// KrewConfig
9// ---------------------------------------------------------------------------
10
11#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
12#[serde(default, deny_unknown_fields)]
13pub struct KrewConfig {
14 /// Override the plugin name (default: crate name).
15 pub name: Option<String>,
16 /// Build IDs filter: only include artifacts whose `id` is in this list.
17 pub ids: Option<Vec<String>>,
18 /// Unified repository config with branch, token, PR, git SSH support.
19 /// (Replaces the legacy `manifests_repo:` / `upstream_repo:` form.) The
20 /// upstream PR target is derived from `repository.pull_request.base`
21 /// when set, falling back to the canonical kubernetes-sigs/krew-index.
22 pub repository: Option<RepositoryConfig>,
23 /// Commit author with optional signing.
24 pub commit_author: Option<CommitAuthorConfig>,
25 /// Custom commit message template.
26 pub commit_msg_template: Option<String>,
27 /// Full description of the kubectl plugin.
28 pub description: Option<String>,
29 /// One-line summary of the kubectl plugin (max 255 chars).
30 pub short_description: Option<String>,
31 /// Project homepage URL for the plugin.
32 pub homepage: Option<String>,
33 /// Custom URL template for download URLs (overrides release URL).
34 pub url_template: Option<String>,
35 /// Post-install message shown to the user.
36 pub caveats: Option<String>,
37 /// Skip publishing. `"true"` always skips; `"auto"` skips for prereleases.
38 /// Accepts bool or template string.
39 #[serde(deserialize_with = "deserialize_string_or_bool_opt", default)]
40 pub skip_upload: Option<StringOrBool>,
41 /// Skip this Krew config. Accepts bool or template string
42 /// (e.g. `"{{ if .IsSnapshot }}true{{ endif }}"` for conditional skip).
43 /// Distinct from `skip_upload` so users can opt out of generating the
44 /// manifest entirely (common when a project is not a kubectl plugin and
45 /// has no krew channel).
46 #[serde(deserialize_with = "deserialize_string_or_bool_opt", default)]
47 pub skip: Option<StringOrBool>,
48 /// amd64 microarchitecture variant filter (e.g. "v1", "v2", "v3", "v4").
49 /// Only artifacts matching this variant are included. Default: "v1".
50 pub amd64_variant: Option<String>,
51 /// ARM version filter (e.g. "6", "7"). Only artifacts matching this
52 /// variant are included.
53 pub arm_variant: Option<String>,
54 /// When true, force-push the updated plugin manifest to the existing PR
55 /// branch when a PR for the same head branch already exists. The PR content
56 /// is updated in place rather than creating a duplicate. When false
57 /// (default), the push is skipped and a warning is emitted so the operator
58 /// sees that the publisher did not update the PR.
59 #[serde(deserialize_with = "deserialize_string_or_bool_opt", default)]
60 pub update_existing_pr: Option<StringOrBool>,
61}