Open sftim opened 5 months ago
Would be nice to add this feature.
/priority backlog /triage accepted
I'm happy to assist anyone interested in contributing to this feature request.
I'm exploring how website works using Hugo and also checking out shortcodes. I'm interested in trying this out.
/assign
I'm happy to assist anyone interested in contributing to this feature request.
@dipesh-rawat I will reach out on Slack for some help with this.
@dev-johnn How's this work going? Feel free to reach out if you need any assistance!
Apologies, got little busy. Now i will be able to dedicate time for open source. Let me first try this. Will definitely reach out if I need help @ dipeshrawat.
hii @dipesh-rawat can you guide me for this issue
{{ $valid_states := "alpha, beta, deprecated, stable, frozen" }}
{{ $state := .Get "state" }}
{{ $for_k8s_version := .Get "for_k8s_version" | default (.Page.Param "version") }}
{{ $is_valid := strings.Contains $valid_states $state }}
{{ $feature_gate_name := .Get "feature_gate_name" }}
{{ if not $feature_gate_name }}
{{ if not $is_valid }}
{{ errorf "%q is not a valid feature-state, use one of %q" $state $valid_states }}
{{ else }}
<div class="feature-state-notice feature-{{ $state }}">
<span class="feature-state-name">{{ T "feature_state" }}</span>
<code>{{ T "feature_state_kubernetes_label" }} {{ $for_k8s_version }} [{{ $state }}]</code>
</div>
{{ end }}
{{ else }}
<!-- When 'feature_gate_name' is specified, extract status of the feature gate -->
{{- $featureGateDescriptionFilesPath := "/docs/reference/command-line-tools-reference/feature-gates" -}}
{{- with index (where .Site.Sites "Language.Lang" "eq" "en") 0 -}}
{{- with .GetPage $featureGateDescriptionFilesPath -}}
{{- $sortedFeatureGates := sort (.Resources.ByType "page") -}}
{{- $featureGateFound := false -}}
{{- range $featureGateFile := $sortedFeatureGates -}}
{{- $featureGateNameFromFile := $featureGateFile.Params.Title -}}
{{- if eq $featureGateNameFromFile $feature_gate_name -}}
{{- $currentStage := index $featureGateFile.Params.stages (sub (len $featureGateFile.Params.stages) 1) -}}
{{- with $currentStage -}}
<div class="feature-state-notice feature-{{ .stage }}" title="{{ printf "%s %s" (T "feature_state_feature_gate_tooltip") $feature_gate_name }}">
<span class="feature-state-name">{{ T "feature_state" }}</span>
<code>{{ T "feature_state_kubernetes_label" }} v{{ .fromVersion }} [{{ .stage }}]</code>
</div>
{{- $featureGateFound = true -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if not $featureGateFound -}}
{{- errorf "Invalid feature gate: '%s' is not recognized or lacks a matching description file in '%s'" $feature_gate_name (print "en" $featureGateDescriptionFilesPath) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{ end }}
The brief is to make something that is visually similar to feature state (but might actually be its own shortcode).
This is a Feature Request
What would you like to be added We can denote features as alpha, beta, generally available, or deprecated. That's it. For example, we have a feature state shortcode.
Add a way, visually similar to feature state, that allows marking a feature as frozen.
Why is this needed https://github.com/kubernetes/enhancements/pull/4572#issuecomment-2059937137 suggests we will have a frozen feature, and this may be a project first.
Comments /area web-development /kind feature
If you've already worked on similar web development work and would be willing to mentor a contributor who hasn't, this issue could be a good opportunity to do that.