code: func (s SecretForTLSGeneratorV1) StructuredGenerate() (runtime.Object, error) {
  	if err := s.validate(); err != nil {
  		return nil, err
  	}
  	tlsCrt, err := readFile(s.Cert)
  	if err != nil {
  		return nil, err
  	}
  	tlsKey, err := readFile(s.Key)
  	if err != nil {
  		return nil, err
  	}
  
  	if _, err := tls.X509KeyPair(tlsCrt, tlsKey); err != nil {
  		return nil, fmt.Errorf("failed to load key pair %v", err)
  	}
  	// TODO: Add more validation.
  	// 1. If the certificate contains intermediates, it is a valid chain.
  	// 2. Format etc.
  
  	secret := &v1.Secret{}
  	secret.Name = s.Name
  	secret.Type = v1.SecretTypeTLS
  	secret.Data = map[string][]byte{}
  	secret.Data[v1.TLSCertKey] = []byte(tlsCrt)
  	secret.Data[v1.TLSPrivateKeyKey] = []byte(tlsKey)
  	if s.AppendHash {
  		h, err := hash.SecretHash(secret)
  		if err != nil {
  			return nil, err
  		}
  		secret.Name = fmt.Sprintf("%s-%s", secret.Name, h)
  	}
  	return secret, nil
  }
docs: // StructuredGenerate outputs a secret object using the configured fields