Fix filter Agent config (#103)

This commit is contained in:
Vivek-Joshi-99 2025-01-27 15:08:37 -08:00 committed by GitHub
parent 2dea81b509
commit 36a500d332
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,7 +88,7 @@ func parseOptions(cluster clusterplugin.Cluster) ([]byte, []byte, []byte) {
// Data received from upstream contains config for both control plane and worker. Thus, for worker,
// config is being filtered via unmarshal into agent config.
var agentCfg api.K3sAgentConfig
if err := yaml.Unmarshal([]byte(cluster.Options), &agentCfg); err == nil {
if err := yaml.Unmarshal(userOptionConfig, &agentCfg); err == nil {
userOptionConfig, _ = yaml.Marshal(agentCfg)
} else {
logrus.Fatalf("failed to un-marshal cluster options in k3s agent config %s", err)