@@ -30,6 +30,7 @@ type AddOn interface {
3030 HostPreflights () (* v1beta2.HostPreflightSpec , error )
3131 GenerateHelmConfig (onlyDefaults bool ) ([]v1beta1.Chart , []v1beta1.Repository , error )
3232 Outro (context.Context , client.Client ) error
33+ GetProtectedFields () map [string ][]string
3334}
3435
3536// Applier is an entity that applies (installs and updates) addons in the cluster.
@@ -78,6 +79,21 @@ func (a *Applier) GenerateHelmConfigs() ([]v1beta1.Chart, []v1beta1.Repository,
7879 return charts , repositories , nil
7980}
8081
82+ // ProtectedFields returns the protected fields for all the embedded charts.
83+ func (a * Applier ) ProtectedFields () (map [string ][]string , error ) {
84+ protectedFields := map [string ][]string {}
85+ addons , err := a .load ()
86+ if err != nil {
87+ return protectedFields , fmt .Errorf ("unable to load addons: %w" , err )
88+ }
89+ for _ , addon := range addons {
90+ for k , v := range addon .GetProtectedFields () {
91+ protectedFields [k ] = v
92+ }
93+ }
94+ return protectedFields , nil
95+ }
96+
8197// HostPreflights reads all embedded host preflights from all add-ons and returns them
8298// merged in a single HostPreflightSpec.
8399func (a * Applier ) HostPreflights () (* v1beta2.HostPreflightSpec , error ) {
0 commit comments