Skip to content

Commit

Permalink
Add disableSSHCAUser and disableSSHCAHost attributes to GCP provisioner
Browse files Browse the repository at this point in the history
  • Loading branch information
dopey committed Oct 28, 2024
1 parent f619bce commit dfb4907
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
17 changes: 17 additions & 0 deletions command/ca/provisioner/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ IID (AWS/GCP/Azure)
[**--azure-audience**=<name>] [**--azure-subscription-id**=<id>]
[**--azure-object-id**=<id>] [**--instance-age**=<duration>] [**--iid-roots**=<file>]
[**--disable-custom-sans**] [**--disable-trust-on-first-use**]
[**--disable-ssh-ca-user**] [**--disable-ssh-ca-host**]
[**--admin-cert**=<file>] [**--admin-key**=<file>]
[**--admin-subject**=<subject>] [**--admin-provisioner**=<name>] [**--admin-password-file**=<file>]
[**--ca-url**=<uri>] [**--root**=<file>] [**--context**=<name>] [**--ca-config**=<file>]
Expand Down Expand Up @@ -790,13 +791,29 @@ func createGCPDetails(ctx *cli.Context) (*linkedca.ProvisionerDetails, error) {
return nil, err
}

var (
disableSSHCAUser *bool
disableSSHCAHost *bool
)

if ctx.IsSet("disable-ssh-ca-user") {
boolVal := ctx.Bool("disable-ssh-ca-user")
disableSSHCAUser = &boolVal
}
if ctx.IsSet("disable-ssh-ca-host") {
boolVal := ctx.Bool("disable-ssh-ca-host")
disableSSHCAHost = &boolVal
}

return &linkedca.ProvisionerDetails{
Data: &linkedca.ProvisionerDetails_GCP{
GCP: &linkedca.GCPProvisioner{
ServiceAccounts: ctx.StringSlice("gcp-service-account"),
ProjectIds: ctx.StringSlice("gcp-project"),
DisableCustomSans: ctx.Bool("disable-custom-sans"),
DisableTrustOnFirstUse: ctx.Bool("disable-trust-on-first-use"),
DisableSshCaUser: disableSSHCAUser,

Check failure on line 815 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / govulncheck / govulncheck

unknown field DisableSshCaUser in struct literal of type linkedca.GCPProvisioner

Check failure on line 815 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

unknown field DisableSshCaUser in struct literal of type linkedca.GCPProvisioner

Check failure on line 815 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

unknown field DisableSshCaUser in struct literal of type linkedca.GCPProvisioner

Check failure on line 815 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / build / build (oldstable)

unknown field DisableSshCaUser in struct literal of type linkedca.GCPProvisioner

Check failure on line 815 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

unknown field DisableSshCaUser in struct literal of type linkedca.GCPProvisioner

Check failure on line 815 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

unknown field DisableSshCaUser in struct literal of type linkedca.GCPProvisioner

Check failure on line 815 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

unknown field DisableSshCaUser in struct literal of type linkedca.GCPProvisioner

Check failure on line 815 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

unknown field DisableSshCaUser in struct literal of type linkedca.GCPProvisioner

Check failure on line 815 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

unknown field DisableSshCaUser in struct literal of type linkedca.GCPProvisioner

Check failure on line 815 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

unknown field DisableSshCaUser in struct literal of type linkedca.GCPProvisioner
DisableSshCaHost: disableSSHCAHost,

Check failure on line 816 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / govulncheck / govulncheck

unknown field DisableSshCaHost in struct literal of type linkedca.GCPProvisioner

Check failure on line 816 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

unknown field DisableSshCaHost in struct literal of type linkedca.GCPProvisioner

Check failure on line 816 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

unknown field DisableSshCaHost in struct literal of type linkedca.GCPProvisioner

Check failure on line 816 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / build / build (oldstable)

unknown field DisableSshCaHost in struct literal of type linkedca.GCPProvisioner

Check failure on line 816 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

unknown field DisableSshCaHost in struct literal of type linkedca.GCPProvisioner

Check failure on line 816 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

unknown field DisableSshCaHost in struct literal of type linkedca.GCPProvisioner

Check failure on line 816 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

unknown field DisableSshCaHost in struct literal of type linkedca.GCPProvisioner

Check failure on line 816 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

unknown field DisableSshCaHost in struct literal of type linkedca.GCPProvisioner

Check failure on line 816 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

unknown field DisableSshCaHost in struct literal of type linkedca.GCPProvisioner

Check failure on line 816 in command/ca/provisioner/add.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

unknown field DisableSshCaHost in struct literal of type linkedca.GCPProvisioner
InstanceAge: d,
},
},
Expand Down
9 changes: 9 additions & 0 deletions command/ca/provisioner/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ IID (AWS/GCP/Azure)
[**--azure-audience**=<name>] [**--azure-subscription-id**=<id>]
[**--azure-object-id**=<id>] [**--instance-age**=<duration>]
[**--disable-custom-sans**] [**--disable-trust-on-first-use**]
[**--disable-ssh-ca-user**] [**--disable-ssh-ca-host**]
[**--admin-cert**=<file>] [**--admin-key**=<file>]
[**--admin-subject**=<subject>] [**--admin-provisioner**=<name>] [**--admin-password-file**=<file>]
[**--ca-url**=<uri>] [**--root**=<file>] [**--context**=<name>] [**--ca-config**=<file>]
Expand Down Expand Up @@ -914,6 +915,14 @@ func updateGCPDetails(ctx *cli.Context, p *linkedca.Provisioner) error {
if ctx.IsSet("disable-trust-on-first-use") {
details.DisableTrustOnFirstUse = ctx.Bool("disable-trust-on-first-use")
}
if ctx.IsSet("disable-ssh-ca-user") {
boolVal := ctx.Bool("disable-ssh-ca-user")
details.DisableSshCaUser = &boolVal

Check failure on line 920 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / govulncheck / govulncheck

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 920 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 920 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 920 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / build / build (oldstable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 920 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 920 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 920 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 920 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)
}
if ctx.IsSet("disable-ssh-ca-host") {
boolVal := ctx.Bool("disable-ssh-ca-host")
details.DisableSshCaHost = &boolVal

Check failure on line 924 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / govulncheck / govulncheck

details.DisableSshCaHost undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaHost)

Check failure on line 924 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

details.DisableSshCaHost undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaHost) (typecheck)

Check failure on line 924 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

details.DisableSshCaHost undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaHost)) (typecheck)

Check failure on line 924 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / build / build (oldstable)

details.DisableSshCaHost undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaHost)

Check failure on line 924 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

details.DisableSshCaHost undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaHost)

Check failure on line 924 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

details.DisableSshCaHost undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaHost)

Check failure on line 924 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

details.DisableSshCaHost undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaHost)

Check failure on line 924 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

details.DisableSshCaHost undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaHost)
}
if ctx.IsSet("remove-gcp-service-account") {
details.ServiceAccounts = removeElements(details.ServiceAccounts, ctx.StringSlice("remove-gcp-service-account"))
}
Expand Down

0 comments on commit dfb4907

Please sign in to comment.