CICD: Warn user if -provider does not match profiles.json:TYPE (#3375)

This commit is contained in:
Tom Limoncelli 2025-01-15 18:28:15 -05:00 committed by GitHub
parent 0d5b3c22b7
commit fc2c506920
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,15 +99,19 @@ func getProvider(t *testing.T) (providers.DNSServiceProvider, string, map[string
if *profileFlag == "" { if *profileFlag == "" {
*profileFlag = profileName *profileFlag = profileName
} }
// Fill in -provider if blank.
if *providerFlag == "" {
*providerFlag = profileType
}
// Fix legacy use of -provider. // Sanity check. If the user-specifed -provider flag doesn't match what was in the file, warn them.
if *providerFlag != profileType { if *providerFlag != profileType {
fmt.Printf("WARNING: -provider=%q does not match profile TYPE=%q. Using profile TYPE.\n", *providerFlag, profileType) fmt.Printf("WARNING: -provider=%q does not match profile TYPE=%q. Using profile TYPE.\n", *providerFlag, profileType)
*providerFlag = profileType *providerFlag = profileType
} }
// fmt.Printf("DEBUG flag=%q Profile=%q TYPE=%q\n", *providerFlag, profileName, profileType) // fmt.Printf("DEBUG flag=%q Profile=%q TYPE=%q\n", *providerFlag, profileName, profileType)
fmt.Printf("Testing Profile=%q TYPE=%q\n", profileName, profileType) fmt.Printf("Testing Profile=%q (TYPE=%q)\n", profileName, profileType)
var metadata json.RawMessage var metadata json.RawMessage