Esempio n. 1
0
// DecodeNestedObjects handles encoding RawExtensions on the MasterConfig, ensuring the
// objects are decoded with the provided decoder.
func (c *MasterConfig) DecodeNestedObjects(d runtime.Decoder) error {
	// decoding failures result in a runtime.Unknown object being created in Object and passed
	// to conversion
	for k, v := range c.AdmissionConfig.PluginConfig {
		extension.DecodeNestedRawExtensionOrUnknown(d, &v.Configuration)
		c.AdmissionConfig.PluginConfig[k] = v
	}
	if c.KubernetesMasterConfig != nil {
		for k, v := range c.KubernetesMasterConfig.AdmissionConfig.PluginConfig {
			extension.DecodeNestedRawExtensionOrUnknown(d, &v.Configuration)
			c.KubernetesMasterConfig.AdmissionConfig.PluginConfig[k] = v
		}
	}
	if c.OAuthConfig != nil {
		for i := range c.OAuthConfig.IdentityProviders {
			extension.DecodeNestedRawExtensionOrUnknown(d, &c.OAuthConfig.IdentityProviders[i].Provider)
		}
	}
	return nil
}
Esempio n. 2
0
func (c *PolicyRule) DecodeNestedObjects(d runtime.Decoder) error {
	// decoding failures result in a runtime.Unknown object being created in Object and passed
	// to conversion
	extension.DecodeNestedRawExtensionOrUnknown(d, &c.AttributeRestrictions)
	return nil
}